## 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"
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 =
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
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
# 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}\`
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