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-sout configure to not build stream output packages"
31 echo " --enable-small optimize libraries for size with slight speed decrease [DANGEROUS]"
42 if test ! -f "../../contrib/src/main.mak"
44 echo "$0 must be run from a subdirectory"
62 PREFIX="${1#--prefix=}"
74 PKGS_DISABLE="${PKGS_DISABLE} ${1#--disable-}"
77 PKGS_ENABLE="${PKGS_ENABLE} ${1#--enable-}"
80 echo "Unrecognized options $1"
90 echo -n "Guessing build system... "
91 BUILD="`cc -dumpmachine`"
92 if test -z "$BUILD"; then
101 echo -n "Guessing host system... "
108 # strip trailing slash
115 echo "Creating configuration file... config.mak"
118 # This file was automatically generated.
119 # Any change will be overwritten if ../bootstrap is run again.
122 PKGS_DISABLE := $PKGS_DISABLE
123 PKGS_ENABLE := $PKGS_ENABLE
146 [ -z "${OSX_VERSION}" ] && echo "OSX_VERSION not specified, assuming 10.5" && OSX_VERSION=10.5
147 SDK="/Developer/SDKs/MacOSX${OSX_VERSION}.sdk"
151 *** ${SDK} does not exist, please install required SDK, or use export OSX_VERSION=10.6 ***
155 add_make "OSX_VERSION ?= ${OSX_VERSION}"
160 if test -z "$SDKROOT"
162 SDKROOT=`xcode-select -print-path`/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}${SDK_VERSION}.sdk
163 echo "SDKROOT not specified, assuming $SDKROOT"
168 if [ ! -d "${SDKROOT}" ]
170 echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
173 add_make "SDKROOT=${SDKROOT}"
178 [ -z "${ANDROID_NDK}" ] && echo "You must set ANDROID_NDK environment variable" && exit 1
179 add_make "ANDROID_NDK := ${ANDROID_NDK}"
180 test -z "${NO_NEON}" && add_make_enabled "HAVE_NEON"
181 test -n "${TEGRA2}" && add_make_enabled "HAVE_TEGRA2"
184 test -z "$PREFIX" || add_make "PREFIX := $PREFIX"
185 test -z "$BUILD_DISCS" || add_make_enabled "BUILD_DISCS"
186 test -z "$BUILD_ENCODERS" || add_make_enabled "BUILD_ENCODERS"
187 test -z "$ENABLE_SMALL" || add_make_enabled "ENABLE_SMALL"
192 OS="${HOST#*-}" # strip architecture
195 if test -z "$BUILDFORIOS"
198 add_make_enabled "HAVE_MACOSX" "HAVE_DARWIN_OS" "HAVE_BSD"
201 add_make_enabled "HAVE_IOS" "HAVE_DARWIN_OS" "HAVE_BSD"
205 add_make_enabled "HAVE_BSD"
209 add_make_enabled "HAVE_LINUX" "HAVE_ANDROID"
210 add_make "PATH = ${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:${PATH}"
213 add_make_enabled "HAVE_LINUX"
216 add_make_enabled "HAVE_WINCE"
219 add_make_enabled "HAVE_WIN32"
226 test -e Makefile && unlink Makefile
227 ln -sf ../../contrib/src/main.mak Makefile
231 Run "make" to start compilation.
234 * make install same as "make"
235 * make prebuilt fetch and install prebuilt binaries
236 * make list list packages
237 * make fetch fetch required source tarballs
238 * make fetch-all fetch all source tarballs
239 * make distclean clean everything and undo bootstrap
240 * make mostlyclean clean everything except source tarballs
241 * make clean clean everything
242 * make package prepare prebuilt packages
245 mkdir -p ../../contrib/tarballs