X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpackage.cpp;h=c4710bca79a4f6082b7dd3e7b62297e85a247599;hb=51d5a0f618faabfce9a0a5d5dd64b0b0d52b97cb;hp=23a8d9c8e6c73a0b592d0d0de5849419d1df0b0b;hpb=654de39b62a9a58fd8e1b5a557361d628345788b;p=builder.git diff --git a/source/package.cpp b/source/package.cpp index 23a8d9c..c4710bc 100644 --- a/source/package.cpp +++ b/source/package.cpp @@ -1,10 +1,4 @@ -/* $Id$ - -This file is part of builder -Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - +#include #include #include #include "builder.h" @@ -14,11 +8,6 @@ Distributed under the LGPL using namespace std; using namespace Msp; -#include - -/** -Creates a buildable package. -*/ Package::Package(Builder &b, const string &n): builder(b), name(n), @@ -26,38 +15,27 @@ Package::Package(Builder &b, const string &n): use_pkgconfig(true) { } -/** -Tries to resolve all references to dependency packages. -*/ -void Package::resolve_refs() -{ - for(PkgRefList::iterator i=requires.begin(); i!=requires.end(); ++i) - i->resolve(); -} - -/** -Processes configuration options that were most likely obtained from the command -line. -*/ void Package::configure(const StringMap &opts, unsigned flag) { if(conf_done) return; if(builder.get_verbose()>=3) - cout<<"Configuring "<get_package()->configure(opts, flag&2); + requires.sort(); + requires.unique(); + + for(PackageList::iterator i=requires.begin(); i!=requires.end(); ++i) + (*i)->configure(opts, flag&2); create_build_info(); - conf_done=true; + conf_done = true; } -/*** private ***/ Package::Loader::Loader(Package &p): pkg(p) @@ -67,5 +45,7 @@ Package::Loader::Loader(Package &p): void Package::Loader::require(const string &n) { - pkg.requires.push_back(PackageRef(pkg.builder, n)); + Package *req = pkg.builder.get_package(n); + if(req) + pkg.requires.push_back(req); }