buildable(true),
source(s),
conf_done(false),
+ use_pkgconfig(true),
need_path(false)
{ }
path=builder.get_cwd()/p;
}
+/**
+Checks which kinds of things the components of this package install.
+
+@return A bitmask of installed things
+*/
+unsigned Package::get_install_flags()
+{
+ unsigned flags=0;
+ for(ComponentList::iterator i=components.begin(); i!=components.end(); ++i)
+ {
+ if(i->get_install())
+ {
+ if(i->get_type()==Component::PROGRAM)
+ flags|=BIN;
+ else if(i->get_type()==Component::LIBRARY || i->get_type()==Component::MODULE)
+ flags|=LIB;
+ }
+ if(!i->get_install_headers().empty())
+ flags|=INCLUDE;
+ }
+
+ return flags;
+}
+
/**
Tries to resolve all references to dependency packages.
*/
*/
void Package::configure(const RawOptionMap &opts, unsigned flag)
{
- if(conf_done || !buildable)
+ if(conf_done)
return;
-
+
if(builder.get_verbose()>=3)
cout<<"Configuring "<<name<<'\n';
-
- init_config();
- if(flag && config.process(opts) && !builder.get_dry_run())
- {
- if(builder.get_verbose()>=2)
- cout<<"Configuration of "<<name<<" changed.\n";
- config.save(source/".options.cache");
- }
-
- for(PackageList::iterator i=all_reqs.begin(); i!=all_reqs.end(); ++i)
+ if(buildable)
{
- (*i)->configure(opts, flag&2);
- if((*i)->get_need_path())
- (*i)->set_path(config.get_option((*i)->get_name()+"_path").value);
+ init_config();
+
+ if(flag && config.process(opts) && !builder.get_dry_run())
+ {
+ if(builder.get_verbose()>=2)
+ cout<<"Configuration of "<<name<<" changed\n";
+ config.save(source/".options.cache");
+ }
+
+ for(PackageList::iterator i=all_reqs.begin(); i!=all_reqs.end(); ++i)
+ {
+ if((*i)->get_need_path())
+ (*i)->set_path(config.get_option((*i)->get_name()+"_path").value);
+ (*i)->configure(opts, flag&2);
+ }
}
-
+
create_build_info();
conf_done=true;
vector<string> info=split(run_command(argv));
bool need_path=false;
+ bool use_pkgconfig=true;
if(info.empty())
{
+ use_pkgconfig=false;
+
//XXX Put these in an external file
if(name=="opengl")
info.push_back("-lGL");
Package *pkg=new Package(b, name, info);
pkg->need_path=need_path;
+ pkg->use_pkgconfig=use_pkgconfig;
return pkg;
}
export_binfo.unique();
}
-/**
-Checks which kinds of things the components of this package install.
-
-@return A bitmask of installed things
-*/
-unsigned Package::get_install_flags()
-{
- unsigned flags=0;
- for(ComponentList::iterator i=components.begin(); i!=components.end(); ++i)
- {
- if(i->get_install())
- {
- if(i->get_type()==Component::PROGRAM)
- flags|=BIN;
- else if(i->get_type()==Component::LIBRARY || i->get_type()==Component::MODULE)
- flags|=LIB;
- }
- if(!i->get_install_headers().empty())
- flags|=INCLUDE;
- }
-
- return flags;
-}
-
Package::Loader::Loader(Package &p):
pkg(p)
{