Mercurial > projects > ldc
diff gen/linker.cpp @ 890:5a03f3f74615
Apply afb's patch from #168 to use $CC instead of "gcc" for toobj and linker.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 17 Jan 2009 17:52:09 +0100 |
parents | 6c850977a941 |
children | 177afbf5297b |
line wrap: on
line diff
--- a/gen/linker.cpp Sat Jan 17 17:44:54 2009 +0100 +++ b/gen/linker.cpp Sat Jan 17 17:52:09 2009 +0100 @@ -204,18 +204,25 @@ // 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++)