aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2022-12-26 10:14:34 +0000
committerSam James <sam@gentoo.org>2022-12-28 19:11:59 +0000
commitfc3edfcd1cc277a3457c0d17041f74452b4d3465 (patch)
treeb4a897372ecbcfdb6dc943b7caa99ede9da6826b /gcc-config
parentRead CHOST with portageq from EROOT and not / (diff)
downloadgcc-config-fc3edfcd1cc277a3457c0d17041f74452b4d3465.tar.gz
gcc-config-fc3edfcd1cc277a3457c0d17041f74452b4d3465.tar.bz2
gcc-config-fc3edfcd1cc277a3457c0d17041f74452b4d3465.zip
Read LIBDIR with portageq from EROOT instead of hardcoding the / valuev2.9
We fall back to the hardcoded / value if that fails. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Closes: https://github.com/gentoo/gcc-config/pull/1 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'gcc-config')
-rwxr-xr-xgcc-config5
1 files changed, 4 insertions, 1 deletions
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() {