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