Makefile.am 4.81 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
	control/position.h \
23
	support/classinfo.h \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
24
	../common/vlc_player_options.h \
25
	$(SOURCES_support)
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
26

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

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

36 37 38 39
npvlc_la_SOURCES = $(libvlcplugin_la_SOURCES)
npvlc_la_DEPENDENCIES = $(libvlcplugin_la_DEPENDENCIES)
npvlc_la_LIBADD = $(libvlcplugin_la_LIBADD)
npvlc_la_LDFLAGS = $(libvlcplugin_la_LDFLAGS)
40

41 42
if !HAVE_DARWIN
if !HAVE_WIN32
43

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

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

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

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
68
else # Win32
69

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

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

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

90
DATA_npvlc_rc = $(noinst_DATA)
91
noinst_DATA = npvlc_rc.$(OBJEXT)
92

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

96
endif
97
else
98

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

104 105
AM_CPPFLAGS += -I. -I$(top_builddir) -c \
	-F/System/Library/Frameworks/CoreFoundation.framework \
106
	-I/Developer/Headers/FlatCarbon -fno-common -fpascal-strings \
107 108
	-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 114 115 116
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)
117 118 119 120

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

122
npvlc.rsrc: vlc.r
123
	/Developer/Tools/Rez -useDF /Developer/Headers/FlatCarbon/Types.r $< -o $@
124

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

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

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

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