summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-04-08 16:34:33 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-09 10:03:20 +0200
commit4f002f325614ef2c5f893c6fffffd76ec4796bb2 (patch)
tree79390d00293e5e0b6bad6d365c153b439cd382ce
parentab7eacd8a57adb29e22d698dbe46e2b8026ee0bb (diff)
Use absolute paths for Xcode helpers such as xcodebuild/xcrun/xcode-select
We always use the xcodebuild/xcrun/xcode-select binaries in /usr/bin, as these will dispatch to the right binary based on what Xcode version has been chosen using xcode-select -switch. This fixes an issue where a tool was in the path from another Xcode installation. We can rely on the tools as they are present on a clean Mac OS install. Change-Id: I1d3cc1e92604f9be6d6f14639cb6322234edd696 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
-rwxr-xr-xconfigure6
-rw-r--r--mkspecs/common/xcode.conf4
-rw-r--r--mkspecs/features/mac/sdk.prf4
3 files changed, 7 insertions, 7 deletions
diff --git a/configure b/configure
index d8e08ed6fb..0f178c0259 100755
--- a/configure
+++ b/configure
@@ -233,7 +233,7 @@ macSDKify()
sdk=$(getSingleQMakeVariable "QMAKE_MAC_SDK" "$1")
if [ -z "$sdk" ]; then echo "QMAKE_MAC_SDK must be set when building on Mac" >&2; exit 1; fi
- sysroot=$(xcodebuild -sdk $sdk -version Path 2>/dev/null)
+ sysroot=$(/usr/bin/xcodebuild -sdk $sdk -version Path 2>/dev/null)
if [ -z "$sysroot" ]; then echo "Failed to resolve SDK path for '$sdk'" >&2; exit 1; fi
case "$sdk" in
@@ -256,7 +256,7 @@ macSDKify()
# Prefix tool with toolchain path
var=$(echo "$line" | cut -d '=' -f 1)
val=$(echo "$line" | cut -d '=' -f 2-)
- sdk_val=$(xcrun -sdk $sdk -find $(echo $val | cut -d ' ' -f 1))
+ sdk_val=$(/usr/bin/xcrun -sdk $sdk -find $(echo $val | cut -d ' ' -f 1))
val=$(echo $sdk_val $(echo $val | cut -s -d ' ' -f 2-))
echo "$var=$val"
;;
@@ -2459,7 +2459,7 @@ if [ -z "$PLATFORM" ]; then
# about the OS version, since we're not using the clang version that comes
# with the system. We use 'xcrun' to check the clang version that's part of
# the Xcode installation.
- if [ "$(xcrun -sdk macosx clang -v 2>&1 | sed -n 's/.*version \([0-9]\).*/\1/p')" -ge 3 ]; then
+ if [ "$(/usr/bin/xcrun -sdk macosx clang -v 2>&1 | sed -n 's/.*version \([0-9]\).*/\1/p')" -ge 3 ]; then
PLATFORM=macx-clang
# Advertise g++ as an alternative on Lion and below
diff --git a/mkspecs/common/xcode.conf b/mkspecs/common/xcode.conf
index 9da6406f7f..0095469421 100644
--- a/mkspecs/common/xcode.conf
+++ b/mkspecs/common/xcode.conf
@@ -3,7 +3,7 @@
#
# Get path of Xcode's Developer directory
-QMAKE_XCODE_DEVELOPER_PATH = $$system("xcode-select --print-path")
+QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path")
isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \
error("Xcode path is not set. Please use xcode-select to choose Xcode installation path.")
@@ -12,6 +12,6 @@ isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \
error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.")
# Extract Xcode version using xcodebuild
-xcode_version = $$system("xcodebuild -version")
+xcode_version = $$system("/usr/bin/xcodebuild -version")
QMAKE_XCODE_VERSION = $$member(xcode_version, 1)
unset(xcode_version)
diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
index db33291b99..ece0e27536 100644
--- a/mkspecs/features/mac/sdk.prf
+++ b/mkspecs/features/mac/sdk.prf
@@ -5,7 +5,7 @@ isEmpty(QMAKE_MAC_SDK): \
contains(QMAKE_MAC_SDK, .*/.*): \
error("QMAKE_MAC_SDK can only contain short-form SDK names (eg. macosx, iphoneos)")
-QMAKE_MAC_SDK_PATH = $$system("xcodebuild -sdk $$QMAKE_MAC_SDK -version Path 2>/dev/null")
+QMAKE_MAC_SDK_PATH = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version Path 2>/dev/null")
isEmpty(QMAKE_MAC_SDK_PATH): error("Could not resolve SDK path for \'$$QMAKE_MAC_SDK\'")
!equals(MAKEFILE_GENERATOR, XCODE) {
@@ -24,7 +24,7 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_
value = $$eval($$tool)
isEmpty(value): next()
- sysrooted = $$system("xcrun -sdk $$QMAKE_MAC_SDK -find $$first(value) 2>/dev/null")
+ sysrooted = $$system("/usr/bin/xcrun -sdk $$QMAKE_MAC_SDK -find $$first(value) 2>/dev/null")
isEmpty(sysrooted): next()
$$tool = $$sysrooted $$member(value, 1, -1)