]> git.sesse.net Git - vlc/blobdiff - bootstrap
bootstrap: remove small bug when generating Makefile.am from Modules.am
[vlc] / bootstrap
index 39fe1a323dacc725d19e041213853c33aef6166b..79f9fb1c4453dfa43e2770d1b17f565ea08653f7 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -99,7 +99,9 @@ esac
 
 # Check for libtool
 libtoolize="no"
-if glibtoolize --version >/dev/null 2>&1; then
+if test -x extras/contrib/bin/libtoolize; then
+  libtoolize="extras/contrib/bin/libtoolize"
+elif glibtoolize --version >/dev/null 2>&1; then
   libtoolize="glibtoolize"
 elif libtoolize --version >/dev/null 2>&1; then
   libtoolize="libtoolize"
@@ -219,15 +221,16 @@ EXTRA_LTLIBRARIES = ${extra_ltlibs}
 
 include Modules.am
 
-LTLIBVLC = \$(top_builddir)/src/libvlc.la
+LTLIBVLC = -L\$(top_builddir)/src -lvlc
 
-if USE_LIBTOOL
-LIBADD = \$(LTLIBVLC)
-endif
-if HAVE_WIN32
-LIBVLC = \$(top_builddir)/src/libvlc.dll
-LIBADD = \$(LIBVLC)
+AM_LDFLAGS = -rpath '\$(libvlcdir)' -avoid-version \\
+       -module -no-undefined -shrext \$(LIBEXT) 
+if HAVE_COMPILER_EXPORT
+AM_LDFLAGS += -export-dynamic
+else
+AM_LDFLAGS += -export-symbol-regex ^\$(VLC_ENTRY)\$\$
 endif
+AM_LIBADD = \$(LTLIBVLC)
 
 all: all-modules
 
@@ -236,23 +239,15 @@ nice:
 
 # Find out which modules were enabled and tell make to build them
 all-modules:
