From 56b860217eb00827ba15fc975f71008080af9b65 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 4 Nov 2019 15:11:01 +0200 Subject: 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 --- libbuild2/buildfile | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'libbuild2/buildfile') 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 -- cgit v1.1