summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-09-13 17:05:37 +0200
committerMichael Stahl <mstahl@redhat.com>2013-09-13 17:09:10 +0200
commit191cf11529ddd0efa3862aac309501b0ef9b9765 (patch)
tree6b290ded80068432ec4977b361451061ad366c06
parent6fc6494aa9fea0b47fbf048998d7bd412ef478b1 (diff)
configure: find MacOSX SDKs in /Applications/Xcode.app/Contents/Developer
... and also export DEVELOPER_DIR so that xcrun returns CC and CXX values that match each other and the found SDK too, which was not previously the case on oddly set up machines with multiple SDKs. Change-Id: Iaed362b369b558b706926f1d15d170db580a4724
-rw-r--r--configure.ac26
1 files changed, 23 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index b23cc0e2a056..d5bc0b033054 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2539,6 +2539,14 @@ if test $_os = Darwin; then
with_macosx_sdk=10.6
elif test -d /Developer/SDKs/MacOSX10.7.sdk; then
with_macosx_sdk=10.7
+ elif test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk"; then
+ with_macosx_sdk=10.6
+ elif test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"; then
+ with_macosx_sdk=10.7
+ elif test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk"; then
+ with_macosx_sdk=10.8
+ elif test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk"; then
+ with_macosx_sdk=10.9
elif test -x /usr/bin/xcode-select; then
xcodepath="`xcode-select -print-path`"
if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk"; then
@@ -2587,6 +2595,8 @@ if test $_os = Darwin; then
MACOSX_SDK_PATH=/Developer-old/SDKs/MacOSX10.6.sdk
elif test -d /Xcode3/SDKs/MacOSX10.6.sdk; then
MACOSX_SDK_PATH=/Xcode3/SDKs/MacOSX10.6.sdk
+ elif test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$with_macosx_sdk.sdk"; then
+ MACOSX_SDK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$with_macosx_sdk.sdk
elif test -x /usr/bin/xcode-select; then
xcodepath="`xcode-select -print-path`"
if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then
@@ -2597,6 +2607,8 @@ if test $_os = Darwin; then
10.7)
if test -d /Developer/SDKs/MacOSX$with_macosx_sdk.sdk; then
MACOSX_SDK_PATH=/Developer/SDKs/MacOSX$with_macosx_sdk.sdk
+ elif test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$with_macosx_sdk.sdk"; then
+ MACOSX_SDK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$with_macosx_sdk.sdk
elif test -x /usr/bin/xcode-select; then
xcodepath="`xcode-select -print-path`"
if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then
@@ -2605,9 +2617,13 @@ if test $_os = Darwin; then
fi
;;
10.8|10.9)
- xcodepath="`xcode-select -print-path`"
- if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then
- MACOSX_SDK_PATH="$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"
+ if test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$with_macosx_sdk.sdk"; then
+ MACOSX_SDK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$with_macosx_sdk.sdk
+ else
+ xcodepath="`xcode-select -print-path`"
+ if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then
+ MACOSX_SDK_PATH="$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"
+ fi
fi
;;
esac
@@ -2625,6 +2641,10 @@ if test $_os = Darwin; then
with_macosx_version_max_allowed="$with_macosx_sdk"
fi
+ # export this so that "xcrun" invocations later return matching values
+ DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
+ DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
+ export DEVELOPER_DIR
FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"