#include <iostream>
+/**
+Creates a buildable package.
+*/
Package::Package(Builder &b, const string &n, const Path::Path &s):
builder(b),
name(n),
build_info_ready(false)
{ }
+/**
+Sets the path where the package files were installed. This is only useful for
+non-buildable packages that don't use pkg-config.
+*/
void Package::set_path(const Msp::Path::Path &p)
{
path=builder.get_cwd()/p;
}
+/**
+Tries to resolve all references to dependency packages.
+*/
void Package::resolve_refs()
{
for(PkgRefList::iterator i=requires.begin(); i!=requires.end(); ++i)
i->resolve_refs();
}
+/**
+Fills in build info based on configuration.
+*/
void Package::create_build_info()
{
if(build_info_ready)
build_info_ready=true;
}
+/**
+Processes configuration options that were most likely obtained from the command
+line.
+*/
void Package::process_options(const RawOptionMap &opts)
{
if(config.process(opts))
config.save(source/".options.cache");
}
+/**
+Creates a non-buildable package with the given name. Pkg-config is tried first
+to get build information. If it fails, a built-in list of known packages is
+consulted.
+*/
Package *Package::create(Builder &b, const string &name)
{
list<string> argv;
bool need_path=false;
if(info.empty())
{
+ //XXX Put these in an external file
if(name=="opengl")
info.push_back("-lGL");
else if(name=="pthread")
}
}
+/**
+Initializes a buildable package. Mostly adds configuration options.
+*/
void Package::init_buildable()
{
buildable=true;
config.load(source/".options.cache");
}
+/**
+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;