summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/WebCore.gyp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-06 11:45:16 +0100
committerSteve Block <steveblock@google.com>2011-05-12 13:44:10 +0100
commitcad810f21b803229eb11403f9209855525a25d57 (patch)
tree29a6fd0279be608e0fe9ffe9841f722f0f4e4269 /Source/WebCore/WebCore.gyp
parent121b0cf4517156d0ac5111caf9830c51b69bae8f (diff)
downloadexternal_webkit-cad810f21b803229eb11403f9209855525a25d57.zip
external_webkit-cad810f21b803229eb11403f9209855525a25d57.tar.gz
external_webkit-cad810f21b803229eb11403f9209855525a25d57.tar.bz2
Merge WebKit at r75315: Initial merge by git.
Change-Id: I570314b346ce101c935ed22a626b48c2af266b84
Diffstat (limited to 'Source/WebCore/WebCore.gyp')
-rw-r--r--Source/WebCore/WebCore.gyp/WebCore.gyp1491
-rw-r--r--Source/WebCore/WebCore.gyp/mac/Empty.cpp27
-rwxr-xr-xSource/WebCore/WebCore.gyp/mac/adjust_visibility.sh108
-rw-r--r--Source/WebCore/WebCore.gyp/scripts/action_csspropertynames.py166
-rw-r--r--Source/WebCore/WebCore.gyp/scripts/action_cssvaluekeywords.py172
-rw-r--r--Source/WebCore/WebCore.gyp/scripts/action_derivedsourcesallinone.py203
-rw-r--r--Source/WebCore/WebCore.gyp/scripts/action_makenames.py174
-rw-r--r--Source/WebCore/WebCore.gyp/scripts/action_maketokenizer.py101
-rw-r--r--Source/WebCore/WebCore.gyp/scripts/action_useragentstylesheets.py102
-rw-r--r--Source/WebCore/WebCore.gyp/scripts/rule_binding.py136
-rw-r--r--Source/WebCore/WebCore.gyp/scripts/rule_bison.py102
11 files changed, 2782 insertions, 0 deletions
diff --git a/Source/WebCore/WebCore.gyp/WebCore.gyp b/Source/WebCore/WebCore.gyp/WebCore.gyp
new file mode 100644
index 0000000..2cd5169
--- /dev/null
+++ b/Source/WebCore/WebCore.gyp/WebCore.gyp
@@ -0,0 +1,1491 @@
+#
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+{
+ 'includes': [
+ # FIXME: Sense whether upstream or downstream build, and
+ # include the right features.gypi
+ '../../../WebKit/chromium/features.gypi',
+ '../WebCore.gypi',
+ ],
+ # Location of the chromium src directory.
+ 'conditions': [
+ ['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',
+ },
+ },{
+ # WebKit is checked out in src/chromium/third_party/WebKit
+ 'variables': {'chromium_src_dir': '../../../../..'},
+ }],
+ ['OS == "mac"', {
+ 'targets': [
+ {
+ # On the Mac, libWebKitSystemInterface*.a is used to help WebCore
+ # interface with the system. This library is supplied as a static
+ # library in binary format. At present, it contains many global
+ # symbols not marked private_extern. It should be considered an
+ # implementation detail of WebCore, and does not need these symbols
+ # to be exposed so widely.
+ #
+ # This target contains an action that cracks open the existing
+ # static library and rebuilds it with these global symbols
+ # transformed to private_extern.
+ 'target_name': 'webkit_system_interface',
+ 'type': 'static_library',
+ 'variables': {
+ 'adjusted_library_path':
+ '<(PRODUCT_DIR)/libWebKitSystemInterfaceLeopardPrivateExtern.a',
+ },
+ 'sources': [
+ # An empty source file is needed to convince Xcode to produce
+ # output for this target. The resulting library won't actually
+ # contain anything. The library at adjusted_library_path will,
+ # and that library is pushed to dependents of this target below.
+ 'mac/Empty.cpp',
+ ],
+ 'actions': [
+ {
+ 'action_name': 'Adjust Visibility',
+ 'inputs': [
+ 'mac/adjust_visibility.sh',
+ '../../../WebKitLibraries/libWebKitSystemInterfaceLeopard.a',
+ ],
+ 'outputs': [
+ '<(adjusted_library_path)',
+ ],
+ 'action': [
+ '<@(_inputs)',
+ '<@(_outputs)',
+ '<(INTERMEDIATE_DIR)/adjust_visibility', # work directory
+ ],
+ },
+ ], # actions
+ 'link_settings': {
+ 'libraries': [
+ '<(adjusted_library_path)',
+ ],
+ }, # link_settings
+ }, # target webkit_system_interface
+ ], # targets
+ }], # condition OS == "mac"
+ ['OS!="win" and remove_webcore_debug_symbols==1', {
+ # Remove -g from all targets defined here.
+ 'target_defaults': {
+ 'cflags!': ['-g'],
+ },
+ }],
+ ], # conditions
+
+ 'variables': {
+ # If set to 1, doesn't compile debug symbols into webcore reducing the
+ # size of the binary and increasing the speed of gdb. gcc only.
+ 'remove_webcore_debug_symbols%': 0,
+
+ # If set to 0, doesn't build SVG support, reducing the size of the
+ # binary and increasing the speed of gdb.
+ 'enable_svg%': 1,
+
+ 'webcore_include_dirs': [
+ '../',
+ '../accessibility',
+ '../accessibility/chromium',
+ '../bindings',
+ '../bindings/generic',
+ '../bindings/v8',
+ '../bindings/v8/custom',
+ '../bindings/v8/specialization',
+ '../css',
+ '../dom',
+ '../dom/default',
+ '../editing',
+ '../fileapi',
+ '../history',
+ '../html',
+ '../html/canvas',
+ '../html/parser',
+ '../html/shadow',
+ '../inspector',
+ '../loader',
+ '../loader/appcache',
+ '../loader/archive',
+ '../loader/cache',
+ '../loader/icon',
+ '../mathml',
+ '../notifications',
+ '../page',
+ '../page/animation',
+ '../page/chromium',
+ '../platform',
+ '../platform/animation',
+ '../platform/audio',
+ '../platform/audio/chromium',
+ '../platform/chromium',
+ '../platform/graphics',
+ '../platform/graphics/chromium',
+ '../platform/graphics/filters',
+ '../platform/graphics/gpu',
+ '../platform/graphics/opentype',
+ '../platform/graphics/skia',
+ '../platform/graphics/transforms',
+ '../platform/image-decoders',
+ '../platform/image-decoders/bmp',
+ '../platform/image-decoders/gif',
+ '../platform/image-decoders/ico',
+ '../platform/image-decoders/jpeg',
+ '../platform/image-decoders/png',
+ '../platform/image-decoders/skia',
+ '../platform/image-decoders/xbm',
+ '../platform/image-decoders/webp',
+ '../platform/image-encoders/skia',
+ '../platform/mock',
+ '../platform/network',
+ '../platform/network/chromium',
+ '../platform/sql',
+ '../platform/text',
+ '../platform/text/transcoder',
+ '../plugins',
+ '../plugins/chromium',
+ '../rendering',
+ '../rendering/style',
+ '../rendering/svg',
+ '../storage',
+ '../storage/chromium',
+ '../svg',
+ '../svg/animation',
+ '../svg/graphics',
+ '../svg/graphics/filters',
+ '../svg/properties',
+ '../webaudio',
+ '../websockets',
+ '../workers',
+ '../xml',
+ ],
+
+ 'bindings_idl_files': [
+ '<@(webcore_bindings_idl_files)',
+ ],
+
+ 'bindings_idl_files!': [
+ # Custom bindings in bindings/v8/custom exist for these.
+ '../dom/EventListener.idl',
+ '../dom/EventTarget.idl',
+ '../html/VoidCallback.idl',
+
+ # Bindings with custom Objective-C implementations.
+ '../page/AbstractView.idl',
+
+ # These bindings are excluded, as they're only used through inheritance and don't define constants that would need a constructor.
+ '../svg/ElementTimeControl.idl',
+ '../svg/SVGExternalResourcesRequired.idl',
+ '../svg/SVGFilterPrimitiveStandardAttributes.idl',
+ '../svg/SVGFitToViewBox.idl',
+
+ '../svg/SVGLangSpace.idl',
+ '../svg/SVGLocatable.idl',
+ '../svg/SVGStylable.idl',
+ '../svg/SVGTests.idl',
+ '../svg/SVGTransformable.idl',
+ '../svg/SVGViewSpec.idl',
+ '../svg/SVGZoomAndPan.idl',
+
+ # FIXME: I don't know why these are excluded, either.
+ # Someone (me?) should figure it out and add appropriate comments.
+ '../css/CSSUnknownRule.idl',
+ ],
+
+ 'conditions': [
+ # TODO(maruel): Move it in its own project or generate it anyway?
+ ['enable_svg!=0', {
+ 'bindings_idl_files': [
+ '<@(webcore_svg_bindings_idl_files)',
+ ],
+ }],
+ ['OS=="mac"', {
+ 'webcore_include_dirs+': [
+ # platform/graphics/cg and cocoa need to come before
+ # platform/graphics/chromium so that the Mac build picks up the
+ # version of ImageBufferData.h in the cg directory and
+ # FontPlatformData.h in the cocoa directory. The + prepends this
+ # directory to the list.
+ # FIXME: This shouldn't need to be prepended.
+ '../platform/graphics/cocoa',
+ '../platform/graphics/cg',
+ ],
+ 'webcore_include_dirs': [
+ # FIXME: Eliminate dependency on platform/mac and related
+ # directories.
+ # 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/graphics/mac',
+ '../platform/mac',
+ '../platform/text/mac',
+ ],
+ }],
+ ['OS=="win"', {
+ 'webcore_include_dirs': [
+ '../page/win',
+ '../platform/audio/win',
+ '../platform/graphics/win',
+ '../platform/text/win',
+ '../platform/win',
+ ],
+ },{
+ # enable -Wall and -Werror, just for Mac and Linux builds for now
+ # FIXME: Also enable this for Windows after verifying no warnings
+ 'chromium_code': 1,
+ }],
+ ['OS=="win" and buildtype=="Official"', {
+ # On windows official release builds, we try to preserve symbol space.
+ 'derived_sources_aggregate_files': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8DerivedSourcesAll.cpp',
+ ],
+ },{
+ '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',
+ ],
+ }],
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'inspector_protocol_sources',
+ 'type': 'none',
+ 'actions': [
+ {
+ 'action_name': 'generateInspectorProtocolSources',
+ # The second input item will be used as item name in vcproj.
+ # It is not possible to put Inspector.idl there because
+ # all idl files are marking as excluded by gyp generator.
+ 'inputs': [
+ '../bindings/scripts/generate-bindings.pl',
+ '../inspector/CodeGeneratorInspector.pm',
+ '../bindings/scripts/CodeGenerator.pm',
+ '../bindings/scripts/IDLParser.pm',
+ '../bindings/scripts/IDLStructure.pm',
+ '../inspector/Inspector.idl',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendDispatcher.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/InspectorBackendDispatcher.h',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorFrontend.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/InspectorFrontend.h',
+ ],
+ 'variables': {
+ 'generator_include_dirs': [
+ ],
+ },
+ 'action': [
+ 'python',
+ 'scripts/rule_binding.py',
+ '../inspector/Inspector.idl',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit',
+ '--',
+ '<@(_inputs)',
+ '--',
+ '--defines', '<(feature_defines) LANGUAGE_JAVASCRIPT',
+ '--generator', 'Inspector',
+ '<@(generator_include_dirs)'
+ ],
+ 'message': 'Generating Inspector protocol sources from Inspector.idl',
+ },
+ ]
+ },
+ {
+ 'target_name': 'webcore_bindings_sources',
+ 'type': 'none',
+ 'hard_dependency': 1,
+ 'sources': [
+ # bison rule
+ '../css/CSSGrammar.y',
+ '../xml/XPathGrammar.y',
+
+ # gperf rule
+ '../html/DocTypeStrings.gperf',
+ '../platform/ColorData.gperf',
+
+ # idl rules
+ '<@(bindings_idl_files)',
+ ],
+ 'actions': [
+ # Actions to build derived sources.
+ {
+ 'action_name': 'HTMLEntityTable',
+ 'inputs': [
+ '../html/parser/HTMLEntityNames.in',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityTable.cpp'
+ ],
+ 'action': [
+ 'python',
+ '../html/parser/create-html-entity-table',
+ '-o',
+ '<@(_outputs)',
+ '<@(_inputs)'
+ ],
+ },
+ {
+ 'action_name': 'CSSPropertyNames',
+ 'inputs': [
+ '../css/makeprop.pl',
+ '../css/CSSPropertyNames.in',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.h',
+ ],
+ 'action': [
+ 'python',
+ 'scripts/action_csspropertynames.py',
+ '<@(_outputs)',
+ '--',
+ '<@(_inputs)'
+ ],
+ 'conditions': [
+ # TODO(maruel): Move it in its own project or generate it anyway?
+ ['enable_svg!=0', {
+ 'inputs': [
+ '../css/SVGCSSPropertyNames.in',
+ ],
+ }],
+ ],
+ },
+ {
+ 'action_name': 'CSSValueKeywords',
+ 'inputs': [
+ '../css/makevalues.pl',
+ '../css/CSSValueKeywords.in',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.h',
+ ],
+ 'action': [
+ 'python',
+ 'scripts/action_cssvaluekeywords.py',
+ '<@(_outputs)',
+ '--',
+ '<@(_inputs)'
+ ],
+ 'conditions': [
+ # TODO(maruel): Move it in its own project or generate it anyway?
+ ['enable_svg!=0', {
+ 'inputs': [
+ '../css/SVGCSSValueKeywords.in',
+ ],
+ }],
+ ],
+ },
+ {
+ 'action_name': 'HTMLNames',
+ 'inputs': [
+ '../dom/make_names.pl',
+ '../html/HTMLTagNames.in',
+ '../html/HTMLAttributeNames.in',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLNames.h',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLElementFactory.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/V8HTMLElementWrapperFactory.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/V8HTMLElementWrapperFactory.h',
+ ],
+ 'action': [
+ 'python',
+ 'scripts/action_makenames.py',
+ '<@(_outputs)',
+ '--',
+ '<@(_inputs)',
+ '--',
+ '--factory',
+ '--wrapperFactoryV8',
+ '--extraDefines', '<(feature_defines)'
+ ],
+ },
+ {
+ 'action_name': 'SVGNames',
+ 'inputs': [
+ '../dom/make_names.pl',
+ '../svg/svgtags.in',
+ '../svg/svgattrs.in',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.h',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGElementFactory.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGElementFactory.h',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/V8SVGElementWrapperFactory.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/V8SVGElementWrapperFactory.h',
+ ],
+ 'action': [
+ 'python',
+ 'scripts/action_makenames.py',
+ '<@(_outputs)',
+ '--',
+ '<@(_inputs)',
+ '--',
+ '--factory',
+ '--wrapperFactoryV8',
+ '--extraDefines', '<(feature_defines)'
+ ],
+ },
+ {
+ 'action_name': 'MathMLNames',
+ 'inputs': [
+ '../dom/make_names.pl',
+ '../mathml/mathtags.in',
+ '../mathml/mathattrs.in',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.h',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLElementFactory.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLElementFactory.h',
+ ],
+ 'action': [
+ 'python',
+ 'scripts/action_makenames.py',
+ '<@(_outputs)',
+ '--',
+ '<@(_inputs)',
+ '--',
+ '--factory',
+ '--extraDefines', '<(feature_defines)'
+ ],
+ },
+ {
+ 'action_name': 'UserAgentStyleSheets',
+ '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',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/UserAgentStyleSheets.h',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/UserAgentStyleSheetsData.cpp',
+ ],
+ 'action': [
+ 'python',
+ 'scripts/action_useragentstylesheets.py',
+ '<@(_outputs)',
+ '--',
+ '<@(_inputs)'
+ ],
+ },
+ {
+ 'action_name': 'XLinkNames',
+ 'inputs': [
+ '../dom/make_names.pl',
+ '../svg/xlinkattrs.in',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/XLinkNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/XLinkNames.h',
+ ],
+ 'action': [
+ 'python',
+ 'scripts/action_makenames.py',
+ '<@(_outputs)',
+ '--',
+ '<@(_inputs)',
+ '--',
+ '--extraDefines', '<(feature_defines)'
+ ],
+ },
+ {
+ 'action_name': 'XMLNSNames',
+ 'inputs': [
+ '../dom/make_names.pl',
+ '../xml/xmlnsattrs.in',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNSNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNSNames.h',
+ ],
+ 'action': [
+ 'python',
+ 'scripts/action_makenames.py',
+ '<@(_outputs)',
+ '--',
+ '<@(_inputs)',
+ '--',
+ '--extraDefines', '<(feature_defines)'
+ ],
+ },
+ {
+ 'action_name': 'XMLNames',
+ 'inputs': [
+ '../dom/make_names.pl',
+ '../xml/xmlattrs.in',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.h',
+ ],
+ 'action': [
+ 'python',
+ 'scripts/action_makenames.py',
+ '<@(_outputs)',
+ '--',
+ '<@(_inputs)',
+ '--',
+ '--extraDefines', '<(feature_defines)'
+ ],
+ },
+ {
+ 'action_name': 'tokenizer',
+ 'inputs': [
+ '../css/maketokenizer',
+ '../css/tokenizer.flex',
+ ],
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/tokenizer.cpp',
+ ],
+ 'action': [
+ 'python',
+ 'scripts/action_maketokenizer.py',
+ '<@(_outputs)',
+ '--',
+ '<@(_inputs)'
+ ],
+ },
+ {
+ 'action_name': 'derived_sources_all_in_one',
+ 'variables': {
+ # Write sources into a file, so that the action command line won't
+ # exceed OS limites.
+ 'idls_list_temp_file': '<|(idls_list_temp_file.tmp <@(bindings_idl_files))',
+ },
+ 'inputs': [
+ 'scripts/action_derivedsourcesallinone.py',
+ '<(idls_list_temp_file)',
+ '<!@(cat <(idls_list_temp_file))',
+ ],
+ 'outputs': [
+ '<@(derived_sources_aggregate_files)',
+ ],
+ 'action': [
+ 'python',
+ 'scripts/action_derivedsourcesallinone.py',
+ '<(idls_list_temp_file)',
+ '--',
+ '<@(derived_sources_aggregate_files)',
+ ],
+ },
+ ],
+ 'rules': [
+ # Rules to build derived sources.
+ {
+ 'rule_name': 'bison',
+ 'extension': 'y',
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/<(RULE_INPUT_ROOT).cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/<(RULE_INPUT_ROOT).h'
+ ],
+ 'action': [
+ 'python',
+ 'scripts/rule_bison.py',
+ '<(RULE_INPUT_PATH)',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit'
+ ],
+ },
+ {
+ 'rule_name': 'gperf',
+ 'extension': 'gperf',
+ #
+ # gperf outputs are generated by WebCore/make-hash-tools.pl
+ #
+ 'outputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/<(RULE_INPUT_ROOT).cpp',
+ ],
+ 'inputs': [
+ '../make-hash-tools.pl',
+ ],
+ 'action': [
+ 'perl',
+ '../make-hash-tools.pl',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit',
+ '<(RULE_INPUT_PATH)',
+ ],
+ },
+ # Rule to build generated JavaScript (V8) bindings from .idl source.
+ {
+ 'rule_name': 'binding',
+ 'extension': 'idl',
+ 'msvs_external_rule': 1,
+ 'inputs': [
+ '../bindings/scripts/generate-bindings.pl',
+ '../bindings/scripts/CodeGenerator.pm',
+ '../bindings/scripts/CodeGeneratorV8.pm',
+ '../bindings/scripts/IDLParser.pm',
+ '../bindings/scripts/IDLStructure.pm',
+ ],
+ 'outputs': [
+ # FIXME: The .cpp file should be in webkit/bindings once
+ # we coax GYP into supporting it (see 'action' below).
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/V8<(RULE_INPUT_ROOT).cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8<(RULE_INPUT_ROOT).h',
+ ],
+ 'variables': {
+ 'generator_include_dirs': [
+ '--include', '../css',
+ '--include', '../dom',
+ '--include', '../fileapi',
+ '--include', '../html',
+ '--include', '../notifications',
+ '--include', '../page',
+ '--include', '../plugins',
+ '--include', '../storage',
+ '--include', '../svg',
+ '--include', '../webaudio',
+ '--include', '../websockets',
+ '--include', '../workers',
+ '--include', '../xml',
+ ],
+ },
+ # FIXME: Note that we put the .cpp files in webcore/bindings
+ # but the .h files in webkit/bindings. This is to work around
+ # the unfortunate fact that GYP strips duplicate arguments
+ # from lists. When we have a better GYP way to suppress that
+ # behavior, change the output location.
+ 'action': [
+ 'python',
+ 'scripts/rule_binding.py',
+ '<(RULE_INPUT_PATH)',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings',
+ '--',
+ '<@(_inputs)',
+ '--',
+ '--defines', '<(feature_defines) LANGUAGE_JAVASCRIPT V8_BINDING',
+ '--generator', 'V8',
+ '<@(generator_include_dirs)'
+ ],
+ 'message': 'Generating binding from <(RULE_INPUT_PATH)',
+ },
+ ],
+ },
+ {
+ 'target_name': 'webcore_bindings',
+ 'type': '<(library)',
+ 'hard_dependency': 1,
+ 'dependencies': [
+ 'webcore_bindings_sources',
+ 'inspector_protocol_sources',
+ '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:pcre',
+ '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
+ '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
+ '<(chromium_src_dir)/skia/skia.gyp:skia',
+ '<(chromium_src_dir)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
+ '<(chromium_src_dir)/third_party/libpng/libpng.gyp:libpng',
+ '<(chromium_src_dir)/third_party/libxml/libxml.gyp:libxml',
+ '<(chromium_src_dir)/third_party/libxslt/libxslt.gyp:libxslt',
+ '<(chromium_src_dir)/third_party/libwebp/libwebp.gyp:libwebp',
+ '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
+ '<(chromium_src_dir)/third_party/sqlite/sqlite.gyp:sqlite',
+ '<(libjpeg_gyp_path):libjpeg',
+ ],
+ 'include_dirs': [
+ '<(INTERMEDIATE_DIR)',
+ # FIXME: Remove <(SHARED_INTERMEDIATE_DIR)/webcore when we
+ # can entice gyp into letting us put both the .cpp and .h
+ # files in the same output directory.
+ '<(SHARED_INTERMEDIATE_DIR)/webcore',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings',
+ '<@(webcore_include_dirs)',
+ ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings',
+ ],
+ },
+ 'sources': [
+ # These files include all the .cpp files generated from the .idl files
+ # in webcore_files.
+ '<@(derived_sources_aggregate_files)',
+
+ # Additional .cpp files for HashTools.h
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/DocTypeStrings.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/ColorData.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSPropertyNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSValueKeywords.cpp',
+
+ # Additional .cpp files from webcore_bindings_sources actions.
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLElementFactory.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/UserAgentStyleSheetsData.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/V8HTMLElementWrapperFactory.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/XLinkNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNSNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLElementFactory.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.cpp',
+
+ # Generated from HTMLEntityNames.in
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLEntityTable.cpp',
+
+ # Additional .cpp files from the webcore_bindings_sources rules.
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/CSSGrammar.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/XPathGrammar.cpp',
+
+ # Additional .cpp files from the webcore_inspector_sources list.
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorFrontend.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendDispatcher.cpp',
+ ],
+ 'conditions': [
+ ['javascript_engine=="v8"', {
+ 'dependencies': [
+ '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
+ ],
+ 'conditions': [
+ ['inside_chromium_build==1 and OS=="win" and component=="shared_library"', {
+ 'defines': [
+ 'USING_V8_SHARED',
+ ],
+ }],
+ ],
+ }],
+ # TODO(maruel): Move it in its own project or generate it anyway?
+ ['enable_svg!=0', {
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGElementFactory.cpp',
+ '<(SHARED_INTERMEDIATE_DIR)/webkit/V8SVGElementWrapperFactory.cpp',
+ ],
+ }],
+ ['OS=="mac"', {
+ 'include_dirs': [
+ '../../../WebKitLibraries',
+ ],
+ }],
+ ['OS=="win"', {
+ 'dependencies': [
+ '<(chromium_src_dir)/build/win/system.gyp:cygwin'
+ ],
+ 'defines': [
+ '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': {
+ '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', {
+ 'include_dirs': [
+ '<(chromium_src_dir)/third_party/mkl/include',
+ ],
+ }],
+ ],
+ },
+ {
+ # We'll soon split libwebcore in multiple smaller libraries.
+ # webcore_prerequisites will be the 'base' target of every sub-target.
+ 'target_name': 'webcore_prerequisites',
+ 'type': 'none',
+ 'dependencies': [
+ 'webcore_bindings',
+ '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:pcre',
+ '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
+ '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
+ '<(chromium_src_dir)/skia/skia.gyp:skia',
+ '<(chromium_src_dir)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
+ '<(chromium_src_dir)/third_party/libwebp/libwebp.gyp:libwebp',
+ '<(chromium_src_dir)/third_party/libpng/libpng.gyp:libpng',
+ '<(chromium_src_dir)/third_party/libxml/libxml.gyp:libxml',
+ '<(chromium_src_dir)/third_party/libxslt/libxslt.gyp:libxslt',
+ '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
+ '<(chromium_src_dir)/third_party/ots/ots.gyp:ots',
+ '<(chromium_src_dir)/third_party/sqlite/sqlite.gyp:sqlite',
+ '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:translator_common',
+ '<(libjpeg_gyp_path):libjpeg',
+ ],
+ 'export_dependent_settings': [
+ 'webcore_bindings',
+ '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:pcre',
+ '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
+ '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
+ '<(chromium_src_dir)/skia/skia.gyp:skia',
+ '<(chromium_src_dir)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
+ '<(chromium_src_dir)/third_party/libwebp/libwebp.gyp:libwebp',
+ '<(chromium_src_dir)/third_party/libpng/libpng.gyp:libpng',
+ '<(chromium_src_dir)/third_party/libxml/libxml.gyp:libxml',
+ '<(chromium_src_dir)/third_party/libxslt/libxslt.gyp:libxslt',
+ '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
+ '<(chromium_src_dir)/third_party/ots/ots.gyp:ots',
+ '<(chromium_src_dir)/third_party/sqlite/sqlite.gyp:sqlite',
+ '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:translator_common',
+ '<(libjpeg_gyp_path):libjpeg',
+ ],
+ # This is needed for mac because of webkit_system_interface. It'd be nice
+ # if this hard dependency could be split off the rest.
+ 'hard_dependency': 1,
+ 'direct_dependent_settings': {
+ 'defines': [
+ 'WEBCORE_NAVIGATOR_VENDOR="Google Inc."',
+ ],
+ 'include_dirs': [
+ '<(INTERMEDIATE_DIR)',
+ '<@(webcore_include_dirs)',
+ '<(chromium_src_dir)/gpu',
+ '<(chromium_src_dir)/third_party/angle/include/GLSLANG',
+ ],
+ 'mac_framework_dirs': [
+ '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks',
+ ],
+ 'msvs_disabled_warnings': [
+ 4138, 4244, 4291, 4305, 4344, 4355, 4521, 4099,
+ ],
+ 'scons_line_length' : 1,
+ 'xcode_settings': {
+ # Some Mac-specific parts of WebKit won't compile without having this
+ # prefix header injected.
+ # FIXME: make this a first-class setting.
+ 'GCC_PREFIX_HEADER': '../WebCorePrefix.h',
+ },
+ },
+ 'conditions': [
+ ['javascript_engine=="v8"', {
+ 'dependencies': [
+ '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
+ ],
+ 'export_dependent_settings': [
+ '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
+ ],
+ 'conditions': [
+ ['inside_chromium_build==1 and OS=="win" and component=="shared_library"', {
+ 'defines': [
+ 'USING_V8_SHARED',
+ ],
+ }],
+ ],
+ }],
+ ['use_accelerated_compositing==1', {
+ 'dependencies': [
+ '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib',
+ ],
+ 'export_dependent_settings': [
+ '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib',
+ ],
+ }],
+ ['OS=="linux" or OS=="freebsd"', {
+ 'dependencies': [
+ '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
+ '<(chromium_src_dir)/build/linux/system.gyp:gtk',
+ ],
+ 'export_dependent_settings': [
+ '<(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',
+ ],
+ }],
+ ['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"',
+ ],
+ }],
+ ['OS=="mac"', {
+ 'dependencies': [
+ 'webkit_system_interface',
+ ],
+ '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.
+
+ # 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',
+ ],
+ }],
+ ['OS=="win"', {
+ 'dependencies': [
+ '<(chromium_src_dir)/build/win/system.gyp:cygwin'
+ ],
+ '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'],
+ }],
+ ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_MKL=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',
+ ],
+ },
+ }],
+ ],
+ },
+ {
+ 'target_name': 'webcore_html',
+ 'type': '<(library)',
+ 'dependencies': [
+ 'webcore_prerequisites',
+ ],
+ 'sources': [
+ '<@(webcore_files)',
+ ],
+ 'sources/': [
+ # Start by excluding everything then include html files only.
+ ['exclude', '.*'],
+ ['include', 'html/'],
+ ],
+ },
+ {
+ 'target_name': 'webcore_svg',
+ 'type': '<(library)',
+ 'dependencies': [
+ 'webcore_prerequisites',
+ ],
+ 'sources': [
+ '<@(webcore_files)',
+ ],
+ 'sources/': [
+ # Start by excluding everything then include svg files only. Note that
+ # css/SVG* and bindings/v8/custom/V8SVG* are still built in
+ # webcore_remaining.
+ ['exclude', '.*'],
+ ['include', 'svg/'],
+ ['include', 'css/svg/'],
+ ['include', 'rendering/style/SVG'],
+ ['include', 'rendering/RenderSVG'],
+ ['include', 'rendering/SVG'],
+ ['exclude', 'svg/SVGAllInOne\\.cpp$'],
+ ],
+ },
+ {
+ 'target_name': 'webcore_platform',
+ 'type': '<(library)',
+ 'dependencies': [
+ 'webcore_prerequisites',
+ ],
+ # This is needed for mac because of webkit_system_interface. It'd be nice
+ # if this hard dependency could be split off the rest.
+ 'hard_dependency': 1,
+ 'sources': [
+ '<@(webcore_files)',
+
+ # For WebCoreSystemInterface, Mac-only.
+ '../../../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.
+
+ ['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/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$'],
+ ],
+ 'conditions': [
+ ['OS=="linux" or OS=="freebsd"', {
+ 'sources/': [
+ # Cherry-pick files excluded by the broader regular expressions above.
+ ['include', 'platform/chromium/KeyCodeConversionGtk\\.cpp$'],
+ ['include', 'platform/graphics/chromium/ComplexTextControllerLinux\\.cpp$'],
+ ['include', 'platform/graphics/chromium/FontCacheLinux\\.cpp$'],
+ ['include', 'platform/graphics/chromium/FontLinux\\.cpp$'],
+ ['include', 'platform/graphics/chromium/FontPlatformDataLinux\\.cpp$'],
+ ['include', 'platform/graphics/chromium/SimpleFontDataLinux\\.cpp$'],
+ ],
+ 'dependencies': [
+ '<(chromium_src_dir)/third_party/harfbuzz/harfbuzz.gyp:harfbuzz',
+ ],
+ }],
+ ['OS=="mac"', {
+ # Necessary for Mac .mm stuff.
+ 'include_dirs': [
+ '../../../WebKitLibraries',
+ ],
+ 'dependencies': [
+ 'webkit_system_interface',
+ ],
+ 'actions': [
+ {
+ # Allow framework-style #include of
+ # <WebCore/WebCoreSystemInterface.h>.
+ 'action_name': 'WebCoreSystemInterface.h',
+ 'inputs': [
+ '../platform/mac/WebCoreSystemInterface.h',
+ ],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/WebCore/WebCoreSystemInterface.h',
+ ],
+ 'action': ['cp', '<@(_inputs)', '<@(_outputs)'],
+ },
+ ],
+ 'sources/': [
+ # 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.
+ ['include', 'CF\\.cpp$'],
+ ['exclude', 'network/cf/'],
+
+ # The Mac build is PLATFORM_CG too. platform/graphics/cg is the
+ # only place that CG files we want to build are located, and not
+ # all of them even have a CG suffix, so just add them by a
+ # regexp matching their directory.
+ ['include', 'platform/graphics/cg/[^/]*(?<!Win)?\\.(cpp|mm?)$'],
+
+ # Use native Mac font code from WebCore.
+ ['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$'],
+ ['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$'],
+ ['include', 'platform/graphics/mac/FloatSizeMac\\.mm$'],
+ ['include', 'platform/graphics/mac/GlyphPageTreeNodeMac\\.cpp$'],
+ ['include', 'platform/graphics/mac/GraphicsContextMac\\.mm$'],
+ ['include', 'platform/graphics/mac/IntRectMac\\.mm$'],
+ ['include', 'platform/mac/BlockExceptions\\.mm$'],
+ ['include', 'platform/mac/KillRingMac\\.mm$'],
+ ['include', 'platform/mac/LocalCurrentGraphicsContext\\.mm$'],
+ ['include', 'platform/mac/PurgeableBufferMac\\.cpp$'],
+ ['include', 'platform/mac/WebCoreSystemInterface\\.mm$'],
+ ['include', 'platform/mac/WebCoreTextRenderer\\.mm$'],
+ ['include', 'platform/text/mac/ShapeArabic\\.c$'],
+ ['include', 'platform/text/mac/String(Impl)?Mac\\.mm$'],
+ # Use USE_NEW_THEME on Mac.
+ ['include', 'platform/Theme\\.cpp$'],
+
+ ['include', 'WebKit/mac/WebCoreSupport/WebSystemInterface\\.mm$'],
+
+ # Chromium Mac does not use skia.
+ ['exclude', 'platform/graphics/skia/[^/]*Skia\\.(cpp|h)$'],
+
+ # The Mac uses platform/mac/KillRingMac.mm instead of the dummy
+ # implementation.
+ ['exclude', 'platform/KillRingNone\\.cpp$'],
+
+ # The Mac currently uses FontCustomPlatformData.cpp from
+ # platform/graphics/mac, included by regex above, instead.
+ ['exclude', 'platform/graphics/skia/FontCustomPlatformData\\.cpp$'],
+
+ # The Mac currently uses ScrollbarThemeChromiumMac.mm, which is not
+ # related to ScrollbarThemeChromium.cpp.
+ ['exclude', 'platform/chromium/ScrollbarThemeChromium\\.cpp$'],
+
+ # The Mac currently uses ImageChromiumMac.mm from
+ # platform/graphics/chromium, included by regex above, instead.
+ ['exclude', 'platform/graphics/chromium/ImageChromium\\.cpp$'],
+
+ # The Mac does not use ImageSourceCG.cpp from platform/graphics/cg
+ # even though it is included by regex above.
+ ['exclude', 'platform/graphics/cg/ImageSourceCG\\.cpp$'],
+ ['exclude', 'platform/graphics/cg/PDFDocumentImage\\.cpp$'],
+
+ # ImageDecoderSkia is not used on mac. ImageDecoderCG is used instead.
+ ['exclude', 'platform/image-decoders/skia/ImageDecoderSkia\\.cpp$'],
+ ['include', 'platform/image-decoders/cg/ImageDecoderCG\\.cpp$'],
+
+ # Again, Skia is not used on Mac.
+ ['exclude', 'platform/chromium/DragImageChromiumSkia\\.cpp$'],
+ ],
+ }],
+ ['OS!="linux" and OS!="freebsd"', {
+ 'sources/': [
+ ['exclude', '(Gtk|Linux)\\.cpp$'],
+ ['exclude', 'Harfbuzz[^/]+\\.(cpp|h)$'],
+ ['exclude', 'VDMX[^/]+\\.(cpp|h)$'],
+ ],
+ }],
+ ['OS!="mac"', {
+ 'sources/': [['exclude', 'Mac\\.(cpp|mm?)$']]
+ }],
+ ['OS!="win"', {
+ 'sources/': [
+ ['exclude', 'Win\\.cpp$'],
+ ['exclude', '/(Windows|Uniscribe)[^/]*\\.cpp$']
+ ],
+ }],
+ ['OS=="win"', {
+ 'sources/': [
+ ['exclude', 'Posix\\.cpp$'],
+
+ # The Chromium Win currently uses GlyphPageTreeNodeChromiumWin.cpp from
+ # platform/graphics/chromium, included by regex above, instead.
+ ['exclude', 'platform/graphics/skia/GlyphPageTreeNodeSkia\\.cpp$']
+ ],
+ }],
+ ['"ENABLE_CLIENT_BASED_GEOLOCATION=1" in feature_defines', {
+ 'sources/': [
+ ['exclude', '/GeolocationService.*$'],
+ ],
+ }],
+ ['(OS=="linux" or OS=="win") and "WTF_USE_WEBAUDIO_MKL=1" in feature_defines', {
+ 'sources/': [
+ ['include', 'platform/audio/mkl/FFTFrameMKL\\.cpp$'],
+ ],
+ }],
+ ],
+ },
+ {
+ 'target_name': 'webcore_remaining',
+ 'type': '<(library)',
+ 'dependencies': [
+ 'webcore_prerequisites',
+ ],
+ # This is needed for mac because of webkit_system_interface. It'd be nice
+ # if this hard dependency could be split off the rest.
+ 'hard_dependency': 1,
+ 'sources': [
+ '<@(webcore_files)',
+ ],
+ 'sources/': [
+ # Exclude JSC custom bindings.
+ ['exclude', 'bindings/js'],
+
+ # Fortunately, many things can be excluded by using broad patterns.
+
+ # 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 SVG except css and javascript bindings.
+ ['exclude', 'rendering/style/SVG[^/]+.(cpp|h)$'],
+ ['exclude', 'rendering/RenderSVG[^/]+.(cpp|h)$'],
+ ['exclude', 'rendering/SVG[^/]+.(cpp|h)$'],
+
+ # JSC-only.
+ ['exclude', 'inspector/JavaScript[^/]*\\.cpp$'],
+
+ # ENABLE_OFFLINE_WEB_APPLICATIONS, exclude most of webcore's impl
+ ['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/icon/IconDatabase\\.cpp$'],
+
+ # Exclude some, but not all, of plugins.
+ ['exclude', 'plugins/PluginDatabase\\.cpp$'],
+ ['exclude', 'plugins/PluginMainThreadScheduler\\.cpp$'],
+ ['exclude', 'plugins/PluginPackage\\.cpp$'],
+ ['exclude', 'plugins/PluginStream\\.cpp$'],
+ ['exclude', 'plugins/PluginView\\.cpp$'],
+ ['exclude', 'plugins/npapi\\.cpp$'],
+
+ # 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)$'],
+ ],
+ 'link_settings': {
+ 'mac_bundle_resources': [
+ '../Resources/aliasCursor.png',
+ '../Resources/cellCursor.png',
+ '../Resources/contextMenuCursor.png',
+ '../Resources/copyCursor.png',
+ '../Resources/crossHairCursor.png',
+ '../Resources/eastResizeCursor.png',
+ '../Resources/eastWestResizeCursor.png',
+ '../Resources/helpCursor.png',
+ '../Resources/linkCursor.png',
+ '../Resources/missingImage.png',
+ '../Resources/moveCursor.png',
+ '../Resources/noDropCursor.png',
+ '../Resources/noneCursor.png',
+ '../Resources/northEastResizeCursor.png',
+ '../Resources/northEastSouthWestResizeCursor.png',
+ '../Resources/northResizeCursor.png',
+ '../Resources/northSouthResizeCursor.png',
+ '../Resources/northWestResizeCursor.png',
+ '../Resources/northWestSouthEastResizeCursor.png',
+ '../Resources/notAllowedCursor.png',
+ '../Resources/progressCursor.png',
+ '../Resources/southEastResizeCursor.png',
+ '../Resources/southResizeCursor.png',
+ '../Resources/southWestResizeCursor.png',
+ '../Resources/verticalTextCursor.png',
+ '../Resources/waitCursor.png',
+ '../Resources/westResizeCursor.png',
+ '../Resources/zoomInCursor.png',
+ '../Resources/zoomOutCursor.png',
+ ],
+ },
+ 'conditions': [
+ ['OS=="win"', {
+ 'sources/': [
+ ['exclude', 'Posix\\.cpp$'],
+ ['include', '/opentype/'],
+ ['include', '/ScrollAnimatorWin\\.cpp$'],
+ ['include', '/ScrollAnimatorWin\\.h$'],
+ ['include', '/SkiaFontWin\\.cpp$'],
+ ['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', {
+ # Due to a bug in gcc 4.2.1 (the current version on hardy), we get
+ # warnings about uninitialized this.7.
+ 'cflags': ['-Wno-uninitialized'],
+ }],
+ ['OS!="linux" and OS!="freebsd"', {
+ 'sources/': [
+ ['exclude', '(Gtk|Linux)\\.cpp$'],
+ ],
+ }],
+ ['OS!="mac"', {
+ 'sources/': [['exclude', 'Mac\\.(cpp|mm?)$']]
+ }],
+ ['OS!="win"', {
+ 'sources/': [
+ ['exclude', 'Win\\.cpp$'],
+ ['exclude', '/(Windows|Uniscribe)[^/]*\\.cpp$']
+ ],
+ }],
+ ],
+ },
+ {
+ 'target_name': 'webcore',
+ 'type': 'none',
+ 'dependencies': [
+ 'webcore_html',
+ 'webcore_platform',
+ 'webcore_remaining',
+ # Exported.
+ 'webcore_bindings',
+ '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
+ '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
+ '<(chromium_src_dir)/skia/skia.gyp:skia',
+ '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
+ ],
+ 'export_dependent_settings': [
+ 'webcore_bindings',
+ '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf',
+ '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
+ '<(chromium_src_dir)/skia/skia.gyp:skia',
+ '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
+ ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '<@(webcore_include_dirs)',
+ ],
+ 'mac_framework_dirs': [
+ '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks',
+ '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework',
+ '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
+ '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
+ '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
+ '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
+ '$(SDKROOT)/System/Library/Frameworks/AudioUnit.framework',
+ '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
+ ],
+ },
+ 'conditions': [
+ ['javascript_engine=="v8"', {
+ 'dependencies': [
+ '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
+ ],
+ 'export_dependent_settings': [
+ '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
+ ],
+ }],
+ ['OS=="mac"', {
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '../../../WebKitLibraries',
+ '../../../WebKit/mac/WebCoreSupport',
+ ],
+ },
+ }],
+ ['OS=="win"', {
+ 'direct_dependent_settings': {
+ 'include_dirs+++': ['../dom'],
+ },
+ }],
+ ['OS=="win" and "WTF_USE_WEBAUDIO_MKL=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',
+ ],
+ },
+ },
+ },
+ }],
+ ['enable_svg!=0', {
+ 'dependencies': [
+ 'webcore_svg',
+ ],
+ }],
+ ],
+ },
+ ], # targets
+}
diff --git a/Source/WebCore/WebCore.gyp/mac/Empty.cpp b/Source/WebCore/WebCore.gyp/mac/Empty.cpp
new file mode 100644
index 0000000..d25a2b7
--- /dev/null
+++ b/Source/WebCore/WebCore.gyp/mac/Empty.cpp
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// This is an empty file used to convince Xcode to link a library when it
+// wouldn't otherwise have any reason to do so.
diff --git a/Source/WebCore/WebCore.gyp/mac/adjust_visibility.sh b/Source/WebCore/WebCore.gyp/mac/adjust_visibility.sh
new file mode 100755
index 0000000..44a50b7
--- /dev/null
+++ b/Source/WebCore/WebCore.gyp/mac/adjust_visibility.sh
@@ -0,0 +1,108 @@
+#!/bin/sh
+
+#
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+# usage: adjust_visibility.sh INPUT OUTPUT WORK_DIR
+#
+# Transforms a static library at INPUT by marking all of its symbols
+# private_extern. The output is placed at OUTPUT. WORK_DIR is used as a
+# scratch directory, which need not exist before this script is invoked,
+# and which will be left behind when the script exits.
+
+set -e
+
+if [ $# -ne 3 ] ; then
+ echo "usage: ${0} INPUT OUTPUT WORK_DIR" >& 2
+ exit 1
+fi
+
+INPUT="${1}"
+OUTPUT="${2}"
+WORK_DIR="${3}"
+
+# Start with a clean slate.
+rm -f "${OUTPUT}"
+rm -rf "${WORK_DIR}"
+mkdir -p "${WORK_DIR}"
+
+# ar doesn't operate on fat files. Figure out what architectures are
+# involved.
+ARCHS=$(file "${INPUT}" | sed -Ene 's/^.*\(for architecture (.+)\):.*$/\1/p')
+if [ -z "${ARCHS}" ] ; then
+ ARCHS=self
+fi
+
+OUTPUT_NAME="output.a"
+
+for ARCH in ${ARCHS} ; do
+ # Get a thin version of fat input by running lipo. If the input is already
+ # thin, just copy it into place. The extra copy isn't strictly necessary
+ # but it simplifies the script.
+ ARCH_DIR="${WORK_DIR}/${ARCH}"
+ mkdir -p "${ARCH_DIR}"
+ INPUT_NAME=input.a
+ ARCH_INPUT="${ARCH_DIR}/${INPUT_NAME}"
+ if [ "${ARCHS}" = "self" ] ; then
+ cp "${INPUT}" "${ARCH_INPUT}"
+ else
+ lipo -thin "${ARCH}" "${INPUT}" -output "${ARCH_INPUT}"
+ fi
+
+ # Change directories to extract the archive to ensure correct pathnames.
+ (cd "${ARCH_DIR}" && ar -x "${INPUT_NAME}")
+
+ # Use ld -r to relink each object that was in the archive. Providing an
+ # empty -exported_symbols_list will transform all symbols to private_extern;
+ # these symbols are retained with -keep_private_externs.
+ for OBJECT in "${ARCH_DIR}/"*.o ; do
+ NEW_OBJECT="${OBJECT}.new"
+ ld -o "${NEW_OBJECT}" -r "${OBJECT}" \
+ -exported_symbols_list /dev/null -keep_private_externs
+ mv "${NEW_OBJECT}" "${OBJECT}"
+ done
+
+ # Build an architecture-specific archive from the modified object files.
+ ARCH_OUTPUT="${ARCH_DIR}/${OUTPUT_NAME}"
+ (cd "${ARCH_DIR}" && ar -rc "${OUTPUT_NAME}" *.o)
+ ranlib "${ARCH_OUTPUT}"
+
+ # Toss the object files out now that they're in the archive.
+ rm -f "${ARCH_DIR}/"*.o
+done
+
+# Create a fat archive from the architecture-specific archives if needed.
+# If the input was thin, leave the output thin by copying the only output
+# archive to the destination.
+if [ "${ARCHS}" = "self" ] ; then
+ cp "${WORK_DIR}/self/${OUTPUT_NAME}" "${OUTPUT}"
+else
+ lipo -create -output "${OUTPUT}" "${WORK_DIR}/"*"/${OUTPUT_NAME}"
+fi
diff --git a/Source/WebCore/WebCore.gyp/scripts/action_csspropertynames.py b/Source/WebCore/WebCore.gyp/scripts/action_csspropertynames.py
new file mode 100644
index 0000000..60314d7
--- /dev/null
+++ b/Source/WebCore/WebCore.gyp/scripts/action_csspropertynames.py
@@ -0,0 +1,166 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# action_csspropertynames.py is a harness script to connect actions sections of
+# gyp-based builds to makeprop.pl.
+#
+# usage: action_makenames.py OUTPUTS -- INPUTS
+#
+# Exactly two outputs must be specified: a path to each of CSSPropertyNames.cpp
+# and CSSPropertyNames.h.
+#
+# Multiple inputs may be specified. One input must have a basename of
+# makeprop.pl; this is taken as the path to makeprop.pl. All other inputs are
+# paths to .in files that are used as input to makeprop.pl; at least one,
+# CSSPropertyNames.in, is required.
+
+
+import os
+import posixpath
+import shutil
+import subprocess
+import sys
+
+
+def SplitArgsIntoSections(args):
+ sections = []
+ while len(args) > 0:
+ if not '--' in args:
+ # If there is no '--' left, everything remaining is an entire section.
+ dashes = len(args)
+ else:
+ dashes = args.index('--')
+
+ sections.append(args[:dashes])
+
+ # Next time through the loop, look at everything after this '--'.
+ if dashes + 1 == len(args):
+ # If the '--' is at the end of the list, we won't come back through the
+ # loop again. Add an empty section now corresponding to the nothingness
+ # following the final '--'.
+ args = []
+ sections.append(args)
+ else:
+ args = args[dashes + 1:]
+
+ return sections
+
+
+def main(args):
+ (outputs, inputs) = SplitArgsIntoSections(args[1:])
+
+ # Make all output pathnames absolute so that they can be accessed after
+ # changing directory.
+ for index in xrange(0, len(outputs)):
+ outputs[index] = os.path.abspath(outputs[index])
+
+ outputDir = os.path.dirname(outputs[0])
+
+ # Look at the inputs and figure out which one is makeprop.pl and which are
+ # inputs to that script.
+ makepropInput = None
+ inFiles = []
+ for input in inputs:
+ # Make input pathnames absolute so they can be accessed after changing
+ # directory. On Windows, convert \ to / for inputs to the perl script to
+ # work around the intermix of activepython + cygwin perl.
+ inputAbs = os.path.abspath(input)
+ inputAbsPosix = inputAbs.replace(os.path.sep, posixpath.sep)
+ inputBasename = os.path.basename(input)
+ if inputBasename == 'makeprop.pl':
+ assert makepropInput == None
+ makepropInput = inputAbs
+ elif inputBasename.endswith('.in'):
+ inFiles.append(inputAbsPosix)
+ else:
+ assert False
+
+ assert makepropInput != None
+ assert len(inFiles) >= 1
+
+ # Change to the output directory because makeprop.pl puts output in its
+ # working directory.
+ os.chdir(outputDir)
+
+ # Merge all inFiles into a single file whose name will be the same as the
+ # first listed inFile, but in the output directory.
+ mergedPath = os.path.basename(inFiles[0])
+ merged = open(mergedPath, 'wb') # 'wb' to get \n only on windows
+
+ # Make sure there aren't any duplicate lines in the in files.
+ lineDict = {}
+ for inFilePath in inFiles:
+ inFile = open(inFilePath)
+ for line in inFile:
+ line = line.rstrip()
+ if line.startswith('#'):
+ line = ''
+ if line == '':
+ continue
+ if line in lineDict:
+ raise KeyError, 'Duplicate value %s' % line
+ lineDict[line] = True
+ print >>merged, line
+ inFile.close()
+
+ merged.close()
+
+ # Build up the command.
+ command = ['perl', makepropInput]
+
+ # Do it. checkCall is new in 2.5, so simulate its behavior with call and
+ # assert.
+ returnCode = subprocess.call(command)
+ assert returnCode == 0
+
+ # Don't leave behind the merged file or the .gperf file created by
+ # makeprop.
+ (root, ext) = os.path.splitext(mergedPath)
+ gperfPath = root + '.gperf'
+ os.unlink(gperfPath)
+ os.unlink(mergedPath)
+
+ # Go through the outputs. Any output that belongs in a different directory
+ # is moved. Do a copy and delete instead of rename for maximum portability.
+ # Note that all paths used in this section are still absolute.
+ for output in outputs:
+ thisOutputDir = os.path.dirname(output)
+ if thisOutputDir != outputDir:
+ outputBasename = os.path.basename(output)
+ src = os.path.join(outputDir, outputBasename)
+ dst = os.path.join(thisOutputDir, outputBasename)
+ shutil.copyfile(src, dst)
+ os.unlink(src)
+
+ return returnCode
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
diff --git a/Source/WebCore/WebCore.gyp/scripts/action_cssvaluekeywords.py b/Source/WebCore/WebCore.gyp/scripts/action_cssvaluekeywords.py
new file mode 100644
index 0000000..ebf895b
--- /dev/null
+++ b/Source/WebCore/WebCore.gyp/scripts/action_cssvaluekeywords.py
@@ -0,0 +1,172 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# action_cssvaluekeywords.py is a harness script to connect actions sections of
+# gyp-based builds to makevalues.pl.
+#
+# usage: action_cssvaluekeywords.py OUTPUTS -- INPUTS
+#
+# Exactly two outputs must be specified: a path to each of CSSValueKeywords.c
+# and CSSValueKeywords.h.
+#
+# Multiple inputs may be specified. One input must have a basename of
+# makevalues.pl; this is taken as the path to makevalues.pl. All other inputs
+# are paths to .in files that are used as input to makevalues.pl; at least
+# one, CSSValueKeywords.in, is required.
+
+
+import os
+import posixpath
+import shutil
+import subprocess
+import sys
+
+
+def SplitArgsIntoSections(args):
+ sections = []
+ while len(args) > 0:
+ if not '--' in args:
+ # If there is no '--' left, everything remaining is an entire section.
+ dashes = len(args)
+ else:
+ dashes = args.index('--')
+
+ sections.append(args[:dashes])
+
+ # Next time through the loop, look at everything after this '--'.
+ if dashes + 1 == len(args):
+ # If the '--' is at the end of the list, we won't come back through the
+ # loop again. Add an empty section now corresponding to the nothingness
+ # following the final '--'.
+ args = []
+ sections.append(args)
+ else:
+ args = args[dashes + 1:]
+
+ return sections
+
+
+def main(args):
+ (outputs, inputs) = SplitArgsIntoSections(args[1:])
+
+ # Make all output pathnames absolute so that they can be accessed after
+ # changing directory.
+ for index in xrange(0, len(outputs)):
+ outputs[index] = os.path.abspath(outputs[index])
+
+ outputDir = os.path.dirname(outputs[0])
+
+ # Look at the inputs and figure out which one is makevalues.pl and which are
+ # inputs to that script.
+ makevaluesInput = None
+ inFiles = []
+ for input in inputs:
+ # Make input pathnames absolute so they can be accessed after changing
+ # directory. On Windows, convert \ to / for inputs to the perl script to
+ # work around the intermix of activepython + cygwin perl.
+ inputAbs = os.path.abspath(input)
+ inputAbsPosix = inputAbs.replace(os.path.sep, posixpath.sep)
+ inputBasename = os.path.basename(input)
+ if inputBasename == 'makevalues.pl':
+ assert makevaluesInput == None
+ makevaluesInput = inputAbs
+ elif inputBasename.endswith('.in'):
+ inFiles.append(inputAbsPosix)
+ else:
+ assert False
+
+ assert makevaluesInput != None
+ assert len(inFiles) >= 1
+
+ # Change to the output directory because makevalues.pl puts output in its
+ # working directory.
+ os.chdir(outputDir)
+
+ # Merge all inFiles into a single file whose name will be the same as the
+ # first listed inFile, but in the output directory.
+ mergedPath = os.path.basename(inFiles[0])
+ merged = open(mergedPath, 'wb') # 'wb' to get \n only on windows
+
+ # Make sure there aren't any duplicate lines in the in files. Lowercase
+ # everything because CSS values are case-insensitive.
+ lineDict = {}
+ for inFilePath in inFiles:
+ inFile = open(inFilePath)
+ for line in inFile:
+ line = line.rstrip()
+ if line.startswith('#'):
+ line = ''
+ if line == '':
+ continue
+ line = line.lower()
+ if line in lineDict:
+ raise KeyError, 'Duplicate value %s' % line
+ lineDict[line] = True
+ print >>merged, line
+ inFile.close()
+
+ merged.close()
+
+ # Build up the command.
+ command = ['perl', makevaluesInput]
+
+ # Do it. checkCall is new in 2.5, so simulate its behavior with call and
+ # assert.
+ returnCode = subprocess.call(command)
+ assert returnCode == 0
+
+ # Don't leave behind the merged file or the .gperf file created by
+ # makevalues.
+ (root, ext) = os.path.splitext(mergedPath)
+ gperfPath = root + '.gperf'
+ os.unlink(gperfPath)
+ os.unlink(mergedPath)
+
+ # Go through the outputs. Any output that belongs in a different directory
+ # is moved. Do a copy and delete instead of rename for maximum portability.
+ # Note that all paths used in this section are still absolute.
+ for output in outputs:
+ thisOutputDir = os.path.dirname(output)
+ if thisOutputDir != outputDir:
+ outputBasename = os.path.basename(output)
+ src = os.path.join(outputDir, outputBasename)
+ dst = os.path.join(thisOutputDir, outputBasename)
+ shutil.copyfile(src, dst)
+ os.unlink(src)
+
+ return returnCode
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
diff --git a/Source/WebCore/WebCore.gyp/scripts/action_derivedsourcesallinone.py b/Source/WebCore/WebCore.gyp/scripts/action_derivedsourcesallinone.py
new file mode 100644
index 0000000..c9c5bf5
--- /dev/null
+++ b/Source/WebCore/WebCore.gyp/scripts/action_derivedsourcesallinone.py
@@ -0,0 +1,203 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# action_derivedsourceslist.py generates a single cpp file that includes
+# all v8 bindings cpp files generated from idls. Files can be assigned into
+# multiple output files, to reduce maximum compilation unit size and allow
+# parallel compilation.
+#
+# usage: action_derivedsourceslist.py IDL_FILES_LIST -- OUTPUT_FILE1 OUTPUT_FILE2 ...
+#
+# Note that IDL_FILES_LIST is a text file containing the IDL file paths.
+
+import errno
+import os
+import os.path
+import re
+import subprocess
+import sys
+
+# A regexp for finding Conditional attributes in interface definitions.
+conditionalPattern = re.compile('interface[\s]*\[[^\]]*Conditional=([\_0-9a-zA-Z&|]*)')
+
+copyrightTemplate = """/*
+ * THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
+ *
+ * This file was generated by the make_jni_lists.py script.
+ *
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+"""
+
+
+# Wraps conditional with ENABLE() and replace '&','|' with '&&','||' if more than one conditional is specified.
+def formatConditional(conditional):
+ def wrapWithEnable(s):
+ if re.match('[|&]$', s):
+ return s * 2
+ return 'ENABLE(' + s + ')'
+ return ' '.join(map(wrapWithEnable, conditional))
+
+
+# Find the conditional interface attribute.
+def extractConditional(idlFilePath):
+ conditional = None
+
+ # Read file and look for "interface [ Conditional=XXX ]".
+ idlFile = open(idlFilePath)
+ idlContents = idlFile.read().replace('\n', '')
+ idlFile.close()
+
+ match = conditionalPattern.search(idlContents)
+ if match:
+ conditional = match.group(1)
+ conditional = re.split('([|&])', conditional)
+
+ return conditional
+
+# Extracts conditional and interface name from each IDL file.
+def extractMetaData(filePaths):
+ metaDataList = []
+
+ for f in filePaths:
+ metaData = {}
+ if len(f) == 0:
+ continue
+ if not os.path.exists(f):
+ print 'WARNING: file not found: "%s"' % f
+ continue
+
+ # Extract type name from file name
+ (parentPath, fileName) = os.path.split(f)
+ (interfaceName, ext) = os.path.splitext(fileName)
+
+ if not ext == '.idl':
+ continue
+
+ metaData = {
+ 'conditional': extractConditional(f),
+ 'name': interfaceName,
+ }
+
+ metaDataList.append(metaData)
+
+ return metaDataList
+
+
+def generateContent(filesMetaData, partition, totalPartitions):
+ # Sort files by conditionals.
+ filesMetaData.sort()
+
+ output = []
+
+ # Add fixed content.
+ output.append(copyrightTemplate)
+ output.append('#define NO_IMPLICIT_ATOMICSTRING\n\n')
+
+ # List all includes segmented by if and endif.
+ prevConditional = None
+ for metaData in filesMetaData:
+ name = metaData['name']
+ if (hash(name) % totalPartitions) != partition:
+ continue
+ conditional = metaData['conditional']
+
+ if prevConditional and prevConditional != conditional:
+ output.append('#endif\n')
+ if conditional and prevConditional != conditional:
+ output.append('\n#if %s\n' % formatConditional(conditional))
+
+ output.append('#include "bindings/V8%s.cpp"\n' % name)
+
+ prevConditional = conditional
+
+ if prevConditional:
+ output.append('#endif\n')
+
+ return ''.join(output)
+
+
+def writeContent(content, outputFileName):
+ (parentPath, fileName) = os.path.split(outputFileName)
+ if not os.path.exists(parentPath):
+ print parentPath
+ os.mkdir(parentPath)
+ f = open(outputFileName, 'w')
+ f.write(content)
+ f.close()
+
+
+def main(args):
+ assert(len(args) > 3)
+ inOutBreakIndex = args.index('--')
+ inputFileName = args[1]
+ outputFileNames = args[inOutBreakIndex+1:]
+
+ inputFile = open(inputFileName, 'r')
+ idlFileNames = inputFile.read().split('\n')
+ inputFile.close()
+
+ filesMetaData = extractMetaData(idlFileNames)
+ for fileName in outputFileNames:
+ print 'Generating derived sources list into %s...' % fileName
+ partition = outputFileNames.index(fileName)
+ fileContents = generateContent(filesMetaData, partition, len(outputFileNames))
+ writeContent(fileContents, fileName)
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
diff --git a/Source/WebCore/WebCore.gyp/scripts/action_makenames.py b/Source/WebCore/WebCore.gyp/scripts/action_makenames.py
new file mode 100644
index 0000000..ecf543f
--- /dev/null
+++ b/Source/WebCore/WebCore.gyp/scripts/action_makenames.py
@@ -0,0 +1,174 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# action_makenames.py is a harness script to connect actions sections of
+# gyp-based builds to make_names.pl.
+#
+# usage: action_makenames.py OUTPUTS -- INPUTS [-- OPTIONS]
+#
+# Multiple OUTPUTS, INPUTS, and OPTIONS may be listed. The sections are
+# separated by -- arguments.
+#
+# The directory name of the first output is chosen as the directory in which
+# make_names will run. If the directory name for any subsequent output is
+# different, those files will be moved to the desired directory.
+#
+# Multiple INPUTS may be listed. An input with a basename matching
+# "make_names.pl" is taken as the path to that script. Inputs with names
+# ending in TagNames.in or tags.in are taken as tag inputs. Inputs with names
+# ending in AttributeNames.in or attrs.in are taken as attribute inputs. There
+# may be at most one tag input and one attribute input. A make_names.pl input
+# is required and at least one tag or attribute input must be present.
+#
+# OPTIONS is a list of additional options to pass to make_names.pl. This
+# section need not be present.
+
+
+import os
+import posixpath
+import shutil
+import subprocess
+import sys
+
+
+def SplitArgsIntoSections(args):
+ sections = []
+ while len(args) > 0:
+ if not '--' in args:
+ # If there is no '--' left, everything remaining is an entire section.
+ dashes = len(args)
+ else:
+ dashes = args.index('--')
+
+ sections.append(args[:dashes])
+
+ # Next time through the loop, look at everything after this '--'.
+ if dashes + 1 == len(args):
+ # If the '--' is at the end of the list, we won't come back through the
+ # loop again. Add an empty section now corresponding to the nothingness
+ # following the final '--'.
+ args = []
+ sections.append(args)
+ else:
+ args = args[dashes + 1:]
+
+ return sections
+
+
+def main(args):
+ sections = SplitArgsIntoSections(args[1:])
+ assert len(sections) == 2 or len(sections) == 3
+ (outputs, inputs) = sections[:2]
+ if len(sections) == 3:
+ options = sections[2]
+ else:
+ options = []
+
+ # Make all output pathnames absolute so that they can be accessed after
+ # changing directory.
+ for index in xrange(0, len(outputs)):
+ outputs[index] = os.path.abspath(outputs[index])
+
+ outputDir = os.path.dirname(outputs[0])
+
+ # Look at the inputs and figure out which ones are make_names.pl, tags, and
+ # attributes. There can be at most one of each, and those are the only
+ # input types supported. make_names.pl is required and at least one of tags
+ # and attributes is required.
+ makeNamesInput = None
+ tagInput = None
+ attrInput = None
+ for input in inputs:
+ # Make input pathnames absolute so they can be accessed after changing
+ # directory. On Windows, convert \ to / for inputs to the perl script to
+ # work around the intermix of activepython + cygwin perl.
+ inputAbs = os.path.abspath(input)
+ inputAbsPosix = inputAbs.replace(os.path.sep, posixpath.sep)
+ inputBasename = os.path.basename(input)
+ if inputBasename == 'make_names.pl':
+ assert makeNamesInput == None
+ makeNamesInput = inputAbs
+ elif inputBasename.endswith('TagNames.in') \
+ or inputBasename.endswith('tags.in'):
+ assert tagInput == None
+ tagInput = inputAbsPosix
+ elif inputBasename.endswith('AttributeNames.in') \
+ or inputBasename.endswith('attrs.in'):
+ assert attrInput == None
+ attrInput = inputAbsPosix
+ else:
+ assert False
+
+ assert makeNamesInput != None
+ assert tagInput != None or attrInput != None
+
+ # scriptsPath is a Perl include directory, located relative to
+ # makeNamesInput.
+ scriptsPath = os.path.normpath(
+ os.path.join(os.path.dirname(makeNamesInput), os.pardir, 'bindings', 'scripts'))
+
+ # Change to the output directory because make_names.pl puts output in its
+ # working directory.
+ os.chdir(outputDir)
+
+ # Build up the command.
+ command = ['perl', '-I', scriptsPath, makeNamesInput]
+ if tagInput != None:
+ command.extend(['--tags', tagInput])
+ if attrInput != None:
+ command.extend(['--attrs', attrInput])
+ command.extend(options)
+
+ # Do it. check_call is new in 2.5, so simulate its behavior with call and
+ # assert.
+ returnCode = subprocess.call(command)
+ assert returnCode == 0
+
+ # Go through the outputs. Any output that belongs in a different directory
+ # is moved. Do a copy and delete instead of rename for maximum portability.
+ # Note that all paths used in this section are still absolute.
+ for output in outputs:
+ thisOutputDir = os.path.dirname(output)
+ if thisOutputDir != outputDir:
+ outputBasename = os.path.basename(output)
+ src = os.path.join(outputDir, outputBasename)
+ dst = os.path.join(thisOutputDir, outputBasename)
+ shutil.copyfile(src, dst)
+ os.unlink(src)
+
+ return returnCode
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
diff --git a/Source/WebCore/WebCore.gyp/scripts/action_maketokenizer.py b/Source/WebCore/WebCore.gyp/scripts/action_maketokenizer.py
new file mode 100644
index 0000000..f4a28ee
--- /dev/null
+++ b/Source/WebCore/WebCore.gyp/scripts/action_maketokenizer.py
@@ -0,0 +1,101 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# usage: action_maketokenizer.py OUTPUTS -- INPUTS
+#
+# Multiple INPUTS may be listed. The sections are separated by -- arguments.
+#
+# OUTPUTS must contain a single item: a path to tokenizer.cpp.
+#
+# INPUTS must contain exactly two items. The first item must be the path to
+# maketokenizer. The second item must be the path to tokenizer.flex.
+
+
+import os
+import subprocess
+import sys
+
+
+def SplitArgsIntoSections(args):
+ sections = []
+ while len(args) > 0:
+ if not '--' in args:
+ # If there is no '--' left, everything remaining is an entire section.
+ dashes = len(args)
+ else:
+ dashes = args.index('--')
+
+ sections.append(args[:dashes])
+
+ # Next time through the loop, look at everything after this '--'.
+ if dashes + 1 == len(args):
+ # If the '--' is at the end of the list, we won't come back through the
+ # loop again. Add an empty section now corresponding to the nothingness
+ # following the final '--'.
+ args = []
+ sections.append(args)
+ else:
+ args = args[dashes + 1:]
+
+ return sections
+
+
+def main(args):
+ sections = SplitArgsIntoSections(args[1:])
+ assert len(sections) == 2
+ (outputs, inputs) = sections
+
+ assert len(outputs) == 1
+ output = outputs[0]
+
+ assert len(inputs) == 2
+ maketokenizer = inputs[0]
+ flexInput = inputs[1]
+
+ # Do it. check_call is new in 2.5, so simulate its behavior with call and
+ # assert.
+ outfile = open(output, 'wb')
+ p1 = subprocess.Popen(['flex', '-t', flexInput], stdout=subprocess.PIPE)
+ p2 = subprocess.Popen(['perl', maketokenizer], stdin=p1.stdout, stdout=outfile)
+
+ r1 = p1.wait()
+ r2 = p2.wait()
+ assert r1 == 0
+ assert r2 == 0
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
diff --git a/Source/WebCore/WebCore.gyp/scripts/action_useragentstylesheets.py b/Source/WebCore/WebCore.gyp/scripts/action_useragentstylesheets.py
new file mode 100644
index 0000000..6f017fc
--- /dev/null
+++ b/Source/WebCore/WebCore.gyp/scripts/action_useragentstylesheets.py
@@ -0,0 +1,102 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# usage: action_useragentstylesheets.py OUTPUTS -- INPUTS
+#
+# Multiple OUTPUTS and INPUTS may be listed. The sections are separated by
+# -- arguments.
+#
+# OUTPUTS must contain two items, in order: a path to UserAgentStyleSheets.h
+# and a path to UserAgentStyleSheetsData.cpp.
+#
+# INPUTS must contain at least two items. The first item must be the path to
+# make-css-file-arrays.pl. The remaining items are paths to style sheets to
+# be fed to that script.
+
+
+import os
+import subprocess
+import sys
+
+
+def SplitArgsIntoSections(args):
+ sections = []
+ while len(args) > 0:
+ if not '--' in args:
+ # If there is no '--' left, everything remaining is an entire section.
+ dashes = len(args)
+ else:
+ dashes = args.index('--')
+
+ sections.append(args[:dashes])
+
+ # Next time through the loop, look at everything after this '--'.
+ if dashes + 1 == len(args):
+ # If the '--' is at the end of the list, we won't come back through the
+ # loop again. Add an empty section now corresponding to the nothingness
+ # following the final '--'.
+ args = []
+ sections.append(args)
+ else:
+ args = args[dashes + 1:]
+
+ return sections
+
+
+def main(args):
+ sections = SplitArgsIntoSections(args[1:])
+ assert len(sections) == 2
+ (outputs, inputs) = sections
+
+ assert len(outputs) == 2
+ outputH = outputs[0]
+ outputCpp = outputs[1]
+
+ makeCssFileArrays = inputs[0]
+ styleSheets = inputs[1:]
+
+ # Build up the command.
+ command = ['perl', makeCssFileArrays, outputH, outputCpp]
+ command.extend(styleSheets)
+
+ # Do it. check_call is new in 2.5, so simulate its behavior with call and
+ # assert.
+ returnCode = subprocess.call(command)
+ assert returnCode == 0
+
+ return returnCode
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
diff --git a/Source/WebCore/WebCore.gyp/scripts/rule_binding.py b/Source/WebCore/WebCore.gyp/scripts/rule_binding.py
new file mode 100644
index 0000000..5a41808
--- /dev/null
+++ b/Source/WebCore/WebCore.gyp/scripts/rule_binding.py
@@ -0,0 +1,136 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# usage: rule_binding.py INPUT CPPDIR HDIR -- INPUTS -- OPTIONS
+#
+# INPUT is an IDL file, such as Whatever.idl.
+#
+# CPPDIR is the directory into which V8Whatever.cpp will be placed. HDIR is
+# the directory into which V8Whatever.h will be placed.
+#
+# The first item in INPUTS is the path to generate-bindings.pl. Remaining
+# items in INPUTS are used to build the Perl module include path.
+#
+# OPTIONS are passed as-is to generate-bindings.pl as additional arguments.
+
+
+import errno
+import os
+import shlex
+import shutil
+import subprocess
+import sys
+
+
+def SplitArgsIntoSections(args):
+ sections = []
+ while len(args) > 0:
+ if not '--' in args:
+ # If there is no '--' left, everything remaining is an entire section.
+ dashes = len(args)
+ else:
+ dashes = args.index('--')
+
+ sections.append(args[:dashes])
+
+ # Next time through the loop, look at everything after this '--'.
+ if dashes + 1 == len(args):
+ # If the '--' is at the end of the list, we won't come back through the
+ # loop again. Add an empty section now corresponding to the nothingness
+ # following the final '--'.
+ args = []
+ sections.append(args)
+ else:
+ args = args[dashes + 1:]
+
+ return sections
+
+
+def main(args):
+ sections = SplitArgsIntoSections(args[1:])
+ assert len(sections) == 3, sections
+ (base, inputs, options) = sections
+
+ assert len(base) == 3, base
+ (input, cppdir, hdir) = base
+
+ assert len(inputs) > 1, inputs
+ generateBindings = inputs[0]
+ perlModules = inputs[1:]
+
+ includeDirs = []
+ for perlModule in perlModules:
+ includeDir = os.path.dirname(perlModule)
+ if not includeDir in includeDirs:
+ includeDirs.append(includeDir)
+
+ if '--prefix' in options:
+ prefixIndex = options.index('--prefix')
+ else:
+ prefixIndex = options.index('--generator')
+
+ fileName = ''
+ if '--filename' in options:
+ fileName = options[options.index('--filename') + 1]
+
+ if prefixIndex + 1 < len(options):
+ prefix = options[prefixIndex + 1]
+
+ # The defines come in as one flat string. Split it up into distinct arguments.
+ if '--defines' in options:
+ definesIndex = options.index('--defines')
+ if definesIndex + 1 < len(options):
+ splitOptions = shlex.split(options[definesIndex + 1])
+ if splitOptions:
+ options[definesIndex + 1] = ' '.join(splitOptions)
+
+ # Build up the command.
+ command = ['perl', '-w']
+ for includeDir in includeDirs:
+ command.extend(['-I', includeDir])
+ command.append(generateBindings)
+ command.extend(options)
+ command.extend(['--outputHeadersDir', hdir])
+ command.extend(['--outputDir', cppdir, input])
+
+ # Do it. check_call is new in 2.5, so simulate its behavior with call and
+ # assert.
+ returnCode = subprocess.call(command)
+ assert returnCode == 0
+
+ return returnCode
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
diff --git a/Source/WebCore/WebCore.gyp/scripts/rule_bison.py b/Source/WebCore/WebCore.gyp/scripts/rule_bison.py
new file mode 100644
index 0000000..eb85a4b
--- /dev/null
+++ b/Source/WebCore/WebCore.gyp/scripts/rule_bison.py
@@ -0,0 +1,102 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# usage: rule_bison.py INPUT_FILE OUTPUT_DIR
+# INPUT_FILE is a path to either CSSGrammar.y or XPathGrammar.y.
+# OUTPUT_DIR is where the bison-generated .cpp and .h files should be placed.
+
+import errno
+import os
+import os.path
+import subprocess
+import sys
+
+assert len(sys.argv) == 3
+
+inputFile = sys.argv[1]
+outputDir = sys.argv[2]
+
+inputName = os.path.basename(inputFile)
+assert inputName == 'CSSGrammar.y' or inputName == 'XPathGrammar.y'
+prefix = {'CSSGrammar.y': 'cssyy', 'XPathGrammar.y': 'xpathyy'}[inputName]
+
+(inputRoot, inputExt) = os.path.splitext(inputName)
+
+# The generated .h will be in a different location depending on the bison
+# version.
+outputHTries = [
+ os.path.join(outputDir, inputRoot + '.cpp.h'),
+ os.path.join(outputDir, inputRoot + '.hpp'),
+]
+
+for outputHTry in outputHTries:
+ try:
+ os.unlink(outputHTry)
+ except OSError, e:
+ if e.errno != errno.ENOENT:
+ raise
+
+outputCpp = os.path.join(outputDir, inputRoot + '.cpp')
+
+returnCode = subprocess.call(['bison', '-d', '-p', prefix, inputFile, '-o', outputCpp])
+assert returnCode == 0
+
+# Find the name that bison used for the generated header file.
+outputHTmp = None
+for outputHTry in outputHTries:
+ try:
+ os.stat(outputHTry)
+ outputHTmp = outputHTry
+ break
+ except OSError, e:
+ if e.errno != errno.ENOENT:
+ raise
+
+assert outputHTmp != None
+
+# Read the header file in under the generated name and remove it.
+outputHFile = open(outputHTmp)
+outputHContents = outputHFile.read()
+outputHFile.close()
+os.unlink(outputHTmp)
+
+# Rewrite the generated header with #include guards.
+outputH = os.path.join(outputDir, inputRoot + '.h')
+
+outputHFile = open(outputH, 'w')
+print >>outputHFile, '#ifndef %sH' % inputRoot
+print >>outputHFile, '#define %sH' % inputRoot
+print >>outputHFile, outputHContents
+print >>outputHFile, '#endif'
+outputHFile.close()