#! /bin/sh
## bootstrap file for vlc, the VideoLAN Client
-## $Id: bootstrap,v 1.15 2002/10/02 12:59:59 sam Exp $
+## $Id: bootstrap,v 1.18 2002/10/04 13:13:54 sam Exp $
##
## Authors: Samuel Hocevar <sam@zoy.org>
fi
PERLSUCKS=no
+AUTOMAKESUCKS=no
##
## Generate the modules makefile, by parsing modules/**/Modules.am
EOF
sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf} | while read mod
do
+ LINKER="LINK"
if echo "$ALL_FLAGS" | grep '^CPPFLAGS_'${mod}'=$' >/dev/null 2>&1; then
echo "AC_SUBST(CPPFLAGS_${mod})" >> configure.ac; fi
if echo "$ALL_FLAGS" | grep '^CFLAGS_'${mod}'=$' >/dev/null 2>&1; then
echo "AC_SUBST(CFLAGS_${mod})" >> configure.ac; fi
if echo "$ALL_FLAGS" | grep '^CXXFLAGS_'${mod}'=$' >/dev/null 2>&1; then
+ LINKER="CXXLINK"
echo "AC_SUBST(CXXFLAGS_${mod})" >> configure.ac; fi
if echo "$ALL_FLAGS" | grep '^OBJCFLAGS_'${mod}'=$' >/dev/null 2>&1; then
+ LINKER="OBJCLINK"
echo "AC_SUBST(OBJCFLAGS_${mod})" >> configure.ac; fi
if echo "$ALL_FLAGS" | grep '^LDFLAGS_'${mod}'=$' >/dev/null 2>&1; then
echo "AC_SUBST(LDFLAGS_${mod})" >> configure.ac; fi
AM_CONDITIONAL(${mod}_plugin, test x\$${mod}_plugin = xyes)
AM_CONDITIONAL(${mod}_builtin, test x\$${mod}_builtin = xyes)
EOF
-# L_ is for LIBRARIES_, D_ for DATA_, B_ for BUILT_SOURCES_, F_ for LDFLAGS_
-# _p is for _plugin, _b is for _builtin
+# Generation of Modules.am
+# ~~~~~~~~~~~~~~~~~~~~~~~~
+# - L_ is for LIBRARIES_, D_ for DATA_, B_ for BUILT_SOURCES_, F_ for LDFLAGS_,
+# S_ for SOURCES_, _p is for _plugin, _b is for _builtin. This is to reduce
+# the resulting file size.
+# - *_CFLAGS, *_CXXFLAGS etc. include *_CPPFLAGS because per-object CPPFLAGS
+# does not seem to work properly with any automake version I tested.
cat >> Modules.am << EOF
# The ${mod} plugin
MOSTLYCLEANFILES += \$(D_${mod}_p)
${PRIVATE}noinst_LIBRARIES += \$(L_${mod}_p)
${PRIVATE}${dir}/lib${mod}_plugin\$(LIBEXT): \$(${sym}_lib${mod}_plugin_a_OBJECTS)
-${PRIVATE} \$(CC) \$^ -o \$@ -shared \$(LDFLAGS) \$(LDFLAGS_plugins) \$(LDFLAGS_${mod})
+${PRIVATE} \$(${LINKER}) \$^ -o \$@ -shared \$(LDFLAGS_plugins) \$(LDFLAGS_${mod})
EOF
if automake-1.6 --version >/dev/null 2>&1
then
amvers="-1.6"
+ if expr "`automake-1.6 --version | sed -e '1s/[^0-9]*//' -e q`" "<=" "1.6.1" > /dev/null 2>&1
+ then AUTOMAKESUCKS=yes
+ fi
else
if automake-1.5 --version >/dev/null 2>&1
then
if automake --version > /dev/null 2>&1
then
amvers=`automake --version | sed -e '1s/[^0-9]*//' -e q`
+ case $amvers in
+ 1.6|1.6.0|1.6.1)
+ AUTOMAKESUCKS=yes ;;
+ esac
if expr "$amvers" "<" "1.5" > /dev/null 2>&1
then amvers="none"
;;
esac
+case "$AUTOMAKESUCKS" in
+ no)
+ ;;
+ yes)
+ echo ""
+ echo "============================================================="
+ echo "IMPORTANT NOTE: your version of automake has a bug which will"
+ echo "prevent proper plugin compilation. Either compile VLC with"
+ echo "the --disable-plugins flag, or use a version of automake newer"
+ echo "than 1.6.1 (1.6.2 is OK, and so are the 1.5 series)."
+ ;;
+esac
+
case "$SEDSUCKS" in
no)
;;