Use commit_id.py on Windows, and handle missing git.

This allows us to delete the Windows batch file.

Changes the commit_id script to take the working directory so that it
can be called from a different working directory than the angle
repository is in.

Renames the generated commit header to angle_commit.h. This is being
written to the shared generated code directory for the entire build,
and "commit.h" is insufficiently unique.

BUG=angle:669
BUG=395705

Change-Id: I35e80411a7e8ba1e02ce3f6a4fc54ed4dbc918f3
Reviewed-on: https://chromium-review.googlesource.com/209617
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/generate_projects b/generate_projects
index 6743254..8175277 100644
--- a/generate_projects
+++ b/generate_projects
@@ -34,6 +34,7 @@
     gyp_cmd += ' -D angle_build_tests=' + ('1' if build_tests else '0')
     gyp_cmd += ' -D angle_build_samples=' + ('1' if build_samples else '0')
     gyp_cmd += ' -D release_symbols=' + ('true' if release_symbols else 'false')
+    gyp_cmd += ' -D angle_use_commit_id=0'
     gyp_cmd += ' ' + os.path.join(script_dir, 'all.gyp')
 
     print 'Generating projects to ' + generation_dir + ' from gyp files...'
diff --git a/projects/build/All.vcxproj b/projects/build/All.vcxproj
index fc2689a..e4d508a 100644
--- a/projects/build/All.vcxproj
+++ b/projects/build/All.vcxproj
@@ -36,7 +36,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate\angle;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <BufferSecurityCheck>true</BufferSecurityCheck>
@@ -65,14 +65,14 @@
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
     <ResourceCompile>
-      <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate\angle;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <Culture>0x0409</Culture>
       <PreprocessorDefinitions>ANGLE_TRANSLATOR_STATIC;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate\angle;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
       <BufferSecurityCheck>true</BufferSecurityCheck>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@@ -100,7 +100,7 @@
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
     <ResourceCompile>
-      <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(OutDir)obj\global_intermediate\angle;..\..\include;..\..\samples\angle\sample_util;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <Culture>0x0409</Culture>
       <PreprocessorDefinitions>ANGLE_TRANSLATOR_STATIC;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
@@ -113,10 +113,6 @@
       <Project>{63FB0B97-D1D9-5158-8E85-7F5B1E403817}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
-    <ProjectReference Include="..\src\commit_id.vcxproj">
-      <Project>{3B7F5656-177F-52EE-26B3-D6A75368D0A9}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
     <ProjectReference Include="..\src\preprocessor.vcxproj">
       <Project>{C7BAF548-697D-2DCB-9DF3-9D1506A7B444}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
@@ -133,6 +129,10 @@
       <Project>{19386E01-D811-FA3B-9F1E-122BB0C0E9F5}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\src\commit_id.vcxproj">
+      <Project>{3B7F5656-177F-52EE-26B3-D6A75368D0A9}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
     <ProjectReference Include="..\src\copy_compiler_dll.vcxproj">
       <Project>{22DC02D5-1598-943C-13E1-82185B469F81}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
diff --git a/projects/build/all.sln b/projects/build/all.sln
index 1aa0796..5862edd 100644
--- a/projects/build/all.sln
+++ b/projects/build/all.sln
@@ -3,11 +3,11 @@
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "All", "All.vcxproj", "{D048EF6F-5312-AF41-8D8A-DB22CD8634E6}"
 	ProjectSection(ProjectDependencies) = postProject
 		{63FB0B97-D1D9-5158-8E85-7F5B1E403817} = {63FB0B97-D1D9-5158-8E85-7F5B1E403817}
