diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-12-10 13:54:59 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-12-10 13:54:59 +0200 |
commit | 0d0d9a9c56822919e9794658d31db57f8fc3e2bf (patch) | |
tree | 6dcb1649706dc7fc3f02cd5646b4611b3309fbd1 /build/install | |
parent | 5f29fc16fb85a934280e00e54bc6307685c4e05d (diff) |
Implement two-phase initialization of modules loaded from bootstrap.build
Diffstat (limited to 'build/install')
-rw-r--r-- | build/install/module | 3 | ||||
-rw-r--r-- | build/install/module.cxx | 19 |
2 files changed, 15 insertions, 7 deletions
diff --git a/build/install/module b/build/install/module index 78004ef..7a814c8 100644 --- a/build/install/module +++ b/build/install/module @@ -14,6 +14,9 @@ namespace build { namespace install { + extern "C" void + install_boot (scope&, const location&, unique_ptr<module>&); + extern "C" bool install_init ( scope&, scope&, const location&, unique_ptr<module>&, bool, bool); diff --git a/build/install/module.cxx b/build/install/module.cxx index f8f7d73..204bddd 100644 --- a/build/install/module.cxx +++ b/build/install/module.cxx @@ -99,6 +99,18 @@ namespace build static alias_rule alias_; static file_rule file_; + extern "C" void + install_boot (scope& r, const location&, unique_ptr<module>&) + { + tracer trace ("install::boot"); + + level5 ([&]{trace << "for " << r.out_path ();}); + + // Register the install operation. + // + r.operations.insert (install_id, install); + } + extern "C" bool install_init (scope& r, scope& b, @@ -109,9 +121,6 @@ namespace build { tracer trace ("install::init"); - if (&r != &b) - fail (l) << "install module must be initialized in bootstrap.build"; - if (!first) { warn (l) << "multiple install module initializations"; @@ -132,10 +141,6 @@ namespace build v.find ("install", dir_path_type); } - // Register the install operation. - // - r.operations.insert (install_id, install); - // Register our alias and file installer rule. // b.rules.insert<alias> (perform_install_id, "install.alias", alias_); |