From fc3edfcd1cc277a3457c0d17041f74452b4d3465 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Mon, 26 Dec 2022 10:14:34 +0000 Subject: Read LIBDIR with portageq from EROOT instead of hardcoding the / value We fall back to the hardcoded / value if that fails. Signed-off-by: James Le Cuirot Closes: https://github.com/gentoo/gcc-config/pull/1 Signed-off-by: Sam James --- gcc-config | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc-config b/gcc-config index 236c433..a44fced 100755 --- a/gcc-config +++ b/gcc-config @@ -41,7 +41,10 @@ fi PV="@PV@" [[ ${PV} == @*@ ]] && PV="git" -GENTOO_LIBDIR="@GENTOO_LIBDIR@" + +ABI=$(portageq envvar DEFAULT_ABI 2>/dev/null) +GENTOO_LIBDIR=$(portageq envvar LIBDIR_"${ABI}" 2>/dev/null) +[[ $? != 0 || -z ${GENTOO_LIBDIR} ]] && GENTOO_LIBDIR="@GENTOO_LIBDIR@" [[ ${GENTOO_LIBDIR} == @*@ ]] && GENTOO_LIBDIR="lib" usage() { -- cgit v1.2.3-65-gdbad