[vlc-devel] [PATCH] rename SDKROOT to SDKROOTDIR

Ben Hiller benhiller at gmail.com
Wed Jul 31 06:24:24 CEST 2013


Versions of XCode above 4.6 use the SDKROOT shell variable to determine
what SDK use for building (it is documented here:
http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html).
Unfortunately, several VLC build scripts were overriding SDKROOT, which
caused xcode commands to fail. This works around that issue by renaming
the SDKROOT variable that VLC build scripts use to SDKROOTDIR. Running
./extras/package/ios/build.sh succeeds for me after this change.
---
 contrib/bootstrap              | 34 +++++++++++++++++-----------------
 contrib/src/main.mak           |  4 ++--
 contrib/src/vpx/rules.mak      |  2 +-
 extras/package/ios/build.sh    | 20 ++++++++++----------
 extras/package/macosx/build.sh | 10 +++++-----
 5 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/contrib/bootstrap b/contrib/bootstrap
index 6bf7bd5..10bb1aa 100755
--- a/contrib/bootstrap
+++ b/contrib/bootstrap
@@ -149,45 +149,45 @@ add_make_enabled()
 check_macosx_sdk()
 {
    [ -z "${OSX_VERSION}" ] && echo "OSX_VERSION not specified, assuming 10.7" && OSX_VERSION=10.7
-   if test -z "$SDKROOT"
+   if test -z "$SDKROOTDIR"
    then
-      SDKROOT=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$OSX_VERSION.sdk
-      echo "SDKROOT not specified, assuming $SDKROOT"
+      SDKROOTDIR=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$OSX_VERSION.sdk
+      echo "SDKROOTDIR not specified, assuming $SDKROOTDIR"
    fi
 
-   if [ ! -d "${SDKROOT}" ]
+   if [ ! -d "${SDKROOTDIR}" ]
    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"
+      SDKROOTDIR_NOT_FOUND=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$OSX_VERSION.sdk
+      SDKROOTDIR=`xcode-select -print-path`/SDKs/MacOSX$OSX_VERSION.sdk
+      echo "SDKROOTDIR not found at $SDKROOTDIR_NOT_FOUND, trying $SDKROOTDIR"
    fi
 
-   if [ ! -d "${SDKROOT}" ]
+   if [ ! -d "${SDKROOTDIR}" ]
    then
-      echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
+      echo "*** ${SDKROOTDIR} does not exist, please install required SDK, or set SDKROOTDIR manually. ***"
       exit 1
    fi
 
-   add_make "MACOSX_SDK=${SDKROOT}"
+   add_make "MACOSX_SDK=${SDKROOTDIR}"
    add_make "OSX_VERSION ?= ${OSX_VERSION}"
 }
 
 check_ios_sdk()
 {
-	if test -z "$SDKROOT"
+	if test -z "$SDKROOTDIR"
 	then
-		SDKROOT=`xcode-select -print-path`/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}${SDK_VERSION}.sdk
-		echo "SDKROOT not specified, assuming $SDKROOT"
+		SDKROOTDIR=`xcode-select -print-path`/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}${SDK_VERSION}.sdk
+		echo "SDKROOTDIR not specified, assuming $SDKROOTDIR"
 	else
-		SDKROOT="$SDKROOT"
+		SDKROOTDIR="$SDKROOTDIR"
 	fi
 
-	if [ ! -d "${SDKROOT}" ]
+	if [ ! -d "${SDKROOTDIR}" ]
 	then
-		echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
+		echo "*** ${SDKROOTDIR} does not exist, please install required SDK, or set SDKROOTDIR manually. ***"
 		exit 1
 	fi
-	add_make "SDKROOT=${SDKROOT}"
+	add_make "SDKROOTDIR=${SDKROOTDIR}"
 }
 
 check_android_sdk()
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 2027af5..96496e3 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -138,8 +138,8 @@ AR=xcrun ar
 LD=xcrun ld
 STRIP=xcrun strip
 RANLIB=xcrun ranlib
-EXTRA_CFLAGS += -isysroot $(SDKROOT)  -miphoneos-version-min=5.0
-EXTRA_LDFLAGS += -Wl,-syslibroot,$(SDKROOT) -isysroot $(SDKROOT) -miphoneos-version-min=5.0
+EXTRA_CFLAGS += -isysroot $(SDKROOTDIR)  -miphoneos-version-min=5.0
+EXTRA_LDFLAGS += -Wl,-syslibroot,$(SDKROOTDIR) -isysroot $(SDKROOTDIR) -miphoneos-version-min=5.0
 endif
 
 ifdef HAVE_WIN32
diff --git a/contrib/src/vpx/rules.mak b/contrib/src/vpx/rules.mak
index df8c314..518cd5f 100644
--- a/contrib/src/vpx/rules.mak
+++ b/contrib/src/vpx/rules.mak
@@ -95,7 +95,7 @@ ifdef HAVE_MACOSX
 VPX_CONF += --sdk-path=$(MACOSX_SDK)
 endif
 ifdef HAVE_IOS
-VPX_CONF += --sdk-path=$(SDKROOT)
+VPX_CONF += --sdk-path=$(SDKROOTDIR)
 endif
 
 .vpx: libvpx
