diff options
author | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2018-11-29 12:28:23 +0000 |
---|---|---|
committer | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2018-11-29 12:28:23 +0000 |
commit | 6a24c58cf13129766b64eca8bbdec678e68b6d4e (patch) | |
tree | 59b06d24c55cfda77a2bbf0f89e520d90bc79914 /reproduce | |
parent | c2d4bd4226770da03c4796c7de77bee28ec79319 (diff) |
Using proper shell when building programs with GNU tools
Previously the SHELL environment variable was only set in `./configure',
`make', and `make install' after our internal Bash was installed. This
caused problems with Lzip's configure script on older shells (tested on a
Mac OS by Raul Infante Sainz).
So now, before having our own Bash, we set it to a possibly existing Bash
on the system and if that isn't present, just the standard `/bin/sh'.
Diffstat (limited to 'reproduce')
-rw-r--r-- | reproduce/src/make/dependencies-build-rules.mk | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/reproduce/src/make/dependencies-build-rules.mk b/reproduce/src/make/dependencies-build-rules.mk index 9ff3463..eafa29c 100644 --- a/reproduce/src/make/dependencies-build-rules.mk +++ b/reproduce/src/make/dependencies-build-rules.mk @@ -53,7 +53,10 @@ gbuild = if [ x$(static_build) = xyes ] && [ $(3)x = staticx ]; then \ fi; \ check="$(6)"; \ if [ x"$$check" = x ]; then check="echo Skipping-check"; fi; \ - if [ -f $(ibdir)/bash ]; then shellop="SHELL=$(ibdir)/bash"; fi; \ + if [ -f $(ibdir)/bash ]; then shellop="SHELL=$(ibdir)/bash"; \ + elif [ -f /bin/bash ]; then shellop="SHELL=/bin/bash"; \ + else shellop="SHELL=/bin/sh"; \ + fi; \ cd $(ddir) && rm -rf $(2) && tar xf $(1) && cd $(2) && \ ./configure $(4) "$$shellop" --prefix=$(idir) && \ make "$$shellop" $(5) && \ @@ -67,11 +70,15 @@ gbuild = if [ x$(static_build) = xyes ] && [ $(3)x = staticx ]; then \ # CMake # ----- +# +# According to the link below, in CMake `/bin/sh' is hardcoded, so there is +# no way to change it. +# +# https://stackoverflow.com/questions/21167014/how-to-set-shell-variable-in-makefiles-generated-by-cmake cbuild = if [ x$(static_build) = xyes ] && [ $(3)x = staticx ]; then \ export LDFLAGS="$$LDFLAGS -static"; \ opts="-DBUILD_SHARED_LIBS=OFF"; \ fi; \ - export SHELL=$(ibdir)/bash; \ cd $(ddir) && rm -rf $(2) && tar xf $(1) && cd $(2) && \ rm -rf pipeline-build && mkdir pipeline-build && \ cd pipeline-build && \ |