]> git.sesse.net Git - vlc/blobdiff - contrib/bootstrap
Move MD5 test to src/
[vlc] / contrib / bootstrap
index 53dfedfa7cb7d44f5f6073b826920fbf633d60b9..170b8f128988dcc958bddd1ad43532206360be67 100755 (executable)
@@ -24,13 +24,21 @@ usage()
        echo "  --build=BUILD    configure for building on BUILD"
        echo "  --host=HOST      cross-compile to build to run on HOST"
        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"
 }
 
 BUILD=
 HOST=
 PREFIX=
+PKGS_ENABLE=
+PKGS_DISABLE=
+BUILD_ENCODERS="1"
+BUILD_DISCS="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
@@ -52,6 +60,18 @@ do
                --prefix=*)
                        PREFIX="${1#--prefix=}"
                        ;;
+               --disable-disc)
+                       BUILD_DISCS=
+                       ;;
+               --disable-sout)
+                       BUILD_ENCODERS=
+                       ;;
+               --disable-*)
+                       PKGS_DISABLE="${PKGS_DISABLE} ${1#--disable-}"
+                       ;;
+               --enable-*)
+                       PKGS_ENABLE="${PKGS_ENABLE} ${1#--enable-}"
+                       ;;
                *)
                        echo "Unrecognized options $1"
                        usage
@@ -83,17 +103,11 @@ 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
 cat >&3 << EOF
@@ -101,7 +115,8 @@ cat >&3 << EOF
 # 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
 
 add_make()
@@ -122,12 +137,38 @@ add_make_enabled()
        done
 }
 
+check_macosx_sdk()
+{
+   [ -z "${OSX_VERSION}" ] && echo "OSX_VERSION not specified, assuming 10.5" && OSX_VERSION=10.5
+   SDK="/Developer/SDKs/MacOSX${OSX_VERSION}.sdk"
+   if [ ! -d "${SDK}" ]
+   then
+          echo "
+*** ${SDK} does not exist, please install required SDK, or use export OSX_VERSION=10.6 ***
+"
+          exit 1
+   fi
+   add_make "OSX_VERSION ?= ${OSX_VERSION}"
+}
+
+check_android_sdk()
+{
+       [ -z "${ANDROID_NDK}" ] && echo "You must set ANDROID_NDK environment variable" && exit 1
+       add_make "ANDROID_NDK := ${ANDROID_NDK}"
+       test -z "${NO_NEON}" && add_make_enabled "HAVE_NEON"
+}
+
+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"
+
 #
 # Checks
 #
 OS="${HOST#*-}" # strip architecture
 case "${OS}" in
        apple-darwin*)
+               check_macosx_sdk
                add_make_enabled "HAVE_MACOSX" "HAVE_DARWIN_OS" "HAVE_BSD"
                ;;
        *darwin*)
@@ -136,29 +177,29 @@ case "${OS}" in
        *bsd*)
                add_make_enabled "HAVE_BSD"
                ;;
+       linux-androideabi)
+               check_android_sdk
+               add_make_enabled "HAVE_LINUX" "HAVE_ANDROID"
+               ;;
        *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
 cat << EOF
 Bootstrap completed.
 
-The following packages were selected:
-$PKGS
-
 Run "make" to start compilation.
 
 Other targets:
@@ -166,6 +207,9 @@ Other targets:
  * 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 list         list packages
 EOF
+
+mkdir -p ../../contrib/tarballs