-		{3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}
 		{C7BAF548-697D-2DCB-9DF3-9D1506A7B444} = {C7BAF548-697D-2DCB-9DF3-9D1506A7B444}
 		{276D20F5-2943-414C-0FF6-21F4723A5CF6} = {276D20F5-2943-414C-0FF6-21F4723A5CF6}
 		{C15697F6-5057-016E-BD29-422971875679} = {C15697F6-5057-016E-BD29-422971875679}
 		{19386E01-D811-FA3B-9F1E-122BB0C0E9F5} = {19386E01-D811-FA3B-9F1E-122BB0C0E9F5}
+		{3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}
 		{22DC02D5-1598-943C-13E1-82185B469F81} = {22DC02D5-1598-943C-13E1-82185B469F81}
 		{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}
 		{FBAEE4F6-562A-588F-01F9-72DCABB3B061} = {FBAEE4F6-562A-588F-01F9-72DCABB3B061}
@@ -30,9 +30,6 @@
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "commit_id", "..\src\commit_id.vcxproj", "{3B7F5656-177F-52EE-26B3-D6A75368D0A9}"
-	ProjectSection(ProjectDependencies) = postProject
-		{63FB0B97-D1D9-5158-8E85-7F5B1E403817} = {63FB0B97-D1D9-5158-8E85-7F5B1E403817}
-	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copy_compiler_dll", "..\src\copy_compiler_dll.vcxproj", "{22DC02D5-1598-943C-13E1-82185B469F81}"
 	ProjectSection(ProjectDependencies) = postProject
@@ -68,7 +65,6 @@
 	ProjectSection(ProjectDependencies) = postProject
 		{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}
 		{3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}
-		{63FB0B97-D1D9-5158-8E85-7F5B1E403817} = {63FB0B97-D1D9-5158-8E85-7F5B1E403817}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLESv2", "..\src\libGLESv2.vcxproj", "{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}"
diff --git a/projects/samples/samples.sln b/projects/samples/samples.sln
index 53cec34..b927860 100644
--- a/projects/samples/samples.sln
+++ b/projects/samples/samples.sln
@@ -1,9 +1,6 @@
 Microsoft Visual Studio Solution File, Format Version 11.00
 # Visual C++ Express 2010
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "commit_id", "..\src\commit_id.vcxproj", "{3B7F5656-177F-52EE-26B3-D6A75368D0A9}"
-	ProjectSection(ProjectDependencies) = postProject
-		{63FB0B97-D1D9-5158-8E85-7F5B1E403817} = {63FB0B97-D1D9-5158-8E85-7F5B1E403817}
-	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copy_compiler_dll", "..\src\copy_compiler_dll.vcxproj", "{22DC02D5-1598-943C-13E1-82185B469F81}"
 	ProjectSection(ProjectDependencies) = postProject
@@ -39,7 +36,6 @@
 	ProjectSection(ProjectDependencies) = postProject
 		{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}
 		{3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}
-		{63FB0B97-D1D9-5158-8E85-7F5B1E403817} = {63FB0B97-D1D9-5158-8E85-7F5B1E403817}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLESv2", "..\src\libGLESv2.vcxproj", "{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}"
diff --git a/projects/src/angle.sln b/projects/src/angle.sln
index 0d6ec65..cdf9f53 100644
--- a/projects/src/angle.sln
+++ b/projects/src/angle.sln
@@ -1,9 +1,6 @@
 Microsoft Visual Studio Solution File, Format Version 11.00
 # Visual C++ Express 2010
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "commit_id", "commit_id.vcxproj", "{3B7F5656-177F-52EE-26B3-D6A75368D0A9}"
-	ProjectSection(ProjectDependencies) = postProject
-		{63FB0B97-D1D9-5158-8E85-7F5B1E403817} = {63FB0B97-D1D9-5158-8E85-7F5B1E403817}
-	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copy_compiler_dll", "copy_compiler_dll.vcxproj", "{22DC02D5-1598-943C-13E1-82185B469F81}"
 	ProjectSection(ProjectDependencies) = postProject
@@ -16,7 +13,6 @@
 	ProjectSection(ProjectDependencies) = postProject
 		{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81} = {7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}
 		{3B7F5656-177F-52EE-26B3-D6A75368D0A9} = {3B7F5656-177F-52EE-26B3-D6A75368D0A9}
