vlc/vlc-2.1 | branch: master | Felix Paul Kühne <[email protected]> | Sat 
Nov 30 20:05:58 2013 +0100| [50b8aa096e3e8065a78eadcdc9e2f4212e0f64dd] | 
committer: Felix Paul Kühne

contrib: fix compilation of libraries for iOS which deploy cmake

(cherry picked from commit 215c6ac6f278860fdb4abc8fdc99226a7c7f895a)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=50b8aa096e3e8065a78eadcdc9e2f4212e0f64dd
---

 contrib/bootstrap           |   19 +++++++++++++++++++
 contrib/src/main.mak        |    3 +++
 extras/package/ios/build.sh |    2 ++
 3 files changed, 24 insertions(+)

diff --git a/contrib/bootstrap b/contrib/bootstrap
index e5c7022..5e5f935 100755
--- a/contrib/bootstrap
+++ b/contrib/bootstrap
@@ -146,6 +146,24 @@ add_make_enabled()
        done
 }
 
+check_ios_sdk()
+{
+   if test -z "$SDKROOT"
+   then
+      SDKROOT=`xcode-select 
-print-path`/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}${SDK_VERSION}.sdk
+      echo "SDKROOT not specified, assuming $SDKROOT"
+   else
+      SDKROOT="$SDKROOT"
+      fi
+
+   if [ ! -d "${SDKROOT}" ]
+   then
+      echo "*** ${SDKROOT} does not exist, please install required SDK, or set 
SDKROOT manually. ***"
+      exit 1
+   fi
+   add_make "IOS_SDK=${SDKROOT}"
+}
+
 check_macosx_sdk()
 {
    [ -z "${OSX_VERSION}" ] && echo "OSX_VERSION not specified, assuming 10.7" 
&& OSX_VERSION=10.7
@@ -200,6 +218,7 @@ case "${OS}" in
                        check_macosx_sdk
                        add_make_enabled "HAVE_MACOSX" "HAVE_DARWIN_OS" 
"HAVE_BSD"
                else
+                       check_ios_sdk
                        add_make_enabled "HAVE_IOS" "HAVE_DARWIN_OS" "HAVE_BSD" 
"HAVE_NEON" "HAVE_ARMV7A"
                fi
                ;;
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 4e568ec..9562165 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -397,6 +397,9 @@ ifdef HAVE_DARWIN_OS
        echo "set(CMAKE_LD_FLAGS $(LDFLAGS))" >> $@
 ifdef HAVE_IOS
        echo "set(CMAKE_AR ar CACHE FILEPATH "Archiver")" >> $@
+       echo "set(CMAKE_OSX_SYSROOT $(IOS_SDK))" >> $@
+else
+       echo "set(CMAKE_OSX_SYSROOT $(MACOSX_SDK))" >> $@
 endif
 endif
 ifdef HAVE_CROSS_COMPILE
diff --git a/extras/package/ios/build.sh b/extras/package/ios/build.sh
index da0f3bd..949f53d 100755
--- a/extras/package/ios/build.sh
+++ b/extras/package/ios/build.sh
@@ -131,6 +131,8 @@ export CXX="xcrun clang++"
 export LD="xcrun ld"
 export STRIP="xcrun strip"
 
+export PLATFORM=$PLATFORM
+export SDK_VERSION=$SDK_VERSION
 
 if [ "$PLATFORM" = "OS" ]; then
 export CFLAGS="-isysroot ${SDKROOT} -arch ${ARCH} -mcpu=cortex-a8 
-miphoneos-version-min=${SDK_MIN} ${OPTIM}"

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to