diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-11-19 09:46:35 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-11-19 09:46:35 +0000 |
commit | f1e6d11864e407a49b93a9b3d07f2aef031193c1 (patch) | |
tree | d306d5fcf536676d1949176ad1ebef25250aa62e /dev-util/ccache/files/ccache-config | |
parent | Add support for USE=gstreamer #345917 by Zorzo Luca. (diff) | |
download | gentoo-2-f1e6d11864e407a49b93a9b3d07f2aef031193c1.tar.gz gentoo-2-f1e6d11864e407a49b93a9b3d07f2aef031193c1.tar.bz2 gentoo-2-f1e6d11864e407a49b93a9b3d07f2aef031193c1.zip |
Version bump #313101 (which should also fix #270062 by Diego Elio Pettenò, #296371 by Attila Stehr, and #301727 by Mariusz Kozlowski). Make ccache-config respect ROOT/multilib and fix handling of cc/chost-cc symlinks between it and the ebuild #302048 by Christoph Junghans.
(Portage version: 2.2.0_alpha4/cvs/Linux x86_64)
Diffstat (limited to 'dev-util/ccache/files/ccache-config')
-rw-r--r-- | dev-util/ccache/files/ccache-config | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/dev-util/ccache/files/ccache-config b/dev-util/ccache/files/ccache-config index 0a4318258a2d..1cd2b37810ec 100644 --- a/dev-util/ccache/files/ccache-config +++ b/dev-util/ccache/files/ccache-config @@ -2,17 +2,19 @@ # # ccache-config - helper script for ccache and its ebuild # -# Copyright 2003 Superlucidity Services, LLC +# Copyright 2003-2010 Superlucidity Services, LLC # This program licensed under the GNU GPL version 2. # # This script developed by Zachary T Welch at Superlucidity Services, LLC # it was cloned from the distcc-config script -# +# # Additional features to come; this provides a starting point # this should be getopt'd someday (override with CC_QUIET=1) CC_VERBOSE=1 +LIBDIR="lib" + cc_echo() { [ -z "${CC_QUIET}" -a -n "${CC_VERBOSE}" ] && echo "$*" } @@ -22,8 +24,11 @@ cc_echo() { # they allow the user or other scripts (namely gcc-config) to # automatically update ccache's links when upgrading toolchains # +cc_path() { + echo ${ROOT%/}/usr/${LIBDIR}/ccache/bin/$1 +} cc_remove_link() { - local t="/usr/lib/ccache/bin/${1}" + local t=$(cc_path "$1") if [ -L ${t} ]; then cc_echo "Removing ${t}..." rm -f "${t}" @@ -32,13 +37,13 @@ cc_remove_link() { cc_install_link() { # Search the PATH for the specified compiler # then create shadow link in /usr/lib/ccache/bin to ccache - - if [ -n "$(type -p ${1})" ]; then + + if [ -n "$(type -p ${1})" ]; then # first be sure any old link is removed CC_QUIET=1 cc_remove_link "${1}" # then create the new link - local t="/usr/lib/ccache/bin/${1}" + local t=$(cc_path "$1") cc_echo "Creating ccache shadow link: ${t}..." ln -s /usr/bin/ccache "${t}" fi @@ -46,7 +51,12 @@ cc_install_link() { cc_links() { local a for a in gcc cc c++ g++ ; do - [ -n "${2}" ] && a="${2}-${a}" + if [ -n "${2}" ] ; then + # gcc-config doesnt install ${CHOST}-cc, so until + # it does, don't install a ccache symlink for it + [ "${a}" = "cc" ] && continue + a="${2}-${a}" + fi eval "cc_${1}_link" "${a}" done } @@ -65,4 +75,3 @@ case "${1}" in echo "usage: ${0} {--install-links|--remove-links} [ CHOST ]" ;; esac - |