]> git.tdb.fi Git - builder.git/blobdiff - source/architecture.h
Rewrite the architecture system
[builder.git] / source / architecture.h
index af586192f9ef44b4dafa9103c68ca2b797000e43..a6388347abb0e9b2cf73b59fee119598cb2909ce 100644 (file)
@@ -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,6 +9,7 @@ Distributed under the LGPL
 #define ARCHITECTURE_H_
 
 #include <msp/datafile/loader.h>
+#include "buildinfo.h"
 #include "misc.h"
 
 class Builder;
@@ -19,27 +20,45 @@ 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, bool a=false);
-       void set_tool(const std::string &t, const std::string &p);
-       std::string get_tool(const std::string &t) const;
+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; }
-       const std::string &get_prefix() const { return prefix; }
+
+       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_cross_prefix() const { return cross_prefix; }
+
+       const BuildInfo &get_build_info() const { return build_info; }
+
 private:
-       Builder     &builder;
-       std::string name;
-       bool        native;
-       std::string prefix;
-       StringMap   tools;
+       void parse_specification(const std::string &);
 };
 
 typedef std::map<std::string, Architecture> ArchMap;