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

5
EXTRA_DIST = npvlc_rc.rc.in npvlc.dll.manifest
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
6
MOSTLYCLEANFILES =
7
CLEANFILES = $(BUILT_SOURCES)
8 9 10
npvlcdir = $(libdir)/mozilla/plugins

AM_CPPFLAGS = $(LIBVLC_CFLAGS)
11

12
libvlcplugin_la_SOURCES = \
13
	vlcshell.cpp \
14
	vlcshell.h \
15
	vlcplugin.h \
Cheng Sun's avatar
Cheng Sun committed
16 17
	vlcplugin_base.cpp \
	vlcplugin_base.h \
18 19 20 21
	control/npolibvlc.cpp \
	control/npolibvlc.h \
	control/nporuntime.cpp \
	control/nporuntime.h \
22
	../common/position.h \
23
	support/classinfo.h \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
24
	../common/vlc_player_options.h \
25 26
	../common/vlc_player.cpp \
	../common/vlc_player.h \
27
	$(SOURCES_support)
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
28

29
EXTRA_libvlcplugin_la_SOURCES = \
30
	support/npwin.cpp support/npmac.cpp support/npunix.cpp
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
31

32 33 34 35 36
libvlcplugin_la_DEPENDENCIES =
libvlcplugin_la_LIBADD = $(LIBVLC_LIBS)
libvlcplugin_la_LDFLAGS = \
	-module -avoid-version \
	-no-undefined
Gildas Bazin's avatar
Gildas Bazin committed
37

38 39 40 41
npvlc_la_SOURCES = $(libvlcplugin_la_SOURCES)
npvlc_la_DEPENDENCIES = $(libvlcplugin_la_DEPENDENCIES)
npvlc_la_LIBADD = $(libvlcplugin_la_LIBADD)
npvlc_la_LDFLAGS = $(libvlcplugin_la_LDFLAGS)
42

43 44
if !HAVE_DARWIN
if !HAVE_WIN32
45

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
46
# Unix (x11) platforms
47 48 49
#
npvlc_LTLIBRARIES = libvlcplugin.la

Cheng Sun's avatar
Cheng Sun committed
50 51 52
AM_CPPFLAGS += -DXP_UNIX -DDATA_PATH=\"$(pkgdatadir)\"
libvlcplugin_la_LIBADD += $(MOZILLA_LIBS)

53 54
if WITH_GTK
AM_CPPFLAGS += $(GTK_CFLAGS)
55
libvlcplugin_la_LIBADD += $(GTK_LIBS) $(X_LIBS) $(X_PRE_LIBS) -lX11
Cheng Sun's avatar
Cheng Sun committed
56 57 58 59
SOURCES_support = \
	support/npunix.cpp \
	vlcplugin_gtk.cpp \
	vlcplugin_gtk.h
60
else # !WITH_GTK
61 62
AM_CPPFLAGS += $(XCB_CFLAGS)
libvlcplugin_la_LIBADD += $(XCB_LIBS)
Cheng Sun's avatar
Cheng Sun committed
63 64
SOURCES_support = \
	support/npunix.cpp \
65
	xembed.h \
66 67
	vlcplugin_xcb.cpp \
	vlcplugin_xcb.h
Cheng Sun's avatar
Cheng Sun committed
68
endif # !USE_GTK
69

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
70
else # Win32
71

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
72 73
# Under Win32|Mac, Mozilla plugins need to be named NP******.DLL, but under Unix
# the common naming scheme is lib******plugin.so.
74 75
#
lib_LTLIBRARIES = npvlc.la
76

77 78
AM_CPPFLAGS += -DXP_WIN -DXP_WIN32 \
	-DXPCOM_GLUE -DHAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
Cheng Sun's avatar
Cheng Sun committed
79 80 81 82
SOURCES_support = \
	support/npwin.cpp \
	vlcplugin_win.cpp \
	vlcplugin_win.h \
83
	../common/win32_fullscreen.cpp \
