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-net configure to not build networking 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=
PKGS_ENABLE=
PKGS_DISABLE=
BUILD_ENCODERS="1"
+BUILD_NETWORK="1"
BUILD_DISCS="1"
+GPL="1"
if test ! -f "../../contrib/src/main.mak"
then
--disable-disc)
BUILD_DISCS=
;;
+ --disable-net)
+ BUILD_NETWORK=
+ ;;
--disable-sout)
BUILD_ENCODERS=
;;
--enable-small)
ENABLE_SMALL=1
;;
+ --disable-gpl)
+ GPL=
+ ;;
--disable-*)
PKGS_DISABLE="${PKGS_DISABLE} ${1#--disable-}"
;;
if test -z "$BUILD"
then
echo -n "Guessing build system... "
- BUILD="`cc -dumpmachine`"
+ BUILD="`${CC:-cc} -dumpmachine`"
if test -z "$BUILD"; then
echo "FAIL!"
exit 1
# Prepare files
#
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.
done
}
-check_macosx_sdk()
+check_ios_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}" ]
+ if test -z "$SDKROOT"
then
- echo "
-*** ${SDK} does not exist, please install required SDK, or use export OSX_VERSION=10.6 ***
-"
- exit 1
+ 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 "OSX_VERSION ?= ${OSX_VERSION}"
+ add_make "IOS_SDK=${SDKROOT}"
}
-check_ios_sdk()
+check_macosx_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 [ -z "${OSX_VERSION}" ]
+ then
+ OSX_VERSION=`xcrun --show-sdk-version`
+ echo "OSX_VERSION not specified, assuming $OSX_VERSION"
+ fi
+ 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
- echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
- exit 1
- fi
- add_make "SDKROOT=${SDKROOT}"
+ 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
+ SDKROOT_NOT_FOUND="$SDKROOT"
+ SDKROOT=`xcrun --show-sdk-path`
+ 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_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"
+ [ -z "${ANDROID_ABI}" ] && echo "You must set ANDROID_ABI environment variable" && exit 1
+ add_make "ANDROID_ABI := ${ANDROID_ABI}"
+ [ -z "${ANDROID_API}" ] && echo "You should set ANDROID_API environment variable (using default android-9)" && ANDROID_API := android-9
+ add_make "ANDROID_API := ${ANDROID_API}"
+ [ ${ANDROID_ABI} = "armeabi-v7a" ] && add_make_enabled "HAVE_NEON"
+ [ ${ANDROID_ABI} = "armeabi-v7a" ] && add_make_enabled "HAVE_ARMV7A"
+ [ ${ANDROID_ABI} = "arm64-v8a" ] && add_make_enabled "HAVE_NEON"
+ [ ${ANDROID_ABI} = "arm64-v8a" ] && add_make_enabled "HAVE_ARMV8A"
+ [ ${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 "$BUILD_NETWORK" || add_make_enabled "BUILD_NETWORK"
test -z "$ENABLE_SMALL" || add_make_enabled "ENABLE_SMALL"
+test -z "$GPL" || add_make_enabled "GPL"
#
# Checks
add_make_enabled "HAVE_MACOSX" "HAVE_DARWIN_OS" "HAVE_BSD"
else
check_ios_sdk
- add_make_enabled "HAVE_IOS" "HAVE_DARWIN_OS" "HAVE_BSD"
+ add_make_enabled "HAVE_IOS" "HAVE_DARWIN_OS" "HAVE_BSD" "HAVE_NEON" "HAVE_ARMV7A"
fi
;;
*bsd*)
add_make_enabled "HAVE_BSD"
;;
- linux-androideabi)
+ *android*)
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}"
+ case "${HOST}" in
+ *arm*)
+ add_make "PLATFORM_SHORT_ARCH := arm"
+ ;;
+ *arm64*)
+ add_make "PLATFORM_SHORT_ARCH := arm64"
+ ;;
+ *i686*)
+ add_make "PLATFORM_SHORT_ARCH := x86"
+ ;;
+ *x86_64*)
+ add_make "PLATFORM_SHORT_ARCH := x86_64"
+ ;;
+ *mipsel*)
+ add_make "PLATFORM_SHORT_ARCH := mips"
+ ;;
+ esac
;;
*linux*)
add_make_enabled "HAVE_LINUX"
;;
- *wince*)
- add_make_enabled "HAVE_WINCE"
- ;;
*mingw*)
add_make_enabled "HAVE_WIN32"
;;
+ *solaris*)
+ add_make_enabled "HAVE_SOLARIS"
+ ;;
esac
#
# Results output
#
test -e Makefile && unlink Makefile
-ln -sf ../../contrib/src/main.mak Makefile
+ln -sf ../../contrib/src/main.mak Makefile || exit $?
cat << EOF
Bootstrap completed.
* make package prepare prebuilt packages
EOF
-mkdir -p ../../contrib/tarballs
+mkdir -p ../../contrib/tarballs || exit $?