From 8793941652d6aa1c3d02b2f87f691e6d06254b7d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 23 Aug 2019 16:49:09 +0200 Subject: Disable dynamic build system module loading in bootstrap build We don't really need it so why jump through hoops like trying to portably link -ldl, etc. --- libbuild2/module.cxx | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'libbuild2/module.cxx') 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 -#ifndef _WIN32 -# include -#else -# include +#ifndef BUILD2_BOOTSTRAP +# ifndef _WIN32 +# include +# else +# include +# endif #endif #include // 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; } -- cgit v1.1