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()
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}"
}
......
......@@ -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
......
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