-
-
Save hyuni/bf85d6e7eaec3ea55e88 to your computer and use it in GitHub Desktop.
VLC buildsystem fix for XCode 4.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/contrib/bootstrap b/contrib/bootstrap | |
index df3dd85..a0a7244 100755 | |
--- a/contrib/bootstrap | |
+++ b/contrib/bootstrap | |
@@ -143,15 +143,19 @@ 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}" ] | |
+ [ -z "${OSX_VERSION}" ] && echo "OSX_VERSION not specified, assuming 10.6" && OSX_VERSION=10.6 | |
+ if test -z "$SDKROOT" | |
then | |
- echo " | |
-*** ${SDK} does not exist, please install required SDK, or use export OSX_VERSION=10.6 *** | |
-" | |
- exit 1 | |
+ 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 | |
+ echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***" | |
+ exit 1 | |
+ fi | |
+ | |
add_make "OSX_VERSION ?= ${OSX_VERSION}" | |
} | |
diff --git a/extras/package/macosx/build.sh b/extras/package/macosx/build.sh | |
index 4ed57be..d9b3601 100755 | |
--- a/extras/package/macosx/build.sh | |
+++ b/extras/package/macosx/build.sh | |
@@ -10,7 +10,8 @@ info() | |
} | |
ARCH="x86_64" | |
-SDK="10.6" | |
+OSX_VERSION="10.6" | |
+SDKROOT=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$OSX_VERSION.sdk | |
usage() | |
{ | |
@@ -22,7 +23,7 @@ Build vlc in the current directory | |
OPTIONS: | |
-h Show some help | |
-q Be quiet | |
- -k <sdk> Use the specified sdk (default: $SDK) | |
+ -k <sdk> Use the specified sdk (default: $SDKROOT) | |
-a <arch> Use the specified arch (default: $ARCH) | |
EOF | |
@@ -53,7 +54,7 @@ do | |
ARCH=$OPTARG | |
;; | |
k) | |
- SDK=$OPTARG | |
+ SDKROOT=$OPTARG | |
;; | |
esac | |
done | |
@@ -83,10 +84,11 @@ builddir=`pwd` | |
info "Building in \"$builddir\"" | |
-export CC=/Developer/usr/bin/clang | |
-export CXX="/Developer/usr/bin/clang++" | |
-export OBJC=/Developer/usr/bin/clang | |
-export OSX_VERSION=$SDK | |
+export CC="xcrun clang" | |
+export CXX="xcrun clang++" | |
+export OBJC="xcrun clang" | |
+export OSX_VERSION | |
+export SDKROOT | |
export PATH="${vlcroot}/extras/tools/build/bin:$PATH" | |
TRIPLET=$ARCH-apple-darwin10 | |
@@ -139,7 +141,7 @@ if [ "${vlcroot}/configure" -nt Makefile ]; then | |
--build=$TRIPLET \ | |
--host=$TRIPLET \ | |
--with-macosx-version-min=$OSX_VERSION \ | |
- --with-macosx-sdk=/Developer/SDKs/MacOSX$OSX_VERSION.sdk > $out | |
+ --with-macosx-sdk=$SDKROOT > $out | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment