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 autoreconf to generate m4 macros and prepare Makefiles."
17 ### Get a sane environment, just in case
26 ## Check for various tools
29 ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"
31 # Check for contrib directory
32 if test -d extras/contrib/bin; then
33 export PATH="`pwd`/extras/contrib/bin:$PATH"
34 if test -d extras/contrib/share/aclocal; then
35 ACLOCAL_ARGS="${ACLOCAL_ARGS} -I extras/contrib/share/aclocal"
37 if test ".`uname -s`" = ".Darwin"; then
38 export LD_LIBRARY_PATH=./extras/contrib/lib:$LD_LIBRARY_PATH
39 export DYLD_LIBRARY_PATH=./extras/contrib/lib:$DYLD_LIBRARY_PATH
40 elif test ".`uname -s`" = ".BeOS"; then
41 export LIBRARY_PATH=./extras/contrib/lib:$LIBRARY_PATH
42 export BELIBRARIES=./extras/contrib/lib:$BELIBRARIES
44 elif test ".`uname -s`" = ".Darwin"; then
47 echo "ERR: Contribs haven't been built"
48 echo "ERR: Please run:"
50 echo "ERR: 'cd extras/contrib && ./bootstrap && make && cd ../..'"
52 echo "ERR: Make sure fink has been disabled too."
58 # Check for pkg-config
59 if pkg-config --version >/dev/null 2>&1; then
60 # We have pkg-config, everything is cool.
67 ## Generate the modules makefile, by parsing modules/**/Modules.am
71 echo "generating modules/**/Makefile.am and m4/private.m4"
73 # Prepare m4/private.m4
74 rm -f m4/private.m4 && cat > m4/private.m4 << EOF
75 dnl Private VLC macros - generated by bootstrap
79 if [ "${PKGCONFIG}" = "no" ]; then cat >> m4/private.m4 << EOF
80 dnl User does not have pkg-config, so assume package was not found
81 AC_DEFUN([PKG_CHECK_MODULES],[ifelse([\$4], , :, [\$4])])
86 cat >> m4/private.m4 << EOF
87 dnl Helper macro for vlc-config generation
88 AC_DEFUN([VLC_CONFIG_HELPER], [
89 cat >> vlc-config.in << BLAH
94 rm -f modules/Makefile.am && cat > modules/Makefile.am << EOF
95 # Autogenerated by bootstrap - DO NOT EDIT
97 dist_noinst_SCRIPTS = genmf
98 SUBDIRS = `sed -ne 's,modules/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`
102 modules/genmf `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
104 cat >> m4/private.m4 << EOF
110 ### classic bootstrap stuff
114 # Automake complains if these are not present
116 cp -f INSTALL INSTALL.svn
118 autoreconf --install --force --verbose ${ACLOCAL_ARGS}
119 rm -f po/Makevars.template
121 mv -f INSTALL.svn INSTALL
124 ## files which need to be regenerated
126 rm -f vlc-config.in vlc-config
127 rm -f src/misc/modules_builtin.h
128 rm -f stamp-builtin stamp-h* mozilla/stamp-pic
134 ## Tell the user about gettext, pkg-config and sed
136 if [ "$PKGCONFIG" = "no" ]; then
139 ==============================================================
140 NOTE: you do not have the "pkg-config" utility on your system;
141 detection of the Gtk-2.0 and GNOME 2.0 libraries will not be
146 echo "Successfully bootstrapped"