-		{63FB0B97-D1D9-5158-8E85-7F5B1E403817} = {63FB0B97-D1D9-5158-8E85-7F5B1E403817}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLESv2", "libGLESv2.vcxproj", "{7FBD6F69-B9A4-69F1-A12B-8DACB3F8CD81}"
diff --git a/projects/src/commit_id.vcxproj b/projects/src/commit_id.vcxproj
index a73f463..6acbadc 100644
--- a/projects/src/commit_id.vcxproj
+++ b/projects/src/commit_id.vcxproj
@@ -36,16 +36,14 @@
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <BufferSecurityCheck>true</BufferSecurityCheck>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <DisableSpecificWarnings>4100;4127;4239;4244;4245;4512;4702;4530;4718;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <MinimalRebuild>false</MinimalRebuild>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;_HAS_EXCEPTIONS=0;_WINDOWS;WIN32;WIN32_LEAN_AND_MEAN;ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };NOMINMAX;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
       <RuntimeTypeInfo>true</RuntimeTypeInfo>
       <TreatWarningAsError>true</TreatWarningAsError>
@@ -55,7 +53,7 @@
       <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Lib>
     <Link>
-      <AdditionalDependencies>kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib</AdditionalDependencies>
+      <AdditionalDependencies></AdditionalDependencies>
       <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <FixedBaseAddress>false</FixedBaseAddress>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -65,22 +63,19 @@
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
     <ResourceCompile>
-      <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };NOMINMAX;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
       <BufferSecurityCheck>true</BufferSecurityCheck>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <DisableSpecificWarnings>4100;4127;4239;4244;4245;4512;4702;4530;4718;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <MinimalRebuild>false</MinimalRebuild>
       <Optimization>MaxSpeed</Optimization>
-      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;_HAS_EXCEPTIONS=0;_WINDOWS;WIN32;WIN32_LEAN_AND_MEAN;ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };NOMINMAX;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
       <RuntimeTypeInfo>true</RuntimeTypeInfo>
       <TreatWarningAsError>true</TreatWarningAsError>
@@ -90,7 +85,7 @@
       <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Lib>
     <Link>
-      <AdditionalDependencies>kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib</AdditionalDependencies>
+      <AdditionalDependencies></AdditionalDependencies>
       <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <FixedBaseAddress>false</FixedBaseAddress>
       <GenerateDebugInformation>false</GenerateDebugInformation>
@@ -100,32 +95,21 @@
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
     <ResourceCompile>
-      <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <Culture>0x0409</Culture>
-      <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };NOMINMAX;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
   </ItemDefinitionGroup>
   <ItemGroup>
     <None Include="..\..\src\angle.gyp"/>
-    <None Include="..\..\.git\index">
-      <ExcludedFromBuild>true</ExcludedFromBuild>
-    </None>
   </ItemGroup>
   <ItemGroup>
-    <CustomBuild Include="$(OutDir)obj\global_intermediate\commit_id.bat">
+    <CustomBuild Include="..\..\src\commit.h">
       <FileType>Document</FileType>
-      <Command>call call $(OutDir)obj\global_intermediate\commit_id.bat &quot;$(OutDir)obj\global_intermediate&quot;</Command>
-      <Message>Generating commit ID header...</Message>
-      <Outputs>$(OutDir)obj\global_intermediate\commit.h</Outputs>
-      <AdditionalInputs>..\..\.git\index</AdditionalInputs>
+      <Command>call mkdir &quot;$(OutDir)obj\global_intermediate\angle\id&quot; 2&gt;nul &amp; set ERRORLEVEL=0 &amp; copy /Y &quot;..\..\src\commit.h&quot; &quot;$(OutDir)obj\global_intermediate\angle\id\commit.h&quot;</Command>
+      <Message>Copying commit.h to $(OutDir)obj/global_intermediate/angle/id\commit.h</Message>
+      <Outputs>$(OutDir)obj\global_intermediate\angle\id\commit.h</Outputs>
     </CustomBuild>
   </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="copy_scripts.vcxproj">
