[vlc-commits] Migrate VLC_ADD_* flags from vlc-config to AC_SUBST

Rémi Denis-Courmont git at videolan.org
Thu Aug 18 21:02:31 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Aug 18 21:23:25 2011 +0300| [e7df8e75ea9ccd8450f88acadbc238a2c0285790] | committer: Rémi Denis-Courmont

Migrate VLC_ADD_* flags from vlc-config to AC_SUBST

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

 bin/Makefile.am                  |    7 ++++---
 m4/vlc.m4                        |   12 ++++++------
 modules/codec/avcodec/Modules.am |    5 +++--
 modules/common.am                |   14 ++++++--------
 modules/genmf                    |    9 +++++----
 modules/gui/qt4/Modules.am       |    8 ++++----
 src/Makefile.am                  |   12 ++++++------
 src/test/Makefile.am             |    4 ++--
 test/Makefile.am                 |    2 +-
 9 files changed, 37 insertions(+), 36 deletions(-)

diff --git a/bin/Makefile.am b/bin/Makefile.am
index 39e0185..85b8a8b 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -8,7 +8,8 @@ EXTRA_DIST = vlc_win32_rc.rc.in
 
 SUFFIXES = .rc.in .rc
 
-AM_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
+AM_CPPFLAGS = $(CPPFLAGS_vlc)
+AM_CFLAGS = $(CFLAGS_vlc)
 
 
 if !HAVE_WIN32
@@ -31,8 +32,8 @@ vlc_wrapper_SOURCES = rootwrap.c
 vlc_wrapper_LDADD = $(SOCKET_LIBS)
 
 vlc_DEPENDENCIES = ../src/libvlc.sym
-vlc_LDFLAGS = `$(VLC_CONFIG) --ldflags vlc`
-vlc_LDADD = ../src/libvlc.la ../src/libvlccore.la `$(VLC_CONFIG) -libs vlc`
+vlc_LDFLAGS = $(LDFLAGS_vlc)
+vlc_LDADD = ../src/libvlc.la ../src/libvlccore.la $(LIBS_vlc)
 
 vlc_static_SOURCES = $(vlc_SOURCES)
 vlc_static_CFLAGS = $(AM_CFLAGS) \
diff --git a/m4/vlc.m4 b/m4/vlc.m4
index abaf0b2..1cfe3e4 100644
--- a/m4/vlc.m4
+++ b/m4/vlc.m4
@@ -17,42 +17,42 @@ dnl  Special cases: vlc, pics, plugins, save
 AC_DEFUN([VLC_ADD_CPPFLAGS], [
   m4_foreach_w([element], [$1], [
     [eval "CPPFLAGS_]element[="'"$'"{CPPFLAGS_]element[} $2"'"']
-    [am_modules_with_cppflags="${am_modules_with_cppflags} ]element["]
+    AC_SUBST([CPPFLAGS_]element)
   ])
 ])
 
 AC_DEFUN([VLC_ADD_CFLAGS], [
   m4_foreach_w([element], [$1], [
     [eval "CFLAGS_]element[="'"$'"{CFLAGS_]element[} $2"'"']
-    [am_modules_with_cflags="${am_modules_with_cflags} ]element["]
+    AC_SUBST([CFLAGS_]element)
   ])
 ])
 
 AC_DEFUN([VLC_ADD_CXXFLAGS], [
   m4_foreach_w([element], [$1], [
     [eval "CXXFLAGS_]element[="'"$'"{CXXFLAGS_]element[} $2"'"']
-    [am_modules_with_cxxflags="${am_modules_with_cxxflags} ]element["]
+    AC_SUBST([CXXFLAGS_]element)
   ])
 ])
 
 AC_DEFUN([VLC_ADD_OBJCFLAGS], [
   m4_foreach_w([element], [$1], [
     [eval "OBJCFLAGS_]element[="'"$'"{OBJCFLAGS_]element[} $2"'"']
-    [am_modules_with_objcflags="${am_modules_with_objcflags} ]element["]
+    AC_SUBST([OBJCFLAGS_]element)
   ])
 ])
 
 AC_DEFUN([VLC_ADD_LDFLAGS], [
   m4_foreach_w([element], [$1], [
     [eval "LDFLAGS_]element[="'"$2 $'"{LDFLAGS_]element[}"'"']
-    [am_modules_with_ldflags="${am_modules_with_ldflags} ]element["]
+    AC_SUBST([LDFLAGS_]element)
   ])
 ])
 
 AC_DEFUN([VLC_ADD_LIBS], [
   m4_foreach_w([element], [$1], [
     [eval "LIBS_]element[="'"'"$2 "'$'"{LIBS_]element[}"'"']
-    [am_modules_with_libs="${am_modules_with_libs} ]element["]
+    AC_SUBST([LIBS_]element)
   ])
 ])
 
