X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=extras%2Fcontrib%2Fbootstrap;h=36db6630ce362168b8c68a779ac45a2fe7826c56;hb=2e57a2c0ffe5cd283d4f909e4aaf09bbc3a004af;hp=82ced5beb577e0ea9ff527047353eda5a390693f;hpb=635efb6284ec941dcf091b6e4bbb5e48a23662c6;p=vlc diff --git a/extras/contrib/bootstrap b/extras/contrib/bootstrap index 82ced5beb5..36db6630ce 100755 --- a/extras/contrib/bootstrap +++ b/extras/contrib/bootstrap @@ -24,6 +24,13 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. # *************************************************************************** +cat >&2 << EOF +WARNING: This method of building third party libraries has been deprecated, + and is not supported anymore. + +Building from the /contrib folder is recommended instead of /extras/contrib. +EOF + LANG=C export LANG set -e @@ -149,14 +156,6 @@ rm -f "${config_mak}" echo "# Make changes if you know what you're doing." } > "${config_mak}" -# Create distro.mak -distro_mak="${BUILDDIR}/distro.mak" -rm -f "${distro_mak}" -{ - echo "# Automatically generated by bootstrap" - echo "# Make changes if you know what you're doing." -} > "${distro_mak}" - if test "$TARGET" != "$BUILD"; then test -z "$CC" && CC="${TARGET}-gcc" test -z "$CXX" && CXX="${TARGET}-g++" @@ -200,6 +199,9 @@ case $TARGET in *wince*) add_enabled_makefile_cfg "HAVE_WINCE" ;; + *symbian*) + add_enabled_makefile_cfg "HAVE_SYMBIAN" + ;; esac # Figure out the correct distro to use @@ -210,39 +212,25 @@ case $TARGET in exit 1 ;; powerpc-apple-darwin9) - hint_distro darwin + hint_distro macosx32 HAVE_DARWIN_32=1 CFLAGS_TUNING=" -arch ppc -mtune=G4" EXTRA_LDFLAGS=" -arch ppc" - - # FIXME - this one seems to be redundant? - LD="ld -arch ppc -syslibroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}" ;; i686-apple-darwin*) - hint_distro darwin + hint_distro macosx32 HAVE_DARWIN_32=1 CFLAGS_TUNING=" -march=prescott -mtune=generic -arch i386 -m32" EXTRA_LDFLAGS=" -arch i386" - - add_enabled_makefile_cfg "HAVE_DARWIN_OS_ON_INTEL" - if test $TARGET = "i686-apple-darwin10"; then - add_enabled_makefile_cfg "HAVE_DARWIN_10" - fi ;; x86_64-apple-darwin*) - hint_distro darwin64 + hint_distro macosx64 HAVE_DARWIN_64=1 CFLAGS_TUNING=" -march=core2 -mtune=core2 -m64 -arch x86_64" EXTRA_LDFLAGS=" -arch x86_64" - - add_enabled_makefile_cfg "HAVE_DARWIN_OS_ON_INTEL" - add_makefile_cfg "PATH = /bin:/usr/bin:/usr/local/bin" - if test $TARGET = "x86_64-apple-darwin10"; then - add_enabled_makefile_cfg "HAVE_DARWIN_10" - fi ;; *mingw32ce) EXTRA_CPPFLAGS=" -D_WIN32_WCE=0x0500" @@ -278,12 +266,10 @@ case $TARGET in ;; arm-none-linux-gnueabi) if test -f /etc/maemo_version; then - hint_distro maemo + hint_distro maemo5 EXTRA_CFLAGS=" -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a" EXTRA_CFLAGS="$EXTRA_CFLAGS -mfpu=neon -mfloat-abi=softfp" EXTRA_CFLAGS="$EXTRA_CFLAGS -O3 -fno-tree-vectorize" - else - EXTRA_CFLAGS="-msoft-float" fi ;; *86_64*linux*) @@ -310,20 +296,17 @@ if test -z "${DISTRO}" -a "$TARGET" = "$BUILD"; then fi fi # Try to match distribution - if test -f /etc/fedora-release; then - hint_distro fedora - elif test -f /etc/maemo_version; then - hint_distro maemo - elif test -f /etc/debian_version; then - # NOTE: check for Debian *after* its derivatives - hint_distro debian + if test -f /etc/maemo_version; then + hint_distro maemo5 fi fi # Default Unix-like systems hint_distro unix -cat src/Distributions/"${DISTRO}".mak >> "${distro_mak}" +distro_mak="${BUILDDIR}/distro.mak" +distro_file="`pwd`/src/Distributions/${DISTRO}.mak" +ln -sf "${distro_file}" "${distro_mak}" # # Distro specific settings @@ -338,17 +321,30 @@ case "$DISTRO" in fi add_makefile_cfg "IOS_SDK_ROOT = ${IOS_SDK_ROOT}" ;; - darwin*) - SDK_TARGET=10.5 - HAVE_DARWIN_9=1 + macosx*) + SDK_TARGET=10.6 + HAVE_MACOSX_DARWIN_9=1 EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -isysroot \${MACOSX_SDK} -Wl,-syslibroot,\${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}" EXTRA_CFLAGS="${EXTRA_CFLAGS} -D\${ENVP} -isysroot \${MACOSX_SDK} -mmacosx-version-min=\${SDK_TARGET}" - CC="/usr/bin/gcc-4.2" - CXX="/usr/bin/g++-4.2" + CC="/usr/bin/clang" + CXX="/usr/bin/clang++" + LD="ld" + RANLIB="ranlib" + AR= + STRIP="strip" add_makefile_cfg "PATH = /bin:/usr/bin:/usr/local/bin" add_makefile_cfg "SDK_TARGET = ${SDK_TARGET}" add_makefile_cfg "ENVP = MACOSX_DEPLOYMENT_TARGET=${SDK_TARGET}" add_makefile_cfg "MACOSX_SDK = /Developer/SDKs/MacOSX${SDK_TARGET}.sdk" + add_enabled_makefile_cfg "HAVE_MACOSX" + + case $TARGET in + x86_64*|i686*) add_enabled_makefile_cfg "HAVE_MACOSX_ON_INTEL" ;; + esac + case $TARGET in + *darwin10) add_enabled_makefile_cfg "HAVE_MACOSX_DARWIN_10" ;; + *darwin9) add_enabled_makefile_cfg "HAVE_MACOSX_DARWIN_9" ;; + esac if ! test -e /Developer/SDKs; then error "Your Developer Tools' SDKs were not found.\nYou need to add extra symbolic links to /Developer to achieve correctly\nbuilt contribs.\nHave a look at the OSX-Compile-HOWTO for details." >&2 @@ -358,6 +354,36 @@ case "$DISTRO" in win*) add_makefile_cfg "PKG_CONFIG_PATH = \$(PREFIX)/lib/pkgconfig" ;; + android) + if test -z "$ANDROID_NDK"; then + error "The bootstrap script requires the ANDROID_NDK environment variable " + error "to be set when building for Android" + exit 1 + fi + # The given host (arm-eabi) is not the real one (arm-linux-androideabi) + ln -sfn $TARGET hosts/arm-linux-androideabi + CC="arm-linux-androideabi-gcc --sysroot=$ANDROID_NDK/platforms/android-9/arch-arm" + CXX="arm-linux-androideabi-g++ --sysroot=$ANDROID_NDK/platforms/android-9/arch-arm" + NM=arm-linux-androideabi-nm + AR=arm-linux-androideabi-ar + LD=arm-linux-androideabi-ld + RANLIB=arm-linux-androideabi-ranlib + STRIP=arm-linux-androideabi-strip + # Add the PATH to the NDK + add_makefile_cfg "ANDROID_NDK = ${ANDROID_NDK}" + add_makefile_cfg "PATH = ${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:${PATH}" + + add_enabled_makefile_cfg "HAVE_LINUX" + if test -z "$NO_NEON"; then + add_enabled_makefile_cfg "HAVE_NEON" + ARM_EABI=armeabi-v7a + else + ARM_EABI=armeabi + fi + # make sure android toolchain can build C++ + EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS -D__STDC_VERSION__=199901L" + EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/include" + EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/libs/$ARM_EABI/include" esac # Save passed flags @@ -388,18 +414,24 @@ add_makefile_cfg "EXTRA_LDFLAGS = ${EXTRA_LDFLAGS}" add_makefile_cfg "EXTRA_PATH = ${EXTRA_PATH}" #CMAKE -if test "$TARGET" != "$BUILD"; then - toolchain_cmake="${BUILDDIR}/toolchain.cmake" - if test ${DISTRO} = "win32"; then - echo "SET(CMAKE_SYSTEM_NAME Windows)" >> "${toolchain_cmake}" - fi - echo "SET(CMAKE_C_COMPILER ${CC})" >> "${toolchain_cmake}" - echo "SET(CMAKE_CXX_COMPILER ${CXX})" >> "${toolchain_cmake}" - echo "SET(CMAKE_FIND_ROOT_PATH `pwd` )" >> "${toolchain_cmake}" - echo "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)" >> "${toolchain_cmake}" - echo "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)" >> "${toolchain_cmake}" - echo "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" >> "${toolchain_cmake}" +toolchain_cmake="${BUILDDIR}/toolchain.cmake" +rm -f ${BUILDDIR}/toolchain.cmake +if test ${DISTRO} = "win32"; then + echo "SET(CMAKE_SYSTEM_NAME Windows)" >> "${toolchain_cmake}" + echo "SET(CMAKE_RC_COMPILER ${TARGET}-windres)" >> "${toolchain_cmake}" fi +case "$DISTRO" in macosx*) + echo "SET(CMAKE_SYSTEM_NAME Darwin)" >> "${toolchain_cmake}" + echo "set(CMAKE_C_FLAGS ${CFLAGS_TUNING} ${EXTRA_CFLAGS})" >> "${toolchain_cmake}" + echo "set(CMAKE_CXX_FLAGS ${CFLAGS_TUNING} ${EXTRA_CFLAGS})" >> "${toolchain_cmake}" + echo "set(CMAKE_LD_FLAGS ${EXTRA_LDFLAGS})" >> "${toolchain_cmake}" +esac +echo "SET(CMAKE_C_COMPILER ${CC})" >> "${toolchain_cmake}" +echo "SET(CMAKE_CXX_COMPILER ${CXX})" >> "${toolchain_cmake}" +echo "SET(CMAKE_FIND_ROOT_PATH `pwd` )" >> "${toolchain_cmake}" +echo "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)" >> "${toolchain_cmake}" +echo "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)" >> "${toolchain_cmake}" +echo "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" >> "${toolchain_cmake}" if wget --version >/dev/null 2>&1; then add_makefile_cfg "WGET = \"`which wget`\" -c --passive" @@ -431,30 +463,28 @@ if test -z "$CONTRIBS_RELEASE"; then info "*****************************************************************" fi -if test $HAVE_DARWIN_9; then - add_enabled_makefile_cfg "HAVE_DARWIN_9" - if ! /usr/bin/gcc-4.2 --version>/dev/null 2>&1; then - error "You do not have GCC-4.2 installed in /usr/bin, compilation WILL FAIL." +if test $HAVE_MACOSX_DARWIN_9; then + add_enabled_makefile_cfg "HAVE_MACOSX_DARWIN_9" + if ! /usr/bin/gcc --version>/dev/null 2>&1; then + error "You do not have GCC installed in /usr/bin, compilation WILL FAIL." fi fi -if test $HAVE_DARWIN_32; then - add_enabled_makefile_cfg "HAVE_DARWIN_32" +if test "$DISTRO" = "macosx32"; then info "*****************************************************************" - info "* VLC will be compiled in 32bit mode. *" + info "* VLC will be compiled in 32bit mode using the 10.5 & later SDK.*" info "* *" - info "* Re-run with the x86_64-apple-darwin* argument to turn on *" + info "* Re-run with the -t x86_64-apple-darwin* argument to turn on *" info "* 64bit compilation for Intel-based Macs, whereas * is either *" info "* 9 or 10 depending on your Darwin version. *" - info "* There is NO PPC64 support right now. *" + info "* There is no PPC64 support. *" info "*****************************************************************" fi -if test $HAVE_DARWIN_64; then - add_enabled_makefile_cfg "HAVE_DARWIN_64" +if test "$DISTRO" = "macosx64"; then info info "*****************************************************************" - info "* VLC will be compiled in 64bit mode using the 10.5 SDK. *" + info "* VLC will be compiled in 64bit mode using the 10.5 & later SDK.*" info "*****************************************************************" fi @@ -462,9 +492,9 @@ case `uname` in Linux) CPUS=`grep -c ^processor /proc/cpuinfo` ;; - Darwin) - CPUS=`sysctl hw.ncpu|cut -d: -f2` - ;; +# Darwin) +# CPUS=`sysctl hw.ncpu|cut -d: -f2` +# ;; *) CPUS=1 # default ;;