diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-06-04 15:06:46 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-06-04 15:06:46 -0700 |
commit | 2dc820fa7cbe09e944d7a9b407ecfa555237bfde (patch) | |
tree | 1a2ff2652fe0f3c38aebfa6d58ee7ef289e035fe /configure | |
parent | 848e5565a06fc206f159f6544fb8fba376381c30 (diff) | |
download | txr-2dc820fa7cbe09e944d7a9b407ecfa555237bfde.tar.gz txr-2dc820fa7cbe09e944d7a9b407ecfa555237bfde.tar.bz2 txr-2dc820fa7cbe09e944d7a9b407ecfa555237bfde.zip |
* configure: Defend against legacy, non-POSIX /bin/sh implementations.
We boostrap using #!/bin/sh, but try to detect a better shell
and re-execute the script with that shell. Furthermore, we now
set up the SHELL variable in config.make, so that make uses that
shell for executing build recipes.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -31,6 +31,20 @@ # in the arguments, oops. # +if test x$txr_shell = x ; then + for shell in /usr/xpg4/bin/sh /bin/bash /usr/bin/bash ; do + if test -e $shell ; then + txr_shell=$shell + fi + done + if test x$txr_shell = x ; then + echo "No known POSIX shell found: falling back on /bin/sh, which may not work" + txr_shell=/bin/sh + fi + export txr_shell + exec $txr_shell $0 ${@+"$@"} +fi + set -u cmdline= @@ -410,6 +424,8 @@ printf "+%s+\n|%s|\n+%s+\n" $banner_box "$banner_text" $banner_box set -e +printf "We are using this shell: %s\n" $txr_shell + # # Check for GNU make # @@ -539,6 +555,11 @@ gen_config_make() # Changes to this file are lost when the above is re-run. # +# Shell used by make for running recipes; this +# is the as the shell we chose for the configure script, +# derived from the txr_shell variable. +SHELL := $txr_shell + # absolute path to source code directory top_srcdir := $top_srcdir |