summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Vanhauwaert <bvh@irule.be>2009-11-16 10:07:55 +0100
committerBart Vanhauwaert <bvh@irule.be>2009-11-16 10:07:55 +0100
commit38eb2032fa9ec5c89788c19467059b427f10b45b (patch)
tree19eb838ce22d0809d514fadd16fb6a81493ec56e
parentCompile bootstrap with debug information (diff)
downloadbldit-38eb2032fa9ec5c89788c19467059b427f10b45b.tar.xz
bldit-38eb2032fa9ec5c89788c19467059b427f10b45b.zip
Correctly detect and configure gcc on Mac OS X
-rw-r--r--Gcc4Compiler.cc14
-rw-r--r--ToolChain.cc4
2 files changed, 11 insertions, 7 deletions
diff --git a/Gcc4Compiler.cc b/Gcc4Compiler.cc
index 76ce7e5..7aa456a 100644
--- a/Gcc4Compiler.cc
+++ b/Gcc4Compiler.cc
@@ -106,7 +106,7 @@ ProcessController* Gcc4Compiler::createCompilation(CCSource& aSource)
void Gcc4Compiler::configure()
{
- Project::it().configureKey(true,"toolchain",IsMingW?"mingw":"gcc4","cc_compiler",Path);
+ Project::it().configureKey(true,"toolchain",IsMingW?"mingw":"gcc","cc_compiler",Path);
}
Gcc4Compiler* compilerFromProcessName(const std::string& ProcessName)
@@ -129,6 +129,8 @@ Gcc4Compiler* Gcc4Compiler::discover()
Result = compilerFromProcessName("c:\\MinGW\\bin\\g++.exe");
if (!Result)
Result = compilerFromProcessName(findExecutableInPath("g++.exe"));
+ if (!Result)
+ Result = compilerFromProcessName(findExecutableInPath("g++"));
return Result;
}
@@ -139,7 +141,7 @@ Gcc4Compiler* Gcc4Compiler::createFrom(const std::string& Name)
"toolchain","mingw","cc_compiler"),true);
else if (Name == "gcc")
return new Gcc4Compiler(Project::it().systemConfiguration().valueAsString(
- "toolchain","mingw","cc_compiler"),false);
+ "toolchain","gcc","cc_compiler"),false);
return 0;
}
@@ -225,8 +227,8 @@ ProcessController* Gcc4Linker::createLinking(Executable& aExec)
std::string Gcc4Linker::configure()
{
- Project::it().configureKey(true,"toolchain",IsMingW?"mingw":"gcc4","cc_linker",Path);
- return "mingw";
+ Project::it().configureKey(true,"toolchain",IsMingW?"mingw":"gcc","cc_linker",Path);
+ return IsMingW?"mingw":"gcc";
}
Gcc4Linker* linkerFromProcessName(const std::string& ProcessName)
@@ -249,6 +251,8 @@ Gcc4Linker* Gcc4Linker::discover()
Result = linkerFromProcessName("c:\\MinGW\\bin\\g++.exe");
if (!Result)
Result = linkerFromProcessName(findExecutableInPath("g++.exe"));
+ if (!Result)
+ Result = linkerFromProcessName(findExecutableInPath("g++"));
return Result;
}
@@ -260,6 +264,6 @@ Gcc4Linker* Gcc4Linker::createFrom(const std::string& Name)
"toolchain","mingw","cc_linker"),true);
else if (Name == "gcc")
return new Gcc4Linker(Project::it().systemConfiguration().valueAsString(
- "toolchain","mingw","cc_linker"),false);
+ "toolchain","gcc","cc_linker"),false);
return 0;
}
diff --git a/ToolChain.cc b/ToolChain.cc
index 9944b8d..99b5b31 100644
--- a/ToolChain.cc
+++ b/ToolChain.cc
@@ -40,8 +40,8 @@ static std::string configureVisualStudio()
static std::string configureMingW()
{
-#ifdef HOST_IS_WINDOWS
- Project::it().configureComment("MingW");
+#if defined(HOST_IS_WINDOWS) || defined(HOST_IS_MACOSX)
+ Project::it().configureComment("Gnu Compiler collection 4 series");
Gcc4Compiler* Compiler = Gcc4Compiler::discover();
if (!Compiler) return "";
Gcc4Linker* Linker = Gcc4Linker::discover();