]> git.tdb.fi Git - builder.git/blobdiff - source/package.cpp
Support for creating .pc files
[builder.git] / source / package.cpp
index 587ce80da4f3b172ca839cb53be9d6673c7c2fb5..5255b864dd8aac6b44eff025dd736fdbdacd5de2 100644 (file)
@@ -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<string> 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)
 {