Commit a8013a7e authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Improve the XCode version detection

Amongst other improvements, we now handle 3-component versions
(like "3.1.4") correctly.
parent a630bb5e
...@@ -421,22 +421,29 @@ AC_SUBST([NmCmd]) ...@@ -421,22 +421,29 @@ AC_SUBST([NmCmd])
SplitObjsBroken=NO SplitObjsBroken=NO
if test "$TargetOS_CPP" = "darwin" if test "$TargetOS_CPP" = "darwin"
then then
AC_MSG_CHECKING(XCode version)
XCodeVersion=`xcodebuild -version | grep Xcode | sed "s/Xcode //"` XCodeVersion=`xcodebuild -version | grep Xcode | sed "s/Xcode //"`
XCodeVersion1=`echo "$XCodeVersion" | sed 's/\..*//'`
XCodeVersion2=`echo "$XCodeVersion" | sed 's/.*\.//'`
# Old XCode versions don't actually give the XCode version # Old XCode versions don't actually give the XCode version
if test "$XCodeVersion" = "" if test "$XCodeVersion" = ""
then then
AC_MSG_RESULT(not found (too old?))
SplitObjsBroken=YES SplitObjsBroken=YES
fi else
# Split objects is broken (#4013) with XCode < 3.2 AC_MSG_RESULT($XCodeVersion)
if test "$XCodeVersion1" -lt 3 XCodeVersion1=`echo "$XCodeVersion" | sed 's/\..*//'`
then changequote(, )dnl
SplitObjsBroken=YES XCodeVersion2=`echo "$XCodeVersion" | sed 's/[^.]*\.\([^.]*\).*/\1/'`
fi changequote([, ])dnl
if test "$XCodeVersion1" -eq 3 && test "$XCodeVersion2" -lt 2 AC_MSG_NOTICE(XCode version component 1: $XCodeVersion1)
then AC_MSG_NOTICE(XCode version component 2: $XCodeVersion2)
SplitObjsBroken=YES # Split objects is broken (#4013) with XCode < 3.2
if test "$XCodeVersion1" -lt 3
then
SplitObjsBroken=YES
elif test "$XCodeVersion1" -eq 3 && test "$XCodeVersion2" -lt 2
then
SplitObjsBroken=YES
fi
fi fi
fi fi
AC_SUBST([SplitObjsBroken]) AC_SUBST([SplitObjsBroken])
......
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