android/configure.sh: enable taglib & matroska
[vlc.git] / bootstrap
blob926b0d69db1453c59ef0c4883165b8fda5c95f00
1 #! /bin/sh
3 ## bootstrap file for the VLC media player
4 ##
5 ## Copyright (C) 2005-2008 the VideoLAN team
6 ##
7 ## Authors: Sam Hocevar <sam@zoy.org>
8 ## RĂ©mi Denis-Courmont <rem # videolan # org>
10 if test "$#" != "0"; then
11 echo "Usage: $0"
12 echo " Calls autoreconf to generate m4 macros and prepare Makefiles."
13 exit 1
16 ###
17 ### Get a sane environment, just in case
18 ###
19 CYGWIN=binmode
20 export CYGWIN
22 set -e
23 set -x
25 cd "$(dirname "$0")"
28 ## Check for various tools
31 ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"
33 # Check for contrib directory
34 if test -d extras/contrib/build/bin; then
35 PATH="`pwd`/extras/contrib/build/bin:$PATH"
36 if test -d extras/contrib/build/share/aclocal; then
37 ACLOCAL_ARGS="${ACLOCAL_ARGS} -I extras/contrib/build/share/aclocal"
39 if test ".`uname -s`" = ".Darwin"; then
40 LD_LIBRARY_PATH=./extras/contrib/build/lib:$LD_LIBRARY_PATH
41 DYLD_LIBRARY_PATH=./extras/contrib/build/lib:$DYLD_LIBRARY_PATH
42 export LD_LIBRARY_PATH
43 export DYLD_LIBRARY_PATH
45 elif test ".`uname -s`" = ".Darwin"; then
46 set +x
47 echo ""
48 echo "ERR: Contribs haven't been built"
49 echo "ERR: Please run:"
50 echo "ERR: "
51 echo "ERR: 'cd extras/contrib && ./bootstrap && make && cd ../..'"
52 echo "ERR: "
53 echo "ERR: Make sure fink has been disabled too."
54 echo ""
55 set -x
56 exit 1
59 # Check for pkg-config
60 if pkg-config --version >/dev/null 2>&1; then
61 # We have pkg-config, everything is cool.
62 PKGCONFIG=yes
63 else
64 PKGCONFIG=no
67 # Check for autopoint (GNU gettext)
68 export AUTOPOINT
69 test "$AUTOPOINT" || AUTOPOINT=autopoint
70 if ! "$AUTOPOINT" --dry-run --force >/dev/null 2>&1; then
71 AUTOPOINT=true
72 echo > ABOUT-NLS
76 ## Generate the modules makefile, by parsing modules/**/Modules.am
79 set +x
80 echo "generating modules/**/Makefile.am"
82 # Prepare m4/private.m4
83 rm -f m4/private.m4 && cat > m4/private.m4 << EOF
84 dnl Private VLC macros - generated by bootstrap
86 EOF
88 if [ "${PKGCONFIG}" = "no" ]; then cat >> m4/private.m4 << EOF
89 dnl User does not have pkg-config, so assume package was not found
90 AC_DEFUN([PKG_CHECK_MODULES],[ifelse([\$4], , :, [\$4])])
92 EOF
95 sh modules/genmf `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
97 ###
98 ### classic bootstrap stuff
99 ###
100 set -x
102 # Automake complains if these are not present
103 echo > ABOUT-NLS
104 cp -f INSTALL INSTALL.git
106 autoreconf --install --force --verbose ${ACLOCAL_ARGS}
107 rm -f po/Makevars.template ABOUT-NLS
108 echo > ABOUT-NLS
109 mv -f INSTALL.git INSTALL
112 ## files which need to be regenerated
114 rm -f stamp-h*
116 # Shut up
117 set +x
120 ## Tell the user about gettext, pkg-config and sed
122 if [ "$AUTOPOINT" = "true" ]; then
123 cat << EOF
125 ==============================================================
126 NOTE: GNU gettext appears to be missing or out-of-date.
127 Please install or update GNU gettext.
128 Also check if you have cvs, a dependency of autopoint.
129 Otherwise, you will not be able to build a source tarball.
133 if [ "$PKGCONFIG" = "no" ]; then
134 cat << EOF
136 ==============================================================
137 NOTE: "pkg-config" is missing from your system. Certain
138 libraries may not be detected properly.
142 echo "Successfully bootstrapped"