]> git.sesse.net Git - vlc/commitdiff
Get rid of the UNTRUE conditionnal
authorRémi Denis-Courmont <rem@videolan.org>
Sat, 13 Aug 2005 08:12:37 +0000 (08:12 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sat, 13 Aug 2005 08:12:37 +0000 (08:12 +0000)
and some other Makefile cleanup

bootstrap
mozilla/Makefile.am

index 8cd918038fe3bf600fb113e86914b25d1c0aa1f9..dccac3fe43f76f02f0011f20e86448033a8a8021 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -3,7 +3,9 @@
 ##  bootstrap file for the VLC media player
 ##  $Id$
 ##
-##  Authors: Sam Hocevar <sam@zoy.org>
+## Copyright (C) 2005 the VideoLAN team
+##
+##  Initial author: Sam Hocevar <sam@zoy.org>
 
 if test "$#" != "0"; then
   echo "Usage: $0"
@@ -188,13 +190,22 @@ EOF
 for dir in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
 do
   printf "."
-  mf="modules/${dir}/Modules.am"
+  modf="modules/${dir}/Modules.am"
+  makf="modules/${dir}/Makefile.am"
   basedir="`echo "${dir}" | cut -f1 -d/`"
   # automake will not recurse for make dist if we don't define SUBDIRS = .
   subdirs="`sed -ne 's,'modules/${dir}'/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`"
-  rm -f modules/${dir}/Makefile.am && cat > modules/${dir}/Makefile.am << EOF
+  mods="`sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < "${modf}" | xargs`"
+  extra_libs=""
+  for mod in $mods
+  do
+    extra_libs="${extra_libs} lib${mod}_plugin.a"
+    extra_libs="${extra_libs} lib${mod}.a lib${mod}_pic.a"
+  done
+  rm -f "${makf}" && cat > "${makf}" << EOF
 
-# Autogenerated by bootstrap - DO NOT EDIT - edit Modules.am instead
+# ${makf} automatically generated from ${modf} by bootstrap
+# DO NOT EDIT - edit Modules.am instead
 
 NULL =
 libvlc_LIBRARIES =
@@ -205,17 +216,19 @@ BUILT_SOURCES =
 SUBDIRS = ${subdirs}
 #DIST_SUBDIRS = \$(SUBDIRS)
 libvlcdir = \$(libdir)/vlc/${basedir}
+
+EXTRA_LIBRARIES = ${extra_libs}
 include Modules.am
 
-if BUILD_MOZILLA
-if HAVE_WIN32
-# There's no need for pic code on win32 so get rid of this to substantially
-# reduce the compilation time.
+if !BUILD_MOZILLA
 pic = no
-endif
 else
+if HAVE_WIN32
+dnl There's no need for pic code on win32 so get rid of this to substantially
+dnl reduce the compilation time.
 pic = no
 endif
+endif
 
 clean-local:
        -rm -f *.a *.so *.dll *.sl *.dylib
@@ -223,25 +236,24 @@ clean-local:
 all: all-modules
 all-modules:
        @set fnord \$\$MAKEFLAGS; amf=\$\$2; targets=\`\\
-       if test "\$(plugin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list plugin); for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf} | xargs`; do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_plugin\$(LIBEXT);; esac; done; fi; \\
-       if test "\$(builtin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf} | xargs`; do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}.a;; esac; done; fi; \\
-       if test "\$(pic)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf} | xargs`; do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_pic.a;; esac; done; fi; \\
+       if test "\$(plugin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list plugin); for mod in $mods; do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_plugin\$(LIBEXT);; esac; done; fi; \\
+       if test "\$(builtin)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in $mods; do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}.a;; esac; done; fi; \\
+       if test "\$(pic)" != "no"; then z=\$\$(\$(VLC_CONFIG) --list builtin); for mod in $mods; do case "\$\$z " in *\ \$\${mod}\ *) echo lib\$\${mod}_pic.a;; esac; done; fi; \\
        \`; case "\$\$targets" in *lib*) \$(MAKE) \$(AM_MAKEFLAGS) \$\$targets || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; ;; esac; \\
        test -z "\$\$fail"
 
+\$(srcdir)Makefile.am: \$(srcdir)Modules.am \$(top_srcdir)bootstrap
+       cd \$(top_srcdir) && \$(SHELL) ./bootstrap
+
 EOF
-  for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf}`
+  for mod in $mods
   do
-    if grep '^SOURCES_'${mod}'.*=.*PRIVATE' < ${mf} >/dev/null 2>&1; then
+    if grep '^SOURCES_'${mod}'.*=.*PRIVATE' < "${modf}" >/dev/null 2>&1; then
         PRIVATE='#'; else
         PRIVATE=''; fi
-    if grep '^nodist_SOURCES_'${mod}'' < ${mf} >/dev/null 2>&1; then
+    if grep '^nodist_SOURCES_'${mod}'' < "${modf}" >/dev/null 2>&1; then
         NODIST=''; else
         NODIST='#'; fi
