2011-05-24 Jay Civelli <jcivelli@chromium.org>
[WebKit-https.git] / Source / WebCore / WebCore.gyp / WebCore.gyp
index b800cf3..013f044 100644 (file)
@@ -32,7 +32,7 @@
   'includes': [
     # FIXME: Sense whether upstream or downstream build, and
     # include the right features.gypi
-    '../../../WebKit/chromium/features.gypi',
+    '../../WebKit/chromium/features.gypi',
     '../WebCore.gypi',
   ],
   # Location of the chromium src directory.
     ['inside_chromium_build==0', {
       # Webkit is being built outside of the full chromium project.
       'variables': {
-        'chromium_src_dir': '../../../WebKit/chromium',
-        'libjpeg_gyp_path': '<(chromium_src_dir)/third_party/libjpeg/libjpeg.gyp',
+        'chromium_src_dir': '../../WebKit/chromium',
+        'libjpeg_gyp_path': '<(chromium_src_dir)/third_party/libjpeg_turbo/libjpeg.gyp',
       },
     },{
       # WebKit is checked out in src/chromium/third_party/WebKit
-      'variables': {'chromium_src_dir': '../../../../..'},
+      'variables': {
+        'chromium_src_dir': '../../../../..',
+      },
     }],
     ['OS == "mac"', {
       'targets': [
         'cflags!': ['-g'],
       },
     }],
