X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Farchitecture.cpp;h=9ce1acef6c59883f8684eb324f2d594bb17f675f;hb=d914c5f40ca1194e7fd6a2b30664ac4717e38786;hp=ba25afd77b27c997656cb37f843e0a7092c5c646;hpb=3a61505c629d51f52343e7dfaaa936143557c3bf;p=builder.git diff --git a/source/architecture.cpp b/source/architecture.cpp index ba25afd..9ce1ace 100644 --- a/source/architecture.cpp +++ b/source/architecture.cpp @@ -61,6 +61,13 @@ const char *systems[] = 0 }; +const char *toolchains[] = +{ + "gnu", + "clang", + 0 +}; + const char *aliases[] = { "pc", "x86", @@ -74,6 +81,8 @@ const char *aliases[] = "power macintosh", "ppc", "armeabi", "arm", "v7a", "armv7a", + "gcc", "gnu", + "mingw", "windows-gnu", 0 }; @@ -122,12 +131,21 @@ Architecture::Architecture(Builder &b, const string &spec): else if(bits==native_arch.bits) native = true; } + + if(toolchain.empty()) + { + if((system=="darwin" || system=="freebsd") && builder.get_vfs().find_binary("clang")) + toolchain = "clang"; + else + toolchain = "gnu"; + } + name = type; if(!cpu.empty()) name += format("-%s", cpu); if(!fpu.empty()) name += format("-%s", fpu); - name += format("-%d-%s", bits, system); + name += format("-%d-%s-%s", bits, system, toolchain); if(system=="windows") { @@ -160,7 +178,7 @@ bool Architecture::match_name(const string &pattern) const { if((*i=="32" && bits==32) || (*i=="64" && bits==64)) ; - else if(*i!=type && *i!=cpu && *i!=fpu && *i!=system) + else if(*i!=type && *i!=cpu && *i!=fpu && *i!=system && *i!=toolchain) return negate; } return !negate; @@ -263,6 +281,13 @@ void Architecture::parse_specification(const string &spec) ok = true; } + for(unsigned j=0; (!ok && toolchains[j]); ++j) + if(*i==toolchains[j]) + { + toolchain = *i; + ok = true; + } + if(!ok && (*i=="32" || *i=="64")) { bits = lexical_cast(*i);