1 ###############################################################################
2 # Building the Mozilla plugin
3 ###############################################################################
6 CLEANFILES = $(BUILT_SOURCES)
7 EXTRA_DIST = $(DIST_sources) install.js npvlc_rc.rc.in vlc.r
9 SOURCES_mozilla_common = \
13 control/npolibvlc.cpp \
15 control/nporuntime.cpp \
16 control/nporuntime.h \
19 DIST_sources = $(SOURCES_mozilla_common) \
20 support/npwin.cpp support/npmac.cpp support/npunix.c
24 LIBRARIES_libvlc = $(top_builddir)/src/libvlc.la \
25 $(top_builddir)/src/libvlccore.la
29 # Under Win32, Mozilla plugins need to be named NP******.DLL, but under Unix
30 # the common naming scheme is lib******plugin.so. Also, we need npwin.cpp
31 # under Win32 and npunix.c under Unix.
33 lib_LTLIBRARIES = npvlc.la
35 SOURCES_support = support/npwin.cpp
36 CPPFLAGS_mozilla_EXTRA = -DXP_WIN -DXP_WIN32
37 LDFLAGS_mozilla_EXTRA = -no-undefined -Wl,--kill-at -Wl,$(DATA_npvlc_rc)
39 npvlc_la_SOURCES = $(SOURCES_mozilla_common) $(SOURCES_support)
40 npvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags mozilla` $(CPPFLAGS_mozilla_extra)
41 npvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags mozilla` $(CPPFLAGS_mozilla_extra)
42 npvlc_la_DEPENDENCIES = $(DATA_npvlc_rc) $(LIBRARIES_libvlc)
43 npvlc_la_LDFLAGS = `$(VLC_CONFIG) --ldflags mozilla` -module -avoid-version \
44 $(LDFLAGS_mozilla_EXTRA)
45 npvlc_la_LIBADD = `$(VLC_CONFIG) -libs mozilla` $(LIBRARIES_libvlc)
47 DATA_npvlc_rc = $(noinst_npvlc_rc_DATA)
48 noinst_npvlc_rc_DATA = npvlc_rc.$(OBJEXT)
51 npvlc_rc.$(OBJEXT): npvlc_rc.rc
52 $(WINDRES) --include-dir $(srcdir) -i $< -o $@
61 lib_LTLIBRARIES = npvlc.la
63 SOURCES_support = support/npmac.cpp
64 CPPFLAGS_mozilla_EXTRA = -I. -I$(top_builddir) -I$(srcdir)/../include -c \
65 -F/System/Library/Frameworks/CoreFoundation.framework $(moz_CFLAGS) \
66 -I/Developer/Headers/FlatCarbon -fno-common -fpascal-strings \
67 -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -DXP_MACOSX=1 \
68 -DNO_X11=1 -DUSE_SYSTEM_CONSOLE=1 -pipe -fmessage-length=0 \
69 -include mozilla-config.h
70 LDFLAGS_mozilla_EXTRA = -no-undefined -bundle -Wl,-read_only_relocs -Wl,suppress \
71 -Wl,-headerpad_max_install_names -shrext $(LIBEXT) -Wl,-framework,Carbon -Wl,-framework,System
73 npvlc_la_SOURCES = $(SOURCES_mozilla_common) $(SOURCES_support)
74 npvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags mozilla` $(CPPFLAGS_mozilla_EXTRA)
75 npvlc_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags mozilla` $(CPPFLAGS_mozilla_EXTRA)
76 npvlc_la_DEPENDENCIES = $(LIBRARIES_libvlc)
77 npvlc_la_LDFLAGS = `$(VLC_CONFIG) --ldflags mozilla` -module -avoid-version \
78 $(LDFLAGS_mozilla_EXTRA)
79 npvlc_la_LIBADD = `$(VLC_CONFIG) -libs mozilla` $(LIBRARIES_libvlc)
82 noinst_DATA = npvlc.rsrc VLC\ Plugin.plugin
83 MOSTLYCLEANFILES += npvlc.rsrc
84 CLEANFILES += VLC\ Plugin.plugin
87 /Developer/Tools/Rez -useDF /Developer/Headers/FlatCarbon/Types.r $< -o $@
90 # Plugin uses shared libraries that are located relatively through @executable_path,
91 # which unfortunately references the path of the App using the Plugin, rather than the
92 # Plugin itself. Since this Plugin should always be installed in '/Library/Internet Plug-Ins',
93 # it is safer to force dylibs to locate dependents through a fixed path
96 otool -L "$$dylib" | \
97 awk -v libdylib="$$dylib" ' \
98 /@executable_path/ { \
100 sub("@executable_path","/Library/Internet Plug-Ins/VLC Plugin.plugin/Contents/MacOS",newpath) ; \
101 print "install_name_tool -change \""$$1"\" \""newpath"\" \""libdylib"\"" ; \
105 VLC\ Plugin.plugin: npvlc.rsrc $(lib_LTLIBRARIES)
107 $(INSTALL) -d "VLC-Plugin.plugin/Contents/MacOS/lib"
108 $(INSTALL) -d "VLC-Plugin.plugin/Contents/Resources"
109 ACTION="release-makefile" PRODUCT="VLC-Plugin.plugin" src_dir=$(srcdir) build_dir=$(top_builddir) sh "$(top_srcdir)/projects/macosx/framework/Pre-Compile.sh"
110 $(INSTALL) npvlc.rsrc "VLC-Plugin.plugin/Contents/Resources/VLC Plugin.rsrc"
111 $(INSTALL) "$(top_builddir)/extras/package/macosx/plugin/Info.plist" "VLC-Plugin.plugin/Contents/Info.plist"
112 mv "VLC-Plugin.plugin" "VLC Plugin.plugin"
113 find "VLC Plugin.plugin" -type d -exec chmod ugo+rx '{}' \;
114 find "VLC Plugin.plugin" -type f -exec chmod ugo+r '{}' \;
116 # uncomment if dependencies on XPCOM libs is sought
117 # if test -d "$(MOZILLA_SDK_PATH)/lib"; then \
118 # for i in "$(MOZILLA_SDK_PATH)"/lib/*.dylib ; do \
119 # dylib="$(srcdir)/$@/Contents/MacOS/`basename $${i}`" ; \
120 # $(INSTALL) -m 644 "$${i}" "$$dylib" ; \
128 # UNIX/Others platforms
131 CPPFLAGS_mozilla_EXTRA = -DDATA_PATH=\"$(pkgdatadir)\"
133 npvlc_LTLIBRARIES = libvlcplugin.la
135 npvlc = libvlcplugin$(LIBEXT)
136 npvlcdir = $(libdir)/mozilla/plugins
137 SOURCES_support = support/npunix.c
139 libvlcplugin_la_SOURCES = $(SOURCES_mozilla_common) $(SOURCES_support)
140 libvlcplugin_la_CFLAGS = `$(VLC_CONFIG) --cflags mozilla` $(CPPFLAGS_mozilla_EXTRA)
141 libvlcplugin_la_CXXFLAGS = `$(VLC_CONFIG) --cxxflags mozilla` $(CPPFLAGS_mozilla_EXTRA)
142 libvlcplugin_la_LDFLAGS = `$(VLC_CONFIG) --ldflags mozilla` -module -avoid-version -shrext $(LIBEXT)
143 libvlcplugin_la_LIBADD = $(LIBRARIES_libvlc) `$(VLC_CONFIG) -libs mozilla`
144 # automake gets confused by the ../..
145 libvlcplugin_la_DEPENDENCIES = $(AM_LIBADD)