+    ['OS=="linux" and target_arch=="arm"', {
+      # Due to a bug in gcc arm, we get warnings about uninitialized timesNewRoman.unstatic.3258
+      # and colorTransparent.unstatic.4879.
+      'target_defaults': {
+        'cflags': ['-Wno-uninitialized'],
+      },
+    }],
   ],  # conditions
 
   'variables': {
     # binary and increasing the speed of gdb.
     'enable_svg%': 1,
 
+    # Use v8 as default JavaScript engine. This makes sure that javascript_engine variable
+    # is set for both inside_chromium_build 0 and 1 cases.
+    'javascript_engine%': 'v8',
+
     'webcore_include_dirs': [
       '../',
+      '../..',
       '../accessibility',
       '../accessibility/chromium',
       '../bindings',
       '../bindings/v8',
       '../bindings/v8/custom',
       '../bindings/v8/specialization',
+      '../bridge',
+      '../bridge/jni',
+      '../bridge/jni/v8',
       '../css',
       '../dom',
       '../dom/default',
       '../loader',
       '../loader/appcache',
       '../loader/archive',
+      '../loader/archive/cf',
+      '../loader/archive/mhtml',
       '../loader/cache',
       '../loader/icon',
       '../mathml',
       '../platform/graphics',
       '../platform/graphics/chromium',
       '../platform/graphics/filters',
+      '../platform/graphics/filters/arm',
       '../platform/graphics/gpu',
       '../platform/graphics/opentype',
       '../platform/graphics/skia',
       '../platform/image-decoders/xbm',
       '../platform/image-decoders/webp',
       '../platform/image-encoders/skia',
+      '../platform/leveldb',
       '../platform/mock',
       '../platform/network',
       '../platform/network/chromium',
       '../svg/graphics',
       '../svg/graphics/filters',
       '../svg/properties',
+      '../../ThirdParty/glu',
       '../webaudio',
       '../websockets',
       '../workers',
           # FIXME: Eliminate dependency on platform/graphics/mac and
           # related directories.
           # platform/graphics/cg may need to stick around, though.
-          '../loader/archive/cf',
           '../platform/audio/mac',
+          '../platform/cocoa',
           '../platform/graphics/mac',
           '../platform/mac',
           '../platform/text/mac',
         ],
       },{
         'derived_sources_aggregate_files': [
-          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources1.cpp',
-          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources2.cpp',
-          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources3.cpp',
-          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources4.cpp',
-          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources5.cpp',
-          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources6.cpp',
-          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources7.cpp',
-          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources8.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources01.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources02.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources03.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources04.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources05.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources06.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources07.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources08.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources09.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources10.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources11.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources12.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources13.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources14.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources15.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources16.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources17.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources18.cpp',
+          '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSources19.cpp',
         ],
       }],
     ],
   },
   'targets': [
     {
+      'target_name': 'inspector_idl',
+      'type': 'none',
+      'actions': [
+        {
+          'action_name': 'generateInspectorProtocolIDL',
+          'inputs': [
+            '../inspector/generate-inspector-idl',
+            '../inspector/Inspector.json',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/webcore/Inspector.idl',
+          ],
+          'variables': {
+            'generator_include_dirs': [
+            ],
+          },
+          'action': [
+            'python',
+            '../inspector/generate-inspector-idl',
+            '-o',
+            '<@(_outputs)',
+            '<@(_inputs)'
+          ],
+          'message': 'Generating Inspector protocol sources from Inspector.idl',
+        },
+      ]
+    },
+    {
       'target_name': 'inspector_protocol_sources',
       'type': 'none',
+      'dependencies': [
+        'inspector_idl'
+      ],
       'actions': [
         {
           'action_name': 'generateInspectorProtocolSources',
             '../bindings/scripts/CodeGenerator.pm',
             '../bindings/scripts/IDLParser.pm',
             '../bindings/scripts/IDLStructure.pm',
-            '../inspector/Inspector.idl',
+            '<(SHARED_INTERMEDIATE_DIR)/webcore/Inspector.idl',
           ],
           'outputs': [
             '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendDispatcher.cpp',
           'action': [
             'python',
             'scripts/rule_binding.py',
-            '../inspector/Inspector.idl',
+            '<(SHARED_INTERMEDIATE_DIR)/webcore/Inspector.idl',
             '<(SHARED_INTERMEDIATE_DIR)/webcore',
             '<(SHARED_INTERMEDIATE_DIR)/webkit',
             '--',
       ]
     },
     {
+      'target_name': 'injected_script_source',
+      'type': 'none',
+      'actions': [
+        {
+          'action_name': 'generateInjectedScriptSource',
+          'inputs': [
+            '../inspector/InjectedScriptSource.js',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/webkit/InjectedScriptSource.h',
+          ],
+          'action': [
+            'perl',
+            '../inspector/xxd.pl',
+            'InjectedScriptSource_js',
+            '<@(_inputs)',
+            '<@(_outputs)'
+          ],
+          'message': 'Generating InjectedScriptSource.h from InjectedScriptSource.js',
+        },
+      ]
+    },
+    {
+      'target_name': 'debugger_script_source',
+      'type': 'none',
+      'actions': [
+        {
+          'action_name': 'generateDebuggerScriptSource',
+          'inputs': [
+            '../bindings/v8/DebuggerScript.js',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/webkit/DebuggerScriptSource.h',
+          ],
+          'action': [
+            'perl',
+            '../inspector/xxd.pl',
+            'DebuggerScriptSource_js',
+            '<@(_inputs)',
+            '<@(_outputs)'
+          ],
+          'message': 'Generating DebuggerScriptSource.h from DebuggerScript.js',
+        },
+      ]
+    },
+    {
       'target_name': 'webcore_bindings_sources',
       'type': 'none',
       'hard_dependency': 1,
       'actions': [
         # Actions to build derived sources.
         {
+          'action_name': 'generateXMLViewerCSS',
+          'inputs': [
+            '../xml/XMLViewer.css',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLViewerCSS.h',
+          ],
+          'action': [
+            'perl',
+            '../inspector/xxd.pl',
+            'XMLViewer_css',
+            '<@(_inputs)',
+            '<@(_outputs)'
+          ],
+        },
+        {
+          'action_name': 'generateXMLViewerJS',
+          'inputs': [
+            '../xml/XMLViewer.js',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLViewerJS.h',
+          ],
+          'action': [
+            'perl',
+            '../inspector/xxd.pl',
+            'XMLViewer_js',
+            '<@(_inputs)',
+            '<@(_outputs)'
+          ],
+        },
+        {
           'action_name': 'HTMLEntityTable',
           'inputs': [
             '../html/parser/HTMLEntityNames.in',
         },
         {
           'action_name': 'UserAgentStyleSheets',
+          'variables': {
+            'scripts': [
+              '../css/make-css-file-arrays.pl',
+              '../bindings/scripts/preprocessor.pm',
+            ],
+            # The .css files are in the same order as ../DerivedSources.make.
+            'stylesheets': [
+              '../css/html.css',
+              '../css/quirks.css',
+              '../css/view-source.css',
+              '../css/themeChromiumLinux.css', # Chromium only.
+              '../css/themeChromiumSkia.css',  # Chromium only.
+              '../css/themeWin.css',
+              '../css/themeWinQuirks.css',
+              '../css/svg.css',
+              '../css/mathml.css',
+              '../css/mediaControls.css',
+              '../css/mediaControlsChromium.css',
+              '../css/fullscreen.css',
+              # Skip fullscreenQuickTime.
+            ],
+          },
           'inputs': [
-            '../css/make-css-file-arrays.pl',
-            '../css/html.css',
-            '../css/quirks.css',
-            '../css/view-source.css',
-            '../css/themeChromiumLinux.css',
-            '../css/themeChromiumSkia.css',
-            '../css/themeWin.css',
-            '../css/themeWinQuirks.css',
-            '../css/svg.css',
-            '../css/mathml.css',
-            '../css/mediaControls.css',
-            '../css/mediaControlsChromium.css',
+            '<@(scripts)',
+            '<@(stylesheets)'
           ],
           'outputs': [
             '<(SHARED_INTERMEDIATE_DIR)/webkit/UserAgentStyleSheets.h',
             'python',
             'scripts/action_useragentstylesheets.py',
             '<@(_outputs)',
+            '<@(stylesheets)',
             '--',
-            '<@(_inputs)'
+            '<@(scripts)',
+            '--',
+            '--defines', '<(feature_defines)',
           ],
         },
         {
             '../bindings/scripts/CodeGeneratorV8.pm',
             '../bindings/scripts/IDLParser.pm',
             '../bindings/scripts/IDLStructure.pm',
+            '../bindings/scripts/preprocessor.pm',
           ],
           'outputs': [
             # FIXME:  The .cpp file should be in webkit/bindings once
     },
     {
       'target_name': 'webcore_bindings',
-      'type': '<(library)',
+      'type': 'static_library',
       'hard_dependency': 1,
       'dependencies': [
         'webcore_bindings_sources',
         'inspector_protocol_sources',
-        '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:pcre',
+        'injected_script_source',
+        'debugger_script_source',
+        '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:yarr',
         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
         '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
         '<(chromium_src_dir)/skia/skia.gyp:skia',
             'include_dirs+++': ['../dom'],
           },
         }],
-        # FIXME: (kbr) ideally this target should just depend on webcore_prerequisites
-        # to pick up this include directory, but I'm nervous about making that change.
-        ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_MKL=1" in feature_defines', {
+        ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_FFTW=1" in feature_defines', {
           'include_dirs': [
-            '<(chromium_src_dir)/third_party/mkl/include',
+            '<(chromium_src_dir)/third_party/fftw/api',
           ],
         }],
       ],
       'type': 'none',
       'dependencies': [
         'webcore_bindings',
-        '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:pcre',
+        '../../ThirdParty/glu/glu.gyp:libtess',
+        '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:yarr',
         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
         '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
         '<(chromium_src_dir)/skia/skia.gyp:skia',
       ],
       'export_dependent_settings': [
         'webcore_bindings',
-        '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:pcre',
+        '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:yarr',
         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
         '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
         '<(chromium_src_dir)/skia/skia.gyp:skia',
           ],
           'conditions': [
             ['inside_chromium_build==1 and OS=="win" and component=="shared_library"', {
-              'defines': [
-                'USING_V8_SHARED',
-              ],
+              'direct_dependent_settings': {
+                'defines': [
+                  'USING_V8_SHARED',
+                ],
+              },
             }],
           ],
         }],
             '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib',
           ],
         }],
