Commit 0802130a authored by Jon Stacey's avatar Jon Stacey Committed by Felix Paul Kühne

build_system: osx: use xcrun and SDKROOT env variable. (close #6305)

Defaults to OSX_VERSION=10.6
Signed-off-by: default avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 5ab6bfbd
...@@ -143,15 +143,19 @@ add_make_enabled() ...@@ -143,15 +143,19 @@ add_make_enabled()
check_macosx_sdk() check_macosx_sdk()
{ {
[ -z "${OSX_VERSION}" ] && echo "OSX_VERSION not specified, assuming 10.5" && OSX_VERSION=10.5 [ -z "${OSX_VERSION}" ] && echo "OSX_VERSION not specified, assuming 10.6" && OSX_VERSION=10.6
SDK="/Developer/SDKs/MacOSX${OSX_VERSION}.sdk" if test -z "$SDKROOT"
if [ ! -d "${SDK}" ] 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 then
echo " echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
*** ${SDK} does not exist, please install required SDK, or use export OSX_VERSION=10.6 ***
"
exit 1 exit 1
fi fi
add_make "OSX_VERSION ?= ${OSX_VERSION}" add_make "OSX_VERSION ?= ${OSX_VERSION}"
} }
......
...@@ -10,7 +10,8 @@ info() ...@@ -10,7 +10,8 @@ info()
} }
ARCH="x86_64" 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() usage()
{ {
...@@ -22,7 +23,7 @@ Build vlc in the current directory ...@@ -22,7 +23,7 @@ Build vlc in the current directory
OPTIONS: OPTIONS:
-h Show some help -h Show some help
-q Be quiet -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) -a <arch> Use the specified arch (default: $ARCH)
EOF EOF
...@@ -53,7 +54,7 @@ do ...@@ -53,7 +54,7 @@ do
ARCH=$OPTARG ARCH=$OPTARG
;; ;;
k) k)
SDK=$OPTARG SDKROOT=$OPTARG
;; ;;
esac esac
done done
...@@ -83,10 +84,11 @@ builddir=`pwd` ...@@ -83,10 +84,11 @@ builddir=`pwd`
info "Building in \"$builddir\"" info "Building in \"$builddir\""
export CC=/Developer/usr/bin/clang export CC="xcrun clang"
export CXX="/Developer/usr/bin/clang++" export CXX="xcrun clang++"
export OBJC=/Developer/usr/bin/clang export OBJC="xcrun clang"
export OSX_VERSION=$SDK export OSX_VERSION
export SDKROOT
export PATH="${vlcroot}/extras/tools/build/bin:$PATH" export PATH="${vlcroot}/extras/tools/build/bin:$PATH"
TRIPLET=$ARCH-apple-darwin10 TRIPLET=$ARCH-apple-darwin10
...@@ -139,7 +141,7 @@ if [ "${vlcroot}/configure" -nt Makefile ]; then ...@@ -139,7 +141,7 @@ if [ "${vlcroot}/configure" -nt Makefile ]; then
--build=$TRIPLET \ --build=$TRIPLET \
--host=$TRIPLET \ --host=$TRIPLET \
--with-macosx-version-min=$OSX_VERSION \ --with-macosx-version-min=$OSX_VERSION \
--with-macosx-sdk=/Developer/SDKs/MacOSX$OSX_VERSION.sdk > $out --with-macosx-sdk=$SDKROOT > $out
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment