From 305a63335d2c545526294dba6649b826f9b88154 Mon Sep 17 00:00:00 2001 From: "KJK::Hyperion" Date: Wed, 10 Jun 2009 18:24:33 +0000 Subject: [PATCH] modified tools/rbuild/backend/mingw/compilers/msc.mak Fix definition of cl Fix definition of RBUILD_CXX modified tools/rbuild/backend/mingw/mingw.cpp modified tools/rbuild/backend/mingw/mingw.h modified tools/rbuild/backend/mingw/mstools_detection.cpp Actually set RBUILD_CL_PATH and RBUILD_LINK_PATH svn path=/trunk/; revision=41370 --- .../tools/rbuild/backend/mingw/compilers/msc.mak | 4 +++- reactos/tools/rbuild/backend/mingw/mingw.cpp | 13 +++++++++++-- reactos/tools/rbuild/backend/mingw/mingw.h | 4 ++-- .../rbuild/backend/mingw/mstools_detection.cpp | 10 ++++++---- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/reactos/tools/rbuild/backend/mingw/compilers/msc.mak b/reactos/tools/rbuild/backend/mingw/compilers/msc.mak index 76f5366cfff..3c0f063433c 100644 --- a/reactos/tools/rbuild/backend/mingw/compilers/msc.mak +++ b/reactos/tools/rbuild/backend/mingw/compilers/msc.mak @@ -15,7 +15,7 @@ CPPFLAG_UNICODE:=/DUNICODE /D_UNICODE BUILTIN_CPPFLAGS+= /X -cl=$$(Q)$$(RBUILD_HELPER_TARGET) "RBUILD_CL_" "$(notdir $<<)" cl /nologo +cl=$(Q)$(RBUILD_HELPER_TARGET) "RBUILD_CL_" "$(notdir $<)" cl /nologo #(module, source, dependencies, cflags, output) #TODO @@ -79,6 +79,8 @@ $(5): $(2) $(3) $$(RBUILD_HELPER_TARGET) | ${call RBUILD_dir,$(5)} $$(ECHO_CC) $${cl} /TP /Fo$$@ ${call RBUILD_cxxflags,$(1),$(4)} /c $$< +endif + endef #(module, source, dependencies, cflags) diff --git a/reactos/tools/rbuild/backend/mingw/mingw.cpp b/reactos/tools/rbuild/backend/mingw/mingw.cpp index 043634739c0..1e15dacea2f 100644 --- a/reactos/tools/rbuild/backend/mingw/mingw.cpp +++ b/reactos/tools/rbuild/backend/mingw/mingw.cpp @@ -70,6 +70,9 @@ const struct ModuleHandlerInformations ModuleHandlerInformations[] = { { HostFalse, "", "", "" }, // MessageHeader }; +static std::string mscPath; +static std::string mslinkPath; + string MingwBackend::GetFullPath ( const FileLocation& file ) const { @@ -426,6 +429,12 @@ MingwBackend::GenerateGlobalVariables () const fprintf ( fMakefile, "include tools$(SEP)rbuild$(SEP)backend$(SEP)mingw$(SEP)linkers$(SEP)%s.mak\n", ProjectNode.GetLinkerSet ().c_str () ); fprintf ( fMakefile, "include tools$(SEP)rbuild$(SEP)backend$(SEP)mingw$(SEP)compilers$(SEP)%s.mak\n", ProjectNode.GetCompilerSet ().c_str () ); + if ( mscPath.length() ) + fprintf ( fMakefile, "export RBUILD_CL_PATH=%s\n", mscPath.c_str () ); + + if ( mslinkPath.length() ) + fprintf ( fMakefile, "export RBUILD_LINK_PATH=%s\n", mslinkPath.c_str () ); + if ( configuration.Dependencies == FullDependencies ) { fprintf ( fMakefile, @@ -762,7 +771,7 @@ MingwBackend::DetectCompiler () } else if ( ProjectNode.configuration.Compiler == MicrosoftC ) { - detectedCompiler = DetectMicrosoftCompiler ( compilerVersion ); + detectedCompiler = DetectMicrosoftCompiler ( compilerVersion, mscPath ); supportedCompiler = true; // TODO } @@ -1006,7 +1015,7 @@ MingwBackend::DetectBinutils () } else if ( ProjectNode.configuration.Linker == MicrosoftLink ) { - detectedBinutils = DetectMicrosoftLinker ( binutilsVersion ); + detectedBinutils = DetectMicrosoftLinker ( binutilsVersion, mslinkPath ); supportedBinutils = true; // TODO } diff --git a/reactos/tools/rbuild/backend/mingw/mingw.h b/reactos/tools/rbuild/backend/mingw/mingw.h index 13b2350cc51..feb4a907b92 100644 --- a/reactos/tools/rbuild/backend/mingw/mingw.h +++ b/reactos/tools/rbuild/backend/mingw/mingw.h @@ -117,8 +117,8 @@ private: void GenerateDirectoryTargets (); FILE* fMakefile; bool use_pch; - bool DetectMicrosoftCompiler ( std::string& version ); - bool DetectMicrosoftLinker ( std::string& version ); + bool DetectMicrosoftCompiler ( std::string& version, std::string& path ); + bool DetectMicrosoftLinker ( std::string& version, std::string& path ); }; diff --git a/reactos/tools/rbuild/backend/mingw/mstools_detection.cpp b/reactos/tools/rbuild/backend/mingw/mstools_detection.cpp index 584f9c51dd6..aad6092c3a6 100644 --- a/reactos/tools/rbuild/backend/mingw/mstools_detection.cpp +++ b/reactos/tools/rbuild/backend/mingw/mstools_detection.cpp @@ -2216,7 +2216,7 @@ void EnumerateMicrosoftTools(const std::string& arch, bool wantCompiler, bool wa } bool -MingwBackend::DetectMicrosoftCompiler ( std::string& version ) +MingwBackend::DetectMicrosoftCompiler ( std::string& version, std::string& path ) { bool wantCompiler = ProjectNode.configuration.Compiler == MicrosoftC; bool wantLinker = ProjectNode.configuration.Linker == MicrosoftLink; @@ -2234,13 +2234,14 @@ MingwBackend::DetectMicrosoftCompiler ( std::string& version ) std::ostringstream compilerVersion; compilerVersion << msCompilerVersion; version = compilerVersion.str(); + path = msCompilerPath; } return ret; } bool -MingwBackend::DetectMicrosoftLinker ( std::string& version ) +MingwBackend::DetectMicrosoftLinker ( std::string& version, std::string& path ) { bool wantCompiler = ProjectNode.configuration.Compiler == MicrosoftC; bool wantLinker = ProjectNode.configuration.Linker == MicrosoftLink; @@ -2258,6 +2259,7 @@ MingwBackend::DetectMicrosoftLinker ( std::string& version ) std::ostringstream linkerVersion; linkerVersion << msLinkerVersion; version = linkerVersion.str(); + path = msLinkerPath; } return ret; @@ -2273,13 +2275,13 @@ MingwBackend::DetectMicrosoftLinker ( std::string& version ) #include "mingw.h" bool -MingwBackend::DetectMicrosoftCompiler ( std::string& ) +MingwBackend::DetectMicrosoftCompiler ( std::string&, std::string& ) { return false; } bool -MingwBackend::DetectMicrosoftLinker ( std::string& ) +MingwBackend::DetectMicrosoftLinker ( std::string&, std::string& ) { return false; }