Package::Loader::Loader(Package &p):
DataFile::ObjectLoader<Package>(p)
{
+ add("if_arch", &Loader::if_arch);
add("require", &Loader::require);
}
+void Package::Loader::if_arch(const string &cond)
+{
+ const Architecture &arch = obj.builder.get_current_arch();
+ bool negate = (cond[0]=='!');
+ bool match = (arch.match_name(cond.substr(negate))!=negate);
+ obj.builder.get_logger().log("configure", format("%s: arch %s %smatched", obj.name, cond, (match ? "" : "not ")));
+ if(match)
+ load_sub_with(*this);
+}
+
void Package::Loader::require(const string &n)
{
Package *req = obj.builder.get_package_manager().find_package(n);
public:
Loader(Package &);
private:
+ void if_arch(const std::string &);
void require(const std::string &);
};
add("build_info", &Loader::build_info);
add("feature", &Loader::feature);
add("if", &Loader::condition);
- add("if_arch", &Loader::if_arch);
add("if_feat", &Loader::if_feature);
add("program", &Loader::component<Component::PROGRAM>);
add("library", &Loader::component<Component::LIBRARY>);
install_map[*i] = "include/"+comp.get_name();
}
-void SourcePackage::Loader::if_arch(const string &cond)
-{
- const Architecture &arch = obj.builder.get_current_arch();
- bool negate = (cond[0]=='!');
- bool match = (arch.match_name(cond.substr(negate))!=negate);
- obj.builder.get_logger().log("configure", format("%s: arch %s %smatched", obj.name, cond, (match ? "" : "not ")));
- if(match)
- load_sub_with(*this);
-}
-
void SourcePackage::Loader::if_feature(const string &cond)
{
bool match = false;
void condition(const std::string &);
void build_info();
void headers(const std::string &);
- void if_arch(const std::string &);
void if_feature(const std::string &);
void source_tarball();
void tarball(const std::string &);