X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpackage.cpp;h=5255b864dd8aac6b44eff025dd736fdbdacd5de2;hb=6613371a07a1a9a8d5dead488092015261a9bf5f;hp=587ce80da4f3b172ca839cb53be9d6673c7c2fb5;hpb=4f78d9f016482ce1ac7d726852e33e07c090df1b;p=builder.git diff --git a/source/package.cpp b/source/package.cpp index 587ce80..5255b86 100644 --- a/source/package.cpp +++ b/source/package.cpp @@ -18,6 +18,7 @@ Package::Package(Builder &b, const string &n, const Path::Path &s): buildable(true), source(s), conf_done(false), + use_pkgconfig(true), need_path(false) { } @@ -30,6 +31,30 @@ void Package::set_path(const Msp::Path::Path &p) path=builder.get_cwd()/p; } +/** +Checks which kinds of things the components of this package install. + +@return A bitmask of installed things +*/ +unsigned Package::get_install_flags() +{ + unsigned flags=0; + for(ComponentList::iterator i=components.begin(); i!=components.end(); ++i) + { + if(i->get_install()) + { + if(i->get_type()==Component::PROGRAM) + flags|=BIN; + else if(i->get_type()==Component::LIBRARY || i->get_type()==Component::MODULE) + flags|=LIB; + } + if(!i->get_install_headers().empty()) + flags|=INCLUDE; + } + + return flags; +} + /** Tries to resolve all references to dependency packages. */ @@ -99,8 +124,11 @@ Package *Package::create(Builder &b, const string &name) vector info=split(run_command(argv)); bool need_path=false; + bool use_pkgconfig=true; if(info.empty()) { + use_pkgconfig=false; + //XXX Put these in an external file if(name=="opengl") info.push_back("-lGL"); @@ -116,6 +144,7 @@ Package *Package::create(Builder &b, const string &name) Package *pkg=new Package(b, name, info); pkg->need_path=need_path; + pkg->use_pkgconfig=use_pkgconfig; return pkg; } @@ -239,30 +268,6 @@ void Package::create_build_info() export_binfo.unique(); } -/** -Checks which kinds of things the components of this package install. - -@return A bitmask of installed things -*/ -unsigned Package::get_install_flags() -{ - unsigned flags=0; - for(ComponentList::iterator i=components.begin(); i!=components.end(); ++i) - { - if(i->get_install()) - { - if(i->get_type()==Component::PROGRAM) - flags|=BIN; - else if(i->get_type()==Component::LIBRARY || i->get_type()==Component::MODULE) - flags|=LIB; - } - if(!i->get_install_headers().empty()) - flags|=INCLUDE; - } - - return flags; -} - Package::Loader::Loader(Package &p): pkg(p) {