X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=extras%2Fpackage%2Fios%2Fbuild.sh;h=778e28bde5aff72759a8c289edbd3be6de22d2d7;hb=a9c89123ff7576aa42bcfd5e9792479c307011a4;hp=5c0d677aa52f679b297a346c94da6583a3ea46e9;hpb=93669d4b0514a2802422b1021b7eade9dda85dff;p=vlc diff --git a/extras/package/ios/build.sh b/extras/package/ios/build.sh index 5c0d677aa5..778e28bde5 100755 --- a/extras/package/ios/build.sh +++ b/extras/package/ios/build.sh @@ -3,16 +3,25 @@ set -e PLATFORM=OS VERBOSE=no -SDK_VERSION=5.0 +DEBUG=no +SDK_VERSION=7.0 +SDK_MIN=6.1 +SIXTYFOURBIT_SDK_MIN=7.0 +ARCH=armv7 +SCARY=yes usage() { cat << EOF -usage: $0 [-s] [-k sdk] +usage: $0 [-s] [-d] [-v] [-k sdk] OPTIONS - -k Specify which sdk to use ('xcodebuild -showsdks', current: ${SDK}) - -s Build for simulator + -k Specify which sdk to use ('xcodebuild -showsdks', current: ${SDK_VERSION}) + -s Build for simulator + -a Specify which arch to use (current: ${ARCH}) + -d Enable debug + -v Enable verbose command-line output + -w Build a limited stack of non-scary libraries only EOF } @@ -33,7 +42,7 @@ info() echo "[${blue}info${normal}] $1" } -while getopts "hvsk:" OPTION +while getopts "hvwdsk:a:" OPTION do case $OPTION in h) @@ -45,10 +54,18 @@ do ;; s) PLATFORM=Simulator - SDK=5.0 + ;; + d) + DEBUG=yes + ;; + w) + SCARY=no ;; k) - SDK=$OPTARG + SDK_VERSION=$OPTARG + ;; + a) + ARCH=$OPTARG ;; ?) usage @@ -68,15 +85,18 @@ if [ "$VERBOSE" = "yes" ]; then out="/dev/stdout" fi -info "Building libvlc for the iOS" +info "Building libvlc for iOS" if [ "$PLATFORM" = "Simulator" ]; then - TARGET="i686-apple-darwin10" - ARCH="i386" + TARGET="${ARCH}-apple-darwin11" else TARGET="arm-apple-darwin11" - ARCH="armv7" - OPTIM="-mno-thumb" +fi + +if [ "$DEBUG" = "yes" ]; then + OPTIM="-O0 -g" +else + OPTIM="-O3 -g" fi info "Using ${ARCH} with SDK version ${SDK_VERSION}" @@ -99,24 +119,19 @@ then exit 1 fi -BUILDDIR="${VLCROOT}/build-ios-${PLATFORM}" - -PREFIX="${VLCROOT}/install-ios-${PLATFORM}" +BUILDDIR="${VLCROOT}/build-ios-${PLATFORM}/${ARCH}" -IOS_GAS_PREPROCESSOR="${VLCROOT}/extras/package/ios/resources/gas-preprocessor.pl" +PREFIX="${VLCROOT}/install-ios-${PLATFORM}/${ARCH}" export PATH="${VLCROOT}/extras/tools/build/bin:${VLCROOT}/contrib/${TARGET}/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin" -# contains gas-processor.pl -export PATH=$PATH:${VLCROOT}/extras/package/ios/resources - info "Building tools" spushd "${VLCROOT}/extras/tools" ./bootstrap -make +make && make .gas spopd -info "Building contrib for iOS in '${VLCROOT}/contrib/iPhone${PLATFORM}'" +info "Building contrib for iOS in '${VLCROOT}/contrib/iPhone${PLATFORM}-${ARCH}'" # The contrib will read the following export AR="xcrun ar" @@ -128,57 +143,116 @@ export CXX="xcrun clang++" export LD="xcrun ld" export STRIP="xcrun strip" +export PLATFORM=$PLATFORM +export SDK_VERSION=$SDK_VERSION + +export CFLAGS="-isysroot ${SDKROOT} -arch ${ARCH} ${OPTIM}" + +if [ "$PLATFORM" = "OS" ]; then +if [ "$ARCH" != "arm64" ]; then +export CFLAGS="${CFLAGS} -mcpu=cortex-a8 -miphoneos-version-min=${SDK_MIN}" +else +export CFLAGS="${CFLAGS} -miphoneos-version-min=${SIXTYFOURBIT_SDK_MIN}" +fi +else +export CFLAGS="${CFLAGS} -miphoneos-version-min=${SIXTYFOURBIT_SDK_MIN}" +fi + +export CXXFLAGS="${CFLAGS} -stdlib=libstdc++" -export SDKROOT 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 BUILDFORIOS="yes" + if [ "$PLATFORM" = "Simulator" ]; then # Use the new ABI on simulator, else we can't build export OBJCFLAGS="-fobjc-abi-version=2 -fobjc-legacy-dispatch ${OBJCFLAGS}" fi +export LDFLAGS="-L${SDKROOT}/usr/lib -arch ${ARCH} -isysroot ${SDKROOT}" + if [ "$PLATFORM" = "OS" ]; then - export LDFLAGS="-L${SDKROOT}/usr/lib -arch ${ARCH} -isysroot ${SDKROOT} -miphoneos-version-min=5.0 " + EXTRA_CFLAGS="-arch ${ARCH}" + EXTRA_LDFLAGS="-arch ${ARCH}" +if [ "$ARCH" != "arm64" ]; then + EXTRA_CFLAGS+=" -mcpu=cortex-a8" + EXTRA_CFLAGS+=" -miphoneos-version-min=${SDK_MIN}" + EXTRA_LDFLAGS+=" -Wl,-ios_version_min,${SDK_MIN}" + export LDFLAGS="${LDFLAGS} -Wl,-ios_version_min,${SDK_MIN}" +else + EXTRA_CFLAGS+=" -miphoneos-version-min=${SIXTYFOURBIT_SDK_MIN}" + EXTRA_LDFLAGS+=" -Wl,-ios_version_min,${SIXTYFOURBIT_SDK_MIN}" + export LDFLAGS="${LDFLAGS} -Wl,-ios_version_min,${SIXTYFOURBIT_SDK_MIN}" +fi else - export LDFLAGS="-syslibroot=${SDKROOT}/ -arch ${ARCH} " + EXTRA_CFLAGS="-arch ${ARCH}" + EXTRA_CFLAGS+=" -miphoneos-version-min=${SIXTYFOURBIT_SDK_MIN}" + EXTRA_LDFLAGS=" -Wl,-ios_version_min,${SIXTYFOURBIT_SDK_MIN}" + export LDFLAGS="${LDFLAGS} -Wl-ios_version_min,${SIXTYFOURBIT_SDK_MIN}" fi + info "LD FLAGS SELECTED = '${LDFLAGS}'" spushd ${VLCROOT}/contrib echo ${VLCROOT} -mkdir -p "${VLCROOT}/contrib/iPhone${PLATFORM}" -cd "${VLCROOT}/contrib/iPhone${PLATFORM}" +mkdir -p "${VLCROOT}/contrib/iPhone${PLATFORM}-${ARCH}" +cd "${VLCROOT}/contrib/iPhone${PLATFORM}-${ARCH}" if [ "$PLATFORM" = "OS" ]; then - export AS="${IOS_GAS_PREPROCESSOR} ${CC}" - export ASCPP="${IOS_GAS_PREPROCESSOR} ${CC}" + export AS="gas-preprocessor.pl ${CC}" + export ASCPP="gas-preprocessor.pl ${CC}" + export CCAS="gas-preprocessor.pl ${CC}" + if [ "$ARCH" = "arm64" ]; then + export GASPP_FIX_XCODE5=1 + fi else - export AS="xcrun as" - export ASCPP="xcrun as" + export ASCPP="xcrun as" fi -../bootstrap --host=${TARGET} --build="i686-apple-darwin10" --disable-disc --disable-sout > ${out} +../bootstrap --build=x86_64-apple-darwin11 --host=${TARGET} --prefix=${VLCROOT}/contrib/${TARGET}-${ARCH} --arch=${ARCH} --disable-gpl \ + --disable-disc --disable-sout \ + --disable-sdl \ + --disable-SDL_image \ + --disable-iconv \ + --enable-zvbi \ + --disable-kate \ + --disable-caca \ + --disable-gettext \ + --disable-mpcdec \ + --disable-upnp \ + --disable-gme \ + --disable-tremor \ + --enable-vorbis \ + --disable-sidplay2 \ + --disable-samplerate \ + --disable-goom \ + --disable-vncserver \ + --disable-orc \ + --disable-schroedinger \ + --disable-libmpeg2 \ + --disable-chromaprint \ + --disable-mad \ + --enable-fribidi \ + --enable-libxml2 \ + --enable-freetype2 \ + --enable-ass \ + --disable-fontconfig \ + --disable-gpg-error \ + --disable-lua \ + --enable-vpx \ + --enable-taglib > ${out} + +echo "EXTRA_CFLAGS += ${EXTRA_CFLAGS}" >> config.mak +echo "EXTRA_LDFLAGS += ${EXTRA_LDFLAGS}" >> config.mak +make fetch make spopd - -if [ "$PLATFORM" = "OS" ]; then - export AS="${IOS_GAS_PREPROCESSOR} ${CC}" - export ASCPP="${IOS_GAS_PREPROCESSOR} ${CC}" -else - export AS="xcrun as" - export ASCPP="xcrun as" -fi - - info "Bootstraping vlc" pwd info "VLCROOT = ${VLCROOT}" @@ -196,75 +270,88 @@ if [ ".$PLATFORM" != ".Simulator" ]; then export AVFORMAT_LIBS="-L${PREFIX}/lib -lavcodec -lz -lavutil -lavformat" fi -export DVBPSI_CFLAGS="-I${VLCROOT}/contrib-ios-${TARGET}/include " -export DVBPSI_LIBS="-L${VLCROOT}/contrib-ios-${TARGET}/lib " - -export SWSCALE_CFLAGS="-I${VLCROOT}/contrib-ios-${TARGET}/include " -export SWSCALE_LIBS="-L${VLCROOT}/contrib-ios-${TARGET}/lib " - - - mkdir -p ${BUILDDIR} spushd ${BUILDDIR} info ">> --prefix=${PREFIX} --host=${TARGET}" +if [ "$DEBUG" = "yes" ]; then + DEBUGFLAG="--enable-debug" +else + DEBUGFLAG="--disable-debug" +fi + +if [ "$SCARY" = "yes" ]; then + SCARYFLAG="--enable-dvbpsi --enable-avcodec" +else + SCARYFLAG="--disable-dca --disable-dvbpsi --disable-avcodec --disable-avformat --disable-zvbi --enable-vpx" +fi + # Run configure only upon changes. if [ "${VLCROOT}/configure" -nt config.log -o \ "${THIS_SCRIPT_PATH}" -nt config.log ]; then -CONTRIB_DIR=${VLCROOT}/contrib-ios-${TARGET} \ ${VLCROOT}/configure \ --prefix="${PREFIX}" \ --host="${TARGET}" \ - --enable-debug \ - --enable-static-modules \ + --with-contrib="${VLCROOT}/contrib/${TARGET}-${ARCH}" \ + --enable-static \ + ${DEBUGFLAG} \ + ${SCARYFLAG} \ --disable-macosx \ - --disable-macosx-defaults \ - --disable-macosx-vout \ --disable-macosx-dialog-provider \ --disable-macosx-qtkit \ --disable-macosx-eyetv \ --disable-macosx-vlc-app \ - --with-macosx-sdk=${SDKROOT} \ - --enable-audioqueue \ - --enable-ios-vout \ + --disable-macosx-avfoundation \ + --disable-audioqueue \ --disable-shared \ - --disable-macosx-quartztext \ - --enable-avcodec \ - --disable-avio \ - --disable-dummy \ - --disable-mkv \ - --enable-ffmpeg \ - --enable-dvbpsi \ - --enable-swscale \ - --disable-projectm \ + --enable-macosx-quartztext \ + --enable-mkv \ + --enable-opus \ --disable-sout \ --disable-faad \ - --disable-mad \ + --disable-lua \ --disable-a52 \ - --disable-fribidi \ - --disable-jpeg \ - --disable-macosx-audio \ - --disable-qtcapture \ - --disable-qtsound \ - --disable-qt4 --disable-skins2 \ - --disable-libgcrypt \ - --disable-remoteosd \ + --enable-fribidi \ + --disable-qt --disable-skins2 \ --disable-vcd \ - --disable-postproc \ --disable-vlc \ - --disable-audio_filter \ - --disable-spatializer \ --disable-vlm \ --disable-httpd \ --disable-nls \ --disable-glx \ - --enable-visual \ - --disable-lua \ --disable-sse \ - --disable-neon \ + --enable-neon \ --disable-notify \ - --disable-mmx > ${out} # MMX and SSE support requires llvm which is broken on Simulator + --enable-live555 \ + --enable-realrtsp \ + --enable-swscale \ + --disable-projectm \ + --enable-libass \ + --enable-libxml2 \ + --disable-goom \ + --disable-dvdread \ + --disable-dvdnav \ + --disable-bluray \ + --disable-linsys \ + --disable-libva \ + --disable-gme \ + --disable-tremor \ + --enable-vorbis \ + --disable-fluidsynth \ + --disable-jack \ + --disable-pulse \ + --disable-mtp \ + --enable-ogg \ + --enable-speex \ + --enable-theora \ + --enable-flac \ + --disable-screen \ + --enable-freetype \ + --enable-taglib \ + --disable-mmx \ + --disable-addonmanagermodules \ + --disable-mad > ${out} # MMX and SSE support requires llvm which is broken on Simulator fi CORE_COUNT=`sysctl -n machdep.cpu.core_count` @@ -275,4 +362,111 @@ make -j$MAKE_JOBS > ${out} info "Installing libvlc" make install > ${out} + +find ${PREFIX}/lib/vlc/plugins -name *.a -type f -exec cp '{}' ${PREFIX}/lib/vlc/plugins \; +rm -rf "${PREFIX}/contribs" +cp -R "${VLCROOT}/contrib/${TARGET}-${ARCH}" "${PREFIX}/contribs" + +info "Removing unneeded modules" +blacklist=" +stats +access_bd +shm +access_imem +oldrc +real +hotkeys +gestures +dynamicoverlay +rss +ball +marq +magnify +audiobargraph_ +clone +mosaic +osdmenu +puzzle +mediadirs +t140 +ripple +motion +sharpen +grain +posterize +mirror +wall +scene +blendbench +psychedelic +alphamask +netsync +audioscrobbler +motiondetect +motionblur +export +smf +podcast +bluescreen +erase +stream_filter_record +speex_resampler +remoteosd +magnify +gradient +tospdif +dtstofloat32 +logger +visual +fb +aout_file +dummy +invert +sepia +wave +hqdn3d +headphone_channel_mixer +gaussianblur +gradfun +extract +colorthres +antiflicker +anaglyph +remap +oldmovie +vhs +demuxdump +fingerprinter +" + +if [ "$SCARY" = "no" ]; then +blacklist="${blacklist} +dts +dvbsub +svcd +hevc +packetizer_mlp +a52 +vc1 +uleaddvaudio +librar +libvoc +avio +chorus_flanger +smooth +cvdsub +libmod +libdash +libmpgv +dolby_surround +mpeg_audio" +fi + +echo ${blacklist} + +for i in ${blacklist} +do + find ${PREFIX}/lib/vlc/plugins -name *$i* -type f -exec rm '{}' \; +done + popd