Fix GCC detection in RBuild (first check TARGET_CC).
authorDmitry Gorbachev <gorbachev@reactos.org>
Sun, 13 Sep 2009 21:18:21 +0000 (21:18 +0000)
committerDmitry Gorbachev <gorbachev@reactos.org>
Sun, 13 Sep 2009 21:18:21 +0000 (21:18 +0000)
svn path=/trunk/; revision=43040

reactos/tools/rbuild/backend/mingw/mingw.cpp

index 951f517..4673d4d 100644 (file)
@@ -740,13 +740,25 @@ MingwBackend::DetectCompiler ()
 
        if ( ProjectNode.configuration.Compiler == GnuGcc )
        {
+               const string& TARGET_CCValue = Environment::GetVariable ( "TARGET_CC" );
                const string& ROS_PREFIXValue = Environment::GetVariable ( "ROS_PREFIX" );
+
                if ( ROS_PREFIXValue.length () > 0 )
                {
-                       compilerPrefix = ROS_PREFIXValue;
-                       compilerCommand = compilerPrefix + "-gcc";
+                       compilerPrefix = "";
+                       compilerCommand = TARGET_CCValue;
                        detectedCompiler = TryToDetectThisCompiler ( compilerCommand );
                }
+
+               if ( !detectedCompiler )
+               {
+                       if ( ROS_PREFIXValue.length () > 0 )
+                       {
+                               compilerPrefix = ROS_PREFIXValue;
+                               compilerCommand = compilerPrefix + "-gcc";
+                               detectedCompiler = TryToDetectThisCompiler ( compilerCommand );
+                       }
+               }
 #if defined(WIN32)
                if ( !detectedCompiler )
                {