diff --git a/extras/package/ios/build.sh b/extras/package/ios/build.sh
index 39d90bd..38bea12 100755
--- a/extras/package/ios/build.sh
+++ b/extras/package/ios/build.sh
@@ -93,15 +93,15 @@ spushd `dirname ${THIS_SCRIPT_PATH}`/../../..
 VLCROOT=`pwd` # Let's make sure VLCROOT is an absolute path
 spopd
 
-if test -z "$SDKROOT"
+if test -z "$SDKROOTDIR"
 then
-    SDKROOT=`xcode-select -print-path`/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}${SDK_VERSION}.sdk
-    echo "SDKROOT not specified, assuming $SDKROOT"
+    SDKROOTDIR=`xcode-select -print-path`/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}${SDK_VERSION}.sdk
+    echo "SDKROOTDIR not specified, assuming $SDKROOTDIR"
 fi
 
-if [ ! -d "${SDKROOT}" ]
+if [ ! -d "${SDKROOTDIR}" ]
 then
-    echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
+    echo "*** ${SDKROOTDIR} does not exist, please install required SDK, or set SDKROOTDIR manually. ***"
     exit 1
 fi
 
@@ -133,11 +133,11 @@ export LD="xcrun ld"
 export STRIP="xcrun strip"
 
 
-export SDKROOT
+export SDKROOTDIR
 if [ "$PLATFORM" = "OS" ]; then
-export CFLAGS="-isysroot ${SDKROOT} -arch ${ARCH} -mcpu=cortex-a8 -miphoneos-version-min=${SDK_MIN} ${OPTIM}"
+export CFLAGS="-isysroot ${SDKROOTDIR} -arch ${ARCH} -mcpu=cortex-a8 -miphoneos-version-min=${SDK_MIN} ${OPTIM}"
 else
-export CFLAGS="-isysroot ${SDKROOT} -arch ${ARCH} -miphoneos-version-min=${SDK_MIN} ${OPTIM}"
+export CFLAGS="-isysroot ${SDKROOTDIR} -arch ${ARCH} -miphoneos-version-min=${SDK_MIN} ${OPTIM}"
 fi
 export CPPFLAGS="${CFLAGS}"
 export CXXFLAGS="${CFLAGS}"
@@ -154,9 +154,9 @@ if [ "$PLATFORM" = "Simulator" ]; then
 fi
 
 if [ "$PLATFORM" = "OS" ]; then
-  export LDFLAGS="-L${SDKROOT}/usr/lib -arch ${ARCH} -isysroot ${SDKROOT} -miphoneos-version-min=${SDK_MIN}"
+  export LDFLAGS="-L${SDKROOTDIR}/usr/lib -arch ${ARCH} -isysroot ${SDKROOTDIR} -miphoneos-version-min=${SDK_MIN}"
 else
-  export LDFLAGS="-syslibroot=${SDKROOT}/ -arch ${ARCH} -miphoneos-version-min=${SDK_MIN}"
+  export LDFLAGS="-syslibroot=${SDKROOTDIR}/ -arch ${ARCH} -miphoneos-version-min=${SDK_MIN}"
 fi
 
 if [ "$PLATFORM" = "OS" ]; then
diff --git a/extras/package/macosx/build.sh b/extras/package/macosx/build.sh
index abac1e5..f6da562 100755
--- a/extras/package/macosx/build.sh
+++ b/extras/package/macosx/build.sh
@@ -12,7 +12,7 @@ info()
 ARCH="x86_64"
 MINIMAL_OSX_VERSION="10.6"
 OSX_VERSION="10.8"
-SDKROOT=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$OSX_VERSION.sdk
+SDKROOTDIR=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$OSX_VERSION.sdk
 
 usage()
 {
@@ -24,7 +24,7 @@ Build vlc in the current directory
 OPTIONS:
    -h            Show some help
    -q            Be quiet
-   -k <sdk>      Use the specified sdk (default: $SDKROOT)
+   -k <sdk>      Use the specified sdk (default: $SDKROOTDIR)
    -a <arch>     Use the specified arch (default: $ARCH)
 EOF
 
@@ -55,7 +55,7 @@ do
              ARCH=$OPTARG
          ;;
          k)
-             SDKROOT=$OPTARG
+             SDKROOTDIR=$OPTARG
          ;;
      esac
 done
@@ -89,7 +89,7 @@ export CC="xcrun clang"
 export CXX="xcrun clang++"
 export OBJC="xcrun clang"
 export OSX_VERSION
-export SDKROOT
+export SDKROOTDIR
 export PATH="${vlcroot}/extras/tools/build/bin:$PATH"
 
 TRIPLET=$ARCH-apple-darwin10
@@ -142,7 +142,7 @@ if [ "${vlcroot}/configure" -nt Makefile ]; then
       --build=$TRIPLET \
       --host=$TRIPLET \
       --with-macosx-version-min=$MINIMAL_OSX_VERSION \
-      --with-macosx-sdk=$SDKROOT > $out
+      --with-macosx-sdk=$SDKROOTDIR > $out
 fi
 
 
-- 
1.8.3.1 (Apple Git-46)




More information about the vlc-devel mailing list