From 6ca302224480f077944cdcd2969072a1f525b7ba Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Thu, 9 Jan 2014 20:42:35 +1000 Subject: [PATCH] Make the Mac specific build stuff less fragile. --- linden/scripts/linux/config-SL-source | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/linden/scripts/linux/config-SL-source b/linden/scripts/linux/config-SL-source index 4ba5bcd1..f1486057 100644 --- a/linden/scripts/linux/config-SL-source +++ b/linden/scripts/linux/config-SL-source @@ -85,10 +85,13 @@ if [[ "$OSTYPE" =~ ^darwin ]] ; then # Try to figure out which SDK is the earliest this version of Xcode supports. # This might be fragile, only tested it with Xcode 3.2.6, which is the minimum supported Xcode anyway. sdk_path="$(xcodebuild -version -sdk | grep Path: | cut -d ' ' -f 2 | grep MacOSX10. | sort | head -n 1)" - sdk="$(echo $sdk_path | cut -d '.' -f 2)" + # Save both parts, in case there's stuff in the path that the magic foo below might get confused over. + sdk_file="$(basename $sdk_path)" + sdk_path="$(dirnam $sdk_path)" + sdk="$(echo $sdk_file | cut -d '.' -f 2)" # Minimum of SDK 10.5 - if [ "$sdk" == "4u" ] ; then sdk_path="$(echo $sdk_path | cut -d '.' -f -1)".5.sdk; fi - defs_extra="-DCMAKE_OSX_SYSROOT=$sdk_path" + if [ "$sdk" == "4u" ] ; then sdk_file=MacOSX10.5.sdk; fi + defs_extra="-DCMAKE_OSX_SYSROOT=$sdk_path/$sdk_file" fi