[GTK] Enable introspection always for developer builds
[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) \
266              CFLAGS="$(CFLAGS) -Wno-deprecated-declarations" \
267              $(G_IR_SCANNER) \
268              --quiet \
269              --warn-all \
270              --warn-error \
271              --symbol-prefix=webkit \
272              --identifier-prefix=WebKit \
273              --namespace=WebKit2 \
274              --nsversion=@WEBKITGTK_API_VERSION@ \
275              --include=GObject-2.0 \
276              --include=Gtk-3.0 \
277              --include=JavaScriptCore-@WEBKITGTK_API_VERSION@ \
278              --include=Soup-2.4 \
279              --library=webkit2gtk-@WEBKITGTK_API_VERSION@ \
280              --library=javascriptcoregtk-@WEBKITGTK_API_VERSION@ \
281              --libtool="$(LIBTOOL)" \
282              --pkg=gobject-2.0 \
283              --pkg=gtk+-@GTK_API_VERSION@ \
284              --pkg=libsoup-2.4 \
285              --pkg-export=webkit2gtk-@WEBKITGTK_API_VERSION@ \
286              --output=$@ \
287              --add-include-path=$(WebKit2) \
288              --add-include-path=$(top_builddir) \
289              --c-include="webkit2/webkit2.h" \
290              -I$(srcdir)/Source \
291              -I$(WebKit2) \
292              -I$(GENSOURCES) \
293              -I$(GENSOURCES_WEBKITDOM) \
294              -I$(GENSOURCES_WEBKIT2) \
295              -I$(top_builddir)/Source/WebKit2/UIProcess/API/gtk \
296              -I$(top_srcdir)/Source/JavaScriptCore/ForwardingHeaders \
297              -I$(top_srcdir) \
298              -I$(GENSOURCES_WEBKIT2)/webkit2gtk/include \
299              -I$(GENSOURCES_WEBKIT2)/webkit2gtk \
300              -DBUILDING_WEBKIT \
301              -DWEBKIT2_COMPILATION \
302              $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.h \
303              $(webkit2gtk_h_api) \
304              $(webkitgtk_gdom_built_h_api) \
305              $(WebKit2)/UIProcess/API/gtk/*.cpp
306
307 WebKit2-@WEBKITGTK_API_VERSION@.typelib: WebKit2-@WEBKITGTK_API_VERSION@.gir $(G_IR_COMPILER)
308         $(AM_V_GEN)$(G_IR_COMPILER) --includedir $(WebKit2) --includedir $(top_builddir) $< -o $@
309
310 gir_DATA += WebKit2-@WEBKITGTK_API_VERSION@.gir
311 typelibs_DATA += WebKit2-@WEBKITGTK_API_VERSION@.typelib
312
313 CLEANFILES += WebKit2-@WEBKITGTK_API_VERSION@.gir WebKit2-@WEBKITGTK_API_VERSION@.typelib
314
315 endif
316 endif
317
318 # WebKit2 specific variables
319 forwarding_headers := $(GENSOURCES_WEBKIT2)/include
320 generate-webkit2-forwarding-headers: $(WebKit2)/Scripts/generate-forwarding-headers.pl $(libWebKit2_la_SOURCES)
321         $(AM_V_GEN)$(PERL) $< $(WebKit2) $(forwarding_headers) gtk
322         $(AM_V_GEN)$(PERL) $< $(WebKit2) $(forwarding_headers) soup
323
324 BUILT_SOURCES += generate-webkit2-forwarding-headers
325
326 $(GENSOURCES_WEBKIT2)/webkit2gtk/include/webkit2: $(libwebkit2gtkinclude_HEADERS)
327         $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/include \
328         && ln -n -s -f ${shell pwd}/$(WebKit2)/UIProcess/API/gtk $@
329
330 $(GENSOURCES_WEBKIT2)/webkit2extension/include/webkit2: $(libwebkit2gtkinclude_HEADERS)
331         $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2extension/include \
332         && ln -n -s -f ${shell pwd}/$(WebKit2)/WebProcess/InjectedBundle/API/gtk $@
333
334 BUILT_SOURCES += \
335         $(GENSOURCES_WEBKIT2)/webkit2extension/include/webkit2 \
336         $(GENSOURCES_WEBKIT2)/webkit2gtk/include/webkit2
337
338 vpath %.messages.in = \
339         $(WebKit2)/PluginProcess \
340         $(WebKit2)/Shared \
341         $(WebKit2)/Shared/Authentication \
342         $(WebKit2)/Shared/Plugins \
343         $(WebKit2)/UIProcess \
344         $(WebKit2)/UIProcess/ApplicationCache \
345         $(WebKit2)/UIProcess/Downloads \
346         $(WebKit2)/UIProcess/Geolocation \
347         $(WebKit2)/UIProcess/Notifications \
348         $(WebKit2)/UIProcess/Plugins \
349         $(WebKit2)/UIProcess/ResourceCache \
350         $(WebKit2)/UIProcess/Storage \
351         $(WebKit2)/UIProcess/soup \
352         $(WebKit2)/WebProcess \
353         $(WebKit2)/WebProcess/ApplicationCache \
354         $(WebKit2)/WebProcess/Battery \
355         $(WebKit2)/WebProcess/Cookies \
356         $(WebKit2)/WebProcess/FullScreen \
357         $(WebKit2)/WebProcess/Geolocation \
358         $(WebKit2)/WebProcess/IconDatabase \
359         $(WebKit2)/WebProcess/MediaCache \
360         $(WebKit2)/WebProcess/NetworkInfo \
361         $(WebKit2)/WebProcess/Notifications \
362         $(WebKit2)/WebProcess/Plugins \
363         $(WebKit2)/WebProcess/ResourceCache \
364         $(WebKit2)/WebProcess/Storage \
365         $(WebKit2)/WebProcess/WebCoreSupport \
366         $(WebKit2)/WebProcess/WebPage \
367         $(WebKit2)/WebProcess/soup
368
369 message_gen_scripts = \
370         $(WebKit2)/Scripts/generate-message-receiver.py \
371         $(WebKit2)/Scripts/generate-messages-header.py \
372         $(WebKit2)/Scripts/webkit2/__init__.py \
373         $(WebKit2)/Scripts/webkit2/messages.py \
374         $(WebKit2)/Scripts/webkit2/model.py \
375         $(WebKit2)/Scripts/webkit2/parser.py
376
377 # Message header generation
378 DerivedSources/WebKit2/%MessageReceiver.cpp: %.messages.in $(message_gen_scripts)
379         $(AM_V_GEN)$(PYTHON) $(WebKit2)/Scripts/generate-message-receiver.py $< > $@
380
381 DerivedSources/WebKit2/%Messages.h: %.messages.in $(message_gen_scripts)
382         $(AM_V_GEN)$(PYTHON) $(WebKit2)/Scripts/generate-messages-header.py $< > $@
383
384 webkit2gtk_built_headers_dir := $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2
385 $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.h: stamp-webkit2enumtypes
386         @true
387
388 stamp-webkit2enumtypes: $(libwebkit2gtkinclude_HEADERS) $(WebKit2)/GNUmakefile.am
389         $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2 \
390         && glib-mkenums \
391                         --fhead "#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)\n" \
392                         --fhead "#error \"Only <webkit2/webkit2.h> can be included directly.\"\n" \
393                         --fhead "#endif\n\n" \
394                         --fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
395                         --fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
396                         --fhead "#include <glib-object.h>\n\n" \
397                         --fhead "#include <webkit2/WebKitDefines.h>\n\n" \
398                         --fhead "G_BEGIN_DECLS\n\n" \
399                         --ftail "G_END_DECLS\n\n" \
400                         --ftail "#endif\n" \
401                         --fprod "#include <webkit2/@basename@>\n\n" \
402                         --eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
403                         --eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
404                 $(libwebkit2gtkinclude_HEADERS) | \
405                 sed 's,web_kit,webkit,' | \
406                 sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
407                 > wk2-xgen-gth \
408         && (cmp -s wk2-xgen-gth $(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h || cp wk2-xgen-gth $(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h) \
409         && rm -f wk2-xgen-gth \
410         && echo timestamp > $(@F)
411
412 $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.cpp: $(libwebkit2gtkinclude_HEADERS) $(WebKit2)/GNUmakefile.am
413         $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2 \
414         && glib-mkenums \
415                         --fhead "#include <config.h>\n" \
416                         --fhead "#include <glib-object.h>\n" \
417                         --fhead "#include \"$(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h\"\n\n" \
418                         --fhead "extern \"C\" {\n\n" \
419                         --fprod "\n/* Enumerations from \"@filename@\". */" \
420                         --vhead "static const G@Type@Value _@enum_name@_values[] = {" \
421                         --vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
422                         --vtail "    { 0, NULL, NULL }\n};\n\n" \
423                         --vtail "GType @enum_name@_get_type(void)\n{\n" \
424                         --vtail "    static GType type = 0;\n\n" \
425                         --vtail "    if (!type)\n" \
426                         --vtail "        type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
427                         --vtail "    return type;\n}\n\n" \
428                         --ftail "}\n" \
429                 $(libwebkit2gtkinclude_HEADERS) | \
430                 sed 's,web_kit,webkit,' \
431                 > wk2-xgen-gtc \
432         && cp wk2-xgen-gtc $@ \
433         && rm -f wk2-xgen-gtc
434
435 WEBKIT2_MARSHAL_LIST = $(WebKit2)/UIProcess/API/gtk/webkit2marshal.list
436
437 $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitMarshal.cpp: stamp-webkit2marshal.cpp
438         @true
439 $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitMarshal.h: stamp-webkit2marshal.h
440         @true
441
442 stamp-webkit2marshal.cpp: $(WEBKIT2_MARSHAL_LIST)
443         $(AM_V_GEN) echo "extern \"C\" {" > $(webkit2gtk_built_headers_dir)/WebKitMarshal.cpp && \
444         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT2_MARSHAL_LIST) --body >> $(webkit2gtk_built_headers_dir)/WebKitMarshal.cpp && \
445         echo '}' >> $(webkit2gtk_built_headers_dir)/WebKitMarshal.cpp && \
446         echo timestamp > $(@F)
447
448 stamp-webkit2marshal.h: $(WEBKIT2_MARSHAL_LIST)
449         $(AM_V_GEN)$(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT2_MARSHAL_LIST) --header > $(webkit2gtk_built_headers_dir)/WebKitMarshal.h && \
450         echo timestamp > $(@F)
451
452 CLEANFILES += \
453         $(BUILT_SOURCES) \
454         $(top_builddir)/stamp-webkit2enumtypes \
455         $(top_builddir)/stamp-webkit2marshal.cpp \
456         $(top_builddir)/stamp-webkit2marshal.h \
457         $(top_builddir)/Programs/WebKitWebProcess
458
459 DISTCLEANFILES += \
460         $(top_builddir)/WebKit2/webkit2gtk-@WEBKITGTK_API_VERSION@.pc
461
462 if ENABLE_WEBKIT2
463 libexec_PROGRAMS += \
464         Programs/WebKitWebProcess
465 endif
466
467 Programs_WebKitWebProcess_CPPFLAGS = \
468         -I$(srcdir)/Source/WebKit2 \
469         -I$(srcdir)/Source/WebKit2/UIProcess/API/C \
470         -I$(srcdir)/Source/WebKit2/WebProcess/gtk \
471         -I$(top_builddir)/DerivedSources/WebKit2 \
472         -I$(top_builddir)/DerivedSources/WebKit2/include \
473         -I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \
474         -std=c++11 \
475         $(global_cppflags) \
476         $(javascriptcore_cppflags)
477
478 Programs_WebKitWebProcess_CFLAGS = \
479         $(global_cflags) \
480         $(CAIRO_CFLAGS) \
481         $(FREETYPE_CFLAGS) \
482         $(GLIB_CFLAGS) \
483         $(GTK_CFLAGS) \
484         $(GTK_UNIX_PRINTING_CFLAGS) \
485         $(LIBSOUP_CFLAGS) \
486         $(ZLIB_CFLAGS)
487
488 Programs_WebKitWebProcess_SOURCES = \
489         Source/WebKit2/gtk/MainGtk.cpp
490
491 Programs_WebKitWebProcess_LDADD = \
492         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
493         libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
494         $(FREETYPE_LIBS) \
495         $(GLIB_LIBS) \
496         $(GTK_LIBS) \
497         $(GTK_UNIX_PRINTING_LIBS) \
498         $(LIBSOUP_LIBS)
499
500 libWebCoreGtk2_la_SOURCES = \
501         $(webcoregtk_sources)
502
503 libWebCoreGtk2_la_CXXFLAGS = \
504         -fvisibility-inlines-hidden \
505         $(global_cxxflags)
506
507 libWebCoreGtk2_la_CFLAGS = \
508         -fvisibility=hidden \
509         $(global_cflags)
510
511 libWebCoreGtk2_la_CPPFLAGS = \
512         -DBUILDING_WEBKIT \
513         -DGTK_API_VERSION_2=1 \
514         $(global_cppflags) \
515         $(platformgtk_cppflags) \
516         $(webcore_cppflags) \
517         $(webcoregtk_cppflags) \
518         $(javascriptcore_cppflags) \
519         -fno-strict-aliasing \
520         $(COVERAGE_CFLAGS) \
521         $(ENCHANT_CFLAGS) \
522         $(GEOCLUE_CFLAGS) \
523         $(FREETYPE_CFLAGS) \
524         $(GLIB_CFLAGS) \
525         $(GSTREAMER_CFLAGS) \
526         $(GTK2_CFLAGS) \
527         $(LIBSECRET_CFLAGS) \
528         $(LIBSOUP_CFLAGS) \
529         $(LIBXML_CFLAGS) \
530         $(LIBXSLT_CFLAGS) \
531         $(SQLITE3_CFLAGS) \
532         $(UNICODE_CFLAGS) \
533         $(XRENDER_CFLAGS) \
534         $(XT_CFLAGS)
535
536 libPlatformGtk2_la_SOURCES = \
537         $(platformgtk_sources)
538
539 libPlatformGtk2_la_CXXFLAGS = \
540         -fvisibility-inlines-hidden \
541         $(global_cxxflags)
542
543 libPlatformGtk2_la_CFLAGS = \
544         -fvisibility=hidden \
545         $(global_cflags)
546
547 libPlatformGtk2_la_CPPFLAGS = \
548         -DBUILDING_WEBKIT \
549         -DGTK_API_VERSION_2=1 \
550         $(global_cppflags) \
551         $(platformgtk_cppflags) \
552         $(platform_webcore_cppflags) \
553         $(javascriptcore_cppflags) \
554         -fno-strict-aliasing \
555         $(GTK2_CFLAGS) \
556         $(LIBSECRET_CFLAGS) \
557         $(LIBSOUP_CFLAGS)
558
559 # Injected Bundle
560 injectedbundledir = $(libdir)/webkit2gtk-3.0/injected-bundle
561 if ENABLE_WEBKIT2
562 injectedbundle_LTLIBRARIES = libwebkit2gtkinjectedbundle.la
563 endif
564
565 libwebkit2gtkinjectedbundle_la_SOURCES = \
566         Source/WebKit2/WebProcess/gtk/WebGtkInjectedBundleMain.cpp
567
568 libwebkit2gtkinjectedbundle_la_LDFLAGS = \
569         $(no_undefined) \
570         -module \
571         -avoid-version
572
573 libwebkit2gtkinjectedbundle_la_CPPFLAGS = \
574         -fno-strict-aliasing \
575         -I$(srcdir)/Source/WebKit2/Platform \
576         -I$(srcdir)/Source/WebKit2/Shared \
577         -I$(srcdir)/Source/WebKit2/Shared/API/c \
578         -I$(srcdir)/Source/WebKit2/UIProcess/API/C \
579         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle \
580         -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/c \
581         -I$(top_builddir)/DerivedSources/InjectedBundle \
582         -I$(top_builddir)/DerivedSources/WebKit2/include \
583         -std=c++11 \
584         $(global_cppflags) \
585         $(javascriptcore_cppflags) \
586         $(GLIB_CFLAGS)
587
588 # Serialize linking of the plugin process with both webkit libraries.
589 plugin_process_for_dep = Programs/WebKitPluginProcess
590 plugin_process_for_dep_list = libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
591 if ENABLE_WEBKIT1
592 plugin_process_for_dep_list += \
593         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
594 endif
595 $(plugin_process_for_dep): $(plugin_process_for_dep_list)
596
597 Programs_WebKitPluginProcess_CPPFLAGS = \
598         -include $(srcdir)/Source/WebKit2/WebKit2Prefix.h \
599         -I$(srcdir)/Source/WebKit2 \
600         -I$(srcdir)/Source/WebKit2/Platform \
601         -I$(srcdir)/Source/WebKit2/Platform/CoreIPC/ \
602         -I$(srcdir)/Source/WebKit2/PluginProcess/ \
603         -I$(srcdir)/Source/WebKit2/PluginProcess/unix \
604         -I$(srcdir)/Source/WebKit2/Shared \
605         -I$(srcdir)/Source/WebKit2/Shared/Plugins \
606         -I$(srcdir)/Source/WebKit2/Shared/Plugins/Netscape/ \
607         -I$(srcdir)/Source/WebKit2/UIProcess/Plugins/ \
608         -I$(srcdir)/Source/WebKit2/UIProcess/Launcher \
609         -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/ \
610         -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape/ \
611         -I$(srcdir)/Source/WebKit2/Shared/soup \
612         -I$(top_builddir)/DerivedSources/WebKit2 \
613         -I$(top_builddir)/DerivedSources/WebKit2/include \
614         -I$(top_builddir)/DerivedSources/WebKit2/include/JavaScriptCore \
615         -I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \
616         -I$(top_builddir)/DerivedSources/WebKit2/include/WebKit2 \
617         -DBUILDING_WEBKIT \
618         -DGTK_API_VERSION_2=1 \
619         -DENABLE_PLUGIN_PROCESS=1 \
620         -DLIBEXECDIR=\""$(libexecdir)"\" \
621         -std=c++11 \
622         $(global_cppflags) \
623         $(platformgtk_cppflags) \
624         $(webcore_cppflags) \
625         $(webcoregtk_cppflags) \
626         $(javascriptcore_cppflags) \
627         -fno-strict-aliasing \
628         $(CAIRO_CFLAGS) \
629         $(FREETYPE_CFLAGS) \
630         $(GLIB_CFLAGS) \
631         $(GSTREAMER_CFLAGS) \
632         $(GTK2_CFLAGS) \
633         $(LIBSOUP_CFLAGS) \
634         $(UNICODE_CFLAGS)
635
636 Programs_WebKitPluginProcess_CFLAGS = \
637         -fvisibility-inlines-hidden \
638         $(global_cflags) \
639         $(CAIRO_CFLAGS) \
640         $(GLIB_CFLAGS) \
641         $(GSTREAMER_CFLAGS) \
642         $(GTK2_CFLAGS) \
643         $(LIBSOUP_CFLAGS) \
644         $(UNICODE_CFLAGS)
645
646 nodist_Programs_WebKitPluginProcess_SOURCES = \
647         $(webkit2_plugin_process_built_sources)
648
649 Programs_WebKitPluginProcess_SOURCES = \
650         $(webkit2_plugin_process_sources)
651
652 Programs_WebKitPluginProcess_LDADD = \
653         -lpthread \
654         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
655         libWebCore.la
656
657 if ENABLE_SVG
658 Programs_WebKitPluginProcess_LDADD += \
659         libWebCoreSVG.la
660 endif
661
662 Programs_WebKitPluginProcess_LDADD += \
663         libPlatform.la \
664         libPlatformGtk2.la \
665         libWebCoreModules.la \
666         libWebCoreGtk2.la \
667         libWebCorePlatform.la \
668         libWebKit2Platform.la \
669         $(CAIRO_LIBS) \
670         $(COVERAGE_LDFLAGS) \
671         $(GEOCLUE_LIBS) \
672         $(GLIB_LIBS) \
673         $(GSTREAMER_LIBS) \
674         $(GTK2_LIBS) \
675         $(JPEG_LIBS) \
676         $(LIBSECRET_LIBS) \
677         $(LIBSOUP_LIBS) \
678         $(LIBXML_LIBS) \
679         $(LIBXSLT_LIBS) \
680         $(OLE32_LIBS) \
681         $(OPENGL_LIBS) \
682         $(PANGO_LIBS) \
683         $(PNG_LIBS) \
684         $(SHLWAPI_LIBS) \
685         $(SHM_LIBS) \
686         $(SQLITE3_LIBS) \
687         $(UNICODE_LIBS) \
688         $(WEBP_LIBS) \
689         $(XRENDER_LIBS) \
690         $(XT_LIBS) \
691         $(WINMM_LIBS) \
692         $(ZLIB_LIBS)
693
694 # libWebCore and libWebCoreModules have circular dependencies that only seem to
695 # be a problem when linking the plugin process; we don't really care about
696 # modules for the plugin process, though, so to work around that we ignore
697 # internal unresolved symbols
698 Programs_WebKitPluginProcess_LDFLAGS = \
699         -Wl,--unresolved-symbols=ignore-in-object-files
700
701 Programs_WebKitPluginProcess_CXXFLAGS = \
702         -fvisibility-inlines-hidden \
703         $(global_cxxflags)
704
705 EXTRA_DIST += \
706         $(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml \
707         $(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk-sections.txt \
708         $(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk.types \
709         $(WebKit2)/Scripts/generate-message-receiver.py \
710         $(WebKit2)/Scripts/generate-messages-header.py \
711         $(WebKit2)/Scripts/webkit2/__init__.py \
712         $(WebKit2)/Scripts/webkit2/messages.py \
713         $(WebKit2)/Scripts/webkit2/model.py \
714         $(WebKit2)/Scripts/webkit2/parser.py \
715         $(WebKit2)/UIProcess/API/gtk/webkit2marshal.list \
716         $(WebKit2)/UIProcess/InspectorServer/front-end/inspectorPageIndex.html \
717         $(WebKit2)/Scripts/generate-forwarding-headers.pl \
718         $(shell ls $(WebKit2)/PluginProcess/*.in) \
719         $(shell ls $(WebKit2)/Shared/*.in) \
720         $(shell ls $(WebKit2)/Shared/Authentication/*.in) \
721         $(shell ls $(WebKit2)/Shared/Plugins/*.in) \
722         $(shell ls $(WebKit2)/UIProcess/*.in) \
723         $(shell ls $(WebKit2)/UIProcess/Downloads/*.in) \
724         $(shell ls $(WebKit2)/UIProcess/Notifications/*.in) \
725         $(shell ls $(WebKit2)/UIProcess/Plugins/*.in) \
726         $(shell ls $(WebKit2)/UIProcess/Storage/*.in) \
727         $(shell ls $(WebKit2)/UIProcess/soup/*.in) \
728         $(shell ls $(WebKit2)/WebProcess/*.in) \
729         $(shell ls $(WebKit2)/WebProcess/ApplicationCache/*.in) \
730         $(shell ls $(WebKit2)/WebProcess/Battery/*.in) \
731         $(shell ls $(WebKit2)/WebProcess/Cookies/*.in) \
732         $(shell ls $(WebKit2)/WebProcess/FullScreen/*.in) \
733         $(shell ls $(WebKit2)/WebProcess/Geolocation/*.in) \
734         $(shell ls $(WebKit2)/WebProcess/IconDatabase/*.in) \
735         $(shell ls $(WebKit2)/WebProcess/MediaCache/*.in) \
736         $(shell ls $(WebKit2)/WebProcess/NetworkInfo/*.in) \
737         $(shell ls $(WebKit2)/WebProcess/Notifications/*.in) \
738         $(shell ls $(WebKit2)/WebProcess/Plugins/*.in) \
739         $(shell ls $(WebKit2)/WebProcess/ResourceCache/*.in) \
740         $(shell ls $(WebKit2)/WebProcess/Storage/*.in) \
741         $(shell ls $(WebKit2)/WebProcess/WebCoreSupport/*.in) \
742         $(shell ls $(WebKit2)/WebProcess/WebPage/*.in) \
743         $(shell ls $(WebKit2)/WebProcess/soup/*.in)
744
745 # Installing remote inspector files
746 remoteinspectordir = ${datadir}/webkitgtk-@WEBKITGTK_API_VERSION@/webinspector
747 remoteinspector_DATA = \
748         $(WebKit2)/UIProcess/InspectorServer/front-end/inspectorPageIndex.html
749