commit:     91978cc8887eec401380546bcb9c31737247ac92
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Fri May  9 17:16:15 2025 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Thu Jun  5 11:06:59 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91978cc8

waf-utils.eclass: Use a sysroot wrapper script when appropriate

waf supports executing binaries via a wrapper for cross-compiling.

I have used this to cross-compile Samba and its waf-based dependencies.

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 eclass/waf-utils.eclass | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
index 377b455de736..ac3b3534169d 100644
--- a/eclass/waf-utils.eclass
+++ b/eclass/waf-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: waf-utils.eclass
@@ -23,7 +23,7 @@ esac
 if [[ -z ${_WAF_UTILS_ECLASS} ]]; then
 _WAF_UTILS_ECLASS=1
 
-inherit multilib toolchain-funcs multiprocessing
+inherit multilib sysroot toolchain-funcs multiprocessing
 
 # @ECLASS_VARIABLE: WAF_VERBOSE
 # @USER_VARIABLE
@@ -95,6 +95,11 @@ waf-utils_src_configure() {
                conf_args+=( --mandir="${EPREFIX}"/usr/share/man )
        fi
 
+       local sysroot_run_prefixed
+       if sysroot_run_prefixed=$(sysroot_make_run_prefixed); then
+               conf_args+=( --cross-compile 
--cross-execute="${sysroot_run_prefixed}" )
+       fi
+
        tc-export AR CC CPP CXX RANLIB
 
        local CMD=(

Reply via email to