[vlc-commits] Build common sources only once

Rémi Denis-Courmont git at videolan.org
Wed Apr 9 18:51:02 CEST 2014


npapi-vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Apr  9 19:47:54 2014 +0300| [0f12f88d401208ea8046afed307369e3227265de] | committer: Rémi Denis-Courmont

Build common sources only once

(This is for automake subdir-objects)

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

 Makefile.am         |    4 ++--
 activex/Makefile.am |   14 +++---------
 common/Makefile.am  |   14 ++++++++++++
 configure.ac        |    1 +
 npapi/Makefile.am   |   63 ++++++++++++++++++++-------------------------------
 5 files changed, 44 insertions(+), 52 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9087e10..49ddd4e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,8 +6,8 @@ AUTOMAKE_OPTIONS = \
 	dist-xz \
 	no-dist-gzip
 
-DIST_SUBDIRS= share npapi activex
-SUBDIRS =
+DIST_SUBDIRS= share common npapi activex
+SUBDIRS = common
 if BUILD_NPAPI
 SUBDIRS += npapi
 endif
diff --git a/activex/Makefile.am b/activex/Makefile.am
index cf26645..c48ebd9 100644
--- a/activex/Makefile.am
+++ b/activex/Makefile.am
@@ -45,7 +45,6 @@ axvlc_la_SOURCES = \
     persiststorage.h \
     persiststreaminit.cpp \
     persiststreaminit.h \
-    ../common/position.h \
     provideclassinfo.cpp \
     provideclassinfo.h \
     connectioncontainer.cpp \
@@ -65,20 +64,13 @@ axvlc_la_SOURCES = \
     plugin.cpp \
     plugin.h \
     axvlc_idl.c \
-    axvlc_idl.h \
-    ../common/vlc_player_options.h \
-    ../common/win32_fullscreen.cpp \
-    ../common/win32_fullscreen.h \
-    ../common/win32_vlcwnd.cpp \
-    ../common/win32_vlcwnd.h \
-    ../common/vlc_player.cpp \
-    ../common/vlc_player.h
-    $(NULL)
+    axvlc_idl.h
 
 axvlc_la_DEPENDENCIES = $(srcdir)/axvlc.def $(DATA_axvlc_rc)
 axvlc_la_LDFLAGS = -Wl,$(srcdir)/axvlc.def -Wl,$(DATA_axvlc_rc) \
     -no-undefined -avoid-version -module
-axvlc_la_LIBADD = $(LIBVLC_LIBS) $(ACTIVEX_LIBS)
+axvlc_la_LIBADD = ../common/libvlcplugin_common.la \
+	$(LIBVLC_LIBS) $(ACTIVEX_LIBS)
 
 
 DATA_axvlc_rc = $(noinst_axvlc_rc_DATA)
