Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/devel/ccache/Makefile,v
retrieving revision 1.38
diff -u -r1.38 Makefile
--- Makefile	7 Mar 2006 19:53:42 -0000	1.38
+++ Makefile	21 Mar 2006 11:32:10 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	ccache
 PORTVERSION=	2.4
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	devel
 MASTER_SITES=	http://samba.org/ftp/ccache/
 
@@ -26,9 +26,9 @@
 
 .if !defined(WITHOUT_COMPILER_LINKS)
 HOWTO=		ccache-howto-freebsd.txt
-PKGMESSAGE=	${WRKDIR}/pkg-message
 CCLINKDIR=	libexec/ccache
 PLIST_DIRS=	${CCLINKDIR}
+SUB_FILES=	${HOWTO} pkg-message
 .endif
 
 .include <bsd.port.pre.mk>
@@ -42,7 +42,14 @@
 .if defined(EXTRA_COMPILERS)
 CCACHE_COMPILERS+=	${EXTRA_COMPILERS}
 .endif
-PLIST_FILES+=	${CCACHE_COMPILERS:S|^|${CCLINKDIR}/|}
+WORLD_COMPILERS=	world-cc world-c++
+PLIST_FILES+=	${CCACHE_COMPILERS:S|^|${CCLINKDIR}/|} \
+		${WORLD_COMPILERS:S|^|${CCLINKDIR}/|}
+SUB_FILES+=	${WORLD_COMPILERS}
+SUB_LIST+=	CCACHE_COMPILERS="${CCACHE_COMPILERS}" \
+		CCLINKDIR="${CCLINKDIR}" \
+		ICCPREFIX="${LOCALBASE}/intel_cc_80/bin" \
+		HOWTO="${HOWTO}"
 .endif
 
 pre-everything::
@@ -58,18 +65,6 @@
 	@${ECHO_MSG} "===>"
 .endif
 
-post-extract:
-.if !defined(WITHOUT_COMPILER_LINKS)
-	@${SED} -e 's|%%CCACHE_COMPILERS%%|${CCACHE_COMPILERS}|; \
-		s|%%PREFIX%%|${PREFIX}|; s|%%CCLINKDIR%%|${CCLINKDIR}|; \
-		s|%%LOCALBASE%%|${LOCALBASE}|; \
-		s|%%ICCPREFIX%%|${LOCALBASE}/intel_cc_80/bin|' \
-		${FILESDIR}/${HOWTO}.in > ${WRKDIR}/${HOWTO}
-	@${SED} -e 's|%%HOWTO%%|${HOWTO}|; \
-		s|%%DOCSDIR%%|${DOCSDIR}|' \
-		${FILESDIR}/pkg-message.in >${PKGMESSAGE}
-.endif
-
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/ccache ${PREFIX}/bin
 	${INSTALL_MAN} ${WRKSRC}/${MAN1} ${PREFIX}/man/man1
@@ -78,6 +73,9 @@
 .for link in ${CCACHE_COMPILERS}
 	${LN} -sf ${PREFIX}/bin/ccache ${PREFIX}/${CCLINKDIR}/${link}
 .endfor
+.for script in ${WORLD_COMPILERS}
+	${INSTALL_SCRIPT} ${WRKDIR}/${script} ${PREFIX}/${CCLINKDIR}
+.endfor
 .endif
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
Index: files/ccache-howto-freebsd.txt.in
===================================================================
RCS file: /home/pcvs/ports/devel/ccache/files/ccache-howto-freebsd.txt.in,v
retrieving revision 1.10
diff -u -r1.10 ccache-howto-freebsd.txt.in
--- files/ccache-howto-freebsd.txt.in	11 Jan 2006 23:21:55 -0000	1.10
+++ files/ccache-howto-freebsd.txt.in	21 Mar 2006 11:32:10 -0000
@@ -4,25 +4,17 @@
 
 To use ccache add the following to /etc/make.conf
 
-.if !defined(NOCCACHE)
-.if ${.CURDIR:M/usr/src*} && exists(%%LOCALBASE%%/libexec/ccache/cc)
-CC=%%LOCALBASE%%/libexec/ccache/cc
-CXX=%%LOCALBASE%%/libexec/ccache/c++
-.else
-CC=cc
-CXX=c++
-.endif
-.else
-CC=/usr/bin/cc
-CXX=/usr/bin/c++
+.if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*)) && !defined(NOCCACHE)
+CC=%%PREFIX%%/%%CCLINKDIR%%/world-cc
+CXX=%%PREFIX%%/%%CCLINKDIR%%/world-c++
 .endif
 
 For Korn/Bourne shells Add the following to /etc/profile:
