X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpkgconfigaction.cpp;h=b5678a962684d50290f64d7e03353872c21ecb25;hb=a2adbd9c0a8d7a7567848c4c6bdbf0de6ba32bb1;hp=b1bebace667a337c22a3372e0473cd6ef3717f52;hpb=7aeaa4ba965f596edad438c02e345a8843f7469a;p=builder.git diff --git a/source/pkgconfigaction.cpp b/source/pkgconfigaction.cpp index b1bebac..b5678a9 100644 --- a/source/pkgconfigaction.cpp +++ b/source/pkgconfigaction.cpp @@ -7,7 +7,7 @@ Distributed under the LGPL #include #include -#include +#include #include "package.h" #include "pkgconfig.h" #include "pkgconfigaction.h" @@ -17,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;