-for dir in `sed -ne 's,\(modules/.*\)/Makefile,\1,p' configure.ac`
-do
- printf "."
- mf="${dir}/Modules.am"
- basedir="`echo ${dir} | cut -f2 -d/`"
- # automake will not recurse for make dist if we don't define SUBDIRS = .
- subdirs="`sed -ne 's,'${dir}'/\([^/]*\)/Makefile,\1,p' configure.ac | xargs`"
- #parent=`echo ${dir} | sed -e 's@[^/]*@..@g'`
- #echo " ${dir}/Makefile" >> m4/private.m4-tmp3
- rm -f ${dir}/Makefile.am && cat > ${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
-EOF
- for mod in `sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < ${mf}`
- do
- count="`expr ${count} + 1`"
- 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 >> Modules.am << EOF
-${dir}/lib${mod}_plugin: ${dir}/lib${mod}_plugin\$(LIBEXT)
-${dir}/lib${mod}_plugin\$(LIBEXT): include/vlc_symbols.h FORCE
- cd ${dir} && \$(MAKE) lib${mod}_plugin\$(LIBEXT)
-${dir}/lib${mod}.a: include/vlc_symbols.h FORCE
- cd ${dir} && \$(MAKE) lib${mod}.a
-${dir}/lib${mod}_pic.a: include/vlc_symbols.h FORCE
- cd ${dir} && \$(MAKE) lib${mod}_pic.a
-
-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 >> ${dir}/Makefile.am << EOF
-# The ${mod} plugin
-
-if UNTRUE
-L${count}p = lib${mod}_plugin.a
-D${count}p = lib${mod}_plugin\$(LIBEXT)
-L${count}b = lib${mod}.a
-L${count}pic = lib${mod}_pic.a
-EOF
- if [ "${NODIST}" != "#" ]; then cat >> ${dir}/Makefile.am << EOF
-B${count}p = \$(nodist_SOURCES_${mod})
-B${count}b = \$(nodist_SOURCES_${mod})
-EOF
- fi
- cat >> ${dir}/Makefile.am << EOF
-endif