Makefile.am 5.49 KB
Newer Older
1 2 3 4
###############################################################################
# Building the Mozilla plugin
###############################################################################

5
AUTOMAKE_OPTIONS = subdir-objects
6
EXTRA_DIST = package/npvlc_rc.rc.in package/npvlc.dll.manifest
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
7
MOSTLYCLEANFILES =
Rafaël Carré's avatar
Rafaël Carré committed
8 9 10 11 12 13
CLEANFILES = $(BUILT_SOURCES) \
	npapi-sdk/npapi.h \
	npapi-sdk/npfunctions.h \
	npapi-sdk/npruntime.h \
	npapi-sdk/nptypes.h

14 15
npvlcdir = $(libdir)/mozilla/plugins

16
AM_CPPFLAGS = $(LIBVLC_CFLAGS) -Inpapi-sdk $(MOZILLA_CFLAGS) -I$(top_srcdir)/vlcpp
17

18
libvlcplugin_la_SOURCES = \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
19
	common.h \
20
	vlcshell.h \
21
	vlcshell.cpp \
22
	vlcplugin.h \
Cheng Sun's avatar
Cheng Sun committed
23 24
	vlcplugin_base.cpp \
	vlcplugin_base.h \
25 26 27
	npruntime/npolibvlc.cpp \
	npruntime/npolibvlc.h \
	npruntime/nporuntime.cpp \
28
	npruntime/nporuntime.h
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
29

30
libvlcplugin_la_DEPENDENCIES =
31
libvlcplugin_la_LIBADD = ../common/libvlcplugin_common.la $(LIBVLC_LIBS)
32 33 34
libvlcplugin_la_LDFLAGS = \
	-module -avoid-version \
	-no-undefined
35

36 37 38 39
if HAVE_WIN32
libvlcplugin_la_LDFLAGS += -Wc,--static -Wc,-static-libgcc
endif

40 41 42 43
npvlc_la_SOURCES = $(libvlcplugin_la_SOURCES)
npvlc_la_DEPENDENCIES = $(libvlcplugin_la_DEPENDENCIES)
npvlc_la_LIBADD = $(libvlcplugin_la_LIBADD)
npvlc_la_LDFLAGS = $(libvlcplugin_la_LDFLAGS)
44

45
npapi-sdk:
46 47 48
	wget https://storage.googleapis.com/google-code-archive-source/v2/code.google.com/npapi-sdk/source-archive.zip
	unzip -j source-archive.zip "npapi-sdk/trunk/headers/*" -x "npapi-sdk/trunk/headers/.svn/*" -d npapi-sdk
	rm -rf source-archive.zip
49

50
if HAVE_XCB
51

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
52
# Unix (x11) platforms
53 54 55
#
npvlc_LTLIBRARIES = libvlcplugin.la

56
if FETCH_NPAPI
57
$(libvlcplugin_la_OBJECTS): npapi-sdk
58 59
endif

60
AM_CPPFLAGS += -DXP_UNIX -DDATA_PATH=\"$(pkgdatadir)\" $(XCB_CFLAGS)
Cheng Sun's avatar
Cheng Sun committed
61

62 63 64
libvlcplugin_la_SOURCES += \
	vlcwindowless_xcb.cpp vlcwindowless_xcb.h \
	vlcwindowless_base.cpp vlcwindowless_base.h \
65
	npcontrol/npunix.cpp npcontrol/npcommon.cpp
66
libvlcplugin_la_LIBADD += $(MOZILLA_LIBS) $(XCB_LIBS)
Ludovic Fauvet's avatar
Ludovic Fauvet committed
67

68 69
if WITH_GTK
AM_CPPFLAGS += $(GTK_CFLAGS)
70 71 72

libvlcplugin_la_SOURCES += \
	vlcplugin_gtk.cpp vlcplugin_gtk.h
73
libvlcplugin_la_LIBADD += $(GTK_LIBS)
74

75
else # !WITH_GTK
76 77
libvlcplugin_la_SOURCES += \
	vlcplugin_xcb.cpp vlcplugin_xcb.h
Cheng Sun's avatar
Cheng Sun committed
78
endif # !USE_GTK
79

80 81 82
endif

if HAVE_WIN32
83

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
84 85
# Under Win32|Mac, Mozilla plugins need to be named NP******.DLL, but under Unix
# the common naming scheme is lib******plugin.so.
86 87
#
lib_LTLIBRARIES = npvlc.la
88

89
if FETCH_NPAPI
90
$(npvlc_la_OBJECTS): npapi-sdk
91 92
endif

93 94
AM_CPPFLAGS += -DXP_WIN -DXP_WIN32 \
	-DXPCOM_GLUE -DHAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
95 96 97 98 99

libvlcplugin_la_SOURCES += \
	vlcplugin_win.cpp vlcplugin_win.h \
	vlcwindowless_base.cpp vlcwindowless_base.h \
	vlcwindowless_win.cpp vlcwindowless_win.h \
100
	npcontrol/npwin.cpp npcontrol/npcommon.cpp
101

