Version 1.25.0-dev.11.0

Merge commit '9abec74aaff75c5b23db1daea81e66c69e63c01e' into dev
diff --git a/build/gypi_to_gn.py b/build/gypi_to_gn.py
new file mode 100644
index 0000000..a107f94
--- /dev/null
+++ b/build/gypi_to_gn.py
@@ -0,0 +1,167 @@
+# Copyright 2014 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.
+
+"""Converts a given gypi file to a python scope and writes the result to stdout.
+
+It is assumed that the file contains a toplevel dictionary, and this script
+will return that dictionary as a GN "scope" (see example below). This script
+does not know anything about GYP and it will not expand variables or execute
+conditions.
+
+It will strip conditions blocks.
+
+A variables block at the top level will be flattened so that the variables
+appear in the root dictionary. This way they can be returned to the GN code.
+
+Say your_file.gypi looked like this:
+  {
+     'sources': [ 'a.cc', 'b.cc' ],
+     'defines': [ 'ENABLE_DOOM_MELON' ],
+  }
+
+You would call it like this:
+  gypi_values = exec_script("//build/gypi_to_gn.py",
+                            [ rebase_path("your_file.gypi") ],
+                            "scope",
+                            [ "your_file.gypi" ])
+
+Notes:
+ - The rebase_path call converts the gypi file from being relative to the
+   current build file to being system absolute for calling the script, which
+   will have a different current directory than this file.
+
+ - The "scope" parameter tells GN to interpret the result as a series of GN
+   variable assignments.
+
+ - The last file argument to exec_script tells GN that the given file is a
+   dependency of the build so Ninja can automatically re-run GN if the file
+   changes.
+
+Read the values into a target like this:
+  component("mycomponent") {
+    sources = gypi_values.sources
+    defines = gypi_values.defines
+  }
+
+Sometimes your .gypi file will include paths relative to a different
+directory than the current .gn file. In this case, you can rebase them to
+be relative to the current directory.
+  sources = rebase_path(gypi_values.sources, ".",
+                        "//path/gypi/input/values/are/relative/to")
+
+This script will tolerate a 'variables' in the toplevel dictionary or not. If
+the toplevel dictionary just contains one item called 'variables', it will be
+collapsed away and the result will be the contents of that dictinoary. Some
+.gypi files are written with or without this, depending on how they expect to
+be embedded into a .gyp file.
+
+This script also has the ability to replace certain substrings in the input.
+Generally this is used to emulate GYP variable expansion. If you passed the
+argument "--replace=<(foo)=bar" then all instances of "<(foo)" in strings in
+the input will be replaced with "bar":
+
+  gypi_values = exec_script("//build/gypi_to_gn.py",
+                            [ rebase_path("your_file.gypi"),
+                              "--replace=<(foo)=bar"],
+                            "scope",
+                            [ "your_file.gypi" ])
+
+"""
+
+import gn_helpers
+from optparse import OptionParser
+import sys
+
+def LoadPythonDictionary(path):
+  file_string = open(path).read()
+  try:
+    file_data = eval(file_string, {'__builtins__': None}, None)
+  except SyntaxError, e:
+    e.filename = path
+    raise
+  except Exception, e:
+    raise Exception("Unexpected error while reading %s: %s" % (path, str(e)))
+
+  assert isinstance(file_data, dict), "%s does not eval to a dictionary" % path
+
+  # Flatten any variables to the top level.
+  if 'variables' in file_data:
+    file_data.update(file_data['variables'])
+    del file_data['variables']
+
+  # Strip any conditions.
+  if 'conditions' in file_data:
+    del file_data['conditions']
+  if 'target_conditions' in file_data:
+    del file_data['target_conditions']
+
+  # Strip targets in the toplevel, since some files define these and we can't
+  # slurp them in.
+  if 'targets' in file_data:
+    del file_data['targets']
+
+  return file_data
+
+
+def ReplaceSubstrings(values, search_for, replace_with):
+  """Recursively replaces substrings in a value.
+
+  Replaces all substrings of the "search_for" with "repace_with" for all
+  strings occurring in "values". This is done by recursively iterating into
+  lists as well as the keys and values of dictionaries."""
+  if isinstance(values, str):
+    return values.replace(search_for, replace_with)
+
+  if isinstance(values, list):
+    return [ReplaceSubstrings(v, search_for, replace_with) for v in values]
+
+  if isinstance(values, dict):
+    # For dictionaries, do the search for both the key and values.
+    result = {}
+    for key, value in values.items():
+      new_key = ReplaceSubstrings(key, search_for, replace_with)
+      new_value = ReplaceSubstrings(value, search_for, replace_with)
+      result[new_key] = new_value
+    return result
+
+  # Assume everything else is unchanged.
+  return values
+
+def main():
+  parser = OptionParser()
+  parser.add_option("-r", "--replace", action="append",
+    help="Replaces substrings. If passed a=b, replaces all substrs a with b.")
+  (options, args) = parser.parse_args()
+
+  if len(args) != 1:
+    raise Exception("Need one argument which is the .gypi file to read.")
+
+  data = LoadPythonDictionary(args[0])
+  if options.replace:
+    # Do replacements for all specified patterns.
+    for replace in options.replace:
+      split = replace.split('=')
+      # Allow "foo=" to replace with nothing.
+      if len(split) == 1:
+        split.append('')
+      assert len(split) == 2, "Replacement must be of the form 'key=value'."
+      data = ReplaceSubstrings(data, split[0], split[1])
+
+  # Sometimes .gypi files use the GYP syntax with percents at the end of the
+  # variable name (to indicate not to overwrite a previously-defined value):
+  #   'foo%': 'bar',
+  # Convert these to regular variables.
+  for key in data:
+    if len(key) > 1 and key[len(key) - 1] == '%':
+      data[key[:-1]] = data[key]
+      del data[key]
+
+  print gn_helpers.ToGNString(data)
+
+if __name__ == '__main__':
+  try:
+    main()
+  except Exception, e:
+    print str(e)
+    sys.exit(1)
diff --git a/build/mac/asan.gyp b/build/mac/asan.gyp
new file mode 100644
index 0000000..5231681
--- /dev/null
+++ b/build/mac/asan.gyp
@@ -0,0 +1,53 @@
+# Copyright (c) 2013 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.
+
+{
+   'targets': [
+     {
+       'target_name': 'asan_dynamic_runtime',
+       'type': 'none',
+       'variables': {
+         # Every target is going to depend on asan_dynamic_runtime, so allow
+         # this one to depend on itself.
+         'prune_self_dependency': 1,
+         # Path is relative to this GYP file.
+         'asan_rtl_mask_path':
+             '../../third_party/llvm-build/Release+Asserts/lib/clang/*/lib/darwin',
+         'asan_osx_dynamic':
+             '<(asan_rtl_mask_path)/libclang_rt.asan_osx_dynamic.dylib',
+         'asan_iossim_dynamic':
+             '<(asan_rtl_mask_path)/libclang_rt.asan_iossim_dynamic.dylib',
+       },
+       'conditions': [
+         ['OS=="mac"', {
+           'copies': [
+             {
+               'destination': '<(PRODUCT_DIR)',
+               'files': [
+                 '<!(/bin/ls <(asan_osx_dynamic))',
+               ],
+             },
+           ],
+         }],
+         # ASan works with iOS simulator only, not bare-metal iOS.
+         ['OS=="ios" and target_arch=="ia32"', {
+           'toolsets': ['host', 'target'],
+           'copies': [
+             {
+               'destination': '<(PRODUCT_DIR)',
+               'target_conditions': [
+                 ['_toolset=="host"', {
+                   'files': [ '<!(/bin/ls <(asan_osx_dynamic))'],
+                 }],
+                 ['_toolset=="target"', {
+                   'files': [ '<!(/bin/ls <(asan_iossim_dynamic))'],
+                 }],
+               ],
+             },
+           ],
+         }],
+       ],
+     },
+   ],
+}
diff --git a/build/sanitizers/sanitizers.gyp b/build/sanitizers/sanitizers.gyp
new file mode 100644
index 0000000..91dab8a
--- /dev/null
+++ b/build/sanitizers/sanitizers.gyp
@@ -0,0 +1,92 @@
+# Copyright 2014 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.
+
+{
+  'targets': [
+    {
+      'target_name': 'sanitizer_options',
+      'type': 'static_library',
+      'toolsets': ['host', 'target'],
+      'variables': {
+         # Every target is going to depend on sanitizer_options, so allow
+         # this one to depend on itself.
+         'prune_self_dependency': 1,
+         # Do not let 'none' targets depend on this one, they don't need to.
+         'link_dependency': 1,
+       },
+      'sources': [
+        'sanitizer_options.cc',
+      ],
+      'include_dirs': [
+        '../..',
+      ],
+      # Some targets may want to opt-out from ASan, TSan and MSan and link
+      # without the corresponding runtime libraries. We drop the libc++
+      # dependency and omit the compiler flags to avoid bringing instrumented
+      # code to those targets.
+      'conditions': [
+        ['use_custom_libcxx==1', {
+          'dependencies!': [
+            '../../buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
+          ],
+        }],
+        ['tsan==1', {
+          'sources': [
+            'tsan_suppressions.cc',
+          ],
+        }],
+        ['lsan==1', {
+          'sources': [
+            'lsan_suppressions.cc',
+          ],
+        }],
+        ['asan==1', {
+          'sources': [
+            'asan_suppressions.cc',
+          ],
+        }],
+      ],
+      'cflags/': [
+        ['exclude', '-fsanitize='],
+        ['exclude', '-fsanitize-'],
+      ],
+      'direct_dependent_settings': {
+        'ldflags': [
+          '-Wl,-u_sanitizer_options_link_helper',
+        ],
+        'target_conditions': [
+          ['_type=="executable"', {
+            'xcode_settings': {
+              'OTHER_LDFLAGS': [
+                '-Wl,-u,__sanitizer_options_link_helper',
+              ],
+            },
+          }],
+        ],
+      },
+    },
+    {
+      # Copy llvm-symbolizer to the product dir so that LKGR bots can package it.
+      'target_name': 'llvm-symbolizer',
+      'type': 'none',
+      'variables': {
+
+       # Path is relative to this GYP file.
+       'llvm_symbolizer_path':
+           '../../third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer<(EXECUTABLE_SUFFIX)',
+      },
+      'conditions': [
+        ['clang==1', {
+          'copies': [{
+            'destination': '<(PRODUCT_DIR)',
+            'files': [
+              '<(llvm_symbolizer_path)',
+            ],
+          }],
+        }],
+      ],
+    },
+  ],
+}
+
diff --git a/build/win/asan.gyp b/build/win/asan.gyp
new file mode 100644
index 0000000..d938426
--- /dev/null
+++ b/build/win/asan.gyp
@@ -0,0 +1,30 @@
+# Copyright (c) 2014 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.
+
+{
+   'targets': [
+     {
+       'target_name': 'asan_dynamic_runtime',
+       'type': 'none',
+       'variables': {
+         # Every target is going to depend on asan_dynamic_runtime, so allow
+         # this one to depend on itself.
+         'prune_self_dependency': 1,
+       },
+       'conditions': [
+         ['OS=="win"', {
+           'copies': [
+             {
+               'destination': '<(PRODUCT_DIR)',
+               'files': [
+                 # Path is relative to this GYP file.
+                 '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/lib/windows/clang_rt.asan_dynamic-i386.dll',
+               ],
+             },
+           ],
+         }],
+       ],
+     },
+   ],
+}
diff --git a/build/win/importlibs/create_import_lib.gypi b/build/win/importlibs/create_import_lib.gypi
new file mode 100644
index 0000000..9cb0d345
--- /dev/null
+++ b/build/win/importlibs/create_import_lib.gypi
@@ -0,0 +1,53 @@
+# Copyright (c) 2012 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.
+
+# This file is meant to be included into a target to provide a rule
+# to create import libraries from an import description file in a consistent
+# manner.
+#
+# To use this, create a gyp target with the following form:
+# {
+#   'target_name': 'my_proto_lib',
+#   'type': 'none',
+#   'sources': [
+#     'foo.imports',
+#     'bar.imports',
+#   ],
+#   'variables': {
+#     # Optional, see below: 'proto_in_dir': '.'
+#     'create_importlib': 'path-to-script',
+#     'lib_dir': 'path-to-output-directory',
+#   },
+#   'includes': ['path/to/this/gypi/file'],
+# }
+#
+# This will generate import libraries named 'foo.lib' and 'bar.lib' in the
+# specified lib directory.
+
+{
+  'variables': {
+    'create_importlib': '<(DEPTH)/build/win/importlibs/create_importlib_win.py',
+    'lib_dir': '<(PRODUCT_DIR)/lib',
+  },
+  'rules': [
+    {
+      'rule_name': 'create_import_lib',
+      'extension': 'imports',
+      'inputs': [
+        '<(create_importlib)',
+      ],
+      'outputs': [
+        '<(lib_dir)/<(RULE_INPUT_ROOT).lib',
+      ],
+      'action': [
+        'python',
+        '<(create_importlib)',
+        '--output-file', '<@(_outputs)',
+        '<(RULE_INPUT_PATH)',
+      ],
+      'message': 'Generating import library from <(RULE_INPUT_PATH)',
+      'process_outputs_as_sources': 0,
+    },
+  ],
+}
diff --git a/create_sdk.gyp b/create_sdk.gyp
new file mode 100644
index 0000000..9e41ef9
--- /dev/null
+++ b/create_sdk.gyp
@@ -0,0 +1,63 @@
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'targets': [
+    {
+      'target_name': 'create_sdk_internal',
+      'type': 'none',
+      'dependencies': [
+        'runtime/dart-runtime.gyp:dart',
+        'utils/compiler/compiler.gyp:dart2js',
+        'utils/pub/pub.gyp:pub',
+        'utils/dartfmt/dartfmt.gyp:dartfmt',
+        'utils/dartdoc/dartdoc.gyp:dartdoc',
+        'utils/analysis_server/analysis_server.gyp:analysis_server',
+        'utils/dartanalyzer/dartanalyzer.gyp:dartanalyzer',
+        'utils/dartdevc/dartdevc.gyp:dartdevc',
+      ],
+      'actions': [
+        {
+          'action_name': 'create_sdk_py',
+          'inputs': [
+            # Xcode can only handle a certain amount of files in one list
+            # (also depending on the length of the path from where you run).
+            '<!@(["python", "tools/list_files.py", "relative", "dart$",'
+                '"sdk/lib"])',
+            'sdk/lib/dart_client.platform',
+            'sdk/lib/dart_server.platform',
+            'sdk/lib/dart_shared.platform',
+            '<!@(["python", "tools/list_files.py", "relative", "", '
+                '"sdk/lib/_internal/js_runtime/lib/preambles"])',
+            '<!@(["python", "tools/list_files.py", "relative",  "", '
+                '"sdk/bin"])',
+            'tools/create_sdk.py',
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '<(SHARED_INTERMEDIATE_DIR)/dart2js.dart.snapshot',
+            '<(SHARED_INTERMEDIATE_DIR)/utils_wrapper.dart.snapshot',
+            '<(SHARED_INTERMEDIATE_DIR)/pub.dart.snapshot',
+            '<(SHARED_INTERMEDIATE_DIR)/dartanalyzer.dart.snapshot',
+            '<(SHARED_INTERMEDIATE_DIR)/dartdevc.dart.snapshot',
+            '<(SHARED_INTERMEDIATE_DIR)/dartfmt.dart.snapshot',
+            '<(SHARED_INTERMEDIATE_DIR)/analysis_server.dart.snapshot',
+            '<(SHARED_INTERMEDIATE_DIR)/dartdoc.dart.snapshot',
+            '<(SHARED_INTERMEDIATE_DIR)/spec.sum',
+            '<(SHARED_INTERMEDIATE_DIR)/strong.sum',
+            'tools/VERSION'
+          ],
+          'outputs': [
+            '<(PRODUCT_DIR)/dart-sdk/README',
+          ],
+          'action': [
+            'python',
+            'tools/create_sdk.py',
+            '--sdk_output_dir', '<(PRODUCT_DIR)/dart-sdk',
+            '--snapshot_location', '<(SHARED_INTERMEDIATE_DIR)/'
+          ],
+          'message': 'Creating SDK.',
+        },
+      ],
+    },
+  ],
+}
diff --git a/dart.gyp b/dart.gyp
new file mode 100644
index 0000000..70fd7162
--- /dev/null
+++ b/dart.gyp
@@ -0,0 +1,116 @@
+# Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'targets': [
+    {
+      'target_name': 'most',
+      'type': 'none',
+      'dependencies': [
+        'analysis_server',
+        'create_sdk',
+        'dart2js',
+        'dartanalyzer',
+        'dartdevc',
+        'runtime',
+        'samples',
+      ],
+    },
+    {
+      # This is the target that is built on the VM build bots.  It
+      # must depend on anything that is required by the VM test
+      # suites.
+      'target_name': 'runtime',
+      'type': 'none',
+      'dependencies': [
+        'runtime/dart-runtime.gyp:dart',
+        'runtime/dart-runtime.gyp:dart_bootstrap#host',
+        'runtime/dart-runtime.gyp:run_vm_tests',
+        'runtime/dart-runtime.gyp:process_test',
+        'runtime/dart-runtime.gyp:test_extension',
+        'runtime/dart-runtime.gyp:sample_extension',
+        'runtime/dart-runtime.gyp:generate_patched_sdk#host',
+      ],
+    },
+    {
+      # This is the target that is built on the VM build bots.  It
+      # must depend on anything that is required by the VM test
+      # suites.
+      'target_name': 'runtime_precompiled',
+      'type': 'none',
+      'dependencies': [
+        'runtime/dart-runtime.gyp:dart_precompiled_runtime',
+        'runtime/dart-runtime.gyp:dart_bootstrap#host',
+        'runtime/dart-runtime.gyp:process_test',
+        'runtime/dart-runtime.gyp:generate_patched_sdk#host',
+      ],
+    },
+
+    {
+      'target_name': 'create_sdk',
+      'type': 'none',
+      'dependencies': [
+        'create_sdk.gyp:create_sdk_internal',
+      ],
+    },
+    {
+      'target_name': 'dart2js',
+      'type': 'none',
+      'dependencies': [
+        'utils/compiler/compiler.gyp:dart2js',
+      ],
+    },
+    {
+      'target_name': 'dartanalyzer',
+      'type': 'none',
+      'dependencies': [
+        'utils/dartanalyzer/dartanalyzer.gyp:dartanalyzer',
+      ],
+    },
+    {
+      'target_name': 'dartdevc',
+      'type': 'none',
+      'dependencies': [
+        'utils/dartdevc/dartdevc.gyp:dartdevc',
+      ],
+    },
+    {
+      'target_name': 'dartfmt',
+      'type': 'none',
+      'dependencies': [
+        'utils/dartfmt/dartfmt.gyp:dartfmt',
+      ],
+    },
+    {
+      'target_name': 'analysis_server',
+      'type': 'none',
+      'dependencies': [
+        'utils/analysis_server/analysis_server.gyp:analysis_server',
+      ],
+    },
+    {
+      # This is the target that is built on the dart2js build bots.
+      # It must depend on anything that is required by the dart2js
+      # test suites.
+      'target_name': 'dart2js_bot',
+      'type': 'none',
+      'dependencies': [
+        'create_sdk',
+      ],
+    },
+    {
+      'target_name': 'samples',
+      'type': 'none',
+      'dependencies': [],
+      'conditions': [
+        ['OS!="android"', {
+           'dependencies': [
+             'runtime/dart-runtime.gyp:sample_extension',
+           ],
+          },
+        ],
+      ]
+    },
+  ],
+}
diff --git a/pkg/pkg_files.gyp b/pkg/pkg_files.gyp
new file mode 100644
index 0000000..9e41a67
--- /dev/null
+++ b/pkg/pkg_files.gyp
@@ -0,0 +1,83 @@
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'targets': [
+    # Other targets depend on pkg files, but have too many inputs, which causes
+    # issues on some platforms.
+    # This target lists all the files in pkg and third_party/pkg,
+    # and creates the timestamp pkg_files.stamp, which depends on some
+    # intermediate helper timestamps.
+    # We split third_party/pkg up into three groups, based on the first letter
+    # of the package name.
+    {
+      'target_name': 'pkg_files_stamp',
+      'type': 'none',
+      'actions': [
+        {
+          'action_name': 'make_pkg_files_stamp',
+          'inputs': [
+            '../tools/create_timestamp_file.py',
+            '<!@(["python", "../tools/list_dart_files.py", "relative", "."])',
+            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_a_k.stamp',
+            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_l_r.stamp',
+            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_s_z.stamp',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/pkg_files.stamp',
+          ],
+          'action': [
+            'python', '../tools/create_timestamp_file.py',
+            '<@(_outputs)',
+          ],
+        },
+        {
+          'action_name': 'make_third_party_pkg_files_a_k_stamp',
+          'inputs': [
+            '../tools/create_timestamp_file.py',
+            '<!@(["python", "../tools/list_dart_files.py", "relative", '
+                '"../third_party/pkg", "[a-k].*"])',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_a_k.stamp',
+          ],
+          'action': [
+            'python', '../tools/create_timestamp_file.py',
+            '<@(_outputs)',
+          ],
+        },
+        {
+          'action_name': 'make_third_party_pkg_files_l_r_stamp',
+          'inputs': [
+            '../tools/create_timestamp_file.py',
+            '<!@(["python", "../tools/list_dart_files.py", "relative", '
+                '"../third_party/pkg", "[l-r].*"])',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_l_r.stamp',
+          ],
+          'action': [
+            'python', '../tools/create_timestamp_file.py',
+            '<@(_outputs)',
+          ],
+        },
+        {
+          'action_name': 'make_third_party_pkg_files_s_z_stamp',
+          'inputs': [
+            '../tools/create_timestamp_file.py',
+            '<!@(["python", "../tools/list_dart_files.py", "relative", '
+                '"../third_party/pkg", "[s-z].*"])',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/third_party_pkg_files_s_z.stamp',
+          ],
+          'action': [
+            'python', '../tools/create_timestamp_file.py',
+            '<@(_outputs)',
+          ],
+        },
+      ],
+    },
+  ],
+}
diff --git a/runtime/bin/bin.gypi b/runtime/bin/bin.gypi
new file mode 100644
index 0000000..39b7412
--- /dev/null
+++ b/runtime/bin/bin.gypi
@@ -0,0 +1,1442 @@
+# Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'variables': {
+    'gen_source_dir': '<(SHARED_INTERMEDIATE_DIR)',
+
+    'io_cc_file': '<(gen_source_dir)/io_gen.cc',
+    'io_patch_cc_file': '<(gen_source_dir)/io_patch_gen.cc',
+    'html_cc_file': '<(gen_source_dir)/html_gen.cc',
+    'html_common_cc_file': '<(gen_source_dir)/html_common_gen.cc',
+    'js_cc_file': '<(gen_source_dir)/js_gen.cc',
+    'js_util_cc_file': '<(gen_source_dir)/js_util_gen.cc',
+    'blink_cc_file': '<(gen_source_dir)/blink_gen.cc',
+    'indexeddb_cc_file': '<(gen_source_dir)/indexeddb_gen.cc',
+    'cached_patches_cc_file': '<(gen_source_dir)/cached_patches_gen.cc',
+    'web_gl_cc_file': '<(gen_source_dir)/web_gl_gen.cc',
+    'metadata_cc_file': '<(gen_source_dir)/metadata_gen.cc',
+    'websql_cc_file': '<(gen_source_dir)/websql_gen.cc',
+    'svg_cc_file': '<(gen_source_dir)/svg_gen.cc',
+    'webaudio_cc_file': '<(gen_source_dir)/webaudio_gen.cc',
+
+    'builtin_in_cc_file': 'builtin_in.cc',
+    'builtin_cc_file': '<(gen_source_dir)/builtin_gen.cc',
+    'snapshot_in_cc_file': 'snapshot_in.cc',
+    'vm_isolate_snapshot_bin_file': '<(gen_source_dir)/vm_isolate_snapshot_gen.bin',
+    'isolate_snapshot_bin_file': '<(gen_source_dir)/isolate_snapshot_gen.bin',
+    'gen_snapshot_stamp_file': '<(gen_source_dir)/gen_snapshot.stamp',
+    'resources_cc_file': '<(gen_source_dir)/resources_gen.cc',
+    'snapshot_cc_file': '<(gen_source_dir)/snapshot_gen.cc',
+    'observatory_assets_cc_file': '<(gen_source_dir)/observatory_assets.cc',
+    'observatory_assets_tar_file': '<(gen_source_dir)/observatory_assets.tar',
+  },
+  'targets': [
+    {
+      'target_name': 'generate_builtin_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        'builtin_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_builtin_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(builtin_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(builtin_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(builtin_cc_file)',
+            '--input_cc', '<(builtin_in_cc_file)',
+            '--include', 'bin/builtin.h',
+            '--var_name', 'dart::bin::Builtin::_builtin_source_paths_',
+            '--library_name', 'dart:_builtin',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(builtin_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_io_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'sources': [
+        '../../sdk/lib/io/io.dart',
+      ],
+      'includes': [
+        '../../sdk/lib/io/io_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_io_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(builtin_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(io_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(io_cc_file)',
+            '--input_cc', '<(builtin_in_cc_file)',
+            '--include', 'bin/builtin.h',
+            '--var_name', 'dart::bin::Builtin::io_source_paths_',
+            '--library_name', 'dart:io',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(io_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_io_patch_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        'io_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_io_patch_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(builtin_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(io_patch_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(io_patch_cc_file)',
+            '--input_cc', '<(builtin_in_cc_file)',
+            '--include', 'bin/builtin.h',
+            '--var_name', 'dart::bin::Builtin::io_patch_paths_',
+            '--library_name', 'dart:io',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(io_patch_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_html_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'sources': [
+        '../../sdk/lib/html/dartium/html_dartium.dart',
+      ],
+      'actions': [
+      {
+        'action_name': 'generate_html_cc',
+        'inputs': [
+          '../tools/gen_library_src_paths.py',
+          '<(builtin_in_cc_file)',
+          '<@(_sources)',
+        ],
+        'outputs': [
+          '<(html_cc_file)',
+        ],
+        'action': [
+          'python',
+          'tools/gen_library_src_paths.py',
+          '--output', '<(html_cc_file)',
+          '--input_cc', '<(builtin_in_cc_file)',
+          '--include', 'bin/builtin.h',
+          '--var_name', 'dart::bin::Builtin::html_source_paths_',
+          '--library_name', 'dart:html',
+          '<@(_sources)',
+        ],
+        'message': 'Generating ''<(html_cc_file)'' file.'
+      },
+      ]
+    },
+    {
+      'target_name': 'generate_html_common_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'sources': [
+      '../../sdk/lib/html/html_common/html_common.dart',
+      '../../sdk/lib/html/html_common/css_class_set.dart',
+      '../../sdk/lib/html/html_common/device.dart',
+      '../../sdk/lib/html/html_common/filtered_element_list.dart',
+      '../../sdk/lib/html/html_common/lists.dart',
+      '../../sdk/lib/html/html_common/conversions.dart',
+      '../../sdk/lib/html/html_common/conversions_dartium.dart',
+      ],
+      'actions': [
+      {
+        'action_name': 'generate_html_common_cc',
+        'inputs': [
+        '../tools/gen_library_src_paths.py',
+        '<(builtin_in_cc_file)',
+        '<@(_sources)',
+        ],
+        'outputs': [
+        '<(html_common_cc_file)',
+        ],
+        'action': [
+        'python',
+        'tools/gen_library_src_paths.py',
+        '--output', '<(html_common_cc_file)',
+        '--input_cc', '<(builtin_in_cc_file)',
+        '--include', 'bin/builtin.h',
+        '--var_name', 'dart::bin::Builtin::html_common_source_paths_',
+        '--library_name', 'dart:html_common',
+        '<@(_sources)',
+        ],
+        'message': 'Generating ''<(html_common_cc_file)'' file.'
+      },
+      ]
+    },
+    {
+      'target_name': 'generate_js_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'sources': [
+      '../../sdk/lib/js/dartium/js_dartium.dart',
+      ],
+      'actions': [
+      {
+        'action_name': 'generate_js_cc',
+        'inputs': [
+        '../tools/gen_library_src_paths.py',
+        '<(builtin_in_cc_file)',
+        '<@(_sources)',
+        ],
+        'outputs': [
+        '<(js_cc_file)',
+        ],
+        'action': [
+        'python',
+        'tools/gen_library_src_paths.py',
+        '--output', '<(js_cc_file)',
+        '--input_cc', '<(builtin_in_cc_file)',
+        '--include', 'bin/builtin.h',
+        '--var_name', 'dart::bin::Builtin::js_source_paths_',
+        '--library_name', 'dart:js',
+        '<@(_sources)',
+        ],
+        'message': 'Generating ''<(js_cc_file)'' file.'
+      },
+      ]
+    },
+    {
+      'target_name': 'generate_js_util_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'sources': [
+      '../../sdk/lib/js_util/dartium/js_util_dartium.dart',
+      ],
+      'actions': [
+      {
+        'action_name': 'generate_js_util_cc',
+        'inputs': [
+        '../tools/gen_library_src_paths.py',
+        '<(builtin_in_cc_file)',
+        '<@(_sources)',
+        ],
+        'outputs': [
+        '<(js_util_cc_file)',
+        ],
+        'action': [
+        'python',
+        'tools/gen_library_src_paths.py',
+        '--output', '<(js_util_cc_file)',
+        '--input_cc', '<(builtin_in_cc_file)',
+        '--include', 'bin/builtin.h',
+        '--var_name', 'dart::bin::Builtin::js_util_source_paths_',
+        '--library_name', 'dart:js_util',
+        '<@(_sources)',
+        ],
+        'message': 'Generating ''<(js_util_cc_file)'' file.'
+      },
+      ]
+    },
+    {
+      'target_name': 'generate_blink_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'sources': [
+      '../../sdk/lib/_blink/dartium/_blink_dartium.dart',
+      ],
+      'actions': [
+      {
+        'action_name': 'generate_blink_cc',
+        'inputs': [
+        '../tools/gen_library_src_paths.py',
+        '<(builtin_in_cc_file)',
+        '<@(_sources)',
+        ],
+        'outputs': [
+        '<(blink_cc_file)',
+        ],
+        'action': [
+        'python',
+        'tools/gen_library_src_paths.py',
+        '--output', '<(blink_cc_file)',
+        '--input_cc', '<(builtin_in_cc_file)',
+        '--include', 'bin/builtin.h',
+        '--var_name', 'dart::bin::Builtin::_blink_source_paths_',
+        '--library_name', 'dart:_blink',
+        '<@(_sources)',
+        ],
+        'message': 'Generating ''<(blink_cc_file)'' file.'
+      },
+      ]
+    },
+    {
+      'target_name': 'generate_indexeddb_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'sources': [
+      '../../sdk/lib/indexed_db/dartium/indexed_db_dartium.dart',
+      ],
+      'actions': [
+      {
+        'action_name': 'generate_indexeddb_cc',
+        'inputs': [
+        '../tools/gen_library_src_paths.py',
+        '<(builtin_in_cc_file)',
+        '<@(_sources)',
+        ],
+        'outputs': [
+        '<(indexeddb_cc_file)',
+        ],
+        'action': [
+        'python',
+        'tools/gen_library_src_paths.py',
+        '--output', '<(indexeddb_cc_file)',
+        '--input_cc', '<(builtin_in_cc_file)',
+        '--include', 'bin/builtin.h',
+        '--var_name', 'dart::bin::Builtin::indexed_db_source_paths_',
+        '--library_name', 'dart:indexed_db',
+        '<@(_sources)',
+        ],
+        'message': 'Generating ''<(indexeddb_cc_file)'' file.'
+      },
+      ]
+    },
+    {
+      'target_name': 'generate_cached_patches_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'sources': [
+      '../../sdk/lib/js/dartium/cached_patches.dart',
+      ],
+      'actions': [
+      {
+        'action_name': 'generate_cached_patches_cc',
+        'inputs': [
+        '../tools/gen_library_src_paths.py',
+        '<(builtin_in_cc_file)',
+        '<@(_sources)',
+        ],
+        'outputs': [
+        '<(cached_patches_cc_file)',
+        ],
+        'action': [
+        'python',
+        'tools/gen_library_src_paths.py',
+        '--output', '<(cached_patches_cc_file)',
+        '--input_cc', '<(builtin_in_cc_file)',
+        '--include', 'bin/builtin.h',
+        '--var_name', 'dart::bin::Builtin::cached_patches_source_paths_',
+        '--library_name', 'cached_patches.dart',
+        '<@(_sources)',
+        ],
+        'message': 'Generating ''<(cached_patches_cc_file)'' file.'
+      },
+      ]
+    },
+    {
+      'target_name': 'generate_web_gl_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'sources': [
+      '../../sdk/lib/web_gl/dartium/web_gl_dartium.dart',
+      ],
+      'actions': [
+      {
+        'action_name': 'generate_web_gl_cc',
+        'inputs': [
+        '../tools/gen_library_src_paths.py',
+        '<(builtin_in_cc_file)',
+        '<@(_sources)',
+        ],
+        'outputs': [
+        '<(web_gl_cc_file)',
+        ],
+        'action': [
+        'python',
+        'tools/gen_library_src_paths.py',
+        '--output', '<(web_gl_cc_file)',
+        '--input_cc', '<(builtin_in_cc_file)',
+        '--include', 'bin/builtin.h',
+        '--var_name', 'dart::bin::Builtin::web_gl_source_paths_',
+        '--library_name', 'dart:web_gl',
+        '<@(_sources)',
+        ],
+        'message': 'Generating ''<(web_gl_cc_file)'' file.'
+      },
+      ]
+    },
+    {
+      'target_name': 'generate_metadata_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'sources': [
+      '../../sdk/lib/html/html_common/metadata.dart',
+      ],
+      'actions': [
+      {
+        'action_name': 'generate_metadata_cc',
+        'inputs': [
+        '../tools/gen_library_src_paths.py',
+        '<(builtin_in_cc_file)',
+        '<@(_sources)',
+        ],
+        'outputs': [
+        '<(metadata_cc_file)',
+        ],
+        'action': [
+        'python',
+        'tools/gen_library_src_paths.py',
+        '--output', '<(metadata_cc_file)',
+        '--input_cc', '<(builtin_in_cc_file)',
+        '--include', 'bin/builtin.h',
+        '--var_name', 'dart::bin::Builtin::metadata_source_paths_',
+        '--library_name', 'metadata.dart',
+        '<@(_sources)',
+        ],
+        'message': 'Generating ''<(metadata_cc_file)'' file.'
+      },
+      ]
+    },
+    {
+      'target_name': 'generate_websql_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'sources': [
+      '../../sdk/lib/web_sql/dartium/web_sql_dartium.dart',
+      ],
+      'actions': [
+      {
+        'action_name': 'generate_websql_cc',
+        'inputs': [
+        '../tools/gen_library_src_paths.py',
+        '<(builtin_in_cc_file)',
+        '<@(_sources)',
+        ],
+        'outputs': [
+        '<(websql_cc_file)',
+        ],
+        'action': [
+        'python',
+        'tools/gen_library_src_paths.py',
+        '--output', '<(websql_cc_file)',
+        '--input_cc', '<(builtin_in_cc_file)',
+        '--include', 'bin/builtin.h',
+        '--var_name', 'dart::bin::Builtin::web_sql_source_paths_',
+        '--library_name', 'dart:web_sql',
+        '<@(_sources)',
+        ],
+        'message': 'Generating ''<(websql_cc_file)'' file.'
+      },
+      ]
+    },
+    {
+      'target_name': 'generate_svg_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'sources': [
+      '../../sdk/lib/svg/dartium/svg_dartium.dart',
+      ],
+      'actions': [
+      {
+        'action_name': 'generate_svg_cc',
+        'inputs': [
+        '../tools/gen_library_src_paths.py',
+        '<(builtin_in_cc_file)',
+        '<@(_sources)',
+        ],
+        'outputs': [
+        '<(svg_cc_file)',
+        ],
+        'action': [
+        'python',
+        'tools/gen_library_src_paths.py',
+        '--output', '<(svg_cc_file)',
+        '--input_cc', '<(builtin_in_cc_file)',
+        '--include', 'bin/builtin.h',
+        '--var_name', 'dart::bin::Builtin::svg_source_paths_',
+        '--library_name', 'dart:svg',
+        '<@(_sources)',
+        ],
+        'message': 'Generating ''<(svg_cc_file)'' file.'
+      },
+      ]
+    },
+    {
+      'target_name': 'generate_webaudio_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'sources': [
+      '../../sdk/lib/web_audio/dartium/web_audio_dartium.dart',
+      ],
+      'actions': [
+      {
+        'action_name': 'generate_webaudio_cc',
+        'inputs': [
+        '../tools/gen_library_src_paths.py',
+        '<(builtin_in_cc_file)',
+        '<@(_sources)',
+        ],
+        'outputs': [
+        '<(webaudio_cc_file)',
+        ],
+        'action': [
+        'python',
+        'tools/gen_library_src_paths.py',
+        '--output', '<(webaudio_cc_file)',
+        '--input_cc', '<(builtin_in_cc_file)',
+        '--include', 'bin/builtin.h',
+        '--var_name', 'dart::bin::Builtin::web_audio_source_paths_',
+        '--library_name', 'dart:web_audio',
+        '<@(_sources)',
+        ],
+        'message': 'Generating ''<(webaudio_cc_file)'' file.'
+      },
+      ]
+    },
+   {
+      'target_name': 'libdart_builtin',
+      'type': 'static_library',
+      'toolsets':['target','host'],
+      'dependencies': [
+        'generate_builtin_cc_file#host',
+        'generate_io_cc_file#host',
+        'generate_io_patch_cc_file#host',
+        'generate_html_cc_file#host',
+        'generate_html_common_cc_file#host',
+        'generate_js_cc_file#host',
+        'generate_js_util_cc_file#host',
+        'generate_blink_cc_file#host',
+        'generate_indexeddb_cc_file#host',
+        'generate_cached_patches_cc_file#host',
+        'generate_web_gl_cc_file#host',
+        'generate_metadata_cc_file#host',
+        'generate_websql_cc_file#host',
+        'generate_svg_cc_file#host',
+        'generate_webaudio_cc_file#host',
+      ],
+      'include_dirs': [
+        '..',
+      ],
+      'sources': [
+        'log_android.cc',
+        'log_linux.cc',
+        'log_macos.cc',
+        'log_win.cc',
+      ],
+      'includes': [
+        'builtin_impl_sources.gypi',
+        '../platform/platform_sources.gypi',
+      ],
+      'sources/': [
+        ['exclude', '_test\\.(cc|h)$'],
+      ],
+      'conditions': [
+        ['dart_io_support==0', {
+          'defines': [
+            'DART_IO_DISABLED',
+          ],
+        }],
+        ['OS=="win"', {
+          'sources/' : [
+            ['exclude', 'fdutils.h'],
+          ],
+          # TODO(antonm): fix the implementation.
+          # Current implementation accepts char* strings
+          # and therefore fails to compile once _UNICODE is
+          # enabled.  That should be addressed using -A
+          # versions of functions and adding necessary conversions.
+          'configurations': {
+            'Common_Base': {
+              'msvs_configuration_attributes': {
+                'CharacterSet': '0',
+              },
+            },
+          },
+        }],
+        ['OS=="linux"', {
+          'link_settings': {
+            'libraries': [
+              '-ldl',
+            ],
+          },
+        }],
+        ['OS=="android"', {
+          'link_settings': {
+            'libraries': [
+              '-ldl',
+            ],
+          },
+        }],
+      ],
+    },
+    # This is the same as libdart_builtin, but the io support libraries are
+    # never disabled, even when dart_io_support==0. This is so that it can
+    # still be usefully linked into gen_snapshot.
+    {
+      'target_name': 'libdart_builtin_no_disable',
+      'type': 'static_library',
+      'toolsets':['host'],
+      'dependencies': [
+        'generate_builtin_cc_file#host',
+        'generate_io_cc_file#host',
+        'generate_io_patch_cc_file#host',
+      ],
+      'include_dirs': [
+        '..',
+      ],
+      'sources': [
+        'log_android.cc',
+        'log_linux.cc',
+        'log_macos.cc',
+        'log_win.cc',
+      ],
+      'includes': [
+        'builtin_impl_sources.gypi',
+        '../platform/platform_sources.gypi',
+      ],
+      'sources/': [
+        ['exclude', '_test\\.(cc|h)$'],
+      ],
+      'conditions': [
+        ['OS=="win"', {
+          'sources/' : [
+            ['exclude', 'fdutils.h'],
+          ],
+          # TODO(antonm): fix the implementation.
+          # Current implementation accepts char* strings
+          # and therefore fails to compile once _UNICODE is
+          # enabled.  That should be addressed using -A
+          # versions of functions and adding necessary conversions.
+          'configurations': {
+            'Common_Base': {
+              'msvs_configuration_attributes': {
+                'CharacterSet': '0',
+              },
+            },
+          },
+        }],
+        ['OS=="linux"', {
+          'link_settings': {
+            'libraries': [
+              '-ldl',
+            ],
+          },
+        }],
+        ['OS=="android"', {
+          'link_settings': {
+            'libraries': [
+              '-ldl',
+            ],
+          },
+        }],
+      ],
+    },
+    # This is a combination of libdart_io, libdart_builtin, and vmservice bits.
+    # The dart_io is built without support for secure sockets.
+    {
+      'target_name': 'libvmservice_io',
+      'type': 'static_library',
+      'toolsets': ['host', 'target'],
+      'include_dirs': [
+        '..',
+        '../../third_party',
+        '../include',
+      ],
+      'includes': [
+        'io_impl_sources.gypi',
+        'builtin_impl_sources.gypi',
+      ],
+      'dependencies': [
+        'generate_builtin_cc_file#host',
+        'generate_io_cc_file#host',
+        'generate_io_patch_cc_file#host',
+        'generate_snapshot_file#host',
+        'generate_resources_cc_file#host',
+        'generate_observatory_assets_cc_file#host',
+      ],
+      'sources': [
+        'builtin_common.cc',
+        'builtin_natives.cc',
+        'builtin_nolib.cc',
+        'builtin.h',
+        'dartutils.cc',
+        'dartutils.h',
+        'io_natives.cc',
+        'io_natives.h',
+        'log_android.cc',
+        'log_linux.cc',
+        'log_macos.cc',
+        'log_win.cc',
+        'vmservice_dartium.h',
+        'vmservice_dartium.cc',
+        'vmservice_impl.cc',
+        'vmservice_impl.h',
+        '<(resources_cc_file)',
+        '<(observatory_assets_cc_file)',
+      ],
+      'sources/': [
+        ['exclude', '_test\\.(cc|h)$'],
+      ],
+      'conditions': [
+        ['OS != "mac" and dart_io_support==1 and dart_io_secure_socket==1', {
+          'dependencies': [
+            '../third_party/boringssl/boringssl_dart.gyp:boringssl',
+          ],
+        }],
+        ['dart_io_secure_socket==0 or dart_io_support==0', {
+          'defines': [
+            'DART_IO_SECURE_SOCKET_DISABLED'
+          ],
+        }, {
+          'sources': [
+            '../../third_party/root_certificates/root_certificates.cc',
+          ],
+        }],
+        ['OS=="win"', {
+          'sources/' : [
+            ['exclude', 'fdutils.h'],
+          ],
+          # TODO(antonm): fix the implementation.
+          # Current implementation accepts char* strings
+          # and therefore fails to compile once _UNICODE is
+          # enabled.  That should be addressed using -A
+          # versions of functions and adding necessary conversions.
+          'configurations': {
+            'Common_Base': {
+              'msvs_configuration_attributes': {
+                'CharacterSet': '0',
+              },
+            },
+          },
+          'link_settings': {
+            'libraries': [ '-liphlpapi.lib', '-lws2_32.lib', '-lRpcrt4.lib' ],
+          },
+        }],
+        ['OS=="mac"', {
+          'link_settings': {
+            'libraries': [
+              '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
+              '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
+              '$(SDKROOT)/System/Library/Frameworks/Security.framework',
+            ],
+          },
+        }],
+        ['OS=="linux"', {
+          'link_settings': {
+            'libraries': [
+              '-ldl',
+            ],
+          },
+        }],
+        ['OS=="android"', {
+          'link_settings': {
+            'libraries': [
+              '-ldl',
+            ],
+          },
+        }],
+      ],
+    },
+    {
+      'target_name': 'libdart_io',
+      'type': 'static_library',
+      'toolsets': ['host', 'target'],
+      'include_dirs': [
+        '..',
+        '../../third_party',
+      ],
+      'includes': [
+        'io_impl_sources.gypi',
+      ],
+      'sources': [
+        'io_natives.h',
+        'io_natives.cc',
+      ],
+      'conditions': [
+        ['dart_io_support==1', {
+          'dependencies': [
+            'bin/zlib.gyp:zlib_dart',
+          ],
+        }, {  # dart_io_support == 0
+          'defines': [
+            'DART_IO_DISABLED',
+            'DART_IO_SECURE_SOCKET_DISABLED',
+          ],
+        }],
+        ['dart_io_secure_socket==0', {
+          'defines': [
+            'DART_IO_SECURE_SOCKET_DISABLED'
+          ],
+        }, {
+          'sources': [
+            '../../third_party/root_certificates/root_certificates.cc',
+          ],
+        }],
+        ['OS != "mac" and dart_io_support==1 and dart_io_secure_socket==1', {
+          'dependencies': [
+            '../third_party/boringssl/boringssl_dart.gyp:boringssl',
+          ],
+        }],
+        ['OS=="win"', {
+          'link_settings': {
+            'libraries': [ '-liphlpapi.lib' ],
+          },
+          # TODO(antonm): fix the implementation.
+          # Current implementation accepts char* strings
+          # and therefore fails to compile once _UNICODE is
+          # enabled.  That should be addressed using -A
+          # versions of functions and adding necessary conversions.
+          'configurations': {
+            'Common_Base': {
+              'msvs_configuration_attributes': {
+                'CharacterSet': '0',
+              },
+            },
+          },
+        }],
+        ['OS=="mac"', {
+          'link_settings': {
+            'libraries': [
+              '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
+              '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
+              '$(SDKROOT)/System/Library/Frameworks/Security.framework',
+            ],
+          },
+        }],
+      ],
+    },
+    # This is the same as libdart_io, but the io support libraries are
+    # never disabled, even when dart_io_support==0. This is so that it can
+    # still be usefully linked into gen_snapshot.
+    {
+      'target_name': 'libdart_io_no_disable',
+      'type': 'static_library',
+      'toolsets': ['host'],
+      'include_dirs': [
+        '..',
+        '../../third_party',
+      ],
+      'includes': [
+        'io_impl_sources.gypi',
+      ],
+      'sources': [
+        'io_natives.h',
+        'io_natives.cc',
+      ],
+      'dependencies': [
+        'bin/zlib.gyp:zlib_dart',
+      ],
+      'conditions': [
+        ['dart_io_support==0 or dart_io_secure_socket==0', {
+          'defines': [
+            'DART_IO_SECURE_SOCKET_DISABLED',
+          ],
+        }, {
+          'sources': [
+            '../../third_party/root_certificates/root_certificates.cc',
+          ],
+        }],
+        ['OS != "mac" and dart_io_support==1 and dart_io_secure_socket==1', {
+          'dependencies': [
+            '../third_party/boringssl/boringssl_dart.gyp:boringssl',
+          ],
+        }],
+        ['OS=="win"', {
+          'link_settings': {
+            'libraries': [ '-liphlpapi.lib' ],
+          },
+          # TODO(antonm): fix the implementation.
+          # Current implementation accepts char* strings
+          # and therefore fails to compile once _UNICODE is
+          # enabled.  That should be addressed using -A
+          # versions of functions and adding necessary conversions.
+          'configurations': {
+            'Common_Base': {
+              'msvs_configuration_attributes': {
+                'CharacterSet': '0',
+              },
+            },
+          },
+        }],
+        ['OS=="mac"', {
+          'link_settings': {
+            'libraries': [
+              '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
+              '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
+              '$(SDKROOT)/System/Library/Frameworks/Security.framework',
+            ],
+          },
+        }],
+      ],
+    },
+    {
+      'target_name': 'libdart_nosnapshot',
+      'type': 'static_library',
+      'toolsets':['target','host'],
+      'dependencies': [
+        'libdart_lib_nosnapshot',
+        'libdart_vm_nosnapshot',
+        'libdouble_conversion',
+        'generate_version_cc_file#host',
+      ],
+      'include_dirs': [
+        '..',
+      ],
+      'sources': [
+        '../include/dart_api.h',
+        '../include/dart_mirrors_api.h',
+        '../include/dart_native_api.h',
+        '../include/dart_tools_api.h',
+        '../vm/dart_api_impl.cc',
+        '../vm/debugger_api_impl.cc',
+        '../vm/mirrors_api_impl.cc',
+        '../vm/native_api_impl.cc',
+        '<(version_cc_file)',
+      ],
+      'defines': [
+        'DART_SHARED_LIB',
+        'DART_NO_SNAPSHOT',
+        'DART_PRECOMPILER',
+      ],
+    },
+    {
+      # Completely statically linked binary for generating snapshots.
+      'target_name': 'gen_snapshot',
+      'type': 'executable',
+      'toolsets':['host'],
+      'dependencies': [
+        'generate_resources_cc_file#host',
+        'generate_observatory_assets_cc_file#host',
+        'libdart_nosnapshot#host',
+        # If io is disabled for the VM, we still need it for gen snapshot, so
+        # use libdart_builtin and libdart_io that still have io enabled.
+        'libdart_builtin_no_disable#host',
+        'libdart_io_no_disable#host',
+      ],
+      'include_dirs': [
+        '..',
+      ],
+      'sources': [
+        'address_sanitizer.cc',
+        'gen_snapshot.cc',
+        # Very limited native resolver provided.
+        'builtin_gen_snapshot.cc',
+        'builtin_common.cc',
+        'builtin.cc',
+        'builtin.h',
+        'dfe.cc',
+        'dfe.h',
+        'loader.cc',
+        'loader.h',
+        'platform_android.cc',
+        'platform_linux.cc',
+        'platform_macos.cc',
+        'platform_win.cc',
+        'platform.h',
+        'vmservice_impl.cc',
+        'vmservice_impl.h',
+        # Include generated source files.
+        '<(builtin_cc_file)',
+        '<(io_cc_file)',
+        '<(io_patch_cc_file)',
+        '<(resources_cc_file)',
+      ],
+      'defines': [
+        'PLATFORM_DISABLE_SOCKET',
+      ],
+      'conditions': [
+        ['OS=="win"', {
+          'link_settings': {
+            'libraries': [ '-lws2_32.lib', '-lRpcrt4.lib' ],
+          },
+        }],
+      ],
+    },
+    {
+      # Generate snapshot bin file.
+      'target_name': 'generate_snapshot_bin',
+      'type': 'none',
+      'toolsets':['host'],
+      'dependencies': [
+        'gen_snapshot#host',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_snapshot_bin',
+          'inputs': [
+            '../tools/create_snapshot_bin.py',
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen_snapshot<(EXECUTABLE_SUFFIX)',
+          ],
+          'outputs': [
+            '<(gen_snapshot_stamp_file)',
+          ],
+          'action': [
+            'python',
+            'tools/create_snapshot_bin.py',
+            '--executable',
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen_snapshot<(EXECUTABLE_SUFFIX)',
+            '--snapshot_kind', 'core',
+            '--vm_output_bin', '<(vm_isolate_snapshot_bin_file)',
+            '--isolate_output_bin', '<(isolate_snapshot_bin_file)',
+            '--timestamp_file', '<(gen_snapshot_stamp_file)',
+          ],
+          'message': 'Generating ''<(vm_isolate_snapshot_bin_file)'' ''<(isolate_snapshot_bin_file)'' files.'
+        },
+      ],
+    },
+    {
+      # Generate snapshot file.
+      'target_name': 'generate_snapshot_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'dependencies': [
+        'generate_snapshot_bin#host',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_snapshot_file',
+          'inputs': [
+            '../tools/create_snapshot_file.py',
+            '<(gen_snapshot_stamp_file)',
+            '<(snapshot_in_cc_file)',
+          ],
+          'outputs': [
+            '<(snapshot_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/create_snapshot_file.py',
+            '--vm_input_bin', '<(vm_isolate_snapshot_bin_file)',
+            '--input_bin', '<(isolate_snapshot_bin_file)',
+            '--input_cc', '<(snapshot_in_cc_file)',
+            '--output', '<(snapshot_cc_file)',
+          ],
+          'message': 'Generating ''<(snapshot_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_observatory_assets_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'dependencies': [
+        'build_observatory#host',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_observatory_assets_cc_file',
+          'inputs': [
+            '../tools/create_archive.py',
+            '<(PRODUCT_DIR)/observatory/deployed/web/index.html'
+          ],
+          'outputs': [
+            '<(observatory_assets_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/create_archive.py',
+            '--output', '<(observatory_assets_cc_file)',
+            '--tar_output', '<(observatory_assets_tar_file)',
+            '--outer_namespace', 'dart',
+            '--inner_namespace', 'bin',
+            '--name', 'observatory_assets_archive',
+            '--compress',
+            '--client_root', '<(PRODUCT_DIR)/observatory/deployed/web/',
+          ],
+          'message': 'Generating ''<(observatory_assets_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_resources_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        'vmservice/vmservice_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_resources_cc',
+          'inputs': [
+            '../tools/create_resources.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(resources_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/create_resources.py',
+            '--output', '<(resources_cc_file)',
+            '--outer_namespace', 'dart',
+            '--inner_namespace', 'bin',
+            '--table_name', 'service_bin',
+            '--root_prefix', 'bin/',
+            '<@(_sources)'
+          ],
+          'message': 'Generating ''<(resources_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      # dart binary with a snapshot of corelibs built in.
+      'target_name': 'dart',
+      'type': 'executable',
+      'dependencies': [
+        'bin/zlib.gyp:zlib_dart',
+        'build_observatory#host',
+        'generate_observatory_assets_cc_file#host',
+        'generate_resources_cc_file#host',
+        'generate_snapshot_file#host',
+        'libdart',
+        'libdart_builtin',
+        'libdart_io',
+      ],
+      'include_dirs': [
+        '..',
+        '../../third_party/', # Zlib
+      ],
+      'sources': [
+        'builtin.h',
+        'builtin_common.cc',
+        'builtin_natives.cc',
+        'builtin_nolib.cc',
+	'dfe.cc',
+	'dfe.h',
+        'error_exit.cc',
+        'error_exit.h',
+        'io_natives.h',
+        'loader.cc',
+        'loader.h',
+        'main.cc',
+        'snapshot_utils.cc',
+        'snapshot_utils.h',
+        'vmservice_impl.cc',
+        'vmservice_impl.h',
+        '<(observatory_assets_cc_file)',
+        '<(resources_cc_file)',
+        '<(snapshot_cc_file)',
+      ],
+      'conditions': [
+        ['OS=="win"', {
+          'link_settings': {
+            'libraries': [ '-lws2_32.lib', '-lRpcrt4.lib', '-lwinmm.lib' ],
+          },
+          # Generate an import library on Windows, by exporting a function.
+          # Extensions use this import library to link to the API in dart.exe.
+          'msvs_settings': {
+            'VCLinkerTool': {
+              'AdditionalOptions': [ '/EXPORT:Dart_True' ],
+            },
+          },
+        }],
+        ['OS == "linux" and asan == 0 and msan == 0 and tsan == 0', {
+          'dependencies': [
+            '../third_party/tcmalloc/tcmalloc.gypi:tcmalloc',
+          ],
+        }],
+      ],
+      'configurations': {
+        'Dart_Linux_Base': {
+          # Have the linker add all symbols to the dynamic symbol table
+          # so that extensions can look them up dynamically in the binary.
+          'ldflags': [
+            '-rdynamic',
+          ],
+        },
+      },
+    },
+    {
+      # dart binary for running precompiled snapshots without the compiler.
+      'target_name': 'dart_precompiled_runtime',
+      'type': 'executable',
+      'dependencies': [
+        'bin/zlib.gyp:zlib_dart',
+        'build_observatory#host',
+        'generate_observatory_assets_cc_file#host',
+        'generate_resources_cc_file#host',
+        'libdart_builtin',
+        'libdart_io',
+        'libdart_precompiled_runtime',
+      ],
+      'include_dirs': [
+        '..',
+        '../../third_party/', # Zlib
+      ],
+      'sources': [
+        'builtin.h',
+        'builtin_common.cc',
+        'builtin_natives.cc',
+        'builtin_nolib.cc',
+        'error_exit.cc',
+        'error_exit.h',
+        'io_natives.h',
+        'main.cc',
+        'loader.cc',
+        'loader.h',
+        'snapshot_empty.cc',
+        'snapshot_utils.cc',
+        'snapshot_utils.h',
+        'vmservice_impl.cc',
+        'vmservice_impl.h',
+        '<(observatory_assets_cc_file)',
+        '<(resources_cc_file)',
+      ],
+      'defines': [
+        'DART_PRECOMPILED_RUNTIME',
+      ],
+      'conditions': [
+        ['OS=="win"', {
+          'link_settings': {
+            'libraries': [ '-lws2_32.lib', '-lRpcrt4.lib', '-lwinmm.lib' ],
+          },
+          # Generate an import library on Windows, by exporting a function.
+          # Extensions use this import library to link to the API in dart.exe.
+          'msvs_settings': {
+            'VCLinkerTool': {
+              'AdditionalOptions': [ '/EXPORT:Dart_True' ],
+            },
+          },
+        }],
+      ],
+    },
+    {
+      # dart binary built for the host. It does not use a snapshot
+      # and does not include Observatory.
+      'target_name': 'dart_bootstrap',
+      'type': 'executable',
+      'toolsets':['host'],
+      'dependencies': [
+        'generate_resources_cc_file#host',
+        'libdart_builtin',
+        'libdart_io',
+        'libdart_nosnapshot',
+      ],
+      'include_dirs': [
+        '..',
+      ],
+      'sources': [
+        'builtin.cc',
+        'builtin.h',
+        'builtin_common.cc',
+        'builtin_natives.cc',
+	'dfe.cc',
+	'dfe.h',
+        'error_exit.cc',
+        'error_exit.h',
+        'io_natives.h',
+        'loader.cc',
+        'loader.h',
+        'main.cc',
+        'observatory_assets_empty.cc',
+        'snapshot_empty.cc',
+        'snapshot_utils.cc',
+        'snapshot_utils.h',
+        'vmservice_impl.cc',
+        'vmservice_impl.h',
+        # Include generated source files.
+        '<(builtin_cc_file)',
+        '<(io_cc_file)',
+        '<(io_patch_cc_file)',
+        '<(html_cc_file)',
+        '<(html_common_cc_file)',
+        '<(js_cc_file)',
+        '<(js_util_cc_file)',
+        '<(blink_cc_file)',
+        '<(indexeddb_cc_file)',
+        '<(cached_patches_cc_file)',
+        '<(web_gl_cc_file)',
+        '<(metadata_cc_file)',
+        '<(websql_cc_file)',
+        '<(svg_cc_file)',
+        '<(webaudio_cc_file)',
+
+        '<(resources_cc_file)',
+      ],
+      'defines': [
+        'DART_NO_SNAPSHOT',
+        'DART_PRECOMPILER',
+      ],
+      'conditions': [
+        ['OS=="win"', {
+          'link_settings': {
+            'libraries': [ '-lws2_32.lib', '-lRpcrt4.lib', '-lwinmm.lib' ],
+          },
+          # Generate an import library on Windows, by exporting a function.
+          # Extensions use this import library to link to the API in dart.exe.
+          'msvs_settings': {
+            'VCLinkerTool': {
+              'AdditionalOptions': [ '/EXPORT:Dart_True' ],
+            },
+          },
+        }],
+      ],
+      'configurations': {
+        'Dart_Linux_Base': {
+          # Have the linker add all symbols to the dynamic symbol table
+          # so that extensions can look them up dynamically in the binary.
+          'ldflags': [
+            '-rdynamic',
+          ],
+        },
+      },
+    },
+    {
+      'target_name': 'process_test',
+      'type': 'executable',
+      'sources': [
+        'process_test.cc',
+      ]
+    },
+    {
+      'target_name': 'run_vm_tests',
+      'type': 'executable',
+      'dependencies': [
+        'libdart',
+        'libdart_builtin',
+        'libdart_io',
+        'generate_snapshot_file#host',
+        'generate_snapshot_test_dat_file#host',
+      ],
+      'include_dirs': [
+        '..',
+        '<(gen_source_dir)',
+      ],
+      'sources': [
+        'run_vm_tests.cc',
+        'error_exit.cc',
+        'error_exit.h',
+        'builtin_common.cc',
+        'builtin_natives.cc',
+        'builtin_nolib.cc',
+        'builtin.h',
+	'dfe.cc',
+	'dfe.h',
+        'io_natives.h',
+        'loader.cc',
+        'loader.h',
+        'snapshot_utils.cc',
+        'snapshot_utils.h',
+        # Include generated source files.
+        '<(snapshot_cc_file)',
+        '<(builtin_cc_file)',
+        '<(io_cc_file)',
+        '<(io_patch_cc_file)',
+      ],
+      'includes': [
+        'builtin_impl_sources.gypi',
+        '../platform/platform_sources.gypi',
+        '../vm/vm_sources.gypi',
+      ],
+      'defines': [
+        'TESTING',
+      ],
+      # Only include _test.[cc|h] files.
+      'sources/': [
+        ['exclude', '\\.(cc|h)$'],
+        ['include', 'run_vm_tests.cc'],
+        ['include', 'error_exit.cc'],
+        ['include', 'builtin_nolib.cc'],
+        ['include', 'builtin_natives.cc'],
+        ['include', 'snapshot_utils.cc'],
+        ['include', '_gen\\.cc$'],
+        ['include', '_test\\.(cc|h)$'],
+      ],
+      'conditions': [
+        ['OS=="win"', {
+          'link_settings': {
+            'libraries': [ '-lws2_32.lib', '-lRpcrt4.lib', '-lwinmm.lib' ],
+          },
+        }],
+        ['OS == "linux" and asan == 0 and msan == 0 and tsan == 0', {
+          'dependencies': [
+            '../third_party/tcmalloc/tcmalloc.gypi:tcmalloc',
+          ],
+        }],
+      ],
+      'configurations': {
+        'Dart_Linux_Base': {
+          # Have the linker add all symbols to the dynamic symbol table
+          # so that extensions can look them up dynamically in the binary.
+          'ldflags': [
+            '-rdynamic',
+          ],
+        },
+      },
+    },
+    {
+      'target_name': 'test_extension',
+      'type': 'shared_library',
+      'dependencies': [
+        'dart',
+      ],
+      'include_dirs': [
+        '..',
+      ],
+      'cflags!': [
+        '-Wnon-virtual-dtor',
+        '-Woverloaded-virtual',
+        '-fno-rtti',
+        '-fvisibility-inlines-hidden',
+        '-Wno-conversion-null',
+      ],
+      'sources': [
+        'test_extension.c',
+        'test_extension_dllmain_win.cc',
+      ],
+      'defines': [
+        # The only effect of DART_SHARED_LIB is to export the Dart API.
+        'DART_SHARED_LIB',
+      ],
+      'conditions': [
+        ['OS=="win"', {
+          'msvs_settings': {
+            'VCLinkerTool': {
+              'AdditionalDependencies': [ 'dart.lib' ],
+              'AdditionalLibraryDirectories': [ '<(PRODUCT_DIR)' ],
+            },
+          },
+        }],
+        ['OS=="mac"', {
+          'xcode_settings': {
+            'OTHER_LDFLAGS': [ '-undefined', 'dynamic_lookup' ],
+          },
+        }],
+        ['OS=="linux"', {
+          'cflags': [
+            '-fPIC',
+          ],
+        }],
+      ],
+    },
+  ],
+}
diff --git a/runtime/bin/zlib.gyp b/runtime/bin/zlib.gyp
new file mode 100644
index 0000000..584f0ef
--- /dev/null
+++ b/runtime/bin/zlib.gyp
@@ -0,0 +1,69 @@
+# Copyright (c) 2012 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.
+
+# Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# This file is a modified copy of
+# https://chromium.googlesource.com/chromium/src/third_party/zlib/zlib.gyp
+# at revision c3d0a6190f2f8c924a05ab6cc97b8f975bddd33f.
+{
+  # Added by Dart. All Dart comments refer to the following block or line.
+  'includes': [
+    '../tools/gyp/runtime-configurations.gypi',
+    '../tools/gyp/nss_configurations.gypi',
+  ],
+  'variables': {
+    # Added by Dart.
+    'zlib_path': '../../third_party/zlib',
+  },
+  # Added by Dart.  We do not indent, so diffs with the original are clearer.
+  'targets': [
+    {
+      'target_name': 'zlib_dart',  # Added by Dart (the _dart postfix)
+      'type': 'static_library',
+      # Added by Dart (the original only has this on android).
+      'toolsets':['host','target'],
+      # Changed by Dart: '<(zlib_directory)/' added to all paths.
+      'sources': [
+        '<(zlib_path)/adler32.c',
+        '<(zlib_path)/compress.c',
+        '<(zlib_path)/crc32.c',
+        '<(zlib_path)/crc32.h',
+        '<(zlib_path)/deflate.c',
+        '<(zlib_path)/deflate.h',
+        '<(zlib_path)/gzclose.c',
+        '<(zlib_path)/gzguts.h',
+        '<(zlib_path)/gzlib.c',
+        '<(zlib_path)/gzread.c',
+        '<(zlib_path)/gzwrite.c',
+        '<(zlib_path)/infback.c',
+        '<(zlib_path)/inffast.c',
+        '<(zlib_path)/inffast.h',
+        '<(zlib_path)/inffixed.h',
+        '<(zlib_path)/inflate.c',
+        '<(zlib_path)/inflate.h',
+        '<(zlib_path)/inftrees.c',
+        '<(zlib_path)/inftrees.h',
+        '<(zlib_path)/mozzconf.h',
+        '<(zlib_path)/trees.c',
+        '<(zlib_path)/trees.h',
+        '<(zlib_path)/uncompr.c',
+        '<(zlib_path)/zconf.h',
+        '<(zlib_path)/zlib.h',
+        '<(zlib_path)/zutil.c',
+        '<(zlib_path)/zutil.h',
+      ],
+      'include_dirs': [
+            '<(zlib_path)/.',
+      ],
+      'direct_dependent_settings': {
+        'include_dirs': [
+              '<(zlib_path)/.',
+        ],
+      },
+    },
+  ],
+}
diff --git a/runtime/dart-runtime.gyp b/runtime/dart-runtime.gyp
new file mode 100644
index 0000000..1b2f9bd
--- /dev/null
+++ b/runtime/dart-runtime.gyp
@@ -0,0 +1,198 @@
+# Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'includes': [
+    'tools/gyp/runtime-configurations.gypi',
+    'vm/vm.gypi',
+    'observatory/observatory.gypi',
+    'bin/bin.gypi',
+    'third_party/double-conversion/src/double-conversion.gypi',
+  ],
+  'variables': {
+    'gen_source_dir': '<(SHARED_INTERMEDIATE_DIR)',
+    'version_in_cc_file': 'vm/version_in.cc',
+    'version_cc_file': '<(gen_source_dir)/version.cc',
+
+    'libdart_deps': ['libdart_lib_nosnapshot', 'libdart_lib',
+                     'libdart_vm_nosnapshot', 'libdart_vm',
+                     'libdouble_conversion',],
+  },
+  'targets': [
+    {
+      'target_name': 'libdart',
+      'type': 'static_library',
+      'dependencies': [
+        'libdart_lib',
+        'libdart_vm',
+        'libdouble_conversion',
+        'generate_version_cc_file#host',
+      ],
+      'include_dirs': [
+        '.',
+      ],
+      'sources': [
+        'include/dart_api.h',
+        'include/dart_mirrors_api.h',
+        'include/dart_native_api.h',
+        'include/dart_tools_api.h',
+        'vm/dart_api_impl.cc',
+        'vm/debugger_api_impl.cc',
+        'vm/mirrors_api_impl.cc',
+        'vm/native_api_impl.cc',
+        'vm/version.h',
+        '<(version_cc_file)',
+      ],
+      'defines': [
+        # The only effect of DART_SHARED_LIB is to export the Dart API entries.
+        'DART_SHARED_LIB',
+      ],
+      'direct_dependent_settings': {
+        'include_dirs': [
+          'include',
+        ],
+      },
+    },
+    {
+      'target_name': 'libdart_precompiled_runtime',
+      'type': 'static_library',
+      'dependencies': [
+        'libdart_lib_precompiled_runtime',
+        'libdart_vm_precompiled_runtime',
+        'libdouble_conversion',
+        'generate_version_cc_file#host',
+      ],
+      'include_dirs': [
+        '.',
+      ],
+      'sources': [
+        'include/dart_api.h',
+        'include/dart_mirrors_api.h',
+        'include/dart_native_api.h',
+        'include/dart_tools_api.h',
+        'vm/dart_api_impl.cc',
+        'vm/debugger_api_impl.cc',
+        'vm/mirrors_api_impl.cc',
+        'vm/native_api_impl.cc',
+        'vm/version.h',
+        '<(version_cc_file)',
+      ],
+      'defines': [
+        # The only effect of DART_SHARED_LIB is to export the Dart API entries.
+        'DART_SHARED_LIB',
+        'DART_PRECOMPILED_RUNTIME',
+      ],
+      'direct_dependent_settings': {
+        'include_dirs': [
+          'include',
+        ],
+      },
+    },
+    {
+      'target_name': 'generate_version_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'dependencies': [
+        'libdart_dependency_helper.target#target',
+        'libdart_dependency_helper.host#host',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_version_cc',
+          'inputs': [
+            '../tools/make_version.py',
+            '../tools/utils.py',
+            '../tools/print_version.py',
+            '../tools/VERSION',
+            '<(version_in_cc_file)',
+            # Depend on libdart_dependency_helper to track the libraries it
+            # depends on.
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)libdart_dependency_helper.target<(EXECUTABLE_SUFFIX)',
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)libdart_dependency_helper.host<(EXECUTABLE_SUFFIX)',
+          ],
+          'outputs': [
+            '<(version_cc_file)',
+          ],
+          'action': [
+            'python',
+            '-u', # Make standard I/O unbuffered.
+            '../tools/make_version.py',
+            '--output', '<(version_cc_file)',
+            '--input', '<(version_in_cc_file)',
+          ],
+        },
+      ],
+    },
+    {
+      'target_name': 'libdart_dependency_helper.target',
+      'type': 'executable',
+      'toolsets':['target'],
+      # The dependencies here are the union of the dependencies of libdart and
+      # libdart_nosnapshot.
+      'dependencies': ['<@(libdart_deps)'],
+      'sources': [
+        'vm/libdart_dependency_helper.cc',
+      ],
+    },
+    {
+      'target_name': 'libdart_dependency_helper.host',
+      'type': 'executable',
+      'toolsets':['host'],
+      # The dependencies here are the union of the dependencies of libdart and
+      # libdart_nosnapshot.
+      'dependencies': ['<@(libdart_deps)'],
+      'sources': [
+        'vm/libdart_dependency_helper.cc',
+      ],
+    },
+    # Targets coming from dart/dart.gyp.
+    {
+      'target_name': 'runtime_all',
+      'type': 'none',
+      'dependencies': [
+        'sample_extension',
+      ],
+    },
+    {
+      'target_name': 'sample_extension',
+      'type': 'shared_library',
+      'dependencies': [
+        'dart',
+      ],
+      'include_dirs': [
+        '.',
+      ],
+      'sources': [
+        '../samples/sample_extension/sample_extension.cc',
+        '../samples/sample_extension/sample_extension_dllmain_win.cc',
+      ],
+      'defines': [
+        'DART_SHARED_LIB',
+      ],
+      'conditions': [
+        ['OS=="win"', {
+          'msvs_settings': {
+            'VCLinkerTool': {
+              'AdditionalDependencies': [ 'dart.lib' ],
+              'AdditionalLibraryDirectories': [ '<(PRODUCT_DIR)' ],
+            },
+          },
+        }],
+        ['OS=="mac"', {
+          'xcode_settings': {
+            'OTHER_LDFLAGS': [
+              '-undefined',
+              'dynamic_lookup',
+            ],
+          },
+        }],
+        ['OS=="linux"', {
+          'cflags': [
+            '-fPIC',
+          ],
+        }],
+      ],
+    },
+  ],
+}
diff --git a/runtime/observatory/observatory.gypi b/runtime/observatory/observatory.gypi
new file mode 100644
index 0000000..be393ca
--- /dev/null
+++ b/runtime/observatory/observatory.gypi
@@ -0,0 +1,63 @@
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'variables': {
+    'gen_source_dir': '<(SHARED_INTERMEDIATE_DIR)',
+  },
+  'targets': [
+    {
+      'target_name': 'build_observatory',
+      'type': 'none',
+      'dependencies': [
+        'dart_bootstrap#host',
+      ],
+      'toolsets': ['host'],
+      'includes': [
+        'observatory_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'pub_build_observatory',
+          'inputs': [
+            '../../tools/observatory_tool.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(PRODUCT_DIR)/observatory/build/web/index.html',
+          ],
+          'action': [
+            'python',
+            '../tools/observatory_tool.py',
+            '--sdk=True',
+            '--dart-executable',
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart_bootstrap<(EXECUTABLE_SUFFIX)',
+            '--directory', 'observatory',
+            '--command', 'build',
+            '<(PRODUCT_DIR)/observatory/build'
+          ],
+        },
+        {
+          'action_name': 'deploy_observatory',
+          'inputs': [
+            '../../tools/observatory_tool.py',
+            '<(PRODUCT_DIR)/observatory/build/web/index.html',
+          ],
+          'outputs': [
+            '<(PRODUCT_DIR)/observatory/deployed/web/index.html',
+          ],
+          'action': [
+            'python',
+            '../tools/observatory_tool.py',
+            '--sdk=True',
+            '--dart-executable',
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart_bootstrap<(EXECUTABLE_SUFFIX)',
+            '--directory', '<(PRODUCT_DIR)/observatory/',
+            '--command', 'deploy',
+          ],
+        }
+      ],
+    },
+  ],
+}
diff --git a/runtime/third_party/double-conversion/src/double-conversion.gypi b/runtime/third_party/double-conversion/src/double-conversion.gypi
new file mode 100644
index 0000000..46f98f1
--- /dev/null
+++ b/runtime/third_party/double-conversion/src/double-conversion.gypi
@@ -0,0 +1,36 @@
+# Copyright 2010 Google Inc. All Rights Reserved.
+
+{
+  'targets': [
+    {
+      'target_name': 'libdouble_conversion',
+      'type': 'static_library',
+      'toolsets':['target','host'],
+      'dependencies': [
+      ],
+      'include_dirs': [
+        '.',
+      ],
+      'sources': [
+        'bignum.cc',
+        'bignum.h',
+        'bignum-dtoa.cc',
+        'bignum-dtoa.h',
+        'cached-powers.cc',
+        'cached-powers.h',
+        'diy-fp.cc',
+        'diy-fp.h',
+        'double-conversion.cc',
+        'double-conversion.h',
+        'fast-dtoa.cc',
+        'fast-dtoa.h',
+        'fixed-dtoa.cc',
+        'fixed-dtoa.h',
+        'ieee.h',
+        'strtod.cc',
+        'strtod.h',
+        'utils.h',
+      ],
+    },
+  ],
+}
diff --git a/runtime/tools/gyp/find_mac_gcc_version.py b/runtime/tools/gyp/find_mac_gcc_version.py
new file mode 100755
index 0000000..0af8412
--- /dev/null
+++ b/runtime/tools/gyp/find_mac_gcc_version.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+# Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+import re
+import subprocess
+import sys
+
+def main():
+  job = subprocess.Popen(['xcodebuild', '-version'],
+                         stdout=subprocess.PIPE,
+                         stderr=subprocess.STDOUT)
+  stdout, stderr = job.communicate()
+  if job.returncode != 0:
+    print >>sys.stderr, stdout
+    print >>sys.stderr, stderr
+    raise Exception('Error %d running xcodebuild!' % job.returncode)
+  matches = re.findall('^Xcode (\d+)\.(\d+)(\.(\d+))?$', stdout, re.MULTILINE)
+  if len(matches) > 0:
+    major = int(matches[0][0])
+    minor = int(matches[0][1])
+
+    if major >= 4:
+      return 'com.apple.compilers.llvmgcc42'
+    elif major == 3 and minor >= 1:
+      return '4.2'
+    else:
+      raise Exception('Unknown XCode Version "%s"' % version_match)
+  else:
+    raise Exception('Could not parse output of xcodebuild "%s"' % stdout)
+
+if __name__ == '__main__':
+  if sys.platform != 'darwin':
+    raise Exception("This script only runs on Mac")
+  print main()
diff --git a/runtime/tools/gyp/find_mac_sdk.py b/runtime/tools/gyp/find_mac_sdk.py
new file mode 100755
index 0000000..baf6279
--- /dev/null
+++ b/runtime/tools/gyp/find_mac_sdk.py
@@ -0,0 +1,89 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 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.
+
+# Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# This file is a copy of Chromium's src/build/mac/find_sdk.py.
+# Revision 180337.
+
+import os
+import re
+import subprocess
+import sys
+
+"""Prints the lowest locally available SDK version greater than or equal to a
+given minimum sdk version to standard output.
+
+Usage:
+  python find_sdk.py 10.6  # Ignores SDKs < 10.6
+"""
+
+from optparse import OptionParser
+
+
+def parse_version(version_str):
+  """'10.6' => [10, 6]"""
+  return map(int, re.findall(r'(\d+)', version_str))
+
+
+def main():
+  parser = OptionParser()
+  parser.add_option("--verify",
+                    action="store_true", dest="verify", default=False,
+                    help="return the sdk argument and warn if it doesn't exist")
+  parser.add_option("--sdk_path",
+                    action="store", type="string", dest="sdk_path", default="",
+                    help="user-specified SDK path; bypasses verification")
+  (options, args) = parser.parse_args()
+  min_sdk_version = args[0]
+
+  job = subprocess.Popen(['xcode-select', '-print-path'],
+                         stdout=subprocess.PIPE,
+                         stderr=subprocess.STDOUT)
+  out, err = job.communicate()
+  if job.returncode != 0:
+    print >>sys.stderr, out
+    print >>sys.stderr, err
+    raise Exception(('Error %d running xcode-select, you might have to run '
+      '|sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer| '
+      'if you are using Xcode 4.') % job.returncode)
+  # The Developer folder moved in Xcode 4.3.
+  xcode43_sdk_path = os.path.join(
+      out.rstrip(), 'Platforms/MacOSX.platform/Developer/SDKs')
+  if os.path.isdir(xcode43_sdk_path):
+    sdk_dir = xcode43_sdk_path
+  else:
+    sdk_dir = os.path.join(out.rstrip(), 'SDKs')
+  sdks = [re.findall('^MacOSX(10\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
+  sdks = [s[0] for s in sdks if s]  # [['10.5'], ['10.6']] => ['10.5', '10.6']
+  sdks = [s for s in sdks  # ['10.5', '10.6'] => ['10.6']
+          if parse_version(s) >= parse_version(min_sdk_version)]
+  if not sdks:
+    raise Exception('No %s+ SDK found' % min_sdk_version)
+  best_sdk = sorted(sdks, key=parse_version)[0]
+
+  if options.verify and best_sdk != min_sdk_version and not options.sdk_path:
+    print >>sys.stderr, ''
+    print >>sys.stderr, '                                           vvvvvvv'
+    print >>sys.stderr, ''
+    print >>sys.stderr, \
+        'This build requires the %s SDK, but it was not found on your system.' \
+        % min_sdk_version
+    print >>sys.stderr, \
+        'Either install it, or explicitly set mac_sdk in your GYP_DEFINES.'
+    print >>sys.stderr, ''
+    print >>sys.stderr, '                                           ^^^^^^^'
+    print >>sys.stderr, ''
+    return min_sdk_version
+
+  return best_sdk
+
+
+if __name__ == '__main__':
+  if sys.platform != 'darwin':
+    raise Exception("This script only runs on Mac")
+  print main()
diff --git a/runtime/tools/gyp/nss_configurations.gypi b/runtime/tools/gyp/nss_configurations.gypi
new file mode 100644
index 0000000..7f24ef4
--- /dev/null
+++ b/runtime/tools/gyp/nss_configurations.gypi
@@ -0,0 +1,100 @@
+# Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# This file is included to modify the configurations to build third-party
+# code from Mozilla's NSS and NSPR libraries, modified by the Chromium project.
+# This code is C code, not C++, and is not warning-free, so we need to remove
+# C++-specific flags, and add flags to supress the warnings in the code.
+# This file is included from gyp files in the runtime/bin/net directory.
+{
+  'variables': {
+    # Used by third_party/nss, which is from Chromium.
+    # Include the built-in set of root certificate authorities.
+    'exclude_nss_root_certs': 0,
+    'os_posix%': 1,
+    'os_bsd%': 0,
+    'chromeos%': 0,
+    'clang%': 0,
+  },
+  'target_defaults': {
+    'cflags': [
+      '-w',
+      '-UHAVE_CVAR_BUILT_ON_SEM',
+    ],
+    # Removes these flags from the list cflags.
+    'cflags!': [
+      # NSS code from upstream mozilla builds with warnings,
+      # so we must allow warnings without failing.
+      '-Werror',
+      '-Wall',
+      '-ansi',
+      # Not supported for C, only for C++.
+      '-Wnon-virtual-dtor',
+      '-Wno-conversion-null',
+      '-fno-rtti',
+      '-fvisibility-inlines-hidden',
+      '-Woverloaded-virtual',
+    ],
+    'configurations': {
+      'Dart_Base': {
+        'xcode_settings': {
+          'WARNING_CFLAGS': [
+            '-w',
+          ],
+          'WARNING_CFLAGS!': [
+            '-Wall',
+            '-Wextra',
+          ],
+        },
+      },
+      # Dart_Macos_Debug and Dart_Macos_Release are merged after
+      # Dart_Macos_Base, so we can override the 'ansi' and '-Werror' flags set
+      # at the global level in tools/gyp/configurations_xcode.gypi.
+      'Dart_Macos_Debug': {
+        'abstract': 1,
+        'xcode_settings': {
+          # Remove 'ansi' setting.
+          'GCC_C_LANGUAGE_STANDARD': 'c99',
+          'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror off
+        },
+      },
+      'Dart_Macos_Release': {
+        'abstract': 1,
+        'xcode_settings': {
+          # Remove 'ansi' setting.
+          'GCC_C_LANGUAGE_STANDARD': 'c99',
+          'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror off
+        },
+      },
+      # When being built for Android nss expects __linux__ to be defined.
+      'Dart_Android_Base': {
+        'target_conditions': [
+          ['_toolset=="host"', {
+            'defines!': [
+              'ANDROID',
+            ],
+            # Define __linux__ on Android build for NSS.
+            'defines': [
+              '__linux__',
+            ],
+            'cflags!': [
+              '-U__linux__',
+            ],
+          }],
+          ['_toolset=="target"', {
+            'defines': [
+              '__linux__',
+              'CHECK_FORK_GETPID',  # Android does not provide pthread_atfork.
+              '__USE_LARGEFILE64',
+            ],
+            # Define __linux__ on Android build for NSS.
+            'cflags!': [
+              '-U__linux__',
+            ],
+          }]
+        ],
+      },
+    },
+  },
+}
diff --git a/runtime/tools/gyp/runtime-configurations.gypi b/runtime/tools/gyp/runtime-configurations.gypi
new file mode 100644
index 0000000..04b7dd5
--- /dev/null
+++ b/runtime/tools/gyp/runtime-configurations.gypi
@@ -0,0 +1,127 @@
+# Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'variables': {
+    'dart_debug_optimization_level%': '2',
+    # If we have not set dart_io_support to 1 in Dart's all.gypi or common.gypi,
+    # then do not build the native libraries supporting  dart:io.
+    'dart_io_support%': 0,
+    'dart_io_secure_socket%': 1,
+    'asan%': 0,
+    'msan%': 0,
+    'tsan%': 0,
+    # Intel VTune related variables.
+    'dart_vtune_support%': 0,
+    'conditions': [
+      ['OS=="linux"', {
+        'dart_vtune_root%': '/opt/intel/vtune_amplifier_xe',
+      }],
+      ['OS=="win"', {
+        'dart_vtune_root%': 'C:/Program Files (x86)/Intel/VTune Amplifier XE 2013',
+      }],
+    ],
+  },
+
+  'target_defaults': {
+    'configurations': {
+
+      'Dart_Base': {
+        'abstract': 1,
+        'xcode_settings': {
+          'GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS': 'YES', # -Woverloaded-virtual
+        },
+      },
+
+      'Dart_ia32_Base': {
+        'abstract': 1,
+        'xcode_settings': {
+          'ARCHS': [ 'i386' ],
+        },
+        'conditions': [
+          ['OS=="linux" and dart_vtune_support==1', {
+            'ldflags': ['-L<(dart_vtune_root)/lib32'],
+          }],
+          ['OS=="win" and dart_vtune_support==1', {
+            'msvs_settings': {
+              'VCLinkerTool': {
+                'AdditionalLibraryDirectories': ['<(dart_vtune_root)/lib32'],
+              },
+            },
+          }],
+        ],
+      },
+
+      'Dart_x64_Base': {
+        'abstract': 1,
+        'xcode_settings': {
+          'ARCHS': [ 'x86_64' ],
+        },
+        'conditions': [
+          ['OS=="linux" and dart_vtune_support==1', {
+            'ldflags': ['-L<(dart_vtune_root)/lib64'],
+          }],
+          ['OS=="win" and dart_vtune_support==1', {
+            'msvs_settings': {
+              'VCLinkerTool': {
+                'AdditionalLibraryDirectories': ['<(dart_vtune_root)/lib32'],
+              },
+            },
+          }],
+        ],
+      },
+
+      'Dart_simarm_Base': {
+        'abstract': 1,
+        'xcode_settings': {
+          'ARCHS': [ 'i386' ],
+        },
+      },
+
+      'Dart_simarmv6_Base': {
+        'abstract': 1,
+        'xcode_settings': {
+          'ARCHS': [ 'i386' ],
+        },
+      },
+
+      'Dart_simarmv5te_Base': {
+        'abstract': 1,
+        'xcode_settings': {
+          'ARCHS': [ 'i386' ],
+        },
+      },
+
+      'Dart_Debug': {
+        'abstract': 1,
+        'defines': [
+          'DEBUG',
+        ],
+        'xcode_settings': {
+          'GCC_OPTIMIZATION_LEVEL': '<(dart_debug_optimization_level)',
+        },
+      },
+
+      'Debug': {
+        'defines': [
+          'DEBUG',
+        ],
+      },
+
+      'Dart_Release': {
+        'abstract': 1,
+        'xcode_settings': {
+          'GCC_OPTIMIZATION_LEVEL': '3',
+        },
+      },
+
+      'Dart_Product' : {
+        'abstract': 1,
+        'xcode_settings': {
+          'GCC_OPTIMIZATION_LEVEL': '3',
+        }
+      },
+    },
+  },
+}
diff --git a/runtime/vm/vm.gypi b/runtime/vm/vm.gypi
new file mode 100644
index 0000000..ae018b6
--- /dev/null
+++ b/runtime/vm/vm.gypi
@@ -0,0 +1,1763 @@
+# Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'variables': {
+    'gen_source_dir': '<(SHARED_INTERMEDIATE_DIR)',
+    'libgen_in_cc_file': '../lib/libgen_in.cc',
+    'builtin_in_cc_file': '../bin/builtin_in.cc',
+    'async_cc_file': '<(gen_source_dir)/async_gen.cc',
+    'async_patch_cc_file': '<(gen_source_dir)/async_patch_gen.cc',
+    'core_cc_file': '<(gen_source_dir)/core_gen.cc',
+    'core_patch_cc_file': '<(gen_source_dir)/core_patch_gen.cc',
+    'collection_cc_file': '<(gen_source_dir)/collection_gen.cc',
+    'collection_patch_cc_file': '<(gen_source_dir)/collection_patch_gen.cc',
+    'convert_cc_file': '<(gen_source_dir)/convert_gen.cc',
+    'convert_patch_cc_file': '<(gen_source_dir)/convert_patch_gen.cc',
+    'developer_cc_file': '<(gen_source_dir)/developer_gen.cc',
+    'developer_patch_cc_file': '<(gen_source_dir)/developer_patch_gen.cc',
+    'internal_cc_file': '<(gen_source_dir)/internal_gen.cc',
+    'internal_patch_cc_file': '<(gen_source_dir)/internal_patch_gen.cc',
+    'isolate_cc_file': '<(gen_source_dir)/isolate_gen.cc',
+    'isolate_patch_cc_file': '<(gen_source_dir)/isolate_patch_gen.cc',
+    'math_cc_file': '<(gen_source_dir)/math_gen.cc',
+    'math_patch_cc_file': '<(gen_source_dir)/math_patch_gen.cc',
+    'mirrors_cc_file': '<(gen_source_dir)/mirrors_gen.cc',
+    'mirrors_patch_cc_file': '<(gen_source_dir)/mirrors_patch_gen.cc',
+    'profiler_cc_file': '<(gen_source_dir)/profiler_gen.cc',
+    'snapshot_test_dat_file': '<(gen_source_dir)/snapshot_test.dat',
+    'snapshot_test_in_dat_file': 'snapshot_test_in.dat',
+    'snapshot_test_dart_file': 'snapshot_test.dart',
+    'typed_data_cc_file': '<(gen_source_dir)/typed_data_gen.cc',
+    'typed_data_patch_cc_file': '<(gen_source_dir)/typed_data_patch_gen.cc',
+    'vmservice_cc_file': '<(gen_source_dir)/vmservice_gen.cc',
+    'vmservice_patch_cc_file': '<(gen_source_dir)/vmservice_patch_gen.cc',
+  },
+  'targets': [
+    {
+      'target_name': 'libdart_vm',
+      'type': 'static_library',
+      'toolsets':['host', 'target'],
+      'includes': [
+        'vm_sources.gypi',
+        '../platform/platform_headers.gypi',
+        '../platform/platform_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all _test.[cc|h] files.
+        ['exclude', '_test\\.(cc|h)$'],
+      ],
+      'include_dirs': [
+        '..',
+      ],
+      'conditions': [
+        ['OS=="linux"', {
+          'link_settings': {
+            'libraries': [
+              '-lpthread',
+              '-lrt',
+              '-ldl',
+            ],
+          },
+        }],
+        ['OS=="android" and _toolset=="host"', {
+          'link_settings': {
+            'libraries': [
+              '-lpthread',
+              '-lrt',
+              '-ldl',
+            ],
+          },
+        }],
+        ['OS=="win"', {
+          'sources/' : [
+            ['exclude', 'gdbjit.cc'],
+          ],
+       }]],
+    },
+    {
+      'target_name': 'libdart_vm_precompiled_runtime',
+      'type': 'static_library',
+      'toolsets':['host', 'target'],
+      'includes': [
+        'vm_sources.gypi',
+        '../platform/platform_headers.gypi',
+        '../platform/platform_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all _test.[cc|h] files.
+        ['exclude', '_test\\.(cc|h)$'],
+      ],
+      'include_dirs': [
+        '..',
+      ],
+      'defines': [
+        'DART_PRECOMPILED_RUNTIME',
+      ],
+      'conditions': [
+        ['OS=="linux"', {
+          'link_settings': {
+            'libraries': [
+              '-lpthread',
+              '-lrt',
+              '-ldl',
+            ],
+          },
+        }],
+        ['OS=="android" and _toolset=="host"', {
+          'link_settings': {
+            'libraries': [
+              '-lpthread',
+              '-lrt',
+              '-ldl',
+            ],
+          },
+        }],
+        ['OS=="win"', {
+          'sources/' : [
+            ['exclude', 'gdbjit.cc'],
+          ],
+       }]],
+    },
+    {
+      'target_name': 'libdart_vm_noopt',
+      'type': 'static_library',
+      'toolsets':['host', 'target'],
+      'includes': [
+        'vm_sources.gypi',
+        '../platform/platform_headers.gypi',
+        '../platform/platform_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all _test.[cc|h] files.
+        ['exclude', '_test\\.(cc|h)$'],
+      ],
+      'include_dirs': [
+        '..',
+      ],
+      'defines': [
+        'DART_PRECOMPILER',
+      ],
+      'conditions': [
+        ['OS=="linux"', {
+          'link_settings': {
+            'libraries': [
+              '-lpthread',
+              '-lrt',
+              '-ldl',
+            ],
+          },
+        }],
+        ['OS=="android" and _toolset=="host"', {
+          'link_settings': {
+            'libraries': [
+              '-lpthread',
+              '-lrt',
+              '-ldl',
+            ],
+          },
+        }],
+        ['OS=="win"', {
+          'sources/' : [
+            ['exclude', 'gdbjit.cc'],
+          ],
+       }]],
+    },
+    {
+      'target_name': 'libdart_vm_nosnapshot',
+      'type': 'static_library',
+      'toolsets':['host', 'target'],
+      'includes': [
+        'vm_sources.gypi',
+        '../platform/platform_headers.gypi',
+        '../platform/platform_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all _test.[cc|h] files.
+        ['exclude', '_test\\.(cc|h)$'],
+      ],
+      'include_dirs': [
+        '..',
+      ],
+      'defines': [
+        'DART_NO_SNAPSHOT',
+        'DART_PRECOMPILER',
+      ],
+      'conditions': [
+        ['OS=="linux"', {
+          'link_settings': {
+            'libraries': [
+              '-lpthread',
+              '-lrt',
+              '-ldl',
+            ],
+          },
+        }],
+        ['OS=="android" and _toolset=="host"', {
+          'link_settings': {
+            'libraries': [
+              '-lpthread',
+              '-lrt',
+              '-ldl',
+            ],
+          },
+        }],
+        ['OS=="win"', {
+          'sources/' : [
+            ['exclude', 'gdbjit.cc'],
+          ],
+       }]],
+    },
+    {
+      'target_name': 'libdart_lib_nosnapshot',
+      'type': 'static_library',
+      'toolsets':['host', 'target'],
+      'dependencies': [
+        'generate_async_cc_file#host',
+        'generate_async_patch_cc_file#host',
+        'generate_core_cc_file#host',
+        'generate_core_patch_cc_file#host',
+        'generate_collection_cc_file#host',
+        'generate_collection_patch_cc_file#host',
+        'generate_convert_cc_file#host',
+        'generate_convert_patch_cc_file#host',
+        'generate_developer_cc_file#host',
+        'generate_developer_patch_cc_file#host',
+        'generate_internal_cc_file#host',
+        'generate_internal_patch_cc_file#host',
+        'generate_isolate_cc_file#host',
+        'generate_isolate_patch_cc_file#host',
+        'generate_math_cc_file#host',
+        'generate_math_patch_cc_file#host',
+        'generate_mirrors_cc_file#host',
+        'generate_mirrors_patch_cc_file#host',
+        'generate_profiler_cc_file#host',
+        'generate_typed_data_cc_file#host',
+        'generate_typed_data_patch_cc_file#host',
+        'generate_vmservice_cc_file#host',
+        'generate_vmservice_patch_cc_file#host',
+      ],
+      'includes': [
+        '../lib/async_sources.gypi',
+        '../lib/collection_sources.gypi',
+        '../lib/core_sources.gypi',
+        '../lib/developer_sources.gypi',
+        '../lib/internal_sources.gypi',
+        '../lib/isolate_sources.gypi',
+        '../lib/math_sources.gypi',
+        '../lib/mirrors_sources.gypi',
+        '../lib/typed_data_sources.gypi',
+        '../lib/vmservice_sources.gypi',
+      ],
+      'sources': [
+        'bootstrap.cc',
+        # Include generated source files.
+        '<(async_cc_file)',
+        '<(async_patch_cc_file)',
+        '<(core_cc_file)',
+        '<(core_patch_cc_file)',
+        '<(collection_cc_file)',
+        '<(collection_patch_cc_file)',
+        '<(convert_cc_file)',
+        '<(convert_patch_cc_file)',
+        '<(developer_cc_file)',
+        '<(developer_patch_cc_file)',
+        '<(internal_cc_file)',
+        '<(internal_patch_cc_file)',
+        '<(isolate_cc_file)',
+        '<(isolate_patch_cc_file)',
+        '<(math_cc_file)',
+        '<(math_patch_cc_file)',
+        '<(mirrors_cc_file)',
+        '<(mirrors_patch_cc_file)',
+        '<(profiler_cc_file)',
+        '<(typed_data_cc_file)',
+        '<(typed_data_patch_cc_file)',
+        '<(vmservice_cc_file)',
+        '<(vmservice_patch_cc_file)',
+      ],
+      'include_dirs': [
+        '..',
+      ],
+    },
+    {
+      'target_name': 'libdart_lib',
+      'type': 'static_library',
+      'toolsets':['host', 'target'],
+      'includes': [
+        '../lib/async_sources.gypi',
+        '../lib/collection_sources.gypi',
+        '../lib/core_sources.gypi',
+        '../lib/developer_sources.gypi',
+        '../lib/internal_sources.gypi',
+        '../lib/isolate_sources.gypi',
+        '../lib/math_sources.gypi',
+        '../lib/mirrors_sources.gypi',
+        '../lib/typed_data_sources.gypi',
+        '../lib/vmservice_sources.gypi',
+      ],
+      'sources': [
+        'bootstrap_nocore.cc',
+      ],
+      'include_dirs': [
+        '..',
+      ],
+    },
+    {
+      'target_name': 'libdart_lib_precompiled_runtime',
+      'type': 'static_library',
+      'toolsets':['host', 'target'],
+      'includes': [
+        '../lib/async_sources.gypi',
+        '../lib/collection_sources.gypi',
+        '../lib/core_sources.gypi',
+        '../lib/developer_sources.gypi',
+        '../lib/internal_sources.gypi',
+        '../lib/isolate_sources.gypi',
+        '../lib/math_sources.gypi',
+        '../lib/mirrors_sources.gypi',
+        '../lib/typed_data_sources.gypi',
+        '../lib/vmservice_sources.gypi',
+      ],
+      'sources': [
+        'bootstrap_nocore.cc',
+      ],
+      'defines': [
+        'DART_PRECOMPILED_RUNTIME',
+      ],
+      'include_dirs': [
+        '..',
+      ],
+    },
+    {
+      'target_name': 'generate_async_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        '../../sdk/lib/async/async_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_async_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(async_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(async_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::async_source_paths_',
+            '--library_name', 'dart:async',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(async_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_async_patch_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the runtime implementation sources.
+        '../lib/async_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_async_patch_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(async_patch_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(async_patch_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::async_patch_paths_',
+            '--library_name', 'dart:async',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(async_patch_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_collection_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the shared collection library sources.
+        '../../sdk/lib/collection/collection_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_collection_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(collection_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(collection_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::collection_source_paths_',
+            '--library_name', 'dart:collection',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(collection_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_collection_patch_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the runtime implementation sources.
+        '../lib/collection_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_collection_patch_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(collection_patch_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(collection_patch_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::collection_patch_paths_',
+            '--library_name', 'dart:collection',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(collection_patch_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_convert_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the shared convert library sources.
+        '../../sdk/lib/convert/convert_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_convert_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(convert_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(convert_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::convert_source_paths_',
+            '--library_name', 'dart:convert',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(convert_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_convert_patch_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the shared convert library sources.
+        '../lib/convert_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_convert_patch_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(convert_patch_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(convert_patch_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::convert_patch_paths_',
+            '--library_name', 'dart:convert',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(convert_patch_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_core_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the shared core library sources.
+        '../../sdk/lib/core/core_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_core_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(core_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(core_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::core_source_paths_',
+            '--library_name', 'dart:core',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(core_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_core_patch_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the runtime implementation sources.
+        '../lib/core_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_core_patch_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(core_patch_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(core_patch_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::core_patch_paths_',
+            '--library_name', 'dart:core',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(core_patch_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_internal_patch_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the runtime implementation sources.
+        '../lib/internal_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_internal_patch_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(internal_patch_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(internal_patch_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::_internal_patch_paths_',
+            '--library_name', 'dart:_internal',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(internal_patch_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_internal_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the shared internal library sources.
+        '../../sdk/lib/internal/internal_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_internal_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(internal_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(internal_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::_internal_source_paths_',
+            '--library_name', 'dart:_internal',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(internal_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_isolate_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the runtime implementation sources.
+        '../../sdk/lib/isolate/isolate_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_isolate_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(isolate_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(isolate_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::isolate_source_paths_',
+            '--library_name', 'dart:isolate',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(isolate_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_isolate_patch_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the runtime implementation sources.
+        '../lib/isolate_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_isolate_patch_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(isolate_patch_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(isolate_patch_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::isolate_patch_paths_',
+            '--library_name', 'dart:isolate',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(isolate_patch_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_math_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the shared math library sources.
+        '../../sdk/lib/math/math_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_math_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(math_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(math_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::math_source_paths_',
+            '--library_name', 'dart:math',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(math_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_math_patch_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the shared math library sources.
+        '../lib/math_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_math_patch_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(math_patch_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(math_patch_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::math_patch_paths_',
+            '--library_name', 'dart:math',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(math_patch_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_mirrors_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the shared core library sources.
+        '../../sdk/lib/mirrors/mirrors_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_mirrors_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(mirrors_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(mirrors_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::mirrors_source_paths_',
+            '--library_name', 'dart:mirrors',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(mirrors_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_mirrors_patch_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the patch sources.
+        '../lib/mirrors_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_mirrors_patch_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(mirrors_patch_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(mirrors_patch_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::mirrors_patch_paths_',
+            '--library_name', 'dart:mirrors',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(mirrors_patch_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_typed_data_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the runtime implementation sources.
+        '../../sdk/lib/typed_data/typed_data_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_typed_data_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(typed_data_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(typed_data_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::typed_data_source_paths_',
+            '--library_name', 'dart:typed_data',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(typed_data_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_typed_data_patch_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the patch sources.
+        '../lib/typed_data_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_typed_data_patch_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(typed_data_patch_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(typed_data_patch_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::typed_data_patch_paths_',
+            '--library_name', 'dart:typed_data',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(typed_data_patch_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_profiler_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the shared library sources.
+        '../../sdk/lib/profiler/profiler_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_profiler_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(profiler_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(profiler_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::profiler_source_paths_',
+            '--library_name', 'dart:profiler',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(profiler_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_developer_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the shared library sources.
+        '../../sdk/lib/developer/developer_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_developer_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(developer_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(developer_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::developer_source_paths_',
+            '--library_name', 'dart:developer',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(developer_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_developer_patch_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the runtime implementation sources.
+        '../lib/developer_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_developer_patch_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(developer_patch_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(developer_patch_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::developer_patch_paths_',
+            '--library_name', 'dart:developer',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(developer_patch_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_snapshot_test_dat_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'actions': [
+        {
+          'action_name': 'generate_snapshot_test_dat',
+          'inputs': [
+            '../tools/create_string_literal.py',
+            '<(snapshot_test_in_dat_file)',
+            '<(snapshot_test_dart_file)',
+          ],
+          'outputs': [
+            '<(snapshot_test_dat_file)',
+          ],
+          'action': [
+            'python',
+            'tools/create_string_literal.py',
+            '--output', '<(snapshot_test_dat_file)',
+            '--input_cc', '<(snapshot_test_in_dat_file)',
+            '--include', 'INTENTIONALLY_LEFT_BLANK',
+            '--var_name', 'INTENTIONALLY_LEFT_BLANK_TOO',
+            '<(snapshot_test_dart_file)',
+          ],
+          'message': 'Generating ''<(snapshot_test_dat_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_vmservice_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the shared library sources.
+        '../../sdk/lib/vmservice/vmservice_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_vmservice_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(vmservice_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(vmservice_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::_vmservice_source_paths_',
+            '--library_name', 'dart:_vmservice',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(vmservice_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_vmservice_patch_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the runtime implementation sources.
+        '../lib/vmservice_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_vmservice_patch_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(vmservice_patch_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(vmservice_patch_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::_vmservice_patch_paths_',
+            '--library_name', 'dart:_vmservice',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(vmservice_patch_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_patched_sdk',
+      'type': 'none',
+      'toolsets': ['host'],
+      'dependencies': [
+        'dart_bootstrap#host',
+        'generate_async_library_patch',
+        'generate_collection_library_patch',
+        'generate_convert_library_patch',
+        'generate_core_library_patch',
+        'generate_developer_library_patch',
+        'generate_internal_library_patch',
+        'generate_io_library_patch',
+        'generate_isolate_library_patch',
+        'generate_math_library_patch',
+        'generate_mirrors_library_patch',
+        'generate_profiler_library_patch',
+        'generate_typed_data_library_patch',
+        'generate_vmservice_library_patch',
+      ],
+      'actions': [
+        {
+          'action_name': 'patch_sdk',
+          'inputs': [
+            '<!@(["python", "../tools/list_files.py", "relative",'
+                  '"dart$", "sdk/lib"])',
+            '../../tools/patch_sdk.py',
+            '../../tools/patch_sdk.dart',
+            # Unlike the other libraries in the SDK, dart:_builtin and
+            # dart:nativewrappers are only available for the Dart VM.
+            '../bin/builtin.dart',
+            '../bin/vmservice/vmservice_io.dart',
+            '../bin/vmservice/loader.dart',
+            '../bin/vmservice/server.dart',
+            '<(gen_source_dir)/patches/async_patch.dart',
+            '<(gen_source_dir)/patches/collection_patch.dart',
+            '<(gen_source_dir)/patches/convert_patch.dart',
+            '<(gen_source_dir)/patches/core_patch.dart',
+            '<(gen_source_dir)/patches/developer_patch.dart',
+            '<(gen_source_dir)/patches/internal_patch.dart',
+            '<(gen_source_dir)/patches/io_patch.dart',
+            '<(gen_source_dir)/patches/isolate_patch.dart',
+            '<(gen_source_dir)/patches/math_patch.dart',
+            '<(gen_source_dir)/patches/mirrors_patch.dart',
+            '<(gen_source_dir)/patches/profiler_patch.dart',
+            '<(gen_source_dir)/patches/typed_data_patch.dart',
+            '<(gen_source_dir)/patches/vmservice_patch.dart',
+          ],
+          'outputs': [
+            # Instead of listing all outputs we list a single well-known one.
+            '<(PRODUCT_DIR)/patched_sdk/lib/core/core.dart',
+          ],
+          'action': [
+            'python',
+            '../tools/patch_sdk.py',
+            '--dart-executable',
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart_bootstrap<(EXECUTABLE_SUFFIX)',
+            'vm',
+            '../sdk',
+            '<(gen_source_dir)/patches',
+            '<(PRODUCT_DIR)/patched_sdk',
+            '../.packages',
+          ],
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'async',
+        'library_uri': 'dart:async',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/async_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'collection',
+        'library_uri': 'dart:collection',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/collection_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'convert',
+        'library_uri': 'dart:convert',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/convert_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'core',
+        'library_uri': 'dart:core',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/core_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'developer',
+        'library_uri': 'dart:developer',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/developer_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'internal',
+        'library_uri': 'dart:_internal',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/internal_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'io',
+        'library_uri': 'dart:io',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../bin/io_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'isolate',
+        'library_uri': 'dart:isolate',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/isolate_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'math',
+        'library_uri': 'dart:math',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/math_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'mirrors',
+        'library_uri': 'dart:mirrors',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/mirrors_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'profiler',
+        'library_uri': 'dart:profiler',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/profiler_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'typed_data',
+        'library_uri': 'dart:typed_data',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/typed_data_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+    {
+      'variables': {
+        'library_name': 'vmservice',
+        'library_uri': 'dart:_vmservice',
+      },
+      'target_name': 'generate_<(library_name)_library_patch',
+      'type': 'none',
+      'toolsets': ['host'],
+      'includes': [
+        '../lib/vmservice_sources.gypi',
+      ],
+      'actions': [
+        {
+          'action_name': 'concatenate_<(library_name)_patches',
+          'inputs': [
+            '../tools/concatenate_patches.py',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart'
+          ],
+          'action': [
+            'python',
+            'tools/concatenate_patches.py',
+            '--output',
+            '<(gen_source_dir)/patches/<(library_name)_patch.dart',
+            '<@(_sources)',
+          ],
+          'message': 'Generating <(library_uri) patch.',
+        },
+      ],
+    },
+  ]
+}
diff --git a/samples/sample_extension/sample_extension.gyp b/samples/sample_extension/sample_extension.gyp
new file mode 100644
index 0000000..3a6974c
--- /dev/null
+++ b/samples/sample_extension/sample_extension.gyp
@@ -0,0 +1,45 @@
+# Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'includes': [
+    '../../runtime/tools/gyp/runtime-configurations.gypi',
+  ],
+  'targets': [
+    {
+      'target_name': 'sample_extension',
+      'type': 'shared_library',
+      'include_dirs': [
+        '../../runtime',
+      ],
+      'sources': [
+        'sample_extension.cc',
+        'sample_extension_dllmain_win.cc',
+      ],
+      'defines': [
+        'DART_SHARED_LIB',
+      ],
+      'conditions': [
+        ['OS=="win"', {
+          'msvs_settings': {
+            'VCLinkerTool': {
+              'AdditionalDependencies': [ 'dart.lib' ],
+              'AdditionalLibraryDirectories': [ '<(PRODUCT_DIR)' ],
+            },
+          },
+        }],
+        ['OS=="mac"', {
+          'xcode_settings': {
+            'OTHER_LDFLAGS': [ '-undefined', 'dynamic_lookup' ],
+          },
+        }],
+        ['OS=="linux"', {
+          'cflags': [
+            '-fPIC',
+          ],
+        }],
+      ],
+    },
+  ],
+}
diff --git a/third_party/tcmalloc/tcmalloc.gypi b/third_party/tcmalloc/tcmalloc.gypi
new file mode 100644
index 0000000..c8e20fe
--- /dev/null
+++ b/third_party/tcmalloc/tcmalloc.gypi
@@ -0,0 +1,109 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'targets': [
+    {
+      'target_name': 'dynamic_annotations',
+      'type': 'static_library',
+      'toolsets': ['host', 'target'],
+      'include_dirs': [
+        'include',
+        'gperftools/src/base',
+        'gperftools/src',
+      ],
+      'cflags!': [
+        '-Werror',
+        '-Wnon-virtual-dtor',
+        '-Woverloaded-virtual',
+        '-fno-rtti',
+      ],
+      'sources': [
+        'gperftools/src/base/dynamic_annotations.c',
+        'gperftools/src/base/dynamic_annotations.h',
+      ],
+    },
+    {
+      'target_name': 'tcmalloc',
+      'type': 'static_library',
+      'toolsets': ['host', 'target'],
+      'dependencies': [
+        'dynamic_annotations',
+      ],
+      'include_dirs': [
+        'include',
+        'gperftools/src/base',
+        'gperftools/src',
+      ],
+      'includes': [
+        'tcmalloc_sources.gypi',
+      ],
+      # Disable the heap checker in tcmalloc.
+      'defines': [
+        'ENABLE_EMERGENCY_MALLOC',
+        'NO_HEAP_CHECK',
+        # Disable debug even in a Dart Debug build. It is too slow.
+        'NDEBUG',
+      ],
+      'defines!': [
+        # Disable debug even in a Dart Debug build. It is too slow.
+        'DEBUG',
+      ],
+      'cflags': [
+        '-Wno-missing-field-initializers',
+        '-Wno-sign-compare',
+        '-Wno-type-limits',
+        '-Wno-unused-result',
+        '-Wno-vla',
+        '-fno-builtin-malloc',
+        '-fno-builtin-free',
+        '-fno-builtin-realloc',
+        '-fno-builtin-calloc',
+        '-fno-builtin-cfree',
+        '-fno-builtin-memalign',
+        '-fno-builtin-posix_memalign',
+        '-fno-builtin-valloc',
+        '-fno-builtin-pvalloc',
+        '-fpermissive',
+      ],
+      'cflags!': [
+        '-Werror',
+        '-Wvla',
+      ],
+      'link_settings': {
+        'configurations': {
+          'Dart_Linux_Base': {
+            'ldflags': [
+              # Don't let linker rip this symbol out, otherwise the heap&cpu
+              # profilers will not initialize properly on startup.
+              '-Wl,-uIsHeapProfilerRunning,-uProfilerStart',
+            ],
+          },
+        },
+      },
+      'sources!': [
+        # No debug allocator.
+        'gperftools/src/debugallocation.cc',
+        # Not needed when using emergency malloc.
+        'gperftools/src/fake_stacktrace_scope.cc',
+        # Not using the cpuprofiler
+        'gperftools/src/base/thread_lister.c',
+        'gperftools/src/base/thread_lister.h',
+        'gperftools/src/profile-handler.cc',
+        'gperftools/src/profile-handler.h',
+        'gperftools/src/profiledata.cc',
+        'gperftools/src/profiledata.h',
+        'gperftools/src/profiler.cc',
+      ],
+      # Disable sample collection in Release and Product builds.
+      'configurations': {
+        'Dart_Product': {
+          'defines': [
+            'NO_TCMALLOC_SAMPLES',
+          ],
+        },
+      },
+    },
+  ],
+}
diff --git a/tools/VERSION b/tools/VERSION
index 42b167d..afa7c36 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -23,9 +23,9 @@
 #  * Making cherry-picks to stable channel
 #     - increase PATCH by 1
 #
-CHANNEL be
+CHANNEL dev
 MAJOR 1
 MINOR 25
 PATCH 0
-PRERELEASE 0
+PRERELEASE 11
 PRERELEASE_PATCH 0
diff --git a/tools/generate_buildfiles.py b/tools/generate_buildfiles.py
index 27f6b7e..d7258e7 100755
--- a/tools/generate_buildfiles.py
+++ b/tools/generate_buildfiles.py
@@ -12,9 +12,14 @@
 HOST_OS = utils.GuessOS()
 SCRIPT_DIR = os.path.dirname(sys.argv[0])
 DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
+DART_USE_GYP = "DART_USE_GYP"
 DART_DISABLE_BUILDFILES = "DART_DISABLE_BUILDFILES"
 
 
+def UseGyp():
+  return DART_USE_GYP in os.environ
+
+
 def DisableBuildfiles():
   return DART_DISABLE_BUILDFILES in os.environ
 
@@ -79,6 +84,16 @@
   return RunAndroidGn(options)
 
 
+def RunGyp(options):
+  gyp_command = [
+    'python',
+    os.path.join(DART_ROOT, 'tools', 'gyp_dart.py'),
+  ]
+  if options.verbose:
+    print ' '.join(gyp_command)
+  return Execute(gyp_command)
+
+
 def ParseArgs(args):
   args = args[1:]
   parser = argparse.ArgumentParser(
@@ -88,8 +103,20 @@
       help='Verbose output.',
       default=False,
       action="store_true")
+  parser.add_argument("--gn",
+      help='Use GN',
+      default=not UseGyp(),
+      action='store_true')
+  parser.add_argument("--gyp",
+      help='Use gyp',
+      default=UseGyp(),
+      action='store_true')
 
-  return parser.parse_args(args)
+  options = parser.parse_args(args)
+  # If gyp is enabled one way or another, then disable gn
+  if options.gyp:
+    options.gn = False
+  return options
 
 
 def main(argv):
@@ -97,7 +124,10 @@
   if DisableBuildfiles():
     return 0
   options = ParseArgs(argv)
-  RunGn(options)
+  if options.gn:
+    return RunGn(options)
+  else:
+    return RunGyp(options)
 
 
 if __name__ == '__main__':
diff --git a/tools/gyp/all.gypi b/tools/gyp/all.gypi
new file mode 100644
index 0000000..1db7dea
--- /dev/null
+++ b/tools/gyp/all.gypi
@@ -0,0 +1,45 @@
+# Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# A set of variables needed to build some of the Chrome based subparts of the
+# Dart project. This is in no way a complete list of variables being defined
+# by Chrome, but just the minimally needed subset.
+{
+  'variables': {
+    'library': 'static_library',
+    'component': 'static_library',
+    'target_arch': 'ia32',
+    # Flag that tells us whether to build native support for dart:io.
+    'dart_io_support': 1,
+    # Flag that tells us whether this is an ASAN build.
+    'asan%': 0,
+    # Flag that tells us whether this is a MSAN build.
+    'msan%': 0,
+    # Flag that teslls us whether this is a TSAN build.
+    'tsan%': 0,
+  },
+  'conditions': [
+    [ 'OS=="linux"', {
+      'target_defaults': {
+        'ldflags': [ '-pthread', ],
+      },
+    }],
+    [ 'OS=="win"', {
+      'target_defaults': {
+        'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
+      },
+      'includes': [
+        'msvs.gypi',
+      ],
+    }],
+    [ 'OS=="mac"', {
+      'includes': [
+        'xcode.gypi',
+      ],
+    }],
+  ],
+  'includes': [
+    'configurations.gypi',
+  ],
+}
diff --git a/tools/gyp/configurations.gypi b/tools/gyp/configurations.gypi
new file mode 100644
index 0000000..3d02bc6
--- /dev/null
+++ b/tools/gyp/configurations.gypi
@@ -0,0 +1,837 @@
+# Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'variables': {
+    'common_gcc_warning_flags': [
+      '-Wall',
+      '-Wextra', # Also known as -W.
+      '-Wno-unused-parameter',
+    ],
+
+    # Default value.  This may be overridden in a containing project gyp.
+    'target_arch%': 'ia32',
+
+    'conditions': [
+      ['"<(target_arch)"=="ia32"', { 'dart_target_arch': 'IA32', }],
+      ['"<(target_arch)"=="x64"', { 'dart_target_arch': 'X64', }],
+      ['"<(target_arch)"=="arm"', { 'dart_target_arch': 'ARM', }],
+      ['"<(target_arch)"=="armv6"', { 'dart_target_arch': 'ARMV6', }],
+      ['"<(target_arch)"=="armv5te"', { 'dart_target_arch': 'ARMV5TE', }],
+      ['"<(target_arch)"=="arm64"', { 'dart_target_arch': 'ARM64', }],
+      ['"<(target_arch)"=="simarm"', { 'dart_target_arch': 'SIMARM', }],
+      ['"<(target_arch)"=="simarmv6"', { 'dart_target_arch': 'SIMARMV6', }],
+      ['"<(target_arch)"=="simarmv5te"', { 'dart_target_arch': 'SIMARMV5TE', }],
+      ['"<(target_arch)"=="simarm64"', { 'dart_target_arch': 'SIMARM64', }],
+      ['"<(target_arch)"=="simdbc"', { 'dart_target_arch': 'SIMDBC', }],
+      ['"<(target_arch)"=="simdbc64"', { 'dart_target_arch': 'SIMDBC64', }],
+      [ 'OS=="linux"', { 'dart_target_os': 'Linux', } ],
+      [ 'OS=="mac"', { 'dart_target_os': 'Macos', } ],
+      [ 'OS=="win"', { 'dart_target_os': 'Win', } ],
+      # The OS is set to "android" only when we are building Dartium+Clank. We
+      # use 'chrome_target_os' so that Release and Debug configurations inherit
+      # from Android configurations when OS=="android". If OS is not set to
+      # Android, then Release and Debug inherit from the usual configurations.
+      [ 'OS=="android"', { 'chrome_target_os': 'Android',},
+                         { 'chrome_target_os': '',}],
+    ],
+  },
+  'includes': [
+    'configurations_android.gypi',
+    'configurations_make.gypi',
+    'configurations_xcode.gypi',
+    'configurations_msvs.gypi',
+  ],
+  'target_defaults': {
+    'default_configuration': 'DebugIA32',
+    'configurations': {
+      'Dart_Base': {
+        'abstract': 1,
+      },
+
+      'Dart_ia32_Base': {
+        'abstract': 1,
+      },
+
+      'Dart_x64_Base': {
+        'abstract': 1,
+      },
+
+      'Dart_simarm_Base': {
+        'abstract': 1,
+        'defines': [
+          'TARGET_ARCH_ARM',
+        ]
+      },
+
+      'Dart_simarmv6_Base': {
+        'abstract': 1,
+        'defines': [
+          'TARGET_ARCH_ARM',
+          'TARGET_ARCH_ARM_6',
+        ]
+      },
+
+      'Dart_simarmv5te_Base': {
+        'abstract': 1,
+        'defines': [
+          'TARGET_ARCH_ARM',
+          'TARGET_ARCH_ARM_5TE',
+        ]
+      },
+
+      'Dart_arm_Base': {
+        'abstract': 1,
+        'defines': [
+          'TARGET_ARCH_ARM',
+        ],
+      },
+
+      'Dart_armv6_Base': {
+        'abstract': 1,
+        'defines': [
+          'TARGET_ARCH_ARM',
+          'TARGET_ARCH_ARM_6',
+        ],
+      },
+
+      'Dart_armv5te_Base': {
+        'abstract': 1,
+        'defines': [
+          'TARGET_ARCH_ARM',
+          'TARGET_ARCH_ARM_5TE',
+        ],
+      },
+
+      'Dart_simarm64_Base': {
+        'abstract': 1,
+        'defines': [
+          'TARGET_ARCH_ARM64',
+        ]
+      },
+
+      'Dart_arm64_Base': {
+        'abstract': 1,
+        'defines': [
+          'TARGET_ARCH_ARM64',
+        ],
+      },
+
+      'Dart_simdbc_Base': {
+        'abstract': 1,
+        'defines': [
+          'TARGET_ARCH_DBC',
+          'USING_SIMULATOR',
+        ]
+      },
+
+      'Dart_Debug': {
+        'abstract': 1,
+      },
+
+      'Dart_Release': {
+        'abstract': 1,
+        'defines': [
+          'NDEBUG',
+        ],
+      },
+
+      'Dart_Product' : {
+        'abstract': 1,
+        'defines' : [
+          'NDEBUG',
+          'PRODUCT',
+        ]
+      },
+
+      # Configurations
+      'DebugIA32': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_ia32_Base', 'Dart_Debug',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_ia32_Base',
+          'Dart_<(dart_target_os)_Debug',
+        ],
+      },
+
+      'ReleaseIA32': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_ia32_Base', 'Dart_Release',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_ia32_Base',
+          'Dart_<(dart_target_os)_Release',
+        ],
+      },
+
+      'ProductIA32': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_ia32_Base', 'Dart_Product',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_ia32_Base',
+          'Dart_<(dart_target_os)_Product',
+        ],
+      },
+
+      'DebugX64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_x64_Base', 'Dart_Debug',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_x64_Base',
+          'Dart_<(dart_target_os)_Debug',
+        ],
+      },
+
+      'ReleaseX64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_x64_Base', 'Dart_Release',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_x64_Base',
+          'Dart_<(dart_target_os)_Release',
+        ],
+      },
+
+      'ProductX64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_x64_Base', 'Dart_Product',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_x64_Base',
+          'Dart_<(dart_target_os)_Product',
+        ],
+      },
+
+      'DebugSIMARM': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simarm_Base', 'Dart_Debug',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simarm_Base',
+          'Dart_<(dart_target_os)_Debug',
+        ],
+        'defines': [
+          'DEBUG',
+        ],
+      },
+
+      'ReleaseSIMARM': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simarm_Base', 'Dart_Release',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simarm_Base',
+          'Dart_<(dart_target_os)_Release',
+        ],
+      },
+
+      'ProductSIMARM': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simarm_Base', 'Dart_Product',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simarm_Base',
+          'Dart_<(dart_target_os)_Product',
+        ],
+      },
+
+      'DebugSIMARMV6': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simarmv6_Base', 'Dart_Debug',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simarmv6_Base',
+          'Dart_<(dart_target_os)_Debug',
+        ],
+        'defines': [
+          'DEBUG',
+        ],
+      },
+
+      'ReleaseSIMARMV6': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simarmv6_Base', 'Dart_Release',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simarmv6_Base',
+          'Dart_<(dart_target_os)_Release',
+        ],
+      },
+
+      'ProductSIMARMV6': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simarmv6_Base', 'Dart_Product',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simarmv6_Base',
+          'Dart_<(dart_target_os)_Product',
+        ],
+      },
+
+      'DebugSIMARMV5TE': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simarmv5te_Base', 'Dart_Debug',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simarmv5te_Base',
+          'Dart_<(dart_target_os)_Debug',
+        ],
+        'defines': [
+          'DEBUG',
+        ],
+      },
+
+      'ReleaseSIMARMV5TE': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simarmv5te_Base', 'Dart_Release',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simarmv5te_Base',
+          'Dart_<(dart_target_os)_Release',
+        ],
+      },
+
+      'ProductSIMARMV5TE': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simarmv5te_Base', 'Dart_Product',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simarmv5te_Base',
+          'Dart_<(dart_target_os)_Product',
+        ],
+      },
+
+      'DebugSIMARM64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simarm64_Base', 'Dart_Debug',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simarm64_Base',
+          'Dart_<(dart_target_os)_Debug',
+        ],
+        'defines': [
+          'DEBUG',
+        ],
+      },
+
+      'ReleaseSIMARM64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simarm64_Base', 'Dart_Release',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simarm64_Base',
+          'Dart_<(dart_target_os)_Release',
+        ],
+      },
+
+      'ProductSIMARM64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simarm64_Base', 'Dart_Product',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simarm64_Base',
+          'Dart_<(dart_target_os)_Product',
+        ],
+      },
+
+      'DebugSIMDBC': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Debug',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simdbc_Base',
+          'Dart_<(dart_target_os)_Debug',
+        ],
+        'defines': [
+          'DEBUG',
+        ],
+      },
+
+      'ReleaseSIMDBC': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Release',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simdbc_Base',
+          'Dart_<(dart_target_os)_Release',
+        ],
+      },
+
+      'ProductSIMDBC': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Product',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simdbc_Base',
+          'Dart_<(dart_target_os)_Product',
+        ],
+      },
+
+      'DebugSIMDBC64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Debug',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simdbc64_Base',
+          'Dart_<(dart_target_os)_Debug',
+        ],
+        'defines': [
+          'DEBUG',
+        ],
+      },
+
+      'ReleaseSIMDBC64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Release',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simdbc64_Base',
+          'Dart_<(dart_target_os)_Release',
+        ],
+      },
+
+      'ProductSIMDBC64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Product',
+          'Dart_<(dart_target_os)_Base',
+          'Dart_<(dart_target_os)_simdbc64_Base',
+          'Dart_<(dart_target_os)_Product',
+        ],
+      },
+
+      # Special Linux-only targets to enable SIMDBC cross compilation for
+      # non-Android ARM devices.
+      'DebugXARMSIMDBC': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Debug',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarm_Base',
+          'Dart_Linux_Debug',
+        ],
+        'defines': [
+          'DEBUG',
+        ],
+      },
+
+      'ReleaseXARMSIMDBC': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Release',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarm_Base',
+          'Dart_Linux_Release',
+        ],
+      },
+
+      'ProductXARMSIMDBC': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Product',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarm_Base',
+          'Dart_Linux_Product',
+        ],
+      },
+
+      # ARM hardware configurations are only for Linux and Android.
+      'DebugXARM': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm_Base', 'Dart_Debug',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarm_Base',
+          'Dart_Linux_Debug',
+        ],
+      },
+
+      'ReleaseXARM': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm_Base', 'Dart_Release',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarm_Base',
+          'Dart_Linux_Release',
+        ],
+      },
+
+      'ProductXARM': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm_Base', 'Dart_Product',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarm_Base',
+          'Dart_Linux_Product',
+        ],
+      },
+
+      'DebugARM': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm_Base', 'Dart_Debug',
+          'Dart_Linux_Base',
+          'Dart_Linux_arm_Base',
+          'Dart_Linux_Debug',
+        ],
+      },
+
+      'ReleaseARM': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm_Base', 'Dart_Release',
+          'Dart_Linux_Base',
+          'Dart_Linux_arm_Base',
+          'Dart_Linux_Release',
+        ],
+      },
+
+      'ProductARM': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm_Base', 'Dart_Product',
+          'Dart_Linux_Base',
+          'Dart_Linux_arm_Base',
+          'Dart_Linux_Product',
+        ],
+      },
+
+      'DebugXARMV6': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_armv6_Base', 'Dart_Debug',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarmv6_Base',
+          'Dart_Linux_Debug',
+        ],
+      },
+
+      'ReleaseXARMV6': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_armv6_Base', 'Dart_Release',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarmv6_Base',
+          'Dart_Linux_Release',
+        ],
+      },
+
+      'ProductXARMV6': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_armv6_Base', 'Dart_Product',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarmv6_Base',
+          'Dart_Linux_Product',
+        ],
+      },
+
+      'DebugARMV6': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_armv6_Base', 'Dart_Debug',
+          'Dart_Linux_Base',
+          'Dart_Linux_armv6_Base',
+          'Dart_Linux_Debug',
+        ],
+      },
+
+      'ReleaseARMV6': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_armv6_Base', 'Dart_Release',
+          'Dart_Linux_Base',
+          'Dart_Linux_armv6_Base',
+          'Dart_Linux_Release',
+        ],
+      },
+
+      'ProductARMV6': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_armv6_Base', 'Dart_Product',
+          'Dart_Linux_Base',
+          'Dart_Linux_armv6_Base',
+          'Dart_Linux_Product',
+        ],
+      },
+
+      'DebugXARMV5TE': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_armv5te_Base', 'Dart_Debug',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarmv5te_Base',
+          'Dart_Linux_Debug',
+        ],
+      },
+
+      'ReleaseXARMV5TE': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_armv5te_Base', 'Dart_Release',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarmv5te_Base',
+          'Dart_Linux_Release',
+        ],
+      },
+
+      'ProductXARMV5TE': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_armv5te_Base', 'Dart_Product',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarmv5te_Base',
+          'Dart_Linux_Product',
+        ],
+      },
+
+      'DebugARMV5TE': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_armv5te_Base', 'Dart_Debug',
+          'Dart_Linux_Base',
+          'Dart_Linux_armv5te_Base',
+          'Dart_Linux_Debug',
+        ],
+      },
+
+      'ReleaseARMV5TE': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_armv5te_Base', 'Dart_Release',
+          'Dart_Linux_Base',
+          'Dart_Linux_armv5te_Base',
+          'Dart_Linux_Release',
+        ],
+      },
+
+      'ProductARMV5TE': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_armv5te_Base', 'Dart_Product',
+          'Dart_Linux_Base',
+          'Dart_Linux_armv5te_Base',
+          'Dart_Linux_Product',
+        ],
+      },
+
+      'DebugXARM64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm64_Base', 'Dart_Debug',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarm64_Base',
+          'Dart_Linux_Debug',
+        ],
+      },
+
+      'ReleaseXARM64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm64_Base', 'Dart_Release',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarm64_Base',
+          'Dart_Linux_Release',
+        ],
+      },
+
+      'ProductXARM64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm64_Base', 'Dart_Product',
+          'Dart_Linux_Base',
+          'Dart_Linux_xarm64_Base',
+          'Dart_Linux_Product',
+        ],
+      },
+
+      'DebugARM64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm64_Base', 'Dart_Debug',
+          'Dart_Linux_Base',
+          'Dart_Linux_arm64_Base',
+          'Dart_Linux_Debug',
+        ],
+      },
+
+      'ReleaseARM64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm64_Base', 'Dart_Release',
+          'Dart_Linux_Base',
+          'Dart_Linux_arm64_Base',
+          'Dart_Linux_Release',
+        ],
+      },
+
+      'ProductARM64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm64_Base', 'Dart_Product',
+          'Dart_Linux_Base',
+          'Dart_Linux_arm64_Base',
+          'Dart_Linux_Product',
+        ],
+      },
+
+      # Android configurations. The configuration names explicitly include
+      # 'Android' because we are cross-building from Linux, and, when building
+      # the standalone VM, we cannot inspect the gyp built-in 'OS' variable to
+      # figure out that we are building for Android. Since we have not re-run
+      # gyp, it will still be 'linux'.
+      'DebugAndroidIA32': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_ia32_Base', 'Dart_Debug',
+          'Dart_Android_Base',
+          'Dart_Android_ia32_Base',
+          'Dart_Android_Debug',
+        ],
+      },
+
+      'ReleaseAndroidIA32': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_ia32_Base', 'Dart_Release',
+          'Dart_Android_Base',
+          'Dart_Android_ia32_Base',
+          'Dart_Android_Release',
+        ],
+      },
+
+      'ProductAndroidIA32': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_ia32_Base', 'Dart_Product',
+          'Dart_Android_Base',
+          'Dart_Android_ia32_Base',
+          'Dart_Android_Product',
+        ],
+      },
+
+      'DebugAndroidX64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_x64_Base', 'Dart_Debug',
+          'Dart_Android_Base',
+          'Dart_Android_x64_Base',
+          'Dart_Android_Debug',
+        ],
+      },
+
+      'ReleaseAndroidX64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_x64_Base', 'Dart_Release',
+          'Dart_Android_Base',
+          'Dart_Android_x64_Base',
+          'Dart_Android_Release',
+        ],
+      },
+
+      'ProductAndroidX64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_x64_Base', 'Dart_Product',
+          'Dart_Android_Base',
+          'Dart_Android_x64_Base',
+          'Dart_Android_Product',
+        ],
+      },
+
+      'DebugAndroidARM': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm_Base', 'Dart_Debug',
+          'Dart_Android_Base',
+          'Dart_Android_arm_Base',
+          'Dart_Android_Debug',
+        ],
+      },
+
+      'ReleaseAndroidARM': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm_Base', 'Dart_Release',
+          'Dart_Android_Base',
+          'Dart_Android_arm_Base',
+          'Dart_Android_Release',
+        ],
+      },
+
+      'ProductAndroidARM': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm_Base', 'Dart_Product',
+          'Dart_Android_Base',
+          'Dart_Android_arm_Base',
+          'Dart_Android_Product',
+        ],
+      },
+
+      'DebugAndroidARM64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm64_Base', 'Dart_Debug',
+          'Dart_Android_Base',
+          'Dart_Android_arm64_Base',
+          'Dart_Android_Debug',
+        ],
+      },
+
+      'ReleaseAndroidARM64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm64_Base', 'Dart_Release',
+          'Dart_Android_Base',
+          'Dart_Android_arm64_Base',
+          'Dart_Android_Release',
+        ],
+      },
+
+      'ProductAndroidARM64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_arm64_Base', 'Dart_Product',
+          'Dart_Android_Base',
+          'Dart_Android_arm64_Base',
+          'Dart_Android_Product',
+        ],
+      },
+
+      'DebugAndroidSIMDBC': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Debug',
+          'Dart_Android_Base',
+          # Default SIMDBC on Android targets arm.
+          'Dart_Android_arm_Base',
+          'Dart_Android_Debug',
+        ],
+        'defines': [
+          'DEBUG',
+        ],
+      },
+
+      'ReleaseAndroidSIMDBC': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Release',
+          'Dart_Android_Base',
+          # Default SIMDBC on Android targets arm.
+          'Dart_Android_arm_Base',
+          'Dart_Android_Release',
+        ],
+      },
+
+      'ProductAndroidSIMDBC': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Product',
+          'Dart_Android_Base',
+          # Default SIMDBC on Android targets arm.
+          'Dart_Android_arm_Base',
+          'Dart_Android_Product',
+        ],
+      },
+
+      'DebugAndroidSIMDBC64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Debug',
+          'Dart_Android_Base',
+          # Default SIMDBC on Android targets arm64.
+          'Dart_Android_arm64_Base',
+          'Dart_Android_Debug',
+        ],
+        'defines': [
+          'DEBUG',
+        ],
+      },
+
+      'ReleaseAndroidSIMDBC64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Release',
+          'Dart_Android_Base',
+          # Default SIMDBC on Android targets arm64.
+          'Dart_Android_arm64_Base',
+          'Dart_Android_Release',
+        ],
+      },
+
+      'ProductAndroidSIMDBC64': {
+        'inherit_from': [
+          'Dart_Base', 'Dart_simdbc_Base', 'Dart_Product',
+          'Dart_Android_Base',
+          # Default SIMDBC on Android targets arm64.
+          'Dart_Android_arm64_Base',
+          'Dart_Android_Product',
+        ],
+      },
+
+      # These targets assume that target_arch is passed in explicitly
+      # by the containing project (e.g., chromium).
+      'Debug': {
+        'inherit_from': ['Debug<(chrome_target_os)<(dart_target_arch)']
+      },
+
+      'Release': {
+        'inherit_from': ['Release<(chrome_target_os)<(dart_target_arch)']
+      },
+
+      'conditions': [
+        # On Windows ninja generator has hardcorded configuration naming
+        # patterns and it expects that x64 configurations are named smth_x64.
+        # This is a workaround for the crash that these expectations cause.
+        [ 'OS=="win" and GENERATOR=="ninja"', {
+          'DebugX64_x64': {
+            'inherit_from': [ 'DebugX64' ]
+          },
+
+          'ReleaseX64_x64': {
+            'inherit_from': [ 'ReleaseX64' ]
+          },
+        }],
+      ],
+    },
+  },
+}
diff --git a/tools/gyp/configurations_android.gypi b/tools/gyp/configurations_android.gypi
new file mode 100644
index 0000000..15ae2a5
--- /dev/null
+++ b/tools/gyp/configurations_android.gypi
@@ -0,0 +1,324 @@
+# Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# Definitions for building standalone Dart binaries to run on Android.
+# This is mostly excerpted from:
+# http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi
+
+{
+  'variables': {
+    'android_ndk_root': '<(PRODUCT_DIR)/../../third_party/android_tools/ndk',
+  },  # variables
+  'target_defaults': {
+    'configurations': {
+      # It is very important to get the order of the linker arguments correct.
+      # Therefore, we put them all in the architecture specific configurations,
+      # even though there are many flags in common, to avoid splitting them
+      # between two configurations and possibly accidentally mixing up the
+      # order.
+      'Dart_Android_Base': {
+        'abstract': 1,
+        'cflags': [
+          # No -Werror due to warnings in stl.
+          '<@(common_gcc_warning_flags)',
+          '-Wnon-virtual-dtor',
+          '-Wvla',
+          '-Woverloaded-virtual',
+          '-g3',
+          '-ggdb3',
+          '-fno-rtti',
+          '-fno-exceptions',
+        ],
+        'target_conditions': [
+          ['_toolset=="target"', {
+            'defines': [
+              'ANDROID',
+              'USE_STLPORT=1',
+              '__GNU_SOURCE=1',
+              '_STLP_USE_PTR_SPECIALIZATIONS=1',
+              'HAVE_OFF64_T',
+              'HAVE_SYS_UIO_H',
+            ],
+            'cflags!': [
+              '-pthread',  # Not supported by Android toolchain.
+            ],
+            'cflags': [
+              '-U__linux__',  # Don't allow toolchain to claim -D__linux__
+              '-U__linux',
+              '-ffunction-sections',
+              '-funwind-tables',
+              '-fstack-protector',
+              '-fno-short-enums',
+              '-finline-limit=64',
+              '-Wa,--noexecstack',
+            ],
+          }],
+        ],
+      },
+      'Dart_Android_Debug': {
+        'abstract': 1,
+        'defines': [
+          'DEBUG',
+        ],
+        'cflags': [
+          '-fno-omit-frame-pointer',
+        ],
+      },
+      'Dart_Android_Release': {
+        'abstract': 1,
+        'defines': [
+          'NDEBUG',
+        ],
+        'cflags!': [
+          '-O2',
+          '-Os',
+        ],
+        'cflags': [
+          '-fno-omit-frame-pointer',
+          '-fdata-sections',
+          '-ffunction-sections',
+          '-O3',
+        ],
+      },
+      'Dart_Android_Product': {
+        'abstract': 1,
+        'defines': [
+          'NDEBUG',
+          'PRODUCT',
+        ],
+        'cflags!': [
+          '-O2',
+          '-Os',
+        ],
+        'cflags': [
+          '-fdata-sections',
+          '-ffunction-sections',
+          '-O3',
+        ],
+      },
+      'Dart_Android_ia32_Base': {
+        'abstract': 1,
+        'variables': {
+          'android_sysroot': '<(android_ndk_root)/platforms/android-14/arch-x86',
+          'android_ndk_include': '<(android_sysroot)/usr/include',
+          'android_ndk_lib': '<(android_sysroot)/usr/lib',
+        },
+        'target_conditions': [
+          ['_toolset=="target"', {
+            # The x86 toolchain currently has problems with stack-protector.
+            'cflags!': [
+              '-fstack-protector',
+            ],
+            'cflags': [
+              '--sysroot=<(android_sysroot)',
+              '-I<(android_ndk_include)',
+              '-I<(android_ndk_root)/sources/cxx-stl/stlport/stlport',
+              '-fno-stack-protector',
+            ],
+            'target_conditions': [
+              ['_type=="executable"', {
+                'ldflags!': ['-Wl,--exclude-libs=ALL,-shared',],
+              }],
+              ['_type=="shared_library"', {
+                'ldflags': ['-Wl,-shared,-Bsymbolic',],
+              }],
+            ],
+            'ldflags': [
+              'ia32', '>(_type)', 'target',
+              '-nostdlib',
+              '-Wl,--no-undefined',
+              # Don't export symbols from statically linked libraries.
+              '-Wl,--exclude-libs=ALL',
+              '-Wl,-rpath-link=<(android_ndk_lib)',
+              '-L<(android_ndk_lib)',
+              # NOTE: The stlport header include paths below are specified in
+              # cflags rather than include_dirs because they need to come
+              # after include_dirs. Think of them like system headers, but
+              # don't use '-isystem' because the arm-linux-androideabi-4.4.3
+              # toolchain (circa Gingerbread) will exhibit strange errors.
+              # The include ordering here is important; change with caution.
+              '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/x86',
+              '-z',
+              'muldefs',
+              '-Bdynamic',
+              '-Wl,-dynamic-linker,/system/bin/linker',
+              '-Wl,--gc-sections',
+              '-Wl,-z,nocopyreloc',
+              # crtbegin_dynamic.o should be the last item in ldflags.
+              '<(android_ndk_lib)/crtbegin_dynamic.o',
+            ],
+            'ldflags!': [
+              '-pthread',  # Not supported by Android toolchain.
+            ],
+          }],
+          ['_toolset=="host"', {
+            'cflags': [ '-m32', '-pthread' ],
+            'ldflags': [ '-m32', '-pthread' ],
+          }],
+        ],
+      },
+      'Dart_Android_x64_Base': {
+        'abstract': 1,
+        'variables': {
+          'android_sysroot': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
+          'android_ndk_include': '<(android_sysroot)/usr/include',
+          'android_ndk_lib': '<(android_sysroot)/usr/lib64',
+        },
+        'target_conditions': [
+          ['_toolset=="target"', {
+            'cflags': [
+              '-fPIE',
+              '--sysroot=<(android_sysroot)',
+              '-I<(android_ndk_include)',
+              '-I<(android_ndk_root)/sources/cxx-stl/stlport/stlport',
+            ],
+            'target_conditions': [
+              ['_type=="executable"', {
+                'ldflags!': ['-Wl,--exclude-libs=ALL,-shared',],
+              }],
+              ['_type=="shared_library"', {
+                'ldflags': ['-Wl,-shared,-Bsymbolic',],
+              }],
+            ],
+            'ldflags': [
+              'x64', '>(_type)', 'target',
+              '-nostdlib',
+              '-Wl,--no-undefined',
+              # Don't export symbols from statically linked libraries.
+              '-Wl,--exclude-libs=ALL',
+              '-Wl,-rpath-link=<(android_ndk_lib)',
+              '-L<(android_ndk_lib)',
+              '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/x86_64',
+              '-z',
+              'muldefs',
+              '-Bdynamic',
+              '-pie',
+              '-Wl,-dynamic-linker,/system/bin/linker',
+              '-Wl,--gc-sections',
+              '-Wl,-z,nocopyreloc',
+              # crtbegin_dynamic.o should be the last item in ldflags.
+              '<(android_ndk_lib)/crtbegin_dynamic.o',
+            ],
+            'ldflags!': [
+              '-pthread',  # Not supported by Android toolchain.
+            ],
+          }],
+          ['_toolset=="host"', {
+            'cflags': [ '-pthread' ],
+            'ldflags': [ '-pthread' ],
+          }],
+        ],
+      },
+      'Dart_Android_arm_Base': {
+        'abstract': 1,
+        'variables': {
+          'android_sysroot': '<(android_ndk_root)/platforms/android-14/arch-arm',
+          'android_ndk_include': '<(android_sysroot)/usr/include',
+          'android_ndk_lib': '<(android_sysroot)/usr/lib',
+        },
+        'target_conditions': [
+          ['_toolset=="target"', {
+            'cflags': [
+              '-fPIE',
+              '--sysroot=<(android_sysroot)',
+              '-I<(android_ndk_include)',
+              '-I<(android_ndk_root)/sources/cxx-stl/stlport/stlport',
+              '-march=armv7-a',
+              '-mtune=cortex-a8',
+              '-mfpu=vfp3',
+              '-mfloat-abi=softfp',
+            ],
+            'target_conditions': [
+              ['_type=="executable"', {
+                'ldflags!': ['-Wl,--exclude-libs=ALL,-shared',],
+              }],
+              ['_type=="shared_library"', {
+                'ldflags': ['-Wl,-shared,-Bsymbolic',],
+              }],
+            ],
+            'ldflags': [
+              'arm', '>(_type)', 'target',
+              '-nostdlib',
+              '-Wl,--no-undefined',
+              # Don't export symbols from statically linked libraries.
+              '-Wl,--exclude-libs=ALL',
+              '-Wl,-rpath-link=<(android_ndk_lib)',
+              '-L<(android_ndk_lib)',
+              # Enable identical code folding to reduce size.
+              '-Wl,--icf=safe',
+              '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/armeabi-v7a',
+              '-z',
+              'muldefs',
+              '-Bdynamic',
+              '-pie',
+              '-Wl,-dynamic-linker,/system/bin/linker',
+              '-Wl,--gc-sections',
+              '-Wl,-z,nocopyreloc',
+              # crtbegin_dynamic.o should be the last item in ldflags.
+              '<(android_ndk_lib)/crtbegin_dynamic.o',
+            ],
+            'ldflags!': [
+              '-pthread',  # Not supported by Android toolchain.
+            ],
+          }],
+          ['_toolset=="host"', {
+            'cflags': [ '-m32', '-pthread' ],
+            'ldflags': [ '-m32', '-pthread' ],
+          }],
+        ],
+      },  # Dart_Android_arm_Base
+      'Dart_Android_arm64_Base': {
+        'abstract': 1,
+        'variables': {
+          'android_sysroot': '<(android_ndk_root)/platforms/android-21/arch-arm64',
+          'android_ndk_include': '<(android_sysroot)/usr/include',
+          'android_ndk_lib': '<(android_sysroot)/usr/lib',
+        },
+        'target_conditions': [
+          ['_toolset=="target"', {
+            'cflags': [
+              '-fPIE',
+              '--sysroot=<(android_sysroot)',
+              '-I<(android_ndk_include)',
+              '-I<(android_ndk_root)/sources/cxx-stl/stlport/stlport',
+            ],
+            'target_conditions': [
+              ['_type=="executable"', {
+                'ldflags!': ['-Wl,--exclude-libs=ALL,-shared',],
+              }],
+              ['_type=="shared_library"', {
+                'ldflags': ['-Wl,-shared,-Bsymbolic',],
+              }],
+            ],
+            'ldflags': [
+              'arm64', '>(_type)', 'target',
+              '-nostdlib',
+              '-Wl,--no-undefined',
+              # Don't export symbols from statically linked libraries.
+              '-Wl,--exclude-libs=ALL',
+              '-Wl,-rpath-link=<(android_ndk_lib)',
+              '-L<(android_ndk_lib)',
+              '-L<(android_ndk_root)/sources/cxx-stl/stlport/libs/arm64-v8a',
+              '-z',
+              'muldefs',
+              '-Bdynamic',
+              '-pie',
+              '-Wl,-dynamic-linker,/system/bin/linker64',
+              '-Wl,--gc-sections',
+              '-Wl,-z,nocopyreloc',
+              # crtbegin_dynamic.o should be the last item in ldflags.
+              '<(android_ndk_lib)/crtbegin_dynamic.o',
+            ],
+            'ldflags!': [
+              '-pthread',  # Not supported by Android toolchain.
+            ],
+          }],
+          ['_toolset=="host"', {
+            'ldflags': [ '-pthread' ],
+          }],
+        ],
+      },  # Dart_Android_arm64_Base
+    },  # configurations
+  },  # target_defaults
+}
diff --git a/tools/gyp/configurations_make.gypi b/tools/gyp/configurations_make.gypi
new file mode 100644
index 0000000..523dfab
--- /dev/null
+++ b/tools/gyp/configurations_make.gypi
@@ -0,0 +1,301 @@
+# Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'variables': {
+    'dart_debug_optimization_level%': '2',
+  },
+  'target_defaults': {
+    'configurations': {
+      'Dart_Linux_Base': {
+        'abstract': 1,
+        'defines': [
+          '_FORTIFY_SOURCE=2',
+        ],
+        'cflags': [
+          '<@(common_gcc_warning_flags)',
+          '-Wnon-virtual-dtor',
+          '-Wvla',
+          '-Woverloaded-virtual',
+          '-g3',
+          '-ggdb3',
+          '-fno-rtti',
+          '-fno-exceptions',
+          '-fstack-protector',
+          '-Wa,--noexecstack',
+        ],
+        'ldflags': [
+          '-Wl,-z,noexecstack',
+          '-Wl,-z,now',
+          '-Wl,-z,relro',
+        ],
+      },
+
+      'Dart_Linux_ia32_Base': {
+        'abstract': 1,
+        'cflags': [
+          '-m32',
+          '-msse2',
+          '-mfpmath=sse',
+        ],
+        'ldflags': [
+          '-m32',
+        ],
+      },
+
+      'Dart_Linux_x64_Base': {
+        'abstract': 1,
+        'cflags': [
+          '-m64',
+          '-msse2',
+        ],
+        'ldflags': [
+          '-m64',
+        ],
+      },
+
+      'Dart_Linux_simarm_Base': {
+        'abstract': 1,
+        'cflags': [
+          '-O3',
+          '-m32',
+          '-msse2',
+          '-mfpmath=sse',
+        ],
+        'ldflags': [
+          '-m32',
+        ],
+      },
+
+      'Dart_Linux_simarmv6_Base': {
+        'abstract': 1,
+        'cflags': [
+          '-O3',
+          '-m32',
+          '-msse2',
+          '-mfpmath=sse',
+        ],
+        'ldflags': [
+          '-m32',
+        ],
+      },
+
+      'Dart_Linux_simarmv5te_Base': {
+        'abstract': 1,
+        'cflags': [
+          '-O3',
+          '-m32',
+          '-msse2',
+          '-mfpmath=sse',
+        ],
+        'ldflags': [
+          '-m32',
+        ],
+      },
+
+      'Dart_Linux_simarm64_Base': {
+        'abstract': 1,
+        'cflags': [
+          '-O3',
+          '-m64',
+          '-msse2',
+          '-mfpmath=sse',
+        ],
+        'ldflags': [
+          '-m64',
+        ],
+      },
+
+      'Dart_Linux_simdbc_Base': {
+        'abstract': 1,
+        'cflags': [ '-O3', '-m32', '-msse2', '-mfpmath=sse' ],
+        'ldflags': [ '-m32', ],
+      },
+
+      'Dart_Linux_simdbc64_Base': {
+        'abstract': 1,
+        'cflags': [ '-O3', '-m64', '-msse2', '-mfpmath=sse' ],
+        'ldflags': [ '-m64', ],
+      },
+
+      # ARM cross-build
+      'Dart_Linux_xarm_Base': {
+        'abstract': 1,
+        'target_conditions': [
+        ['_toolset=="target"', {
+          'cflags': [
+            '-marm',
+            '-mfpu=vfp',
+            '-Wno-psabi', # suppresses va_list warning
+            '-fno-strict-overflow',
+          ],
+        }],
+        ['_toolset=="host"', {
+          'cflags': [
+            '-m32',
+            '-msse2',
+            '-mfpmath=sse',
+          ],
+          'ldflags': [
+            '-m32',
+          ],
+        }]]
+      },
+
+      # ARM native build
+      'Dart_Linux_arm_Base': {
+        'abstract': 1,
+        'cflags': [
+          '-marm',
+          '-mfpu=vfp',
+          '-Wno-psabi', # suppresses va_list warning
+          '-fno-strict-overflow',
+        ],
+      },
+
+      # ARMv6 cross-build
+      'Dart_Linux_xarmv6_Base': {
+        'abstract': 1,
+        'target_conditions': [
+        ['_toolset=="target"', {
+          'cflags': [
+            '-march=armv6',
+            '-mfpu=vfp',
+            '-Wno-psabi', # suppresses va_list warning
+            '-fno-strict-overflow',
+          ],
+        }],
+        ['_toolset=="host"', {
+          'cflags': [
+            '-m32',
+            '-msse2',
+            '-mfpmath=sse',
+          ],
+          'ldflags': [
+            '-m32',
+          ],
+        }]]
+      },
+
+      # ARMv6 native build
+      'Dart_Linux_armv6_Base': {
+        'abstract': 1,
+        'cflags': [
+          '-march=armv6',
+          '-mfpu=vfp',
+          '-Wno-psabi', # suppresses va_list warning
+          '-fno-strict-overflow',
+        ],
+      },
+
+      # ARMv5 cross-build
+      'Dart_Linux_xarmv5te_Base': {
+        'abstract': 1,
+        'target_conditions': [
+        ['_toolset=="target"', {
+          'cflags': [
+            '-mthumb',
+            '-mlong-calls',
+            '-march=armv5te',
+            '-mfloat-abi=soft',
+            '-Wno-psabi', # suppresses va_list warning
+            '-fno-strict-overflow',
+          ],
+        }],
+        ['_toolset=="host"', {
+          'cflags': [
+            '-m32',
+            '-msse2',
+            '-mfpmath=sse',
+          ],
+          'ldflags': [
+            '-m32',
+          ],
+        }]]
+      },
+
+      # ARMv5 native build
+      'Dart_Linux_armv5te_Base': {
+        'abstract': 1,
+        'cflags': [
+          '-mthumb',
+          '-mlong-calls',
+          '-march=armv5te',
+          '-mfloat-abi=soft',
+          '-Wno-psabi', # suppresses va_list warning
+          '-fno-strict-overflow',
+        ],
+      },
+
+      # ARM64 cross-build
+      'Dart_Linux_xarm64_Base': {
+        'abstract': 1,
+        'target_conditions': [
+        ['_toolset=="target"', {
+          'cflags': [
+            '-O3',
+          ],
+        }],
+        ['_toolset=="host"', {
+          'cflags': [
+            '-O3',
+            '-m64',
+            '-msse2',
+          ],
+          'ldflags': [
+            '-m64',
+          ],
+        }]]
+      },
+
+      # ARM64 native build
+      'Dart_Linux_arm64_Base': {
+        'abstract': 1,
+        'cflags': [
+          '-O3',
+        ],
+      },
+
+      'Dart_Linux_Debug': {
+        'abstract': 1,
+        'cflags': [
+          '-O<(dart_debug_optimization_level)',
+          '-fno-omit-frame-pointer',
+          # Clang on Linux will still omit frame pointers from leaf
+          # functions unless told otherwise:
+          # (note this flag only works on recent GCC versions.)
+          #'-mno-omit-leaf-frame-pointer',
+        ],
+      },
+
+      'Dart_Linux_Release': {
+        'abstract': 1,
+        'cflags': [
+          '-O3',
+          '-ffunction-sections',
+          '-fno-omit-frame-pointer',
+          # Clang on Linux will still omit frame pointers from leaf
+          # functions unless told otherwise:
+          # (note this flag only works on recent GCC versions.)
+          #'-mno-omit-leaf-frame-pointer',
+        ],
+        'ldflags': [
+          '-Wl,--gc-sections',
+        ],
+      },
+
+      'Dart_Linux_Product': {
+        'abstract': 1,
+        'cflags': [
+          '-O3',
+          '-ffunction-sections',
+          '-fomit-frame-pointer',
+        ],
+        'ldflags': [
+          '-Wl,--gc-sections',
+        ],
+      },
+    },
+  },
+}
diff --git a/tools/gyp/configurations_msvs.gypi b/tools/gyp/configurations_msvs.gypi
new file mode 100644
index 0000000..530b701
--- /dev/null
+++ b/tools/gyp/configurations_msvs.gypi
@@ -0,0 +1,143 @@
+# Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'variables': {
+    'dart_debug_optimization_level%': '2',
+  },
+  'target_defaults': {
+    'configurations': {
+      'Dart_Win_Base': {
+        'abstract': 1,
+        'msvs_configuration_attributes': {
+          'OutputDirectory': '<(DEPTH)\\out\\$(ConfigurationName)',
+          'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
+          'CharacterSet': '1',
+        },
+        'defines': [
+          '_HAS_EXCEPTIONS=0',  # disable C++ exceptions use in C++ std. libs.
+        ],
+      },
+      'Dart_Win_ia32_Base': {
+        'abstract': 1,
+      },
+      'Dart_Win_x64_Base': {
+        'abstract': 1,
+        'msvs_configuration_platform': 'x64',
+      },
+      'Dart_Win_simarm_Base': {
+        'abstract': 1,
+      },
+      'Dart_Win_simarmv6_Base': {
+        'abstract': 1,
+      },
+      'Dart_Win_simarmv5te_Base': {
+        'abstract': 1,
+      },
+      'Dart_Win_simarm64_Base': {
+        'abstract': 1,
+      },
+      'Dart_Win_simdbc_Base': {
+        'abstract': 1,
+      },
+      'Dart_Win_simdbc64_Base': {
+        'abstract': 1,
+      },
+      'Dart_Win_Debug': {
+        'abstract': 1,
+        'msvs_settings': {
+          'VCCLCompilerTool': {
+            'Optimization': '<(dart_debug_optimization_level)',
+            'BasicRuntimeChecks': '0',  # disable /RTC1 when compiling /O2
+            'DebugInformationFormat': '3',
+            'ExceptionHandling': '0',
+            'RuntimeTypeInfo': 'false',
+            'RuntimeLibrary': '1',  # /MTd - Multi-threaded, static (debug)
+            'OmitFramePointers': 'false',
+          },
+          'VCLinkerTool': {
+            'LinkIncremental': '2',
+            'GenerateDebugInformation': 'true',
+            'StackReserveSize': '2097152',
+            'AdditionalDependencies': [
+              'advapi32.lib',
+              'shell32.lib',
+              'dbghelp.lib',
+            ],
+          },
+        },
+        # C4351 warns MSVC follows the C++ specification regarding array
+        # initialization in member initializers.  Code that expects the
+        # specified behavior should silence this warning.
+        'msvs_disabled_warnings': [4351],
+      },
+
+      'Dart_Win_Release': {
+        'abstract': 1,
+        'msvs_settings': {
+          'VCCLCompilerTool': {
+            'Optimization': '2',
+            'InlineFunctionExpansion': '2',
+            'EnableIntrinsicFunctions': 'true',
+            'FavorSizeOrSpeed': '0',
+            'ExceptionHandling': '0',
+            'RuntimeTypeInfo': 'false',
+            'StringPooling': 'true',
+            'RuntimeLibrary': '0',  # /MT - Multi-threaded, static
+            'OmitFramePointers': 'false',
+          },
+          'VCLinkerTool': {
+            'LinkIncremental': '1',
+            'GenerateDebugInformation': 'true',
+            'OptimizeReferences': '2',
+            'EnableCOMDATFolding': '2',
+            'StackReserveSize': '2097152',
+            'AdditionalDependencies': [
+              'advapi32.lib',
+              'shell32.lib',
+              'dbghelp.lib',
+            ],
+          },
+        },
+        # C4351 warns MSVC follows the C++ specification regarding array
+        # initialization in member initializers.  Code that expects the
+        # specified behavior should silence this warning.
+        'msvs_disabled_warnings': [4351],
+      },
+
+      'Dart_Win_Product': {
+        'abstract': 1,
+        'msvs_settings': {
+          'VCCLCompilerTool': {
+            'Optimization': '2',
+            'InlineFunctionExpansion': '2',
+            'EnableIntrinsicFunctions': 'true',
+            'EnableFunctionLevelLinking': 'true',
+            'FavorSizeOrSpeed': '0',
+            'ExceptionHandling': '0',
+            'RuntimeTypeInfo': 'false',
+            'StringPooling': 'true',
+            'RuntimeLibrary': '0',  # /MT - Multi-threaded, static
+          },
+          'VCLinkerTool': {
+            'LinkIncremental': '1',
+            'GenerateDebugInformation': 'true',
+            'OptimizeReferences': '2',
+            'EnableCOMDATFolding': '2',
+            'StackReserveSize': '2097152',
+            'AdditionalDependencies': [
+            'advapi32.lib',
+            'shell32.lib',
+            'dbghelp.lib',
+            ],
+          },
+        },
+        # C4351 warns MSVC follows the C++ specification regarding array
+        # initialization in member initializers.  Code that expects the
+        # specified behavior should silence this warning.
+        'msvs_disabled_warnings': [4351],
+      },
+    },
+  },
+}
diff --git a/tools/gyp/configurations_xcode.gypi b/tools/gyp/configurations_xcode.gypi
new file mode 100644
index 0000000..5ce3b68
--- /dev/null
+++ b/tools/gyp/configurations_xcode.gypi
@@ -0,0 +1,112 @@
+# Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# The purpose of this file and others in this directory is to simulate
+# the Chromium build environment. This file is included in all GYP
+# files that are used by the Dart project.
+
+# READ BEFORE EDITING:
+# Do not add Dart VM specific configuration to this file. Instead,
+# modify runtime/tools/gyp/runtime-configurations.gypi.
+
+{
+  'variables': {
+    'xcode_gcc_version%': '<!(python <(DEPTH)/tools/gyp/find_mac_gcc_version.py)',
+  },
+  'target_defaults': {
+    'configurations': {
+      'Dart_Macos_Base': {
+        'abstract': 1,
+        'xcode_settings': {
+          'GCC_VERSION': '<(xcode_gcc_version)',
+          'GCC_C_LANGUAGE_STANDARD': 'ansi',
+          'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
+          'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
+          'GCC_DEBUGGING_SYMBOLS': 'default', # -g
+          'GCC_GENERATE_DEBUGGING_SYMBOLS': 'YES', # Do not strip symbols
+          'DEAD_CODE_STRIPPING': 'YES',  # -Wl,-dead_strip
+          'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
+          'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', # -fvisibility-inlines-hidden
+          'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
+          'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
+          'WARNING_CFLAGS': [
+            '<@(common_gcc_warning_flags)',
+            '-Wtrigraphs', # Disable Xcode default.
+            '-Wreturn-type',
+            '-Werror=return-type',
+            # TODO(15922): Enable this flag by default.
+            # '-Wshorten-64-to-32',
+          ],
+
+          # Generate PIC code as Chrome is switching to this.
+          'GCC_DYNAMIC_NO_PIC': 'NO',
+
+          # When searching for header files, do not search
+          # subdirectories. Without this option, vm/assert.h conflicts
+          # with the system header assert.h. Apple also recommend
+          # setting this to NO.
+          'ALWAYS_SEARCH_USER_PATHS': 'NO',
+
+          # Attempt to remove compiler options that Xcode adds by default.
+          'GCC_CW_ASM_SYNTAX': 'NO', # Remove -fasm-blocks.
+
+          'GCC_ENABLE_PASCAL_STRINGS': 'NO',
+          'GCC_ENABLE_TRIGRAPHS': 'NO',
+          'COMBINE_HIDPI_IMAGES': 'YES',
+        },
+      },
+      'Dart_Macos_ia32_Base': {
+        'abstract': 1,
+      },
+      'Dart_Macos_x64_Base': {
+        'abstract': 1,
+      },
+      'Dart_Macos_simarm_Base': {
+        'abstract': 1,
+      },
+      'Dart_Macos_simarmv6_Base': {
+        'abstract': 1,
+      },
+      'Dart_Macos_simarmv5te_Base': {
+        'abstract': 1,
+      },
+      'Dart_Macos_simarm64_Base': {
+        'abstract': 1,
+      },
+      'Dart_Macos_simdbc_Base': {
+        'abstract': 1,
+      },
+      'Dart_Macos_simdbc64_Base': {
+        'abstract': 1,
+      },
+      'Dart_Macos_Debug': {
+        'abstract': 1,
+        'xcode_settings': {
+          'OTHER_CFLAGS': [
+            '-fno-omit-frame-pointer',
+            '-mno-omit-leaf-frame-pointer',
+          ],
+        },
+      },
+      'Dart_Macos_Release': {
+        'abstract': 1,
+        'xcode_settings': {
+          'OTHER_CFLAGS': [
+            '-fno-omit-frame-pointer',
+            '-mno-omit-leaf-frame-pointer',
+          ],
+        },
+      },
+      'Dart_Macos_Product': {
+        'abstract': 1,
+        'xcode_settings': {
+          'OTHER_CFLAGS': [
+            '-fomit-frame-pointer',
+            '-momit-leaf-frame-pointer',
+          ],
+        },
+      },
+    },
+  },
+}
diff --git a/tools/gyp/find_mac_gcc_version.py b/tools/gyp/find_mac_gcc_version.py
new file mode 100755
index 0000000..79e9af3e
--- /dev/null
+++ b/tools/gyp/find_mac_gcc_version.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+# Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+import re
+import subprocess
+import sys
+
+def main():
+  job = subprocess.Popen(['xcodebuild', '-version'],
+                         stdout=subprocess.PIPE,
+                         stderr=subprocess.STDOUT)
+  stdout, stderr = job.communicate()
+  if job.returncode != 0:
+    print >>sys.stderr, stdout
+    print >>sys.stderr, stderr
+    raise Exception('Error %d running xcodebuild!' % job.returncode)
+  matches = re.findall('^Xcode (\d+)\.(\d+)(\.(\d+))?$', stdout, re.MULTILINE)
+  if len(matches) > 0:
+    major = int(matches[0][0])
+    minor = int(matches[0][1])
+
+    if major == 3 and minor >= 1:
+      return '4.2'
+    elif major == 4 and minor < 5:
+      return 'com.apple.compilers.llvmgcc42'
+    elif (major == 4 and minor >= 5) or major >= 5:
+      # XCode seems to select the specific clang version automatically
+      return 'com.apple.compilers.llvm.clang.1_0'
+    else:
+      raise Exception('Unknown XCode Version "%s"' % stdout)
+  else:
+    raise Exception('Could not parse output of xcodebuild "%s"' % stdout)
+
+if __name__ == '__main__':
+  if sys.platform != 'darwin':
+    #raise Exception("This script only runs on Mac")
+    # If we aren't on Mac, print out a dummy version string; it won't be used.
+    print 'X.X'
+  else:
+    print main()
diff --git a/tools/gyp/find_mac_sdk.py b/tools/gyp/find_mac_sdk.py
new file mode 100755
index 0000000..b280b3f
--- /dev/null
+++ b/tools/gyp/find_mac_sdk.py
@@ -0,0 +1,92 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 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.
+
+# Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# This file is a copy of Chromium's src/build/mac/find_sdk.py.
+# Revision 180337.
+
+import os
+import re
+import subprocess
+import sys
+
+"""Prints the lowest locally available SDK version greater than or equal to a
+given minimum sdk version to standard output.
+
+Usage:
+  python find_sdk.py 10.6  # Ignores SDKs < 10.6
+"""
+
+from optparse import OptionParser
+
+
+def parse_version(version_str):
+  """'10.6' => [10, 6]"""
+  return map(int, re.findall(r'(\d+)', version_str))
+
+
+def main():
+  parser = OptionParser()
+  parser.add_option("--verify",
+                    action="store_true", dest="verify", default=False,
+                    help="return the sdk argument and warn if it doesn't exist")
+  parser.add_option("--sdk_path",
+                    action="store", type="string", dest="sdk_path", default="",
+                    help="user-specified SDK path; bypasses verification")
+  (options, args) = parser.parse_args()
+  min_sdk_version = args[0]
+
+  job = subprocess.Popen(['xcode-select', '-print-path'],
+                         stdout=subprocess.PIPE,
+                         stderr=subprocess.STDOUT)
+  out, err = job.communicate()
+  if job.returncode != 0:
+    print >>sys.stderr, out
+    print >>sys.stderr, err
+    raise Exception(('Error %d running xcode-select, you might have to run '
+      '|sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer| '
+      'if you are using Xcode 4.') % job.returncode)
+  # The Developer folder moved in Xcode 4.3.
+  xcode43_sdk_path = os.path.join(
+      out.rstrip(), 'Platforms/MacOSX.platform/Developer/SDKs')
+  if os.path.isdir(xcode43_sdk_path):
+    sdk_dir = xcode43_sdk_path
+  else:
+    sdk_dir = os.path.join(out.rstrip(), 'SDKs')
+  sdks = [re.findall('^MacOSX(10\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
+  sdks = [s[0] for s in sdks if s]  # [['10.5'], ['10.6']] => ['10.5', '10.6']
+  sdks = [s for s in sdks  # ['10.5', '10.6'] => ['10.6']
+          if parse_version(s) >= parse_version(min_sdk_version)]
+  if not sdks:
+    raise Exception('No %s+ SDK found' % min_sdk_version)
+  best_sdk = sorted(sdks, key=parse_version)[0]
+
+  if options.verify and best_sdk != min_sdk_version and not options.sdk_path:
+    print >>sys.stderr, ''
+    print >>sys.stderr, '                                           vvvvvvv'
+    print >>sys.stderr, ''
+    print >>sys.stderr, \
+        'This build requires the %s SDK, but it was not found on your system.' \
+        % min_sdk_version
+    print >>sys.stderr, \
+        'Either install it, or explicitly set mac_sdk in your GYP_DEFINES.'
+    print >>sys.stderr, ''
+    print >>sys.stderr, '                                           ^^^^^^^'
+    print >>sys.stderr, ''
+    return min_sdk_version
+
+  return best_sdk
+
+
+if __name__ == '__main__':
+  if sys.platform != 'darwin':
+    # raise Exception("This script only runs on Mac")
+    # If we aren't on Mac, print out a dummy version string; it won't be used.
+    print 'X.X'
+  else:
+    print main()
diff --git a/tools/gyp/msvs.gypi b/tools/gyp/msvs.gypi
new file mode 100644
index 0000000..1ed6576
--- /dev/null
+++ b/tools/gyp/msvs.gypi
@@ -0,0 +1,17 @@
+# Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'target_defaults': {
+    'msvs_configuration_attributes': {
+      # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
+      # This block adds *project-wide* configuration settings to each project
+      # file.  It's almost always wrong to put things here. Instead, specify
+      # your custom msvs_configuration_attributes in a target_defaults section
+      # of a .gypi file that is explicitly included.
+      'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
+      'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
+    },
+  }
+}
diff --git a/tools/gyp/xcode.gypi b/tools/gyp/xcode.gypi
new file mode 100644
index 0000000..1799baf
--- /dev/null
+++ b/tools/gyp/xcode.gypi
@@ -0,0 +1,62 @@
+# Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'variables': {
+    # Mac OS X SDK and deployment target support.
+    # The SDK identifies the version of the system headers that will be used,
+    # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro.
+    # "Maximum allowed" refers to the operating system version whose APIs are
+    # available in the headers.
+    # The deployment target identifies the minimum system version that the
+    # built products are expected to function on.  It corresponds to the
+    # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.
+    # To ensure these macros are available, #include <AvailabilityMacros.h>.
+    # Additional documentation on these macros is available at
+    # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
+    # Chrome normally builds with the Mac OS X 10.5 SDK and sets the
+    # deployment target to 10.5.  Other projects, such as O3D, may override
+    # these defaults.
+    'mac_sdk%': '<!(python <(DEPTH)/tools/gyp/find_mac_sdk.py 10.8)',
+    'mac_deployment_target%': '10.8',
+  },
+  'xcode_settings': {
+    # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
+    # This block adds *project-wide* configuration settings to each project
+    # file.  It's almost always wrong to put things here.  Specify your
+    # custom xcode_settings in target_defaults to add them to targets instead.
+
+    # In an Xcode Project Info window, the "Base SDK for All Configurations"
+    # setting sets the SDK on a project-wide basis.  In order to get the
+    # configured SDK to show properly in the Xcode UI, SDKROOT must be set
+    # here at the project level.
+    'SDKROOT': 'macosx<(mac_sdk)',  # -isysroot
+
+    # The Xcode generator will look for an xcode_settings section at the root
+    # of each dict and use it to apply settings on a file-wide basis.  Most
+    # settings should not be here, they should be in target-specific
+    # xcode_settings sections, or better yet, should use non-Xcode-specific
+    # settings in target dicts.  SYMROOT is a special case, because many other
+    # Xcode variables depend on it, including variables such as
+    # PROJECT_DERIVED_FILE_DIR.  When a source group corresponding to something
+    # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
+    # files to appear (when present) in the UI as actual files and not red
+    # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
+    # and therefore SYMROOT, needs to be set at the project level.
+    'SYMROOT': '<(DEPTH)/xcodebuild',
+
+    # It is here to make it possible to run binaries with shared libraries.
+    # However, it may create problems if you move the shared library. Also,
+    # this may not be appropriate for "release release" builds.
+    # Perhaps we should set it to @rpath instead. See
+    # http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/RunpathDependentLibraries.html#//apple_ref/doc/uid/TP40008306-SW1
+    'INSTALL_PATH': '$(TARGET_BUILD_DIR)',
+
+    # This must go here because mac_deployment_target is defined in this file,
+    # which is only included on mac, and configurations_xcode.gypi is included
+    # on all platforms, so it would be an undefined variable there.
+    # Move this to configurations_xcode if we start including it only on mac.
+    'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
+  },
+}
diff --git a/tools/gyp_dart.py b/tools/gyp_dart.py
new file mode 100644
index 0000000..708d403
--- /dev/null
+++ b/tools/gyp_dart.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2012 The Dart Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Invoke gyp to generate build files for building the Dart VM.
+"""
+
+import os
+import subprocess
+import sys
+
+SCRIPT_DIR = os.path.dirname(sys.argv[0])
+DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
+
+def execute(args):
+  process = subprocess.Popen(args, cwd=DART_ROOT)
+  process.wait()
+  return process.returncode
+
+def main():
+  component = 'all'
+  if len(sys.argv) == 2:
+    component = sys.argv[1]
+
+  component_gyp_files = {
+    'all' : 'dart.gyp',
+    'runtime' : 'runtime/dart-runtime.gyp',
+  }
+  args = ['python', '-S', 'third_party/gyp/gyp_main.py',
+          '--depth=.', '-Itools/gyp/all.gypi',
+          component_gyp_files[component]]
+
+  sys.exit(execute(args))
+
+if __name__ == '__main__':
+  main()
diff --git a/utils/analysis_server/analysis_server.gyp b/utils/analysis_server/analysis_server.gyp
new file mode 100644
index 0000000..c238888
--- /dev/null
+++ b/utils/analysis_server/analysis_server.gyp
@@ -0,0 +1,35 @@
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'targets': [
+    {
+      'target_name': 'analysis_server',
+      'type': 'none',
+      'dependencies': [
+        '../../runtime/dart-runtime.gyp:dart',
+        '../../pkg/pkg_files.gyp:pkg_files_stamp'
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_analysis_server_snapshot',
+          'inputs': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '../../sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart',
+            '<(SHARED_INTERMEDIATE_DIR)/pkg_files.stamp',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/analysis_server.dart.snapshot',
+          ],
+          'action': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '--packages=../../.packages',
+            '--snapshot=<(SHARED_INTERMEDIATE_DIR)/analysis_server.dart.snapshot',
+            '../../pkg/analysis_server/bin/server.dart',
+          ],
+        },
+      ],
+    },
+  ],
+}
diff --git a/utils/compiler/compiler.gyp b/utils/compiler/compiler.gyp
new file mode 100644
index 0000000..272dd0a
--- /dev/null
+++ b/utils/compiler/compiler.gyp
@@ -0,0 +1,72 @@
+# Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'variables': {
+    'dart_dir': '../..',
+  },
+  'targets': [
+    {
+      'target_name': 'dart2js',
+      'type': 'none',
+      'dependencies': [
+        '../../runtime/dart-runtime.gyp:dart',
+        'dart2js_files_stamp',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_snapshots',
+          'inputs': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '../../sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart',
+            '<!@(["python", "../../tools/list_files.py",  "relative", '
+                '"\\.dart$", '
+                '"../../runtime/lib", '
+                '"../../sdk/lib/_internal/dartdoc"])',
+            'create_snapshot.dart',
+            '<(SHARED_INTERMEDIATE_DIR)/dart2js_files.stamp',
+            '../../tools/VERSION',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/utils_wrapper.dart.snapshot',
+            '<(SHARED_INTERMEDIATE_DIR)/dart2js.dart.snapshot',
+          ],
+          'action': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '--packages=../../.packages',
+            'create_snapshot.dart',
+            '--output_dir=<(SHARED_INTERMEDIATE_DIR)',
+            '--dart2js_main=pkg/compiler/lib/src/dart2js.dart',
+          ],
+        },
+      ],
+    },
+    # Other targets depend on dart2js files, but have to many inputs,
+    # which causes issues on some platforms.
+    # This target lists all the files in pkg/compiler,
+    # and creates a single dart2js_files.stamp
+    {
+      'target_name': 'dart2js_files_stamp',
+      'type': 'none',
+      'actions': [
+        {
+          'action_name': 'make_dart2js_files_stamp',
+          'inputs': [
+            '../../tools/create_timestamp_file.py',
+            '<!@(["python", "../../tools/list_files.py", "relative", '
+                '"\\.dart$", '
+                ' "../../pkg/compiler/lib"])',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/dart2js_files.stamp',
+          ],
+          'action': [
+            'python', '../../tools/create_timestamp_file.py',
+            '<@(_outputs)',
+          ],
+        },
+      ],
+    }
+  ],
+}
diff --git a/utils/dartanalyzer/dartanalyzer.gyp b/utils/dartanalyzer/dartanalyzer.gyp
new file mode 100644
index 0000000..282d304
--- /dev/null
+++ b/utils/dartanalyzer/dartanalyzer.gyp
@@ -0,0 +1,77 @@
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'targets': [
+    {
+      'target_name': 'dartanalyzer',
+      'type': 'none',
+      'dependencies': [
+        '../../runtime/dart-runtime.gyp:dart',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_dartanalyzer_snapshot',
+          'inputs': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '../../sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart',
+            '<!@(["python", "../../tools/list_dart_files.py", "relative", '
+                '"../../pkg/analyzer_cli"])',
+            '<!@(["python", "../../tools/list_dart_files.py", "relative", '
+                '"../../pkg/analyzer"])',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/dartanalyzer.dart.snapshot',
+          ],
+          'action': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '--packages=../../.packages',
+            '--snapshot=<(SHARED_INTERMEDIATE_DIR)/dartanalyzer.dart.snapshot',
+            '../../pkg/analyzer_cli/bin/analyzer.dart',
+          ],
+        },
+        {
+          'action_name': 'generate_summary_spec',
+          'inputs': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '<!@(["python", "../../tools/list_dart_files.py", "relative", '
+                '"../../sdk/lib"])',
+            '<!@(["python", "../../tools/list_dart_files.py", "relative", '
+                '"../../pkg/analyzer"])',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/spec.sum',
+          ],
+          'action': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '--packages=../../.packages',
+            '../../pkg/analyzer/tool/summary/build_sdk_summaries.dart',
+            'build-spec',
+            '<(SHARED_INTERMEDIATE_DIR)/spec.sum',
+          ],
+        },
+        {
+          'action_name': 'generate_summary_strong',
+          'inputs': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '<!@(["python", "../../tools/list_dart_files.py", "relative", '
+                '"../../sdk/lib"])',
+            '<!@(["python", "../../tools/list_dart_files.py", "relative", '
+                '"../../pkg/analyzer"])',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/strong.sum',
+          ],
+          'action': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '--packages=../../.packages',
+            '../../pkg/analyzer/tool/summary/build_sdk_summaries.dart',
+            'build-strong',
+            '<(SHARED_INTERMEDIATE_DIR)/strong.sum',
+          ],
+        },
+      ],
+    },
+  ],
+}
diff --git a/utils/dartdevc/dartdevc.gyp b/utils/dartdevc/dartdevc.gyp
new file mode 100644
index 0000000..b141bc5
--- /dev/null
+++ b/utils/dartdevc/dartdevc.gyp
@@ -0,0 +1,36 @@
+# Copyright (c) 2016, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'targets': [
+    {
+      'target_name': 'dartdevc',
+      'type': 'none',
+      'dependencies': [
+        '../../runtime/dart-runtime.gyp:dart',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_dartdevc_snapshot',
+          'inputs': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '../../sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart',
+            '<!@(["python", "../../tools/list_dart_files.py", "relative", '
+                '"../../pkg/dev_compiler/bin"])',
+            '<(SHARED_INTERMEDIATE_DIR)/pkg_files.stamp',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/dartdevc.dart.snapshot',
+          ],
+          'action': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '--packages=../../.packages',
+            '--snapshot=<(SHARED_INTERMEDIATE_DIR)/dartdevc.dart.snapshot',
+            '../../pkg/dev_compiler/bin/dartdevc.dart'
+          ],
+        },
+      ],
+    },
+  ],
+}
diff --git a/utils/dartdoc/dartdoc.gyp b/utils/dartdoc/dartdoc.gyp
new file mode 100644
index 0000000..e5327c0
--- /dev/null
+++ b/utils/dartdoc/dartdoc.gyp
@@ -0,0 +1,35 @@
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'targets': [
+    {
+      'target_name': 'dartdoc',
+      'type': 'none',
+      'dependencies': [
+        '../../runtime/dart-runtime.gyp:dart',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_dartdoc_snapshot',
+          'inputs': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '../../sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart',
+            '<!@(["python", "../../tools/list_dart_files.py", "relative", '
+                '"../../third_party/pkg/dartdoc"])',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/dartdoc.dart.snapshot',
+          ],
+          'action': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '--packages=../../.packages',
+            '--snapshot=<(SHARED_INTERMEDIATE_DIR)/dartdoc.dart.snapshot',
+            '../../third_party/pkg/dartdoc/bin/dartdoc.dart',
+          ],
+        },
+      ],
+    },
+  ],
+}
diff --git a/utils/dartfmt/dartfmt.gyp b/utils/dartfmt/dartfmt.gyp
new file mode 100644
index 0000000..5590883
--- /dev/null
+++ b/utils/dartfmt/dartfmt.gyp
@@ -0,0 +1,35 @@
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'targets': [
+    {
+      'target_name': 'dartfmt',
+      'type': 'none',
+      'dependencies': [
+        '../../runtime/dart-runtime.gyp:dart',
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_dartfmt_snapshot',
+          'inputs': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '../../sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart',
+            '<!@(["python", "../../tools/list_dart_files.py", "relative", '
+                '"../../third_party/pkg_tested/dart_style"])',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/dartfmt.dart.snapshot',
+          ],
+          'action': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '--packages=../../.packages',
+            '--snapshot=<(SHARED_INTERMEDIATE_DIR)/dartfmt.dart.snapshot',
+            '../../third_party/pkg_tested/dart_style/bin/format.dart',
+          ],
+        },
+      ],
+    },
+  ],
+}
diff --git a/utils/pub/pub.gyp b/utils/pub/pub.gyp
new file mode 100644
index 0000000..b568c0c
--- /dev/null
+++ b/utils/pub/pub.gyp
@@ -0,0 +1,37 @@
+# Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+{
+  'targets': [
+    {
+      'target_name': 'pub',
+      'type': 'none',
+      'dependencies': [
+        '../../runtime/dart-runtime.gyp:dart',
+        '../../pkg/pkg_files.gyp:pkg_files_stamp',
+        '../../utils/compiler/compiler.gyp:dart2js_files_stamp'
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_pub_snapshot',
+          'inputs': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '../../sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart',
+            '<(SHARED_INTERMEDIATE_DIR)/dart2js_files.stamp',
+            '<(SHARED_INTERMEDIATE_DIR)/pkg_files.stamp',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/pub.dart.snapshot',
+          ],
+          'action': [
+            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
+            '--packages=../../.packages',
+            '--snapshot=<(SHARED_INTERMEDIATE_DIR)/pub.dart.snapshot',
+            '../../third_party/pkg/pub/bin/pub.dart',
+          ]
+        },
+      ],
+    },
+  ],
+}