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]"
}
BUILD=
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
--disable-sout)
BUILD_ENCODERS=
;;
+ --enable-small)
+ ENABLE_SMALL=1
+ ;;
--disable-*)
PKGS_DISABLE="${PKGS_DISABLE} ${1#--disable-}"
;;
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
# 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
done
}
+check_macosx_sdk()
+{
+ [ -z "${OSX_VERSION}" ] && echo "OSX_VERSION not specified, assuming 10.6" && OSX_VERSION=10.6
+ 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 "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}"
+ 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"
+test -z "$ENABLE_SMALL" || add_make_enabled "ENABLE_SMALL"
#
# 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"
+ fi
;;
*bsd*)
add_make_enabled "HAVE_BSD"
;;
+ linux-androideabi)
+ check_android_sdk
+ add_make_enabled "HAVE_LINUX" "HAVE_ANDROID"
+ add_make "PATH = ${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:${PATH}"
+ ;;
*linux*)
add_make_enabled "HAVE_LINUX"
;;
# 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:
* 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