summaryrefslogtreecommitdiff
path: root/Source/WebKit2/GNUmakefile.am
blob: 3edce0aa2f21fd68b293d10c695aeddb9706dfd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
include $(srcdir)/Source/WebKit2/GNUmakefile.list.am

libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_HEADERS = \
	$(webkit2_h_api)

libwebkit2gtkincludedir = $(libwebkitgtkincludedir)/webkit2
nodist_libwebkit2gtkinclude_HEADERS = \
	DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitEnumTypes.h \
	DerivedSources/WebKit2/webkit2gtk/webkit2/WebKitVersion.h

libwebkit2gtkinclude_HEADERS = \
	$(webkit2gtk_h_api)

nodist_libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
	$(webkit2_built_sources) \
	$(webkit2gtk_built_sources)

libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
	$(webkit2_sources)

libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS = \
	-fno-strict-aliasing \
	$(global_cppflags) \
	-include $(srcdir)/Source/WebKit2/WebKit2Prefix.h \
	-I$(srcdir)/Source/WebKit/gtk \
	-I$(srcdir)/Source/WebKit2 \
	-I$(srcdir)/Source/WebKit2/gtk \
	-I$(srcdir)/Source/WebKit2/Platform \
	-I$(srcdir)/Source/WebKit2/Platform/CoreIPC \
	-I$(srcdir)/Source/WebKit2/Platform/CoreIPC/gtk \
	-I$(srcdir)/Source/WebKit2/Platform/gtk \
	-I$(srcdir)/Source/WebKit2/PluginProcess \
	-I$(srcdir)/Source/WebKit2/Shared \
	-I$(srcdir)/Source/WebKit2/Shared/API \
	-I$(srcdir)/Source/WebKit2/Shared/API/c \
	-I$(srcdir)/Source/WebKit2/Shared/API/c/gtk \
	-I$(srcdir)/Source/WebKit2/Shared/API/c/soup \
	-I$(srcdir)/Source/WebKit2/Shared/CoreIPCSupport \
	-I$(srcdir)/Source/WebKit2/Shared/gtk \
	-I$(srcdir)/Source/WebKit2/Shared/Plugins \
	-I$(srcdir)/Source/WebKit2/Shared/Plugins/Netscape \
	-I$(srcdir)/Source/WebKit2/Shared/Plugins/Netscape/x11 \
	-I$(srcdir)/Source/WebKit2/Shared/soup \
	-I$(srcdir)/Source/WebKit2/UIProcess \
	-I$(srcdir)/Source/WebKit2/UIProcess/API \
	-I$(srcdir)/Source/WebKit2/UIProcess/API/C \
	-I$(srcdir)/Source/WebKit2/UIProcess/API/C/gtk \
	-I$(srcdir)/Source/WebKit2/UIProcess/API/C/soup \
	-I$(srcdir)/Source/WebKit2/UIProcess/API/cpp \
	-I$(srcdir)/Source/WebKit2/UIProcess/API/gtk \
	-I$(srcdir)/Source/WebKit2/UIProcess/Authentication \
	-I$(srcdir)/Source/WebKit2/UIProcess/Downloads \
	-I$(srcdir)/Source/WebKit2/UIProcess/gtk \
	-I$(srcdir)/Source/WebKit2/UIProcess/Launcher \
	-I$(srcdir)/Source/WebKit2/UIProcess/Launcher/gtk \
	-I$(srcdir)/Source/WebKit2/UIProcess/Notifications \
	-I$(srcdir)/Source/WebKit2/UIProcess/Plugins \
	-I$(srcdir)/Source/WebKit2/UIProcess/Plugins/gtk \
	-I$(srcdir)/Source/WebKit2/UIProcess/soup \
	-I$(srcdir)/Source/WebKit2/WebProcess \
	-I$(srcdir)/Source/WebKit2/WebProcess/ApplicationCache \
	-I$(srcdir)/Source/WebKit2/WebProcess/Authentication \
	-I$(srcdir)/Source/WebKit2/WebProcess/Battery \
	-I$(srcdir)/Source/WebKit2/WebProcess/Cookies \
	-I$(srcdir)/Source/WebKit2/WebProcess/Downloads \
	-I$(srcdir)/Source/WebKit2/WebProcess/Downloads/soup \
	-I$(srcdir)/Source/WebKit2/WebProcess/FullScreen \
	-I$(srcdir)/Source/WebKit2/WebProcess/Geolocation \
	-I$(srcdir)/Source/WebKit2/WebProcess/gtk \
	-I$(srcdir)/Source/WebKit2/WebProcess/IconDatabase \
	-I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle \
	-I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API \
	-I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/c \
	-I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/DOM \
	-I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/gtk \
	-I$(srcdir)/Source/WebKit2/WebProcess/KeyValueStorage \
	-I$(srcdir)/Source/WebKit2/WebProcess/Launching \
	-I$(srcdir)/Source/WebKit2/WebProcess/MediaCache \
	-I$(srcdir)/Source/WebKit2/WebProcess/NetworkInfo \
	-I$(srcdir)/Source/WebKit2/WebProcess/Notifications \
	-I$(srcdir)/Source/WebKit2/WebProcess/ResourceCache \
	-I$(srcdir)/Source/WebKit2/WebProcess/soup \
	-I$(srcdir)/Source/WebKit2/WebProcess/Plugins \
	-I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape \
	-I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape/gtk \
	-I$(srcdir)/Source/WebKit2/WebProcess/WebCoreSupport \
	-I$(srcdir)/Source/WebKit2/WebProcess/WebCoreSupport/gtk \
	-I$(srcdir)/Source/WebKit2/WebProcess/WebCoreSupport/soup \
	-I$(srcdir)/Source/WebKit2/WebProcess/WebPage \
	-I$(srcdir)/Source/WebKit2/WebProcess/WebPage/gtk \
	-I$(top_builddir)/DerivedSources/WebKit2 \
	-I$(top_builddir)/DerivedSources/WebKit2/include \
	-I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk \
	-I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk/include \
	-I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk/webkit2 \
	-I$(top_builddir)/DerivedSources/WebKit2/include/JavaScriptCore \
	-I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \
	-I$(top_builddir)/DerivedSources/WebKit2/include/WebKit2 \
	-DLIBEXECDIR=\""$(libexecdir)"\" \
	-DWEBKIT2_COMPILATION \
	$(webcore_cppflags) \
	$(webcoregtk_cppflags) \
	$(javascriptcore_cppflags) \
	$(COVERAGE_CFLAGS) \
	$(GEOCLUE_CFLAGS) \
	$(GLIB_CFLAGS) \
	$(GTK_CFLAGS) \
	$(GTK_UNIX_PRINTING_CFLAGS) \
	$(LIBSOUP_CFLAGS) \
	$(UNICODE_CFLAGS) \
	$(XT_CFLAGS)

libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXXFLAGS = \
	$(global_cxxflags)

libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CFLAGS = \
	$(global_cflags)

if ENABLE_WEBKIT2
# Shared libraries
lib_LTLIBRARIES += \
	libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
endif

# Artificial dependency to make sure libwebkit2gtk and libwebkitgtk are not linked at the same time
# The variable creation is to avoid having automake override the entire rule instead of adding the
# dependency.
webkit2gtk_lib_for_dep = libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
$(webkit2gtk_lib_for_dep): libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la

libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_ladir = \
	$(libwebkit2gtkincludedir)/WebKit2

# For the Gtk port we want to use XP_UNIX both in X11 and Mac
if !TARGET_WIN32
libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS += \
	-DXP_UNIX
endif

# Add MOZ_X11 for X11 targets only
if TARGET_X11
libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS += \
	-DMOZ_X11
endif

# Plugin process
if ENABLE_PLUGIN_PROCESS
libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS += \
	-DENABLE_PLUGIN_PROCESS=1
endif

libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LDFLAGS = \
	-version-info @LIBWEBKIT2GTK_VERSION@ \
	$(version_script) \
	$(no_undefined)

libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD = \
	-lpthread \
	libWebCore.la \
	libWebCoreModules.la \
	libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
	libWebCoreGtk.la \
	$(CAIRO_LIBS) \
	$(COVERAGE_LDFLAGS) \
	$(FARSTREAM_LIBS) \
	$(GAIL_LIBS) \
	$(GAMEPAD_LIBS) \
	$(GEOCLUE_LIBS) \
	$(GLIB_LIBS) \
	$(GSTREAMER_LIBS) \
	$(GTK_LIBS) \
	$(GTK_UNIX_PRINTING_LIBS) \
	$(JPEG_LIBS) \
	$(LIBSOUP_LIBS) \
	$(LIBXML_LIBS) \
	$(LIBXSLT_LIBS) \
	$(OPENGL_LIBS) \
	$(PANGO_LIBS) \
	$(PNG_LIBS) \
	$(SQLITE3_LIBS) \
	$(UNICODE_LIBS) \
	$(XRENDER_LIBS) \
	$(XT_LIBS) \
	$(ZLIB_LIBS)

if ENABLE_SPELLCHECK
libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS += \
	-DENABLE_SPELLCHECK=1 \
	$(ENCHANT_CFLAGS)

libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD += \
	$(ENCHANT_LIBS)
endif


if ENABLE_WEBKIT2
pkgconfig_DATA += Source/WebKit2/webkit2gtk-@WEBKITGTK_API_VERSION@.pc
endif

# WebKit2 specific variables
forwarding_headers := $(GENSOURCES_WEBKIT2)/include
generate-webkit2-forwarding-headers: $(WebKit2)/Scripts/generate-forwarding-headers.pl $(libWebKit2_la_SOURCES)
	$(AM_V_GEN)$(PERL) $< $(WebKit2) $(forwarding_headers) gtk
	$(AM_V_GEN)$(PERL) $< $(WebKit2) $(forwarding_headers) soup

BUILT_SOURCES += generate-webkit2-forwarding-headers

$(GENSOURCES_WEBKIT2)/webkit2gtk/include/webkit2: $(libwebkit2gtkinclude_HEADERS)
	$(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/include \
	&& ln -n -s -f ${shell pwd}/$(WebKit2)/UIProcess/API/gtk $@

BUILT_SOURCES += $(GENSOURCES_WEBKIT2)/webkit2gtk/include/webkit2

vpath %.messages.in = \
	$(WebKit2)/PluginProcess \
	$(WebKit2)/Shared/Plugins \
	$(WebKit2)/UIProcess \
	$(WebKit2)/UIProcess/ApplicationCache \
	$(WebKit2)/UIProcess/Downloads \
	$(WebKit2)/UIProcess/Geolocation \
	$(WebKit2)/UIProcess/Notifications \
	$(WebKit2)/UIProcess/Plugins \
	$(WebKit2)/UIProcess/ResourceCache \
	$(WebKit2)/UIProcess/soup \
	$(WebKit2)/WebProcess \
	$(WebKit2)/WebProcess/ApplicationCache \
	$(WebKit2)/WebProcess/Authentication \
	$(WebKit2)/WebProcess/Battery \
	$(WebKit2)/WebProcess/Cookies \
	$(WebKit2)/WebProcess/FullScreen \
	$(WebKit2)/WebProcess/Geolocation \
	$(WebKit2)/WebProcess/IconDatabase \
	$(WebKit2)/WebProcess/KeyValueStorage \
	$(WebKit2)/WebProcess/MediaCache \
	$(WebKit2)/WebProcess/NetworkInfo \
	$(WebKit2)/WebProcess/Notifications \
	$(WebKit2)/WebProcess/Plugins \
	$(WebKit2)/WebProcess/ResourceCache \
	$(WebKit2)/WebProcess/WebCoreSupport \
	$(WebKit2)/WebProcess/WebPage \
	$(WebKit2)/WebProcess/soup

message_gen_scripts = \
	$(WebKit2)/Scripts/generate-message-receiver.py \
	$(WebKit2)/Scripts/generate-messages-header.py \
	$(WebKit2)/Scripts/webkit2/__init__.py \
	$(WebKit2)/Scripts/webkit2/messages.py \
	$(WebKit2)/Scripts/webkit2/model.py \
	$(WebKit2)/Scripts/webkit2/parser.py

# Message header generation
DerivedSources/WebKit2/%MessageReceiver.cpp: %.messages.in $(message_gen_scripts)
	$(AM_V_GEN)$(PYTHON) $(WebKit2)/Scripts/generate-message-receiver.py $< > $@

DerivedSources/WebKit2/%Messages.h: %.messages.in $(message_gen_scripts)
	$(AM_V_GEN)$(PYTHON) $(WebKit2)/Scripts/generate-messages-header.py $< > $@

webkit2gtk_built_headers_dir := $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2
$(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.h: stamp-webkit2enumtypes
	@true

stamp-webkit2enumtypes: $(libwebkit2gtkinclude_HEADERS) $(WebKit2)/GNUmakefile.am
	$(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2 \
	&& glib-mkenums \
			--fhead "#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)\n" \
			--fhead "#error \"Only <webkit2/webkit2.h> can be included directly.\"\n" \
			--fhead "#endif\n\n" \
			--fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
			--fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
			--fhead "#include <glib-object.h>\n\n" \
			--fhead "#include <webkit2/WebKitDefines.h>\n\n" \
			--fhead "G_BEGIN_DECLS\n\n" \
			--ftail "G_END_DECLS\n\n" \
			--ftail "#endif\n" \
			--fprod "#include <webkit2/@basename@>\n\n" \
			--eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
			--eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
		$(libwebkit2gtkinclude_HEADERS) | \
		sed 's,web_kit,webkit,' | \
		sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
		> wk2-xgen-gth \
	&& (cmp -s wk2-xgen-gth $(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h || cp wk2-xgen-gth $(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h) \
	&& rm -f wk2-xgen-gth \
	&& echo timestamp > $(@F)

$(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitEnumTypes.cpp: $(libwebkit2gtkinclude_HEADERS) $(WebKit2)/GNUmakefile.am
	$(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2 \
	&& glib-mkenums \
			--fhead "#include <config.h>\n" \
			--fhead "#include <glib-object.h>\n" \
			--fhead "#include \"$(webkit2gtk_built_headers_dir)/WebKitEnumTypes.h\"\n\n" \
			--fhead "extern \"C\" {\n\n" \
			--fprod "\n/* Enumerations from \"@filename@\". */" \
			--vhead "static const G@Type@Value _@enum_name@_values[] = {" \
			--vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
			--vtail "    { 0, NULL, NULL }\n};\n\n" \
			--vtail "GType @enum_name@_get_type(void)\n{\n" \
			--vtail "    static GType type = 0;\n\n" \
			--vtail "    if (!type)\n" \
			--vtail "        type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
			--vtail "    return type;\n}\n\n" \
			--ftail "}\n" \
		$(libwebkit2gtkinclude_HEADERS) | \
		sed 's,web_kit,webkit,' \
		> wk2-xgen-gtc \
	&& cp wk2-xgen-gtc $@ \
	&& rm -f wk2-xgen-gtc

WEBKIT2_MARSHAL_LIST = $(WebKit2)/UIProcess/API/gtk/webkit2marshal.list

$(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitMarshal.cpp: stamp-webkit2marshal.cpp
	@true
$(GENSOURCES_WEBKIT2)/webkit2gtk/webkit2/WebKitMarshal.h: stamp-webkit2marshal.h
	@true

stamp-webkit2marshal.cpp: $(WEBKIT2_MARSHAL_LIST)
	$(AM_V_GEN) echo "extern \"C\" {" > $(webkit2gtk_built_headers_dir)/WebKitMarshal.cpp && \
	$(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT2_MARSHAL_LIST) --body >> $(webkit2gtk_built_headers_dir)/WebKitMarshal.cpp && \
	echo '}' >> $(webkit2gtk_built_headers_dir)/WebKitMarshal.cpp && \
	echo timestamp > $(@F)

stamp-webkit2marshal.h: $(WEBKIT2_MARSHAL_LIST)
	$(AM_V_GEN)$(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT2_MARSHAL_LIST) --header > $(webkit2gtk_built_headers_dir)/WebKitMarshal.h && \
	echo timestamp > $(@F)

CLEANFILES += \
	$(BUILT_SOURCES) \
	$(top_builddir)/stamp-webkit2enumtypes \
	$(top_builddir)/stamp-webkit2marshal.cpp \
	$(top_builddir)/stamp-webkit2marshal.h \
	$(top_builddir)/Programs/WebKitWebProcess

DISTCLEANFILES += \
	$(top_builddir)/WebKit2/webkit2gtk-@WEBKITGTK_API_VERSION@.pc

if ENABLE_WEBKIT2
libexec_PROGRAMS += \
	Programs/WebKitWebProcess
endif

Programs_WebKitWebProcess_CPPFLAGS = \
	-I$(srcdir)/Source/WebKit2 \
	-I$(srcdir)/Source/WebKit2/UIProcess/API/C \
	-I$(srcdir)/Source/WebKit2/WebProcess/gtk \
	-I$(top_builddir)/DerivedSources/WebKit2 \
	-I$(top_builddir)/DerivedSources/WebKit2/include \
	-I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \
	$(global_cppflags) \
	$(javascriptcore_cppflags)

Programs_WebKitWebProcess_CFLAGS = \
	$(global_cflags) \
	$(CAIRO_CFLAGS) \
	$(GLIB_CFLAGS) \
	$(GTK_CFLAGS) \
	$(GTK_UNIX_PRINTING_CFLAGS) \
	$(LIBSOUP_CFLAGS) \
	$(ZLIB_CFLAGS)

Programs_WebKitWebProcess_SOURCES = \
	Source/WebKit2/gtk/MainGtk.cpp

Programs_WebKitWebProcess_LDADD = \
	libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
	libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
	$(GLIB_LIBS) \
	$(GTK_LIBS) \
	$(GTK_UNIX_PRINTING_LIBS) \
	$(LIBSOUP_LIBS)

# PluginProcess
if ENABLE_PLUGIN_PROCESS

# We need to make sure plugin process is always built with gtk2, because plugins like flash
# still use gtk2. Since webcore was built with gtk3, we need to build webcoregtk sources again with gtk2
noinst_LTLIBRARIES += \
	libWebCoreGtk2.la

libWebCoreGtk2_la_SOURCES = \
	$(webcoregtk_sources)

libWebCoreGtk2_la_CXXFLAGS = \
	$(SYMBOL_VISIBILITY_INLINES) \
	$(global_cxxflags)

libWebCoreGtk2_la_CFLAGS = \
	$(SYMBOL_VISIBILITY) \
	$(global_cflags)

libWebCoreGtk2_la_CPPFLAGS = \
	-DBUILDING_WEBKIT \
	-DGTK_API_VERSION_2=1 \
	$(global_cppflags) \
	$(webcore_cppflags) \
	$(webcoregtk_cppflags) \
	$(javascriptcore_cppflags) \
	-fno-strict-aliasing \
	$(COVERAGE_CFLAGS) \
	$(ENCHANT_CFLAGS) \
	$(GEOCLUE_CFLAGS) \
	$(FARSTREAM_CFLAGS) \
	$(GLIB_CFLAGS) \
	$(GSTREAMER_CFLAGS) \
	$(GTK2_CFLAGS) \
	$(LIBSOUP_CFLAGS) \
	$(LIBXML_CFLAGS) \
	$(LIBXSLT_CFLAGS) \
	$(SQLITE3_CFLAGS) \
	$(UNICODE_CFLAGS) \
	$(XRENDER_CFLAGS) \
	$(XT_CFLAGS)

libexec_PROGRAMS += \
	Programs/WebKitPluginProcess

# Serialize linking of the plugin process with both webkit libraries.
plugin_process_for_dep = Programs/WebKitPluginProcess
$(plugin_process_for_dep): libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la

Programs_WebKitPluginProcess_CPPFLAGS = \
	-include $(srcdir)/Source/WebKit2/WebKit2Prefix.h \
	-I$(srcdir)/Source/WebKit2 \
	-I$(srcdir)/Source/WebKit2/Platform \
	-I$(srcdir)/Source/WebKit2/Platform/CoreIPC/ \
	-I$(srcdir)/Source/WebKit2/PluginProcess/ \
	-I$(srcdir)/Source/WebKit2/PluginProcess/gtk \
	-I$(srcdir)/Source/WebKit2/Shared \
	-I$(srcdir)/Source/WebKit2/Shared/Plugins \
	-I$(srcdir)/Source/WebKit2/Shared/Plugins/Netscape/ \
	-I$(srcdir)/Source/WebKit2/UIProcess/Plugins/ \
	-I$(srcdir)/Source/WebKit2/UIProcess/Launcher \
	-I$(srcdir)/Source/WebKit2/WebProcess/Plugins/ \
	-I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape/ \
	-I$(srcdir)/Source/WebKit2/Shared/soup \
	-I$(top_builddir)/DerivedSources/WebKit2 \
	-I$(top_builddir)/DerivedSources/WebKit2/include \
	-I$(top_builddir)/DerivedSources/WebKit2/include/JavaScriptCore \
	-I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \
	-I$(top_builddir)/DerivedSources/WebKit2/include/WebKit2 \
	-DBUILDING_WEBKIT \
	-DGTK_API_VERSION_2=1 \
	-DENABLE_PLUGIN_PROCESS=1 \
	-DLIBEXECDIR=\""$(libexecdir)"\" \
	$(global_cppflags) \
	$(webcore_cppflags) \
	$(webcoregtk_cppflags) \
	$(javascriptcore_cppflags) \
	-fno-strict-aliasing \
	$(CAIRO_CFLAGS) \
	$(GLIB_CFLAGS) \
	$(GSTREAMER_CFLAGS) \
	$(GTK2_CFLAGS) \
	$(LIBSOUP_CFLAGS) \
	$(UNICODE_CFLAGS)

Programs_WebKitPluginProcess_CFLAGS = \
	$(SYMBOL_VISIBILITY) \
	$(global_cflags) \
	$(CAIRO_CFLAGS) \
	$(GLIB_CFLAGS) \
	$(GSTREAMER_CFLAGS) \
	$(GTK2_CFLAGS) \
	$(LIBSOUP_CFLAGS) \
	$(UNICODE_CFLAGS)

nodist_Programs_WebKitPluginProcess_SOURCES = \
	$(webkit2_plugin_process_built_sources)

Programs_WebKitPluginProcess_SOURCES = \
	$(webkit2_plugin_process_sources)

Programs_WebKitPluginProcess_LDADD = \
	-lpthread \
	libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
	libWebCore.la \
	libWebCoreGtk2.la \
	$(CAIRO_LIBS) \
	$(COVERAGE_LDFLAGS) \
	$(GEOCLUE_LIBS) \
	$(GLIB_LIBS) \
	$(GSTREAMER_LIBS) \
	$(GTK2_LIBS) \
	$(JPEG_LIBS) \
	$(LIBSOUP_LIBS) \
	$(LIBXML_LIBS) \
	$(LIBXSLT_LIBS) \
	$(OLE32_LIBS) \
	$(OPENGL_LIBS) \
	$(PANGO_LIBS) \
	$(PNG_LIBS) \
	$(SHLWAPI_LIBS) \
	$(SQLITE3_LIBS) \
	$(UNICODE_LIBS) \
	$(XRENDER_LIBS) \
	$(XT_LIBS) \
	$(WINMM_LIBS) \
	$(ZLIB_LIBS)

# libWebCore and libWebCoreModules have circular dependencies that only seem to
# be a problem when linking the plugin process; we don't really care about
# modules for the plugin process, though, so to work around that we ignore
# internal unresolved symbols
Programs_WebKitPluginProcess_LDFLAGS = \
	-Wl,--unresolved-symbols=ignore-in-object-files

Programs_WebKitPluginProcess_CXXFLAGS = \
	$(SYMBOL_VISIBILITY_INLINES) \
	$(global_cxxflags)

endif # ENABLE_PLUGIN_PROCESS

EXTRA_DIST += \
	$(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml \
	$(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk-sections.txt \
	$(WebKit2)/UIProcess/API/gtk/docs/webkit2gtk.types \
	$(WebKit2)/Scripts/generate-message-receiver.py \
	$(WebKit2)/Scripts/generate-messages-header.py \
	$(WebKit2)/Scripts/webkit2/__init__.py \
	$(WebKit2)/Scripts/webkit2/messages.py \
	$(WebKit2)/Scripts/webkit2/model.py \
	$(WebKit2)/Scripts/webkit2/parser.py \
	$(WebKit2)/UIProcess/API/gtk/webkit2marshal.list \
	$(WebKit2)/Scripts/generate-forwarding-headers.pl \
	$(shell ls $(WebKit2)/PluginProcess/*.in) \
	$(shell ls $(WebKit2)/Shared/Plugins/*.in) \
	$(shell ls $(WebKit2)/UIProcess/*.in) \
	$(shell ls $(WebKit2)/UIProcess/Downloads/*.in) \
	$(shell ls $(WebKit2)/UIProcess/Notifications/*.in) \
	$(shell ls $(WebKit2)/UIProcess/Plugins/*.in) \
	$(shell ls $(WebKit2)/UIProcess/soup/*.in) \
	$(shell ls $(WebKit2)/WebProcess/*.in) \
	$(shell ls $(WebKit2)/WebProcess/ApplicationCache/*.in) \
	$(shell ls $(WebKit2)/WebProcess/Authentication/*.in) \
	$(shell ls $(WebKit2)/WebProcess/Battery/*.in) \
	$(shell ls $(WebKit2)/WebProcess/Cookies/*.in) \
	$(shell ls $(WebKit2)/WebProcess/FullScreen/*.in) \
	$(shell ls $(WebKit2)/WebProcess/Geolocation/*.in) \
	$(shell ls $(WebKit2)/WebProcess/IconDatabase/*.in) \
	$(shell ls $(WebKit2)/WebProcess/KeyValueStorage/*.in) \
	$(shell ls $(WebKit2)/WebProcess/MediaCache/*.in) \
	$(shell ls $(WebKit2)/WebProcess/NetworkInfo/*.in) \
	$(shell ls $(WebKit2)/WebProcess/Notifications/*.in) \
	$(shell ls $(WebKit2)/WebProcess/Plugins/*.in) \
	$(shell ls $(WebKit2)/WebProcess/ResourceCache/*.in) \
	$(shell ls $(WebKit2)/WebProcess/WebCoreSupport/*.in) \
	$(shell ls $(WebKit2)/WebProcess/WebPage/*.in) \
	$(shell ls $(WebKit2)/WebProcess/soup/*.in)