[vlc-commits] contrib: added support for iOS

Felix Paul Kühne git at videolan.org
Tue Mar 20 18:59:35 CET 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Mar 20 18:59:23 2012 +0100| [08c67883c48164cdce1f671dbf92e4b5645d7e3c] | committer: Felix Paul Kühne

contrib: added support for iOS

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

 contrib/bootstrap    |   19 +++++++++++++++++++
 contrib/src/main.mak |   13 ++++++++++++-
 2 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/contrib/bootstrap b/contrib/bootstrap
index 35c47a3..de77a34 100755
--- a/contrib/bootstrap
+++ b/contrib/bootstrap
@@ -155,6 +155,24 @@ check_macosx_sdk()
    add_make "OSX_VERSION ?= ${OSX_VERSION}"
 }
 
+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 "SDKROOT=${SDKROOT}"
+}
+
 check_android_sdk()
 {
 	[ -z "${ANDROID_NDK}" ] && echo "You must set ANDROID_NDK environment variable" && exit 1
@@ -172,6 +190,7 @@ test -z "$ENABLE_SMALL" || add_make_enabled "ENABLE_SMALL"
 #
 case "${HOST}" in
 	arm-apple-darwin*)
+		check_ios_sdk
 		add_make_enabled "HAVE_IOS" "HAVE_DARWIN_OS" "HAVE_BSD"
 		;;
 	*86*-apple-darwin*)
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 9b87c89..5927a11 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -147,6 +147,17 @@ endif
 
 endif
 
+ifdef HAVE_IOS
+CC=xcrun clang
+CXX=xcrun clang++
+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
+endif
+
 ifdef HAVE_WIN32
 ifneq ($(shell $(CC) $(CFLAGS) -E -dM -include _mingw.h - < /dev/null | grep -E __MINGW64_VERSION_MAJOR),)
 HAVE_MINGW_W64 := 1
@@ -380,7 +391,7 @@ ifdef HAVE_WIN32
 	echo "set(CMAKE_SYSTEM_NAME Windows)" >> $@
 	echo "set(CMAKE_RC_COMPILER $(HOST)-windres)" >> $@
 endif
-ifdef HAVE_MACOSX
+ifdef HAVE_DARWIN_OS
 	echo "set(CMAKE_SYSTEM_NAME Darwin)" >> $@
 	echo "set(CMAKE_C_FLAGS $(CFLAGS))" >> $@
 	echo "set(CMAKE_CXX_FLAGS $(CFLAGS))" >> $@



More information about the vlc-commits mailing list