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-gnuv3 configure to not build version 3 (L)GPL code"
35 echo " --enable-ad-clauses configure to build packages with advertising clauses"
36 echo " (USE AT YOUR OWN LEGAL RISKS)"
37 echo " --disable-optim disable optimization in libraries"
53 if test ! -f "../../contrib/src/main.mak"
55 echo "$0 must be run from a subdirectory"
73 PREFIX
="${1#--prefix=}"
100 PKGS_DISABLE
="${PKGS_DISABLE} ${1#--disable-}"
103 PKGS_ENABLE
="${PKGS_ENABLE} ${1#--enable-}"
106 echo "Unrecognized options $1"
114 if test -n "$AD_CLAUSES" -a -n "$GPL" -a -z "$GNUV3"
116 echo "Error: advertising clauses are not compatible with GPLv2!" >&2
122 echo -n "Guessing build system... "
123 BUILD
="`${CC:-cc} -dumpmachine`"
124 if test -z "$BUILD"; then
133 echo -n "Guessing host system... "
138 echo -n "Packages licensing... "
143 LICENSE
="GPL version 3"
145 LICENSE
="GPL version 2"
150 LICENSE
="Lesser GPL version 3"
152 LICENSE
="Lesser GPL version 2.1"
155 test -z "$AD_CLAUSES" || LICENSE
="$LICENSE, with advertisement clauses"
160 # strip trailing slash
167 echo "Creating configuration file... config.mak"
168 exec 3>config.mak ||
exit $?
170 # This file was automatically generated.
171 # Any change will be overwritten if ../bootstrap is run again.
174 PKGS_DISABLE := $PKGS_DISABLE
175 PKGS_ENABLE := $PKGS_ENABLE
198 if test "$VLCSDKROOT"
200 SDKROOT
="$VLCSDKROOT"
202 if test -z "$SDKROOT"
204 SDKROOT
=`xcode-select -print-path`/Platforms
/iPhone
${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}${SDK_VERSION}.sdk
205 echo "SDKROOT not specified, assuming $SDKROOT"
211 if [ ! -d "${SDKROOT}" ]
213 echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
216 add_make
"IOS_SDK=${SDKROOT}"
221 if [ -z "${OSX_VERSION}" ]
223 OSX_VERSION
=`xcrun --show-sdk-version`
224 echo "OSX_VERSION not specified, assuming $OSX_VERSION"
226 if test -z "$SDKROOT"
228 SDKROOT
=`xcode-select -print-path`/Platforms
/MacOSX.platform
/Developer
/SDKs
/MacOSX
$OSX_VERSION.sdk
229 echo "SDKROOT not specified, assuming $SDKROOT"
232 if [ ! -d "${SDKROOT}" ]
234 SDKROOT_NOT_FOUND
=`xcode-select -print-path`/Platforms
/MacOSX.platform
/Developer
/SDKs
/MacOSX
$OSX_VERSION.sdk
235 SDKROOT
=`xcode-select -print-path`/SDKs
/MacOSX
$OSX_VERSION.sdk
236 echo "SDKROOT not found at $SDKROOT_NOT_FOUND, trying $SDKROOT"
238 if [ ! -d "${SDKROOT}" ]
240 SDKROOT_NOT_FOUND
="$SDKROOT"
241 SDKROOT
=`xcrun --show-sdk-path`
242 echo "SDKROOT not found at $SDKROOT_NOT_FOUND, trying $SDKROOT"
245 if [ ! -d "${SDKROOT}" ]
247 echo "*** ${SDKROOT} does not exist, please install required SDK, or set SDKROOT manually. ***"
251 add_make
"MACOSX_SDK=${SDKROOT}"
252 add_make
"OSX_VERSION ?= ${OSX_VERSION}"
257 [ -z "${ANDROID_NDK}" ] && echo "You must set ANDROID_NDK environment variable" && exit 1
258 add_make
"ANDROID_NDK := ${ANDROID_NDK}"
259 [ -z "${ANDROID_ABI}" ] && echo "You must set ANDROID_ABI environment variable" && exit 1
260 add_make
"ANDROID_ABI := ${ANDROID_ABI}"
261 [ -z "${ANDROID_API}" ] && echo "You should set ANDROID_API environment variable (using default android-9)" && ANDROID_API
:= android-9
262 add_make
"ANDROID_API := ${ANDROID_API}"
263 [ ${ANDROID_ABI} = "armeabi-v7a" ] && add_make_enabled
"HAVE_NEON"
264 [ ${ANDROID_ABI} = "armeabi-v7a" ] && add_make_enabled
"HAVE_ARMV7A"
265 [ ${ANDROID_ABI} = "arm64-v8a" ] && add_make_enabled
"HAVE_NEON"
266 [ ${ANDROID_ABI} = "arm64-v8a" ] && add_make_enabled
"HAVE_ARMV8A"
267 [ ${ANDROID_ABI} = "armeabi" -a -z "${NO_ARMV6}" ] && add_make_enabled
"HAVE_ARMV6"
272 [ -z "${TIZEN_SDK}" ] && echo "You must set TIZEN_SDK environment variable" && exit 1
273 add_make
"TIZEN_SDK := ${TIZEN_SDK}"
274 [ -z "${TIZEN_ABI}" ] && echo "You must set TIZEN_ABI environment variable" && exit 1
275 add_make
"TIZEN_ABI := ${TIZEN_ABI}"
276 [ ${TIZEN_ABI} = "armv7l" ] && add_make_enabled
"HAVE_NEON"
277 [ ${TIZEN_ABI} = "armv7l" ] && add_make_enabled
"HAVE_ARMV7A"
280 test -z "$PREFIX" || add_make
"PREFIX := $PREFIX"
281 test -z "$BUILD_DISCS" || add_make_enabled
"BUILD_DISCS"
282 test -z "$BUILD_ENCODERS" || add_make_enabled
"BUILD_ENCODERS"
283 test -z "$BUILD_NETWORK" || add_make_enabled
"BUILD_NETWORK"
284 test -z "$ENABLE_SMALL" || add_make_enabled
"ENABLE_SMALL"
285 test -z "$GPL" || add_make_enabled
"GPL"
286 test -z "$GNUV3" || add_make_enabled
"GNUV3"
287 test -z "$AD_CLAUSES" || add_make_enabled
"AD_CLAUSES"
288 test -z "$WITH_OPTIMIZATION" || add_make_enabled
"WITH_OPTIMIZATION"
289 test "`uname -o`" != "Msys" || add_make
"CMAKE_GENERATOR := -G \"MSYS Makefiles\""
294 OS
="${HOST#*-}" # strip architecture
297 if test -z "$BUILDFORIOS"
300 add_make_enabled
"HAVE_MACOSX" "HAVE_DARWIN_OS" "HAVE_BSD"
303 add_make_enabled
"HAVE_IOS" "HAVE_DARWIN_OS" "HAVE_BSD" "HAVE_FPU"
307 add_make_enabled
"HAVE_NEON" "HAVE_ARMV7A"
311 if test "$BUILDFORTVOS"
313 add_make_enabled
"HAVE_TVOS"
317 add_make_enabled
"HAVE_BSD"
321 add_make_enabled
"HAVE_LINUX" "HAVE_ANDROID"
324 add_make
"PLATFORM_SHORT_ARCH := arm"
327 add_make
"PLATFORM_SHORT_ARCH := arm64"
330 add_make
"PLATFORM_SHORT_ARCH := x86"
333 add_make
"PLATFORM_SHORT_ARCH := x86_64"
336 add_make
"PLATFORM_SHORT_ARCH := mips"
341 if [ "`${CC} -v 2>&1 | grep tizen`" ]; then
343 add_make_enabled
"HAVE_TIZEN"
346 add_make
"PLATFORM_SHORT_ARCH := arm"
349 add_make
"PLATFORM_SHORT_ARCH := x86"
354 add_make_enabled
"HAVE_LINUX"
357 add_make_enabled
"HAVE_WIN32"
359 *winphone
*|
*windowsphone
*)
360 add_make_enabled
"HAVE_WINDOWSPHONE"
364 *winphone
*|
*windowsphone
*|
*winrt
*|
*uwp
*)
365 add_make_enabled
"HAVE_WINSTORE"
370 add_make_enabled
"HAVE_WIN64"
375 add_make_enabled
"HAVE_ARMV7A"
380 add_make_enabled
"HAVE_SOLARIS"
387 test -e Makefile
&& unlink Makefile
388 ln -sf ..
/..
/contrib
/src
/main.mak Makefile ||
exit $?
389 echo "Bootstrap completed."
391 mkdir
-p ..
/..
/contrib
/tarballs ||
exit $?