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"
38 echo " --enable-pdb generate debug information in PDB format"
69 PREFIX
="${1#--prefix=}"
99 PKGS_DISABLE
="${PKGS_DISABLE} ${1#--disable-}"
102 PKGS_ENABLE
="${PKGS_ENABLE} ${1#--enable-}"
105 echo "Unrecognized options $1"
113 if test -n "$AD_CLAUSES" -a -n "$GPL" -a -z "$GNUV3"
115 echo "Error: advertising clauses are not compatible with GPLv2!" >&2
121 printf "Guessing build system... "
122 BUILD
="`${CC:-cc} -dumpmachine | sed s/windows-gnu/mingw32/`"
123 if test -z "$BUILD"; then
132 printf "Guessing host system... "
137 printf "Packages licensing... "
142 LICENSE
="GPL version 3"
144 LICENSE
="GPL version 2"
149 LICENSE
="Lesser GPL version 3"
151 LICENSE
="Lesser GPL version 2.1"
154 test -z "$AD_CLAUSES" || LICENSE
="$LICENSE, with advertisement clauses"
159 # strip trailing slash
166 echo "Creating makefile..."
167 test -e Makefile
&& unlink Makefile
168 exec 3>Makefile ||
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 "$SDKROOT" ]; then
222 SDKROOT
=$
(xcrun
--show-sdk-path)
223 echo "SDKROOT not specified, assuming $SDKROOT"
226 if [ ! -d "$SDKROOT" ]; then
227 echo "*** $SDKROOT does not exist, please install required SDK, or set SDKROOT manually. ***"
231 add_make
"MACOSX_SDK=${SDKROOT}"
236 [ -z "${ANDROID_NDK}" ] && echo "You must set ANDROID_NDK environment variable" && exit 1
237 add_make
"ANDROID_NDK := ${ANDROID_NDK}"
238 [ -z "${ANDROID_ABI}" ] && echo "You must set ANDROID_ABI environment variable" && exit 1
239 add_make
"ANDROID_ABI := ${ANDROID_ABI}"
240 [ -z "${ANDROID_API}" ] && echo "You should set ANDROID_API environment variable (using default android-9)" && ANDROID_API
:= android-9
241 add_make
"ANDROID_API := ${ANDROID_API}"
242 [ ${ANDROID_ABI} = "armeabi-v7a" ] && add_make_enabled
"HAVE_NEON"
243 [ ${ANDROID_ABI} = "armeabi-v7a" ] && add_make_enabled
"HAVE_ARMV7A"
244 [ ${ANDROID_ABI} = "arm64-v8a" ] && add_make_enabled
"HAVE_NEON"
245 [ ${ANDROID_ABI} = "arm64-v8a" ] && add_make_enabled
"HAVE_ARMV8A"
246 [ ${ANDROID_ABI} = "armeabi" -a -z "${NO_ARMV6}" ] && add_make_enabled
"HAVE_ARMV6"
249 test -z "$PREFIX" || add_make
"PREFIX := $PREFIX"
250 test -z "$BUILD_DISCS" || add_make_enabled
"BUILD_DISCS"
251 test -z "$BUILD_ENCODERS" || add_make_enabled
"BUILD_ENCODERS"
252 test -z "$BUILD_NETWORK" || add_make_enabled
"BUILD_NETWORK"
253 test -z "$ENABLE_SMALL" || add_make_enabled
"ENABLE_SMALL"
254 test -z "$GPL" || add_make_enabled
"GPL"
255 test -z "$GNUV3" || add_make_enabled
"GNUV3"
256 test -z "$AD_CLAUSES" || add_make_enabled
"AD_CLAUSES"
257 test -z "$WITH_OPTIMIZATION" || add_make_enabled
"WITH_OPTIMIZATION"
258 test -z "$ENABLE_PDB" || add_make_enabled
"ENABLE_PDB"
259 test "`uname -o 2>/dev/null`" != "Msys" || add_make
"CMAKE_GENERATOR := -G \"MSYS Makefiles\""
264 OS
="${HOST#*-}" # strip architecture
267 if test -z "$BUILDFORIOS"
270 add_make_enabled
"HAVE_MACOSX" "HAVE_DARWIN_OS" "HAVE_BSD"
273 add_make_enabled
"HAVE_IOS" "HAVE_DARWIN_OS" "HAVE_BSD" "HAVE_FPU"
277 add_make
"PLATFORM_SHORT_ARCH := arm64"
280 add_make
"PLATFORM_SHORT_ARCH := armv7"
281 add_make_enabled
"HAVE_NEON" "HAVE_ARMV7A"
284 add_make
"PLATFORM_SHORT_ARCH := x86_64"
287 add_make
"PLATFORM_SHORT_ARCH := i386"
291 if test "$BUILDFORTVOS"
293 add_make_enabled
"HAVE_TVOS"
297 add_make_enabled
"HAVE_BSD"
301 add_make_enabled
"HAVE_LINUX" "HAVE_ANDROID"
304 add_make
"PLATFORM_SHORT_ARCH := arm64"
307 add_make
"PLATFORM_SHORT_ARCH := arm"
310 add_make
"PLATFORM_SHORT_ARCH := x86"
313 add_make
"PLATFORM_SHORT_ARCH := x86_64"
316 add_make
"PLATFORM_SHORT_ARCH := mips"
321 add_make_enabled
"HAVE_LINUX"
324 add_make_enabled
"HAVE_WIN32"
326 *winphone
*|
*windowsphone
*)
327 add_make_enabled
"HAVE_WINDOWSPHONE"
331 *winphone
*|
*windowsphone
*|
*winrt
*|
*uwp
*)
332 add_make_enabled
"HAVE_WINSTORE"
337 add_make_enabled
"HAVE_ARMV7A"
342 add_make_enabled
"HAVE_SOLARIS"
345 add_make_enabled
"HAVE_NACL"
352 BOOTSTRAP_PATH
="$( cd "$
(dirname "$0")" ; pwd -P )"
353 CURRENT_PATH
="$( pwd -P )"
354 # location of the contrib/src folder from the root of the contrib build folder
355 TOPSRC
=$
(python3
-c "import os; print(os.path.relpath('$BOOTSTRAP_PATH', '$CURRENT_PATH'))")
356 # location of the contrib/src folder from a built library folder
357 TOPSRC_BUILT
=$
(python3
-c "import os; print(os.path.relpath('$BOOTSTRAP_PATH', '$CURRENT_PATH/libfoo'))")
358 add_make
"TOPSRC = $TOPSRC"
359 add_make
"TOPSRC_BUILT = $TOPSRC_BUILT"
360 add_make
"TOPDST = .."
361 add_make
"-include config.mak"
362 add_make
'include $(TOPSRC)/src/main.mak'
363 echo "Bootstrap completed."
365 mkdir
-p $BOOTSTRAP_PATH/tarballs ||
exit $?