diff options
-rw-r--r-- | aclocal.m4 | 18 | ||||
-rw-r--r-- | configure.ac | 13 | ||||
-rw-r--r-- | distrib/configure.ac.in | 13 |
3 files changed, 20 insertions, 24 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index dc9479117a..d798eb5063 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1607,4 +1607,22 @@ AC_DEFUN([XCODE_VERSION],[ fi ]) +# FIND_GCC() +# -------------------------------- +# Finds where gcc is +AC_DEFUN([FIND_GCC],[ + 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) +]) + # LocalWords: fi diff --git a/configure.ac b/configure.ac index 2045a15aee..29185d3ca3 100644 --- a/configure.ac +++ b/configure.ac @@ -426,18 +426,7 @@ 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) +FIND_GCC() dnl ** Which ld to use? dnl -------------------------------------------------------------- diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in index 72fb71258d..ce51c278f2 100644 --- a/distrib/configure.ac.in +++ b/distrib/configure.ac.in @@ -51,18 +51,7 @@ XCODE_VERSION() 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) +FIND_GCC() FP_GCC_VERSION AC_PROG_CPP |