aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbuild2/buildfile17
-rw-r--r--libbuild2/context.cxx4
-rw-r--r--libbuild2/utility-installed.cxx10
-rw-r--r--libbuild2/utility-uninstalled.cxx10
-rw-r--r--libbuild2/utility.cxx2
-rw-r--r--libbuild2/utility.hxx2
6 files changed, 21 insertions, 24 deletions
diff --git a/libbuild2/buildfile b/libbuild2/buildfile
index c496c52..3ad2f9b 100644
--- a/libbuild2/buildfile
+++ b/libbuild2/buildfile
@@ -9,19 +9,15 @@
import int_libs = libbutl%lib{butl}
-# Note that this won't work on libul{} since it's never installed.
-#
-lib{build2}: cxx{utility-installed}: for_install = true
-
-# @@ TMP
-#liba{build2}: bin.whole = true # See utility-installed.cxx.
-
-# Keep dependency on libul{build2} after cxx{utility-installed}.
-#
lib{build2}: libul{build2}: \
- {hxx ixx txx cxx}{* -utility-installed -config -version -*.test...} \
+ {hxx ixx txx cxx}{* -utility-*installed -config -version -*.test...} \
{hxx}{config version}
+# Note that this won't work in libul{} since it's not installed.
+#
+lib{build2}: cxx{utility-installed}: for_install = true
+lib{build2}: cxx{utility-uninstalled}: for_install = false
+
# These are "core modules" that come bundled with libbuild2 (see also unit
# tests loop below). Note that the build system core can still function
# without them or with their alternative implementations.
@@ -69,6 +65,7 @@ for t: cxx{ *.test...} \
./: $d/exe{$n}: $t $d/{hxx ixx txx}{+$n} $d/testscript{+$n +$b+*.test...}
$d/exe{$n}: libul{build2}: bin.whole = false
+ $d/exe{$n}: cxx{utility-uninstalled}
}
# Build options.
diff --git a/libbuild2/context.cxx b/libbuild2/context.cxx
index f310426..cc0eb0b 100644
--- a/libbuild2/context.cxx
+++ b/libbuild2/context.cxx
@@ -133,10 +133,12 @@ namespace build2
//
var_import_build2 = &vp.insert<abs_dir_path> ("import.build2");
-#ifdef BUILD2_IMPORT_PATH
if (!build_installed)
+ {
+#ifdef BUILD2_IMPORT_PATH
gs.assign (var_import_build2) = abs_dir_path (BUILD2_IMPORT_PATH);
#endif
+ }
// Build system verbosity level.
//
diff --git a/libbuild2/utility-installed.cxx b/libbuild2/utility-installed.cxx
index 8fcb271..5ef8811 100644
--- a/libbuild2/utility-installed.cxx
+++ b/libbuild2/utility-installed.cxx
@@ -10,15 +10,7 @@
namespace build2
{
- struct build_installed_init
- {
- build_installed_init ()
- {
- build_installed = true;
- }
- };
-
- static build_installed_init init_;
+ bool build_installed = true;
}
#endif
diff --git a/libbuild2/utility-uninstalled.cxx b/libbuild2/utility-uninstalled.cxx
new file mode 100644
index 0000000..b4bbe93
--- /dev/null
+++ b/libbuild2/utility-uninstalled.cxx
@@ -0,0 +1,10 @@
+// file : libbuild2/utility-uninstalled.cxx -*- C++ -*-
+// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#include <libbuild2/utility.hxx>
+
+namespace build2
+{
+ bool build_installed = false;
+}
diff --git a/libbuild2/utility.cxx b/libbuild2/utility.cxx
index 4f6874e..ba50c5a 100644
--- a/libbuild2/utility.cxx
+++ b/libbuild2/utility.cxx
@@ -81,8 +81,6 @@ namespace build2
: (to_string (build_version.major ()) + '.' +
to_string (build_version.minor ())));
- bool build_installed;
-
optional<bool> mtime_check_option;
optional<path> config_sub;
diff --git a/libbuild2/utility.hxx b/libbuild2/utility.hxx
index d9c530b..e4b5bcb 100644
--- a/libbuild2/utility.hxx
+++ b/libbuild2/utility.hxx
@@ -144,8 +144,6 @@ namespace build2
// Whether running installed build.
//
- // Note: only available after static initialization.
- //
LIBBUILD2_SYMEXPORT extern bool build_installed;
// --[no-]mtime-check