[commit: ghc] ghc-7.2: On OS X, use gcc-4.2 with Xcode 4 and up (4edb76c)
Ian Lynagh
igloo at earth.li
Wed Aug 3 16:58:45 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : ghc-7.2
http://hackage.haskell.org/trac/ghc/changeset/4edb76cb4460d85cde507d596ea02ab4a5b1abf5
>---------------------------------------------------------------
commit 4edb76cb4460d85cde507d596ea02ab4a5b1abf5
Author: Manuel M T Chakravarty <chak at cse.unsw.edu.au>
Date: Wed Jul 27 14:59:22 2011 +1000
On OS X, use gcc-4.2 with Xcode 4 and up
>---------------------------------------------------------------
configure.ac | 46 +++++++++++++++++++++++++++-------------------
1 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/configure.ac b/configure.ac
index dffae5c..32a425e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -403,25 +403,6 @@ then
fi
fi
-dnl ** Which gcc to use?
-dnl --------------------------------------------------------------
-FP_ARG_WITH_PATH_GNU_PROG([CC], [gcc])
-export CC
-WhatGccIsCalled="$CC"
-AC_SUBST(WhatGccIsCalled)
-
-dnl ** Which ld to use?
-dnl --------------------------------------------------------------
-FP_ARG_WITH_PATH_GNU_PROG([LD], [ld])
-LdCmd="$LD"
-AC_SUBST([LdCmd])
-
-dnl ** Which nm to use?
-dnl --------------------------------------------------------------
-FP_ARG_WITH_PATH_GNU_PROG([NM], [nm])
-NmCmd="$NM"
-AC_SUBST([NmCmd])
-
SplitObjsBroken=NO
if test "$TargetOS_CPP" = "darwin"
then
@@ -457,6 +438,33 @@ changequote([, ])dnl
fi
AC_SUBST([SplitObjsBroken])
+dnl ** Which gcc to use?
+dnl --------------------------------------------------------------
+if test "$TargetOS_CPP" = "darwin" &&
+ test "$XCodeVersion1" -ge 4
+then
+ # From Xcode 4, use 'gcc-4.2' to force the use of the gcc legacy backend (instead of the LLVM
+ # backend)
+ FP_ARG_WITH_PATH_GNU_PROG([CC], [gcc-4.2])
+else
+ FP_ARG_WITH_PATH_GNU_PROG([CC], [gcc])
+fi
+export CC
+WhatGccIsCalled="$CC"
+AC_SUBST(WhatGccIsCalled)
+
+dnl ** Which ld to use?
+dnl --------------------------------------------------------------
+FP_ARG_WITH_PATH_GNU_PROG([LD], [ld])
+LdCmd="$LD"
+AC_SUBST([LdCmd])
+
+dnl ** Which nm to use?
+dnl --------------------------------------------------------------
+FP_ARG_WITH_PATH_GNU_PROG([NM], [nm])
+NmCmd="$NM"
+AC_SUBST([NmCmd])
+
dnl ** Mac OS X: explicit deployment target
dnl --------------------------------------------------------------
AC_ARG_WITH([macosx-deployment-target],
More information about the Cvs-ghc
mailing list