[m-rev.] diff: avoid the use of llvm-gcc on Mac OS X

Julien Fischer jfischer at opturion.com
Fri Jan 11 11:52:53 AEDT 2013


Avoid using llvm-gcc on Mac OS X.

The llvm-gcc on recent versions of Mac OS X is broken and cannot compile
Mercury.  This is inconvenient since the executable named `gcc' on these
versions of Mac OS X is llvm-gcc, not real gcc.

configure.ac:
     On Mac OS X, if we appear to be using llcm-gcc emit an error message.

Julien.

diff --git a/configure.ac b/configure.ac
index 6eb9ed0..9340b40 100644
--- a/configure.ac
+++ b/configure.ac
@@ -247,6 +247,28 @@ AC_SUBST(BUILD_C_PROGS_FOR_BUILD_SYSTEM)

 #-----------------------------------------------------------------------------#

+# Check that we are not using the llvm-gcc on Mac OS X since it is too broken
+# to successfully compile Mercury.
+
+if test "$MERCURY_HAVE_GCC" = yes
+then
+    case "$host" in
+        *apple*darwin*)
+            if $CC -v 2>&1 | grep -q "gcc.*Apple.*LLVM"
+            then
+                AC_MSG_ERROR(
+[
+**** The executable `$CC' on this system appears to be llvm-gcc.
+**** It contains bugs that means it cannot be used to compile Mercury.
+**** See README.MacOS for further details.])
+            exit 1
+            fi
+        ;;
+    esac
+fi
+
+#-----------------------------------------------------------------------------#
+
 # Using `cygpath -m' gives a path that works under both Cygwin and native
 # Windows, without causing quoting problems in shell scripts.
 # (`cygpath -m' converts the path to Windows format, with '/' as the directory



More information about the reviews mailing list