diff options
author | Ian Lynagh <igloo@earth.li> | 2011-08-03 00:49:10 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2011-08-03 00:49:10 +0100 |
commit | 6d934cce1d4ccbcc8abf7985b66d36d4386808db (patch) | |
tree | 4f73a7b53fd478f70f2bad0fbe7ea712d24c9bdf | |
parent | a01e195400b0495d8971f0ebe1c246286b764aac (diff) | |
download | haskell-6d934cce1d4ccbcc8abf7985b66d36d4386808db.tar.gz |
Refactor configure.ac's: Put XCODE_VERSION() in aclocal.m4
-rw-r--r-- | aclocal.m4 | 26 | ||||
-rw-r--r-- | configure.ac | 21 | ||||
-rw-r--r-- | 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 -------------------------------------------------------------- |