const Architecture &native_arch = builder.get_native_arch();
if(type.empty())
type = native_arch.type;
- if(cpu.empty())
- cpu = native_arch.cpu;
if(system.empty())
system = native_arch.system;
if(!bits)
{
sharedlib_patterns.push_back(Pattern("%.dll"));
sharedlib_patterns.push_back(Pattern("lib%.dll"));
+ /* XXX Hack: Consider import libraries (*.dll.a) as dynamic libraries,
+ even though technically they are linked statically. */
+ sharedlib_patterns.push_back(Pattern("lib%.dll.a"));
staticlib_patterns.push_back(Pattern("lib%.a"));
- staticlib_patterns.push_back(Pattern("lib%.dll.a"));
executable_patterns.push_back(Pattern("%.exe"));
}
else
}
}
-void Architecture::set_cross_prefix(const string &p)
-{
- cross_prefix = p;
-}
-
bool Architecture::match_name(const string &pattern) const
{
- vector<string> parts = split(pattern, "-");
+ bool negate = (pattern[0]=='!');
+ vector<string> parts = split(pattern.substr(negate), "-");
for(vector<string>::const_iterator i=parts.begin(); i!=parts.end(); ++i)
{
string part = resolve_alias(*i);
if((part=="32" && bits==32) || (part=="64" && bits==64))
;
else if(part!=type && part!=cpu && part!=system)
- return false;
+ return negate;
}
- return true;
+ return !negate;
}
string Architecture::resolve_alias(const string &part) const
Architecture::Loader::Loader(Architecture &a):
- arch(a)
+ DataFile::ObjectLoader<Architecture>(a)
{
add("prefix", &Architecture::cross_prefix);
}