commit:     8e9c05ddfcd74be3b53c7c4c2fbc799a9ab7fa61
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 14 00:39:07 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun 15 21:47:19 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e9c05dd

llvm.eclass: export LLVM_CONFIG if not cross-compiling

Set LLVM_CONFIG to help Meson (bug #907965) but only do it for empty ESYSROOT
(as a proxy for "are we cross-compiling?").

Closes: https://bugs.gentoo.org/907965
Signed-off-by: Sam James <sam <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/31429
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/llvm.eclass | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/eclass/llvm.eclass b/eclass/llvm.eclass
index 022820d012d5..223e2a15baf4 100644
--- a/eclass/llvm.eclass
+++ b/eclass/llvm.eclass
@@ -250,6 +250,12 @@ llvm_pkg_setup() {
                llvm_fix_tool_path ADDR2LINE AR AS LD NM OBJCOPY OBJDUMP RANLIB
                llvm_fix_tool_path READELF STRINGS STRIP
 
+               # Set LLVM_CONFIG to help Meson (bug #907965) but only do it
+               # for empty ESYSROOT (as a proxy for "are we cross-compiling?").
+               if [[ -z ${ESYSROOT} ]] ; then
+                       llvm_fix_tool_path LLVM_CONFIG
+               fi
+
                local prefix=${ESYSROOT}
                local llvm_path=${prefix}/usr/lib/llvm/${LLVM_SLOT}/bin
                local IFS=:

Reply via email to