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

16
configure vendored
View file

@ -509,7 +509,15 @@ Some influential environment variables:
((equal? '( "gnu") kernel-list) "gnu") ((equal? '( "gnu") kernel-list) "gnu")
(else "unknown"))) (else "unknown")))
(compiler (if gcc? "gcc" "mescc")) (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 (define* (substitute file-name pairs
#:key (target (if (string-suffix? ".in" file-name) #: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")) ("@V@" . ,(if disable-silent-rules? "1" "0"))
("@AR@" . ,(or (file-name "ar" deps) "")) ("@AR@" . ,(or (file-name "ar" deps) ""))
("@BASH@" . ,(or (file-name "bash" deps) "")) ("@BASH@" . ,bash)
("@CC@" . ,(or (file-name "cc" deps) "")) ("@CC@" . ,(or (file-name "cc" deps) ""))
("@DIFF@" . ,(or (file-name "diff" deps) (string-append abs-top-builddir "/pre-inst-env diff.scm"))) ("@DIFF@" . ,(or (file-name "diff" deps) (string-append abs-top-builddir "/pre-inst-env diff.scm")))
("@DOT@" . ,(or (file-name "dot" deps) "")) ("@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) "")) ("@PERL@" . ,(or (file-name "perl" deps) ""))
("#SCHEME=\"@SCHEME@\"" . ,(if with-cheating? (string-append "\nSCHEME=\"" guile "\"") "")) ("#SCHEME=\"@SCHEME@\"" . ,(if with-cheating? (string-append "\nSCHEME=\"" guile "\"") ""))
("@SCHEME@" . ,(if with-cheating? guile "")) ("@SCHEME@" . ,(if with-cheating? guile ""))
("@SHELL@" . ,(or (file-name "bash" deps) ("@SHELL@" . ,shell)
(file-name "sh" deps)
"sh"))
("@CFLAGS@" . ,(or (getenv "CFLAGS") "")) ("@CFLAGS@" . ,(or (getenv "CFLAGS") ""))
("@HEX2FLAGS@" . ,(or (getenv "HEX2FLAGS") "")) ("@HEX2FLAGS@" . ,(or (getenv "HEX2FLAGS") ""))