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