1 |
From: Daniel Cordero <catalyst@××××.io> |
2 |
|
3 |
On amd64 (17.1), distcc does not create /usr/lib64/distcc, despite get_libdir |
4 |
returning 'lib64'. |
5 |
|
6 |
Signed-off-by: Daniel Cordero <catalyst@××××.io> |
7 |
--- |
8 |
targets/support/chroot-functions.sh | 28 ++++++++++++++++------------ |
9 |
1 file changed, 16 insertions(+), 12 deletions(-) |
10 |
|
11 |
diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh |
12 |
index 2aec018e..0c77ac75 100755 |
13 |
--- a/targets/support/chroot-functions.sh |
14 |
+++ b/targets/support/chroot-functions.sh |
15 |
@@ -86,12 +86,14 @@ setup_features() { |
16 |
# This sets up automatic cross-distcc-fu according to |
17 |
# https://wiki.gentoo.org/wiki/Distcc/Cross-Compiling |
18 |
CHOST=$(portageq envvar CHOST) |
19 |
- LIBDIR=$(get_libdir) |
20 |
- cd /usr/${LIBDIR}/distcc/bin |
21 |
- rm cc gcc g++ c++ 2>/dev/null |
22 |
- echo -e '#!/bin/bash\nexec /usr/'${LIBDIR}'/distcc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper |
23 |
- chmod a+x /usr/${LIBDIR}/distcc/bin/${CHOST}-wrapper |
24 |
- for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done |
25 |
+ for LIBDIR in lib $(get_libdir); do |
26 |
+ test -d /usr/${LIBDIR}/distcc/bin || continue |
27 |
+ cd /usr/${LIBDIR}/distcc/bin |
28 |
+ rm cc gcc g++ c++ 2>/dev/null |
29 |
+ echo -e '#!/bin/bash\nexec /usr/'${LIBDIR}'/distcc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper |
30 |
+ chmod a+x /usr/${LIBDIR}/distcc/bin/${CHOST}-wrapper |
31 |
+ for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done |
32 |
+ done |
33 |
fi |
34 |
|
35 |
if [ -n "${clst_ICECREAM}" ] |
36 |
@@ -174,13 +176,15 @@ setup_gcc(){ |
37 |
} |
38 |
|
39 |
cleanup_distcc() { |
40 |
- LIBDIR=$(get_libdir) |
41 |
- rm -rf /etc/distcc/hosts |
42 |
- for i in cc gcc c++ g++; do |
43 |
- rm -f /usr/${LIBDIR}/distcc/bin/${i} |
44 |
- ln -s /usr/bin/distcc /usr/${LIBDIR}/distcc/bin/${i} |
45 |
+ rm -f /etc/distcc/hosts |
46 |
+ for LIBDIR in lib $(get_libdir); do |
47 |
+ test -d /usr/${LIBDIR}/distcc/bin || continue |
48 |
+ for i in cc gcc c++ g++; do |
49 |
+ rm -f /usr/${LIBDIR}/distcc/bin/${i} |
50 |
+ ln -s /usr/bin/distcc /usr/${LIBDIR}/distcc/bin/${i} |
51 |
+ done |
52 |
+ rm -f /usr/${LIBDIR}/distcc/bin/*-wrapper |
53 |
done |
54 |
- rm -f /usr/${LIBDIR}/distcc/bin/*-wrapper |
55 |
} |
56 |
|
57 |
cleanup_icecream() { |
58 |
-- |
59 |
2.26.2 |