summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnout Vandecappelle <arnout@mind.be>2016-10-15 23:14:11 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-10-16 13:12:29 +0200
commit1ae8d415e60fec75997b9d9a533ab5103d4d93d0 (patch)
tree9724ce8afd909a8d7392bfe0cac3457c3aea15c4
parent70f76e05b90e39a92b95393c2e8ad6aeb3ed2ad6 (diff)
downloadbuildroot-1ae8d415e60fec75997b9d9a533ab5103d4d93d0.tar.gz
buildroot-1ae8d415e60fec75997b9d9a533ab5103d4d93d0.zip
gzip: force shell shebang to /bin/sh
gzip's configure uses $SHELL to find a POSIX-compliant shell to put in the shebang of its shell scripts (zcat, gzexe, ...). However, we set $SHELL to /bin/bash in the Makefile, which may not be present on the target. We do make sure that /bin/sh always points to a valid shell on the target so we can use that. The configure discovery is completely broken for cross-compilation. The same $SHELL is used during the build (it is used by make to run the commands in rules) and on the target. Also, the checks for a valid shell use the host shell, not the target shell. We could try to patch gzip to fix that, but the checks can anyway not be run for the target shell, so we'll have to override it with a cache value anyway. So we can just as well do exactly that, without patching. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Reported-by: Pascal Speck <kernel@iktek.de> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--package/gzip/gzip.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/package/gzip/gzip.mk b/package/gzip/gzip.mk
index 6dc910ec15..c4e91b07cc 100644
--- a/package/gzip/gzip.mk
+++ b/package/gzip/gzip.mk
@@ -14,5 +14,12 @@ GZIP_DEPENDENCIES = $(if $(BR2_PACKAGE_BUSYBOX),busybox)
GZIP_LICENSE = GPLv3+
GZIP_LICENSE_FILES = COPYING
GZIP_CONF_ENV += gl_cv_func_fflush_stdin=yes
+# configure substitutes $(SHELL) for the shell shebang in scripts like
+# gzexe. Unfortunately, the same $(SHELL) variable will also be used by
+# make to run its commands. Fortunately, /bin/sh is always a POSIX shell
+# on both the target and host systems that we support. Even with this,
+# the configure check is slightly broken and prints a bogus warning:
+# "using /bin/sh, even though it may have file descriptor bugs"
+GZIP_CONF_ENV += ac_cv_path_shell=/bin/sh
$(eval $(autotools-package))
OpenPOWER on IntegriCloud