3 ## bootstrap file for the VLC media player
5 ## Copyright (C) 2005-2006 the VideoLAN team
7 ## Authors: Sam Hocevar <sam@zoy.org>
8 ## RĂ©mi Denis-Courmont <rem # videolan # org>
10 if test "$#" != "0"; then
12 echo " Calls automake, autoconf, autoheader, autopoint and other auto* to generate"
13 echo " m4 macros and prepare Makefiles."
18 ### Get a sane environment, just in case
27 ## Check for various tools
30 ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"
32 # Check for contrib directory
33 if test -d extras/contrib/bin; then
34 export PATH="`pwd`/extras/contrib/bin:$PATH"
35 if test -d extras/contrib/share/aclocal; then
36 ACLOCAL_ARGS="${ACLOCAL_ARGS} -I extras/contrib/share/aclocal"
38 if test ".`uname -s`" = ".Darwin"; then
39 export LD_LIBRARY_PATH=./extras/contrib/lib:$LD_LIBRARY_PATH
40 export DYLD_LIBRARY_PATH=./extras/contrib/lib:$DYLD_LIBRARY_PATH
41 elif test ".`uname -s`" = ".BeOS"; then
42 export LIBRARY_PATH=./extras/contrib/lib:$LIBRARY_PATH
43 export BELIBRARIES=./extras/contrib/lib:$BELIBRARIES
45 elif test ".`uname -s`" = ".Darwin"; then
48 echo "ERR: Contribs haven't been built"
49 echo "ERR: Please run:"
51 echo "ERR: 'cd extras/contrib && ./bootstrap && make && cd ../..'"
53 echo "ERR: Make sure fink has been disabled too."
59 # Check for pkg-config
60 if pkg-config --version >/dev/null 2>&1; then
61 # We have pkg-config, everything is cool.
68 ## Generate the modules makefile, by parsing modules/**/Modules.am
72 echo "generating modules/**/Makefile.am and m4/private.m4"
74 # Prepare m4/private.m4
75 rm -f m4/private.m4 && cat > m4/private.m4 << EOF
76 dnl Private VLC macros - generated by bootstrap
80 if [ "${PKGCONFIG}" = "no" ]; then cat >> m4/private.m4 << EOF
81 dnl User does not have pkg-config, so assume package was not found
82 AC_DEFUN([PKG_CHECK_MODULES],[ifelse([\$4], , :, [\$4])])
87 cat >> m4/private.m4 << EOF
88 dnl Helper macro for vlc-config generation
89 AC_DEFUN([VLC_CONFIG_HELPER], [
90 cat >> vlc-config.in << BLAH
95 rm -f modules/Makefile.am && cat > modules/Makefile.am << EOF
96 # Autogenerated by bootstrap - DO NOT EDIT
98 dist_noinst_SCRIPTS = genmf
99 SUBDIRS = `sed -ne 's,modules/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`
103 modules/genmf `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
105 cat >> m4/private.m4 << EOF
111 ### classic bootstrap stuff
115 # Automake complains if these are not present
117 cp -f INSTALL INSTALL.svn
119 autoreconf --install --force --verbose ${ACLOCAL_ARGS}
120 rm -f po/Makevars.template
122 mv -f INSTALL.svn INSTALL
125 ## files which need to be regenerated
127 rm -f vlc-config.in vlc-config
128 rm -f src/misc/modules_builtin.h
129 rm -f stamp-builtin stamp-h* mozilla/stamp-pic
135 ## Tell the user about gettext, pkg-config and sed
137 if [ "$PKGCONFIG" = "no" ]; then
140 ==============================================================
141 NOTE: you do not have the "pkg-config" utility on your system;
142 detection of the Gtk-2.0 and GNOME 2.0 libraries will not be
147 echo "Successfully bootstrapped"