-if USE_LIBTOOL
        @set fnord \$\$MAKEFLAGS; amf=\$\$2; targets=\`\\
        z=\$\$(\$(VLC_CONFIG) --list plugin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_plugin.la;; esac; done; \\
        \`; case "\$\$targets" in *lib*) \$(MAKE) \$(AM_MAKEFLAGS) \$\$targets || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; ;; esac; \\
        test -z "\$\$fail"
-else
-       @set fnord \$\$MAKEFLAGS; amf=\$\$2; targets=\`\\
-       z=\$\$(\$(VLC_CONFIG) --list plugin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_plugin\$(LIBEXT);; esac; done; \\
-       z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}.a;; esac; done; \\
-       \`; case "\$\$targets" in *lib*) \$(MAKE) \$(AM_MAKEFLAGS) \$\$targets || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; ;; esac; \\
-       test -z "\$\$fail"
-endif
 
 # Build a plugin with the adequate linker and linker's flags
 _plugin.la_plugin\$(LIBEXT):
        @mod="\$*" ; mod=\$\${mod#lib} ; \
-       ldfl="\`\$(VLC_CONFIG) --libs plugin \$\$mod\` \$(LIBADD) -u \$(SYMPREF)\$(VLC_ENTRY)" ; \
+       ldfl="\`\$(VLC_CONFIG) --libs plugin \$\$mod\` \$(LIBVLC) -u \$(SYMPREF)\$(VLC_ENTRY)" ; \
        case \`\$(VLC_CONFIG) --linkage \$\$mod\` in \\
          c++)  ld="\$(CXXLINK)" ;; \
          objc) ld="\$(OBJCLINK)" ;; \
@@ -260,7 +255,6 @@ _plugin.la_plugin\$(LIBEXT):
        esac ; \
        echo \$\$ld \$< \$\$ldfl ; \
        \$\$ld \$< \$\$ldfl
-       @if test -f "\$@.exe"; then mv -f -- "\$@.exe" "\$@"; fi
 
 if MAINTAINER_MODE
 \$(srcdir)/Makefile.am: \$(srcdir)/Modules.am \$(top_srcdir)/bootstrap
@@ -268,53 +262,25 @@ if MAINTAINER_MODE
 endif
 
 mostlyclean-local:
-       -rm -f *.la
-if !USE_LIBTOOL
-       -rm -f *\$(LIBEXT)
-endif
+       -rm -f -- *.la
 
 ### automake creates libvlcdir after running install-*-local
 ### so we have to create it ourselves first
 install-exec-local: all-modules
-if USE_LIBTOOL
        @if test -z "\$(libvlc_LTLIBRARIES)"; then \
          z=\$\$(\$(VLC_CONFIG) --list plugin); \
          m=\`for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo -n " lib\$\${mod}_plugin.la" ;; esac; done\` ; \
          test -z "\$\$m" || \
            \$(MAKE) \$(AM_MAKEFLAGS) libvlc_LTLIBRARIES="\$\$m" install-libvlcLTLIBRARIES || exit \$\$? ; \
        fi
-else
-       mkdir -p -- "\$(DESTDIR)\$(libvlcdir)"
-       @z=\$\$(\$(VLC_CONFIG) --list plugin); \
-       for mod in \$(mods); do \
-         case "\$\$z " \
-           in *\ \$\${mod}\ *) \
-             echo \$(INSTALL_PROGRAM) "lib\$\${mod}_plugin\$(LIBEXT)" "\$(DESTDIR)\$(libvlcdir)/" ; \
-             \$(INSTALL_PROGRAM) "lib\$\${mod}_plugin\$(LIBEXT)" "\$(DESTDIR)\$(libvlcdir)/" || exit \$\$?; \
-             ;; \
-         esac; \
-       done
-endif
 
 uninstall-local:
-if USE_LIBTOOL
        @if test -z "\$(libvlc_LTLIBRARIES)"; then \
          z=\$\$(\$(VLC_CONFIG) --list plugin); \
          m=\`for mod in \$(mods); do case "\$\$z " in *\ \$\${mod}\ *) echo -n " lib\$\${mod}_plugin.la" ;; esac; done\` ; \
          test -z "\$\$m" || \
            \$(MAKE) \$(AM_MAKEFLAGS) libvlc_LTLIBRARIES="\$\$m" uninstall-libvlcLTLIBRARIES || exit \$\$?; \
        fi
-else
-       @z=\$\$(\$(VLC_CONFIG) --list plugin); \
-       for mod in \$(mods); do \
-         case "\$\$z " \
-           in *\ \$\${mod}\ *) \
-             echo rm -f "\$(DESTDIR)\$(libvlcdir)/lib\$\${mod}_plugin\$(LIBEXT)" ; \
-             rm -f "\$(DESTDIR)\$(libvlcdir)/lib\$\${mod}_plugin\$(LIBEXT)" || true; \
-             ;; \
-         esac; \
-       done
-endif
 
 EOF
   for mod in $mods
@@ -341,7 +307,7 @@ lib${mod}_plugin_la_SOURCES = \$(SOURCES_${mod})
 EOF
     if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
 nodist_lib${mod}_plugin_la_SOURCES = \$(nodist_SOURCES_${mod})
-CLEANFILES += "\$(nodist_SOURCES_${mod})"
+CLEANFILES += \$(nodist_SOURCES_${mod})
 BUILT_SOURCES += \$(B${mod})
 EOF
     fi
@@ -349,13 +315,14 @@ EOF
 lib${mod}_plugin_la_CFLAGS = \`\$(VLC_CONFIG) --cflags plugin ${mod}\`
 lib${mod}_plugin_la_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags plugin ${mod}\`
 lib${mod}_plugin_la_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags plugin ${mod}\`
-lib${mod}_plugin_la_LDFLAGS = \`\$(VLC_CONFIG) --libs plugin ${mod}\` \\
-       -rpath '\$(libvlcdir)' -avoid-version -module -shrext \$(LIBEXT) \\
-       -export-symbol-regex ^\$(VLC_ENTRY)\$\$ -no-undefined \$(LIBADD)
+lib${mod}_plugin_la_LDFLAGS = \`\$(VLC_CONFIG) --libs plugin ${mod}\` \$(AM_LDFLAGS)
+lib${mod}_plugin_la_LIBADD = \$(AM_LIBADD)
 EOF
   done
 done
 
+printf "\n"
+
 cat >> m4/private.m4 << EOF
 BLAH
 ])
@@ -397,25 +364,9 @@ if test -f "ltmain.sh"; then
   mv ltmain.sh autotools/
 fi
 
-# patch for DLL link for libtool on cygwin (remove when fixed)
-if test ".`uname -s|sed -n '/^CYGWIN/p'`" != "."; then
-patch -s -p0 << 'EOF'
---- autotools/ltmain.orig      2006-12-05 15:15:42.064607000 +0000
-+++ autotools/ltmain.sh        2006-12-05 15:16:24.705777800 +0000
-@@ -4360,7 +4360,7 @@
-     prog)
-       case $host in
--      *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
-+      *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,;s,.dll.exe$,.dll,'` ;;
-       esac
-       if test -n "$vinfo"; then
-       $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
-EOF
-fi
-
 # Do the rest
 ${autopoint} -f
+rm -f po/Makevars.template
 ${aclocal} ${ACLOCAL_ARGS}
 ${autoconf}
 ${autoheader}