#include <limits>
-#ifndef _WIN32
-#include <sys/utsname.h>
-#endif
#include <msp/strings/format.h>
#include <msp/strings/utils.h>
#include "architecture.h"
#include "builder.h"
+#include "sysutils.h"
using namespace std;
using namespace Msp;
{
"pc", "x86",
"x86_64", "x86-64",
+ "x64", "x86-64",
"amd64", "x86-64",
"i586", "pentium",
"i686", "pentiumpro",
{
if(spec.empty())
{
-#ifdef _WIN32
- system = "windows";
-#else
- utsname un;
- if(uname(&un)==0)
- {
- system = tolower(un.sysname);
- parse_specification(tolower(un.machine));
- // We really only want to set type for the default arch
- cpu.clear();
- }
-#endif
+ parse_specification(get_system_type());
+ // We really only want to set type for the default arch
+ cpu.clear();
bits = sizeof(void *)*numeric_limits<unsigned char>::digits;
native = true;
}
name += format("-%s", fpu);
name += format("-%d-%s-%s", bits, system, toolchain);
+ object_patterns.push_back(Pattern("%.o"));
if(system=="windows")
{
sharedlib_patterns.push_back(Pattern("%.dll"));
return !negate;
}
-string Architecture::best_match(const list<string> &names) const
+string Architecture::best_match(const vector<string> &names) const
{
string best;
unsigned best_size = 0;
- for(list<string>::const_iterator i=names.begin(); i!=names.end(); ++i)
+ for(vector<string>::const_iterator i=names.begin(); i!=names.end(); ++i)
if(match_name(*i))
{
/* TODO Do full parse and alias resolution here? Otherwise x86 and