aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-08-23 23:57:09 +0000
committerGuy Harris <guy@alum.mit.edu>2013-08-23 23:57:09 +0000
commit98db1cefbbc78ecc3b3e4b8de70b383704dc699a (patch)
treec0b03a46a1aa563a70815e72c44d82e3802370b5 /configure.ac
parent0675ed74943a53daae10ff641a71c28a4d87252f (diff)
To handle the hypothetical case of an OS X release offering a choice of
installing command-line developer tools with no SDKs but with a standard UN*Xy /usr/include or of installing Full Frontal Xcode, if the user didn't specify building against an SDK, check to see whether we *have* any SDKs and, if not, don't set the deployment target. svn path=/trunk/; revision=51501
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac25
1 files changed, 18 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 7b52c8cd85..419cb9c0f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -267,10 +267,11 @@ AC_ARG_ENABLE(osx-deploy-target,
# Let the user specify an OS X release to use as a
# deplayment target; if they specify that we should
# have a deployment target but don't specify the
- # deployment target, pick the OS version on which the
- # build is being done. This also causes the build to
- # be done against an SDK rather than against the headers
- # and libraries in /usr/include and /usr/lib.
+ # deployment target, then, if we have SDKs available,
+ # pick the OS version on which the build is being done.
+ # This also causes the build to be done against an SDK
+ # rather than against the headers and libraries in
+ # /usr/include and /usr/lib.
#
# Check for an OS X deployment target early, so that
# as many tests using the compiler are done using the
@@ -319,13 +320,23 @@ AC_ARG_ENABLE(osx-deploy-target,
#
# Yes.
#
- # Default to targeting the major version number of
- # the version of OS X on which we're running.
+ # If we have SDKs available, default to targeting the major
+ # version number of the version of OS X on which we're
+ # running.
#
# (We quote the command so that we can use autoconf's
# M4 quoting characters, [ and ], in the sed expression.)
#
- [deploy_target=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
+ for i in /Developer/SDKs \
+ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
+ /Library/Developer/CommandLineTools/SDKs
+ do
+ if [ -d "$i" ]
+ then
+ [deploy_target=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
+ break
+ fi
+ done
;;
*)