From 98db1cefbbc78ecc3b3e4b8de70b383704dc699a Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 23 Aug 2013 23:57:09 +0000 Subject: 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 --- configure.ac | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'configure.ac') 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 ;; *) -- cgit v1.2.3