[commit: ghc] master: aclocal.m4: Fix llc/opt detection code (f7bd37e)

git at git.haskell.org git at git.haskell.org
Sun Dec 20 20:32:42 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/f7bd37ed6fc84a9d5d69850a83a983248729968a/ghc

>---------------------------------------------------------------

commit f7bd37ed6fc84a9d5d69850a83a983248729968a
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sun Dec 20 21:29:51 2015 +0100

    aclocal.m4: Fix llc/opt detection code
    
    Currently if llc/opt is missing, we get
    
      checking for llc-3.7... no
      checking for llc... no
      checking  is version 3.7... ./configure[7417]: --version:  not found
      no
      checking for opt-3.7... no
      checking for opt... no
      checking  is version 3.7... ./configure[7664]: --version:  not found
      no
      checking for llc... no
      checking for opt... no
    
    With this fix, the version is queried iff `llc`/`opt` has been detected
    at all, thereby avoiding the disturbing `--version: not found` error
    output.
    
    Reviewed By: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1674


>---------------------------------------------------------------

f7bd37ed6fc84a9d5d69850a83a983248729968a
 aclocal.m4 | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index e50d008..45c94f7 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1975,15 +1975,17 @@ AC_DEFUN([XCODE_VERSION],[
 AC_DEFUN([FIND_LLVM_PROG],[
     # Test for program with version name.
     FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL_NOTARGET([$1], [$2], [$3-$4])
-    if test "$$1" = ""; then
+    if test -z "$$1"; then
         # Test for program without version name.
         FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL_NOTARGET([$1], [$2], [$3])
-        AC_MSG_CHECKING([$$1 is version $4])
-        if test `$$1 --version | grep -c "version $4"` -gt 0 ; then
-            AC_MSG_RESULT(yes)
-        else
-            AC_MSG_RESULT(no)
-            $1=""
+        if test -n "$$1"; then
+            AC_MSG_CHECKING([$$1 is version $4])
+            if test `$$1 --version | grep -c "version $4"` -gt 0 ; then
+                AC_MSG_RESULT(yes)
+            else
+                AC_MSG_RESULT(no)
+                $1=""
+            fi
         fi
     fi
 ])



More information about the ghc-commits mailing list