Fix GCC detection in RBuild (first check TARGET_CC).
[reactos.git] / reactos / tools / rbuild / backend / mingw / mingw.cpp
index fc81eb3..4673d4d 100644 (file)
@@ -59,8 +59,6 @@ const struct ModuleHandlerInformations ModuleHandlerInformations[] = {
        { HostFalse, "", "", "" }, // Win32SCR
        { HostFalse, "", "", "" }, // IdlHeader
        { HostFalse, "", "", "" }, // IdlInterface
-       { HostFalse, "", "", "" }, // IsoRegTest
-       { HostFalse, "", "", "" }, // LiveIsoRegTest
        { HostFalse, "", "", "" }, // EmbeddedTypeLib
        { HostFalse, "", "", "" }, // ElfExecutable
        { HostFalse, "", "", "" }, // RpcProxy
@@ -164,7 +162,10 @@ v2s ( const Backend* backend, const vector<FileLocation>& files, int wrap_at )
        {
                const FileLocation& file = files[i];
                if ( wrap_at > 0 && wrap_count++ == wrap_at )
+               {
                        s += " \\\n\t\t";
+                       wrap_count = 1;
+               }
                else if ( s.size() )
                        s += " ";
                s += backend->GetFullName ( file );
@@ -185,7 +186,10 @@ v2s ( const string_list& v, int wrap_at )
                if ( !v[i].size() )
                        continue;
                if ( wrap_at > 0 && wrap_count++ == wrap_at )
+               {
                        s += " \\\n\t\t";
+                       wrap_count = 1;
+               }
                else if ( s.size() )
                        s += " ";
                s += v[i];
@@ -538,10 +542,6 @@ MingwBackend::IncludeInAllTarget ( const Module& module ) const
                return false;
        if ( module.type == LiveIso )
                return false;
-       if ( module.type == IsoRegTest )
-               return false;
-       if ( module.type == LiveIsoRegTest )
-               return false;
        if ( module.type == Test )
                return false;
        if ( module.type == Alias )
@@ -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 )
                {