X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsourcepackage.cpp;h=ab66c0056651cbfddaa768fed2dbb47577779870;hb=903a5727ef1f8a7f540e162139396163c736d484;hp=60276daff288bb48cc2292bf12e91f5b88d882e2;hpb=45c778b1976de1a3093e0c6fb5e2a94c42073dcb;p=builder.git diff --git a/source/sourcepackage.cpp b/source/sourcepackage.cpp index 60276da..ab66c00 100644 --- a/source/sourcepackage.cpp +++ b/source/sourcepackage.cpp @@ -5,6 +5,8 @@ #include "binarypackage.h" #include "builder.h" #include "misc.h" +#include "pkgconfigfile.h" +#include "tool.h" #include "sourcepackage.h" using namespace std; @@ -128,8 +130,7 @@ void SourcePackage::do_configure(const StringMap &opts, unsigned flag) if(flag && config.update(opts)) { - if(builder.get_verbose()>=2) - IO::print("Configuration of %s changed\n", name); + builder.get_logger().log("configure", format("Configuration of %s changed", name)); if(!builder.get_dry_run()) config.save(); } @@ -141,7 +142,7 @@ void SourcePackage::do_configure(const StringMap &opts, unsigned flag) { const StringList &reqs = i->get_requires(); for(StringList::const_iterator j=reqs.begin(); j!=reqs.end(); ++j) - if(Package *pkg = builder.get_package(*j)) + if(Package *pkg = builder.get_package_manager().find_package(*j)) requires.push_back(pkg); } @@ -218,16 +219,29 @@ void SourcePackage::create_build_info() if(i->eval()) build_info.update_from(i->get_build_info()); - build_info.unique(); - for(list::iterator i=components.begin(); i!=components.end(); ++i) { i->create_build_info(); if(i->get_type()==Component::LIBRARY) export_binfo.libs.push_back(i->get_name()); } +} + +void SourcePackage::create_targets() +{ + bool pc_needed = false; + for(ComponentList::const_iterator i=components.begin(); i!=components.end(); ++i) + { + i->create_targets(); + if(i->get_type()==Component::LIBRARY || i->get_type()==Component::HEADERS) + pc_needed = true; + } - export_binfo.unique(); + if(pc_needed) + { + PkgConfigFile *pc = new PkgConfigFile(builder, *this); + builder.get_target("install")->add_depend(builder.get_toolchain().get_tool("CP").create_target(*pc)); + } }