build: Prefer /bin/bash if available. Thanks, Vagrant!

Ensure the configure script uses /bin/bash, otherwise on systems with
/bin -> /usr/bin it results in /bin/bash being embedded in various
scripts.

Inspired by

    https://salsa.debian.org/debian/mes/blob/debian/master/debian/patches/force-use-of-bin-bash

* configure: Prefer /bin/bash, /bin/sh if available.  Helps
reproducibility on Debian.
This commit is contained in:
Jan Nieuwenhuizen 2019-11-09 10:59:01 +01:00
parent c6cceb47f3
commit 11798d4272
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 11 additions and 5 deletions

16
configure vendored
View File

@ -509,7 +509,15 @@ Some influential environment variables:
((equal? '( "gnu") kernel-list) "gnu")
(else "unknown")))
(compiler (if gcc? "gcc" "mescc"))
(mes-system (string-join (list mes-cpu mes-kernel "mes") "-")))
(mes-system (string-join (list mes-cpu mes-kernel "mes") "-"))
(bash (or (and (file-exists? "/bin/bash") "/bin/bash")
(file-name "bash" deps)
""))
(shell (or (and (file-exists? "/bin/bash") "/bin/bash")
(file-name "bash" deps)
(and (file-exists? "/bin/sh") "/bin/sh")
(file-name "sh" deps)
"sh")))
(define* (substitute file-name pairs
#:key (target (if (string-suffix? ".in" file-name)
@ -586,7 +594,7 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
("@V@" . ,(if disable-silent-rules? "1" "0"))
("@AR@" . ,(or (file-name "ar" deps) ""))
("@BASH@" . ,(or (file-name "bash" deps) ""))
("@BASH@" . ,bash)
("@CC@" . ,(or (file-name "cc" deps) ""))
("@DIFF@" . ,(or (file-name "diff" deps) (string-append abs-top-builddir "/pre-inst-env diff.scm")))
("@DOT@" . ,(or (file-name "dot" deps) ""))
@ -601,9 +609,7 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system)
("@PERL@" . ,(or (file-name "perl" deps) ""))
("#SCHEME=\"@SCHEME@\"" . ,(if with-cheating? (string-append "\nSCHEME=\"" guile "\"") ""))
("@SCHEME@" . ,(if with-cheating? guile ""))
("@SHELL@" . ,(or (file-name "bash" deps)
(file-name "sh" deps)
"sh"))
("@SHELL@" . ,shell)
("@CFLAGS@" . ,(or (getenv "CFLAGS") ""))
("@HEX2FLAGS@" . ,(or (getenv "HEX2FLAGS") ""))