[vlc-devel] [RFC] add iOS support to configure

Rafaël Carré funman at videolan.org
Wed Mar 21 23:33:39 CET 2012


Le 2012-03-21 18:19, Felix Paul Kühne a écrit :
> On 21.03.2012, at 20:31, Rafaël Carré wrote:
> 
>> > However I think it could be easily moved into configure.sh helpers for
>> > both osx and ios.
> Reworked patches attached!
> 
> 
> Best regards,
> 
> Felix
> 
> 
> 
> 0001-configure.ac-split-Mac-OS-X-SDK-handling-and-move-it.patch
> 
> 
> From 77517f4eaf6aa0e9e2117d0544803005da82ba94 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 23:13:45 +0100
> Subject: [PATCH 1/3] configure.ac: split Mac OS X SDK handling and move it to
>  the OS X specific configure.sh
> 
> ---
>  configure.ac                       |   25 -------------------------
>  extras/package/macosx/configure.sh |   34 ++++++++++++++++++++++++++++++++++
>  2 files changed, 34 insertions(+), 25 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 4c16c28..ee62b49 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -166,31 +166,6 @@ case "${host_os}" in
>              AC_LIBOBJ([getdelim])
>              AC_LIBOBJ([strndup])
>              AC_LIBOBJ([strnlen])],)
> -
> -    dnl
> -    dnl  Check for Mac OS X SDK settings
> -    dnl
> -    AC_ARG_WITH(macosx-sdk,
> -      [AS_HELP_STRING([--with-macosx-sdk=DIR],
> -        [compile using the SDK in DIR])])
> -    test "${with_macosx_sdk}" = "" && with_macosx_sdk=/Developer/SDKs/MacOSX10.6.sdk
> -    test ! -d "${with_macosx_sdk}" && AC_MSG_ERROR([SDK "${with_macosx_sdk}" not found])
> -    AC_ARG_WITH(macosx-version-min,
> -      [AS_HELP_STRING([--with-macosx-version-min=VERSION],
> -        [compile for MacOS X VERSION and above])])
> -    if test "${with_macosx_version_min}" = "" ; then
> -       with_macosx_version_min=10.5
> -    fi
> -    MACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}
> -    CPP="${CPP} -isysroot ${with_macosx_sdk} -mmacosx-version-min=${with_macosx_version_min}"
> -    CC="${CC} -isysroot ${with_macosx_sdk} -mmacosx-version-min=${with_macosx_version_min}"
> -    CXX="${CXX} -isysroot ${with_macosx_sdk} -mmacosx-version-min=${with_macosx_version_min}"
> -    OBJC="${OBJC} -isysroot ${with_macosx_sdk} -mmacosx-version-min=${with_macosx_version_min}"
> -    LD="${LD} -syslibroot ${with_macosx_sdk} -mmacosx_version_min=${with_macosx_version_min}"
> -    CFLAGS="${CFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
> -    CXXFLAGS="${CXXFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
> -    OBJCFLAGS="${OBJCFLAGS} -DMACOSX_DEPLOYMENT_TARGET=${with_macosx_version_min}"
> -    export MACOSX_DEPLOYMENT_TARGET
>      ;;
>    *mingw32* | *cygwin* | *wince* | *mingwce*)
>      AC_CHECK_TOOL(WINDRES, windres, :)
> diff --git a/extras/package/macosx/configure.sh b/extras/package/macosx/configure.sh
> index 3a1e00a..32b7404f 100755
> --- a/extras/package/macosx/configure.sh
> +++ b/extras/package/macosx/configure.sh
> @@ -1,5 +1,39 @@
>  #!/bin/sh
>  
> +if test -z "$SDKVERSION"
> +then
> +    SDKVERSION=10.6
> +    echo "SDKVERSION not specified, assuming $SDKVERSION"
> +fi
> +
> +if test -z "$DEPLOYMENTTARGET"
> +then
> +    DEPLOYMENTTARGET=10.5
> +    echo "DEPLOYMENTTARGET not specified, assuming $DEPLOYMENTTARGET"
> +fi
> +
> +if test -z "$SDKROOT"
> +then
> +    SDKROOT=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$SDKVERSION.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
> +
> +export SDKROOT
> +
> +export CPPFLAGS="-isysroot ${SDKROOT} -mmacosx-version-min=${DEPLOYMENTTARGET} -DMACOSX_DEPLOYMENT_TARGET=${DEPLOYMENTTARGET}"
> +export LDFLAGS="-syslibroot=${SDKROOT} -mmacosx-version-min=${DEPLOYMENTTARGET}"
> +export MACOSX_DEPLOYMENT_TARGET=${DEPLOYMENTTARGET}
> +
> +echo ""
> +echo " ** compiling with the ${SDKVERSION} SDK, deployment target: ${DEPLOYMENTTARGET} ** "
> +echo ""
> +
>  OPTIONS="
>          --prefix=`pwd`/vlc_install_dir
>          --enable-macosx
> -- 1.7.7.5 (Apple Git-26)

