summaryrefslogtreecommitdiffabout
path: root/lib
Side-by-side diff
Diffstat (limited to 'lib') (more/less context) (show whitespace changes)
-rw-r--r--lib/component_factory.cc25
1 files changed, 21 insertions, 4 deletions
diff --git a/lib/component_factory.cc b/lib/component_factory.cc
index 5c18bb7..b5e95af 100644
--- a/lib/component_factory.cc
+++ b/lib/component_factory.cc
@@ -115,7 +115,6 @@ namespace sitecing {
bool component_factory::is_uptodate(const string& dst,file_list_t *deps) {
string dp = normalize_path(dst,strip_trailing_slash);
- // XXX: or just compare it off, instead of throwing things around.
try {
string noro = strip_prefix(dp,root_intermediate);
for(int ppt=0;(ppt+1)<sizeof(pp_targets)/sizeof(*pp_targets);ppt++) {
@@ -127,6 +126,7 @@ namespace sitecing {
bool rv = file_factory::is_uptodate(dst,deps);
return rv;
}catch(utility_no_prefix& unp) { }
+ // XXX: or just compare it off, instead of throwing things around.
try {
strip_prefix(dp,root_so);
return file_factory::is_uptodate(dst,deps);
@@ -147,6 +147,7 @@ namespace sitecing {
string noso = strip_suffix(dp,".so");
string noro = strip_prefix(noso,root_so);
string o = root_intermediate+noro+".o";
+ cerr << "Linking " << noro << endl;
if(access(o.c_str(),R_OK))
throw konforka::exception(CODEPOINT,string("can't access compiled component code (")+o+")");
make_path(dir_name(root_so+noro),0755);
@@ -191,6 +192,7 @@ namespace sitecing {
string nos = strip_suffix(noro,cc_targets[cct]);
string cc = root_intermediate+nos+".cc";
string o = root_intermediate+nos+".o";
+ cerr << "Compiling " << nos << endl;
if(access(cc.c_str(),R_OK))
throw konforka::exception(CODEPOINT,string("can't access preprocessed component code (")+cc+")");
make_path(dir_name(cc),0755);
@@ -230,6 +232,7 @@ namespace sitecing {
try {
string nos = strip_suffix(noro,pp_targets[ppt]);
string src = root_source+nos;
+ cerr << "Preprocessing " << nos << endl;
if(access(src.c_str(),R_OK))
throw konforka::exception(CODEPOINT,string("can't access component source (")+src+")");
make_path(dir_name(root_intermediate+nos),0755);
@@ -264,17 +267,31 @@ namespace sitecing {
cerr << "ignoring build request for " << dp << endl;
}
+ void component_factory::make(const string& dst) {
+ string dp = normalize_path(dst,strip_trailing_slash);
+ try {
+ string noso = strip_suffix(dp,".so");
+ string noro = strip_prefix(noso,root_so);
+ file_list_t a;
+ get_ancestors(noro,a);
+ for(file_list_t::const_iterator i=a.begin();i!=a.end();++i) {
+ make(root_so+*i+".so");
+ }
+ }catch(utility_no_affix& una) { }
+ file_factory::make(dst);
+ }
+
int component_factory::execute(const string& cmd, const list<string>& args,int stdo,int stde) {
// XXX: is it right that we do stdio/stderr tricks outside of the function?
- cerr << "executing: " << cmd;
+ // cerr << "executing: " << cmd;
vector<const char*> argv(args.size()+2);
argv[0]=cmd.c_str();
int an = 1;
for(list<string>::const_iterator i=args.begin();i!=args.end();i++) {
- cerr << " " << *i ;
+ // cerr << " " << *i ;
argv[an++] = i->c_str();
}
- cerr << endl;
+ // cerr << endl;
argv[an++]=NULL;
pid_t pid = vfork();
if(pid==-1) {