]> git.sesse.net Git - vlc/blobdiff - bootstrap
* ./bootstrap: we use the proper linker for plugin compilation.
[vlc] / bootstrap
index 7a5c0f75cb19a78cdea14ed8f82708dc09177696..09c99571fa396e4137883cb15eb7880e4bccf220 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -1,7 +1,7 @@
 #! /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>
 
@@ -37,6 +37,7 @@ then
 fi
 
 PERLSUCKS=no
+AUTOMAKESUCKS=no
 
 ##
 ## Generate the modules makefile, by parsing modules/**/Modules.am
@@ -72,13 +73,16 @@ include ${dir}/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
@@ -92,8 +96,13 @@ EOF
 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
 
@@ -144,7 +153,7 @@ lib${mod}dir = \$(libdir)/vlc/${topdir}
 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
@@ -195,6 +204,9 @@ amvers="none"
 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
@@ -203,6 +215,10 @@ else
     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"
@@ -325,6 +341,19 @@ case "$GETTEXT" in
   ;;
 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)
   ;;