aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/module.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-23 16:49:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-23 16:49:09 +0200
commit8793941652d6aa1c3d02b2f87f691e6d06254b7d (patch)
treea76b70f6b47d2a7441d22aa236549a02dc493ad0 /libbuild2/module.cxx
parent739f68b9e45c925ccc5a28b9b796030272575e2b (diff)
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.
Diffstat (limited to 'libbuild2/module.cxx')
-rw-r--r--libbuild2/module.cxx23
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;
}