-      <Project>{63FB0B97-D1D9-5158-8E85-7F5B1E403817}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
-  </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
   <ImportGroup Label="ExtensionTargets"/>
 </Project>
diff --git a/projects/src/commit_id.vcxproj.filters b/projects/src/commit_id.vcxproj.filters
deleted file mode 100644
index 3613833..0000000
--- a/projects/src/commit_id.vcxproj.filters
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="$(OutDir)obj">
-      <UniqueIdentifier>{7BD4F48B-77B4-AB58-9E24-A7302D190D1C}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="$(OutDir)obj\global_intermediate">
-      <UniqueIdentifier>{14CEDE64-16A7-96A9-EF19-5C5D6085FF18}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="$(OutDir)obj\global_intermediate\_excluded_files">
-      <UniqueIdentifier>{158E591E-B6EA-0C85-8F5A-18EAFA09B4CE}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="..">
-      <UniqueIdentifier>{739DB09A-CC57-A953-A6CF-F64FA08E4FA7}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="..\..">
-      <UniqueIdentifier>{739DB09A-CC57-A953-A6CF-F64FA08E4FA7}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="..\..\src">
-      <UniqueIdentifier>{8CDEE807-BC53-E450-C8B8-4DEBB66742D4}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="..\..\.git">
-      <UniqueIdentifier>{3C74FDB1-3FB1-8FA9-1073-A344751C6694}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="..\..\.git\_excluded_files">
-      <UniqueIdentifier>{158E591E-B6EA-0C85-8F5A-18EAFA09B4CE}</UniqueIdentifier>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="$(OutDir)obj\global_intermediate\commit_id.bat">
-      <Filter>$(OutDir)obj\global_intermediate\_excluded_files</Filter>
-    </None>
-    <None Include="..\..\src\angle.gyp">
-      <Filter>..\..\src</Filter>
-    </None>
-    <None Include="..\..\.git\index">
-      <Filter>..\..\.git\_excluded_files</Filter>
-    </None>
-  </ItemGroup>
-</Project>
diff --git a/projects/src/copy_compiler_dll.vcxproj b/projects/src/copy_compiler_dll.vcxproj
index 010887f..6b8587c 100644
--- a/projects/src/copy_compiler_dll.vcxproj
+++ b/projects/src/copy_compiler_dll.vcxproj
@@ -111,7 +111,7 @@
   <ItemGroup>
     <CustomBuild Include="..\..\src\copy_compiler_dll.bat">
       <FileType>Document</FileType>
-      <Command>call call $(OutDir)obj\global_intermediate\copy_compiler_dll.bat &quot;$(Platform)&quot; &quot;C:\Program Files (x86)\Windows Kits\8.0&quot; &quot;$(OutDir)&quot;</Command>
+      <Command>call call $(OutDir)obj\global_intermediate\angle\copy_compiler_dll.bat &quot;$(Platform)&quot; &quot;C:\Program Files (x86)\Windows Kits\8.0&quot; &quot;$(OutDir)&quot;</Command>
       <Message>Copying D3D Compiler DLL...</Message>
       <Outputs>$(OutDir)\D3DCompiler_46.dll</Outputs>
     </CustomBuild>
diff --git a/projects/src/copy_scripts.vcxproj b/projects/src/copy_scripts.vcxproj
index c10663f..748d69a 100644
--- a/projects/src/copy_scripts.vcxproj
+++ b/projects/src/copy_scripts.vcxproj
@@ -105,21 +105,15 @@
   <ItemGroup>
     <CustomBuild Include="..\..\src\commit_id.py">
       <FileType>Document</FileType>
