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())
{
Builder::Loader::Loader(Builder &b, const FS::Path &s):
- bld(b),
+ 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(bld, 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)
{
- bld.cross_prefixes[a] = p;
+ BinaryPackage *pkg = new BinaryPackage(obj, n);
+ load_sub(*pkg);
}
void Builder::Loader::profile(const string &n)
StringMap prf;
ProfileLoader ldr(prf);
load_sub_with(ldr);
- bld.profile_tmpl.insert(ProfileTemplateMap::value_type(n, prf));
+ obj.profile_tmpl.insert(ProfileTemplateMap::value_type(n, prf));
}
void Builder::Loader::package(const string &n)
{
- SourcePackage *pkg = new SourcePackage(bld, n, src);
- if(!bld.main_pkg)
- bld.main_pkg = pkg;
+ SourcePackage *pkg = new SourcePackage(obj, n, src);
+ if(!obj.main_pkg)
+ obj.main_pkg = pkg;
load_sub(*pkg);
}