Adding a slightly modified version of Andrew Gaffney's <agaffney@gentoo.org> patch...
authorChris Gianelloni <wolf31o2@gentoo.org>
Thu, 11 Oct 2007 23:39:52 +0000 (23:39 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Thu, 11 Oct 2007 23:39:52 +0000 (23:39 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1248 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
targets/support/chroot-functions.sh

index 746179c45ed446d199d0f5915348a93c0a7a9774..b1f3f0765d3e3fbdc4160de73b14ea9a5fce779a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
 # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
 # $Id: $
 
+  11 Oct 2007; Chris Gianelloni <wolf31o2@gentoo.org>
+  targets/support/chroot-functions.sh:
+  Adding a slightly modified version of Andrew Gaffney's <agaffney@gentoo.org>
+  patch from bug #120076 to add cross-compiling support to our distcc
+  configuration.
+
   11 Oct 2007; Chris Gianelloni <wolf31o2@gentoo.org>
   targets/support/chroot-functions.sh:
   Added a version of get_libdir from multilib.eclass so we can determine where
index 224ef0b691d9ff9e1e3067aad5e216d68a824d22..ee2097a356c5105d9b2c4f778dd142c23897668d 100755 (executable)
@@ -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(){