[oe-commits] Richard Purdie : autoconf: Add fix for sh verses bash issues

git at git.openembedded.org git at git.openembedded.org
Tue Sep 24 16:11:44 UTC 2013


Module: openembedded-core.git
Branch: master
Commit: 367a19aaf31bcf997f10d045e7954cc800189052
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=367a19aaf31bcf997f10d045e7954cc800189052

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Mon Sep 23 16:20:40 2013 +0000

autoconf: Add fix for sh verses bash issues

Libtool scripts were finding bash was /bin/sh and then using bashisms which
then got into sstate and used on machines where /bin/sh might be dash.

This changes things to search for bash first since its preferred. We then hardcode
bash into the scripts which is more correct.

This does mean we have a dependency on bash but many of our scripts have
that anyway.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 .../autoconf/autoconf/preferbash.patch             |   23 ++++++++++++++++++++
 meta/recipes-devtools/autoconf/autoconf_2.69.bb    |    1 +
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/meta/recipes-devtools/autoconf/autoconf/preferbash.patch b/meta/recipes-devtools/autoconf/autoconf/preferbash.patch
new file mode 100644
index 0000000..41a623a
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf/preferbash.patch
@@ -0,0 +1,23 @@
+This value is used to determine CONFIG_SHELL and SHELL which may get exported into
+scripts shared via sstate onto other systems.
+
+Some systems have /bin/sh -> dash and others /bin/sh -> bash. Bash is preferred 
+but sometimes we can sometimes end up exporting /bin/sh yet use bashisms.
+
+This patch puts bash first in the search results which avoids the bash/dash confusion.
+
+RP 2012/9/23
+
+Index: autoconf-2.69/lib/m4sugar/m4sh.m4
+===================================================================
+--- autoconf-2.69.orig/lib/m4sugar/m4sh.m4	2012-03-07 17:35:26.000000000 +0000
++++ autoconf-2.69/lib/m4sugar/m4sh.m4	2013-09-23 16:12:38.853597515 +0000
+@@ -229,7 +229,7 @@
+     [_AS_PATH_WALK([/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH],
+       [case $as_dir in @%:@(
+ 	 /*)
+-	   for as_base in sh bash ksh sh5; do
++	   for as_base in bash sh ksh sh5; do
+ 	     # Try only shells that exist, to save several forks.
+ 	     as_shell=$as_dir/$as_base
+ 	     AS_IF([{ test -f "$as_shell" || test -f "$as_shell.exe"; } &&
diff --git a/meta/recipes-devtools/autoconf/autoconf_2.69.bb b/meta/recipes-devtools/autoconf/autoconf_2.69.bb
index 7512951..1522729 100644
--- a/meta/recipes-devtools/autoconf/autoconf_2.69.bb
+++ b/meta/recipes-devtools/autoconf/autoconf_2.69.bb
@@ -16,6 +16,7 @@ SRC_URI += "file://autoreconf-include.patch \
 	    ${@['file://path_prog_fixes.patch', ''][bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d)]} \
             file://config_site.patch \
             file://remove-usr-local-lib-from-m4.patch \
+            file://preferbash.patch \
            "
 
 SRC_URI[md5sum] = "82d05e03b93e45f5a39b828dc9c6c29b"



More information about the Openembedded-commits mailing list