aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-06-12 07:51:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-06-12 07:51:42 +0200
commit9d5322d6a1220e91a1a4eabda08066bf60fa967e (patch)
treeb49ab123a1c261302aa459df7f0a67d82b7e8f97
parentbebdfc468e7808704f724e58eaca0c994595dcde (diff)
Make order of imports stable in saved host build configuration
-rw-r--r--build/root.build6
-rw-r--r--build2/buildfile4
-rw-r--r--libbuild2/bash/buildfile2
-rw-r--r--libbuild2/bin/buildfile2
-rw-r--r--libbuild2/buildfile4
-rw-r--r--libbuild2/c/buildfile2
-rw-r--r--libbuild2/cc/buildfile2
-rw-r--r--libbuild2/config/module.hxx8
-rw-r--r--libbuild2/cxx/buildfile2
-rw-r--r--libbuild2/in/buildfile2
-rw-r--r--libbuild2/version/buildfile2
11 files changed, 30 insertions, 6 deletions
diff --git a/build/root.build b/build/root.build
index 5a5e961..5371419 100644
--- a/build/root.build
+++ b/build/root.build
@@ -29,6 +29,12 @@ cxx.poptions =+ "-I$out_root" "-I$src_root"
#
using c.config
+# Imports for build2/ (or any subdirectory other than libbuild2/) should be
+# done here in order to get stable order in the host build configuration that
+# we embed into libbuild2.
+#
+import libbutl = libbutl%lib{butl}
+
# Load the cli module but only if it's available. This way a distribution
# that includes pre-generated files can be built without installing cli.
# This is also the reason why we need to explicitly spell out individual
diff --git a/build2/buildfile b/build2/buildfile
index 549016c..3be724c 100644
--- a/build2/buildfile
+++ b/build2/buildfile
@@ -1,7 +1,9 @@
# file : build2/buildfile
# license : MIT; see accompanying LICENSE file
-import libs = libbutl%lib{butl}
+# NOTE: imports should go into root.build.
+#
+libs = $libbutl
include ../libbuild2/
libs += ../libbuild2/lib{build2}
diff --git a/libbuild2/bash/buildfile b/libbuild2/bash/buildfile
index 63356b7..2fd49ec 100644
--- a/libbuild2/bash/buildfile
+++ b/libbuild2/bash/buildfile
@@ -1,6 +1,8 @@
# file : libbuild2/bash/buildfile
# license : MIT; see accompanying LICENSE file
+# NOTE: shared imports should go into root.build.
+#
include ../
imp_libs = ../lib{build2} # Implied interface dependency.
diff --git a/libbuild2/bin/buildfile b/libbuild2/bin/buildfile
index 8b4d115..0df78e6 100644
--- a/libbuild2/bin/buildfile
+++ b/libbuild2/bin/buildfile
@@ -1,6 +1,8 @@
# file : libbuild2/bin/buildfile
# license : MIT; see accompanying LICENSE file
+# NOTE: shared imports should go into root.build.
+#
include ../
imp_libs = ../lib{build2} # Implied interface dependency.
diff --git a/libbuild2/buildfile b/libbuild2/buildfile
index 5f7bc11..29a559c 100644
--- a/libbuild2/buildfile
+++ b/libbuild2/buildfile
@@ -20,8 +20,10 @@ include $bundled_modules
# explicitly. A module should also assume that lib{butl} will always be an
# interface dependency of lib{build2} and therefore need not be explicitly
# imported or linked.
+
+# NOTE: shared imports should go into root.build.
#
-import int_libs = libbutl%lib{butl}
+int_libs = $libbutl
lib{build2}: libul{build2}: \
{hxx ixx txx cxx}{* -utility-*installed -config -version -*.test...} \
diff --git a/libbuild2/c/buildfile b/libbuild2/c/buildfile
index 3c069dc..fa23648 100644
--- a/libbuild2/c/buildfile
+++ b/libbuild2/c/buildfile
@@ -1,6 +1,8 @@
# file : libbuild2/c/buildfile
# license : MIT; see accompanying LICENSE file
+# NOTE: shared imports should go into root.build.
+#
include ../
imp_libs = ../lib{build2} # Implied interface dependency.
diff --git a/libbuild2/cc/buildfile b/libbuild2/cc/buildfile
index 6b18eb7..fc8809d 100644
--- a/libbuild2/cc/buildfile
+++ b/libbuild2/cc/buildfile
@@ -1,6 +1,8 @@
# file : libbuild2/cc/buildfile
# license : MIT; see accompanying LICENSE file
+# NOTE: shared imports should go into root.build.
+#
include ../
imp_libs = ../lib{build2} # Implied interface dependency.
diff --git a/libbuild2/config/module.hxx b/libbuild2/config/module.hxx
index ade75cd..5cb4faa 100644
--- a/libbuild2/config/module.hxx
+++ b/libbuild2/config/module.hxx
@@ -20,10 +20,10 @@ namespace build2
namespace config
{
// An ordered list of build system modules each with an ordered list of
- // list of config.* variables and their "save flags" (see save_variable())
- // that are used (as opposed to just being specified) in this
- // configuration. Populated by the config utility functions (required(),
- // optional()) and saved in the order populated.
+ // config.* variables and their "save flags" (see save_variable()) that
+ // are used (as opposed to just being specified) in this configuration.
+ // Populated by the config utility functions (required(), optional()) and
+ // saved in the order populated.
//
struct saved_variable
{
diff --git a/libbuild2/cxx/buildfile b/libbuild2/cxx/buildfile
index 429027a..a95da97 100644
--- a/libbuild2/cxx/buildfile
+++ b/libbuild2/cxx/buildfile
@@ -1,6 +1,8 @@
# file : libbuild2/cxx/buildfile
# license : MIT; see accompanying LICENSE file
+# NOTE: shared imports should go into root.build.
+#
include ../
imp_libs = ../lib{build2} # Implied interface dependency.
diff --git a/libbuild2/in/buildfile b/libbuild2/in/buildfile
index b9d51d6..f396e31 100644
--- a/libbuild2/in/buildfile
+++ b/libbuild2/in/buildfile
@@ -1,6 +1,8 @@
# file : libbuild2/in/buildfile
# license : MIT; see accompanying LICENSE file
+# NOTE: shared imports should go into root.build.
+#
include ../
imp_libs = ../lib{build2} # Implied interface dependency.
diff --git a/libbuild2/version/buildfile b/libbuild2/version/buildfile
index 9fd1eef..b991f73 100644
--- a/libbuild2/version/buildfile
+++ b/libbuild2/version/buildfile
@@ -1,6 +1,8 @@
# file : libbuild2/version/buildfile
# license : MIT; see accompanying LICENSE file
+# NOTE: shared imports should go into root.build.
+#
include ../
imp_libs = ../lib{build2} # Implied interface dependency.