I propose to add a IUSE flag to enable installation of a wrapper script, for example: USE="wrappers" emerge distcc This would install a %%ARCH%%-wrapper into /usr/lib/distcc/bin and symlink %%ARCH%%-wrapper to c++ g++ gcc cc The wrapper would contain: #!/bin/bash exec /usr/lib/distcc/bin/%%ARCH%%-g${0:$[-2]} "$@" For example ARCH = sparc-unknown-linux-gnu would give us: # ls -la total 16 drwxr-xr-x 3 root root 4096 Nov 22 12:19 . drwxr-xr-x 3 root root 4096 Oct 24 21:42 .. lrwxrwxrwx 1 root root 31 Oct 24 21:46 c++ -> sparc-unknown-linux-gnu-wrapper lrwxrwxrwx 1 root root 31 Oct 24 21:46 cc -> sparc-unknown-linux-gnu-wrapper lrwxrwxrwx 1 root root 31 Oct 24 21:46 g++ -> sparc-unknown-linux-gnu-wrapper lrwxrwxrwx 1 root root 31 Oct 24 21:46 gcc -> sparc-unknown-linux-gnu-wrapper lrwxrwxrwx 1 root root 15 Oct 24 21:46 sparc-unknown-linux-gnu-c++ -> /usr/bin/distcc lrwxrwxrwx 1 root root 15 Oct 24 21:46 sparc-unknown-linux-gnu-g++ -> /usr/bin/distcc lrwxrwxrwx 1 root root 15 Oct 24 21:46 sparc-unknown-linux-gnu-gcc -> /usr/bin/distcc -rwxr-xr-x 1 root root 78 Oct 24 21:45 sparc-unknown-linux-gnu-wrapper Why? I am fed up with having to recreate all this each time distcc gets re-emerged. I will shortly put together an ebuild for this.
OK, the ebuild and the wrapper are now cooked. Attachments added.
Created attachment 255117 [details] distcc ebuild
Created attachment 255119 [details] wrapper script, sed in ebuild changes it with the TARGET & HOST.
You need to fix your clients not to call generic 'gcc' etc., and instead call full ${CHOST}-gcc, etc.