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"
34 echo " --disable-optim disable optimization in libraries"
48 if test ! -f "../../contrib/src/main.mak"
50 echo "$0 must be run from a subdirectory"
68 PREFIX
="${1#--prefix=}"
89 PKGS_DISABLE
="${PKGS_DISABLE} ${1#--disable-}"
92 PKGS_ENABLE
="${PKGS_ENABLE} ${1#--enable-}"
95 echo "Unrecognized options $1"
105 echo -n "Guessing build system... "
106 BUILD
="`${CC:-cc} -dumpmachine`"
107 if test -z "$BUILD"; then
116 echo -n "Guessing host system... "
123 # strip trailing slash
130 echo "Creating configuration file... config.mak"
131 exec 3>config.mak ||
exit $?
133 # This file was automatically generated.
134 # Any change will be overwritten if ../bootstrap is run again.
137 PKGS_DISABLE := $PKGS_DISABLE
138 PKGS_ENABLE := $PKGS_ENABLE
161 if test "$VLCSDKROOT"
163 SDKROOT
="$VLCSDKROOT"
165 if test -z "$SDKROOT"
167 SDKROOT
=`xcode-select -print-path`/Platforms
/iPhone
${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}${SDK_VERSION}.sdk
168 echo "SDKROOT not specified, assuming $SDKROOT"
174 if [ ! -d "${SDKROOT}" ]
176 echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
179 add_make
"IOS_SDK=${SDKROOT}"
184 if [ -z "${OSX_VERSION}" ]
186 OSX_VERSION
=`xcrun --show-sdk-version`
187 echo "OSX_VERSION not specified, assuming $OSX_VERSION"
189 if test -z "$SDKROOT"
191 SDKROOT
=`xcode-select -print-path`/Platforms
/MacOSX.platform
/Developer
/SDKs
/MacOSX
$OSX_VERSION.sdk
192 echo "SDKROOT not specified, assuming $SDKROOT"
195 if [ ! -d "${SDKROOT}" ]
197 SDKROOT_NOT_FOUND
=`xcode-select -print-path`/Platforms
/MacOSX.platform
/Developer
/SDKs
/MacOSX
$OSX_VERSION.sdk
198 SDKROOT
=`xcode-select -print-path`/SDKs
/MacOSX
$OSX_VERSION.sdk
199 echo "SDKROOT not found at $SDKROOT_NOT_FOUND, trying $SDKROOT"
201 if [ ! -d "${SDKROOT}" ]
203 SDKROOT_NOT_FOUND
="$SDKROOT"
204 SDKROOT
=`xcrun --show-sdk-path`
205 echo "SDKROOT not found at $SDKROOT_NOT_FOUND, trying $SDKROOT"
208 if [ ! -d "${SDKROOT}" ]
210 echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
214 add_make
"MACOSX_SDK=${SDKROOT}"
215 add_make
"OSX_VERSION ?= ${OSX_VERSION}"
220 [ -z "${ANDROID_NDK}" ] && echo "You must set ANDROID_NDK environment variable" && exit 1
221 add_make
"ANDROID_NDK := ${ANDROID_NDK}"
222 [ -z "${ANDROID_ABI}" ] && echo "You must set ANDROID_ABI environment variable" && exit 1
223 add_make
"ANDROID_ABI := ${ANDROID_ABI}"
224 [ -z "${ANDROID_API}" ] && echo "You should set ANDROID_API environment variable (using default android-9)" && ANDROID_API
:= android-9
225 add_make
"ANDROID_API := ${ANDROID_API}"
226 [ ${ANDROID_ABI} = "armeabi-v7a" ] && add_make_enabled
"HAVE_NEON"
227 [ ${ANDROID_ABI} = "armeabi-v7a" ] && add_make_enabled
"HAVE_ARMV7A"
228 [ ${ANDROID_ABI} = "arm64-v8a" ] && add_make_enabled
"HAVE_NEON"
229 [ ${ANDROID_ABI} = "arm64-v8a" ] && add_make_enabled
"HAVE_ARMV8A"
230 [ ${ANDROID_ABI} = "armeabi" -a -z "${NO_ARMV6}" ] && add_make_enabled
"HAVE_ARMV6"
235 [ -z "${TIZEN_SDK}" ] && echo "You must set TIZEN_SDK environment variable" && exit 1
236 add_make
"TIZEN_SDK := ${TIZEN_SDK}"
237 [ -z "${TIZEN_ABI}" ] && echo "You must set TIZEN_ABI environment variable" && exit 1
238 add_make
"TIZEN_ABI := ${TIZEN_ABI}"
239 [ ${TIZEN_ABI} = "armv7l" ] && add_make_enabled
"HAVE_NEON"
240 [ ${TIZEN_ABI} = "armv7l" ] && add_make_enabled
"HAVE_ARMV7A"
243 test -z "$PREFIX" || add_make
"PREFIX := $PREFIX"
244 test -z "$BUILD_DISCS" || add_make_enabled
"BUILD_DISCS"
245 test -z "$BUILD_ENCODERS" || add_make_enabled
"BUILD_ENCODERS"
246 test -z "$BUILD_NETWORK" || add_make_enabled
"BUILD_NETWORK"
247 test -z "$ENABLE_SMALL" || add_make_enabled
"ENABLE_SMALL"
248 test -z "$GPL" || add_make_enabled
"GPL"
249 test -z "$WITH_OPTIMIZATION" || add_make_enabled
"WITH_OPTIMIZATION"
254 OS
="${HOST#*-}" # strip architecture
257 if test -z "$BUILDFORIOS"
260 add_make_enabled
"HAVE_MACOSX" "HAVE_DARWIN_OS" "HAVE_BSD"
263 add_make_enabled
"HAVE_IOS" "HAVE_DARWIN_OS" "HAVE_BSD" "HAVE_FPU"
267 add_make_enabled
"HAVE_NEON" "HAVE_ARMV7A"
271 if test "$BUILDFORTVOS"
273 add_make_enabled
"HAVE_TVOS"
277 add_make_enabled
"HAVE_BSD"
281 add_make_enabled
"HAVE_LINUX" "HAVE_ANDROID"
284 add_make
"PLATFORM_SHORT_ARCH := arm"
287 add_make
"PLATFORM_SHORT_ARCH := arm64"
290 add_make
"PLATFORM_SHORT_ARCH := x86"
293 add_make
"PLATFORM_SHORT_ARCH := x86_64"
296 add_make
"PLATFORM_SHORT_ARCH := mips"
301 if [ "`${CC} -v 2>&1 | grep tizen`" ]; then
303 add_make_enabled
"HAVE_TIZEN"
306 add_make
"PLATFORM_SHORT_ARCH := arm"
309 add_make
"PLATFORM_SHORT_ARCH := x86"
314 add_make_enabled
"HAVE_LINUX"
317 add_make_enabled
"HAVE_WIN32"
320 add_make_enabled
"HAVE_SOLARIS"
327 test -e Makefile
&& unlink Makefile
328 ln -sf ..
/..
/contrib
/src
/main.mak Makefile ||
exit $?
332 Run "make" to start compilation.
335 * make install same as "make"
336 * make prebuilt fetch and install prebuilt binaries
337 * make list list packages
338 * make fetch fetch required source tarballs
339 * make fetch-all fetch all source tarballs
340 * make distclean clean everything and undo bootstrap
341 * make mostlyclean clean everything except source tarballs
342 * make clean clean everything
343 * make package prepare prebuilt packages
346 mkdir
-p ..
/..
/contrib
/tarballs ||
exit $?