-      <Command>call mkdir &quot;$(OutDir)obj\global_intermediate&quot; 2&gt;nul &amp; set ERRORLEVEL=0 &amp; copy /Y &quot;..\..\src\commit_id.py&quot; &quot;$(OutDir)obj\global_intermediate\commit_id.py&quot;</Command>
-      <Message>Copying commit_id.py to $(OutDir)obj/global_intermediate\commit_id.py</Message>
-      <Outputs>$(OutDir)obj\global_intermediate\commit_id.py</Outputs>
-    </CustomBuild>
-    <CustomBuild Include="..\..\src\commit_id.bat">
-      <FileType>Document</FileType>
-      <Command>call mkdir &quot;$(OutDir)obj\global_intermediate&quot; 2&gt;nul &amp; set ERRORLEVEL=0 &amp; copy /Y &quot;..\..\src\commit_id.bat&quot; &quot;$(OutDir)obj\global_intermediate\commit_id.bat&quot;</Command>
-      <Message>Copying commit_id.bat to $(OutDir)obj/global_intermediate\commit_id.bat</Message>
-      <Outputs>$(OutDir)obj\global_intermediate\commit_id.bat</Outputs>
+      <Command>call mkdir &quot;$(OutDir)obj\global_intermediate\angle&quot; 2&gt;nul &amp; set ERRORLEVEL=0 &amp; copy /Y &quot;..\..\src\commit_id.py&quot; &quot;$(OutDir)obj\global_intermediate\angle\commit_id.py&quot;</Command>
+      <Message>Copying commit_id.py to $(OutDir)obj/global_intermediate/angle\commit_id.py</Message>
+      <Outputs>$(OutDir)obj\global_intermediate\angle\commit_id.py</Outputs>
     </CustomBuild>
     <CustomBuild Include="..\..\src\copy_compiler_dll.bat">
       <FileType>Document</FileType>
-      <Command>call mkdir &quot;$(OutDir)obj\global_intermediate&quot; 2&gt;nul &amp; set ERRORLEVEL=0 &amp; copy /Y &quot;..\..\src\copy_compiler_dll.bat&quot; &quot;$(OutDir)obj\global_intermediate\copy_compiler_dll.bat&quot;</Command>
-      <Message>Copying copy_compiler_dll.bat to $(OutDir)obj/global_intermediate\copy_compiler_dll.bat</Message>
-      <Outputs>$(OutDir)obj\global_intermediate\copy_compiler_dll.bat</Outputs>
+      <Command>call mkdir &quot;$(OutDir)obj\global_intermediate\angle&quot; 2&gt;nul &amp; set ERRORLEVEL=0 &amp; copy /Y &quot;..\..\src\copy_compiler_dll.bat&quot; &quot;$(OutDir)obj\global_intermediate\angle\copy_compiler_dll.bat&quot;</Command>
+      <Message>Copying copy_compiler_dll.bat to $(OutDir)obj/global_intermediate/angle\copy_compiler_dll.bat</Message>
+      <Outputs>$(OutDir)obj\global_intermediate\angle\copy_compiler_dll.bat</Outputs>
     </CustomBuild>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
diff --git a/projects/src/libEGL.vcxproj b/projects/src/libEGL.vcxproj
index 71c8ab1..4daf31d 100644
--- a/projects/src/libEGL.vcxproj
+++ b/projects/src/libEGL.vcxproj
@@ -37,7 +37,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <BufferSecurityCheck>true</BufferSecurityCheck>
@@ -68,14 +68,14 @@
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
     <ResourceCompile>
-      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <Culture>0x0409</Culture>
       <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };GL_APICALL=;GL_GLEXT_PROTOTYPES=;EGLAPI=;NOMINMAX;ANGLE_ENABLE_PERF;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
       <BufferSecurityCheck>true</BufferSecurityCheck>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@@ -105,7 +105,7 @@
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
     <ResourceCompile>