diff --git a/modules/codec/avcodec/Modules.am b/modules/codec/avcodec/Modules.am
index cf213de..2dee687 100644
--- a/modules/codec/avcodec/Modules.am
+++ b/modules/codec/avcodec/Modules.am
@@ -19,8 +19,9 @@ if ENABLE_SOUT
 libavcodec_plugin_la_SOURCES += \
 	encoder.c
 endif
-libavcodec_plugin_la_CFLAGS = $(AM_CFLAGS)
-libavcodec_plugin_la_LIBADD = $(AM_LIBADD)
+libavcodec_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_avcodec)
+libavcodec_plugin_la_LIBADD = $(AM_LIBADD) $(LIBS_avcodec)
+libavcodec_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_avcodec)
 libavcodec_plugin_la_DEPENDENCIES =
 
 if MERGE_FFMPEG
diff --git a/modules/common.am b/modules/common.am
index ad64737..d0b2d0e 100644
--- a/modules/common.am
+++ b/modules/common.am
@@ -19,19 +19,17 @@ 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)\"
+	-DMODULE_STRING=\"$(MODULE_NAME)\" \
 	-D__PLUGIN__
-AM_CFLAGS = `$(VLC_CONFIG) --cflags plugin $@`
-AM_CXXFLAGS = `$(VLC_CONFIG) --cxxflags plugin $@`
-AM_OBJCFLAGS = `$(VLC_CONFIG) --objcflags plugin $@`
+AM_CFLAGS =
+AM_CXXFLAGS =
+AM_OBJCFLAGS =
 AM_LDFLAGS = -rpath '$(libvlcdir)' \
 	-avoid-version -module \
 	-export-symbols-regex ^vlc_entry \
 	-shrext $(LIBEXT) \
-	-no-undefined \
-	 `$(VLC_CONFIG) --ldflags plugin $@`
-AM_LIBADD = `$(VLC_CONFIG) -libs plugin $@` \
-	$(LTLIBVLCCORE) $(top_builddir)/compat/libcompat.la
+	-no-undefined
+AM_LIBADD = $(LTLIBVLCCORE) $(top_builddir)/compat/libcompat.la $(LIBS_plugin)
 
 include $(srcdir)/Modules.am
 
diff --git a/modules/genmf b/modules/genmf
index 6bdf882..cb3a033 100755
--- a/modules/genmf
+++ b/modules/genmf
@@ -55,11 +55,12 @@ EOF
 lib${mod}_plugin_la_SOURCES = \$(SOURCES_${mod})
 nodist_lib${mod}_plugin_la_SOURCES = \$(nodist_SOURCES_${mod})
 # Force per-target objects:
-lib${mod}_plugin_la_CFLAGS = \$(AM_CFLAGS)
-lib${mod}_plugin_la_CXXFLAGS = \$(AM_CXXFLAGS)
-lib${mod}_plugin_la_OBJCFLAGS = \$(AM_OBJCFLAGS)
+lib${mod}_plugin_la_CPPFLAGS = \$(AM_CPPFLAGS) \$(CPPFLAGS_${mod})
+lib${mod}_plugin_la_CFLAGS = \$(AM_CFLAGS) \$(CFLAGS_${mod})
+lib${mod}_plugin_la_CXXFLAGS = \$(AM_CXXFLAGS) \$(CXXFLAGS_${mod})
+lib${mod}_plugin_la_OBJCFLAGS = \$(AM_OBJCFLAGS) \$(OBJCFLAGS_${mod})
 # Set LIBADD and DEPENDENCIES manually:
-lib${mod}_plugin_la_LIBADD = \$(AM_LIBADD)
+lib${mod}_plugin_la_LIBADD = \$(AM_LIBADD) \$(LIBS_${mod})
 lib${mod}_plugin_la_DEPENDENCIES =
 
 EOF
diff --git a/modules/gui/qt4/Modules.am b/modules/gui/qt4/Modules.am
index f64eda1..a754412 100644
--- a/modules/gui/qt4/Modules.am
+++ b/modules/gui/qt4/Modules.am
@@ -225,12 +225,12 @@ resources.cpp: vlc.qrc $(DEPS_res)
 
 .hpp.moc.cpp:
 if HAVE_DARWIN
-	$(moc_verbose)$(MOC) -DQ_WS_MAC $(DEFS) -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) `$(VLC_CONFIG) --cppflags plugin qt4` -o $@ $<
+	$(moc_verbose)$(MOC) -DQ_WS_MAC $(DEFS) -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) $(CPPFLAGS_qt4) -o $@ $<
 else
 if HAVE_WIN32
-	$(moc_verbose)$(MOC) -DWIN32 $(DEFS) -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) `$(VLC_CONFIG) --cppflags plugin qt4` -o $@ $<
+	$(moc_verbose)$(MOC) -DWIN32 $(DEFS) -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) $(CPPFLAGS_qt4) -o $@ $<
 else
