vlc/bootstrap

89 lines
2.0 KiB
Plaintext
Raw Permalink Normal View History

#! /bin/sh
## bootstrap file for the VLC media player
##
2008-03-23 20:43:06 +01:00
## Copyright (C) 2005-2008 the VideoLAN team
##
2006-03-04 21:24:19 +01:00
## Authors: Sam Hocevar <sam@zoy.org>
2019-09-04 21:10:51 +02:00
## Rémi Denis-Courmont
2011-08-30 18:32:56 +02:00
set -e
cd "$(dirname "$0")"
if test "$#" != "0"; then
2019-05-03 12:32:58 +02:00
echo "Usage: $0" >&2
echo " Calls autoreconf to generate m4 macros and prepare Makefiles." >&2
exit 1
fi
# Check for tools directory
if test -z ${VLC_TOOLS}; then
VLC_TOOLS=extras/tools/build
fi
if test -d ${VLC_TOOLS}/bin; then
VLC_TOOLS_PATH="$( cd "${VLC_TOOLS}/bin" ; pwd -P )"
PATH="$VLC_TOOLS_PATH:$PATH"
fi
bootstrap: provide aclocal m4 from extras tools The libtool.m4 file defining the LT_INIT macro is located in the share directory of the built libtool prefix. This file can be present on the host system but when it isn't, the bootstrap can fail during bootstrap with the following error: autoreconf: running: automake --add-missing --copy --force-missing bin/Makefile.am:41: error: Libtool library used but 'LIBTOOL' is undefined bin/Makefile.am:41: The usual way to define 'LIBTOOL' is to add 'LT_INIT' bin/Makefile.am:41: to 'configure.ac' and run 'aclocal' and 'autoconf' again. bin/Makefile.am:41: If 'LT_INIT' is in 'configure.ac', make sure bin/Makefile.am:41: its definition is in aclocal's search path. Indeed, when libtool.m4 is not installed with the same prefix as autoconf/autom4te, and specificallly the share/ folder is not shared, then autom4te will fail to detect LT_INIT, leading autoreconf to disable the libtool support and discard the call to libtoolize. Then, automake cannot find the aclocal m4 file since libtoolize didn't install it, and the previous error is displayed before bootstrap exits. This behaviour can be checked by uninstalling every libtool and trying to run the following commands: # Works autom4te --verbose --language=Autoconf --output=- --trace=LT_INIT extras/tools/build/share/aclocal/libtool.m4 configure.ac # Fails to find LT_INIT autom4te --verbose --language=Autoconf --output=- --trace=LT_INIT configure.ac extras/tools/build/share/aclocal/libtool.m4 # Fails to find LT_INIT autom4te --verbose --language=Autoconf --output=- --trace=LT_INIT configure.ac This commit ensures that the libtool.m4 will be found at the aclocal setup, to allow libtoolize to copy the libtool.m4 as aclocal.m4 for automake.
2023-07-28 13:34:37 +02:00
if test -d ${VLC_TOOLS}/share/aclocal; then
# https://www.gnu.org/software/automake/manual/html_node/Macro-Search-Path.html
ACLOCAL_ARGS="${ACLOCAL_ARGS} -I ${VLC_TOOLS}/share/aclocal/"
fi
###
### Get a sane environment, just in case
###
CYGWIN=binmode
export CYGWIN
# Check for pkg-config
if ! "${PKG_CONFIG:-pkg-config}" --version >/dev/null 2>&1; then
echo 'Error: "pkg-config" is not installed.' >&2
exit 1
fi
2011-08-30 18:32:56 +02:00
# Check for autopoint (GNU gettext)
export AUTOPOINT
test "$AUTOPOINT" || AUTOPOINT=autopoint
if ! "$AUTOPOINT" --dry-run --force >/dev/null 2>&1; then
AUTOPOINT=true
cat << EOF
2017-06-03 14:15:16 +02:00
NOTE: autopoint (GNU gettext-tools) appears to be missing or out-of-date.
Please install or update GNU gettext tools.
2011-08-30 18:32:56 +02:00
Otherwise, you will not be able to build a source tarball.
2017-06-03 14:15:16 +02:00
==========================================================================
2011-08-30 18:32:56 +02:00
EOF
fi
# Check for flex and bison
if ! flex --version >/dev/null 2>&1; then
echo "ERROR: flex is not installed." >&2
if ! test -f modules/codec/webvtt/CSSLexer.c; then
exit 1
fi
fi
if ! bison --version >/dev/null 2>&1; then
echo "ERROR: GNU bison is not installed." >&2
if ! test -f modules/codec/webvtt/CSSGrammar.c; then
exit 1
fi
fi
###
### classic bootstrap stuff
###
2008-03-25 17:55:30 +01:00
autoreconf --install --force --verbose ${ACLOCAL_ARGS}
rm -f po/Makevars.template
##
## files which need to be regenerated
##
rm -f stamp-h*
# Shut up
set +x
echo "Successfully bootstrapped"