Fix in-tree GMP build (#8497) on OS X Mavericks
authorKazu Yamamoto <kazu@iij.ad.jp>
Tue, 14 Jan 2014 04:06:03 +0000 (22:06 -0600)
committerAustin Seipp <austin@well-typed.com>
Tue, 14 Jan 2014 09:49:21 +0000 (03:49 -0600)
Signed-off-by: Austin Seipp <austin@well-typed.com>
gmp/ghc.mk

index 1ded050..a5d33ab 100644 (file)
@@ -103,6 +103,14 @@ endif
 
 libraries/integer-gmp_dist-install_EXTRA_CC_OPTS += $(gmp_CC_OPTS)
 
+CLANG = $(findstring clang, $(shell $(CC_STAGE1) --version))
+
+ifeq "$(CLANG)" "clang"
+CCX = $(CLANG)
+else
+CCX = $(CC_STAGE1)
+endif
+
 # 2007-09-26
 #     set -o igncr 
 # is not a valid command on non-Cygwin-systems.
@@ -138,7 +146,7 @@ libraries/integer-gmp/gmp/libgmp.a libraries/integer-gmp/gmp/gmp.h:
            PATH=`pwd`:$$PATH; \
            export PATH; \
            cd gmpbuild && \
-           CC=$(CC_STAGE1) NM=$(NM) AR=$(AR_STAGE1) $(SHELL) ./configure \
+           CC=$(CCX) NM=$(NM) AR=$(AR_STAGE1) $(SHELL) ./configure \
                  --enable-shared=no \
                  --host=$(HOSTPLATFORM) --build=$(BUILDPLATFORM)
        $(MAKE) -C libraries/integer-gmp/gmp/gmpbuild MAKEFLAGS=