-      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <Culture>0x0409</Culture>
       <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };GL_APICALL=;GL_GLEXT_PROTOTYPES=;EGLAPI=;NOMINMAX;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
@@ -166,10 +166,6 @@
       <Project>{3B7F5656-177F-52EE-26B3-D6A75368D0A9}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
-    <ProjectReference Include="copy_scripts.vcxproj">
-      <Project>{63FB0B97-D1D9-5158-8E85-7F5B1E403817}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
   <ImportGroup Label="ExtensionTargets"/>
diff --git a/projects/src/libGLESv2.vcxproj b/projects/src/libGLESv2.vcxproj
index 6ab232f..28a7793 100644
--- a/projects/src/libGLESv2.vcxproj
+++ b/projects/src/libGLESv2.vcxproj
@@ -37,7 +37,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <BufferSecurityCheck>true</BufferSecurityCheck>
@@ -68,14 +68,14 @@
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
     <ResourceCompile>
-      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <Culture>0x0409</Culture>
       <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };GL_APICALL=;GL_GLEXT_PROTOTYPES=;EGLAPI=;NOMINMAX;ANGLE_ENABLE_D3D9;ANGLE_ENABLE_D3D11;ANGLE_ENABLE_PERF;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
       <BufferSecurityCheck>true</BufferSecurityCheck>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@@ -105,7 +105,7 @@
       <TargetMachine>MachineX86</TargetMachine>
     </Link>
     <ResourceCompile>
-      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\src;..\..\include;..\..\src\libGLESv2;$(OutDir)obj\global_intermediate\angle;C:\Program Files (x86)\Windows Kits\8.0\Include\shared;C:\Program Files (x86)\Windows Kits\8.0\Include\um;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <Culture>0x0409</Culture>
       <PreprocessorDefinitions>ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT(&quot;d3dcompiler_46.dll&quot;), TEXT(&quot;d3dcompiler_43.dll&quot;) };GL_APICALL=;GL_GLEXT_PROTOTYPES=;EGLAPI=;NOMINMAX;ANGLE_ENABLE_D3D9;ANGLE_ENABLE_D3D11;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
diff --git a/src/angle.gypi b/src/angle.gypi
index 5339369..ef16749 100644
--- a/src/angle.gypi
+++ b/src/angle.gypi
@@ -7,6 +7,12 @@
     {
         'angle_code': 1,
         'angle_post_build_script%': 0,
+        'angle_gen_path': '<(SHARED_INTERMEDIATE_DIR)/angle',
+        'angle_id_script_base': 'commit_id.py',
+        'angle_id_script': '<(angle_gen_path)/<(angle_id_script_base)',
+        'angle_id_header_base': 'commit.h',
+        'angle_id_header': '<(angle_gen_path)/id/<(angle_id_header_base)',
+        'angle_use_commit_id%': '<!(python <(angle_id_script_base) check ..)',
     },
     'includes':
     [
@@ -23,57 +29,71 @@
             'copies':
             [
                 {
-                    'destination': '<(SHARED_INTERMEDIATE_DIR)',
-                    'files': [ 'commit_id.bat', 'copy_compiler_dll.bat', 'commit_id.py' ],
+                    'destination': '<(angle_gen_path)',
+                    'files': [ 'copy_compiler_dll.bat', '<(angle_id_script_base)' ],
                 },
             ],
         },
