diff options
author | Martin Väth <martin@mvath.de> | 2010-04-03 13:15:10 +0200 |
---|---|---|
committer | Martin Väth <martin@mvath.de> | 2015-10-11 10:45:19 +0200 |
commit | 89525b2440ac20ed3a7986aa5fd11970b7907ecb (patch) | |
tree | ce56af9a4d877fc490dbc832d8f01b2bb9e5a81f /dev-util/ccache/files | |
parent | Bump firefox-plugins. Add noscript (diff) | |
download | mv-89525b2440ac20ed3a7986aa5fd11970b7907ecb.tar.gz mv-89525b2440ac20ed3a7986aa5fd11970b7907ecb.tar.bz2 mv-89525b2440ac20ed3a7986aa5fd11970b7907ecb.zip |
Add ccache-3.0_pre0. Reformat metadata.xml
Diffstat (limited to 'dev-util/ccache/files')
-rwxr-xr-x | dev-util/ccache/files/ccache-config | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/dev-util/ccache/files/ccache-config b/dev-util/ccache/files/ccache-config new file mode 100755 index 00000000..0ca7375d --- /dev/null +++ b/dev-util/ccache/files/ccache-config @@ -0,0 +1,69 @@ +#! /bin/sh +# +# ccache-config - helper script for ccache and its ebuild +# +# Copyright 2003 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 +# +# Ported to POSIX by Martin Väth <martin@mvath.de> +# +# Additional features to come; this provides a starting point + +# this should be getopt'd someday (override with CC_QUIET=1) +CC_VERBOSE=1 + +cc_echo() { + [ -z "${CC_QUIET}" ] && [ -n "${CC_VERBOSE}" ] && printf '%s\n' "${*}" +} + +### +# the following functions manage the ccache symlinks +# they allow the user or other scripts (namely gcc-config) to +# automatically update ccache's links when upgrading toolchains +# +cc_remove_link() { + t="/usr/lib/ccache/bin/${1}" + if test -L "${t}" + then cc_echo "Removing ${t}..." + rm -f -- "${t}" + fi +} +cc_install_link() { + # Search the PATH for the specified compiler + # then create shadow link in /usr/lib/ccache/bin to ccache + + if command -v "${1}" >/dev/null 2>&1 + then # first be sure any old link is removed + CC_QUIET=1 cc_remove_link "${1}" + + # then create the new link + t="/usr/lib/ccache/bin/${1}" + cc_echo "Creating ccache shadow link: ${t}..." + ln -s -- /usr/bin/ccache "${t}" + fi +} +cc_links() { + for a in gcc cc c++ g++ + do [ -n "${2}" ] && a="${2}-${a}" + eval "cc_${1}_link" "${a}" + done +} + +### +# main routine + +case "${1}" in +--install-links) + cc_links install "${2}" + ;; +--remove-links) + cc_links remove "${2}" + ;; +*) + printf '%s\n' "Usage: ${0##*/} {--install-links|--remove-links} [ CHOST ]" + ;; +esac + |