X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpkgconfigaction.cpp;h=b5678a962684d50290f64d7e03353872c21ecb25;hb=a2adbd9c0a8d7a7567848c4c6bdbf0de6ba32bb1;hp=9c565f6ddcf5b1dc86588f8eb691b26beae19abe;hpb=57bdb055acb0453c75b22cb64f35cc0e817a2827;p=builder.git diff --git a/source/pkgconfigaction.cpp b/source/pkgconfigaction.cpp index 9c565f6..b5678a9 100644 --- a/source/pkgconfigaction.cpp +++ b/source/pkgconfigaction.cpp @@ -1,6 +1,13 @@ +/* $Id$ + +This file is part of builder +Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ + #include #include -#include +#include #include "package.h" #include "pkgconfig.h" #include "pkgconfigaction.h" @@ -10,29 +17,29 @@ using namespace std; PkgConfigAction::PkgConfigAction(Builder &b, const PkgConfig &p): Action(b) { - const Package &pkg=*p.get_package(); - - announce(pkg.get_name(), "PC", relative(p.get_name(), pkg.get_source()).str()); - + const SourcePackage &spkg=*static_cast(p.get_package()); + + announce(spkg.get_name(), "PC", relative(p.get_name(), spkg.get_source()).str()); + ofstream out(p.get_name().c_str()); if(out) { // Prefix is already included in the various paths //out<<"prefix="<get_package()->get_use_pkgconfig()) - out<<' '<get_name(); + const PackageList &reqs=spkg.get_requires(); + for(PackageList::const_iterator i=reqs.begin(); i!=reqs.end(); ++i) + if((*i)->get_use_pkgconfig()) + out<<' '<<(*i)->get_name(); out<<'\n'; - const BuildInfo &binfo=pkg.get_exported_binfo(); + const BuildInfo &binfo=spkg.get_exported_binfo(); out<<"Libs:"; for(StringList::const_iterator i=binfo.libpath.begin(); i!=binfo.libpath.end(); ++i) out<<" -L"<<*i;