Commit 6d934cce authored by Ian Lynagh's avatar Ian Lynagh

Refactor configure.ac's: Put XCODE_VERSION() in aclocal.m4

parent a01e1954
......@@ -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
......@@ -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"
......
......@@ -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 --------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment