2011-03-15 Ilya Tikhonovsky <loislo@chromium.org>
[WebKit-https.git] / Source / WebCore / WebCore.gyp / WebCore.gyp
1 #
2 # Copyright (C) 2009 Google Inc. All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are
6 # met:
7 #
8 #     * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 #     * Redistributions in binary form must reproduce the above
11 # copyright notice, this list of conditions and the following disclaimer
12 # in the documentation and/or other materials provided with the
13 # distribution.
14 #     * Neither the name of Google Inc. nor the names of its
15 # contributors may be used to endorse or promote products derived from
16 # this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #
30
31 {
32   'includes': [
33     # FIXME: Sense whether upstream or downstream build, and
34     # include the right features.gypi
35     '../../WebKit/chromium/features.gypi',
36     '../WebCore.gypi',
37   ],
38   # Location of the chromium src directory.
39   'conditions': [
40     ['inside_chromium_build==0', {
41       # Webkit is being built outside of the full chromium project.
42       'variables': {
43         'chromium_src_dir': '../../WebKit/chromium',
44         'libjpeg_gyp_path': '<(chromium_src_dir)/third_party/libjpeg_turbo/libjpeg.gyp',
45       },
46     },{
47       # WebKit is checked out in src/chromium/third_party/WebKit
48       'variables': {
49         'chromium_src_dir': '../../../../..',
50       },
51     }],
52     ['OS == "mac"', {
53       'targets': [
54         {
55           # On the Mac, libWebKitSystemInterface*.a is used to help WebCore
56           # interface with the system.  This library is supplied as a static
57           # library in binary format.  At present, it contains many global
58           # symbols not marked private_extern.  It should be considered an
59           # implementation detail of WebCore, and does not need these symbols
60           # to be exposed so widely.
61           #
62           # This target contains an action that cracks open the existing
63           # static library and rebuilds it with these global symbols
64           # transformed to private_extern.
65           'target_name': 'webkit_system_interface',
66           'type': 'static_library',
67           'variables': {
68             'adjusted_library_path':
69                 '<(PRODUCT_DIR)/libWebKitSystemInterfaceLeopardPrivateExtern.a',
70           },
71           'sources': [
72             # An empty source file is needed to convince Xcode to produce
73             # output for this target.  The resulting library won't actually
74             # contain anything.  The library at adjusted_library_path will,
75             # and that library is pushed to dependents of this target below.
76             'mac/Empty.cpp',
77           ],
78           'actions': [
79             {
80               'action_name': 'Adjust Visibility',
81               'inputs': [
82                 'mac/adjust_visibility.sh',
83                 '../../../WebKitLibraries/libWebKitSystemInterfaceLeopard.a',
84               ],
85               'outputs': [
86                 '<(adjusted_library_path)',
87               ],
88               'action': [
89                 '<@(_inputs)',
90                 '<@(_outputs)',
91                 '<(INTERMEDIATE_DIR)/adjust_visibility',  # work directory
92               ],
93             },
94           ],  # actions
95           'link_settings': {
96             'libraries': [
97               '<(adjusted_library_path)',
98             ],
99           },  # link_settings
100         },  # target webkit_system_interface
101       ],  # targets
102     }],  # condition OS == "mac"
103     ['OS!="win" and remove_webcore_debug_symbols==1', {
104       # Remove -g from all targets defined here.
105       'target_defaults': {
106         'cflags!': ['-g'],
107       },
108     }],
109     ['OS=="linux" and target_arch=="arm"', {
110       # Due to a bug in gcc arm, we get warnings about uninitialized timesNewRoman.unstatic.3258
111       # and colorTransparent.unstatic.4879.
112       'target_defaults': {
113         'cflags': ['-Wno-uninitialized'],
114       },
115     }],
116   ],  # conditions
117
118   'variables': {
119     # If set to 1, doesn't compile debug symbols into webcore reducing the
120     # size of the binary and increasing the speed of gdb.  gcc only.
121     'remove_webcore_debug_symbols%': 0,
122
123     # If set to 0, doesn't build SVG support, reducing the size of the
124     # binary and increasing the speed of gdb.
125     'enable_svg%': 1,
126
127     # Use v8 as default JavaScript engine. This makes sure that javascript_engine variable
128     # is set for both inside_chromium_build 0 and 1 cases.
129     'javascript_engine%': 'v8',
130
131     'webcore_include_dirs': [
132       '../',
133       '../accessibility',
134       '../accessibility/chromium',
135       '../bindings',
136       '../bindings/generic',
137       '../bindings/v8',
138       '../bindings/v8/custom',
139       '../bindings/v8/specialization',
140       '../bridge',
141       '../bridge/jni',
142       '../bridge/jni/v8',
143       '../css',
144       '../dom',
145       '../dom/default',
146       '../editing',
147       '../fileapi',
148       '../history',
149       '../html',
150       '../html/canvas',
151       '../html/parser',
152       '../html/shadow',
153       '../inspector',
154       '../loader',
155       '../loader/appcache',
156       '../loader/archive',
157       '../loader/cache',
158       '../loader/icon',
159       '../mathml',
160       '../notifications',
161       '../page',
162       '../page/animation',
163       '../page/chromium',
164       '../platform',
165       '../platform/animation',
166       '../platform/audio',
167       '../platform/audio/chromium',
168       '../platform/chromium',
169       '../platform/graphics',
170       '../platform/graphics/chromium',
171       '../platform/graphics/filters',
172       '../platform/graphics/gpu',
173       '../platform/graphics/opentype',
174       '../platform/graphics/skia',
175       '../platform/graphics/transforms',
176       '../platform/image-decoders',
177       '../platform/image-decoders/bmp',
178       '../platform/image-decoders/gif',
179       '../platform/image-decoders/ico',
180       '../platform/image-decoders/jpeg',
181       '../platform/image-decoders/png',
182       '../platform/image-decoders/skia',
183       '../platform/image-decoders/xbm',
184       '../platform/image-decoders/webp',
185       '../platform/image-encoders/skia',
186       '../platform/mock',
187       '../platform/network',
188       '../platform/network/chromium',
189       '../platform/sql',
190       '../platform/text',
191       '../platform/text/transcoder',
192       '../plugins',
193       '../plugins/chromium',
194       '../rendering',
195       '../rendering/style',
196       '../rendering/svg',
197       '../storage',
198       '../storage/chromium',
199       '../svg',
200       '../svg/animation',
201       '../svg/graphics',
202       '../svg/graphics/filters',
203       '../svg/properties',
204       '../thirdparty/glu',
205       '../webaudio',
206       '../websockets',
207       '../workers',
208       '../xml',
209     ],
210
211     'bindings_idl_files': [
212       '<@(webcore_bindings_idl_files)',
213     ],
214
215     'bindings_idl_files!': [
216       # Custom bindings in bindings/v8/custom exist for these.
217       '../dom/EventListener.idl',
218       '../dom/EventTarget.idl',
219       '../html/VoidCallback.idl',
220
221       # Bindings with custom Objective-C implementations.
222       '../page/AbstractView.idl',
223
224       # These bindings are excluded, as they're only used through inheritance and don't define constants that would need a constructor.
225       '../svg/ElementTimeControl.idl',
226       '../svg/SVGExternalResourcesRequired.idl',
227       '../svg/SVGFilterPrimitiveStandardAttributes.idl',
228       '../svg/SVGFitToViewBox.idl',
229
230       '../svg/SVGLangSpace.idl',
231       '../svg/SVGLocatable.idl',
232       '../svg/SVGStylable.idl',
233       '../svg/SVGTests.idl',
234       '../svg/SVGTransformable.idl',
235       '../svg/SVGViewSpec.idl',
236       '../svg/SVGZoomAndPan.idl',
237
238       # FIXME: I don't know why these are excluded, either.
239       # Someone (me?) should figure it out and add appropriate comments.
240       '../css/CSSUnknownRule.idl',
241     ],
242
243     'conditions': [
244       # TODO(maruel): Move it in its own project or generate it anyway?
245       ['enable_svg!=0', {
246         'bindings_idl_files': [
247           '<@(webcore_svg_bindings_idl_files)',
248         ],
249       }],
250       ['OS=="mac"', {
251         'webcore_include_dirs+': [
252           # platform/graphics/cg and cocoa need to come before
253           # platform/graphics/chromium so that the Mac build picks up the
254           # version of ImageBufferData.h in the cg directory and
255           # FontPlatformData.h in the cocoa directory.  The + prepends this
256           # directory to the list.
257           # FIXME: This shouldn't need to be prepended.
258           '../platform/graphics/cocoa',
259           '../platform/graphics/cg',
260         ],
261         'webcore_include_dirs': [
262           # FIXME: Eliminate dependency on platform/mac and related
263           # directories.
264           # FIXME: Eliminate dependency on platform/graphics/mac and
265           # related directories.
266           # platform/graphics/cg may need to stick around, though.
267           '../platform/audio/mac',
268           '../platform/cocoa',
269           '../platform/graphics/mac',
270           '../platform/mac',
271           '../platform/text/mac',
272         ],
273       }],
274       ['OS=="win"', {
275         'webcore_include_dirs': [
276           '../page/win',
277           '../platform/audio/win',
278           '../platform/graphics/win',
279           '../platform/text/win',
280           '../platform/win',
281         ],
282       },{
283         # enable -Wall and -Werror, just for Mac and Linux builds for now
284         # FIXME: Also enable this for Windows after verifying no warnings
285         'chromium_code': 1,
286       }],
287       ['OS=="win" and buildtype=="Official"', {
288         # On windows official release builds, we try to preserve symbol space.
289         'derived_sources_aggregate_files': [
290           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSourcesAll.cpp',
291         ],
292       },{
293         'derived_sources_aggregate_files': [
294           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources1.cpp',
295           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources2.cpp',
296           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources3.cpp',
297           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources4.cpp',
298           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources5.cpp',
299           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources6.cpp',
300           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources7.cpp',
301           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources8.cpp',
302         ],
303       }],
304     ],
305   },
306   'targets': [
307     {
308       'target_name': 'inspector_protocol_sources',
309       'type': 'none',
310       'actions': [
311         {
312           'action_name': 'generateInspectorProtocolSources',
313           # The second input item will be used as item name in vcproj.
314           # It is not possible to put Inspector.idl there because
315           # all idl files are marking as excluded by gyp generator.
316           'inputs': [
317             '../bindings/scripts/generate-bindings.pl',
318             '../inspector/CodeGeneratorInspector.pm',
319             '../bindings/scripts/CodeGenerator.pm',
320             '../bindings/scripts/IDLParser.pm',
321             '../bindings/scripts/IDLStructure.pm',
322             '../inspector/Inspector.idl',
323           ],
324           'outputs': [
325             '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendDispatcher.cpp',
326             '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js',
327             '<(SHARED_INTERMEDIATE_DIR)/webkit/InspectorBackendDispatcher.h',
328             '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorFrontend.cpp',
329             '<(SHARED_INTERMEDIATE_DIR)/webkit/InspectorFrontend.h',
330           ],
331           'variables': {
332             'generator_include_dirs': [
333             ],
334           },
335           'action': [
336             'python',
337             'scripts/rule_binding.py',
338             '../inspector/Inspector.idl',
339             '<(SHARED_INTERMEDIATE_DIR)/webcore',
340             '<(SHARED_INTERMEDIATE_DIR)/webkit',
341             '--',
342             '<@(_inputs)',
343             '--',
344             '--defines', '<(feature_defines) LANGUAGE_JAVASCRIPT',
345             '--generator', 'Inspector',
346             '<@(generator_include_dirs)'
347           ],
348           'message': 'Generating Inspector protocol sources from Inspector.idl',
349         },
350       ]
351     },
352     {
353       'target_name': 'injected_script_source',
354       'type': 'none',
355       'actions': [
356         {
357           'action_name': 'generateInjectedScriptSource',
358           'inputs': [
359             '../inspector/InjectedScriptSource.js',
360           ],
361           'outputs': [
362             '<(SHARED_INTERMEDIATE_DIR)/webkit/InjectedScriptSource.h',
363           ],
364           'action': [
365             'perl',
366             '../inspector/xxd.pl',
367             'InjectedScriptSource_js',
368             '../inspector/InjectedScriptSource.js',
369             '<(SHARED_INTERMEDIATE_DIR)/webkit/InjectedScriptSource.h'
370           ],
371           'message': 'Generating InjectedScriptSource.h from InjectedScriptSource.js',
372         },
373       ]
374     },
375     {
376       'target_name': 'webcore_bindings_sources',
377       'type': 'none',
378       'hard_dependency': 1,
379       'sources': [
380         # bison rule
381         '../css/CSSGrammar.y',
382         '../xml/XPathGrammar.y',
383
384         # gperf rule
385         '../html/DocTypeStrings.gperf',
386         '../platform/ColorData.gperf',
387
388         # idl rules
389         '<@(bindings_idl_files)',
390       ],
391       'actions': [
392         # Actions to build derived sources.
393         {
394           'action_name': 'generateXMLViewerXSL',
395           'inputs': [
396             '../xml/XMLViewer.xsl',
397           ],
398           'outputs': [
399             '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLViewerXSL.h',
400           ],
401           'action': [
402             'perl',
403             '../inspector/xxd.pl',
404             'XMLViewer_xsl',
405             '<@(_inputs)',
406             '<@(_outputs)'
407           ],
408         },
409         {
410           'action_name': 'HTMLEntityTable',
411           'inputs': [
412             '../html/parser/HTMLEntityNames.in',
413           ],
414           'outputs': [
415             '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityTable.cpp'
416           ],
417           'action': [
418             'python',
419             '../html/parser/create-html-entity-table',
420             '-o',
421             '<@(_outputs)',
422             '<@(_inputs)'
423           ],
424         },
425         {
426           'action_name': 'CSSPropertyNames',
427           'inputs': [
428             '../css/makeprop.pl',
429             '../css/CSSPropertyNames.in',
430           ],
431           'outputs': [
432             '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.cpp',
433             '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.h',
434           ],
435           'action': [
436             'python',
437             'scripts/action_csspropertynames.py',
438             '<@(_outputs)',
439             '--',
440             '<@(_inputs)'
441           ],
442           'conditions': [
443             # TODO(maruel): Move it in its own project or generate it anyway?
444             ['enable_svg!=0', {
445               'inputs': [
446                 '../css/SVGCSSPropertyNames.in',
447               ],
448             }],
449           ],
450         },
451         {
452           'action_name': 'CSSValueKeywords',
453           'inputs': [
454             '../css/makevalues.pl',
455             '../css/CSSValueKeywords.in',
456           ],
457           'outputs': [
458             '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.cpp',
459             '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.h',
460           ],
461           'action': [
462             'python',
463             'scripts/action_cssvaluekeywords.py',
464             '<@(_outputs)',
465             '--',
466             '<@(_inputs)'
467           ],
468           'conditions': [
469             # TODO(maruel): Move it in its own project or generate it anyway?
470             ['enable_svg!=0', {
471               'inputs': [
472                 '../css/SVGCSSValueKeywords.in',
473               ],
474             }],
475           ],
476         },
477         {
478           'action_name': 'HTMLNames',
479           'inputs': [
480             '../dom/make_names.pl',
481             '../html/HTMLTagNames.in',
482             '../html/HTMLAttributeNames.in',
483           ],
484           'outputs': [
485             '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLNames.cpp',
486             '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLNames.h',
487             '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLElementFactory.cpp',
488             '<(SHARED_INTERMEDIATE_DIR)/webkit/V8HTMLElementWrapperFactory.cpp',
489             '<(SHARED_INTERMEDIATE_DIR)/webkit/V8HTMLElementWrapperFactory.h',
490           ],
491           'action': [
492             'python',
493             'scripts/action_makenames.py',
494             '<@(_outputs)',
495             '--',
496             '<@(_inputs)',
497             '--',
498             '--factory',
499             '--wrapperFactoryV8',
500             '--extraDefines', '<(feature_defines)'
501           ],
502         },
503         {
504           'action_name': 'SVGNames',
505           'inputs': [
506             '../dom/make_names.pl',
507             '../svg/svgtags.in',
508             '../svg/svgattrs.in',
509           ],
510           'outputs': [
511             '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.cpp',
512             '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.h',
513             '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGElementFactory.cpp',
514             '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGElementFactory.h',
515             '<(SHARED_INTERMEDIATE_DIR)/webkit/V8SVGElementWrapperFactory.cpp',
516             '<(SHARED_INTERMEDIATE_DIR)/webkit/V8SVGElementWrapperFactory.h',
517           ],
518           'action': [
519             'python',
520             'scripts/action_makenames.py',
521             '<@(_outputs)',
522             '--',
523             '<@(_inputs)',
524             '--',
525             '--factory',
526             '--wrapperFactoryV8',
527             '--extraDefines', '<(feature_defines)'
528           ],
529         },
530         {
531           'action_name': 'MathMLNames',
532           'inputs': [
533             '../dom/make_names.pl',
534             '../mathml/mathtags.in',
535             '../mathml/mathattrs.in',
536           ],
537           'outputs': [
538             '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.cpp',
539             '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.h',
540             '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLElementFactory.cpp',
541             '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLElementFactory.h',
542           ],
543           'action': [
544             'python',
545             'scripts/action_makenames.py',
546             '<@(_outputs)',
547             '--',
548             '<@(_inputs)',
549             '--',
550             '--factory',
551             '--extraDefines', '<(feature_defines)'
552           ],
553         },
554         {
555           'action_name': 'UserAgentStyleSheets',
556           # The .css files are in the same order as ../DerivedSources.make.
557           'inputs': [
558             '../css/make-css-file-arrays.pl',
559             '../css/html.css',
560             '../css/quirks.css',
561             '../css/view-source.css',
562             '../css/themeChromiumLinux.css', # Chromium only.
563             '../css/themeChromiumSkia.css',  # Chromium only.
564             '../css/themeWin.css',
565             '../css/themeWinQuirks.css',
566             '../css/svg.css',
567             # Skip WML.
568             '../css/mathml.css',
569             '../css/mediaControls.css',
570             '../css/mediaControlsChromium.css',
571             '../css/fullscreen.css',
572           ],
573           'outputs': [
574             '<(SHARED_INTERMEDIATE_DIR)/webkit/UserAgentStyleSheets.h',
575             '<(SHARED_INTERMEDIATE_DIR)/webkit/UserAgentStyleSheetsData.cpp',
576           ],
577           'action': [
578             'python',
579             'scripts/action_useragentstylesheets.py',
580             '<@(_outputs)',
581             '--',
582             '<@(_inputs)'
583           ],
584         },
585         {
586           'action_name': 'XLinkNames',
587           'inputs': [
588             '../dom/make_names.pl',
589             '../svg/xlinkattrs.in',
590           ],
591           'outputs': [
592             '<(SHARED_INTERMEDIATE_DIR)/webkit/XLinkNames.cpp',
593             '<(SHARED_INTERMEDIATE_DIR)/webkit/XLinkNames.h',
594           ],
595           'action': [
596             'python',
597             'scripts/action_makenames.py',
598             '<@(_outputs)',
599             '--',
600             '<@(_inputs)',
601             '--',
602             '--extraDefines', '<(feature_defines)'
603           ],
604         },
605         {
606           'action_name': 'XMLNSNames',
607           'inputs': [
608             '../dom/make_names.pl',
609             '../xml/xmlnsattrs.in',
610           ],
611           'outputs': [
612             '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNSNames.cpp',
613             '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNSNames.h',
614           ],
615           'action': [
616             'python',
617             'scripts/action_makenames.py',
618             '<@(_outputs)',
619             '--',
620             '<@(_inputs)',
621             '--',
622             '--extraDefines', '<(feature_defines)'
623           ],
624         },
625         {
626           'action_name': 'XMLNames',
627           'inputs': [
628             '../dom/make_names.pl',
629             '../xml/xmlattrs.in',
630           ],
631           'outputs': [
632             '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.cpp',
633             '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.h',
634           ],
635           'action': [
636             'python',
637             'scripts/action_makenames.py',
638             '<@(_outputs)',
639             '--',
640             '<@(_inputs)',
641             '--',
642             '--extraDefines', '<(feature_defines)'
643           ],
644         },
645         {
646           'action_name': 'tokenizer',
647           'inputs': [
648             '../css/maketokenizer',
649             '../css/tokenizer.flex',
650           ],
651           'outputs': [
652             '<(SHARED_INTERMEDIATE_DIR)/webkit/tokenizer.cpp',
653           ],
654           'action': [
655             'python',
656             'scripts/action_maketokenizer.py',
657             '<@(_outputs)',
658             '--',
659             '<@(_inputs)'
660           ],
661         },
662         {
663           'action_name': 'derived_sources_all_in_one',
664           'variables': {
665             # Write sources into a file, so that the action command line won't
666             # exceed OS limites.
667             'idls_list_temp_file': '<|(idls_list_temp_file.tmp <@(bindings_idl_files))',
668           },
669           'inputs': [
670             'scripts/action_derivedsourcesallinone.py',
671             '<(idls_list_temp_file)',
672             '<!@(cat <(idls_list_temp_file))',
673           ],
674           'outputs': [
675             '<@(derived_sources_aggregate_files)',
676           ],
677           'action': [
678             'python',
679             'scripts/action_derivedsourcesallinone.py',
680             '<(idls_list_temp_file)',
681             '--',
682             '<@(derived_sources_aggregate_files)',
683           ],
684         },
685       ],
686       'rules': [
687         # Rules to build derived sources.
688         {
689           'rule_name': 'bison',
690           'extension': 'y',
691           'outputs': [
692             '<(SHARED_INTERMEDIATE_DIR)/webkit/<(RULE_INPUT_ROOT).cpp',
693             '<(SHARED_INTERMEDIATE_DIR)/webkit/<(RULE_INPUT_ROOT).h'
694           ],
695           'action': [
696             'python',
697             'scripts/rule_bison.py',
698             '<(RULE_INPUT_PATH)',
699             '<(SHARED_INTERMEDIATE_DIR)/webkit'
700           ],
701         },
702         {
703           'rule_name': 'gperf',
704           'extension': 'gperf',
705           #
706           # gperf outputs are generated by WebCore/make-hash-tools.pl
707           #
708           'outputs': [
709             '<(SHARED_INTERMEDIATE_DIR)/webkit/<(RULE_INPUT_ROOT).cpp',
710           ],
711           'inputs': [
712             '../make-hash-tools.pl',
713           ],
714           'action': [
715             'perl',
716             '../make-hash-tools.pl',
717             '<(SHARED_INTERMEDIATE_DIR)/webkit',
718             '<(RULE_INPUT_PATH)',
719           ],
720         },
721         # Rule to build generated JavaScript (V8) bindings from .idl source.
722         {
723           'rule_name': 'binding',
724           'extension': 'idl',
725           'msvs_external_rule': 1,
726           'inputs': [
727             '../bindings/scripts/generate-bindings.pl',
728             '../bindings/scripts/CodeGenerator.pm',
729             '../bindings/scripts/CodeGeneratorV8.pm',
730             '../bindings/scripts/IDLParser.pm',
731             '../bindings/scripts/IDLStructure.pm',
732           ],
733           'outputs': [
734             # FIXME:  The .cpp file should be in webkit/bindings once
735             # we coax GYP into supporting it (see 'action' below).
736             '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/V8<(RULE_INPUT_ROOT).cpp',
737             '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8<(RULE_INPUT_ROOT).h',
738           ],
739           'variables': {
740             'generator_include_dirs': [
741               '--include', '../css',
742               '--include', '../dom',
743               '--include', '../fileapi',
744               '--include', '../html',
745               '--include', '../notifications',
746               '--include', '../page',
747               '--include', '../plugins',
748               '--include', '../storage',
749               '--include', '../svg',
750               '--include', '../webaudio',
751               '--include', '../websockets',
752               '--include', '../workers',
753               '--include', '../xml',
754             ],
755           },
756           # FIXME:  Note that we put the .cpp files in webcore/bindings
757           # but the .h files in webkit/bindings.  This is to work around
758           # the unfortunate fact that GYP strips duplicate arguments
759           # from lists.  When we have a better GYP way to suppress that
760           # behavior, change the output location.
761           'action': [
762             'python',
763             'scripts/rule_binding.py',
764             '<(RULE_INPUT_PATH)',
765             '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings',
766             '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings',
767             '--',
768             '<@(_inputs)',
769             '--',
770             '--defines', '<(feature_defines) LANGUAGE_JAVASCRIPT V8_BINDING',
771             '--generator', 'V8',
772             '<@(generator_include_dirs)'
773           ],
774           'message': 'Generating binding from <(RULE_INPUT_PATH)',
775         },
776       ],
777     },
778     {
779       'target_name': 'webcore_bindings',
780       'type': '<(library)',
781       'hard_dependency': 1,
782       'dependencies': [
783         'webcore_bindings_sources',
784         'inspector_protocol_sources',
785         'injected_script_source',
786         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:yarr',
787         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
788         '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
789         '<(chromium_src_dir)/skia/skia.gyp:skia',
790         '<(chromium_src_dir)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
791         '<(chromium_src_dir)/third_party/libpng/libpng.gyp:libpng',
792         '<(chromium_src_dir)/third_party/libxml/libxml.gyp:libxml',
793         '<(chromium_src_dir)/third_party/libxslt/libxslt.gyp:libxslt',
794         '<(chromium_src_dir)/third_party/libwebp/libwebp.gyp:libwebp',
795         '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
796         '<(chromium_src_dir)/third_party/sqlite/sqlite.gyp:sqlite',
797         '<(libjpeg_gyp_path):libjpeg',
798       ],
799       'include_dirs': [
800         '<(INTERMEDIATE_DIR)',
801         # FIXME:  Remove <(SHARED_INTERMEDIATE_DIR)/webcore when we
802         # can entice gyp into letting us put both the .cpp and .h
803         # files in the same output directory.
804         '<(SHARED_INTERMEDIATE_DIR)/webcore',
805         '<(SHARED_INTERMEDIATE_DIR)/webkit',
806         '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings',
807         '<@(webcore_include_dirs)',
808       ],
809       'direct_dependent_settings': {
810         'include_dirs': [
811           '<(SHARED_INTERMEDIATE_DIR)/webkit',
812           '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings',
813         ],
814       },
815       'sources': [
816         # These files include all the .cpp files generated from the .idl files
817         # in webcore_files.
818         '<@(derived_sources_aggregate_files)',
819
820         # Additional .cpp files for HashTools.h
821         '<(SHARED_INTERMEDIATE_DIR)/webkit/DocTypeStrings.cpp',
822         '<(SHARED_INTERMEDIATE_DIR)/webkit/ColorData.cpp',
823         '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.cpp',
824         '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.cpp',
825
826         # Additional .cpp files from webcore_bindings_sources actions.
827         '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLElementFactory.cpp',
828         '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLNames.cpp',
829         '<(SHARED_INTERMEDIATE_DIR)/webkit/UserAgentStyleSheetsData.cpp',
830         '<(SHARED_INTERMEDIATE_DIR)/webkit/V8HTMLElementWrapperFactory.cpp',
831         '<(SHARED_INTERMEDIATE_DIR)/webkit/XLinkNames.cpp',
832         '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNSNames.cpp',
833         '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.cpp',
834         '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.cpp',
835         '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLElementFactory.cpp',
836         '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.cpp',
837
838         # Generated from HTMLEntityNames.in
839         '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityTable.cpp',
840
841         # Additional .cpp files from the webcore_bindings_sources rules.
842         '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSGrammar.cpp',
843         '<(SHARED_INTERMEDIATE_DIR)/webkit/XPathGrammar.cpp',
844
845         # Additional .cpp files from the webcore_inspector_sources list.
846         '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorFrontend.cpp',
847         '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendDispatcher.cpp',
848       ],
849       'conditions': [
850         ['javascript_engine=="v8"', {
851           'dependencies': [
852             '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
853           ],
854           'conditions': [
855             ['inside_chromium_build==1 and OS=="win" and component=="shared_library"', {
856               'defines': [
857                 'USING_V8_SHARED',
858               ],
859             }],
860           ],
861         }],
862         # TODO(maruel): Move it in its own project or generate it anyway?
863         ['enable_svg!=0', {
864           'sources': [
865             '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGElementFactory.cpp',
866             '<(SHARED_INTERMEDIATE_DIR)/webkit/V8SVGElementWrapperFactory.cpp',
867          ],
868         }],
869         ['OS=="mac"', {
870           'include_dirs': [
871             '../../../WebKitLibraries',
872           ],
873         }],
874         ['OS=="win"', {
875           'dependencies': [
876             '<(chromium_src_dir)/build/win/system.gyp:cygwin'
877           ],
878           'defines': [
879             'WEBCORE_NAVIGATOR_PLATFORM="Win32"',
880             '__PRETTY_FUNCTION__=__FUNCTION__',
881           ],
882           # This is needed because Event.h in this directory is blocked
883           # by a system header on windows.
884           'include_dirs++': ['../dom'],
885           'direct_dependent_settings': {
886             'include_dirs+++': ['../dom'],
887           },
888         }],
889         # FIXME: (kbr) ideally this target should just depend on webcore_prerequisites
890         # to pick up these include directories, but I'm nervous about making that change.
891         ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_MKL=1" in feature_defines', {
892           'include_dirs': [
893             '<(chromium_src_dir)/third_party/mkl/include',
894           ],
895         }],
896         ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_FFTW=1" in feature_defines', {
897           'include_dirs': [
898             '<(chromium_src_dir)/third_party/fftw/api',
899           ],
900         }],
901       ],
902     },
903     {
904       # We'll soon split libwebcore in multiple smaller libraries.
905       # webcore_prerequisites will be the 'base' target of every sub-target.
906       'target_name': 'webcore_prerequisites',
907       'type': 'none',
908       'dependencies': [
909         'webcore_bindings',
910         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:yarr',
911         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
912         '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
913         '<(chromium_src_dir)/skia/skia.gyp:skia',
914         '<(chromium_src_dir)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
915         '<(chromium_src_dir)/third_party/libwebp/libwebp.gyp:libwebp',
916         '<(chromium_src_dir)/third_party/libpng/libpng.gyp:libpng',
917         '<(chromium_src_dir)/third_party/libxml/libxml.gyp:libxml',
918         '<(chromium_src_dir)/third_party/libxslt/libxslt.gyp:libxslt',
919         '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
920         '<(chromium_src_dir)/third_party/ots/ots.gyp:ots',
921         '<(chromium_src_dir)/third_party/sqlite/sqlite.gyp:sqlite',
922         '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:translator_common',
923         '<(libjpeg_gyp_path):libjpeg',
924       ],
925       'export_dependent_settings': [
926         'webcore_bindings',
927         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:yarr',
928         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
929         '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
930         '<(chromium_src_dir)/skia/skia.gyp:skia',
931         '<(chromium_src_dir)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
932         '<(chromium_src_dir)/third_party/libwebp/libwebp.gyp:libwebp',
933         '<(chromium_src_dir)/third_party/libpng/libpng.gyp:libpng',
934         '<(chromium_src_dir)/third_party/libxml/libxml.gyp:libxml',
935         '<(chromium_src_dir)/third_party/libxslt/libxslt.gyp:libxslt',
936         '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
937         '<(chromium_src_dir)/third_party/ots/ots.gyp:ots',
938         '<(chromium_src_dir)/third_party/sqlite/sqlite.gyp:sqlite',
939         '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:translator_common',
940         '<(libjpeg_gyp_path):libjpeg',
941       ],
942       # This is needed for mac because of webkit_system_interface. It'd be nice
943       # if this hard dependency could be split off the rest.
944       'hard_dependency': 1,
945       'direct_dependent_settings': {
946         'defines': [
947           'WEBCORE_NAVIGATOR_VENDOR="Google Inc."',
948         ],
949         'include_dirs': [
950           '<(INTERMEDIATE_DIR)',
951           '<@(webcore_include_dirs)',
952           '<(chromium_src_dir)/gpu',
953           '<(chromium_src_dir)/third_party/angle/include/GLSLANG',
954         ],
955         'mac_framework_dirs': [
956           '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks',
957         ],
958         'msvs_disabled_warnings': [
959           4138, 4244, 4291, 4305, 4344, 4355, 4521, 4099,
960         ],
961         'scons_line_length' : 1,
962         'xcode_settings': {
963           # Some Mac-specific parts of WebKit won't compile without having this
964           # prefix header injected.
965           # FIXME: make this a first-class setting.
966           'GCC_PREFIX_HEADER': '../WebCorePrefix.h',
967         },
968       },
969       'conditions': [
970         ['javascript_engine=="v8"', {
971           'dependencies': [
972             '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
973           ],
974           'export_dependent_settings': [
975             '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
976           ],
977           'conditions': [
978             ['inside_chromium_build==1 and OS=="win" and component=="shared_library"', {
979               'direct_dependent_settings': {
980                 'defines': [
981                   'USING_V8_SHARED',
982                 ],
983               },
984             }],
985           ],
986         }],
987         ['use_accelerated_compositing==1', {
988           'dependencies': [
989             '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib',
990           ],
991           'export_dependent_settings': [
992             '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib',
993           ],
994         }],
995         ['OS=="linux" or OS=="freebsd"', {
996           'dependencies': [
997             '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
998             '<(chromium_src_dir)/build/linux/system.gyp:gtk',
999           ],
1000           'export_dependent_settings': [
1001             '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
1002             '<(chromium_src_dir)/build/linux/system.gyp:gtk',
1003           ],
1004           'direct_dependent_settings': {
1005             'cflags': [
1006               # WebCore does not work with strict aliasing enabled.
1007               # https://bugs.webkit.org/show_bug.cgi?id=25864
1008               '-fno-strict-aliasing',
1009             ],
1010           },
1011         }],
1012         ['OS=="linux"', {
1013           'direct_dependent_settings': {
1014             'defines': [
1015               # Mozilla on Linux effectively uses uname -sm, but when running
1016               # 32-bit x86 code on an x86_64 processor, it uses
1017               # "Linux i686 (x86_64)".  Matching that would require making a
1018               # run-time determination.
1019               'WEBCORE_NAVIGATOR_PLATFORM="Linux i686"',
1020             ],
1021           },
1022         }],
1023         ['OS=="mac"', {
1024           'dependencies': [
1025             'webkit_system_interface',
1026           ],
1027           'export_dependent_settings': [
1028             'webkit_system_interface',
1029           ],
1030           'direct_dependent_settings': {
1031             'defines': [
1032               # Match Safari and Mozilla on Mac x86.
1033               'WEBCORE_NAVIGATOR_PLATFORM="MacIntel"',
1034
1035               # Chromium's version of WebCore includes the following Objective-C
1036               # classes. The system-provided WebCore framework may also provide
1037               # these classes. Because of the nature of Objective-C binding
1038               # (dynamically at runtime), it's possible for the
1039               # Chromium-provided versions to interfere with the system-provided
1040               # versions.  This may happen when a system framework attempts to
1041               # use WebCore.framework, such as when converting an HTML-flavored
1042               # string to an NSAttributedString.  The solution is to force
1043               # Objective-C class names that would conflict to use alternate
1044               # names.
1045               #
1046               # This list will hopefully shrink but may also grow.  Its
1047               # performance is monitored by the "Check Objective-C Rename"
1048               # postbuild step, and any suspicious-looking symbols not handled
1049               # here or whitelisted in that step will cause a build failure.
1050               #
1051               # If this is unhandled, the console will receive log messages
1052               # such as:
1053               # com.google.Chrome[] objc[]: Class ScrollbarPrefsObserver is implemented in both .../Google Chrome.app/Contents/Versions/.../Google Chrome Helper.app/Contents/MacOS/../../../Google Chrome Framework.framework/Google Chrome Framework and /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore. One of the two will be used. Which one is undefined.
1054               'ScrollbarPrefsObserver=ChromiumWebCoreObjCScrollbarPrefsObserver',
1055               'WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver',
1056               'WebFontCache=ChromiumWebCoreObjCWebFontCache',
1057             ],
1058             'include_dirs': [
1059               '../../../WebKitLibraries',
1060             ],
1061             'postbuilds': [
1062               {
1063                 # This step ensures that any Objective-C names that aren't
1064                 # redefined to be "safe" above will cause a build failure.
1065                 'postbuild_name': 'Check Objective-C Rename',
1066                 'variables': {
1067                   'class_whitelist_regex':
1068                       'ChromiumWebCoreObjC|TCMVisibleView|RTCMFlippedView',
1069                   'category_whitelist_regex':
1070                       'TCMInterposing',
1071                 },
1072                 'action': [
1073                   'mac/check_objc_rename.sh',
1074                   '<(class_whitelist_regex)',
1075                   '<(category_whitelist_regex)',
1076                 ],
1077               },
1078             ],
1079           },
1080         }],
1081         ['OS=="win"', {
1082           'dependencies': [
1083             '<(chromium_src_dir)/build/win/system.gyp:cygwin'
1084           ],
1085           'export_dependent_settings': [
1086             '<(chromium_src_dir)/build/win/system.gyp:cygwin'
1087           ],
1088           'direct_dependent_settings': {
1089             'defines': [
1090               # Match Safari and Mozilla on Windows.
1091               'WEBCORE_NAVIGATOR_PLATFORM="Win32"',
1092               '__PRETTY_FUNCTION__=__FUNCTION__',
1093             ],
1094             # This is needed because Event.h in this directory is blocked
1095             # by a system header on windows.
1096             'include_dirs++': ['../dom'],
1097           },
1098         }],
1099         ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_MKL=1" in feature_defines', {
1100           # This directory needs to be on the include path for multiple sub-targets of webcore.
1101           'direct_dependent_settings': {
1102             'include_dirs': [
1103               '<(chromium_src_dir)/third_party/mkl/include',
1104             ],
1105           },
1106         }],
1107         ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_FFTW=1" in feature_defines', {
1108           # This directory needs to be on the include path for multiple sub-targets of webcore.
1109           'direct_dependent_settings': {
1110             'include_dirs': [
1111               '<(chromium_src_dir)/third_party/fftw/api',
1112             ],
1113           },
1114         }],
1115       ],
1116     },
1117     {
1118       'target_name': 'webcore_html',
1119       'type': '<(library)',
1120       'dependencies': [
1121         'webcore_prerequisites',
1122       ],
1123       'sources': [
1124         '<@(webcore_files)',
1125       ],
1126       'sources/': [
1127         # Start by excluding everything then include html files only.
1128         ['exclude', '.*'],
1129         ['include', 'html/'],
1130
1131         ['exclude', 'AllInOne\\.cpp$'],
1132       ],
1133     },
1134     {
1135       'target_name': 'webcore_svg',
1136       'type': '<(library)',
1137       'dependencies': [
1138         'webcore_prerequisites',
1139       ],
1140       'sources': [
1141         '<@(webcore_files)',
1142       ],
1143       'sources/': [
1144         # Start by excluding everything then include svg files only. Note that
1145         # css/SVG* and bindings/v8/custom/V8SVG* are still built in
1146         # webcore_remaining.
1147         ['exclude', '.*'],
1148         ['include', 'svg/'],
1149         ['include', 'css/svg/'],
1150         ['include', 'rendering/style/SVG'],
1151         ['include', 'rendering/RenderSVG'],
1152         ['include', 'rendering/SVG'],
1153
1154         ['exclude', 'AllInOne\\.cpp$'],
1155       ],
1156     },
1157     {
1158       'target_name': 'webcore_platform',
1159       'type': '<(library)',
1160       'dependencies': [
1161         'webcore_prerequisites',
1162       ],
1163       # This is needed for mac because of webkit_system_interface. It'd be nice
1164       # if this hard dependency could be split off the rest.
1165       'hard_dependency': 1,
1166       'sources': [
1167         '<@(webcore_files)',
1168
1169         # For WebCoreSystemInterface, Mac-only.
1170         '../../WebKit/mac/WebCoreSupport/WebSystemInterface.mm',
1171       ],
1172       'sources/': [
1173         ['exclude', '.*'],
1174         ['include', 'platform/'],
1175
1176         # FIXME: Figure out how to store these patterns in a variable.
1177         ['exclude', '(android|brew|cairo|ca|cf|cg|curl|efl|freetype|fftw|gstreamer|gtk|haiku|linux|mac|mkl|opengl|openvg|opentype|pango|posix|qt|soup|svg|symbian|texmap|iphone|win|wince|wx)/'],
1178         ['exclude', '(?<!Chromium)(Android|Cairo|CF|CG|Curl|Gtk|JSC|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|WinCE|Wx)\\.(cpp|mm?)$'],
1179
1180         ['include', 'platform/graphics/opentype/OpenTypeSanitizer\\.cpp$'],
1181
1182         ['exclude', 'platform/LinkHash\\.cpp$'],
1183         ['exclude', 'platform/MIMETypeRegistry\\.cpp$'],
1184         ['exclude', 'platform/Theme\\.cpp$'],
1185         ['exclude', 'platform/graphics/ANGLEWebKitBridge\\.(cpp|h)$'],
1186         ['exclude', 'platform/image-encoders/JPEGImageEncoder\\.(cpp|h)$'],
1187         ['exclude', 'platform/image-encoders/PNGImageEncoder\\.(cpp|h)$'],
1188         ['exclude', 'platform/network/ResourceHandle\\.cpp$'],
1189         ['exclude', 'platform/sql/SQLiteFileSystem\\.cpp$'],
1190         ['exclude', 'platform/text/LocalizedNumberNone\\.cpp$'],
1191         ['exclude', 'platform/text/TextEncodingDetectorNone\\.cpp$'],
1192
1193         ['include', 'thirdparty/glu/libtess/'],
1194       ],
1195       'conditions': [
1196         ['OS=="linux" or OS=="freebsd"', {
1197           'sources/': [
1198             # Cherry-pick files excluded by the broader regular expressions above.
1199             ['include', 'platform/chromium/KeyCodeConversionGtk\\.cpp$'],
1200             ['include', 'platform/graphics/chromium/ComplexTextControllerLinux\\.cpp$'],
1201             ['include', 'platform/graphics/chromium/FontCacheLinux\\.cpp$'],
1202             ['include', 'platform/graphics/chromium/FontLinux\\.cpp$'],
1203             ['include', 'platform/graphics/chromium/FontPlatformDataLinux\\.cpp$'],
1204             ['include', 'platform/graphics/chromium/SimpleFontDataLinux\\.cpp$'],
1205           ],
1206           'dependencies': [
1207             '<(chromium_src_dir)/third_party/harfbuzz/harfbuzz.gyp:harfbuzz',
1208           ],
1209         }],
1210         ['OS=="mac"', {
1211           # Necessary for Mac .mm stuff.
1212           'include_dirs': [
1213             '../../../WebKitLibraries',
1214           ],
1215           'dependencies': [
1216             'webkit_system_interface',
1217           ],
1218           'actions': [
1219             {
1220               # Allow framework-style #include of
1221               # <WebCore/WebCoreSystemInterface.h>.
1222               'action_name': 'WebCoreSystemInterface.h',
1223               'inputs': [
1224                 '../platform/mac/WebCoreSystemInterface.h',
1225               ],
1226               'outputs': [
1227                 '<(INTERMEDIATE_DIR)/WebCore/WebCoreSystemInterface.h',
1228               ],
1229               'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
1230             },
1231           ],
1232           'sources/': [
1233             # Additional files from the WebCore Mac build that are presently
1234             # used in the WebCore Chromium Mac build too.
1235
1236             # The Mac build is USE(CF) but does not use CFNetwork.
1237             ['include', 'CF\\.cpp$'],
1238             ['exclude', 'network/cf/'],
1239
1240             # The Mac build is PLATFORM_CG too.  platform/graphics/cg is the
1241             # only place that CG files we want to build are located, and not
1242             # all of them even have a CG suffix, so just add them by a
1243             # regexp matching their directory.
1244             ['include', 'platform/graphics/cg/[^/]*(?<!Win)?\\.(cpp|mm?)$'],
1245
1246             # Use native Mac font code from WebCore.
1247             ['include', 'platform/(graphics/)?mac/[^/]*Font[^/]*\\.(cpp|mm?)$'],
1248             ['include', 'platform/graphics/mac/ComplexText[^/]*\\.(cpp|h)$'],
1249
1250             # We can use this for the fast Accelerate.framework FFT.
1251             ['include', 'platform/audio/mac/FFTFrameMac\\.cpp$'],
1252
1253             # Cherry-pick some files that can't be included by broader regexps.
1254             # Some of these are used instead of Chromium platform files, see
1255             # the specific exclusions in the "sources!" list below.
1256             ['include', 'rendering/RenderThemeMac\\.mm$'],
1257             ['include', 'platform/graphics/mac/ColorMac\\.mm$'],
1258             ['include', 'platform/graphics/mac/FloatPointMac\\.mm$'],
1259             ['include', 'platform/graphics/mac/FloatRectMac\\.mm$'],
1260             ['include', 'platform/graphics/mac/FloatSizeMac\\.mm$'],
1261             ['include', 'platform/graphics/mac/GlyphPageTreeNodeMac\\.cpp$'],
1262             ['include', 'platform/graphics/mac/GraphicsContextMac\\.mm$'],
1263             ['include', 'platform/graphics/mac/IntRectMac\\.mm$'],
1264             ['include', 'platform/mac/BlockExceptions\\.mm$'],
1265             ['include', 'platform/mac/KillRingMac\\.mm$'],
1266             ['include', 'platform/mac/LocalCurrentGraphicsContext\\.mm$'],
1267             ['include', 'platform/mac/PurgeableBufferMac\\.cpp$'],
1268             ['include', 'platform/mac/WebCoreSystemInterface\\.mm$'],
1269             ['include', 'platform/mac/WebCoreTextRenderer\\.mm$'],
1270             ['include', 'platform/text/mac/ShapeArabic\\.c$'],
1271             ['include', 'platform/text/mac/String(Impl)?Mac\\.mm$'],
1272             # Use USE_NEW_THEME on Mac.
1273             ['include', 'platform/Theme\\.cpp$'],
1274
1275             ['include', 'WebKit/mac/WebCoreSupport/WebSystemInterface\\.mm$'],
1276
1277             # Chromium Mac does not use skia.
1278             ['exclude', 'platform/graphics/skia/[^/]*Skia\\.(cpp|h)$'],
1279
1280             # The Mac uses platform/mac/KillRingMac.mm instead of the dummy
1281             # implementation.
1282             ['exclude', 'platform/KillRingNone\\.cpp$'],
1283
1284             # The Mac currently uses FontCustomPlatformData.cpp from
1285             # platform/graphics/mac, included by regex above, instead.
1286             ['exclude', 'platform/graphics/skia/FontCustomPlatformData\\.cpp$'],
1287
1288             # The Mac currently uses ScrollbarThemeChromiumMac.mm, which is not
1289             # related to ScrollbarThemeChromium.cpp.
1290             ['exclude', 'platform/chromium/ScrollbarThemeChromium\\.cpp$'],
1291
1292             # The Mac currently uses ImageChromiumMac.mm from
1293             # platform/graphics/chromium, included by regex above, instead.
1294             ['exclude', 'platform/graphics/chromium/ImageChromium\\.cpp$'],
1295
1296             # The Mac does not use ImageSourceCG.cpp from platform/graphics/cg
1297             # even though it is included by regex above.
1298             ['exclude', 'platform/graphics/cg/ImageSourceCG\\.cpp$'],
1299             ['exclude', 'platform/graphics/cg/PDFDocumentImage\\.cpp$'],
1300
1301             # ImageDecoderSkia is not used on mac.  ImageDecoderCG is used instead.
1302             ['exclude', 'platform/image-decoders/skia/ImageDecoderSkia\\.cpp$'],
1303             ['include', 'platform/image-decoders/cg/ImageDecoderCG\\.cpp$'],
1304
1305             # Again, Skia is not used on Mac.
1306             ['exclude', 'platform/chromium/DragImageChromiumSkia\\.cpp$'],
1307           ],
1308         }],
1309         ['OS!="linux" and OS!="freebsd"', {
1310           'sources/': [
1311             ['exclude', '(Gtk|Linux)\\.cpp$'],
1312             ['exclude', 'Harfbuzz[^/]+\\.(cpp|h)$'],
1313             ['exclude', 'VDMX[^/]+\\.(cpp|h)$'],
1314           ],
1315         }],
1316         ['OS!="mac"', {
1317           'sources/': [['exclude', 'Mac\\.(cpp|mm?)$']]
1318         }],
1319         ['OS!="win"', {
1320           'sources/': [
1321             ['exclude', 'Win\\.cpp$'],
1322             ['exclude', '/(Windows|Uniscribe)[^/]*\\.cpp$']
1323           ],
1324         }],
1325         ['OS=="win"', {
1326           'sources/': [
1327             ['exclude', 'Posix\\.cpp$'],
1328
1329             # The Chromium Win currently uses GlyphPageTreeNodeChromiumWin.cpp from
1330             # platform/graphics/chromium, included by regex above, instead.
1331             ['exclude', 'platform/graphics/skia/GlyphPageTreeNodeSkia\\.cpp$'],
1332
1333             # SystemInfo.cpp is useful and we don't want to copy it.
1334             ['include', 'platform/win/SystemInfo\\.cpp$'],
1335           ],
1336         }],
1337         ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_MKL=1" in feature_defines', {
1338           'sources/': [
1339             ['include', 'platform/audio/mkl/FFTFrameMKL\\.cpp$'],
1340           ],
1341         }],
1342         ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_FFTW=1" in feature_defines', {
1343           'sources/': [
1344             ['include', 'platform/audio/fftw/FFTFrameFFTW\\.cpp$'],
1345           ],
1346         }],
1347       ],
1348     },
1349     {
1350       'target_name': 'webcore_rendering',
1351       'type': '<(library)',
1352       'dependencies': [
1353         'webcore_prerequisites',
1354       ],
1355       'sources': [
1356         '<@(webcore_files)',
1357       ],
1358       'sources/': [
1359         ['exclude', '.*'],
1360         ['include', 'rendering/'],
1361
1362         # FIXME: Figure out how to store these patterns in a variable.
1363         ['exclude', '(android|brew|cairo|ca|cf|cg|curl|efl|freetype|fftw|gstreamer|gtk|haiku|linux|mac|mkl|opengl|openvg|opentype|pango|posix|qt|soup|svg|symbian|texmap|iphone|win|wince|wx)/'],
1364         ['exclude', '(?<!Chromium)(Android|Cairo|CF|CG|Curl|Gtk|JSC|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|WinCE|Wx)\\.(cpp|mm?)$'],
1365
1366         ['exclude', 'AllInOne\\.cpp$'],
1367
1368         # Exclude most of SVG except css and javascript bindings.
1369         ['exclude', 'rendering/style/SVG[^/]+.(cpp|h)$'],
1370         ['exclude', 'rendering/RenderSVG[^/]+.(cpp|h)$'],
1371         ['exclude', 'rendering/SVG[^/]+.(cpp|h)$'],
1372       ],
1373       'conditions': [
1374         ['OS=="win"', {
1375           'sources/': [
1376             ['exclude', 'Posix\\.cpp$'],
1377           ],
1378         }],
1379         ['OS=="mac"', {
1380           'sources/': [
1381             # RenderThemeChromiumSkia is not used on mac since RenderThemeChromiumMac
1382             # does not reference the Skia code that is used by Windows and Linux.
1383             ['exclude', 'rendering/RenderThemeChromiumSkia\\.cpp$'],
1384           ],
1385         }],
1386         ['(OS=="linux" or OS=="freebsd" or OS=="openbsd") and gcc_version==42', {
1387           # Due to a bug in gcc 4.2.1 (the current version on hardy), we get
1388           # warnings about uninitialized this.
1389           'cflags': ['-Wno-uninitialized'],
1390         }],
1391         ['OS!="linux" and OS!="freebsd"', {
1392           'sources/': [
1393             ['exclude', '(Gtk|Linux)\\.cpp$'],
1394           ],
1395         }],
1396         ['OS!="mac"', {
1397           'sources/': [['exclude', 'Mac\\.(cpp|mm?)$']]
1398         }],
1399         ['OS!="win"', {
1400           'sources/': [
1401             ['exclude', 'Win\\.cpp$'],
1402           ],
1403         }],
1404       ],
1405     },
1406     {
1407       'target_name': 'webcore_remaining',
1408       'type': '<(library)',
1409       'dependencies': [
1410         'webcore_prerequisites',
1411       ],
1412       # This is needed for mac because of webkit_system_interface. It'd be nice
1413       # if this hard dependency could be split off the rest.
1414       'hard_dependency': 1,
1415       'sources': [
1416         '<@(webcore_files)',
1417       ],
1418       'sources/': [
1419         ['exclude', 'html/'],
1420         ['exclude', 'platform/'],
1421         ['exclude', 'rendering/'],
1422
1423         # Exclude most of bindings, except of the V8-related parts.
1424         ['exclude', 'bindings/[^/]+/'],
1425         ['include', 'bindings/generic/'],
1426         ['include', 'bindings/v8/'],
1427
1428         # Exclude most of bridge, except for the V8-related parts.
1429         ['exclude', 'bridge/'],
1430         ['include', 'bridge/jni/'],
1431         ['exclude', 'bridge/jni/[^/]+_jsobject\\.mm$'],
1432         ['exclude', 'bridge/jni/[^/]+_objc\\.mm$'],
1433         ['exclude', 'bridge/jni/jsc/'],
1434
1435         # FIXME: Figure out how to store these patterns in a variable.
1436         ['exclude', '(android|brew|cairo|ca|cf|cg|curl|efl|freetype|fftw|gstreamer|gtk|haiku|linux|mac|mkl|opengl|openvg|opentype|pango|posix|qt|soup|svg|symbian|texmap|iphone|win|wince|wx)/'],
1437         ['exclude', '(?<!Chromium)(Android|Cairo|CF|CG|Curl|Gtk|JSC|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|WinCE|Wx)\\.(cpp|mm?)$'],
1438
1439         ['exclude', 'AllInOne\\.cpp$'],
1440
1441         ['exclude', 'dom/StaticStringList\\.cpp$'],
1442         ['exclude', 'dom/default/PlatformMessagePortChannel\\.(cpp|h)$'],
1443         ['exclude', 'fileapi/LocalFileSystem\\.cpp$'],
1444         ['exclude', 'inspector/InspectorFrontendClientLocal\\.cpp$'],
1445         ['exclude', 'inspector/JavaScript[^/]*\\.cpp$'],
1446         ['exclude', 'loader/UserStyleSheetLoader\\.cpp$'],
1447         ['exclude', 'loader/appcache/'],
1448         ['exclude', 'loader/archive/ArchiveFactory\\.cpp$'],
1449         ['exclude', 'loader/archive/cf/LegacyWebArchiveMac\\.mm$'],
1450         ['exclude', 'loader/archive/cf/LegacyWebArchive\\.cpp$'],
1451         ['exclude', 'loader/icon/IconDatabase\\.cpp$'],
1452         ['exclude', 'plugins/PluginDataNone\\.cpp$'],
1453         ['exclude', 'plugins/PluginDatabase\\.cpp$'],
1454         ['exclude', 'plugins/PluginMainThreadScheduler\\.cpp$'],
1455         ['exclude', 'plugins/PluginPackageNone\\.cpp$'],
1456         ['exclude', 'plugins/PluginPackage\\.cpp$'],
1457         ['exclude', 'plugins/PluginStream\\.cpp$'],
1458         ['exclude', 'plugins/PluginView\\.cpp$'],
1459         ['exclude', 'plugins/npapi\\.cpp$'],
1460         ['exclude', 'storage/DatabaseTrackerClient\\.h$'],
1461         ['exclude', 'storage/DatabaseTracker\\.cpp$'],
1462         ['exclude', 'storage/IDBFactoryBackendInterface\\.cpp$'],
1463         ['exclude', 'storage/IDBKeyPathBackendImpl\\.cpp$'],
1464         ['exclude', 'storage/OriginQuotaManager\\.(cpp|h)$'],
1465         ['exclude', 'storage/OriginUsageRecord\\.(cpp|h)$'],
1466         ['exclude', 'storage/SQLTransactionClient\\.cpp$'],
1467         ['exclude', 'storage/StorageEventDispatcher\\.cpp$'],
1468         ['exclude', 'storage/StorageNamespace\\.cpp$'],
1469         ['exclude', 'workers/DefaultSharedWorkerRepository\\.(cpp|h)$'],
1470
1471         ['include', 'loader/appcache/ApplicationCacheHost\.h$'],
1472         ['include', 'loader/appcache/DOMApplicationCache\.(cpp|h)$'],
1473       ],
1474       'link_settings': {
1475         'mac_bundle_resources': [
1476           '../Resources/aliasCursor.png',
1477           '../Resources/cellCursor.png',
1478           '../Resources/contextMenuCursor.png',
1479           '../Resources/copyCursor.png',
1480           '../Resources/crossHairCursor.png',
1481           '../Resources/eastResizeCursor.png',
1482           '../Resources/eastWestResizeCursor.png',
1483           '../Resources/helpCursor.png',
1484           '../Resources/linkCursor.png',
1485           '../Resources/missingImage.png',
1486           '../Resources/moveCursor.png',
1487           '../Resources/noDropCursor.png',
1488           '../Resources/noneCursor.png',
1489           '../Resources/northEastResizeCursor.png',
1490           '../Resources/northEastSouthWestResizeCursor.png',
1491           '../Resources/northResizeCursor.png',
1492           '../Resources/northSouthResizeCursor.png',
1493           '../Resources/northWestResizeCursor.png',
1494           '../Resources/northWestSouthEastResizeCursor.png',
1495           '../Resources/notAllowedCursor.png',
1496           '../Resources/progressCursor.png',
1497           '../Resources/southEastResizeCursor.png',
1498           '../Resources/southResizeCursor.png',
1499           '../Resources/southWestResizeCursor.png',
1500           '../Resources/verticalTextCursor.png',
1501           '../Resources/waitCursor.png',
1502           '../Resources/westResizeCursor.png',
1503           '../Resources/zoomInCursor.png',
1504           '../Resources/zoomOutCursor.png',
1505         ],
1506       },
1507       'conditions': [
1508         ['OS=="win"', {
1509           'sources/': [
1510             ['exclude', 'Posix\\.cpp$'],
1511             ['include', '/opentype/'],
1512             ['include', '/ScrollAnimatorWin\\.cpp$'],
1513             ['include', '/ScrollAnimatorWin\\.h$'],
1514             ['include', '/SkiaFontWin\\.cpp$'],
1515             ['include', '/TransparencyWin\\.cpp$'],
1516           ],
1517         }],
1518         ['(OS=="linux" or OS=="freebsd" or OS=="openbsd") and gcc_version==42', {
1519           # Due to a bug in gcc 4.2.1 (the current version on hardy), we get
1520           # warnings about uninitialized this.
1521           'cflags': ['-Wno-uninitialized'],
1522         }],
1523         ['OS!="linux" and OS!="freebsd"', {
1524           'sources/': [
1525             ['exclude', '(Gtk|Linux)\\.cpp$'],
1526           ],
1527         }],
1528         ['OS!="mac"', {
1529           'sources/': [['exclude', 'Mac\\.(cpp|mm?)$']]
1530         }],
1531         ['OS!="win"', {
1532           'sources/': [
1533             ['exclude', 'Win\\.cpp$'],
1534             ['exclude', '/(Windows|Uniscribe)[^/]*\\.cpp$']
1535           ],
1536         }],
1537         ['javascript_engine=="v8"', {
1538           'dependencies': [
1539             '<(chromium_src_dir)/v8/src/extensions/experimental/experimental.gyp:i18n_api',
1540           ],
1541         }],
1542       ],
1543     },
1544     {
1545       'target_name': 'webcore',
1546       'type': 'none',
1547       'dependencies': [
1548         'webcore_html',
1549         'webcore_platform',
1550         'webcore_remaining',
1551         'webcore_rendering',
1552         # Exported.
1553         'webcore_bindings',
1554         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
1555         '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
1556         '<(chromium_src_dir)/skia/skia.gyp:skia',
1557         '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
1558       ],
1559       'export_dependent_settings': [
1560         'webcore_bindings',
1561         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
1562         '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
1563         '<(chromium_src_dir)/skia/skia.gyp:skia',
1564         '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
1565       ],
1566       'direct_dependent_settings': {
1567         'include_dirs': [
1568           '<@(webcore_include_dirs)',
1569         ],
1570         'mac_framework_dirs': [
1571           '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks',
1572           '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework',
1573           '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
1574           '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
1575           '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
1576           '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
1577           '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework',
1578           '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
1579         ],
1580       },
1581       'conditions': [
1582         ['javascript_engine=="v8"', {
1583           'dependencies': [
1584             '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
1585           ],
1586           'export_dependent_settings': [
1587             '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
1588           ],
1589         }],
1590         ['OS=="mac"', {
1591           'direct_dependent_settings': {
1592             'include_dirs': [
1593               '../../../WebKitLibraries',
1594               '../../WebKit/mac/WebCoreSupport',
1595             ],
1596           },
1597         }],
1598         ['OS=="win"', {
1599           'direct_dependent_settings': {
1600             'include_dirs+++': ['../dom'],
1601           },
1602         }],
1603         ['OS=="win" and "WTF_USE_WEBAUDIO_MKL=1" in feature_defines', {
1604           # FIXME: (kbr) figure out how to make these dependencies
1605           # work in a cross-platform way. Attempts to use
1606           # "link_settings" and "libraries" in conjunction with the
1607           # msvs-specific settings didn't work so far.
1608           'all_dependent_settings': {
1609             'msvs_settings': {
1610               'VCLinkerTool': {
1611                 'AdditionalLibraryDirectories': [
1612                   # This is a hack to make this directory correct
1613                   # relative to targets like chrome_dll. Should use
1614                   # <(chromium_src_dir).
1615                   '../third_party/mkl/lib/win/ia32',
1616                 ],
1617                 'AdditionalDependencies': [
1618                   'mkl_intel_c.lib',
1619                   'mkl_sequential.lib',
1620                   'mkl_core.lib',
1621                 ],
1622               },
1623             },
1624           },
1625         }],
1626         ['OS=="linux" and "WTF_USE_WEBAUDIO_FFTW=1" in feature_defines', {
1627           # FIXME: (kbr) figure out how to make these dependencies
1628           # work in a cross-platform way. Attempts to use
1629           # "link_settings" and "libraries" in conjunction with the
1630           # msvs-specific settings didn't work so far.
1631           'all_dependent_settings': {
1632             'ldflags': [
1633               # FIXME: (kbr) build the FFTW into PRODUCT_DIR using GYP.
1634               '-Lthird_party/fftw/.libs',
1635             ],
1636             'link_settings': {
1637               'libraries': [
1638                 '-lfftw3f'
1639               ],
1640             },
1641           },
1642         }],
1643         ['enable_svg!=0', {
1644           'dependencies': [
1645             'webcore_svg',
1646           ],
1647         }],
1648       ],
1649     },
1650   ],  # targets
1651 }