-
-        {
-            'target_name': 'commit_id',
-            'type': 'none',
-            'includes': [ '../build/common_defines.gypi', ],
-            'dependencies': [ 'copy_scripts', ],
-            'conditions':
-            [
-                ['OS=="win"',
-                {
-                    'actions':
-                    [
-                        {
-                            'action_name': 'Generate Commit ID Header',
-                            'message': 'Generating commit ID header...',
-                            'msvs_cygwin_shell': 0,
-                            'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit_id.bat', '<(angle_path)/.git/index' ],
-                            'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit.h' ],
-                            'action': [ '<(SHARED_INTERMEDIATE_DIR)/commit_id.bat', '<(SHARED_INTERMEDIATE_DIR)' ],
-                        },
-                    ],
-                },
-                { # OS != win
-                    'actions':
-                    [
-                        {
-                            'action_name': 'Generate Commit ID Header',
-                            'message': 'Generating commit ID header...',
-                            'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit_id.py', '<(angle_path)/.git/index' ],
-                            'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/commit.h' ],
-                            'action': [ 'python', '<(SHARED_INTERMEDIATE_DIR)/commit_id.py', '<(SHARED_INTERMEDIATE_DIR)/commit.h' ],
-                        },
-                    ],
-                }],
-            ],
-            'direct_dependent_settings':
-            {
-                'include_dirs':
-                [
-                    '<(SHARED_INTERMEDIATE_DIR)',
-                ],
-            },
-        },
     ],
     'conditions':
     [
+        ['angle_use_commit_id!=0',
+        {
+            'targets':
+            [
+                {
+                    'target_name': 'commit_id',
+                    'type': 'none',
+                    'includes': [ '../build/common_defines.gypi', ],
+                    'dependencies': [ 'copy_scripts', ],
+                    'actions':
+                    [
+                        {
+                            'action_name': 'Generate ANGLE Commit ID Header',
+                            'message': 'Generating ANGLE Commit ID',
+                            # reference the git index as an input, so we rebuild on changes to the index
+                            'inputs': [ '<(angle_id_script)', '<(angle_path)/.git/index' ],
+                            'outputs': [ '<(angle_id_header)' ],
+                            'msvs_cygwin_shell': 0,
+                            'action':
+                            [
+                                'python', '<(angle_id_script)', 'gen', '<(angle_path)', '<(angle_id_header)'
+                            ],
+                        },
+                    ],
+                    'direct_dependent_settings':
+                    {
+                        'include_dirs':
+                        [
+                            '<(angle_gen_path)',
+                        ],
+                    },
+                }
+            ]
+        },
+        { # angle_use_commit_id==0
+            'targets':
+            [
+                {
+                    'target_name': 'commit_id',
+                    'type': 'none',
+                    'copies':
+                    [
+                        {
+                            'destination': '<(angle_gen_path)/id',
+                            'files': [ '<(angle_id_header_base)' ]
+                        }
+                    ],
+                    'direct_dependent_settings':
+                    {
+                        'include_dirs':
+                        [
+                            '<(angle_gen_path)',
+                        ],
+                    },
+                }
+            ]
+        }],
         ['OS=="win"',
         {
             'targets':
@@ -93,7 +113,7 @@
                             'outputs': [ '<(PRODUCT_DIR)/D3DCompiler_46.dll' ],
                             'action':
                             [
-                                "<(SHARED_INTERMEDIATE_DIR)/copy_compiler_dll.bat",
+                                "<(angle_gen_path)/copy_compiler_dll.bat",
                                 "$(PlatformName)",
                                 "<(windows_sdk_path)",
                                 "<(PRODUCT_DIR)"
diff --git a/src/commit.h b/src/commit.h
new file mode 100644
index 0000000..4c89a65
--- /dev/null
+++ b/src/commit.h
@@ -0,0 +1,14 @@
+//
+// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// commit.h:
+//   This is a default commit hash header, when git is not available.
+//
+
+#define ANGLE_COMMIT_HASH "unknown hash"
+#define ANGLE_COMMIT_HASH_SIZE 12
+#define ANGLE_COMMIT_DATE "unknown date"
+
+#define ANGLE_DISABLE_PROGRAM_BINARY_LOAD
diff --git a/src/commit_id.bat b/src/commit_id.bat
deleted file mode 100644
index 0bebc62..0000000
--- a/src/commit_id.bat
+++ /dev/null
@@ -1,15 +0,0 @@
-@echo off
-
-REM commit hash
-(FOR /F "delims=" %%i IN ('call git rev-parse --short^=12 HEAD') DO set _Str=%%i) || (set _Str=badf00dbad00)
-set _Str=#define ANGLE_COMMIT_HASH "%_Str%"
-echo %_Str% > %1%\commit.h
-
-REM commit hash size
-set _Str=#define ANGLE_COMMIT_HASH_SIZE 12
-echo %_Str% >> %1%\commit.h
-
-REM commit date
-(FOR /F "delims=" %%i IN ('call git show -s --format^="%%ci" HEAD') DO set _Str=%%i) || (set _Str=Unknown Date)
-set _Str=#define ANGLE_COMMIT_DATE "%_Str%"
-echo %_Str% >> %1%\commit.h
diff --git a/src/commit_id.py b/src/commit_id.py
index 6339cca..7f711e7 100644
--- a/src/commit_id.py
+++ b/src/commit_id.py
@@ -1,19 +1,35 @@
 import subprocess as sp
 import sys
+import os
 
-def grab_output(*command):
-    return sp.Popen(command, stdout=sp.PIPE).communicate()[0].strip()
+# Usage: commit_id.py check <angle_dir> (checks if git is present)
+# Usage: commit_id.py gen <angle_dir> <file_to_write> (generates commit id)
 
+def grab_output(command, cwd):
+    return sp.Popen(command, stdout=sp.PIPE, shell=True, cwd=cwd).communicate()[0].strip()
+
+operation = sys.argv[1]
+cwd = sys.argv[2]
+
+if operation == 'check':
+    index_path = os.path.join(cwd, '.git', 'index')
+    if os.path.exists(index_path):
+        print("1")
+    else:
+        print("0")
+    sys.exit(0)
+
+output_file = sys.argv[3]
 commit_id_size = 12
 
 try:
-    commit_id = grab_output('git', 'rev-parse', '--short=%d' % commit_id_size, 'HEAD')
-    commit_date = grab_output('git', 'show', '-s', '--format=%ci', 'HEAD')
+    commit_id = grab_output('git rev-parse --short=%d HEAD' % commit_id_size, cwd)
+    commit_date = grab_output('git show -s --format=%ci HEAD', cwd)
 except:
     commit_id = 'invalid-hash'
     commit_date = 'invalid-date'
 
-hfile = open(sys.argv[1], 'w')
+hfile = open(output_file, 'w')
 
 hfile.write('#define ANGLE_COMMIT_HASH "%s"\n'    % commit_id)
 hfile.write('#define ANGLE_COMMIT_HASH_SIZE %d\n' % commit_id_size)
diff --git a/src/common/version.h b/src/common/version.h
index b9781d7..d9148d1 100644
--- a/src/common/version.h
+++ b/src/common/version.h
@@ -1,4 +1,4 @@
-#include "commit.h"
+#include "id/commit.h"
 
 #define ANGLE_MAJOR_VERSION 2
 #define ANGLE_MINOR_VERSION 1
diff --git a/src/libGLESv2/ProgramBinary.cpp b/src/libGLESv2/ProgramBinary.cpp
index 8525ffb..e3ffa47 100644
--- a/src/libGLESv2/ProgramBinary.cpp
+++ b/src/libGLESv2/ProgramBinary.cpp
@@ -1018,6 +1018,9 @@
 
 bool ProgramBinary::load(InfoLog &infoLog, const void *binary, GLsizei length)
 {
+#ifdef ANGLE_DISABLE_PROGRAM_BINARY_LOAD
+    return false;
+#else
     BinaryInputStream stream(binary, length);
 
     int format = stream.readInt<int>();
@@ -1260,6 +1263,7 @@
     initializeUniformStorage();
 
     return true;
+#endif // #ifdef ANGLE_DISABLE_PROGRAM_BINARY_LOAD
 }
 
 bool ProgramBinary::save(void* binary, GLsizei bufSize, GLsizei *length)