From de48dbbf7cb77315645566f14bed088d44585546 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 10 Sep 2002 15:40:41 -0400 Subject: [PATCH] ERR: Fixes for comeau compiler. NULL is a pointer of type void*, and cannot be compared directly with other pointer types. We use 0 instead. Also changed putenv to setenv for comeau on linux. --- Source/cmGlobalUnixMakefileGenerator.cxx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalUnixMakefileGenerator.cxx b/Source/cmGlobalUnixMakefileGenerator.cxx index d3dd4e97d..883e7c2b2 100644 --- a/Source/cmGlobalUnixMakefileGenerator.cxx +++ b/Source/cmGlobalUnixMakefileGenerator.cxx @@ -14,6 +14,7 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ + #include "cmGlobalUnixMakefileGenerator.h" #include "cmLocalUnixMakefileGenerator.h" #include "cmMakefile.h" @@ -34,19 +35,35 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang, static char envCC[5000]; if(mf->GetDefinition("CMAKE_CXX_COMPILER")) { +#if !defined(_WIN32) && defined(__COMO__) + std::string env = "${CMAKE_CXX_COMPILER}"; + mf->ExpandVariablesInString(env); + strncpy(envCXX, env.c_str(), 4999); + envCXX[4999] = 0; + setenv("CXX", envCXX, 1); +#else std::string env = "CXX=${CMAKE_CXX_COMPILER}"; mf->ExpandVariablesInString(env); strncpy(envCXX, env.c_str(), 4999); envCXX[4999] = 0; putenv(envCXX); +#endif } if(mf->GetDefinition("CMAKE_C_COMPILER")) { +#if !defined(_WIN32) && defined(__COMO__) + std::string env = "${CMAKE_C_COMPILER}"; + mf->ExpandVariablesInString(env); + strncpy(envCC, env.c_str(), 4999); + envCC[4999] = 0; + setenv("CC", envCC, 1); +#else std::string env = "CC=${CMAKE_C_COMPILER}"; mf->ExpandVariablesInString(env); strncpy(envCC, env.c_str(), 4999); envCC[4999] = 0; putenv(envCC); +#endif } std::string output; std::string root @@ -65,7 +82,7 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang, cmSystemTools::ConvertToOutputPath(mf->GetHomeOutputDirectory()).c_str()); std::string fpath = mf->GetHomeOutputDirectory(); fpath += "/CCMakeSystemConfig.cmake"; - mf->ReadListFile(NULL,fpath.c_str()); + mf->ReadListFile(0,fpath.c_str()); this->SetLanguageEnabled("C"); } // if CXX @@ -77,7 +94,7 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang, cmSystemTools::ConvertToOutputPath(mf->GetHomeOutputDirectory()).c_str()); std::string fpath = mf->GetHomeOutputDirectory(); fpath += "/CXXCMakeSystemConfig.cmake"; - mf->ReadListFile(NULL,fpath.c_str()); + mf->ReadListFile(0,fpath.c_str()); this->SetLanguageEnabled("CXX"); } }