-for dir in `sed -ne 's,modules/\(.*\)/Makefile,\1,p' configure.ac`
-do
- printf "."
- mf="modules/${dir}/Modules.am"
- basedir="${dir%%\/*}"
- # 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
-
-# Autogenerated by bootstrap - DO NOT EDIT - edit Modules.am instead
-
-NULL =
-libvlc_LIBRARIES =
-noinst_LIBRARIES =
-noinst_HEADERS =
-EXTRA_DIST = Modules.am
-BUILT_SOURCES =
-SUBDIRS = ${subdirs}
-#DIST_SUBDIRS = \$(SUBDIRS)
-libvlcdir = \$(libdir)/vlc/${basedir}
-include Modules.am
-
-clean: clean-local
-clean-local:
- -rm -f *.a *.so *.dll *.sl *.dylib
-
-EOF
- for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf}`
- do
- if grep '^SOURCES_'${mod}'.*=.*PRIVATE' < ${mf} >/dev/null 2>&1; then
- PRIVATE='#'; else
- PRIVATE=''; fi
- if grep '^nodist_SOURCES_'${mod}'' < ${mf} >/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
-# Generation of modules/**/Makefile.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. because per-object CPPFLAGS does not seem to
-# work properly with any automake version I tested.
- cat >> modules/${dir}/Makefile.am << EOF
-# The ${mod} plugin
-clean: clean-${mod}
-all: all-${mod}
-
-EOF
- if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
-clean-${mod}:
- -test -z "\$(nodist_SOURCES_${mod})" || rm -f \$(nodist_SOURCES_${mod})
-
-EOF
- fi
- cat >> modules/${dir}/Makefile.am << EOF
-all-${mod}:
-if BUILD_MOZILLA
- @set fnord \$\$MAKEFLAGS; amf=\$\$2; \\
- if test "\$(plugin)" != "no" \\
- && \$(VLC_CONFIG) --target plugin | grep "${dir}/lib${mod}_plugin" >/dev/null 2>&1; then \\
- \$(MAKE) \$(AM_MAKEFLAGS) lib${mod}_plugin\$(LIBEXT) || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \\
- fi; \\
- if test "\$(builtin)" != "no" \\
- && \$(VLC_CONFIG) --target builtin | grep "${dir}/lib${mod}\\.a" >/dev/null 2>&1; then \\
- \$(MAKE) \$(AM_MAKEFLAGS) lib${mod}.a || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \\
- fi; \\
- if test "\$(pic)" != "no" \\
- && \$(VLC_CONFIG) --target builtin pic | grep "${dir}/lib${mod}_pic\\.a" >/dev/null 2>&1; then \\
- \$(MAKE) \$(AM_MAKEFLAGS) lib${mod}_pic.a || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \\
- fi; \\
- test -z "\$\$fail"
-else
- @set fnord \$\$MAKEFLAGS; amf=\$\$2; \\
- if test "\$(plugin)" != "no" \\
- && \$(VLC_CONFIG) --target plugin | grep "${dir}/lib${mod}_plugin" >/dev/null 2>&1; then \\
- \$(MAKE) \$(AM_MAKEFLAGS) lib${mod}_plugin\$(LIBEXT) || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \\
- fi; \\
- if test "\$(builtin)" != "no" \\
- && \$(VLC_CONFIG) --target builtin | grep "${dir}/lib${mod}\\.a" >/dev/null 2>&1; then \\
- \$(MAKE) \$(AM_MAKEFLAGS) lib${mod}.a || case "\$\$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \\
- fi; \\
- test -z "\$\$fail"
-endif
-
-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
-${PRIVATE}BUILT_SOURCES += \$(B${mod})
-EOF
- fi
- cat >> modules/${dir}/Makefile.am << EOF
-${PRIVATE}lib${mod}_plugin_a_SOURCES = \$(SOURCES_${mod})
-EOF
- if [ "${NODIST}" != "#" ]; then cat >> modules/${dir}/Makefile.am << EOF
-${PRIVATE}nodist_lib${mod}_plugin_a_SOURCES = \$(nodist_SOURCES_${mod})
-EOF
- fi
- cat >> modules/${dir}/Makefile.am << 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
-nodist_lib${mod}_pic_a_SOURCES = ${PRIVATE}\$(nodist_SOURCES_${mod})
-EOF
- fi
- cat >> modules/${dir}/Makefile.am << 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
-nodist_lib${mod}_a_SOURCES = ${PRIVATE}\$(nodist_SOURCES_${mod})
-EOF
- fi
- cat >> modules/${dir}/Makefile.am << 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}\`
-
-libvlc_LIBRARIES += \$(L${mod}b) \$(L${mod}pic)
-lib${mod}_DATA = \$(D${mod}p)
-
-lib${mod}dir = \$(libdir)/vlc/${topdir}
-${PRIVATE}noinst_LIBRARIES += \$(L${mod}p)
-${PRIVATE}lib${mod}_plugin\$(LIBEXT): \$(lib${mod}_plugin_a_OBJECTS)
-${PRIVATE} @case \`\$(VLC_CONFIG) --linkage ${mod}\` in \\
-${PRIVATE} c++) echo \$(CXXLINK) \$(lib${mod}_plugin_a_OBJECTS) \\\`\$(VLC_CONFIG) --libs plugin ${mod}\\\` ; \$(CXXLINK) \$(lib${mod}_plugin_a_OBJECTS) \`\$(VLC_CONFIG) --libs plugin ${mod}\` ;; \\
-${PRIVATE} objc) echo \$(OBJCLINK) \$(lib${mod}_plugin_a_OBJECTS) \\\`\$(VLC_CONFIG) --libs plugin ${mod}\\\` ; \$(OBJCLINK) \$(lib${mod}_plugin_a_OBJECTS) \`\$(VLC_CONFIG) --libs plugin ${mod}\` ;; \\
-${PRIVATE} c|*) echo \$(LINK) \$(lib${mod}_plugin_a_OBJECTS) \\\`\$(VLC_CONFIG) --libs plugin ${mod}\\\` ; \$(LINK) \$(lib${mod}_plugin_a_OBJECTS) \`\$(VLC_CONFIG) --libs plugin ${mod}\` ;; \\
-${PRIVATE} esac
-
-
-EOF
- done
-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
-cat >> m4/private.m4-tmp2 << EOF
-])
-EOF
-cat m4/private.m4-tmp2 >> m4/private.m4 && rm -f m4/private.m4-tmp2
-cat >> m4/private.m4-tmp3 << EOF
-])])
-EOF
-cat m4/private.m4-tmp3 >> m4/private.m4 && rm -f m4/private.m4-tmp3
-cat >> m4/private.m4-tmp4 << EOF
-BLAH
-])
-EOF
-cat m4/private.m4-tmp4 >> m4/private.m4 && rm -f m4/private.m4-tmp4
-
-echo "done."