From 6761f241ce749e69346ffab9126f069b31fa44f8 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Thu, 11 Oct 2007 23:39:52 +0000 Subject: [PATCH] Adding a slightly modified version of Andrew Gaffney's patch from bug #120076 to add cross-compiling support to our distcc configuration. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1248 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 6 ++++++ targets/support/chroot-functions.sh | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index 746179c4..b1f3f076 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,12 @@ # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 # $Id: $ + 11 Oct 2007; Chris Gianelloni + targets/support/chroot-functions.sh: + Adding a slightly modified version of Andrew Gaffney's + patch from bug #120076 to add cross-compiling support to our distcc + configuration. + 11 Oct 2007; Chris Gianelloni targets/support/chroot-functions.sh: Added a version of get_libdir from multilib.eclass so we can determine where diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh index 224ef0b6..ee2097a3 100755 --- a/targets/support/chroot-functions.sh +++ b/targets/support/chroot-functions.sh @@ -88,6 +88,16 @@ setup_myfeatures(){ #fi mkdir -p /etc/distcc echo "${clst_distcc_hosts}" > /etc/distcc/hosts + + # This sets up automatic cross-distcc-fu according to + # http://www.gentoo.org/doc/en/cross-compiling-distcc.xml + CHOST=$(portageq envvar CHOST) + # TODO: change to use get_libdir + cd /usr/lib/distcc/bin + rm cc gcc g++ c++ 2>/dev/null + echo -e '#!/bin/bash\nexec /usr/lib/distcc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper + chmod a+x /usr/lib/distcc/bin/${CHOST}-wrapper + for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done fi } @@ -148,6 +158,12 @@ setup_binutils(){ cleanup_distcc() { rm -rf /etc/distcc/hosts + for i in cc gcc c++ g++; do + # TODO: change to use get_libdir + rm /usr/lib/distcc/bin/${i} + ln -s /usr/bin/distcc /usr/lib/distcc/bin/${i} + done + rm /usr/lib/distcc/bin/*-wrapper } update_env_settings(){ -- 2.26.2