diff options
Diffstat (limited to 'libbuild2/module.cxx')
-rw-r--r-- | libbuild2/module.cxx | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/libbuild2/module.cxx b/libbuild2/module.cxx index 1feb121..b06b030 100644 --- a/libbuild2/module.cxx +++ b/libbuild2/module.cxx @@ -4,10 +4,12 @@ #include <libbuild2/module.hxx> -#ifndef _WIN32 -# include <dlfcn.h> -#else -# include <libbutl/win32-utility.hxx> +#ifndef BUILD2_BOOTSTRAP +# ifndef _WIN32 +# include <dlfcn.h> +# else +# include <libbutl/win32-utility.hxx> +# endif #endif #include <libbuild2/file.hxx> // import() @@ -76,6 +78,15 @@ namespace build2 << "supported"; } + module_load_function* r (nullptr); + + // No dynamic loading of build system modules during bootstrap. + // +#ifdef BUILD2_BOOTSTRAP + if (!opt) + fail (loc) << "unknown build system module " << mod << + info << "running bootstrap build system"; +#else path lib; #if 0 @@ -133,8 +144,6 @@ namespace build2 // Note that we don't unload our modules since it's not clear what would // the benefit be. // - module_load_function* r (nullptr); - #ifndef _WIN32 // Use RTLD_NOW instead of RTLD_LAZY to both speed things up (we are going // to use this module now) and to detect any symbol mismatches. @@ -167,6 +176,8 @@ namespace build2 << " (" << lib << "): " << win32::last_error_msg (); #endif +#endif // BUILD2_BOOTSTRAP + return r; } |