[vlc-devel] [RFC] add iOS support to configure
Rafaël Carré
funman at videolan.org
Wed Mar 21 20:31:42 CET 2012
Le 2012-03-21 14:59, Felix Paul Kühne a écrit :
> Hello,
>
> this patch adds iOS support to configure.
>
> For some of you, it might look shocking at first. The rationale is that Mac OS X and iOS can't be easily split by configure, so I implemented the following:
> By default, configure will compile VLC for Mac OS X once it runs on Darwin (same behavior as before).
> However, you can specify --enable-ios and --disable-macosx to disable the Mac OS X support and enable iOS (regardless of the iOS architecture, since x86_64 and i686 are valid targets as well). By doing so, configure will try to find an iOS SDK and will use slightly different CFLAGS.
>
> The previous --enable-macosx check was renamed to --enable-macosx-gui, as actually just enables the Cocoa interface in modules/gui/macosx and isn't related to configure's actual OS X support.
>
> Feedback is welcome!
>
> Best regards,
>
> Felix
>
>
>
>
>
> 0015-configure.ac-added-support-for-iOS.patch
>
>
> From d0d6e57f48d7ccd038ba3e1d6642eecc4e7360bc Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne at videolan.org>
> Date: Wed, 21 Mar 2012 19:49:30 +0100
> Subject: [PATCH 15/15] configure.ac: added support for iOS
>
> ---
> configure.ac | 46 +++++++++++++++++++++++++++++++++++++++++++---
> 1 files changed, 43 insertions(+), 3 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 4c16c28..e860fda 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -142,6 +142,10 @@ case "${host_os}" in
> x86_64*)
> ARCH_flag="-arch x86_64"
> ;;
> + arm*)
> + ARCH_flag="-arch armv7"
> + ac_cv_c_bigendian="no"
Not sure about that one, does the check fail or is it to avoid the check
because we already know the result?
> + ;;
> esac
>
> SYS=darwin
> @@ -170,6 +174,10 @@ case "${host_os}" in
> dnl
> dnl Check for Mac OS X SDK settings
> dnl
> +AC_ARG_ENABLE(macosx,
> + [ --enable-macosx Enable Mac OS X support (default enabled on Mac OS X)])
> +if test "x${enable_macosx}" != "xno" && test "${SYS}" = "darwin"
> +then
> AC_ARG_WITH(macosx-sdk,
> [AS_HELP_STRING([--with-macosx-sdk=DIR],
> [compile using the SDK in DIR])])
> @@ -191,6 +199,38 @@ case "${host_os}" in
> CXXFLAGS="${CXXFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
> OBJCFLAGS="${OBJCFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
> export MACOSX_DEPLOYMENT_TARGET
> +fi
> + dnl
> + dnl Check for iOS SDK settings
> + dnl
> + AC_ARG_ENABLE(ios,
> + [ --enable-ios Enable iOS support (default disabled)])
> +if test "x${enable_ios}" = "yes" && test "${SYS}" = "darwin"
> +then
> + AC_ARG_WITH(ios-sdk,
> + [AS_HELP_STRING([--with-ios-sdk=DIR],
> + [compile using the SDK in DIR])])
> + test "${with_ios_sdk}" = "" && with_macosx_sdk=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
> + test ! -d "${with_ios_sdk}" && AC_MSG_ERROR([SDK "${with_ios_sdk}" not found])
test -d ... || fail ?
> + AC_ARG_WITH(ios-version-min,
> + [AS_HELP_STRING([--with-ios-version-min=VERSION],
> + [compile for iOS VERSION and above])])
> + if test "${with_ios_version_min}" = "" ; then
> + with_ios_version_min=5.0
> + fi
> + IPHONEOS_DEPLOYMENT_TARGET=${with_ios_version_min}
> + CPP="${CPP} -isysroot ${with_ios_sdk} -miphoneos-version-min=${with_ios_version_min}"
> + CC="${CC} -isysroot ${with_ios_sdk} -miphoneos-version-min=${with_ios_version_min}"
> + CXX="${CXX} -isysroot ${with_ios_sdk} -miphoneos-version-min=${with_ios_version_min}"
> + CXXCPP="${CXXCPP} -isysroot ${with_ios_sdk} -miphoneos-version-min=${with_ios_version_min}"
> + OBJC="${OBJC} -isysroot ${with_ios_sdk} -miphoneos-version-min=${with_ios_version_min}"
> + LD="${LD} -syslibroot ${with_ios_sdk} -miphoneos-version-min=${with_ios_version_min}"
> + CFLAGS="${CFLAGS} -DIPHONEOS_DEPLOYMENT_TARGET=${with_ios_version_min}"
> + CPPFLAGS="${CPPFLAGS} -DIPHONEOS_DEPLOYMENT_TARGET=${with_ios_version_min}"
> + CXXFLAGS="${CXXFLAGS} -DIPHONEOS_DEPLOYMENT_TARGET=${with_ios_version_min}"
> + OBJCFLAGS="${OBJCFLAGS} -DIPHONEOS_DEPLOYMENT_TARGET=${with_ios_version_min}"
> + export IPHONEOS_DEPLOYMENT_TARGET
> +fi
> ;;
> *mingw32* | *cygwin* | *wince* | *mingwce*)
> AC_CHECK_TOOL(WINDRES, windres, :)
> @@ -3730,9 +3770,9 @@ AS_IF([test "${enable_skins2}" = "yes" && test "${enable_libtar}" != "no"], [
> dnl
> dnl MacOS X gui module
> dnl
> -AC_ARG_ENABLE(macosx,
> - [ --enable-macosx Mac OS X gui support (default enabled on Mac OS X)])
> -if test "x${enable_macosx}" != "xno" -a "${SYS}" = "darwin"
> +AC_ARG_ENABLE(macosx-gui,
> + [ --enable-macosx-gui Mac OS X gui support (default enabled on Mac OS X)])
> +if test "x${enable_macosx_gui}" != "xno" -a "${SYS}" = "darwin"
> then
> VLC_ADD_LIBS([macosx minimal_macosx], [-Wl,-framework,Cocoa -Wl,-framework,OpenGL -Wl,-framework,Carbon -Wl,-framework,CoreServices -Wl,-framework,AGL])
> VLC_ADD_OBJCFLAGS([macosx minimal_macosx], [-fobjc-exceptions] )
Looks sane, at least not more insane than macosx code.
However I think it could be easily moved into configure.sh helpers for
both osx and ios.
More information about the vlc-devel
mailing list