- export PATH=%%PREFIX%%/libexec/ccache/:$PATH
+ export PATH=%%PREFIX%%/%%CCLINKDIR%%:$PATH
  export CCACHE_PATH=/usr/bin:%%LOCALBASE%%/bin
 
 For csh/tcsh Add the following to /etc/csh.cshrc:
- setenv PATH %%PREFIX%%/libexec/ccache/:$PATH
+ setenv PATH %%PREFIX%%/%%CCLINKDIR%%:$PATH
  setenv CCACHE_PATH /usr/bin:%%LOCALBASE%%/bin
 
 For icc users:
@@ -42,9 +34,12 @@
 
 --
 
-If you have a problem building a port
+If you have a problem building world
 define NOCCACHE and try again.
 
+If you have a problem building a port
+reset PATH=$CCACHE_PATH and try again.
+
 --
 
 Ccache has installed links for the following compilers
Index: files/patch-ccache.c
===================================================================
RCS file: /home/pcvs/ports/devel/ccache/files/patch-ccache.c,v
retrieving revision 1.1
diff -u -r1.1 patch-ccache.c
--- files/patch-ccache.c	15 Nov 2005 20:03:33 -0000	1.1
+++ files/patch-ccache.c	21 Mar 2006 11:32:10 -0000
@@ -1,12 +1,14 @@
---- ccache.c.orig	Mon Sep 13 06:38:30 2004
-+++ ccache.c	Tue Nov 15 14:59:46 2005
-@@ -331,8 +331,10 @@
+--- ccache.c.orig	2004/09/13 10:19:06	1.96
++++ ccache.c	2005/11/24 21:54:09	1.98
+@@ -331,8 +331,12 @@
  		hash_string(str_basename(args->argv[0]));
  	}
  
 -	hash_int(st.st_size);
 -	hash_int(st.st_mtime);
-+	if (!getenv("CCACHE_NOHASH_SIZE_MTIME")) {
++	if (getenv("CCACHE_HASH_COMPILER")) {
++		hash_file(args->argv[0]);
++	} else if (!getenv("CCACHE_NOHASH_SIZE_MTIME")) {
 +		hash_int(st.st_size);
 +		hash_int(st.st_mtime);
 +	}
Index: files/patch-ccache.yo
===================================================================
RCS file: files/patch-ccache.yo
diff -N files/patch-ccache.yo
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-ccache.yo	21 Mar 2006 11:32:10 -0000
@@ -0,0 +1,14 @@
+--- ccache.yo.orig	2004/09/10 05:05:14	1.26
++++ ccache.yo	2005/11/24 21:54:09	1.27
+@@ -203,6 +203,11 @@
+ strike problems with gdb not using the correct directory then enable
+ this option.
+ 
++dit(bf(CCACHE_HASH_COMPILER)) This tells ccache to hash binary of the
++compiler instead of hashing just its size and mtime. This is very
++slightly slower, but makes copes better with compiler upgrades during
++a build bootstrapping process.
++
+ dit(bf(CCACHE_UNIFY)) If you set the environment variable CCACHE_UNIFY
+ then ccache will use the C/C++ unifier when hashing the pre-processor
+ output if -g is not used in the compile. The unifier is slower than a
Index: files/world-c++.in
===================================================================
RCS file: files/world-c++.in
diff -N files/world-c++.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/world-c++.in	21 Mar 2006 11:32:10 -0000
@@ -0,0 +1,4 @@
+#!/bin/sh
+unset CCACHE_PATH
+export CCACHE_HASH_COMPILER
+exec %%PREFIX%%/%%CCLINKDIR%%/c++ "$@"
Index: files/world-cc.in
===================================================================
RCS file: files/world-cc.in
diff -N files/world-cc.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/world-cc.in	21 Mar 2006 11:32:10 -0000
@@ -0,0 +1,4 @@
+#!/bin/sh
+unset CCACHE_PATH
+export CCACHE_HASH_COMPILER
+exec %%PREFIX%%/%%CCLINKDIR%%/cc "$@"
