aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/buildfile
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-04-02 12:49:10 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-04-02 12:49:10 +0200
commit0fb42229a5bf13170667701ad6cb468d58348007 (patch)
treed56760707760af718decb319ea17f91d1e98e51a /libbuild2/buildfile
parent3d08bfb688cf08fb805c9431d43e65d58dcb8669 (diff)
Fix ~host config to only contain cc and bin modules configuration
Also add ~build2 that contains everything (except config.dist.*) to be used for build system modules.
Diffstat (limited to 'libbuild2/buildfile')
-rw-r--r--libbuild2/buildfile30
1 files changed, 20 insertions, 10 deletions
diff --git a/libbuild2/buildfile b/libbuild2/buildfile
index a253ab1..578a4c8 100644
--- a/libbuild2/buildfile
+++ b/libbuild2/buildfile
@@ -45,21 +45,31 @@ libul{build2}: config/{hxx ixx txx cxx}{** -host-config -**.test...} \
config/cxx{host-config}
# 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).
+# let's wait and enjoy the fireworks (and get a sense of why someone would
+# want to cross-compile a build system).
#
config/cxx{host-config}: config/in{host-config}
{
- # Remove comment lines which could be confused with preprocessor directives
- # by some lesser compilers.
+ # For the ~host configuration we only want c/cxx/cc and bin that they load.
+ # For ~build2 we want to keep everything except dist.
#
- # Also filter out config.install.chroot -- we definitely don't want it
- # carried through.
+ # We also remove comment lines which could be confused with preprocessor
+ # directives by some lesser compilers.
#
- host_config = $regex.replace_lines($config.save(), \
- '^ *(#|config.install.chroot).*$', \
- [null], \
- return_lines)
+ # For ~build2 also filter out config.install.chroot -- we definitely don't
+ # want it carried through.
+ #
+ build2_config = $regex.replace_lines( \
+ $config.save(), \
+ '^ *(#|config\.dist\.|config\.install\.chroot).*$', \
+ [null], \
+ return_lines)
+
+ host_config = $regex.replace_lines( \
+ $build2_config, \
+ '^ *config\.(c[. ]|cxx[. ]|cc[.]|bin[.]).*$', \
+ '$&', \
+ format_no_copy return_lines)
}
libul{build2}: dist/{hxx ixx txx cxx}{** -**.test...}