}
Architecture::Architecture(Builder &b, const string &spec):
- builder(b),
- bits(0),
- native(false)
+ builder(b)
{
if(spec.empty())
{
toolchain = "gnu";
}
+ update();
+}
+
+void Architecture::refine(const string &spec)
+{
+ parse_specification(spec);
+ update();
+}
+
+void Architecture::update()
+{
name = type;
if(!cpu.empty())
name += format("-%s", cpu);
name += format("-%s", fpu);
name += format("-%d-%s-%s", bits, system, toolchain);
+ filename_patterns.clear();
if(system=="windows")
{
add_pattern<SharedLibrary>("%.dll");
for(unsigned j=0; (!ok && systems[j]); ++j)
if(p==systems[j])
{
+ if(!system.empty() && p!=system)
+ throw invalid_argument("Conflicting system specification");
system = p;
ok = true;
}
for(unsigned j=0; (!ok && toolchains[j]); ++j)
if(p==toolchains[j])
{
+ if(!toolchain.empty() && p!=toolchain)
+ throw invalid_argument("Conflicting toolchain specification");
toolchain = p;
ok = true;
}
if(!ok && (p=="32" || p=="64"))
{
- bits = lexical_cast<unsigned>(p);
+ unsigned b = lexical_cast<unsigned>(p);
+ if(bits && b!=bits)
+ throw invalid_argument("Conflicting bits specification");
+ bits = b;
ok = true;
}