84 85
	../common/win32_fullscreen.h \
	../common/win32_vlcwnd.cpp \
86
	../common/win32_vlcwnd.h
87

88 89 90
npvlc_la_DEPENDENCIES += $(DATA_npvlc_rc)
npvlc_la_LDFLAGS += -Wl,--kill-at -Wl,$(DATA_npvlc_rc)
npvlc_la_LIBADD += -lgdi32
91

92
DATA_npvlc_rc = $(noinst_DATA)
93
noinst_DATA = npvlc_rc.$(OBJEXT)
94

95
npvlc_rc.$(OBJEXT): npvlc_rc.rc
96
	$(WINDRES) --include-dir $(srcdir) -i $< -o $@
97

98
endif
99
else
100

101
# MacOS X
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
102
# Mac OS plugins need .r files that will be processed into rsrc files
103 104
#
lib_LTLIBRARIES = npvlc.la
105

106 107 108
AM_CPPFLAGS += -I. -I$(top_builddir) -c \
	-Wmost -Wno-four-char-constants -Wno-unknown-pragmas \
	-DXP_UNIX -DXP_MACOSX=1 \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
109
	-DNO_X11=1 -DUSE_SYSTEM_CONSOLE=1 -pipe -fmessage-length=0
110

111 112 113
SOURCES_support = support/npmac.cpp \
                  vlcplugin_mac.cpp \
                  vlcplugin_mac.h
114 115 116 117
libvlcplugin_la_LDFLAGS += \
	-bundle -Wl,-read_only_relocs -Wl,suppress \
	-Wl,-headerpad_max_install_names \
	-Wl,-framework,Carbon -Wl,-framework,System \
118
	-shrext .dylib
119

120
noinst_DATA = VLC\ Plugin.plugin
121
CLEANFILES += VLC\ Plugin.plugin
122

123 124 125 126
#
# Plugin uses shared libraries that are located relatively through @executable_path,
# which unfortunately references the path of the App using the Plugin, rather than the
# Plugin itself. Since this Plugin should always be installed in '/Library/Internet Plug-Ins',
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
127
# it is safer to force dylibs to locate dependents through a fixed path
128 129 130 131 132 133 134 135 136 137 138
#
define FIXEXECPATH
	otool -L "$$dylib" | \
	awk -v libdylib="$$dylib" ' \
	/@executable_path/ { \
	    newpath=$$1 ; \
	    sub("@executable_path","/Library/Internet Plug-Ins/VLC Plugin.plugin/Contents/MacOS",newpath) ; \
	    print "install_name_tool -change \""$$1"\" \""newpath"\" \""libdylib"\"" ; \
	}' | sh -x
endef

139
VLC\ Plugin.plugin: $(lib_LTLIBRARIES)
140
	rm -Rf "$@"
141 142
	$(INSTALL) -d "VLC-Plugin.plugin/Contents/MacOS/lib"
	$(INSTALL) -d "VLC-Plugin.plugin/Contents/Resources"
143 144
	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"
	$(INSTALL) "$(top_builddir)/extras/macosx/Info.plist" "VLC-Plugin.plugin/Contents/Info.plist"
145
	mv "VLC-Plugin.plugin" "VLC Plugin.plugin"
146 147
	find "VLC Plugin.plugin" -type d -exec chmod ugo+rx '{}' \;
	find "VLC Plugin.plugin" -type f -exec chmod ugo+r '{}' \;
148

149 150 151
# uncomment if dependencies on XPCOM libs is sought
#	if test -d "$(MOZILLA_SDK_PATH)/lib"; then \
#	  for i in "$(MOZILLA_SDK_PATH)"/lib/*.dylib ; do \
152
#	    dylib="$(srcdir)/$@/Contents/MacOS/`basename $${i}`" ; \
153 154 155 156
#	    $(INSTALL) -m 644 "$${i}" "$$dylib" ; \
#	    $(FIXEXECPATH); \
#	  done ; \
#	fi
157

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