OK if tested (perhaps needs a buildbot update but i can take care of it
if you don't change it)

> 0002-configure.ac-added-support-for-native-iOS-compilatio.patch
> 
> 
> From 3de4d3c2f5589426e060c504eb98f355d95a0ffd 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 23:14:41 +0100
> Subject: [PATCH 2/3] configure.ac: added support for native iOS compilation
> 
> ---
>  configure.ac |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index ee62b49..6ecd16a 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"
> +      ;;
>      esac
>  
>      SYS=darwin
> -- 1.7.7.5 (Apple Git-26)
> 
> 
> 0003-ios-build.sh-improve-libvlc-compilation.patch
> 
> 
> From 902ecb264539f6010aba36bb2fbba4f3ed9b639c 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 23:16:00 +0100
> Subject: [PATCH 3/3] ios/build.sh: improve libvlc compilation
> 
> ---
>  extras/package/ios/build.sh |   13 +++++++------
>  1 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/extras/package/ios/build.sh b/extras/package/ios/build.sh
> index 1b4efaf..b60fe24 100755
> --- a/extras/package/ios/build.sh
> +++ b/extras/package/ios/build.sh
> @@ -118,7 +118,7 @@ spopd
>  
>  info "Building contrib for iOS in '${VLCROOT}/contrib/iPhone${PLATFORM}'"
>  
> -# The contrib will read the following
> +# The contrib and configure will read the following
>  export AR="xcrun ar"
>  
>  export RANLIB="xcrun ranlib"
> @@ -130,13 +130,13 @@ export STRIP="xcrun strip"
>  
>  
>  export SDKROOT
> +export CFLAGS="-isysroot ${SDKROOT} -arch ${ARCH} -miphoneos-version-min=5.0 ${OPTIM}"
>  export CPPFLAGS="${CFLAGS}"
>  export CXXFLAGS="${CFLAGS}"
> -export CFLAGS="-isysroot ${SDKROOT} -arch ${ARCH} -miphoneos-version-min=5.0 ${OPTIM}"
>  export OBJCFLAGS="${CFLAGS}"
>  
> -export CPP="xcrun cc -E"
> -export CXXCPP="xcrun c++ -E"
> +export CPP="xcrun clang -E"
> +export CXXCPP="xcrun clang++ -E"
>  
>  if [ "$PLATFORM" = "Simulator" ]; then
>      # Use the new ABI on simulator, else we can't build
> @@ -257,7 +257,7 @@ ${VLCROOT}/configure \
>      --disable-faad \
>      --disable-lua \
>      --disable-mad \
> -    --disable-a52 \
> +    --enable-a52 \
>      --disable-fribidi \
>      --disable-macosx-audio \
>      --disable-qt4 --disable-skins2 \
> @@ -269,8 +269,9 @@ ${VLCROOT}/configure \
>      --disable-httpd \
>      --disable-nls \
>      --disable-glx \
> -    --enable-visual \
> +    --disable-visual \
>      --disable-lua \
> +    --without-x \
>      --disable-sse \
>      --disable-neon \
>      --disable-notify \

OK

Thanks



More information about the vlc-devel mailing list