Kaydet (Commit) 191cf115 authored tarafından Michael Stahl's avatar Michael Stahl

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
üst 6fc6494a
...@@ -2539,6 +2539,14 @@ if test $_os = Darwin; then ...@@ -2539,6 +2539,14 @@ if test $_os = Darwin; then
with_macosx_sdk=10.6 with_macosx_sdk=10.6
elif test -d /Developer/SDKs/MacOSX10.7.sdk; then elif test -d /Developer/SDKs/MacOSX10.7.sdk; then
with_macosx_sdk=10.7 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 elif test -x /usr/bin/xcode-select; then
xcodepath="`xcode-select -print-path`" xcodepath="`xcode-select -print-path`"
if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk"; then if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk"; then
...@@ -2587,6 +2595,8 @@ if test $_os = Darwin; then ...@@ -2587,6 +2595,8 @@ if test $_os = Darwin; then
MACOSX_SDK_PATH=/Developer-old/SDKs/MacOSX10.6.sdk MACOSX_SDK_PATH=/Developer-old/SDKs/MacOSX10.6.sdk
elif test -d /Xcode3/SDKs/MacOSX10.6.sdk; then elif test -d /Xcode3/SDKs/MacOSX10.6.sdk; then
MACOSX_SDK_PATH=/Xcode3/SDKs/MacOSX10.6.sdk 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 elif test -x /usr/bin/xcode-select; then
xcodepath="`xcode-select -print-path`" xcodepath="`xcode-select -print-path`"
if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then
...@@ -2597,6 +2607,8 @@ if test $_os = Darwin; then ...@@ -2597,6 +2607,8 @@ if test $_os = Darwin; then
10.7) 10.7)
if test -d /Developer/SDKs/MacOSX$with_macosx_sdk.sdk; then if test -d /Developer/SDKs/MacOSX$with_macosx_sdk.sdk; then
MACOSX_SDK_PATH=/Developer/SDKs/MacOSX$with_macosx_sdk.sdk 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 elif test -x /usr/bin/xcode-select; then
xcodepath="`xcode-select -print-path`" xcodepath="`xcode-select -print-path`"
if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then
...@@ -2605,9 +2617,13 @@ if test $_os = Darwin; then ...@@ -2605,9 +2617,13 @@ if test $_os = Darwin; then
fi fi
;; ;;
10.8|10.9) 10.8|10.9)
xcodepath="`xcode-select -print-path`" if test -d "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$with_macosx_sdk.sdk"; then
if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then MACOSX_SDK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/$with_macosx_sdk.sdk
MACOSX_SDK_PATH="$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$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 fi
;; ;;
esac esac
...@@ -2625,6 +2641,10 @@ if test $_os = Darwin; then ...@@ -2625,6 +2641,10 @@ if test $_os = Darwin; then
with_macosx_version_max_allowed="$with_macosx_sdk" with_macosx_version_max_allowed="$with_macosx_sdk"
fi 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" FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required" MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
......
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