summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-01-05 05:33:34 +0000
committerMike Frysinger <vapier@gentoo.org>2005-01-05 05:33:34 +0000
commit0b84a35594749c02a57c4d8e99c069216caf3fd3 (patch)
tree6847f9b2237a076129e276fb3f89b16f7d41ed8b
parentSeems people still have outdated gcc versions installed which break with GCC_... (diff)
downloadgcc-config-0b84a35594749c02a57c4d8e99c069216caf3fd3.tar.gz
gcc-config-0b84a35594749c02a57c4d8e99c069216caf3fd3.tar.bz2
gcc-config-0b84a35594749c02a57c4d8e99c069216caf3fd3.zip
Make sure that when we switch compilers, we dont accidently invalidate all of our ccache data #70548.v1.3.8
-rwxr-xr-xgcc-config16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc-config b/gcc-config
index 9e27d10..6c5fcc7 100755
--- a/gcc-config
+++ b/gcc-config
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.3.8,v 1.2 2004/12/24 05:46:24 vapier Exp $
+# $Header: gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.3.8,v 1.5 2005/01/05 05:33:34 vapier Exp $
# Author: Martin Schlemmer <azarah@gentoo.org>
trap ":" INT QUIT TSTP
@@ -199,14 +199,16 @@ switch_profile() {
&& ${RM} -f "${ROOT}/usr/bin/${x}"{32,64}
# Only install a wrapper if the binary exists ...
- # If installing one of the C++ binaries, check to see
- # if g++ exists so we don't install crappy wrappers
- if ([[ -x ${ROOT}/${GCC_BIN_PATH}/${x} || ${x} = "cc" ]]) || \
- ([[ ${x} = "c++" || ${x} = ${CTARGET}-c++ || ${x} = "cpp" ]] && \
- [[ -x ${ROOT}/${GCC_BIN_PATH}/${CTARGET}-g++ ]])
- then
+ # We want to figure out the 'reference file' for each
+ # wrapper (the binary we're 'wrapping') so that we can
+ # sync mtimes together. This makes things like ccache
+ # happy. See Bug #70548 for more info.
+ local ref=${ROOT}/${GCC_BIN_PATH}/${x}
+ [[ ${x} = "cc" ]] && ref=${ROOT}/${GCC_BIN_PATH}/gcc
+ if [[ -x ${ref} ]] ; then
${CP} -f "${ROOT}/usr/lib/gcc-config/wrapper" \
"${ROOT}/usr/bin/${x}"
+ touch -r "${ref}" "${ROOT}/usr/bin/${x}"
# Install 32bit and 64bit wrappers if need be
# This should probably get folded back into the wrapper ...