summaryrefslogtreecommitdiffstats
path: root/package/bash/bash.mk
diff options
context:
space:
mode:
Diffstat (limited to 'package/bash/bash.mk')
-rw-r--r--package/bash/bash.mk11
1 files changed, 11 insertions, 0 deletions
diff --git a/package/bash/bash.mk b/package/bash/bash.mk
index 34a3a73956..5eec3cc603 100644
--- a/package/bash/bash.mk
+++ b/package/bash/bash.mk
@@ -28,6 +28,17 @@ BASH_MAKE = $(MAKE1)
# The static build needs some trickery
ifeq ($(BR2_PREFER_STATIC_LIB),y)
BASH_CONF_OPTS += --enable-static-link --without-bash-malloc
+# bash wants to redefine the getenv() function. To check whether this is
+# possible, AC_TRY_RUN is used which is not possible in
+# cross-compilation.
+# On uClibc, redefining getenv is not possible; on glibc and musl it is.
+# Related:
+# http://lists.gnu.org/archive/html/bug-bash/2012-03/msg00052.html
+ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
+BASH_CONF_ENV += bash_cv_getenv_redef=no
+else
+BASH_CONF_ENV += bash_cv_getenv_redef=yes
+endif
endif
# Make /bin/sh -> bash (no other shell, better than busybox shells)
OpenPOWER on IntegriCloud