X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgenmf;h=d7b288748611e850209c7f361fb06dea7f4c856b;hb=903a434e3f7f78e2522b00f1f4c5da00a66e6d8c;hp=f756893b36cccdddfe61e4d99fcb4f95b9d8db36;hpb=24ce9d79088f2723522cee2215e55a3b4ef00e0b;p=vlc diff --git a/modules/genmf b/modules/genmf index f756893b36..d7b2887486 100755 --- a/modules/genmf +++ b/modules/genmf @@ -14,15 +14,26 @@ do printf "." dir="$1" modf="modules/${dir}/Modules.am" + if ! test -f "$modf"; then + echo "$modf does not exist!" >&2 + exit 1 + fi 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`" - mods="`sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < "${modf}" | xargs`" + mods="`sed -n -e 's/^ *SOURCES_\([^ ]*\).*/\1/p' < "${modf}" | sort | uniq | xargs`" + plugins="`sed -n -e 's/^.*lib\([^ ]*\)_plugin\.la.*/\1/p' < "${modf}" | sort | uniq | xargs`" + libvlc_ltlibs="" extra_ltlibs="" for mod in $mods do - extra_ltlibs="${extra_ltlibs} lib${mod}_plugin.la" + case " ${plugins} " in + *\ ${mod}\ *) + ;; + *) + libvlc_ltlibs="${libvlc_ltlibs} \$(LTLIB${mod})" + extra_ltlibs="${extra_ltlibs} lib${mod}_plugin.la" + ;; + esac done rm -f "${makf}" && cat > "${makf}" << EOF # ${makf} automatically generated from ${modf} by $0 @@ -31,7 +42,7 @@ do basedir = ${basedir} dir = ${dir} mods = ${mods} -SUBDIRS = ${subdirs} +libvlc_LTLIBRARIES = ${libvlc_ltlibs} EXTRA_LTLIBRARIES = ${extra_ltlibs} include \$(top_srcdir)/modules/common.am @@ -49,7 +60,7 @@ lib${mod}_plugin_la_CXXFLAGS = \$(AM_CXXFLAGS) lib${mod}_plugin_la_OBJCFLAGS = \$(AM_OBJCFLAGS) # Set LIBADD and DEPENDENCIES manually: lib${mod}_plugin_la_LIBADD = \$(AM_LIBADD) -lib${mod}_plugin_la_DEPENDENCIES = +lib${mod}_plugin_la_DEPENDENCIES = \$(top_srcdir)/src/libvlccore.sym EOF done