From 11798d4272002a00d7e07112caf0757e2043afd1 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 9 Nov 2019 10:59:01 +0100 Subject: [PATCH] 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. --- configure | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/configure b/configure index e0950c1b..d12170c0 100755 --- a/configure +++ b/configure @@ -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") ""))