102 103 104
npvlc_la_DEPENDENCIES += $(DATA_npvlc_rc)
npvlc_la_LDFLAGS += -Wl,--kill-at -Wl,$(DATA_npvlc_rc)
npvlc_la_LIBADD += -lgdi32
105

106
DATA_npvlc_rc = $(noinst_DATA)
107
noinst_DATA = npvlc_rc.$(OBJEXT)
108

109
npvlc_rc.$(OBJEXT): package/npvlc_rc.rc
110
	$(WINDRES) --include-dir $(srcdir) -i $< -o $@
111

112
endif
113 114

if HAVE_DARWIN
115

116
if FETCH_NPAPI
117 118
$(npvlc_la_OBJECTS): npapi-sdk libvlcplugin_objc.la
$(libvlcplugin_objc_la_SOURCES): npapi-sdk
119 120
endif

121
# MacOS X
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
122
# Mac OS plugins need .r files that will be processed into rsrc files
123 124
#
lib_LTLIBRARIES = npvlc.la
125

126 127
AM_CPPFLAGS += -I. -I$(top_builddir) -c \
	-DXP_UNIX -DXP_MACOSX=1 \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
128
	-DNO_X11=1 -DUSE_SYSTEM_CONSOLE=1 -pipe -fmessage-length=0
129

130 131 132 133 134
libvlcplugin_objc_la_SOURCES = \
	vlcplugin_mac.mm vlcplugin_mac.h
libvlcplugin_objc_la_LDFLAGS = -static
noinst_LTLIBRARIES = libvlcplugin_objc.la

135 136 137
libvlcplugin_la_SOURCES += \
	vlcwindowless_base.cpp vlcwindowless_base.h \
	vlcwindowless_mac.cpp vlcwindowless_mac.h \
138
	npcontrol/npmac.cpp npcontrol/npcommon.cpp
139
libvlcplugin_la_LIBADD += libvlcplugin_objc.la
140
libvlcplugin_la_LDFLAGS += \
141 142
	-bundle -Wl,-headerpad_max_install_names \
	-Wl,-framework,CoreFoundation -Wl,-framework,ApplicationServices \
143
	-Wl,-framework,QuartzCore, -Wl,-framework,AppKit, -shrext .dylib
144

145 146
noinst_DATA = VLC-Plugin.plugin
CLEANFILES += VLC-Plugin.plugin
147

148
VLC-Plugin.plugin: $(lib_LTLIBRARIES)
149
	rm -Rf "$(top_builddir)/$@"
150 151 152
	$(INSTALL) -d "$(top_builddir)/VLC-Plugin.plugin/Contents/MacOS/lib"
	$(INSTALL) -d "$(top_builddir)/VLC-Plugin.plugin/Contents/Resources"
	$(INSTALL) $(top_srcdir)/share/pixmaps/macosx/*.png "$(top_builddir)/VLC-Plugin.plugin/Contents/Resources"
153
	ACTION="release-makefile" PRODUCT="VLC-Plugin.plugin" libvlc_dir=$(LIBVLC_PREFIX) src_dir=$(srcdir) build_dir=$(top_builddir) sh "$(top_srcdir)/extras/macosx/build-package.sh"
154
	$(INSTALL) "$(top_builddir)/extras/macosx/Info.plist" "$(top_builddir)/VLC-Plugin.plugin/Contents/Info.plist"
155
	xcrun plutil -convert binary1 "$(top_builddir)/VLC-Plugin.plugin/Contents/Info.plist"
156
	$(INSTALL) "$(top_builddir)/npapi/.libs/npvlc.dylib" "$(top_builddir)/VLC-Plugin.plugin/Contents/MacOS/"
157 158
	mv $(top_builddir)/VLC-Plugin.plugin/Contents/MacOS/npvlc.dylib "$(top_builddir)/VLC-Plugin.plugin/Contents/MacOS/VLC-Plugin"
	chmod +x "$(top_builddir)/VLC-Plugin.plugin/Contents/MacOS/VLC-Plugin"
159
	install_name_tool -change $(LIBVLC_PREFIX)/lib/libvlc.5.dylib @loader_path/lib/libvlc.5.dylib $(top_builddir)/VLC-Plugin.plugin/Contents/MacOS/VLC-Plugin
160
	install_name_tool -change $(LIBVLC_PREFIX)/lib/libvlccore.8.dylib @loader_path/lib/libvlccore.8.dylib $(top_builddir)/VLC-Plugin.plugin/Contents/MacOS/VLC-Plugin
161 162
	find "$(top_builddir)/VLC-Plugin.plugin" -type d -exec chmod ugo+rx '{}' \;
	find "$(top_builddir)/VLC-Plugin.plugin" -type f -exec chmod ugo+r '{}' \;
163

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
164
endif # Mac
165 166

package/vlc.r.in: vlcshell.cpp
167 168 169
	./gen-vlc-r-in macosx > package/vlc.r.in
package/npvlc_rc.rc.in: vlcshell.cpp
	./gen-vlc-r-in win > package/npvlc_rc.rc.in