X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpackage.cpp;h=f1374298eac0c8d14315a03d751498d5ba144a97;hb=20994a6f4802f2dbcf01888d0e1996edf554ade5;hp=20fec32acfb84d64665ff2c05372482761de3eb2;hpb=c679a9dd1a97ae3b1ffa568143d42d02c2ca9e74;p=builder.git diff --git a/source/package.cpp b/source/package.cpp index 20fec32..f137429 100644 --- a/source/package.cpp +++ b/source/package.cpp @@ -1,10 +1,11 @@ /* $Id$ This file is part of builder -Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Copyright © 2006-2007, 2009 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ +#include #include #include #include "builder.h" @@ -14,11 +15,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,17 +22,29 @@ Package::Package(Builder &b, const string &n): use_pkgconfig(true) { } -/** -Processes configuration options that were most likely obtained from the command -line. -*/ +PackageList Package::collect_requires() +{ + PackageList result; + result.push_back(this); + for(PackageList::const_iterator i=requires.begin(); i!=requires.end(); ++i) + { + PackageList r = (*i)->collect_requires(); + result.splice(result.end(), r); + } + + result.sort(); + result.unique(); + + return result; +} + void Package::configure(const StringMap &opts, unsigned flag) { if(conf_done) return; if(builder.get_verbose()>=3) - cout<<"Configuring "<