diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2015-12-20 21:29:51 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2015-12-20 21:33:25 +0100 |
commit | f7bd37ed6fc84a9d5d69850a83a983248729968a (patch) | |
tree | 86a4e422474ced2f706c0e7b53f8381ce9cd055d /aclocal.m4 | |
parent | 3b669606914b2c712c4f0cb86de695cfbf2decfc (diff) | |
download | haskell-f7bd37ed6fc84a9d5d69850a83a983248729968a.tar.gz |
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
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index e50d008b5b..45c94f784b 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 ]) |