On OS X, use gcc-4.2 with Xcode 4 and up
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>
Wed, 27 Jul 2011 04:59:22 +0000 (14:59 +1000)
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>
Wed, 27 Jul 2011 04:59:22 +0000 (14:59 +1000)
configure.ac

index 2ab11c9..74c190b 100644 (file)
@@ -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],