Use detected prefix
authorCasper Hornstrup <chorns@users.sourceforge.net>
Sat, 28 May 2005 19:35:23 +0000 (19:35 +0000)
committerCasper Hornstrup <chorns@users.sourceforge.net>
Sat, 28 May 2005 19:35:23 +0000 (19:35 +0000)
svn path=/trunk/; revision=15604

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

index 43167ee..7bff652 100644 (file)
@@ -147,15 +147,15 @@ ifeq ($(HOST),mingw32-linux)
        EXEPOSTFIX =
        SEP = /
        mkdir = -$(Q)mkdir -p
-       gcc = $(Q)mingw32-gcc
-       gpp = $(Q)mingw32-g++
-       ld = $(Q)mingw32-ld
-       nm = $(Q)mingw32-nm
-       objdump = $(Q)mingw32-objdump
-       ar = $(Q)mingw32-ar
-       objcopy = $(Q)mingw32-objcopy
-       dlltool = $(Q)mingw32-dlltool
-       windres = $(Q)mingw32-windres
+       gcc = $(Q)$(PREFIX)-gcc
+       gpp = $(Q)$(PREFIX)-g++
+       ld = $(Q)$(PREFIX)-ld
+       nm = $(Q)$(PREFIX)-nm
+       objdump = $(Q)$(PREFIX)-objdump
+       ar = $(Q)$(PREFIX)-ar
+       objcopy = $(Q)$(PREFIX)-objcopy
+       dlltool = $(Q)$(PREFIX)-dlltool
+       windres = $(Q)$(PREFIX)-windres
        rm = $(Q)rm -f
        cp = $(Q)cp
        NUL = /dev/null
index 4c709bb..ddcf00b 100644 (file)
@@ -227,6 +227,7 @@ MingwBackend::MingwBackend ( Project& project,
          outputDirectory ( new Directory ( "$(OUTPUT)" ) ),
          installDirectory ( new Directory ( "$(INSTALL)" ) )
 {
+       compilerPrefix = "";
 }
 
 MingwBackend::~MingwBackend()
@@ -482,6 +483,10 @@ MingwBackend::GenerateProjectLFLAGS () const
 void
 MingwBackend::GenerateGlobalVariables () const
 {
+       fprintf ( fMakefile,
+                 "PREFIX := %s\n",
+                 compilerPrefix.c_str () );
+
        GenerateGlobalCFlagsAndProperties ( "=", ProjectNode.non_if_data );
        GenerateProjectGccOptions ( "=", ProjectNode.non_if_data );
 
@@ -695,19 +700,22 @@ MingwBackend::DetectCompiler ()
        const string& ROS_PREFIXValue = Environment::GetVariable ( "ROS_PREFIX" );
        if ( ROS_PREFIXValue.length () > 0 )
        {
-               compilerCommand = ROS_PREFIXValue + "-gcc";
+               compilerPrefix = ROS_PREFIXValue;
+               compilerCommand = compilerPrefix + "-gcc";
                detectedCompiler = TryToDetectThisCompiler ( compilerCommand );
        }
 #if defined(WIN32)
        if ( !detectedCompiler )
        {
+               compilerPrefix = "";
                compilerCommand = "gcc";
                detectedCompiler = TryToDetectThisCompiler ( compilerCommand );
        }
 #endif
        if ( !detectedCompiler )
        {
-               compilerCommand = "mingw32-gcc";
+               compilerPrefix = "mingw32";
+               compilerCommand = compilerPrefix + "-gcc";
                detectedCompiler = TryToDetectThisCompiler ( compilerCommand );
        }
        if ( detectedCompiler )
index b67fb01..8143d9e 100644 (file)
@@ -51,6 +51,7 @@ public:
        virtual void Process ();
        std::string AddDirectoryTarget ( const std::string& directory,
                                         Directory* directoryTree );
+       std::string compilerPrefix;
        std::string compilerCommand;
        bool usePipe;
        Directory* intermediateDirectory;