[vlc-commits] contrib: fixed SDK lookup using Xcode 4.2 or later

Felix Paul Kühne git at videolan.org
Mon Aug 20 14:31:52 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Fri Aug 17 14:39:56 2012 +0200| [3df41cb62cc53da20d8f859c37cbba7dc49fe6ae] | committer: Felix Paul Kühne

contrib: fixed SDK lookup using Xcode 4.2 or later
(cherry picked from commit 6b521aafb0b4db719cd4b6a173b51f27971c9fec)

Conflicts:

	contrib/bootstrap
	contrib/src/main.mak

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=3df41cb62cc53da20d8f859c37cbba7dc49fe6ae
---

 contrib/bootstrap    |   32 ++++++++++++++++++++++----------
 contrib/src/main.mak |    2 --
 2 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/contrib/bootstrap b/contrib/bootstrap
index 32db642..7a1b5d7 100755
--- a/contrib/bootstrap
+++ b/contrib/bootstrap
@@ -143,16 +143,28 @@ add_make_enabled()
 
 check_macosx_sdk()
 {
-   [ -z "${OSX_VERSION}" ] && echo "OSX_VERSION not specified, assuming 10.5" && OSX_VERSION=10.5
-   SDK="/Developer/SDKs/MacOSX${OSX_VERSION}.sdk"
-   if [ ! -d "${SDK}" ]
-   then
-	   echo "
-*** ${SDK} does not exist, please install required SDK, or use export OSX_VERSION=10.6 ***
-"
-	   exit 1
-   fi
-   add_make "OSX_VERSION ?= ${OSX_VERSION}"
+	[ -z "${OSX_VERSION}" ] && echo "OSX_VERSION not specified, assuming 10.5" && OSX_VERSION=10.5
+	if test -z "$SDKROOT"
+	then
+		SDKROOT=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$OSX_VERSION.sdk
+		echo "SDKROOT not specified, assuming $SDKROOT"
+	fi
+
+	if [ ! -d "${SDKROOT}" ]
+	then
+		SDKROOT_NOT_FOUND=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$OSX_VERSION.sdk
+		SDKROOT=`xcode-select -print-path`/SDKs/MacOSX$OSX_VERSION.sdk
+		echo "SDKROOT not found at $SDKROOT_NOT_FOUND, trying $SDKROOT"
+	fi
+
+	if [ ! -d "${SDKROOT}" ]
+	then
+		echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
+		exit 1
+	fi
+
+	add_make "MACOSX_SDK=${SDKROOT}"
+	add_make "OSX_VERSION ?= ${OSX_VERSION}"
 }
 
 check_android_sdk()
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index c3fec63..b3ee71d 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -115,8 +115,6 @@ endif
 
 ifdef HAVE_MACOSX
 MIN_OSX_VERSION=10.5
-MACOSX_SDK=/Developer/SDKs/MacOSX$(OSX_VERSION).sdk
-PATH :=$(abspath ../../extras/tools/build/bin):$(abspath ../$(BUILD)/bin):$(PATH)
 CC=gcc-4.2
 CXX=g++-4.2
 AR=ar



More information about the vlc-commits mailing list