summaryrefslogtreecommitdiff
path: root/m4/xcode_version.m4
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-04-02 11:52:47 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-05 05:42:38 -0400
commit7ffbdc3fa603c6411249ba9b758cf8f109c5fb30 (patch)
tree8a05d6e03ce2790e6e59651c824e569fee088d33 /m4/xcode_version.m4
parent6acadb79afe685c635fd255f90551a0fbfcbe3dc (diff)
downloadhaskell-7ffbdc3fa603c6411249ba9b758cf8f109c5fb30.tar.gz
Break up aclocal.m4
Diffstat (limited to 'm4/xcode_version.m4')
-rw-r--r--m4/xcode_version.m425
1 files changed, 25 insertions, 0 deletions
diff --git a/m4/xcode_version.m4 b/m4/xcode_version.m4
new file mode 100644
index 0000000000..e59604d6b8
--- /dev/null
+++ b/m4/xcode_version.m4
@@ -0,0 +1,25 @@
+# XCODE_VERSION()
+# --------------------------------
+# Gets the version number of Xcode, if on a Mac
+AC_DEFUN([XCODE_VERSION],[
+ if test "$TargetVendor_CPP" = "apple"
+ then
+ AC_MSG_CHECKING(Xcode version)
+ XcodeVersion=`(xcode-select -p >& /dev/null && 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
+])