- add("prefix", &Architecture::prefix);
- add("tool", &Loader::tool);
+ vector<string> parts = split(spec, "-");
+ for(vector<string>::const_iterator i=parts.begin(); i!=parts.end(); ++i)
+ {
+ string part = resolve_alias(*i);
+
+ bool ok = false;
+
+ for(unsigned j=0; (!ok && types[j]); ++j)
+ if(part==types[j])
+ {
+ if(!type.empty() && part!=type)
+ throw invalid_argument("Conflicting type specification");
+ type = part;
+ ok = true;
+ }
+
+ for(unsigned j=0; (!ok && cpus[j]); j+=2)
+ if(part==cpus[j])
+ {
+ if(type.empty())
+ type = cpus[j+1];
+ else if(cpus[j+1]!=type)
+ throw invalid_argument("Conflicting CPU specification");
+ cpu = part;
+ ok = true;
+ }
+
+ for(unsigned j=0; (!ok && systems[j]); ++j)
+ if(part==systems[j])
+ {
+ system = part;
+ ok = true;
+ }
+
+ if(!ok && (part=="32" || part=="64"))
+ {
+ bits = lexical_cast<unsigned>(part);
+ ok = true;
+ }
+
+ if(!ok)
+ throw invalid_argument("Unrecognized part in arch specification: "+*i);
+ }