-AM_CFLAGS = `$(VLC_CONFIG) --cflags plugin $@`
-AM_CXXFLAGS = `$(VLC_CONFIG) --cxxflags plugin $@`
-AM_OBJCFLAGS = `$(VLC_CONFIG) --objcflags plugin $@`
-AM_LDFLAGS = -rpath '$(libvlcdir)' \
- -avoid-version -module -no-undefined \
- -shrext $(LIBEXT) \
- `$(VLC_CONFIG) --ldflags plugin $@`
-AM_LIBADD = `$(VLC_CONFIG) -libs plugin $@` $(LTLIBVLC)
+# Module name from object or executable file name.
+MODULE_NAME = `p="$@"; p="$${p\#\#*/}"; p="$${p\#lib}"; echo "$${p%_plugin*}"`