[GTK] Add support for loading web process extensions
[WebKit-https.git] / Source / WebKit2 / GNUmakefile.am
1 include $(srcdir)/Source/WebKit2/GNUmakefile.list.am
2
3 if ENABLE_WEBKIT2
4 # Shared libraries
5 lib_LTLIBRARIES += \
6         libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
7
8 # We need to make sure plugin process is always built with gtk2, because plugins like flash
9 # still use gtk2. Since webcore was built with gtk3, we need to build webcoregtk sources again with gtk2
10 noinst_LTLIBRARIES += \
11         libWebCoreGtk2.la
12
13 libexec_PROGRAMS += \
14         Programs/WebKitPluginProcess
15 endif
16
17 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_HEADERS = \
18         $(webkit2_h_api)
19
20 libwebkit2gtkincludedir = $(libwebkitgtkincludedir)/webkit2
21 nodist_libwebkit2gtkinclude_HEADERS = \
22         DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitEnumTypes.h \
23         DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitVersion.h
24
25 libwebkit2gtkinclude_HEADERS = \
26         $(webkit2gtk_h_api) \
27         $(webkit2_web_extension_h_api)
28
29 nodist_libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
30         $(webkit2_built_sources) \
31         $(webkit2gtk_built_sources)
32
33 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
34         $(webkit2_sources)
35
36 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS = \
37         -fno-strict-aliasing \
38         $(global_cppflags) \
39         -include $(srcdir)/Source/WebKit2/WebKit2Prefix.h \
40         -I$(srcdir)/Source/WebKit/gtk \
41         -I$(srcdir)/Source/WebKit2 \
42         -I$(srcdir)/Source/WebKit2/gtk \
43         -I$(srcdir)/Source/WebKit2/Platform \
44         -I$(srcdir)/Source/WebKit2/Platform/CoreIPC \
45         -I$(srcdir)/Source/WebKit2/Platform/CoreIPC/gtk \
46         -I$(srcdir)/Source/WebKit2/Platform/gtk \
47         -I$(srcdir)/Source/WebKit2/PluginProcess \
48         -I$(srcdir)/Source/WebKit2/Shared \
49         -I$(srcdir)/Source/WebKit2/Shared/API \
50         -I$(srcdir)/Source/WebKit2/Shared/API/c \
51         -I$(srcdir)/Source/WebKit2/Shared/API/c/gtk \
52         -I$(srcdir)/Source/WebKit2/Shared/API/c/soup \
53         -I$(srcdir)/Source/WebKit2/Shared/CoreIPCSupport \
54         -I$(srcdir)/Source/WebKit2/Shared/gtk \
55         -I$(srcdir)/Source/WebKit2/Shared/Network \
56         -I$(srcdir)/Source/WebKit2/Shared/Plugins \
57         -I$(srcdir)/Source/WebKit2/Shared/Plugins/Netscape \
58         -I$(srcdir)/Source/WebKit2/Shared/Plugins/Netscape/x11 \
59         -I$(srcdir)/Source/WebKit2/Shared/soup \
60         -I$(srcdir)/Source/WebKit2/UIProcess \
61         -I$(srcdir)/Source/WebKit2/UIProcess/API \
62         -I$(srcdir)/Source/WebKit2/UIProcess/API/C \
63         -I$(srcdir)/Source/WebKit2/UIProcess/API/C/gtk \
64         -I$(srcdir)/Source/WebKit2/UIProcess/API/C/soup \
65         -I$(srcdir)/Source/WebKit2/UIProcess/API/cpp \
66         -I$(srcdir)/Source/WebKit2/UIProcess/API/gtk \
67         -I$(srcdir)/Source/WebKit2/UIProcess/Authentication \
68         -I$(srcdir)/Source/WebKit2/UIProcess/Downloads \
69         -I$(srcdir)/Source/WebKit2/UIProcess/gtk \
70         -I$(srcdir)/Source/WebKit2/UIProcess/Launcher \
71         -I$(srcdir)/Source/WebKit2/UIProcess/Launcher/gtk \
72         -I$(srcdir)/Source/WebKit2/UIProcess/Notifications \
73         -I$(srcdir)/Source/WebKit2/UIProcess/Plugins \
74         -I$(srcdir)/Source/WebKit2/UIProcess/Plugins/unix \
75         -I$(srcdir)/Source/WebKit2/UIProcess/soup \
76         -I$(srcdir)/Source/WebKit2/UIProcess/InspectorServer \
77         -I$(srcdir)/Source/WebKit2/WebProcess \
78         -I$(srcdir)/Source/WebKit2/WebProcess/ApplicationCache \
79         -I$(srcdir)/Source/WebKit2/WebProcess/Authentication \
80         -I$(srcdir)/Source/WebKit2/WebProcess/Battery \
81         -I$(srcdir)/Source/WebKit2/WebProcess/Cookies \
82         -I$(srcdir)/Source/WebKit2/WebProcess/Downloads \
83         -I$(srcdir)/Source/WebKit2/WebProcess/Downloads/soup \
84         -I$(srcdir)/Source/WebKit2/WebProcess/FullScreen \
85         -I$(srcdir)/Source/WebKit2/WebProcess/Geolocation \
86         -I$(srcdir)/Source/WebKit2/WebProcess/gtk \
87         -I$(srcdir)/Source/WebKit2/WebProcess/IconDatabase \
88         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle \
89         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API \
90         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/c \
91         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/gtk \
92         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/DOM \
93         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/gtk \
94         -I$(srcdir)/Source/WebKit2/WebProcess/KeyValueStorage \
95         -I$(srcdir)/Source/WebKit2/WebProcess/Launching \
96         -I$(srcdir)/Source/WebKit2/WebProcess/MediaCache \
97         -I$(srcdir)/Source/WebKit2/WebProcess/NetworkInfo \
98         -I$(srcdir)/Source/WebKit2/WebProcess/Notifications \
99         -I$(srcdir)/Source/WebKit2/WebProcess/ResourceCache \
100         -I$(srcdir)/Source/WebKit2/WebProcess/soup \
101         -I$(srcdir)/Source/WebKit2/WebProcess/Plugins \
102         -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape \
103         -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape/unix \
104         -I$(srcdir)/Source/WebKit2/WebProcess/WebCoreSupport \
105         -I$(srcdir)/Source/WebKit2/WebProcess/WebCoreSupport/gtk \
106         -I$(srcdir)/Source/WebKit2/WebProcess/WebCoreSupport/soup \
107         -I$(srcdir)/Source/WebKit2/WebProcess/WebPage \
108         -I$(srcdir)/Source/WebKit2/WebProcess/WebPage/atk \
109         -I$(srcdir)/Source/WebKit2/WebProcess/WebPage/gtk \
110         -I$(top_builddir)/DerivedSources/WebKit2 \
111         -I$(top_builddir)/DerivedSources/WebKit2/include \
112         -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk \
113         -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk/include \
114         -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk/webkit2 \
115         -I$(top_builddir)/DerivedSources/WebKit2/webkit2extension/include \
116         -I$(top_builddir)/DerivedSources/WebKit2/include/JavaScriptCore \
117         -I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \
118         -I$(top_builddir)/DerivedSources/WebKit2/include/WebKit2 \
119         -I$(top_builddir)/DerivedSources/webkitdom \
120         -DLIBEXECDIR=\""$(libexecdir)"\" \
121         -DLIBDIR=\""$(libdir)"\" \
122         -DBUILDING_WEBKIT \
123         -DWEBKIT2_COMPILATION \
124         -DENABLE_PLUGIN_PROCESS=1 \
125         $(webcore_cppflags) \
126         $(webcoregtk_cppflags) \
127         $(javascriptcore_cppflags) \
128         $(CLUTTER_CFLAGS) \
129         $(COVERAGE_CFLAGS) \
130         $(FREETYPE_CFLAGS) \
131         $(GEOCLUE_CFLAGS) \
132         $(GLIB_CFLAGS) \
133         $(GTK_CFLAGS) \
134         $(GTK_UNIX_PRINTING_CFLAGS) \
135         $(LIBSOUP_CFLAGS) \
136         $(UNICODE_CFLAGS) \
137         $(XCOMPOSITE_CFLAGS) \
138         $(XDAMAGE_CFLAGS) \
139         $(XT_CFLAGS)
140
141 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXXFLAGS = \
142         $(global_cxxflags)
143
144 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CFLAGS = \
145         $(global_cflags)
146
147 # Artificial dependency to make sure libwebkit2gtk and libwebkitgtk are not linked at the same time
148 # The variable creation is to avoid having automake override the entire rule instead of adding the
149 # dependency.
150 webkit2gtk_lib_for_dep = libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
151 $(webkit2gtk_lib_for_dep): libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
152
153 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_ladir = \
154         $(libwebkit2gtkincludedir)/WebKit2
155
156 # For the Gtk port we want to use XP_UNIX both in X11 and Mac
157 if !TARGET_WIN32
158 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS += \
159         -DXP_UNIX
160 endif
161
162 # Add MOZ_X11 for X11 targets only
163 if TARGET_X11
164 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS += \
165         -DMOZ_X11
166 endif
167
168 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LDFLAGS = \
169         -version-info @LIBWEBKIT2GTK_VERSION@ \
170         $(version_script) \
171         $(no_undefined)
172
173 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD := \
174         -lpthread \
175         libWebCore.la \
176         libWebCorePlatform.la \
177         libWebCoreModules.la
178
179 if ENABLE_SVG
180 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD += \
181         libWebCoreSVG.la
182 endif
183
184 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD += \
185         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
186         libWebCoreDOM.la \
187         libWebCoreGtk.la \
188         $(CAIRO_LIBS) \
189         $(CLUTTER_LIBS) \
190         $(COVERAGE_LDFLAGS) \
191         $(FARSTREAM_LIBS) \
192         $(FREETYPE_LIBS) \
193         $(GAIL_LIBS) \
194         $(GAMEPAD_LIBS) \
195         $(GEOCLUE_LIBS) \
196         $(GLIB_LIBS) \
197         $(GSTREAMER_LIBS) \
198         $(GTK_LIBS) \
199         $(GTK_UNIX_PRINTING_LIBS) \
200         $(JPEG_LIBS) \
201         $(LIBSECRET_LIBS) \
202         $(LIBSOUP_LIBS) \
203         $(LIBXML_LIBS) \
204         $(LIBXSLT_LIBS) \
205         $(OPENGL_LIBS) \
206         $(PANGO_LIBS) \
207         $(PNG_LIBS) \
208         $(SQLITE3_LIBS) \
209         $(UNICODE_LIBS) \
210         $(WEBP_LIBS) \
211         $(XRENDER_LIBS) \
212         $(XCOMPOSITE_LIBS) \
213         $(XDAMAGE_LIBS) \
214         $(XT_LIBS) \
215         $(ZLIB_LIBS)
216
217 if ENABLE_SPELLCHECK
218 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS += \
219         -DENABLE_SPELLCHECK=1 \
220         $(ENCHANT_CFLAGS)
221
222 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD += \
223         $(ENCHANT_LIBS)
224 endif
225
226
227 if ENABLE_WEBKIT2
228 pkgconfig_DATA += Source/WebKit2/webkit2gtk-@WEBKITGTK_API_VERSION@.pc
229
230 if ENABLE_INTROSPECTION
231
232 WebKit2-@WEBKITGTK_API_VERSION@.gir: $(G_IR_SCANNER) libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
233         $(AM_V_GEN)$(G_IR_SCANNER) -v --warn-all \
234              --symbol-prefix=webkit \
235              --identifier-prefix=WebKit \
236              --namespace=WebKit2 \
237              --nsversion=@WEBKITGTK_API_VERSION@ \
238              --include=GObject-2.0 \
239              --include=Gtk-3.0 \
240              --include=Soup-2.4 \
241              --library=webkit2gtk-@WEBKITGTK_API_VERSION@ \
242              --library=javascriptcoregtk-@WEBKITGTK_API_VERSION@ \
243              --libtool="$(LIBTOOL)" \
244              --pkg=gobject-2.0 \
245              --pkg=gtk+-@GTK_API_VERSION@ \
246              --pkg=libsoup-2.4 \
247              --pkg-export=webkit2gtk-@WEBKITGTK_API_VERSION@ \
248              --output=$@ \
249              --add-include-path=$(WebKit2) \
250              --add-include-path=$(top_builddir) \
251              --c-include="webkit2/webkit2.h" \
252              -I$(srcdir)/Source \
253              -I$(WebKit2) \
254              -I$(GENSOURCES) \
255              -I$(GENSOURCES_WEBKIT2) \
256              -I$(top_builddir)/Source/WebKit2/UIProcess/API/gtk \
257              -I$(top_srcdir)/Source/JavaScriptCore/ForwardingHeaders \
258              -I$(top_srcdir) \
259              -I$(GENSOURCES_WEBKIT2)/webkit2gtk/include \
260              -I$(GENSOURCES_WEBKIT2)/webkit2gtk \
261              -DWEBKIT2_COMPILATION \
262              $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.h \
263              $(webkit2gtk_h_api) \
264              $(WebKit2)/UIProcess/API/gtk/*.cpp
265
266 gir2dir = $(datadir)/gir-1.0
267 gir2_DATA = WebKit2-@WEBKITGTK_API_VERSION@.gir
268
269 typelibs2dir = $(libdir)/girepository-1.0
270 typelibs2_DATA = WebKit2-@WEBKITGTK_API_VERSION@.typelib
271
272 WebKit2-@WEBKITGTK_API_VERSION@.typelib: WebKit2-@WEBKITGTK_API_VERSION@.gir $(G_IR_COMPILER)
273         $(AM_V_GEN)$(G_IR_COMPILER) --includedir $(WebKit2) --includedir $(top_builddir) $< -o $@
274
275 CLEANFILES += WebKit2-@WEBKITGTK_API_VERSION@.gir WebKit2-@WEBKITGTK_API_VERSION@.typelib
276
277 endif
278 endif
279
280 # WebKit2 specific variables
281 forwarding_headers := $(GENSOURCES_WEBKIT2)/include
282 generate-webkit2-forwarding-headers: $(WebKit2)/Scripts/generate-forwarding-headers.pl $(libWebKit2_la_SOURCES)
283         $(AM_V_GEN)$(PERL) $< $(WebKit2) $(forwarding_headers) gtk
284         $(AM_V_GEN)$(PERL) $< $(WebKit2) $(forwarding_headers) soup
285
286 BUILT_SOURCES += generate-webkit2-forwarding-headers
287
288 $(GENSOURCES_WEBKIT2)/webkit2gtk/include/webkit2: $(libwebkit2gtkinclude_HEADERS)
289         $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/include \
290         && ln -n -s -f ${shell pwd}/$(WebKit2)/UIProcess/API/gtk $@
291
292 $(GENSOURCES_WEBKIT2)/webkit2extension/include/webkit2: $(libwebkit2gtkinclude_HEADERS)
293         $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2extension/include \
294         && ln -n -s -f ${shell pwd}/$(WebKit2)/WebProcess/InjectedBundle/API/gtk $@
295
296 BUILT_SOURCES += \
297         $(GENSOURCES_WEBKIT2)/webkit2extension/include/webkit2 \
298         $(GENSOURCES_WEBKIT2)/webkit2gtk/include/webkit2
299
300 vpath %.messages.in = \
301         $(WebKit2)/PluginProcess \
302         $(WebKit2)/Shared \
303         $(WebKit2)/Shared/Plugins \
304         $(WebKit2)/UIProcess \
305         $(WebKit2)/UIProcess/ApplicationCache \
306         $(WebKit2)/UIProcess/Downloads \
307         $(WebKit2)/UIProcess/Geolocation \
308         $(WebKit2)/UIProcess/Notifications \
309         $(WebKit2)/UIProcess/Plugins \
310         $(WebKit2)/UIProcess/ResourceCache \
311         $(WebKit2)/UIProcess/soup \
312         $(WebKit2)/WebProcess \
313         $(WebKit2)/WebProcess/ApplicationCache \
314         $(WebKit2)/WebProcess/Authentication \
315         $(WebKit2)/WebProcess/Battery \
316         $(WebKit2)/WebProcess/Cookies \
317         $(WebKit2)/WebProcess/FullScreen \
318         $(WebKit2)/WebProcess/Geolocation \
319         $(WebKit2)/WebProcess/IconDatabase \
320         $(WebKit2)/WebProcess/KeyValueStorage \
321         $(WebKit2)/WebProcess/MediaCache \
322         $(WebKit2)/WebProcess/NetworkInfo \
323         $(WebKit2)/WebProcess/Notifications \
324         $(WebKit2)/WebProcess/Plugins \
325         $(WebKit2)/WebProcess/ResourceCache \
326         $(WebKit2)/WebProcess/WebCoreSupport \
327         $(WebKit2)/WebProcess/WebPage \
328         $(WebKit2)/WebProcess/soup
329
330 message_gen_scripts = \
331         $(WebKit2)/Scripts/generate-message-receiver.py \
332         $(WebKit2)/Scripts/generate-messages-header.py \
333         $(WebKit2)/Scripts/webkit2/__init__.py \
334         $(WebKit2)/Scripts/webkit2/messages.py \
335         $(WebKit2)/Scripts/webkit2/model.py \
336         $(WebKit2)/Scripts/webkit2/parser.py
337
338 # Message header generation
339 DerivedSources/WebKit2/%MessageReceiver.cpp: %.messages.in $(message_gen_scripts)
340         $(AM_V_GEN)$(PYTHON) $(WebKit2)/Scripts/generate-message-receiver.py $< > $@
341
342 DerivedSources/WebKit2/%Messages.h: %.messages.in $(message_gen_scripts)
343         $(AM_V_GEN)$(PYTHON) $(WebKit2)/Scripts/generate-messages-header.py $< > $@
344
345 webkit2gtk_built_headers_dir := $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2
346 $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.h: stamp-webkit2enumtypes
347         @true
348
349 stamp-webkit2enumtypes: $(libwebkit2gtkinclude_HEADERS) $(WebKit2)/GNUmakefile.am
350         $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2 \
351         && glib-mkenums \
352                         --fhead "#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)\n" \
353                         --fhead "#error \"Only <webkit2/webkit2.h> can be included directly.\"\n" \
354                         --fhead "#endif\n\n" \
355                         --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
356                         --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
357                         --fhead "#include <glib-object.h>\n\n" \
358                         --fhead "#include <webkit2/WebKitDefines.h>\n\n" \
359                         --fhead "G_BEGIN_DECLS\n\n" \
360                         --ftail "G_END_DECLS\n\n" \
361                         --ftail "#endif\n" \
362                         --fprod "#include <webkit2/@basename@>\n\n" \
363                         --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
364                         --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
365                 $(libwebkit2gtkinclude_HEADERS) | \
366                 sed 's,web_kit,webkit,' | \
367                 sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
368                 > wk2-xgen-gth \
369         && (cmp -s wk2-xgen-gth $(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h || cp wk2-xgen-gth $(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h) \
370         && rm -f wk2-xgen-gth \
371         && echo timestamp > $(@F)
372
373 $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.cpp: $(libwebkit2gtkinclude_HEADERS) $(WebKit2)/GNUmakefile.am
374         $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2 \
375         && glib-mkenums \
376                         --fhead "#include <config.h>\n" \
377                         --fhead "#include <glib-object.h>\n" \
378                         --fhead "#include \"$(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h\"\n\n" \
379                         --fhead "extern \"C\" {\n\n" \
380                         --fprod "\n/* Enumerations from \"@filename@\". */" \
381                         --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
382                         --vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
383                         --vtail "    { 0, NULL, NULL }\n};\n\n" \
384                         --vtail "GType @enum_name@_get_type(void)\n{\n" \
385                         --vtail "    static GType type = 0;\n\n" \
386                         --vtail "    if (!type)\n" \
387                         --vtail "        type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
388                         --vtail "    return type;\n}\n\n" \
389                         --ftail "}\n" \
390                 $(libwebkit2gtkinclude_HEADERS) | \
391                 sed 's,web_kit,webkit,' \
392                 > wk2-xgen-gtc \
393         && cp wk2-xgen-gtc $@ \
394         && rm -f wk2-xgen-gtc
395
396 WEBKIT2_MARSHAL_LIST = $(WebKit2)/UIProcess/API/gtk/webkit2marshal.list
397
398 $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitMarshal.cpp: stamp-webkit2marshal.cpp
399         @true
400 $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitMarshal.h: stamp-webkit2marshal.h
401         @true
402
403 stamp-webkit2marshal.cpp: $(WEBKIT2_MARSHAL_LIST)
404         $(AM_V_GEN) echo "extern \"C\" {" > $(webkit2gtk_built_headers_dir)/WebKitMarshal.cpp && \
405         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT2_MARSHAL_LIST) --body >> $(webkit2gtk_built_headers_dir)/WebKitMarshal.cpp && \
406         echo '}' >> $(webkit2gtk_built_headers_dir)/WebKitMarshal.cpp && \
407         echo timestamp > $(@F)
408
409 stamp-webkit2marshal.h: $(WEBKIT2_MARSHAL_LIST)
410         $(AM_V_GEN)$(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT2_MARSHAL_LIST) --header > $(webkit2gtk_built_headers_dir)/WebKitMarshal.h && \
411         echo timestamp > $(@F)
412
413 CLEANFILES += \
414         $(BUILT_SOURCES) \
415         $(top_builddir)/stamp-webkit2enumtypes \
416         $(top_builddir)/stamp-webkit2marshal.cpp \
417         $(top_builddir)/stamp-webkit2marshal.h \
418         $(top_builddir)/Programs/WebKitWebProcess
419
420 DISTCLEANFILES += \
421         $(top_builddir)/WebKit2/webkit2gtk-@WEBKITGTK_API_VERSION@.pc
422
423 if ENABLE_WEBKIT2
424 libexec_PROGRAMS += \
425         Programs/WebKitWebProcess
426 endif
427
428 Programs_WebKitWebProcess_CPPFLAGS = \
429         -I$(srcdir)/Source/WebKit2 \
430         -I$(srcdir)/Source/WebKit2/UIProcess/API/C \
431         -I$(srcdir)/Source/WebKit2/WebProcess/gtk \
432         -I$(top_builddir)/DerivedSources/WebKit2 \
433         -I$(top_builddir)/DerivedSources/WebKit2/include \
434         -I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \
435         $(global_cppflags) \
436         $(javascriptcore_cppflags)
437
438 Programs_WebKitWebProcess_CFLAGS = \
439         $(global_cflags) \
440         $(CAIRO_CFLAGS) \
441         $(GLIB_CFLAGS) \
442         $(GTK_CFLAGS) \
443         $(GTK_UNIX_PRINTING_CFLAGS) \
444         $(LIBSOUP_CFLAGS) \
445         $(ZLIB_CFLAGS)
446
447 Programs_WebKitWebProcess_SOURCES = \
448         Source/WebKit2/gtk/MainGtk.cpp
449
450 Programs_WebKitWebProcess_LDADD = \
451         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
452         libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
453         $(GLIB_LIBS) \
454         $(GTK_LIBS) \
455         $(GTK_UNIX_PRINTING_LIBS) \
456         $(LIBSOUP_LIBS)
457
458 libWebCoreGtk2_la_SOURCES = \
459         $(webcoregtk_sources)
460
461 libWebCoreGtk2_la_CXXFLAGS = \
462         $(SYMBOL_VISIBILITY_INLINES) \
463         $(global_cxxflags)
464
465 libWebCoreGtk2_la_CFLAGS = \
466         $(SYMBOL_VISIBILITY) \
467         $(global_cflags)
468
469 libWebCoreGtk2_la_CPPFLAGS = \
470         -DBUILDING_WEBKIT \
471         -DGTK_API_VERSION_2=1 \
472         $(global_cppflags) \
473         $(webcore_cppflags) \
474         $(webcoregtk_cppflags) \
475         $(javascriptcore_cppflags) \
476         -fno-strict-aliasing \
477         $(COVERAGE_CFLAGS) \
478         $(ENCHANT_CFLAGS) \
479         $(GEOCLUE_CFLAGS) \
480         $(FREETYPE_CFLAGS) \
481         $(FARSTREAM_CFLAGS) \
482         $(GLIB_CFLAGS) \
483         $(GSTREAMER_CFLAGS) \
484         $(GTK2_CFLAGS) \
485         $(LIBSECRET_CFLAGS) \
486         $(LIBSOUP_CFLAGS) \
487         $(LIBXML_CFLAGS) \
488         $(LIBXSLT_CFLAGS) \
489         $(SQLITE3_CFLAGS) \
490         $(UNICODE_CFLAGS) \
491         $(XRENDER_CFLAGS) \
492         $(XT_CFLAGS)
493
494 # Injected Bundle
495 injectedbundledir = $(libdir)/webkit2gtk-3.0/injected-bundle
496 injectedbundle_LTLIBRARIES = libwebkit2gtkinjectedbundle.la
497
498 libwebkit2gtkinjectedbundle_la_SOURCES = \
499         Source/WebKit2/WebProcess/gtk/WebGtkInjectedBundleMain.cpp
500
501 libwebkit2gtkinjectedbundle_la_LDFLAGS = \
502         $(no_undefined) \
503         -module \
504         -avoid-version
505
506 libwebkit2gtkinjectedbundle_la_CPPFLAGS = \
507         -fno-strict-aliasing \
508         -I$(srcdir)/Source/WebKit2/Platform \
509         -I$(srcdir)/Source/WebKit2/Shared \
510         -I$(srcdir)/Source/WebKit2/Shared/API/c \
511         -I$(srcdir)/Source/WebKit2/UIProcess/API/C \
512         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle \
513         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/c \
514         -I$(top_builddir)/DerivedSources/InjectedBundle \
515         -I$(top_builddir)/DerivedSources/WebKit2/include \
516         $(global_cppflags) \
517         $(javascriptcore_cppflags) \
518         $(GLIB_CFLAGS)
519
520 # Serialize linking of the plugin process with both webkit libraries.
521 plugin_process_for_dep = Programs/WebKitPluginProcess
522 $(plugin_process_for_dep): libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
523
524 Programs_WebKitPluginProcess_CPPFLAGS = \
525         -include $(srcdir)/Source/WebKit2/WebKit2Prefix.h \
526         -I$(srcdir)/Source/WebKit2 \
527         -I$(srcdir)/Source/WebKit2/Platform \
528         -I$(srcdir)/Source/WebKit2/Platform/CoreIPC/ \
529         -I$(srcdir)/Source/WebKit2/PluginProcess/ \
530         -I$(srcdir)/Source/WebKit2/PluginProcess/unix \
531         -I$(srcdir)/Source/WebKit2/Shared \
532         -I$(srcdir)/Source/WebKit2/Shared/Plugins \
533         -I$(srcdir)/Source/WebKit2/Shared/Plugins/Netscape/ \
534         -I$(srcdir)/Source/WebKit2/UIProcess/Plugins/ \
535         -I$(srcdir)/Source/WebKit2/UIProcess/Launcher \
536         -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/ \
537         -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape/ \
538         -I$(srcdir)/Source/WebKit2/Shared/soup \
539         -I$(top_builddir)/DerivedSources/WebKit2 \
540         -I$(top_builddir)/DerivedSources/WebKit2/include \
541         -I$(top_builddir)/DerivedSources/WebKit2/include/JavaScriptCore \
542         -I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \
543         -I$(top_builddir)/DerivedSources/WebKit2/include/WebKit2 \
544         -DBUILDING_WEBKIT \
545         -DGTK_API_VERSION_2=1 \
546         -DENABLE_PLUGIN_PROCESS=1 \
547         -DLIBEXECDIR=\""$(libexecdir)"\" \
548         $(global_cppflags) \
549         $(webcore_cppflags) \
550         $(webcoregtk_cppflags) \
551         $(javascriptcore_cppflags) \
552         -fno-strict-aliasing \
553         $(CAIRO_CFLAGS) \
554         $(FREETYPE_CFLAGS) \
555         $(GLIB_CFLAGS) \
556         $(GSTREAMER_CFLAGS) \
557         $(GTK2_CFLAGS) \
558         $(LIBSOUP_CFLAGS) \
559         $(UNICODE_CFLAGS)
560
561 Programs_WebKitPluginProcess_CFLAGS = \
562         $(SYMBOL_VISIBILITY) \
563         $(global_cflags) \
564         $(CAIRO_CFLAGS) \
565         $(GLIB_CFLAGS) \
566         $(GSTREAMER_CFLAGS) \
567         $(GTK2_CFLAGS) \
568         $(LIBSOUP_CFLAGS) \
569         $(UNICODE_CFLAGS)
570
571 nodist_Programs_WebKitPluginProcess_SOURCES = \
572         $(webkit2_plugin_process_built_sources)
573
574 Programs_WebKitPluginProcess_SOURCES = \
575         $(webkit2_plugin_process_sources)
576
577 Programs_WebKitPluginProcess_LDADD = \
578         -lpthread \
579         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
580         libWebCore.la
581
582 #if ENABLE_SVG
583 Programs_WebKitPluginProcess_LDADD += \
584     libWebCoreSVG.la
585 #endif
586
587 Programs_WebKitPluginProcess_LDADD += \
588         libWebCorePlatform.la \
589         libWebCoreGtk2.la \
590         $(CAIRO_LIBS) \
591         $(COVERAGE_LDFLAGS) \
592         $(GEOCLUE_LIBS) \
593         $(GLIB_LIBS) \
594         $(GSTREAMER_LIBS) \
595         $(GTK2_LIBS) \
596         $(JPEG_LIBS) \
597         $(LIBSECRET_LIBS) \
598         $(LIBSOUP_LIBS) \
599         $(LIBXML_LIBS) \
600         $(LIBXSLT_LIBS) \
601         $(OLE32_LIBS) \
602         $(OPENGL_LIBS) \
603         $(PANGO_LIBS) \
604         $(PNG_LIBS) \
605         $(SHLWAPI_LIBS) \
606         $(SHM_LIBS) \
607         $(SQLITE3_LIBS) \
608         $(UNICODE_LIBS) \
609         $(WEBP_LIBS) \
610         $(XRENDER_LIBS) \
611         $(XT_LIBS) \
612         $(WINMM_LIBS) \
613         $(ZLIB_LIBS)
614
615 # libWebCore and libWebCoreModules have circular dependencies that only seem to
616 # be a problem when linking the plugin process; we don't really care about
617 # modules for the plugin process, though, so to work around that we ignore
618 # internal unresolved symbols
619 Programs_WebKitPluginProcess_LDFLAGS = \
620         -Wl,--unresolved-symbols=ignore-in-object-files
621
622 Programs_WebKitPluginProcess_CXXFLAGS = \
623         $(SYMBOL_VISIBILITY_INLINES) \
624         $(global_cxxflags)
625
626 EXTRA_DIST += \
627         $(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml \
628         $(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk-sections.txt \
629         $(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk.types \
630         $(WebKit2)/Scripts/generate-message-receiver.py \
631         $(WebKit2)/Scripts/generate-messages-header.py \
632         $(WebKit2)/Scripts/webkit2/__init__.py \
633         $(WebKit2)/Scripts/webkit2/messages.py \
634         $(WebKit2)/Scripts/webkit2/model.py \
635         $(WebKit2)/Scripts/webkit2/parser.py \
636         $(WebKit2)/UIProcess/API/gtk/webkit2marshal.list \
637         $(WebKit2)/UIProcess/InspectorServer/front-end/inspectorPageIndex.html \
638         $(WebKit2)/Scripts/generate-forwarding-headers.pl \
639         $(shell ls $(WebKit2)/PluginProcess/*.in) \
640         $(shell ls $(WebKit2)/Shared/*.in) \
641         $(shell ls $(WebKit2)/Shared/Plugins/*.in) \
642         $(shell ls $(WebKit2)/UIProcess/*.in) \
643         $(shell ls $(WebKit2)/UIProcess/Downloads/*.in) \
644         $(shell ls $(WebKit2)/UIProcess/Notifications/*.in) \
645         $(shell ls $(WebKit2)/UIProcess/Plugins/*.in) \
646         $(shell ls $(WebKit2)/UIProcess/soup/*.in) \
647         $(shell ls $(WebKit2)/WebProcess/*.in) \
648         $(shell ls $(WebKit2)/WebProcess/ApplicationCache/*.in) \
649         $(shell ls $(WebKit2)/WebProcess/Authentication/*.in) \
650         $(shell ls $(WebKit2)/WebProcess/Battery/*.in) \
651         $(shell ls $(WebKit2)/WebProcess/Cookies/*.in) \
652         $(shell ls $(WebKit2)/WebProcess/FullScreen/*.in) \
653         $(shell ls $(WebKit2)/WebProcess/Geolocation/*.in) \
654         $(shell ls $(WebKit2)/WebProcess/IconDatabase/*.in) \
655         $(shell ls $(WebKit2)/WebProcess/KeyValueStorage/*.in) \
656         $(shell ls $(WebKit2)/WebProcess/MediaCache/*.in) \
657         $(shell ls $(WebKit2)/WebProcess/NetworkInfo/*.in) \
658         $(shell ls $(WebKit2)/WebProcess/Notifications/*.in) \
659         $(shell ls $(WebKit2)/WebProcess/Plugins/*.in) \
660         $(shell ls $(WebKit2)/WebProcess/ResourceCache/*.in) \
661         $(shell ls $(WebKit2)/WebProcess/WebCoreSupport/*.in) \
662         $(shell ls $(WebKit2)/WebProcess/WebPage/*.in) \
663         $(shell ls $(WebKit2)/WebProcess/soup/*.in)
664
665 # Installing remote inspector files
666 remoteinspectordir = ${datadir}/webkitgtk-@WEBKITGTK_API_VERSION@/webinspector
667 remoteinspector_DATA = \
668         $(WebKit2)/UIProcess/InspectorServer/front-end/inspectorPageIndex.html
669