-        ['OS=="linux" or OS=="freebsd"', {
+        ['toolkit_uses_gtk == 1', {
           'dependencies': [
             '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
             '<(chromium_src_dir)/build/linux/system.gyp:gtk',
             '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
             '<(chromium_src_dir)/build/linux/system.gyp:gtk',
           ],
-          'cflags': [
-            # WebCore does not work with strict aliasing enabled.
-            # https://bugs.webkit.org/show_bug.cgi?id=25864
-            '-fno-strict-aliasing',
-          ],
+          'direct_dependent_settings': {
+            'cflags': [
+              # WebCore does not work with strict aliasing enabled.
+              # https://bugs.webkit.org/show_bug.cgi?id=25864
+              '-fno-strict-aliasing',
+            ],
+          },
         }],
         ['OS=="linux"', {
-          'defines': [
-            # Mozilla on Linux effectively uses uname -sm, but when running
-            # 32-bit x86 code on an x86_64 processor, it uses
-            # "Linux i686 (x86_64)".  Matching that would require making a
-            # run-time determination.
-            'WEBCORE_NAVIGATOR_PLATFORM="Linux i686"',
-          ],
+          'direct_dependent_settings': {
+            'defines': [
+              # Mozilla on Linux effectively uses uname -sm, but when running
+              # 32-bit x86 code on an x86_64 processor, it uses
+              # "Linux i686 (x86_64)".  Matching that would require making a
+              # run-time determination.
+              'WEBCORE_NAVIGATOR_PLATFORM="Linux i686"',
+            ],
+          },
         }],
         ['OS=="mac"', {
           'dependencies': [
           'export_dependent_settings': [
             'webkit_system_interface',
           ],
-          'defines': [
-            # Match Safari and Mozilla on Mac x86.
-            'WEBCORE_NAVIGATOR_PLATFORM="MacIntel"',
-
-            # Chromium's version of WebCore includes the following Objective-C
-            # classes. The system-provided WebCore framework may also provide
-            # these classes. Because of the nature of Objective-C binding
-            # (dynamically at runtime), it's possible for the Chromium-provided
-            # versions to interfere with the system-provided versions.  This may
-            # happen when a system framework attempts to use WebCore.framework,
-            # such as when converting an HTML-flavored string to an
-            # NSAttributedString.  The solution is to force Objective-C class
-            # names that would conflict to use alternate names.
+          'direct_dependent_settings': {
+            'defines': [
+              # Match Safari and Mozilla on Mac x86.
+              'WEBCORE_NAVIGATOR_PLATFORM="MacIntel"',
 
-            # FIXME: This list will hopefully shrink but may also grow.
-            # Periodically run:
-            # nm libwebcore.a | grep -E '[atsATS] ([+-]\[|\.objc_class_name)'
-            # and make sure that everything listed there has the alternate
-            # ChromiumWebCoreObjC name, and that nothing extraneous is listed
-            # here. If all Objective-C can be eliminated from Chromium's WebCore
-            # library, these defines should be removed entirely.
-            'ScrollbarPrefsObserver=ChromiumWebCoreObjCScrollbarPrefsObserver',
-            'WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver',
-            'WebFontCache=ChromiumWebCoreObjCWebFontCache',
-          ],
-          'include_dirs': [
-            '../../../WebKitLibraries',
-          ],
+              # Chromium's version of WebCore includes the following Objective-C
+              # classes. The system-provided WebCore framework may also provide
+              # these classes. Because of the nature of Objective-C binding
+              # (dynamically at runtime), it's possible for the
+              # Chromium-provided versions to interfere with the system-provided
+              # versions.  This may happen when a system framework attempts to
+              # use WebCore.framework, such as when converting an HTML-flavored
+              # string to an NSAttributedString.  The solution is to force
+              # Objective-C class names that would conflict to use alternate
+              # names.
+              #
+              # This list will hopefully shrink but may also grow.  Its
+              # performance is monitored by the "Check Objective-C Rename"
+              # postbuild step, and any suspicious-looking symbols not handled
+              # here or whitelisted in that step will cause a build failure.
+              #
+              # If this is unhandled, the console will receive log messages
+              # such as:
+              # 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.
+              'ScrollbarPrefsObserver=ChromiumWebCoreObjCScrollbarPrefsObserver',
+              'WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver',
+              'WebFontCache=ChromiumWebCoreObjCWebFontCache',
+            ],
+            'include_dirs': [
+              '../../../WebKitLibraries',
+            ],
+            'postbuilds': [
+              {
+                # This step ensures that any Objective-C names that aren't
+                # redefined to be "safe" above will cause a build failure.
+                'postbuild_name': 'Check Objective-C Rename',
+                'variables': {
+                  'class_whitelist_regex':
+                      'ChromiumWebCoreObjC|TCMVisibleView|RTCMFlippedView',
+                  'category_whitelist_regex':
+                      'TCMInterposing',
+                },
+                'action': [
+                  'mac/check_objc_rename.sh',
+                  '<(class_whitelist_regex)',
+                  '<(category_whitelist_regex)',
+                ],
+              },
+            ],
+          },
         }],
         ['OS=="win"', {
           'dependencies': [
           'export_dependent_settings': [
             '<(chromium_src_dir)/build/win/system.gyp:cygwin'
           ],
-          'defines': [
-            # Match Safari and Mozilla on Windows.
-            'WEBCORE_NAVIGATOR_PLATFORM="Win32"',
-            '__PRETTY_FUNCTION__=__FUNCTION__',
-          ],
-          # This is needed because Event.h in this directory is blocked
-          # by a system header on windows.
-          'include_dirs++': ['../dom'],
+          'direct_dependent_settings': {
+            'defines': [
+              # Match Safari and Mozilla on Windows.
+              'WEBCORE_NAVIGATOR_PLATFORM="Win32"',
+              '__PRETTY_FUNCTION__=__FUNCTION__',
+            ],
+            # This is needed because Event.h in this directory is blocked
+            # by a system header on windows.
+            'include_dirs++': ['../dom'],
+          },
         }],
-        ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_MKL=1" in feature_defines', {
+        ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_FFTW=1" in feature_defines', {
           # This directory needs to be on the include path for multiple sub-targets of webcore.
           'direct_dependent_settings': {
             'include_dirs': [
-              '<(chromium_src_dir)/third_party/mkl/include',
+              '<(chromium_src_dir)/third_party/fftw/api',
             ],
           },
         }],
+        ['(OS=="mac" or OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_FFMPEG=1" in feature_defines', {
+          # This directory needs to be on the include path for multiple sub-targets of webcore.
+          'direct_dependent_settings': {
+            'include_dirs': [
+              '<(chromium_src_dir)/third_party/ffmpeg/patched-ffmpeg-mt',
+            ],
+          },
+          'dependencies': [
+            '<(chromium_src_dir)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
+          ],
+        }],
+        ['"ENABLE_LEVELDB=1" in feature_defines', {
+          'dependencies': [
+            '<(chromium_src_dir)/third_party/leveldb/leveldb.gyp:leveldb',
+          ],
+          'export_dependent_settings': [
+            '<(chromium_src_dir)/third_party/leveldb/leveldb.gyp:leveldb',
+          ],
+        }],
       ],
     },
     {
       'target_name': 'webcore_html',
-      'type': '<(library)',
+      'type': 'static_library',
       'dependencies': [
         'webcore_prerequisites',
       ],
       'sources': [
+        '<@(webcore_privateheader_files)',
         '<@(webcore_files)',
       ],
       'sources/': [
         # Start by excluding everything then include html files only.
         ['exclude', '.*'],
         ['include', 'html/'],
+
+        ['exclude', 'AllInOne\\.cpp$'],
       ],
     },
     {
       'target_name': 'webcore_svg',
-      'type': '<(library)',
+      'type': 'static_library',
       'dependencies': [
         'webcore_prerequisites',
       ],
       'sources': [
+        '<@(webcore_privateheader_files)',
         '<@(webcore_files)',
       ],
       'sources/': [
         ['include', 'rendering/style/SVG'],
         ['include', 'rendering/RenderSVG'],
         ['include', 'rendering/SVG'],
-        ['exclude', 'svg/SVGAllInOne\\.cpp$'],
+
+        ['exclude', 'AllInOne\\.cpp$'],
       ],
     },
     {
       'target_name': 'webcore_platform',
-      'type': '<(library)',
+      'type': 'static_library',
       'dependencies': [
         'webcore_prerequisites',
       ],
       # if this hard dependency could be split off the rest.
       'hard_dependency': 1,
       'sources': [
+        '<@(webcore_privateheader_files)',
         '<@(webcore_files)',
 
         # For WebCoreSystemInterface, Mac-only.
-        '../../../WebKit/mac/WebCoreSupport/WebSystemInterface.mm',
+        '../../WebKit/mac/WebCoreSupport/WebSystemInterface.mm',
       ],
       'sources/': [
-        # Start by excluding everything then include platform files only.
         ['exclude', '.*'],
         ['include', 'platform/'],
 
-        # Exclude things that don't apply to the Chromium platform on the basis
-        # of their enclosing directories and tags at the ends of their
-        # filenames.
-        ['exclude', '(android|cairo|cf|cg|curl|gtk|haiku|linux|mac|mkl|opentype|posix|qt|soup|svg|symbian|win|wx)/'],
-        ['exclude', '(?<!Chromium)(Android|Cairo|CF|CG|Curl|Gtk|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|Wx)\\.(cpp|mm?)$'],
-
-        # A few things can't be excluded by patterns.  List them individually.
+        # FIXME: Figure out how to store these patterns in a variable.
+        ['exclude', '(android|brew|cairo|ca|cf|cg|curl|efl|freetype|gstreamer|gtk|haiku|linux|mac|opengl|openvg|opentype|pango|posix|qt|soup|svg|symbian|texmap|iphone|win|wince|wx)/'],
+        ['exclude', '(?<!Chromium)(Android|Cairo|CF|CG|Curl|Gtk|JSC|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|WinCE|Wx)\\.(cpp|mm?)$'],
 
         ['include', 'platform/graphics/opentype/OpenTypeSanitizer\\.cpp$'],
 
-        # Exclude some DB-related files.
-        ['exclude', 'platform/sql/SQLiteFileSystem\\.cpp$'],
-
-        # Use platform/KURLGoogle.cpp instead.
-        ['exclude', 'platform/KURL\\.cpp$'],
-
-        # Use platform/MIMETypeRegistryChromium.cpp instead.
+        ['exclude', 'platform/LinkHash\\.cpp$'],
         ['exclude', 'platform/MIMETypeRegistry\\.cpp$'],
-
-        # Theme.cpp is used only if we're using USE_NEW_THEME. We are not for
-        # Windows and Linux. We manually include Theme.cpp for the Mac below.
         ['exclude', 'platform/Theme\\.cpp$'],
-
-        # Use LinkHashChromium.cpp instead
-        ['exclude', 'platform/LinkHash\\.cpp$'],
+        ['exclude', 'platform/graphics/ANGLEWebKitBridge\\.(cpp|h)$'],
+        ['exclude', 'platform/image-encoders/JPEGImageEncoder\\.(cpp|h)$'],
+        ['exclude', 'platform/image-encoders/PNGImageEncoder\\.(cpp|h)$'],
+        ['exclude', 'platform/network/ResourceHandle\\.cpp$'],
+        ['exclude', 'platform/sql/SQLiteFileSystem\\.cpp$'],
+        ['exclude', 'platform/text/LocalizedNumberNone\\.cpp$'],
+        ['exclude', 'platform/text/TextEncodingDetectorNone\\.cpp$'],
       ],
       'conditions': [
-        ['OS=="linux" or OS=="freebsd"', {
+        ['toolkit_uses_gtk == 1', {
           'sources/': [
             # Cherry-pick files excluded by the broader regular expressions above.
             ['include', 'platform/chromium/KeyCodeConversionGtk\\.cpp$'],
             # Additional files from the WebCore Mac build that are presently
             # used in the WebCore Chromium Mac build too.
 
-            # The Mac build is PLATFORM_CF but does not use CFNetwork.
+            # The Mac build is USE(CF) but does not use CFNetwork.
             ['include', 'CF\\.cpp$'],
             ['exclude', 'network/cf/'],
 
             ['include', 'platform/(graphics/)?mac/[^/]*Font[^/]*\\.(cpp|mm?)$'],
             ['include', 'platform/graphics/mac/ComplexText[^/]*\\.(cpp|h)$'],
 
-            # AudioBusMac is necessary for web audio API bringup on Chrome.
-            # It will later be replaced with chromium-specific code.
-            ['include', 'platform/audio/mac/AudioBusMac\\.mm$'],
+            # We can use this for the fast Accelerate.framework FFT.
             ['include', 'platform/audio/mac/FFTFrameMac\\.cpp$'],
 
             # Cherry-pick some files that can't be included by broader regexps.
             # Some of these are used instead of Chromium platform files, see
             # the specific exclusions in the "sources!" list below.
             ['include', 'rendering/RenderThemeMac\\.mm$'],
-            ['include', 'loader/archive/cf/LegacyWebArchive\\.cpp$'],
             ['include', 'platform/graphics/mac/ColorMac\\.mm$'],
             ['include', 'platform/graphics/mac/FloatPointMac\\.mm$'],
             ['include', 'platform/graphics/mac/FloatRectMac\\.mm$'],
             # Again, Skia is not used on Mac.
             ['exclude', 'platform/chromium/DragImageChromiumSkia\\.cpp$'],
           ],
+        },{ # OS!="mac"
+          'sources/': [
+            # FIXME: We will eventually compile this too, but for now it's
+            # only used on mac.
+            ['exclude', 'platform/graphics/FontPlatformData\\.cpp$']
+          ],
         }],
-        ['OS!="linux" and OS!="freebsd"', {
+        ['toolkit_uses_gtk == 0', {
           'sources/': [
             ['exclude', '(Gtk|Linux)\\.cpp$'],
             ['exclude', 'Harfbuzz[^/]+\\.(cpp|h)$'],
 
             # The Chromium Win currently uses GlyphPageTreeNodeChromiumWin.cpp from
             # platform/graphics/chromium, included by regex above, instead.
-            ['exclude', 'platform/graphics/skia/GlyphPageTreeNodeSkia\\.cpp$']
+            ['exclude', 'platform/graphics/skia/GlyphPageTreeNodeSkia\\.cpp$'],
+
+            # SystemInfo.cpp is useful and we don't want to copy it.
+            ['include', 'platform/win/SystemInfo\\.cpp$'],
+          ],
+        }],
+      ],
+    },
+    {
+      'target_name': 'webcore_rendering',
+      'type': 'static_library',
+      'dependencies': [
+        'webcore_prerequisites',
+      ],
+      'sources': [
+        '<@(webcore_privateheader_files)',
+        '<@(webcore_files)',
+      ],
+      'sources/': [
+        ['exclude', '.*'],
+        ['include', 'rendering/'],
+
+        # FIXME: Figure out how to store these patterns in a variable.
+        ['exclude', '(android|brew|cairo|ca|cf|cg|curl|efl|freetype|gstreamer|gtk|haiku|linux|mac|opengl|openvg|opentype|pango|posix|qt|soup|svg|symbian|texmap|iphone|win|wince|wx)/'],
+        ['exclude', '(?<!Chromium)(Android|Cairo|CF|CG|Curl|Gtk|JSC|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|WinCE|Wx)\\.(cpp|mm?)$'],
+
+        ['exclude', 'AllInOne\\.cpp$'],
+
+        # Exclude most of SVG except css and javascript bindings.
+        ['exclude', 'rendering/style/SVG[^/]+.(cpp|h)$'],
+        ['exclude', 'rendering/RenderSVG[^/]+.(cpp|h)$'],
+        ['exclude', 'rendering/SVG[^/]+.(cpp|h)$'],
+      ],
+      'conditions': [
+        ['OS=="win"', {
+          'sources/': [
+            ['exclude', 'Posix\\.cpp$'],
+          ],
+        }],
+        ['OS=="mac"', {
+          'sources/': [
+            # RenderThemeChromiumSkia is not used on mac since RenderThemeChromiumMac
+            # does not reference the Skia code that is used by Windows and Linux.
+            ['exclude', 'rendering/RenderThemeChromiumSkia\\.cpp$'],
+          ],
+        }],
+        ['os_posix == 1 and OS != "mac" and gcc_version == 42', {
+          # Due to a bug in gcc 4.2.1 (the current version on hardy), we get
+          # warnings about uninitialized this.
+          'cflags': ['-Wno-uninitialized'],
+        }],
+        ['toolkit_uses_gtk == 0', {
+          'sources/': [
+            ['exclude', '(Gtk|Linux)\\.cpp$'],
           ],
         }],
-        ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_MKL=1" in feature_defines', {
+        ['OS!="mac"', {
+          'sources/': [['exclude', 'Mac\\.(cpp|mm?)$']]
+        }],
+        ['OS!="win"', {
           'sources/': [
-            ['include', 'platform/audio/mkl/FFTFrameMKL\\.cpp$'],
+            ['exclude', 'Win\\.cpp$'],
           ],
         }],
       ],
     },
     {
       'target_name': 'webcore_remaining',
-      'type': '<(library)',
+      'type': 'static_library',
       'dependencies': [
         'webcore_prerequisites',
       ],
       # if this hard dependency could be split off the rest.
       'hard_dependency': 1,
       'sources': [
+        '<@(webcore_privateheader_files)',
         '<@(webcore_files)',
       ],
       'sources/': [
-        # Exclude JSC custom bindings.
-        ['exclude', 'bindings/js'],
+        ['exclude', 'html/'],
+        ['exclude', 'platform/'],
+        ['exclude', 'rendering/'],
 
-        # Fortunately, many things can be excluded by using broad patterns.
+        # Exclude most of bindings, except of the V8-related parts.
+        ['exclude', 'bindings/[^/]+/'],
+        ['include', 'bindings/generic/'],
+        ['include', 'bindings/v8/'],
 
-        # Exclude things that don't apply to the Chromium platform on the basis
-        # of their enclosing directories and tags at the ends of their
-        # filenames.
-        ['exclude', '(android|cairo|cf|cg|curl|gtk|haiku|html|linux|mac|opentype|platform|posix|qt|soup|svg|symbian|win|wx)/'],
-        ['exclude', '(?<!Chromium)(Android|Cairo|CF|CG|Curl|Gtk|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|Wx)\\.(cpp|mm?)$'],
+        # Exclude most of bridge, except for the V8-related parts.
+        ['exclude', 'bridge/'],
+        ['include', 'bridge/jni/'],
+        ['exclude', 'bridge/jni/[^/]+_jsobject\\.mm$'],
+        ['exclude', 'bridge/jni/[^/]+_objc\\.mm$'],
+        ['exclude', 'bridge/jni/jsc/'],
 
-        # Exclude most of SVG except css and javascript bindings.
-        ['exclude', 'rendering/style/SVG[^/]+.(cpp|h)$'],
-        ['exclude', 'rendering/RenderSVG[^/]+.(cpp|h)$'],
-        ['exclude', 'rendering/SVG[^/]+.(cpp|h)$'],
+        # FIXME: Figure out how to store these patterns in a variable.
+        ['exclude', '(android|brew|cairo|ca|cf|cg|curl|efl|freetype|gstreamer|gtk|haiku|linux|mac|opengl|openvg|opentype|pango|posix|qt|soup|svg|symbian|texmap|iphone|win|wince|wx)/'],
+        ['exclude', '(?<!Chromium)(Android|Cairo|CF|CG|Curl|Gtk|JSC|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Soup|Symbian|Win|WinCE|Wx)\\.(cpp|mm?)$'],
 
-        # JSC-only.
-        ['exclude', 'inspector/JavaScript[^/]*\\.cpp$'],
+        ['exclude', 'AllInOne\\.cpp$'],
 
-        # ENABLE_OFFLINE_WEB_APPLICATIONS, exclude most of webcore's impl
+        ['exclude', 'dom/StaticStringList\\.cpp$'],
+        ['exclude', 'dom/default/PlatformMessagePortChannel\\.(cpp|h)$'],
+        ['exclude', 'fileapi/LocalFileSystem\\.cpp$'],
+        ['exclude', 'inspector/InspectorFrontendClientLocal\\.cpp$'],
+        ['exclude', 'inspector/JavaScript[^/]*\\.cpp$'],
+        ['exclude', 'loader/UserStyleSheetLoader\\.cpp$'],
         ['exclude', 'loader/appcache/'],
-        ['include', 'loader/appcache/ApplicationCacheHost\.h$'],
-        ['include', 'loader/appcache/DOMApplicationCache\.(h|cpp)$'],
-
-        # Exclude some DB-related files.
-        ['exclude', 'storage/DatabaseTracker\\.cpp$'],
-        ['exclude', 'storage/DatabaseTrackerClient\\.h$'],
-        ['exclude', 'storage/OriginQuotaManager\\.(cpp|h)$'],
-        ['exclude', 'storage/OriginUsageRecord\\.(cpp|h)$'],
-        ['exclude', 'storage/SQLTransactionClient\\.cpp$'],
-
-        # Don't build StorageNamespace.  We have our own implementation.
-        ['exclude', 'storage/StorageNamespace\\.cpp$'],
-
-        # Don't build StorageEventDispatcher.  We have our own implementation.
-        ['exclude', 'storage/StorageEventDispatcher\\.cpp$'],
-
-        # Don't build IDBFactoryBackendInterface.  We have our own implementation.
-        ['exclude', 'storage/IDBFactoryBackendInterface\\.cpp$'],
-
-        # Don't build IDBKeyPathBackendImpl.  We have our own implementation.
-        ['exclude', 'storage/IDBKeyPathBackendImpl\\.cpp$'],
-
-        # Use history/BackForwardListChromium.cpp instead.
-        ['exclude', 'history/BackForwardListImpl\\.cpp$'],
-
-        # Use loader/icon/IconDatabaseNone.cpp instead.
+        ['exclude', 'loader/archive/cf/LegacyWebArchiveMac\\.mm$'],
+        ['exclude', 'loader/archive/cf/LegacyWebArchive\\.cpp$'],
         ['exclude', 'loader/icon/IconDatabase\\.cpp$'],
-
-        # Exclude some, but not all, of plugins.
+        ['exclude', 'plugins/PluginDataNone\\.cpp$'],
         ['exclude', 'plugins/PluginDatabase\\.cpp$'],
         ['exclude', 'plugins/PluginMainThreadScheduler\\.cpp$'],
+        ['exclude', 'plugins/PluginPackageNone\\.cpp$'],
         ['exclude', 'plugins/PluginPackage\\.cpp$'],
         ['exclude', 'plugins/PluginStream\\.cpp$'],
         ['exclude', 'plugins/PluginView\\.cpp$'],
         ['exclude', 'plugins/npapi\\.cpp$'],
+        ['exclude', 'storage/DatabaseTrackerClient\\.h$'],
+        ['exclude', 'storage/DatabaseTracker\\.cpp$'],
+        ['exclude', 'storage/IDBFactoryBackendInterface\\.cpp$'],
+        ['exclude', 'storage/IDBKeyPathBackendImpl\\.cpp$'],
+        ['exclude', 'storage/OriginQuotaManager\\.(cpp|h)$'],
+        ['exclude', 'storage/OriginUsageRecord\\.(cpp|h)$'],
+        ['exclude', 'storage/SQLTransactionClient\\.cpp$'],
+        ['exclude', 'storage/StorageEventDispatcher\\.cpp$'],
+        ['exclude', 'storage/StorageNamespace\\.cpp$'],
+        ['exclude', 'workers/DefaultSharedWorkerRepository\\.(cpp|h)$'],
 
-        # FIXME: I don't know exactly why these are excluded.  It would
-        # be nice to provide more explicit comments.  Some of these do actually
-        # compile.
-        ['exclude', 'dom/StaticStringList\\.cpp$'],
-        ['exclude', 'loader/UserStyleSheetLoader\\.cpp$'],
-
-        # We use a multi-process version from the WebKit API.
-        ['exclude', 'dom/default/PlatformMessagePortChannel\\.(cpp|h)$'],
+        ['include', 'loader/appcache/ApplicationCacheHost\.h$'],
+        ['include', 'loader/appcache/DOMApplicationCache\.(cpp|h)$'],
       ],
       'link_settings': {
         'mac_bundle_resources': [
             ['include', '/TransparencyWin\\.cpp$'],
           ],
         }],
-        ['OS=="mac"', {
-          'sources/': [
-            # RenderThemeChromiumSkia is not used on mac since RenderThemeChromiumMac
-            # does not reference the Skia code that is used by Windows and Linux.
-            ['exclude', 'rendering/RenderThemeChromiumSkia\\.cpp$'],
-          ],
-        }],
-        ['(OS=="linux" or OS=="freebsd" or OS=="openbsd") and gcc_version==42', {
+        ['os_posix == 1 and OS != "mac" and gcc_version == 42', {
           # Due to a bug in gcc 4.2.1 (the current version on hardy), we get
-          # warnings about uninitialized this.7.
+          # warnings about uninitialized this.
           'cflags': ['-Wno-uninitialized'],
         }],
-        ['OS!="linux" and OS!="freebsd"', {
+        ['toolkit_uses_gtk == 0', {
           'sources/': [
             ['exclude', '(Gtk|Linux)\\.cpp$'],
           ],
             ['exclude', '/(Windows|Uniscribe)[^/]*\\.cpp$']
           ],
         }],
+        ['javascript_engine=="v8"', {
+          'dependencies': [
+            '<(chromium_src_dir)/v8/src/extensions/experimental/experimental.gyp:i18n_api',
+          ],
+        }],
       ],
     },
     {
         'webcore_html',
         'webcore_platform',
         'webcore_remaining',
+        'webcore_rendering',
         # Exported.
         'webcore_bindings',
         '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
           'direct_dependent_settings': {
             'include_dirs': [
               '../../../WebKitLibraries',
-              '../../../WebKit/mac/WebCoreSupport',
+              '../../WebKit/mac/WebCoreSupport',
             ],
           },
         }],
             'include_dirs+++': ['../dom'],
           },
         }],
-        ['OS=="win" and "WTF_USE_WEBAUDIO_MKL=1" in feature_defines', {
+        ['OS=="linux" and "WTF_USE_WEBAUDIO_FFTW=1" in feature_defines', {
           # FIXME: (kbr) figure out how to make these dependencies
           # work in a cross-platform way. Attempts to use
           # "link_settings" and "libraries" in conjunction with the
           # msvs-specific settings didn't work so far.
           'all_dependent_settings': {
-            'msvs_settings': {
-              'VCLinkerTool': {
-                'AdditionalLibraryDirectories': [
-                  # This is a hack to make this directory correct
-                  # relative to targets like chrome_dll. Should use
-                  # <(chromium_src_dir).
-                  '../third_party/mkl/lib/win/ia32',
-                ],
-                'AdditionalDependencies': [
-                  'mkl_intel_c.lib',
-                  'mkl_sequential.lib',
-                  'mkl_core.lib',
-                ],
-              },
+            'ldflags': [
+              # FIXME: (kbr) build the FFTW into PRODUCT_DIR using GYP.
+              '-Lthird_party/fftw/.libs',
+            ],
+            'link_settings': {
+              'libraries': [
+                '-lfftw3f'
+              ],
             },
           },
         }],