]> git.tdb.fi Git - builder.git/blobdiff - source/package.cpp
Add comments
[builder.git] / source / package.cpp
index 14d2321e26964229a04d68cc72716b791bc15978..14ae5f7878ac99781a701eb9fee6ce82052df204 100644 (file)
@@ -9,6 +9,9 @@ using namespace Msp;
 
 #include <iostream>
 
+/**
+Creates a buildable package.
+*/
 Package::Package(Builder &b, const string &n, const Path::Path &s):
        builder(b),
        name(n),
@@ -17,11 +20,18 @@ Package::Package(Builder &b, const string &n, const Path::Path &s):
        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)
@@ -30,6 +40,9 @@ void Package::resolve_refs()
                i->resolve_refs();
 }
 
+/**
+Fills in build info based on configuration.
+*/
 void Package::create_build_info()
 {
        if(build_info_ready)
@@ -101,12 +114,21 @@ void Package::create_build_info()
        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;
@@ -120,6 +142,7 @@ Package *Package::create(Builder &b, const string &name)
        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")
@@ -158,6 +181,9 @@ Package::Package(Builder &b, const string &n, const vector<string> &info):
        }
 }
 
+/**
+Initializes a buildable package.  Mostly adds configuration options.
+*/
 void Package::init_buildable()
 {
        buildable=true;
@@ -187,6 +213,11 @@ void Package::init_buildable()
        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;