bootstrap 1.83 KB
Newer Older
1 2
#! /bin/sh

3
##  bootstrap file for the VLC media player
4
##
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
5
## Copyright (C) 2005-2008 the VideoLAN team
6
##
7 8
##  Authors: Sam Hocevar <sam@zoy.org>
##           Rémi Denis-Courmont <rem # videolan # org>
9

10 11 12 13
set -e

cd "$(dirname "$0")"

Sam Hocevar's avatar
Sam Hocevar committed
14
if test "$#" != "0"; then
15 16
  echo "Usage: $0" >&2
  echo "  Calls autoreconf to generate m4 macros and prepare Makefiles." >&2
17 18 19
  exit 1
fi

20 21
ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"

22
# Check for tools directory
23 24 25 26 27 28
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"
29 30
fi

31
###
32
###  Get a sane environment, just in case
33
###
34 35
CYGWIN=binmode
export CYGWIN
36

37 38 39 40 41 42
# 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

43 44 45 46 47 48
# 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
49 50
NOTE: autopoint (GNU gettext-tools) appears to be missing or out-of-date.
Please install or update GNU gettext tools.
51
Otherwise, you will not be able to build a source tarball.
52
==========================================================================
53 54 55

EOF
fi
56

57 58
# Check for flex and bison
if ! flex --version >/dev/null 2>&1; then
59 60 61 62
	echo "ERROR: flex is not installed." >&2
	if ! test -f modules/codec/webvtt/CSSLexer.c; then
		exit 1
	fi
63 64 65
fi

if ! bison --version >/dev/null 2>&1; then
66 67 68 69
	echo "ERROR: GNU bison is not installed." >&2
	if ! test -f modules/codec/webvtt/CSSGrammar.c; then
		exit 1
	fi
70 71
fi

72
###
73
###  classic bootstrap stuff
74
###
75

76
autoreconf --install --force --verbose ${ACLOCAL_ARGS}
77
rm -f po/Makevars.template
78 79

##
Sam Hocevar's avatar
Sam Hocevar committed
80
##  files which need to be regenerated
81
##
82
rm -f stamp-h*
83

84
# Shut up
85
set +x
86
echo "Successfully bootstrapped"