detect PCH support ( not doing anything more than detection yet )
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h
Added: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/pch_detection.h

Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp
--- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp	2005-03-08 15:08:01 UTC (rev 13877)
+++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp	2005-03-08 17:14:07 UTC (rev 13878)
@@ -26,6 +26,8 @@
 void
 MingwBackend::Process ()
 {
+	DetectPCHSupport();
+
 	CreateMakefile ();
 	GenerateHeader ();
 	GenerateGlobalVariables ();
@@ -323,3 +325,24 @@
 {
 	return string("$(ROS_INTERMEDIATE)") + NormalizeFilename ( targetFilename );
 }
+
+void
+MingwBackend::DetectPCHSupport()
+{
+	string path = "tools" SSEP "rbuild" SSEP "backend" SSEP "mingw" SSEP "pch_detection.h";
+	system ( ssprintf("gcc -c %s", path.c_str()).c_str() );
+	path += ".gch";
+	{
+		FILE* f = fopen ( path.c_str(), "rb" );
+		if ( f )
+		{
+			use_pch = true;
+			fclose(f);
+			unlink ( path.c_str() );
+		}
+		else
+			use_pch = false;
+	}
+	// TODO FIXME - eventually check for ROS_USE_PCH env var and
+	// allow that to override use_pch if true
+}

Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h
--- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h	2005-03-08 15:08:01 UTC (rev 13877)
+++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h	2005-03-08 17:14:07 UTC (rev 13878)
@@ -32,7 +32,10 @@
 	void GenerateInitTarget () const;
 	void GenerateXmlBuildFilesMacro() const;
 	void CheckAutomaticDependencies ();
+	void DetectPCHSupport();
+
 	FILE* fMakefile;
+	bool use_pch;
 };
 
 std::string FixupTargetFilename ( const std::string& targetFilename );

Added: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/pch_detection.h
--- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/pch_detection.h	2005-03-08 15:08:01 UTC (rev 13877)
+++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/pch_detection.h	2005-03-08 17:14:07 UTC (rev 13878)
@@ -0,0 +1 @@
+// this file is intentionally left empty
\ No newline at end of file
Property changes on: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/pch_detection.h
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native