Skip to contentSkip to conversation

flex: fix m4 issue on target

PATCH Superseded Laurentiu Palcu 2 participants 4 messages Nov 5, 2013 – Nov 6, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover flex: fix m4 issue on target

The following changes since commit 57498cede4696526c121e0112b5dea3e6e8365ac:

bitbake: toaster: fix target package information (2013-11-05 12:50:44 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib lpalcu/b5329_flex_issue_target
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=lpalcu/b5329_flex_issue_target

Laurentiu Palcu (1):
flex: fix m4 issue on target

 meta/recipes-devtools/flex/flex.inc |    7 +++++++
 1 file changed, 7 insertions(+)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 flex: fix m4 issue on target

Flex needs m4 to run (see below) and, since the create_wrapper introduces a bash dependency, export the right m4 path when /etc/profile is sourced by the shell.

Snippet from the flex documentation:
"The macro processor m4 must be installed wherever flex is installed. <...>
m4 is only required at the time you run flex."

[YOCTO #5329]

---
 meta/recipes-devtools/flex/flex.inc |    7 +++++++
 1 file changed, 7 insertions(+)
meta/recipes-devtools/flex/flex.inc +7 -0
index 43f1dda..eed2908 100644
@@ -13,6 +13,11 @@ inherit autotools gettext
 M4 = "${bindir}/m4"
 M4_class-native = "${STAGING_BINDIR_NATIVE}/m4"
 
+do_install_append_class-target() {
+	install -d ${D}${sysconfdir}/profile.d
+	echo "export M4=${M4}" > ${D}${sysconfdir}/profile.d/flex.sh
+}
+
 do_install_append_class-native() {
 	create_wrapper ${D}/${bindir}/flex M4=${M4}
 }
@@ -20,3 +25,5 @@ do_install_append_class-native() {
 do_install_append_class-nativesdk() {
 	create_wrapper ${D}/${bindir}/flex M4=${M4}
 }
+
+RDEPENDS_${PN} += "m4"
Signature · 1 line
1.7.9.5
#2 lore raw

Laurentiu Palcu

Quoted 8 lines · <[email protected]> writes:

Flex needs m4 to run (see below) and, since the create_wrapper introduces a bash dependency, export the right m4 path when /etc/profile is sourced by the shell.

Snippet from the flex documentation:
"The macro processor m4 must be installed wherever flex is installed. <...>
m4 is only required at the time you run flex."

Content at profile.d/ won't be evaluated when program is started without a shell (e.g. by 'execlp("flex", "flex", ...)').

Quoted 1 line

[YOCTO #5329]

This should be solved by defining a correct path for the m4 binary at build time.

EXTRA_OECONF += " ac_cv_path_M4=${M4}"
EXTRA_OEMAKE += " m4=${M4_class-native}"

is probably a better solution.

Enrico

#3 lore raw

Hi Enrico,

Quoted 18 lines · Enrico Scholz

Laurentiu Palcu

Quoted 8 lines · <[email protected]> writes:

Flex needs m4 to run (see below) and, since the create_wrapper introduces a bash dependency, export the right m4 path when /etc/profile is sourced by the shell.

Snippet from the flex documentation:
"The macro processor m4 must be installed wherever flex is installed. <...>
m4 is only required at the time you run flex."

Content at profile.d/ won't be evaluated when program is started without a shell (e.g. by 'execlp("flex", "flex", ...)').

Quoted 7 lines
Quoted 1 line

[YOCTO #5329]

This should be solved by defining a correct path for the m4 binary at build time.

EXTRA_OECONF += " ac_cv_path_M4=${M4}"
EXTRA_OEMAKE += " m4=${M4_class-native}"

This is, indeed, a better solution for the target issue. But, I don't think we can remove the wrapper scripts for native/nativesdk packages (as you suggested in bugzilla). And the reason for that are those guys using sstate from build machines. They'll end up with flex searching for m4 in a path belonging to the build machine.

I'll prepare a v2.

Laurentiu

Quoted 7 lines

is probably a better solution.

Enrico