Apply afb's patch from #168 to use $CC instead of "gcc" for toobj and linker.

This commit is contained in:
Christian Kamm 2009-01-17 17:52:09 +01:00
parent 50be43051a
commit 4042f90800
2 changed files with 18 additions and 4 deletions

View file

@ -204,18 +204,25 @@ int linkObjToExecutable(const char* argv0)
// error string
std::string errstr;
const char *cc;
#if !_WIN32
cc = getenv("CC");
if (!cc)
#endif
cc = "gcc";
// find gcc for linking
llvm::sys::Path gcc = llvm::sys::Program::FindProgramByName("gcc");
llvm::sys::Path gcc = llvm::sys::Program::FindProgramByName(cc);
if (gcc.isEmpty())
{
gcc.set("gcc");
gcc.set(cc);
}
// build arguments
std::vector<const char*> args;
// first the program name ??
args.push_back("gcc");
args.push_back(cc);
// object files
for (int i = 0; i < global.params.objfiles->dim; i++)