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