diff --git a/common/Makefile.am b/common/Makefile.am
new file mode 100644
index 0000000..2e26f66
--- /dev/null
+++ b/common/Makefile.am
@@ -0,0 +1,14 @@
+AM_CPPFLAGS = $(LIBVLC_CFLAGS)
+
+libvlcplugin_common_la_SOURCES = \
+	position.h \
+	vlc_player_options.h \
+	vlc_player.cpp vlc_player.h
+if HAVE_WIN32
+libvlcplugin_common_la_SOURCES += \
+	win32_fullscreen.cpp win32_fullscreen.h \
+	win32_vlcwnd.cpp win32_vlcwnd.h
+endif
+libvlcplugin_common_la_LDFLAGS = -static
+
+noinst_LTLIBRARIES = libvlcplugin_common.la
diff --git a/configure.ac b/configure.ac
index b54d640..c119620 100644
--- a/configure.ac
+++ b/configure.ac
@@ -276,6 +276,7 @@ AM_COND_IF([HAVE_WIN32], [
 AC_CONFIG_FILES([
   Makefile
   share/Makefile
+  common/Makefile
   npapi/Makefile
   activex/Makefile
   npapi/package/install.js
diff --git a/npapi/Makefile.am b/npapi/Makefile.am
index caa5a21..23ff8a9 100644
--- a/npapi/Makefile.am
+++ b/npapi/Makefile.am
@@ -27,15 +27,10 @@ libvlcplugin_la_SOURCES = \
 	control/npolibvlc.h \
 	control/nporuntime.cpp \
 	control/nporuntime.h \
-	../common/position.h \
-	support/classinfo.h \
-	../common/vlc_player_options.h \
-	../common/vlc_player.cpp \
-	../common/vlc_player.h \
-	$(SOURCES_support)
+	support/classinfo.h
 
 libvlcplugin_la_DEPENDENCIES =
-libvlcplugin_la_LIBADD = $(LIBVLC_LIBS)
+libvlcplugin_la_LIBADD = ../common/libvlcplugin_common.la $(LIBVLC_LIBS)
 libvlcplugin_la_LDFLAGS = \
 	-module -avoid-version \
 	-no-undefined
@@ -60,25 +55,23 @@ $(libvlcplugin_la_OBJECTS): npapi-sdk
 endif
 
 AM_CPPFLAGS += -DXP_UNIX -DDATA_PATH=\"$(pkgdatadir)\" $(XCB_CFLAGS)
-libvlcplugin_la_LIBADD += $(MOZILLA_LIBS) $(XCB_LIBS)
 
-SOURCES_support = \
-	support/npunix.cpp \
-	vlcwindowless_xcb.cpp \
-	vlcwindowless_xcb.h \
-	vlcwindowless_base.cpp \
-	vlcwindowless_base.h
+libvlcplugin_la_SOURCES += \
+	vlcwindowless_xcb.cpp vlcwindowless_xcb.h \
+	vlcwindowless_base.cpp vlcwindowless_base.h \
+	support/npunix.cpp
+libvlcplugin_la_LIBADD += $(MOZILLA_LIBS) $(XCB_LIBS)
 
 if WITH_GTK
 AM_CPPFLAGS += $(GTK_CFLAGS)
+
+libvlcplugin_la_SOURCES += \
+	vlcplugin_gtk.cpp vlcplugin_gtk.h
 libvlcplugin_la_LIBADD += $(GTK_LIBS)
-SOURCES_support += \
-	vlcplugin_gtk.cpp \
-	vlcplugin_gtk.h
+
 else # !WITH_GTK
-SOURCES_support += \
-	vlcplugin_xcb.cpp \
-	vlcplugin_xcb.h
+libvlcplugin_la_SOURCES += \
+	vlcplugin_xcb.cpp vlcplugin_xcb.h
 endif # !USE_GTK
 
 endif
@@ -96,18 +89,12 @@ endif
 
 AM_CPPFLAGS += -DXP_WIN -DXP_WIN32 \
 	-DXPCOM_GLUE -DHAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
-SOURCES_support = \
-	support/npwin.cpp \
-	vlcplugin_win.cpp \
-	vlcplugin_win.h \
-	vlcwindowless_base.cpp \
-	vlcwindowless_base.h \
-	vlcwindowless_win.cpp \
-	vlcwindowless_win.h \
-	../common/win32_fullscreen.cpp \
-	../common/win32_fullscreen.h \
-	../common/win32_vlcwnd.cpp \
-	../common/win32_vlcwnd.h
+
+libvlcplugin_la_SOURCES += \
+	vlcplugin_win.cpp vlcplugin_win.h \
+	vlcwindowless_base.cpp vlcwindowless_base.h \
+	vlcwindowless_win.cpp vlcwindowless_win.h \
+	support/npwin.cpp
 
 npvlc_la_DEPENDENCIES += $(DATA_npvlc_rc)
 npvlc_la_LDFLAGS += -Wl,--kill-at -Wl,$(DATA_npvlc_rc)
@@ -136,13 +123,11 @@ AM_CPPFLAGS += -I. -I$(top_builddir) -c \
 	-DXP_UNIX -DXP_MACOSX=1 \
 	-DNO_X11=1 -DUSE_SYSTEM_CONSOLE=1 -pipe -fmessage-length=0
 
-SOURCES_support = support/npmac.cpp \
-                  vlcplugin_mac.mm \
-                  vlcplugin_mac.h \
-                  vlcwindowless_base.cpp \
-                  vlcwindowless_base.h \
-                  vlcwindowless_mac.cpp \
-                  vlcwindowless_mac.h
+libvlcplugin_la_SOURCES += \
+	vlcplugin_mac.mm vlcplugin_mac.h \
+	vlcwindowless_base.cpp vlcwindowless_base.h \
+	vlcwindowless_mac.cpp vlcwindowless_mac.h \
+	support/npmac.cpp
 libvlcplugin_la_LDFLAGS += \
 	-bundle -Wl,-headerpad_max_install_names \
 	-Wl,-framework,CoreFoundation -Wl,-framework,ApplicationServices \



More information about the vlc-commits mailing list