gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 592843e: Reporting the version of Bash if not


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 592843e: Reporting the version of Bash if not suitable for Libtool
Date: Tue, 29 Jan 2019 13:26:05 -0500 (EST)

branch: master
commit 592843e3602082f96506883dd942fee3b8311925
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    Reporting the version of Bash if not suitable for Libtool
    
    Very old versions of Bash fail with Libtool, but since many users expect
    Bash to work with it anyway, it can be confusing when the configure script
    just says that a proper shell couldn't be found. To help in debugging the
    problem, if the version of Bash isn't good for libtool, it will be reported
    (both as a new line during the tests and after it finishes).
    
    This was suggested by David Valls-Gabaud.
---
 configure.ac                 | 32 +++++++++++++++++++++-----------
 doc/announce-acknowledge.txt |  1 +
 2 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8fea1e7..9318393 100644
--- a/configure.ac
+++ b/configure.ac
@@ -420,16 +420,18 @@ AS_IF([test "x$has_gnulibtool" = "xyes"],
         echo "#include <stdio.h>"                                 > $cprog
         echo "int main(void){printf(\"success\\n\"); return 0;}" >> $cprog
         ltargs="--quiet --tag=CC --mode=link $CC $cprog -O3 -o $outname"
-        AS_IF( sh -c "$gnulibtool_exec $ltargs" > /dev/null 2>&1,
-               [libtool_shell="sh"],
-               [AS_IF([test "x$has_bash" = "xyes"],
-                      [AS_IF(bash -c "$gnulibtool_exec $ltargs" > /dev/null 
2>&1,
-                             [libtool_shell="bash"]) ],
-                      [AS_IF([test "x$has_zsh" = "xyes"],
-                             [AS_IF(zsh -c "$gnulibtool_exec $ltargs" > 
/dev/null 2>&1,
-                                    [libtool_shell="zsh"]) ])
-                       ] )
-               ] )
+
+        # Check the shells, starting with known shells and ultimately
+        # trying with `sh' (can be any shell).
+        AS_IF([test "x$has_bash" = "xyes"],
+              [AS_IF(bash -c "$gnulibtool_exec $ltargs" > /dev/null 2>&1,
+                     [libtool_shell="bash"],
+                     [bash_version=$BASH_VERSION]) ],
+              [AS_IF([test "x$has_zsh" = "xyes"],
+                     [AS_IF(zsh -c "$gnulibtool_exec $ltargs" > /dev/null 2>&1,
+                            [libtool_shell="zsh"]) ],
+                     [AS_IF(sh -c "$gnulibtool_exec $ltargs" > /dev/null 2>&1,
+                            [libtool_shell="sh"]) ]) ])
 
         # Clean up: note that no output might have been generated (when no
         # proper shell was found). Therefore, for deleting the output file,
@@ -443,7 +445,12 @@ AS_IF([test "x$has_gnulibtool" = "xyes"],
 # If a good shell to call Libtool could be found, then Libtool is usable
 # within a program (BuildProgram in this case).
 AS_IF([test "x$libtool_shell" = "xnone"],
-      [usable_libtool=no; anywarnings=yes],
+      [
+        anywarnings=yes;
+        usable_libtool=no;
+        AS_IF([test "x$bash_version" = x], [junk=1],
+              [echo "GNU Bash was found but not a suitable version: 
$bash_version"])
+      ],
       [
         usable_libtool=yes
         AC_DEFINE_UNQUOTED([GAL_CONFIG_GNULIBTOOL_SHELL], ["$libtool_shell"],
@@ -455,6 +462,7 @@ AS_IF([test "x$libtool_shell" = "xnone"],
 
 
 
+
 # Check Ghostscript: "-dPDFFitPage" option to Ghostscript, used by the
 # library to convert from EPS to PDF, has been introduced in Ghostscript
 # 9.10.  Make sure we have at least that version.
@@ -902,6 +910,8 @@ AS_IF([test x$enable_guide_message = xyes],
                AS_ECHO([])
                AS_IF([test "x$has_gnulibtool" = "xyes"],
                      [AS_ECHO(["    -- GNU Libtool is present, but couldn't be 
run in tested shells."])
+                      AS_IF([test "x$bash_version" = x], [junk=1],
+                            [echo "       (GNU Bash was found but not a 
suitable version: $bash_version)"])
                       AS_ECHO([])],
                      [AS_IF([test "x$has_libtool" = "xyes"],
                             [AS_ECHO(["    -- A libtool implementation was 
found, but it isn't GNU."])
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index d690df8..5669500 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -1,3 +1,4 @@
 Alphabetically ordered list to acknowledge in the next release.
 
 Raúl Infante Sainz
+David Valls-Gabaud



reply via email to

[Prev in Thread] Current Thread [Next in Thread]