[vlc-commits] Move MODULE_* predefined constants from vlc-config to Makefile

Rémi Denis-Courmont git at videolan.org
Thu Aug 18 19:46:28 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Aug 18 19:56:01 2011 +0300| [75532d5c0f7340a326650d7e0f363e1123de8d41] | committer: Rémi Denis-Courmont

Move MODULE_* predefined constants from vlc-config to Makefile

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=75532d5c0f7340a326650d7e0f363e1123de8d41
---

 modules/common.am |    9 ++++++++-
 src/Makefile.am   |    1 +
 vlc-config.in.in  |    7 -------
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/modules/common.am b/modules/common.am
index 5cecb18..ad64737 100644
--- a/modules/common.am
+++ b/modules/common.am
@@ -13,7 +13,14 @@ CLEANFILES = $(BUILT_SOURCES)
 
 LTLIBVLCCORE = $(top_builddir)/src/libvlccore.la
 
-AM_CPPFLAGS = -D__PLUGIN__
+# Module name from object or executable file name.
+MODULE_NAME = `p="$@"; p="$${p\#\#*/}"; p="$${p\#lib}"; echo "$${p%_plugin*}"`
+
+AM_CPPFLAGS = \
+	-DMODULE_NAME=$(MODULE_NAME) \
+	-DMODULE_NAME_IS_$(MODULE_NAME) \
+	-DMODULE_STRING=\"$(MODULE_NAME)\"
+	-D__PLUGIN__
 AM_CFLAGS = `$(VLC_CONFIG) --cflags plugin $@`
 AM_CXXFLAGS = `$(VLC_CONFIG) --cxxflags plugin $@`
 AM_OBJCFLAGS = `$(VLC_CONFIG) --objcflags plugin $@`
diff --git a/src/Makefile.am b/src/Makefile.am
index 394d766..ba23fd5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -223,6 +223,7 @@ libvlc_win32_rc.$(OBJEXT): libvlc_win32_rc.rc
 libvlc_la_SOURCES = $(SOURCES_libvlc_control)
 libvlc_la_LIBADD = `$(VLC_CONFIG) -libs libvlc` \
 	libvlccore.la ../compat/libcompat.la
+libvlc_la_CPPFLAGS = -DMODULE_STRING=\"libvlc\"
 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
 libvlc_la_LDFLAGS = $(AM_LDFLAGS) `$(VLC_CONFIG) --ldflags libvlc` \
 	-version-info 6:0:1 \
diff --git a/vlc-config.in.in b/vlc-config.in.in
index be89ce4..3287656 100644
--- a/vlc-config.in.in
+++ b/vlc-config.in.in
@@ -129,13 +129,6 @@ while test $# -gt 0; do
 done
 
 #
-#  If a module was requested, use its name
-#
-if test -n "${module}"; then
-  cppflags="${cppflags} -DMODULE_NAME=${module} -DMODULE_NAME_IS_${module} -DMODULE_STRING=\"${module}\""
-fi
-
-#
 #  Output what we were asked
 #
 if test "${echo_cppflags}" = yes; then



More information about the vlc-commits mailing list