X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Farchitecture.h;h=ad30fe5d5db4f36a40d24f8194ffda6548d37882;hb=f4a10e1dc189f28367eafe3b91723d275928ced7;hp=16ff50547c465e6ccb77957321fdcc6593b88cad;hpb=329dc80e392faf7354338621e73dba1880fc767d;p=builder.git diff --git a/source/architecture.h b/source/architecture.h index 16ff505..ad30fe5 100644 --- a/source/architecture.h +++ b/source/architecture.h @@ -1,7 +1,7 @@ /* $Id$ This file is part of builder -Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Copyright © 2007-2010 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ @@ -9,33 +9,57 @@ Distributed under the LGPL #define ARCHITECTURE_H_ #include +#include "buildinfo.h" #include "misc.h" class Builder; +// XXX Add lib/exe prefix/suffix fields. Some archs may need multiple alternatives, how to handle this? class Architecture { public: class Loader: public Msp::DataFile::Loader { + private: + Architecture &arch; + public: Loader(Architecture &); Architecture &get_object() { return arch; } private: - Architecture &arch; - void tool(const std::string &t, const std::string &p); }; - Architecture(Builder &b, const std::string &n); +private: + Builder &builder; + std::string type; + std::string cpu; + std::string system; + unsigned bits; + std::string name; + bool native; + std::string cross_prefix; + StringMap tools; + BuildInfo build_info; + +public: + Architecture(Builder &b, const std::string &spec); + + const std::string &get_name() const { return name; } + const std::string &get_system() const { return system; } + bool match_name(const std::string &) const; + bool is_native() const { return native; } + void set_tool(const std::string &t, const std::string &p); + void set_cross_prefix(const std::string &); std::string get_tool(const std::string &t) const; - const std::string &get_prefix() const { return prefix; } + const std::string &get_cross_prefix() const { return cross_prefix; } + + const BuildInfo &get_build_info() const { return build_info; } + private: - Builder &builder; - std::string name; - std::string prefix; - StringMap tools; + std::string resolve_alias(const std::string &) const; + void parse_specification(const std::string &); }; typedef std::map ArchMap;