X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Farchitecture.h;h=c07297a8940153fa7551e6a62c1c956c66852f33;hb=4facd021514ab372c23b1b132d6b4b62baa4efbf;hp=aa5f8650ddae92803114d9ffd98049b9e6647071;hpb=04c316da6d5d90e43cba262f54d90ca231f703bf;p=builder.git diff --git a/source/architecture.h b/source/architecture.h index aa5f865..c07297a 100644 --- a/source/architecture.h +++ b/source/architecture.h @@ -1,15 +1,9 @@ -/* $Id$ - -This file is part of builder -Copyright © 2007-2009 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef ARCHITECTURE_H_ #define ARCHITECTURE_H_ #include -#include "misc.h" +#include "buildinfo.h" +#include "pattern.h" class Builder; @@ -25,24 +19,43 @@ public: public: Loader(Architecture &); Architecture &get_object() { return arch; } - private: - void tool(const std::string &t, const std::string &p); }; + typedef std::list PatternList; + private: Builder &builder; + std::string type; + std::string cpu; + std::string system; + unsigned bits; std::string name; bool native; - std::string prefix; - StringMap tools; + std::string cross_prefix; + PatternList sharedlib_patterns; + PatternList staticlib_patterns; + PatternList executable_patterns; public: - Architecture(Builder &b, const std::string &n, bool a = false); - void set_tool(const std::string &t, const std::string &p); - std::string get_tool(const std::string &t) const; + Architecture(Builder &b, const std::string &spec); + const std::string &get_name() const { return name; } + const std::string &get_system() const { return system; } + unsigned get_bits() const { return bits; } + const std::string &get_cpu() const { return cpu; } + bool match_name(const std::string &) const; bool is_native() const { return native; } - const std::string &get_prefix() const { return prefix; } + + void set_cross_prefix(const std::string &); + const std::string &get_cross_prefix() const { return cross_prefix; } + + const PatternList &get_shared_library_patterns() const { return sharedlib_patterns; } + const PatternList &get_static_library_patterns() const { return staticlib_patterns; } + const PatternList &get_executable_patterns() const { return executable_patterns; } + +private: + std::string resolve_alias(const std::string &) const; + void parse_specification(const std::string &); }; typedef std::map ArchMap;