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

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
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)
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
8 9 10
npvlcdir = $(libdir)/mozilla/plugins

AM_CPPFLAGS = $(LIBVLC_CFLAGS)
11

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
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
	control/position.h \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
23 24
	support/classinfo.h \
	$(SOURCES_support)
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
25

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
26
EXTRA_libvlcplugin_la_SOURCES = \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
27
	support/npwin.cpp support/npmac.cpp support/npunix.cpp
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
28

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
29 30 31 32 33
libvlcplugin_la_DEPENDENCIES =
libvlcplugin_la_LIBADD = $(LIBVLC_LIBS)
libvlcplugin_la_LDFLAGS = \
	-module -avoid-version \
	-no-undefined
Gildas Bazin's avatar
 
Gildas Bazin committed
34

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
35 36 37 38
npvlc_la_SOURCES = $(libvlcplugin_la_SOURCES)
npvlc_la_DEPENDENCIES = $(libvlcplugin_la_DEPENDENCIES)
npvlc_la_LIBADD = $(libvlcplugin_la_LIBADD)
npvlc_la_LDFLAGS = $(libvlcplugin_la_LDFLAGS)
39

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
40 41
if !HAVE_DARWIN
if !HAVE_WIN32
42

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
43
# Unix (x11) platforms
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
44 45 46
#
npvlc_LTLIBRARIES = libvlcplugin.la

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

if USE_GTK
AM_CPPFLAGS += $(GTK_CFLAGS) -DUSE_GTK
Cheng Sun's avatar
Cheng Sun committed
52
libvlcplugin_la_LIBADD += $(GTK_LIBS) $(X_LIBS) $(X_PRE_LIBS) -lX11
Cheng Sun's avatar
Cheng Sun committed
53 54 55 56 57
SOURCES_support = \
	support/npunix.cpp \
	vlcplugin_gtk.cpp \
	vlcplugin_gtk.h
else # !USE_GTK
58 59
AM_CPPFLAGS += $(XCB_CFLAGS)
libvlcplugin_la_LIBADD += $(XCB_LIBS)
Cheng Sun's avatar
Cheng Sun committed
60 61
SOURCES_support = \
	support/npunix.cpp \
62 63
	vlcplugin_xcb.cpp \
	vlcplugin_xcb.h
Cheng Sun's avatar
Cheng Sun committed
64
endif # !USE_GTK
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
65

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
66
else # Win32
67

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

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
73 74
AM_CPPFLAGS += -DXP_WIN -DXP_WIN32 \
	-DXPCOM_GLUE -DHAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
Cheng Sun's avatar
Cheng Sun committed
75 76 77 78
SOURCES_support = \
	support/npwin.cpp \
	vlcplugin_win.cpp \
	vlcplugin_win.h \
79 80
	../common/win32_fullscreen.cpp \
	../common/win32_fullscreen.h
81

82 83 84
npvlc_la_DEPENDENCIES += $(DATA_npvlc_rc)
npvlc_la_LDFLAGS += -Wl,--kill-at -Wl,$(DATA_npvlc_rc)
npvlc_la_LIBADD += -lgdi32
85

86
DATA_npvlc_rc = $(noinst_DATA)
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
87
noinst_DATA = npvlc_rc.$(OBJEXT)
88

89
npvlc_rc.$(OBJEXT): npvlc_rc.rc
90
	$(WINDRES) --include-dir $(srcdir) -i $< -o $@
91

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
92
endif
93
else
94

95
# MacOS X
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
96
# Mac OS plugins need .r files that will be processed into rsrc files
97 98
#
lib_LTLIBRARIES = npvlc.la
99

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
100 101
AM_CPPFLAGS += -I. -I$(top_builddir) -c \
	-F/System/Library/Frameworks/CoreFoundation.framework \
102
	-I/Developer/Headers/FlatCarbon -fno-common -fpascal-strings \
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
103 104
	-Wmost -Wno-four-char-constants -Wno-unknown-pragmas \
	-DXP_UNIX -DXP_MACOSX=1 \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
105
	-DNO_X11=1 -DUSE_SYSTEM_CONSOLE=1 -pipe -fmessage-length=0
106

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
107 108 109 110 111 112
SOURCES_support = support/npmac.cpp
libvlcplugin_la_LDFLAGS += \
	-bundle -Wl,-read_only_relocs -Wl,suppress \
	-Wl,-headerpad_max_install_names \
	-Wl,-framework,Carbon -Wl,-framework,System \
	-shrext $(LIBEXT)
113 114 115 116

noinst_DATA = npvlc.rsrc VLC\ Plugin.plugin
MOSTLYCLEANFILES += npvlc.rsrc
CLEANFILES += VLC\ Plugin.plugin
117

118
npvlc.rsrc: vlc.r
119
	/Developer/Tools/Rez -useDF /Developer/Headers/FlatCarbon/Types.r $< -o $@
120

121 122 123 124
#
# 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
125
# it is safer to force dylibs to locate dependents through a fixed path
126 127 128 129 130 131 132 133 134 135 136
#
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

137
VLC\ Plugin.plugin: npvlc.rsrc $(lib_LTLIBRARIES)
138
	rm -Rf "$@"
139 140
	$(INSTALL) -d "VLC-Plugin.plugin/Contents/MacOS/lib"
	$(INSTALL) -d "VLC-Plugin.plugin/Contents/Resources"
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
141
	ACTION="release-makefile" PRODUCT="VLC-Plugin.plugin" src_dir=$(srcdir) build_dir=$(top_builddir) sh "$(top_srcdir)/project/macosx/framework/Pre-Compile.sh"
142
	$(INSTALL) npvlc.rsrc "VLC-Plugin.plugin/Contents/Resources/VLC Plugin.rsrc"
143
	$(INSTALL) "$(top_builddir)/extras/package/macosx/plugin/Info.plist" "VLC-Plugin.plugin/Contents/Info.plist"
144
	mv "VLC-Plugin.plugin" "VLC Plugin.plugin"
145 146
	find "VLC Plugin.plugin" -type d -exec chmod ugo+rx '{}' \;
	find "VLC Plugin.plugin" -type f -exec chmod ugo+r '{}' \;
147

148 149 150
# 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 \
151
#	    dylib="$(srcdir)/$@/Contents/MacOS/`basename $${i}`" ; \
152 153 154 155
#	    $(INSTALL) -m 644 "$${i}" "$$dylib" ; \
#	    $(FIXEXECPATH); \
#	  done ; \
#	fi
156

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