Makefile.am 4.8 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 24
	support/classinfo.h \
	$(SOURCES_support)
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
25

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

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

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

40 41
if !HAVE_DARWIN
if !HAVE_WIN32
42

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
43
# Unix (x11) platforms
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
52
libvlcplugin_la_LIBADD += $(GTK_LIBS) $(X_LIBS) $(X_PRE_LIBS) -lX11
Cheng Sun's avatar
Cheng Sun committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66
SOURCES_support = \
	support/npunix.cpp \
	vlcplugin_gtk.cpp \
	vlcplugin_gtk.h
else # !USE_GTK
AM_CPPFLAGS += $(X_CFLAGS) $(XPM_CFLAGS)
libvlcplugin_la_LIBADD += $(X_LIBS) $(X_PRE_LIBS) \
	$(XT_LIBS) -lX11 -lSM -lICE -lXpm \
	$(XPM_LIBS)
SOURCES_support = \
	support/npunix.cpp \
	vlcplugin_xlib.cpp \
	vlcplugin_xlib.h
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 82
	../common/win32_fullscreen.cpp \
	../common/win32_fullscreen.h
83

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

88
DATA_npvlc_rc = $(noinst_DATA)
89
noinst_DATA = npvlc_rc.$(OBJEXT)
90

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

94
endif
95
else
96

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

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

109 110 111 112 113 114
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)
115 116 117 118

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

120
npvlc.rsrc: vlc.r
121
	/Developer/Tools/Rez -useDF /Developer/Headers/FlatCarbon/Types.r $< -o $@
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: npvlc.rsrc $(lib_LTLIBRARIES)
140
	rm -Rf "$@"
141 142
	$(INSTALL) -d "VLC-Plugin.plugin/Contents/MacOS/lib"
	$(INSTALL) -d "VLC-Plugin.plugin/Contents/Resources"
143
	ACTION="release-makefile" PRODUCT="VLC-Plugin.plugin" src_dir=$(srcdir) build_dir=$(top_builddir) sh "$(top_srcdir)/project/macosx/framework/Pre-Compile.sh"
144
	$(INSTALL) npvlc.rsrc "VLC-Plugin.plugin/Contents/Resources/VLC Plugin.rsrc"
145
	$(INSTALL) "$(top_builddir)/extras/package/macosx/plugin/Info.plist" "VLC-Plugin.plugin/Contents/Info.plist"
146
	mv "VLC-Plugin.plugin" "VLC Plugin.plugin"
147 148
	find "VLC Plugin.plugin" -type d -exec chmod ugo+rx '{}' \;
	find "VLC Plugin.plugin" -type f -exec chmod ugo+r '{}' \;
149

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

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