]> git.tdb.fi Git - builder.git/blobdiff - source/builder.cpp
Compatibility with previous change in mspcore
[builder.git] / source / builder.cpp
index 38fbc1703f2d3bd7c68e17dc1dc9770a832284a3..8ac06f6b6133caf82924a03ccb5f69256661297a 100644 (file)
@@ -18,6 +18,7 @@
 #include "misc.h"
 #include "objectfile.h"
 #include "package.h"
+#include "pkgconfig.h"
 #include "sharedlibrary.h"
 #include "staticlibrary.h"
 #include "systemlibrary.h"
@@ -270,7 +271,7 @@ int Builder::main()
 
        if(help)
        {
-               usage("builder", false);
+               usage(0, "builder", false);
                cout<<'\n';
                package_help();
                return 0;
@@ -343,10 +344,13 @@ Builder::~Builder()
        delete analyzer;
 }
 
-void Builder::usage(const char *argv0, bool brief)
+void Builder::usage(const char *reason, const char *argv0, bool brief)
 {
+       if(reason)
+               cerr<<reason<<'\n';
+       
        if(brief)
-               cerr<<"Usage: "<<argv0<<" [-a|--analyze MODE] [-b|--build] [-c|--clean] [-f|--file FILE] [-h|--help] [-j|--jobs NUM] [-n||--dry-run] [-v|--verbose] [-A|--conf-all] [-B|--build-all] [-C|--chdir DIRECTORY] [-W|--what-if FILE] [--chrome] [--full-paths] [--max-depth NUM] [<target> ...]";
+               cerr<<"Usage: "<<argv0<<" [-a|--analyze MODE] [-b|--build] [-c|--clean] [-f|--file FILE] [-h|--help] [-j|--jobs NUM] [-n||--dry-run] [-v|--verbose] [-A|--conf-all] [-B|--build-all] [-C|--chdir DIRECTORY] [-W|--what-if FILE] [--chrome] [--conf-only] [--full-paths] [--max-depth NUM] [<target> ...]";
        else
        {
                cerr<<
@@ -527,6 +531,15 @@ int Builder::create_targets()
                                }
                        }
                }
+
+               if(i->second->get_install_flags()&(Package::LIB|Package::INCLUDE))
+               {
+                       PkgConfig *pc=new PkgConfig(*this, *i->second);
+                       add_target(pc);
+                       Install *inst=new Install(*this, *i->second, *pc, (inst_base/"lib"/"pkgconfig"/Path::basename(pc->get_name())).str());
+                       add_target(inst);
+                       install->add_depend(inst);
+               }
        }
 
        // Find dependencies until no new targets are created