ninja: Stop lower-casing outputs on case-insensitive file systems.

This was added to fix a problem with file renames that rename a file only
in captialization (https://chromiumcodereview.appspot.com/10907140).  Now
that we use depsmode (which reads deps from a flat text file instead of
doing a lookup for a depsfile on the file system, and which always does
so case-sensitively), this is no longer necessary.  The test we added
when we added this hack still passes.

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/23542007

git-svn-id: http://gyp.googlecode.com/svn/trunk@1712 78cadc50-ecff-11dd-a971-7dbc132099af
diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py
index ac449a3..d6eff22 100644
--- a/pylib/gyp/generator/ninja.py
+++ b/pylib/gyp/generator/ninja.py
@@ -359,8 +359,7 @@
     output_file_base = os.path.splitext(self.output_file_name)[0]
     return '%s.%s.ninja' % (output_file_base, arch)
 
-  def WriteSpec(self, spec, config_name, generator_flags,
-      case_sensitive_filesystem):
+  def WriteSpec(self, spec, config_name, generator_flags):
     """The main entry point for NinjaWriter: write the build rules for a spec.
 
     Returns a Target object, which represents the output paths for this spec.
@@ -458,7 +457,7 @@
             lambda path, lang: self.GypPathToUniqueOutput(path + '-' + lang))
       link_deps = self.WriteSources(
           self.ninja, config_name, config, sources, compile_depends_stamp, pch,
-          case_sensitive_filesystem, spec)
+          spec)
       # Some actions/rules output 'sources' that are already object files.
       obj_outputs = [f for f in sources if f.endswith(self.obj_ext)]
       if obj_outputs:
@@ -759,7 +758,7 @@
     bundle_depends.append(out)
 
   def WriteSources(self, ninja_file, config_name, config, sources, predepends,
-                   precompiled_header, case_sensitive_filesystem, spec):
+                   precompiled_header, spec):
     """Write build rules to compile all of |sources|."""
     if self.toolset == 'host':
       self.ninja.variable('ar', '$ar_host')
@@ -770,16 +769,15 @@
     if self.flavor != 'mac' or len(self.archs) == 1:
       return self.WriteSourcesForArch(
           self.ninja, config_name, config, sources, predepends,
-          precompiled_header, case_sensitive_filesystem, spec)
+          precompiled_header, spec)
     else:
       return dict((arch, self.WriteSourcesForArch(
             self.arch_subninjas[arch], config_name, config, sources, predepends,
-            precompiled_header, case_sensitive_filesystem, spec, arch=arch))
+            precompiled_header, spec, arch=arch))
           for arch in self.archs)
 
   def WriteSourcesForArch(self, ninja_file, config_name, config, sources,
-                          predepends, precompiled_header,
-                          case_sensitive_filesystem, spec, arch=None):
+                          predepends, precompiled_header, spec, arch=None):
     """Write build rules to compile all of |sources|."""
 
     extra_defines = []
@@ -890,12 +888,6 @@
       output = self.GypPathToUniqueOutput(filename + obj_ext)
       if arch is not None:
         output = AddArch(output, arch)
-      # Ninja's depfile handling gets confused when the case of a filename
-      # changes on a case-insensitive file system. To work around that, always
-      # convert .o filenames to lowercase on such file systems. See
-      # https://github.com/martine/ninja/issues/402 for details.
-      if not case_sensitive_filesystem:
-        output = output.lower()
       implicit = precompiled_header.GetObjDependencies([input], [output], arch)
       variables = []
       if self.flavor == 'win':
@@ -1616,8 +1608,6 @@
   master_ninja = ninja_syntax.Writer(
       OpenOutput(os.path.join(toplevel_build, 'build.ninja')),
       width=120)
-  case_sensitive_filesystem = not os.path.exists(
-      os.path.join(toplevel_build, 'BUILD.NINJA'))
 
   # Put build-time support tools in out/{config_name}.
   gyp.common.CopyTool(flavor, toplevel_build)
@@ -2022,8 +2012,7 @@
                          flavor, toplevel_dir=options.toplevel_dir)
     master_ninja.subninja(output_file)
 
-    target = writer.WriteSpec(
-        spec, config_name, generator_flags, case_sensitive_filesystem)
+    target = writer.WriteSpec(spec, config_name, generator_flags)
     if target:
       if name != target.FinalOutput() and spec['toolset'] == 'target':
         target_short_names.setdefault(name, []).append(target)