aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Junghans <ottxor@gentoo.org>2012-12-27 14:43:54 -0700
committerChristoph Junghans <ottxor@gentoo.org>2012-12-27 14:43:54 -0700
commit5b2dc2b166fd66e6b471c7e57da69a7259ce3fbc (patch)
tree36f606efd94f79473772ee61206647492dd43e89 /dev-util/ccache/files
parentmasked dev-util/ccache use flags (diff)
downloadsci-5b2dc2b166fd66e6b471c7e57da69a7259ce3fbc.tar.gz
sci-5b2dc2b166fd66e6b471c7e57da69a7259ce3fbc.tar.bz2
sci-5b2dc2b166fd66e6b471c7e57da69a7259ce3fbc.zip
added for testing
Package-Manager: portage-2.2.0_alpha149
Diffstat (limited to 'dev-util/ccache/files')
-rw-r--r--dev-util/ccache/files/ccache-3.1.7-no-perl.patch15
-rw-r--r--dev-util/ccache/files/ccache-config-297
2 files changed, 112 insertions, 0 deletions
diff --git a/dev-util/ccache/files/ccache-3.1.7-no-perl.patch b/dev-util/ccache/files/ccache-3.1.7-no-perl.patch
new file mode 100644
index 000000000..5abd15e1a
--- /dev/null
+++ b/dev-util/ccache/files/ccache-3.1.7-no-perl.patch
@@ -0,0 +1,15 @@
+avoid weak perl usage in tests
+
+https://bugs.gentoo.org/421609
+
+--- a/test.sh
++++ b/test.sh
+@@ -1466,7 +1466,7 @@
+ mkdir -p $dir
+ i=0
+ while [ $i -lt 10 ]; do
+- perl -e 'print "A" x 4017' >$dir/result$i-4017.o
++ printf '%4017s' '' | tr ' ' 'A' >$dir/result$i-4017.o
+ touch $dir/result$i-4017.stderr
+ touch $dir/result$i-4017.d
+ if [ $i -gt 5 ]; then
diff --git a/dev-util/ccache/files/ccache-config-2 b/dev-util/ccache/files/ccache-config-2
new file mode 100644
index 000000000..b0a111d61
--- /dev/null
+++ b/dev-util/ccache/files/ccache-config-2
@@ -0,0 +1,97 @@
+#!/bin/sh
+#
+# ccache-config - helper script for ccache and its ebuild
+#
+# Copyright 2003-2012 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
+
+EPREFIX=''
+
+. "${EPREFIX}"/etc/init.d/functions.sh 2>/dev/null || {
+ ebegin() { echo " * $* ..."; }
+ eend() {
+ local r=${1:-$?}
+ [ ${r} -eq 0 ] && echo " [ OK ]" || echo " [ !! ]"
+ return $r
+ }
+}
+
+LIBDIR="lib"
+
+# this should be getopt'd someday (override with CC_QUIET=1)
+CC_VERBOSE=1
+unset _CC_QUIET
+c_quiet() {
+ [ -n "${CC_QUIET:-${_CC_QUIET}}" ] || [ -z "${CC_VERBOSE}" ]
+}
+
+c_ebegin() { c_quiet || ebegin "$@" ; }
+c_eend() { c_quiet || eend "$@" ; }
+
+###
+# 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_path() {
+ echo ${ROOT%/}${EPREFIX}/usr/${LIBDIR}/ccache/bin/$1
+}
+cc_remove_link() {
+ local t=$(cc_path "$1")
+ if [ -L ${t} ]; then
+ c_ebegin "Removing ${t}"
+ rm -f "${t}"
+ c_eend
+ fi
+}
+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
+ # first be sure any old link is removed
+ _CC_QUIET=1
+ cc_remove_link "${1}"
+ unset _CC_QUIET
+
+ # then create the new link
+ local t=$(cc_path "$1")
+ c_ebegin "Creating ccache shadow link ${t}"
+ mkdir -p -m 0755 "${t%/*}" && ln -s "${EPREFIX}"/usr/bin/ccache "${t}"
+ c_eend
+ fi
+}
+cc_links() {
+ local a compilers="gcc cc c++ g++"
+ [ "${2}" = icc ] && compilers="icc icpc" && set -- "$1"
+ [ "${2}" = clang ] && compilers="clang " && set -- "$1"
+ for a in ${compilers} ; do
+ 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
+}
+
+###
+# main routine
+
+case "${1}" in
+ --install-links )
+ cc_links install "${2}"
+ ;;
+ --remove-links )
+ cc_links remove "${2}"
+ ;;
+ * )
+ echo "usage: ${0} {--install-links|--remove-links} [ CHOST|clang|icc ]"
+ ;;
+esac