 +    self.path = path
 +    self.file = open(path, 'w')
 +    self.variables = {}  # XXX take in global values.
++
++  def FullPath(self, path):
++    """Convert a per-gypfile path (i.e. relative to gyp file directory) into
++    a project-qualified path."""
++    if path.startswith('@'):
++      return path
++    return os.path.normpath(os.path.join(self.base_dir, path))
 +
 +  def WriteSpec(self, spec, config):
 +    if spec['type'] == 'settings':

===================================================================
--- pylib/gyp/generator/ninja.py	(revision 0)
+++ pylib/gyp/generator/ninja.py	(revision 0)
@@ -0,0 +1,308 @@
+#!/usr/bin/python
+
+# Copyright (c) 2010 Google Inc. All rights reserved.

+    self.WriteVariableList('ldflags', config.get('ldflags'))
+    self.WriteVariableList('libs', spec.get('libraries'))
+
+    output = self.ComputeOutput(spec)
+    if 'dependencies' in spec:
+      for dep in spec['dependencies']:
+        dep = self.linkable_outputs.get(dep)
