X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Farchitecture.cpp;h=ba25afd77b27c997656cb37f843e0a7092c5c646;hb=e4c839cacd8572ade951f4961e8e145d20e0103f;hp=fe0033891feb903867bc7eb037b8ca9d480c0943;hpb=7e8d4dd11403234221a34848a69cff486dc72890;p=builder.git diff --git a/source/architecture.cpp b/source/architecture.cpp index fe00338..ba25afd 100644 --- a/source/architecture.cpp +++ b/source/architecture.cpp @@ -1,5 +1,5 @@ #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif #include @@ -42,6 +42,15 @@ const char *cpus[] = 0 }; +const char *fpus[] = +{ + "387", "x86", + "sse", "x86", + "vfpv3", "arm", + "neon", "arm", + 0 +}; + const char *systems[] = { "linux", @@ -77,7 +86,7 @@ Architecture::Architecture(Builder &b, const string &spec): { if(spec.empty()) { -#ifdef WIN32 +#ifdef _WIN32 system = "windows"; #else utsname un; @@ -116,6 +125,8 @@ Architecture::Architecture(Builder &b, const string &spec): name = type; if(!cpu.empty()) name += format("-%s", cpu); + if(!fpu.empty()) + name += format("-%s", fpu); name += format("-%d-%s", bits, system); if(system=="windows") @@ -149,7 +160,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!=system) + else if(*i!=type && *i!=cpu && *i!=fpu && *i!=system) return negate; } return !negate; @@ -236,6 +247,15 @@ void Architecture::parse_specification(const string &spec) ok = true; } + for(unsigned j=0; (!ok && fpus[j]); j+=2) + if(*i==fpus[j]) + { + if(fpus[j+1]!=type) + throw invalid_argument("Conflicting FPU specification"); + fpu = *i; + ok = true; + } + for(unsigned j=0; (!ok && systems[j]); ++j) if(*i==systems[j]) {