From 0d0d9a9c56822919e9794658d31db57f8fc3e2bf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 10 Dec 2015 13:54:59 +0200 Subject: Implement two-phase initialization of modules loaded from bootstrap.build --- build/install/module | 3 +++ build/install/module.cxx | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'build/install') 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&); + extern "C" bool install_init ( scope&, scope&, const location&, unique_ptr&, 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&) + { + 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 (perform_install_id, "install.alias", alias_); -- cgit v1.1