public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: Daniel Cordero <gentoo.catalyst@xxoo.ws>
To: gentoo-catalyst@lists.gentoo.org
Subject: [gentoo-catalyst] [PATCH] distcc: try more combinations of libdir
Date: Thu,  4 Feb 2021 11:07:21 +0000	[thread overview]
Message-ID: <20210204110721.33846-4-gentoo.catalyst@xxoo.ws> (raw)

From: Daniel Cordero <catalyst@0xdc.io>

On amd64 (17.1), distcc does not create /usr/lib64/distcc, despite get_libdir
returning 'lib64'.

Signed-off-by: Daniel Cordero <catalyst@0xdc.io>
---
 targets/support/chroot-functions.sh | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh
index 2aec018e..0c77ac75 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -86,12 +86,14 @@ setup_features() {
 		# This sets up automatic cross-distcc-fu according to
 		# https://wiki.gentoo.org/wiki/Distcc/Cross-Compiling
 		CHOST=$(portageq envvar CHOST)
-		LIBDIR=$(get_libdir)
-		cd /usr/${LIBDIR}/distcc/bin
-		rm cc gcc g++ c++ 2>/dev/null
-		echo -e '#!/bin/bash\nexec /usr/'${LIBDIR}'/distcc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper
-		chmod a+x /usr/${LIBDIR}/distcc/bin/${CHOST}-wrapper
-		for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done
+		for LIBDIR in lib $(get_libdir); do
+			test -d /usr/${LIBDIR}/distcc/bin || continue
+			cd /usr/${LIBDIR}/distcc/bin
+			rm cc gcc g++ c++ 2>/dev/null
+			echo -e '#!/bin/bash\nexec /usr/'${LIBDIR}'/distcc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper
+			chmod a+x /usr/${LIBDIR}/distcc/bin/${CHOST}-wrapper
+			for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done
+		done
 	fi
 
 	if [ -n "${clst_ICECREAM}" ]
@@ -174,13 +176,15 @@ setup_gcc(){
 }
 
 cleanup_distcc() {
-	LIBDIR=$(get_libdir)
-	rm -rf /etc/distcc/hosts
-	for i in cc gcc c++ g++; do
-		rm -f /usr/${LIBDIR}/distcc/bin/${i}
-		ln -s /usr/bin/distcc /usr/${LIBDIR}/distcc/bin/${i}
+	rm -f /etc/distcc/hosts
+	for LIBDIR in lib $(get_libdir); do
+		test -d /usr/${LIBDIR}/distcc/bin || continue
+		for i in cc gcc c++ g++; do
+			rm -f /usr/${LIBDIR}/distcc/bin/${i}
+			ln -s /usr/bin/distcc /usr/${LIBDIR}/distcc/bin/${i}
+		done
+		rm -f /usr/${LIBDIR}/distcc/bin/*-wrapper
 	done
-	rm -f /usr/${LIBDIR}/distcc/bin/*-wrapper
 }
 
 cleanup_icecream() {
-- 
2.26.2



             reply	other threads:[~2021-02-04 11:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-04 11:07 Daniel Cordero [this message]
2021-02-21  2:05 ` [gentoo-catalyst] [PATCH] distcc: try more combinations of libdir Matt Turner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210204110721.33846-4-gentoo.catalyst@xxoo.ws \
    --to=gentoo.catalyst@xxoo.ws \
    --cc=gentoo-catalyst@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox