Commit f7bd37ed authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

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
parent 3b669606
......@@ -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
])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment