]> git.tdb.fi Git - builder.git/commitdiff
Add gmpxx package
authorMikko Rasa <tdb@tdb.fi>
Sat, 16 Sep 2006 11:46:47 +0000 (11:46 +0000)
committerMikko Rasa <tdb@tdb.fi>
Sat, 16 Sep 2006 11:46:47 +0000 (11:46 +0000)
Support custom cflags
Use basenames for Install rebuild reasons

source/component.cpp
source/component.h
source/install.cpp
source/package.cpp

index 1274a75c12d283ebbe234adabffcafd35b846de1..1fd6b24bfc89676324cd80eb7fe3469c6263b86a 100644 (file)
@@ -12,7 +12,7 @@ Component::Component(Package &p, Type t, const string &n):
 
 void Component::create_build_info()
 {
-       build_info=pkg.get_build_info();
+       build_info.add(pkg.get_build_info());
        build_info.unique();
 }
 
@@ -22,9 +22,15 @@ Component::Loader::Loader(Component &c):
        add("source",          &Loader::source);
        add("install",         &Component::install);
        add("install_headers", &Component::install_headers);
+       add("cflag",           &Loader::cflag);
 }
 
 void Component::Loader::source(const string &s)
 {
        comp.sources.push_back(comp.pkg.get_source()/s);
 }
+
+void Component::Loader::cflag(const string &f)
+{
+       comp.build_info.cflags.push_back(f);
+}
index af2fc2fae380a3accd0294c25239b268c6c67c1c..d0b3cc2aff060c8031ff8111ad3c0725bfcc8ece 100644 (file)
@@ -21,6 +21,7 @@ public:
                Component &comp;
 
                void source(const std::string &);
+               void cflag(const std::string &);
        };
        
        enum Type
index 1ade8b2887d4d6279c8feb4f7f1ef6b053052efc..658a6fb84a0bc5bd867f8311168406008dc25189 100644 (file)
@@ -1,3 +1,4 @@
+#include <msp/path/utils.h>
 #include "builder.h"
 #include "copy.h"
 #include "header.h"
@@ -5,6 +6,7 @@
 #include "package.h"
 
 using namespace std;
+using namespace Msp;
 
 Install::Install(Builder &b, const Package &p, Target &tgt, const string &n):
        Target(b, &p, n)
@@ -21,9 +23,9 @@ void Install::check_rebuild()
        {
                Target *dep=depends.front();
                if(dep->get_mtime()>mtime)
-                       mark_rebuild(dep->get_name()+" has changed");
+                       mark_rebuild(Path::basename(dep->get_name())+" has changed");
                else if(dep->get_rebuild())
-                       mark_rebuild(dep->get_name()+" needs rebuilding");
+                       mark_rebuild(Path::basename(dep->get_name())+" needs rebuilding");
        }
 }
 
index cb1940341722608c25e80f1e19794ba741e6ce66..121213f19b068147f062d3afb5f4233f143ced26 100644 (file)
@@ -127,6 +127,8 @@ Package *Package::create(Builder &b, const string &name)
                        info.push_back("-lGL");
                else if(name=="pthread")
                        info.push_back("-lpthread");
+               else if(name=="gmpxx")
+                       info.push_back("-lgmpxx");
                else
                        return 0;
        }