From 6d934cce1d4ccbcc8abf7985b66d36d4386808db Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Wed, 3 Aug 2011 00:49:10 +0100 Subject: Refactor configure.ac's: Put XCODE_VERSION() in aclocal.m4 --- aclocal.m4 | 26 ++++++++++++++++++++++++++ configure.ac | 21 +-------------------- distrib/configure.ac.in | 22 +--------------------- 3 files changed, 28 insertions(+), 41 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 680e0a8efe..dc9479117a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1581,4 +1581,30 @@ LIBRARY_[]translit([$1], [-], [_])[]_VERSION=`grep -i "^version:" libraries/${di AC_SUBST(LIBRARY_[]translit([$1], [-], [_])[]_VERSION) ]) +# XCODE_VERSION() +# -------------------------------- +# Gets the version number of XCode, if on a Mac +AC_DEFUN([XCODE_VERSION],[ + if test "$TargetOS_CPP" = "darwin" + then + AC_MSG_CHECKING(XCode version) + XCodeVersion=`xcodebuild -version | grep Xcode | sed "s/Xcode //"` + # Old XCode versions don't actually give the XCode version + if test "$XCodeVersion" = "" + then + AC_MSG_RESULT(not found (too old?)) + XCodeVersion1=0 + XCodeVersion2=0 + else + AC_MSG_RESULT($XCodeVersion) + XCodeVersion1=`echo "$XCodeVersion" | sed 's/\..*//'` + changequote(, )dnl + XCodeVersion2=`echo "$XCodeVersion" | sed 's/[^.]*\.\([^.]*\).*/\1/'` + changequote([, ])dnl + AC_MSG_NOTICE(XCode version component 1: $XCodeVersion1) + AC_MSG_NOTICE(XCode version component 2: $XCodeVersion2) + fi + fi +]) + # LocalWords: fi diff --git a/configure.ac b/configure.ac index ce9b5223cd..2045a15aee 100644 --- a/configure.ac +++ b/configure.ac @@ -403,26 +403,7 @@ then fi fi -if test "$TargetOS_CPP" = "darwin" -then - AC_MSG_CHECKING(XCode version) - XCodeVersion=`xcodebuild -version | grep Xcode | sed "s/Xcode //"` - # Old XCode versions don't actually give the XCode version - if test "$XCodeVersion" = "" - then - AC_MSG_RESULT(not found (too old?)) - XCodeVersion1=0 - XCodeVersion2=0 - else - AC_MSG_RESULT($XCodeVersion) - XCodeVersion1=`echo "$XCodeVersion" | sed 's/\..*//'` -changequote(, )dnl - XCodeVersion2=`echo "$XCodeVersion" | sed 's/[^.]*\.\([^.]*\).*/\1/'` -changequote([, ])dnl - AC_MSG_NOTICE(XCode version component 1: $XCodeVersion1) - AC_MSG_NOTICE(XCode version component 2: $XCodeVersion2) - fi -fi +XCODE_VERSION() SplitObjsBroken=NO if test "$TargetOS_CPP" = "darwin" diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in index a37800458b..72fb71258d 100644 --- a/distrib/configure.ac.in +++ b/distrib/configure.ac.in @@ -47,27 +47,7 @@ dnl ** Find the path to sed ** # AC_PATH_PROG(SedCmd,gsed sed,sed) -# -dnl ** How to invoke gcc/cpp ** -# -if test "$TargetOS_CPP" = "darwin" -then - AC_MSG_CHECKING(XCode version) - XCodeVersion=`xcodebuild -version | grep Xcode | sed "s/Xcode //"` - # Old XCode versions don't actually give the XCode version - if test "$XCodeVersion" = "" - then - AC_MSG_RESULT(not found (too old?)) - else - AC_MSG_RESULT($XCodeVersion) - XCodeVersion1=`echo "$XCodeVersion" | sed 's/\..*//'` -changequote(, )dnl - XCodeVersion2=`echo "$XCodeVersion" | sed 's/[^.]*\.\([^.]*\).*/\1/'` -changequote([, ])dnl - AC_MSG_NOTICE(XCode version component 1: $XCodeVersion1) - AC_MSG_NOTICE(XCode version component 2: $XCodeVersion2) - fi -fi +XCODE_VERSION() dnl ** Which gcc to use? dnl -------------------------------------------------------------- -- cgit v1.2.1