-#    cat >> m4/private.m4-tmp1 << EOF
-#dnl  AM_CONDITIONAL(${mod}_p, test x\$${mod}_p = xyes)
-#dnl  AM_CONDITIONAL(${mod}_b, test x\$${mod}_b = xyes)
-#EOF
     cat >> m4/private.m4-tmp4 << EOF
     ${mod}) list="\\\${list} ${dir}/lib${mod}" ;;
 EOF
@@ -252,66 +264,51 @@ EOF
 #   the resulting file size.
 # - *_CFLAGS, *_CXXFLAGS etc. because per-object CPPFLAGS does not seem to
 #   work properly with any automake version I tested.
-    cat >> modules/${dir}/Makefile.am << EOF
+    cat >> "${makf}" << EOF
 # The ${mod} plugin
 
 EOF
-    if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
+    if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
 clean-local: clean-${mod}
 clean-${mod}:
        -test -z "\$(nodist_SOURCES_${mod})" || rm -f \$(nodist_SOURCES_${mod})
 
 EOF
     fi
-    cat >> modules/${dir}/Makefile.am << EOF
-if UNTRUE
-L${mod}p = lib${mod}_plugin.a
-D${mod}p = lib${mod}_plugin\$(LIBEXT)
-L${mod}b = lib${mod}.a
-L${mod}pic = lib${mod}_pic.a
-EOF
-    if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
-B${mod} = \$(nodist_SOURCES_${mod})
-EOF
-    fi
-    cat >> modules/${dir}/Makefile.am << EOF
-endif
-
-EOF
-    if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
+    if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
 ${PRIVATE}BUILT_SOURCES += \$(B${mod})
 EOF
     fi
-    cat >> modules/${dir}/Makefile.am << EOF
+    cat >> "${makf}" << EOF
 ${PRIVATE}lib${mod}_plugin_a_SOURCES = \$(SOURCES_${mod})
 EOF
-    if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
+    if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
 ${PRIVATE}nodist_lib${mod}_plugin_a_SOURCES = \$(nodist_SOURCES_${mod})
 EOF
     fi
-    cat >> modules/${dir}/Makefile.am << EOF
+    cat >> "${makf}" << EOF
 lib${mod}_plugin_a_CFLAGS = \`\$(VLC_CONFIG) --cflags plugin ${mod}\`
 lib${mod}_plugin_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags plugin ${mod}\`
 lib${mod}_plugin_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags plugin ${mod}\`
 
 lib${mod}_pic_a_SOURCES = ${PRIVATE}\$(SOURCES_${mod})
 EOF
-    if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
+    if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
 nodist_lib${mod}_pic_a_SOURCES = ${PRIVATE}\$(nodist_SOURCES_${mod})
 EOF
     fi
-    cat >> modules/${dir}/Makefile.am << EOF
+    cat >> "${makf}" << EOF
 lib${mod}_pic_a_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin pic ${mod}\`
 lib${mod}_pic_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin pic ${mod}\`
 lib${mod}_pic_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin pic ${mod}\`
 
 lib${mod}_a_SOURCES = ${PRIVATE}\$(SOURCES_${mod})
 EOF
-    if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
+    if [ "${NODIST}" != "#" ]; then cat >> "${makf}" << EOF
 nodist_lib${mod}_a_SOURCES = ${PRIVATE}\$(nodist_SOURCES_${mod})
 EOF
     fi
-    cat >> modules/${dir}/Makefile.am << EOF
+    cat >> "${makf}" << EOF
 lib${mod}_a_CFLAGS = \`\$(VLC_CONFIG) --cflags builtin ${mod}\`
 lib${mod}_a_CXXFLAGS = \`\$(VLC_CONFIG) --cxxflags builtin ${mod}\`
 lib${mod}_a_OBJCFLAGS = \`\$(VLC_CONFIG) --objcflags builtin ${mod}\`
@@ -334,7 +331,6 @@ EOF
 done
 
 cat >> m4/private.m4-tmp1 << EOF
-  AM_CONDITIONAL(UNTRUE, false)
 ])
 EOF
 cat m4/private.m4-tmp1 >> m4/private.m4 && rm -f m4/private.m4-tmp1
index 357adba2f1dba60fe6b0d507eeffdcdaf408282d..8ac4af2119f9cf886283055f87ccefa24f91101c 100644 (file)
@@ -2,7 +2,7 @@
 # Building the Mozilla plugin
 ###############################################################################
 
-noinst_LIBRARIES = $(noinst_LIBRARIES_mozilla)
+EXTRA_LIBRARIES = libplugin.a
                                             
 MOSTLYCLEANFILES = $(LIBRARIES_mozilla)
 EXTRA_DIST = $(SOURCES_mozilla) $(DIST_rsrc) vlcintf.idl
@@ -51,10 +51,6 @@ endif
 endif
 
 if BUILD_MOZILLA
-if UNTRUE
-noinst_LIBRARIES_mozilla = libplugin.a
-endif
-
 libplugin_a_SOURCES = $(SOURCES_mozilla)
 libplugin_a_CFLAGS = `$(VLC_CONFIG) --cflags mozilla $(pic)` \
                     $(CPPFLAGS_mozilla_EXTRA) -Imozilla