aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/buildfile
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-11-04 15:11:01 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-11-04 15:16:13 +0200
commit56b860217eb00827ba15fc975f71008080af9b65 (patch)
tree882f39a7c228923363162eb17b6f1ac2db38adb4 /libbuild2/buildfile
parentb39ce46b80ef5cccc592398e0a74ba8d02742ead (diff)
Add support for ~host special configuration name in config.import
This is the "default host configuration" that corresponds to how the build system itself was built. For example: $ b create: tools/,cc config.import=~host
Diffstat (limited to 'libbuild2/buildfile')
-rw-r--r--libbuild2/buildfile25
1 files changed, 22 insertions, 3 deletions
diff --git a/libbuild2/buildfile b/libbuild2/buildfile
index 865bb91..325d54a 100644
--- a/libbuild2/buildfile
+++ b/libbuild2/buildfile
@@ -32,10 +32,29 @@ lib{build2}: cxx{utility-uninstalled}: for_install = false
# NOTE: remember to update import_modules() in libbuild2/modules.cxx if adding
# a new such module.
#
-for m: config dist install test
- libul{build2}: $m/{hxx ixx txx cxx}{** -**-options -**.test...}
+libul{build2}: config/{hxx ixx txx cxx}{** -host-config -**.test...} \
+ config/cxx{host-config}
-libul{build2}: test/script/{hxx ixx cxx}{builtin-options}
+# This will of course blow up spectacularly if we are cross-compiling. But
+# let's wait and enjoy the fireworks (and get a sense of why would someone
+# need to cross-compile a build system).
+#
+newline = '
+'
+config/cxx{host-config}: config/in{host-config}
+{
+ # Remove comment lines which could be confused by some lesser compilers with
+ # preprocessor directives.
+ #
+ host_config = $regex.replace($config.export(), "#.*$newline", '')
+}
+
+libul{build2}: dist/{hxx ixx txx cxx}{** -**.test...}
+
+libul{build2}: install/{hxx ixx txx cxx}{** -**.test...}
+
+libul{build2}: test/{hxx ixx txx cxx}{** -**-options -**.test...} \
+ test/script/{hxx ixx cxx}{builtin-options}
libul{build2}: $int_libs