type(t),
name(n),
install(false),
- module_host(0),
- modular(false),
deflt(true)
{ }
build_info.cflags.push_back("-fPIC");
}
- if(modular)
- {
- build_info.ldflags.push_back("-rdynamic");
- build_info.libs.push_back("dl");
- }
- else if(module_host)
- {
- const StringList &host_src = module_host->get_sources();
- for(StringList::const_iterator i=host_src.begin(); i!=host_src.end(); ++i)
- build_info.incpath.push_back(*i);
- }
-
build_info.unique();
}
void Component::Loader::modular()
{
- if(comp.type!=PROGRAM)
- throw Exception("Only programs can be modular");
- comp.modular = true;
+ IO::print("%s: Note: modular is deprecated\n", get_source());
+ comp.build_info.ldflags.push_back("-rdynamic");
+ comp.build_info.libs.push_back("dl");
}
-void Component::Loader::host(const string &n)
+void Component::Loader::host(const string &)
{
- const ComponentList &comps = comp.pkg.get_components();
- for(ComponentList::const_iterator i=comps.begin(); i!=comps.end(); ++i)
- if(i->get_name()==n)
- {
- if(i->get_type()!=PROGRAM || !i->is_modular())
- throw Exception("Module host must be a modular program");
- comp.module_host = &*i;
- return;
- }
-
- throw KeyError("Unknown component", n);
+ IO::print("%s: Note: host is deprecated\n", get_source());
}
void Component::Loader::install_headers(const string &p)
std::string name;
StringList sources;
bool install;
- const Component *module_host;
- bool modular;
BuildInfo build_info;
PackageList requires;
bool deflt;
const StringList &get_sources() const { return sources; }
const BuildInfo &get_build_info() const { return build_info; }
bool get_install() const { return install; }
- bool is_modular() const { return modular; }
const PackageList &get_requires() const { return requires; }
bool is_default() const { return deflt; }