[vlc-commits] build_system: osx: use xcrun and SDKROOT env variable. (close #6305)

Jon Stacey git at videolan.org
Thu May 17 13:59:48 CEST 2012


vlc | branch: master | Jon Stacey <jon at jonsview.com> | Thu May 17 13:59:27 2012 +0200| [0802130a71120dd199174739d6bf9655dfb9605a] | committer: Felix Paul Kühne

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

Defaults to OSX_VERSION=10.6

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0802130a71120dd199174739d6bf9655dfb9605a
---

 contrib/bootstrap              |   18 +++++++++++-------
 extras/package/macosx/build.sh |   18 ++++++++++--------
 2 files changed, 21 insertions(+), 15 deletions(-)

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
 
 



More information about the vlc-commits mailing list