1 #ifndef ARCHITECTURE_H_
2 #define ARCHITECTURE_H_
4 #include <msp/datafile/loader.h>
11 Stores information about an architecture. This includes CPU type, model and
12 bitness and operating system.
17 class Loader: public Msp::DataFile::ObjectLoader<Architecture>
20 Loader(Architecture &);
23 typedef std::list<Pattern> PatternList;
32 std::string toolchain;
35 std::string cross_prefix;
36 PatternList object_patterns;
37 PatternList sharedlib_patterns;
38 PatternList staticlib_patterns;
39 PatternList executable_patterns;
42 Architecture(Builder &b, const std::string &spec);
44 const std::string &get_type() const { return type; }
45 const std::string &get_name() const { return name; }
46 const std::string &get_system() const { return system; }
47 unsigned get_bits() const { return bits; }
48 const std::string &get_cpu() const { return cpu; }
49 const std::string &get_fpu() const { return fpu; }
50 const std::string &get_toolchain() const { return toolchain; }
51 bool match_name(const std::string &) const;
52 std::string best_match(const std::vector<std::string> &) const;
53 bool is_native() const { return native; }
54 bool is_cross() const { return !cross_prefix.empty(); }
56 const std::string &get_cross_prefix() const { return cross_prefix; }
58 const PatternList &get_object_patterns() const { return object_patterns; }
59 const PatternList &get_shared_library_patterns() const { return sharedlib_patterns; }
60 const PatternList &get_static_library_patterns() const { return staticlib_patterns; }
61 const PatternList &get_executable_patterns() const { return executable_patterns; }
64 static void resolve_aliases(std::vector<std::string> &);
65 void parse_specification(const std::string &);