-	$(moc_verbose)$(MOC) $(DEFS) -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) `$(VLC_CONFIG) --cppflags plugin qt4` -o $@ $<
+	$(moc_verbose)$(MOC) $(DEFS) -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) $(CPPFLAGS_qt4) -o $@ $<
 endif
 endif
 
@@ -243,7 +243,7 @@ endif
 	$(AM_V_at)rm -f $@.tmp
 
 .mm.lo: 
-	$(top_builddir)/libtool --verbose --mode=compile $(CXX) $(objcxxflags) -DQ_WS_MAC -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) `$(VLC_CONFIG) --cxxflags plugin qt4` -c $< -o $@ 
+	$(top_builddir)/libtool --verbose --mode=compile $(CXX) $(objcxxflags) -DQ_WS_MAC -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_builddir) $(CXXFLAGS_qt4) -c $< -o $@ 
 
 SOURCES_qt4 = 	qt4.cpp \
 		menus.cpp \
diff --git a/src/Makefile.am b/src/Makefile.am
index ba23fd5..f57ff47 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -199,17 +199,17 @@ AM_LDFLAGS += -avoid-version
 endif
 
 libvlccore_la_SOURCES = $(SOURCES_libvlc)
-libvlccore_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlccore` \
+libvlccore_la_CFLAGS = $(CFLAGS_libvlccore) \
 	-DMODULE_STRING=\"main\" \
 	-DLOCALEDIR=\"$(localedir)\" \
 	-DSYSCONFDIR=\"$(sysconfdir)\" \
 	-DDATA_PATH=\"$(vlcdatadir)\" \
 	-DPKGLIBDIR=\"$(vlclibdir)\"
-libvlccore_la_LDFLAGS = `$(VLC_CONFIG) --ldflags libvlccore` $(AM_LDFLAGS) \
+libvlccore_la_LDFLAGS = $(LDFLAGS_libvlccore) $(AM_LDFLAGS) \
 	-no-undefined \
 	-export-symbols $(srcdir)/libvlccore.sym \
 	-version-info 5:0:0
-libvlccore_la_LIBADD = `$(VLC_CONFIG) -libs libvlccore` $(AM_LIBADD) \
+libvlccore_la_LIBADD = $(LIBS_libvlccore) $(AM_LIBADD) \
 	$(LTLIBINTL) ../compat/libcompat.la
 libvlccore_la_DEPENDENCIES = libvlccore.sym
 if HAVE_WIN32
@@ -221,11 +221,11 @@ libvlc_win32_rc.$(OBJEXT): libvlc_win32_rc.rc
 	$(WINDRES) --include-dir $(top_srcdir)/share -i $< -o $@
 
 libvlc_la_SOURCES = $(SOURCES_libvlc_control)
-libvlc_la_LIBADD = `$(VLC_CONFIG) -libs libvlc` \
+libvlc_la_LIBADD = $(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` \
+libvlc_la_CFLAGS = $(CFLAGS_libvlc)
+libvlc_la_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_libvlc) \
 	-version-info 6:0:1 \
 	-export-symbols $(srcdir)/libvlc.sym
 libvlc_la_DEPENDENCIES = libvlc.sym libvlccore.la
diff --git a/src/test/Makefile.am b/src/test/Makefile.am
index 72c04e1..215029b 100644
--- a/src/test/Makefile.am
+++ b/src/test/Makefile.am
@@ -12,12 +12,12 @@ check_PROGRAMS = \
 
 TESTS = $(check_PROGRAMS)
 
-AM_CFLAGS = `$(VLC_CONFIG) --cflags libvlccore`
+AM_CFLAGS = $(CFLAGS_libvlccore)
 AM_LDFLAGS = -no-install
 LDADD = ../libvlccore.la
 
 test_block_SOURCES = block_test.c ../misc/block.c
-test_block_LDADD = $(LDADD) `$(VLC_CONFIG) -libs libvlccore`
+test_block_LDADD = $(LDADD) $(LIBS_libvlccore)
 test_block_DEPENDENCIES =
 
 test_dictionary_SOURCES = dictionary.c
diff --git a/test/Makefile.am b/test/Makefile.am
index 17f82b0..9761359 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -51,7 +51,7 @@ samples/meta.sample:
 	mkdir -p `dirname $@`
 	curl $(SAMPLES_SERVER)/metadata/id3tag/Wesh-Bonneville.mp3 > $@
 
-CFLAGS_tests = `$(VLC_CONFIG) --cflags libvlc` -DSRCDIR=\"$(srcdir)\"
+CFLAGS_tests = $(LIBS_libvlc) -DSRCDIR=\"$(srcdir)\"
 LDFLAGS_tests = -no-install -static
 
 test_libvlc_core_SOURCES = libvlc/core.c



More information about the vlc-commits mailing list