2 # Copyright (C) 2003-2011 the VideoLAN team
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 # Command line handling
23 echo "Usage: $0 [--build=BUILD] [--host=HOST] [--prefix=PREFIX]"
24 echo " --build=BUILD configure for building on BUILD"
25 echo " --host=HOST cross-compile to build to run on HOST"
26 echo " --prefix=PREFIX install files in PREFIX"
27 echo " --disable-FOO configure to not build package FOO"
28 echo " --enable-FOO configure to build package FOO"
29 echo " --disable-disc configure to not build optical discs packages"
30 echo " --disable-net configure to not build networking packages"
31 echo " --disable-sout configure to not build stream output packages"
32 echo " --enable-small optimize libraries for size with slight speed decrease [DANGEROUS]"
33 echo " --disable-gpl configure to not build viral GPL code"
46 if test ! -f "../../contrib/src/main.mak"
48 echo "$0 must be run from a subdirectory"
66 PREFIX
="${1#--prefix=}"
84 PKGS_DISABLE
="${PKGS_DISABLE} ${1#--disable-}"
87 PKGS_ENABLE
="${PKGS_ENABLE} ${1#--enable-}"
90 echo "Unrecognized options $1"
100 echo -n "Guessing build system... "
101 BUILD
="`${CC:-cc} -dumpmachine`"
102 if test -z "$BUILD"; then
111 echo -n "Guessing host system... "
118 # strip trailing slash
125 echo "Creating configuration file... config.mak"
126 exec 3>config.mak ||
exit $?
128 # This file was automatically generated.
129 # Any change will be overwritten if ../bootstrap is run again.
132 PKGS_DISABLE := $PKGS_DISABLE
133 PKGS_ENABLE := $PKGS_ENABLE
156 if test -z "$SDKROOT"
158 SDKROOT
=`xcode-select -print-path`/Platforms
/iPhone
${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}${SDK_VERSION}.sdk
159 echo "SDKROOT not specified, assuming $SDKROOT"
164 if [ ! -d "${SDKROOT}" ]
166 echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
169 add_make
"IOS_SDK=${SDKROOT}"
174 if [ -z "${OSX_VERSION}" ]
176 OSX_VERSION
=`xcrun --show-sdk-version`
177 echo "OSX_VERSION not specified, assuming $OSX_VERSION"
179 if test -z "$SDKROOT"
181 SDKROOT
=`xcode-select -print-path`/Platforms
/MacOSX.platform
/Developer
/SDKs
/MacOSX
$OSX_VERSION.sdk
182 echo "SDKROOT not specified, assuming $SDKROOT"
185 if [ ! -d "${SDKROOT}" ]
187 SDKROOT_NOT_FOUND
=`xcode-select -print-path`/Platforms
/MacOSX.platform
/Developer
/SDKs
/MacOSX
$OSX_VERSION.sdk
188 SDKROOT
=`xcode-select -print-path`/SDKs
/MacOSX
$OSX_VERSION.sdk
189 echo "SDKROOT not found at $SDKROOT_NOT_FOUND, trying $SDKROOT"
191 if [ ! -d "${SDKROOT}" ]
193 SDKROOT_NOT_FOUND
="$SDKROOT"
194 SDKROOT
=`xcrun --show-sdk-path`
195 echo "SDKROOT not found at $SDKROOT_NOT_FOUND, trying $SDKROOT"
198 if [ ! -d "${SDKROOT}" ]
200 echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
204 add_make
"MACOSX_SDK=${SDKROOT}"
205 add_make
"OSX_VERSION ?= ${OSX_VERSION}"
210 [ -z "${ANDROID_NDK}" ] && echo "You must set ANDROID_NDK environment variable" && exit 1
211 add_make
"ANDROID_NDK := ${ANDROID_NDK}"
212 [ -z "${ANDROID_ABI}" ] && echo "You must set ANDROID_ABI environment variable" && exit 1
213 add_make
"ANDROID_ABI := ${ANDROID_ABI}"
214 [ ${ANDROID_ABI} = "armeabi-v7a" ] && add_make_enabled
"HAVE_NEON"
215 [ ${ANDROID_ABI} = "armeabi-v7a" ] && add_make_enabled
"HAVE_ARMV7A"
216 [ ${ANDROID_ABI} = "armeabi" -a -z "${NO_ARMV6}" ] && add_make_enabled
"HAVE_ARMV6"
219 test -z "$PREFIX" || add_make
"PREFIX := $PREFIX"
220 test -z "$BUILD_DISCS" || add_make_enabled
"BUILD_DISCS"
221 test -z "$BUILD_ENCODERS" || add_make_enabled
"BUILD_ENCODERS"
222 test -z "$BUILD_NETWORK" || add_make_enabled
"BUILD_NETWORK"
223 test -z "$ENABLE_SMALL" || add_make_enabled
"ENABLE_SMALL"
224 test -z "$GPL" || add_make_enabled
"GPL"
229 OS
="${HOST#*-}" # strip architecture
232 if test -z "$BUILDFORIOS"
235 add_make_enabled
"HAVE_MACOSX" "HAVE_DARWIN_OS" "HAVE_BSD"
238 add_make_enabled
"HAVE_IOS" "HAVE_DARWIN_OS" "HAVE_BSD" "HAVE_NEON" "HAVE_ARMV7A"
242 add_make_enabled
"HAVE_BSD"
246 add_make_enabled
"HAVE_LINUX" "HAVE_ANDROID"
249 add_make
"PLATFORM_SHORT_ARCH := arm"
252 add_make
"PLATFORM_SHORT_ARCH := x86"
255 add_make
"PLATFORM_SHORT_ARCH := mips"
260 add_make_enabled
"HAVE_LINUX"
263 add_make_enabled
"HAVE_WINCE"
266 add_make_enabled
"HAVE_WIN32"
269 add_make_enabled
"HAVE_SOLARIS"
276 test -e Makefile
&& unlink Makefile
277 ln -sf ..
/..
/contrib
/src
/main.mak Makefile ||
exit $?
281 Run "make" to start compilation.
284 * make install same as "make"
285 * make prebuilt fetch and install prebuilt binaries
286 * make list list packages
287 * make fetch fetch required source tarballs
288 * make fetch-all fetch all source tarballs
289 * make distclean clean everything and undo bootstrap
290 * make mostlyclean clean everything except source tarballs
291 * make clean clean everything
292 * make package prepare prebuilt packages
295 mkdir
-p ..
/..
/contrib
/tarballs ||
exit $?