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