From 7197d069cb82286f9789a8ce987fe5f0f5b6f05d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 10 Jan 2024 12:02:13 +0200 Subject: Add ability to specify alternative sysroot for pkg-config files (GC issue #59) Specifically, the new config.cc.pkgconfig.sysroot variable provides roughly equivalent functionality to PKG_CONFIG_SYSROOT_DIR in pkg-config. For details and limitations, see "Rewriting Installed Libraries System Root (sysroot)" in the manual for details. --- libbuild2/cc/init.cxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'libbuild2/cc/init.cxx') diff --git a/libbuild2/cc/init.cxx b/libbuild2/cc/init.cxx index d766b30..1bddbb2 100644 --- a/libbuild2/cc/init.cxx +++ b/libbuild2/cc/init.cxx @@ -100,13 +100,19 @@ namespace build2 vp.insert ("config.cc.loptions"); vp.insert ("config.cc.aoptions"); vp.insert ("config.cc.libs"); - vp.insert ("config.cc.internal.scope"); + + vp.insert ("config.cc.internal.scope"); + + vp.insert ("config.cc.reprocess"); // See cc.preprocess below. + + vp.insert ("config.cc.pkgconfig.sysroot"); vp.insert ("cc.poptions"); vp.insert ("cc.coptions"); vp.insert ("cc.loptions"); vp.insert ("cc.aoptions"); vp.insert ("cc.libs"); + vp.insert ("cc.internal.scope"); vp.insert ("cc.internal.libs"); @@ -177,7 +183,6 @@ namespace build2 // Ability to disable using preprocessed output for compilation. // - vp.insert ("config.cc.reprocess"); vp.insert ("cc.reprocess"); // Register scope operation callback. @@ -337,6 +342,15 @@ namespace build2 if (lookup l = lookup_config (rs, "config.cc.reprocess")) rs.assign ("cc.reprocess") = *l; + // config.cc.pkgconfig.sysroot + // + // Let's look it up instead of just marking for saving to make sure the + // path is valid. + // + // Note: save omitted. + // + lookup_config (rs, "config.cc.pkgconfig.sysroot"); + // Load the bin.config module. // if (!cast_false (rs["bin.config.loaded"])) -- cgit v1.1