X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=contrib%2Fbootstrap;h=6bf7bd5520e0b40d32b436973322144ffc2032e0;hb=194e237ea1021555b9d654d22c50dd531a6c5da1;hp=b504173c3d065e3b0b75ebe5d88039c625e1bca4;hpb=9596739f167e9189094dcc55031f0af08d0a1b74;p=vlc diff --git a/contrib/bootstrap b/contrib/bootstrap index b504173c3d..6bf7bd5520 100755 --- a/contrib/bootstrap +++ b/contrib/bootstrap @@ -26,6 +26,10 @@ usage() echo " --prefix=PREFIX install files in PREFIX" echo " --disable-FOO configure to not build package FOO" echo " --enable-FOO configure to build package FOO" + echo " --disable-disc configure to not build optical discs packages" + echo " --disable-sout configure to not build stream output packages" + echo " --enable-small optimize libraries for size with slight speed decrease [DANGEROUS]" + echo " --disable-gpl configure to not build viral GPL code" } BUILD= @@ -33,8 +37,11 @@ HOST= PREFIX= PKGS_ENABLE= PKGS_DISABLE= +BUILD_ENCODERS="1" +BUILD_DISCS="1" +GPL="1" -if test ! -f "../src/main.mak" +if test ! -f "../../contrib/src/main.mak" then echo "$0 must be run from a subdirectory" exit 1 @@ -56,6 +63,18 @@ do --prefix=*) PREFIX="${1#--prefix=}" ;; + --disable-disc) + BUILD_DISCS= + ;; + --disable-sout) + BUILD_ENCODERS= + ;; + --enable-small) + ENABLE_SMALL=1 + ;; + --disable-gpl) + GPL= + ;; --disable-*) PKGS_DISABLE="${PKGS_DISABLE} ${1#--disable-}" ;; @@ -93,25 +112,18 @@ if test "$PREFIX" then # strip trailing slash PREFIX="${PREFIX%/}" -else - PREFIX="../hosts/$HOST" fi # # Prepare files # -echo "Creating prefix... $PREFIX" -mkdir -p -- "$PREFIX" || exit $? -mkdir -p -- "$PREFIX/share/aclocal" || exit $? - echo "Creating configuration file... config.mak" -exec 3>config.mak +exec 3>config.mak || exit $? cat >&3 << EOF # This file was automatically generated. # Any change will be overwritten if ../bootstrap is run again. BUILD := $BUILD HOST := $HOST -PREFIX := $PREFIX PKGS_DISABLE := $PKGS_DISABLE PKGS_ENABLE := $PKGS_ENABLE EOF @@ -134,50 +146,131 @@ add_make_enabled() done } +check_macosx_sdk() +{ + [ -z "${OSX_VERSION}" ] && echo "OSX_VERSION not specified, assuming 10.7" && OSX_VERSION=10.7 + if test -z "$SDKROOT" + then + SDKROOT=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$OSX_VERSION.sdk + echo "SDKROOT not specified, assuming $SDKROOT" + fi + + if [ ! -d "${SDKROOT}" ] + then + SDKROOT_NOT_FOUND=`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$OSX_VERSION.sdk + SDKROOT=`xcode-select -print-path`/SDKs/MacOSX$OSX_VERSION.sdk + echo "SDKROOT not found at $SDKROOT_NOT_FOUND, trying $SDKROOT" + fi + + if [ ! -d "${SDKROOT}" ] + then + echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***" + exit 1 + fi + + add_make "MACOSX_SDK=${SDKROOT}" + 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 + add_make "ANDROID_NDK := ${ANDROID_NDK}" + [ -z "${ANDROID_ABI}" ] && echo "You must set ANDROID_ABI environment variable" && exit 1 + add_make "ANDROID_ABI := ${ANDROID_ABI}" + [ ${ANDROID_ABI} = "armeabi-v7a" ] && add_make_enabled "HAVE_NEON" + [ ${ANDROID_ABI} = "armeabi-v7a" ] && add_make_enabled "HAVE_ARMV7A" + [ ${ANDROID_ABI} = "armeabi" -a -z "${NO_ARMV6}" ] && add_make_enabled "HAVE_ARMV6" +} + +test -z "$PREFIX" || add_make "PREFIX := $PREFIX" +test -z "$BUILD_DISCS" || add_make_enabled "BUILD_DISCS" +test -z "$BUILD_ENCODERS" || add_make_enabled "BUILD_ENCODERS" +test -z "$ENABLE_SMALL" || add_make_enabled "ENABLE_SMALL" +test -z "$GPL" || add_make_enabled "GPL" + # # Checks # OS="${HOST#*-}" # strip architecture case "${OS}" in apple-darwin*) - add_make_enabled "HAVE_MACOSX" "HAVE_DARWIN_OS" "HAVE_BSD" - ;; - *darwin*) - add_make_enabled "HAVE_DARWIN_OS" "HAVE_BSD" + if test -z "$BUILDFORIOS" + then + 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 ;; *bsd*) add_make_enabled "HAVE_BSD" ;; + *android*) + check_android_sdk + add_make_enabled "HAVE_LINUX" "HAVE_ANDROID" + case "${HOST}" in + *arm*) + add_make "PLATFORM_SHORT_ARCH := arm" + ;; + *i686*) + add_make "PLATFORM_SHORT_ARCH := x86" + ;; + *mipsel*) + add_make "PLATFORM_SHORT_ARCH := mips" + ;; + esac + ;; *linux*) add_make_enabled "HAVE_LINUX" ;; - *mingw*) - add_make_enabled "HAVE_WIN32" - ;; *wince*) add_make_enabled "HAVE_WINCE" ;; + *mingw*) + add_make_enabled "HAVE_WIN32" + ;; esac -add_make_enabled "BUILD_ENCODERS" # # Results output # test -e Makefile && unlink Makefile -ln -sf ../src/main.mak Makefile +ln -sf ../../contrib/src/main.mak Makefile || exit $? cat << EOF Bootstrap completed. -The following packages were selected: -$PKGS - Run "make" to start compilation. Other targets: * make install same as "make" + * make prebuilt fetch and install prebuilt binaries + * make list list packages * make fetch fetch required source tarballs * make fetch-all fetch all source tarballs * make distclean clean everything and undo bootstrap - * make clean clean everything * make mostlyclean clean everything except source tarballs + * make clean clean everything + * make package prepare prebuilt packages EOF + +mkdir -p ../../contrib/tarballs || exit $?