Makefile.am 5.21 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
Gildas Bazin's avatar
Gildas Bazin committed
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 46 47
npapi-sdk:
	svn export http://npapi-sdk.googlecode.com/svn/trunk/headers npapi-sdk-svn -r HEAD
	mv npapi-sdk-svn npapi-sdk
48

49
if HAVE_XCB
50

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

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

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

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

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

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

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

79 80 81
endif

if HAVE_WIN32
82

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

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

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

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

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

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

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

111
endif
112 113

if HAVE_DARWIN
114

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

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

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

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

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

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

147
VLC-Plugin.plugin: $(lib_LTLIBRARIES)
148
	rm -Rf "$(top_builddir)/$@"
149 150 151
	$(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"
152
	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"
153
	$(INSTALL) "$(top_builddir)/extras/macosx/Info.plist" "$(top_builddir)/VLC-Plugin.plugin/Contents/Info.plist"
154
	xcrun plutil -convert binary1 "$(top_builddir)/VLC-Plugin.plugin/Contents/Info.plist"
155
	$(INSTALL) "$(top_builddir)/npapi/.libs/npvlc.dylib" "$(top_builddir)/VLC-Plugin.plugin/Contents/MacOS/"
156 157
	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"
158
	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
159
	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
160 161
	find "$(top_builddir)/VLC-Plugin.plugin" -type d -exec chmod ugo+rx '{}' \;
	find "$(top_builddir)/VLC-Plugin.plugin" -type f -exec chmod ugo+r '{}' \;
162

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
163
endif # Mac