]> git.tdb.fi Git - builder.git/blobdiff - source/builder.cpp
Better way to set cross_prefix in architectures
[builder.git] / source / builder.cpp
index 94bbce04d3a552480994b2d4597fdeb5e154f3b1..df6eda42fcfe535f2074b1939b5a0c6afe677782 100644 (file)
@@ -165,23 +165,13 @@ Builder::Builder(int argc, char **argv):
 
        package_manager.set_no_externals(no_externals);
 
-       load_build_file((FS::get_sys_data_dir(argv[0], "builder")/"builderrc").str());
-       load_build_file((FS::get_user_data_dir("builder")/"rc").str());
-
        if(arch.empty())
                current_arch = &native_arch;
        else
                current_arch = new Architecture(*this, arch);
 
-       if(!current_arch->is_native())
-       {
-               for(StringMap::const_iterator i=cross_prefixes.begin(); i!=cross_prefixes.end(); ++i)
-                       if(current_arch->match_name(i->first))
-                       {
-                               current_arch->set_cross_prefix(i->second);
-                               break;
-                       }
-       }
+       load_build_file((FS::get_sys_data_dir(argv[0], "builder")/"builderrc").str());
+       load_build_file((FS::get_user_data_dir("builder")/"rc").str());
 
        if(prfx.empty())
        {
@@ -609,21 +599,22 @@ Builder::Loader::Loader(Builder &b, const FS::Path &s):
        DataFile::ObjectLoader<Builder>(b),
        src(s)
 {
+       add("architecture", &Loader::architecture);
        add("binary_package", &Loader::binpkg);
-       add("cross_prefix", &Loader::cross_prefix);
        add("profile", &Loader::profile);
        add("package", &Loader::package);
 }
 
-void Builder::Loader::binpkg(const string &n)
+void Builder::Loader::architecture(const string &n)
 {
-       BinaryPackage *pkg = new BinaryPackage(obj, n);
-       load_sub(*pkg);
+       if(obj.current_arch->match_name(n))
+               load_sub(*obj.current_arch);
 }
 
-void Builder::Loader::cross_prefix(const string &a, const string &p)
+void Builder::Loader::binpkg(const string &n)
 {
-       obj.cross_prefixes[a] = p;
+       BinaryPackage *pkg = new BinaryPackage(obj, n);
+       load_sub(*pkg);
 }
 
 void Builder::Loader::profile(const string &n)