summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>2013-09-04 15:29:03 +1000
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>2013-09-04 15:29:03 +1000
commitfc4856f9e811d9a23ae9212f43a09ddf5ef12b26 (patch)
treebe25695f2b816016314e912f512a40d5cdf43c22 /aclocal.m4
parent62d3fdeb9edfcfdeb661a6b8551ac2fc45b8595c (diff)
downloadhaskell-fc4856f9e811d9a23ae9212f43a09ddf5ef12b26.tar.gz
Make validate play nice with clang (for Xcode 5 command line tools)
* This partially fixes #8148. However, --with-ghc-4.8 will still not work given the rather dubious m4 macros and the failures in the test suite due to '-nodefaultlibs' still need to be fixed.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m414
1 files changed, 13 insertions, 1 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 7e555446a1..151cc2ea2c 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1184,6 +1184,7 @@ AC_SUBST(GccLT46)
dnl Check to see if the C compiler is clang or llvm-gcc
dnl
+GccIsClang=NO
AC_DEFUN([FP_CC_LLVM_BACKEND],
[AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING([whether C compiler is clang])
@@ -1191,6 +1192,7 @@ $CC -x c /dev/null -dM -E > conftest.txt 2>&1
if grep "__clang__" conftest.txt >/dev/null 2>&1; then
AC_SUBST([CC_CLANG_BACKEND], [1])
AC_SUBST([CC_LLVM_BACKEND], [1])
+ GccIsClang=YES
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
@@ -1205,6 +1207,7 @@ else
AC_MSG_RESULT([no])
fi
fi
+AC_SUBST(GccIsClang)
rm -f conftest.txt
])
@@ -2049,7 +2052,16 @@ AC_DEFUN([FIND_GCC],[
then
$1="$CC"
else
- FP_ARG_WITH_PATH_GNU_PROG([$1], [$2], [$3])
+ FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL([$1], [$2], [$3])
+ # From Xcode 5 on, OS X command line tools do not include gcc anymore. Use clang.
+ if test -z "$$1"
+ then
+ FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL([$1], [clang], [clang])
+ fi
+ if test -z "$$1"
+ then
+ AC_MSG_ERROR([cannot find $3 nor clang in your PATH])
+ fi
fi
AC_SUBST($1)
])