ref: a05bf133aef384c3d129f73edc04f810caaa8a15
parent: e68953b7c82396c5018d8d65b116a17050094151
author: John Koleszar <jkoleszar@google.com>
date: Tue Feb 21 09:41:39 EST 2012
Update XCode SDK search paths Newer XCodes have moved the SDK path from /Developer/SDKs Use a suggestion from jorgenisaksson@gmail.com to locate it osx_sdk_dir is not required to be set. Apple now offers a set command line tools which do not require this. isysroot is also not required in newer versions of XCode so only set it when we are confident in the location. There remain issues with the iOS configure steps which will be addressed later Change-Id: I4f5d7e35175d0dea84faaa6bfb52a0153c72f84b
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -635,42 +635,45 @@
# Handle darwin variants. Newer SDKs allow targeting older
# platforms, so find the newest SDK available.
- if [ -d "/Developer/SDKs/MacOSX10.4u.sdk" ]; then
- osx_sdk_dir="/Developer/SDKs/MacOSX10.4u.sdk"
- fi
- if [ -d "/Developer/SDKs/MacOSX10.5.sdk" ]; then
- osx_sdk_dir="/Developer/SDKs/MacOSX10.5.sdk"
+ case ${toolchain} in
+ *-darwin*)
+ if [ -z "${DEVELOPER_DIR}" ]; then
+ DEVELOPER_DIR=`xcode-select -print-path 2> /dev/null`
+ [ $? -ne 0 ] && OSX_SKIP_DIR_CHECK=1
+ fi
+ if [ -z "${OSX_SKIP_DIR_CHECK}" ]; then
+ OSX_SDK_ROOTS="${DEVELOPER_DIR}/SDKs"
+ OSX_SDK_VERSIONS="MacOSX10.4u.sdk MacOSX10.5.sdk MacOSX10.6.sdk"
+ OSX_SDK_VERSIONS="${OSX_SDK_VERSIONS} MacOSX10.7.sdk"
+ for v in ${OSX_SDK_VERSIONS}; do
+ if [ -d "${OSX_SDK_ROOTS}/${v}" ]; then
+ osx_sdk_dir="${OSX_SDK_ROOTS}/${v}"
+ fi
+ done
+ fi
+ ;;
+ esac
+
+ if [ -d "${osx_sdk_dir}" ]; then
+ add_cflags "-isysroot ${osx_sdk_dir}"
+ add_ldflags "-isysroot ${osx_sdk_dir}"
fi
- if [ -d "/Developer/SDKs/MacOSX10.6.sdk" ]; then
- osx_sdk_dir="/Developer/SDKs/MacOSX10.6.sdk"
- fi
- if [ -d "/Developer/SDKs/MacOSX10.7.sdk" ]; then
- osx_sdk_dir="/Developer/SDKs/MacOSX10.7.sdk"
- fi
case ${toolchain} in
*-darwin8-*)
- add_cflags "-isysroot ${osx_sdk_dir}"
add_cflags "-mmacosx-version-min=10.4"
- add_ldflags "-isysroot ${osx_sdk_dir}"
add_ldflags "-mmacosx-version-min=10.4"
;;
*-darwin9-*)
- add_cflags "-isysroot ${osx_sdk_dir}"
add_cflags "-mmacosx-version-min=10.5"
- add_ldflags "-isysroot ${osx_sdk_dir}"
add_ldflags "-mmacosx-version-min=10.5"
;;
*-darwin10-*)
- add_cflags "-isysroot ${osx_sdk_dir}"
add_cflags "-mmacosx-version-min=10.6"
- add_ldflags "-isysroot ${osx_sdk_dir}"
add_ldflags "-mmacosx-version-min=10.6"
;;
*-darwin11-*)
- add_cflags "-isysroot ${osx_sdk_dir}"
add_cflags "-mmacosx-version-min=10.7"
- add_ldflags "-isysroot ${osx_sdk_dir}"
add_ldflags "-mmacosx-version-min=10.7"
;;
esac
--
⑨