On Friday 17 December 2010 12:03:30 Alberto Villa wrote:
> while i had no problems at building world with world/clang, i've not yet
> tested the port installation, but i'll do it as soon as i have a free
> tinderbox. meanwhile you can share your comments about the patch

fixed and tested patch attached
-- 
Alberto Villa, FreeBSD committer <avi...@freebsd.org>
http://people.FreeBSD.org/~avilla

Beware of a dark-haired man with a loud tie.
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/devel/ccache/Makefile,v
retrieving revision 1.57
diff -u -r1.57 Makefile
--- Makefile	30 Nov 2010 22:37:33 -0000	1.57
+++ Makefile	17 Dec 2010 14:15:15 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	ccache
 PORTVERSION=	3.1.3
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	http://samba.org/ftp/ccache/ CRITICAL
 
@@ -26,7 +27,7 @@
 .if !defined(WITHOUT_COMPILER_LINKS)
 HOWTO=		ccache-howto-freebsd.txt
 CCLINKDIR=	libexec/ccache
-PLIST_DIRS=	${CCLINKDIR}
+PLIST_DIRS=	${CCLINKDIR} ${CCLINKDIR}/world
 SUB_FILES=	${HOWTO} pkg-message
 .endif
 
@@ -42,10 +43,10 @@
 .if defined(EXTRA_COMPILERS)
 CCACHE_COMPILERS+=	${EXTRA_COMPILERS}
 .endif
-WORLD_COMPILERS=	world-cc world-c++
 PLIST_FILES+=	${CCACHE_COMPILERS:S|^|${CCLINKDIR}/|} \
-		${WORLD_COMPILERS:S|^|${CCLINKDIR}/|}
-SUB_FILES+=	${WORLD_COMPILERS}
+		${CCACHE_COMPILERS:S|^|${CCLINKDIR}/world/|} \
+		${CCLINKDIR}/world/ccache
+SUB_FILES+=	world-ccache
 SUB_LIST+=	CCACHE_COMPILERS="${CCACHE_COMPILERS}" \
 		CCLINKDIR="${CCLINKDIR}" \
 		ICCPREFIX="${LOCALBASE}/intel_cc_80/bin" \
@@ -69,12 +70,11 @@
 	${INSTALL_PROGRAM} ${WRKSRC}/ccache ${PREFIX}/bin
 	${INSTALL_MAN} ${WRKSRC}/${MAN1} ${PREFIX}/man/man1
 .if !defined(WITHOUT_COMPILER_LINKS)
-	@${MKDIR} ${PREFIX}/${CCLINKDIR}
+	@${MKDIR} ${PREFIX}/${CCLINKDIR}/world
+	${INSTALL_SCRIPT} ${WRKDIR}/world-ccache ${PREFIX}/${CCLINKDIR}/world/ccache
 .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}
+	${LN} -sf ccache ${PREFIX}/${CCLINKDIR}/world/${link}
 .endfor
 .endif
 .if !defined(NOPORTDOCS)
Index: files/ccache-howto-freebsd.txt.in
===================================================================
RCS file: /home/pcvs/ports/devel/ccache/files/ccache-howto-freebsd.txt.in,v
retrieving revision 1.13
diff -u -r1.13 ccache-howto-freebsd.txt.in
--- files/ccache-howto-freebsd.txt.in	17 Nov 2010 18:41:35 -0000	1.13
+++ files/ccache-howto-freebsd.txt.in	17 Dec 2010 14:15:15 -0000
@@ -2,12 +2,14 @@
 # $FreeBSD: ports/devel/ccache/files/ccache-howto-freebsd.txt.in,v 1.13 2010/11/17 18:41:35 ehaupt Exp $
 #
 
-To use ccache add the following to /etc/make.conf
+To use ccache add the following to /etc/make.conf.
+You can replace cc and c++ with the compilers of your choice.
+(remember that only GCC and Clang can build world and kernel)
 
 .if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*))
 .if !defined(NOCCACHE)
-CC:=${CC:C,^cc,%%PREFIX%%/%%CCLINKDIR%%/world-cc,1}
-CXX:=${CXX:C,^c\+\+,%%PREFIX%%/%%CCLINKDIR%%/world-c++,1}
+CC:=${CC:C,^cc,%%PREFIX%%/%%CCLINKDIR%%/world/cc,1}
+CXX:=${CXX:C,^c\+\+,%%PREFIX%%/%%CCLINKDIR%%/world/c++,1}
 .endif
 .endif
 
@@ -47,12 +49,16 @@
 Ccache has installed links for the following compilers
 %%CCACHE_COMPILERS%%
 in %%PREFIX%%/%%CCLINKDIR%%
+and %%PREFIX%%/%%CCLINKDIR%%/world
+
+Clang will return a lot of 'unused argument' warnings: they are harmless.
+Just add -Qunused-arguments to CFLAGS if you want to hide them.
 
 !!! WARNING !!!
 Please make sure you have the compiler installed before you do this or your
 build will fail because it will not be able to find the compiler.
 
-Any time you change CC/CXX you need to reinstall devel/libtool15 or you 
+Any time you change CC/CXX you need to reinstall devel/libtool or you 
 will run in to problems.
 
 --
Index: files/world-c++.in
===================================================================
RCS file: files/world-c++.in
diff -N files/world-c++.in
--- files/world-c++.in	31 Jul 2010 10:48:26 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,4 +0,0 @@
-#!/bin/sh
-unset CCACHE_PATH
-export CCACHE_COMPILERCHECK=content
-exec %%PREFIX%%/%%CCLINKDIR%%/c++ "$@"
Index: files/world-cc.in
===================================================================
RCS file: files/world-cc.in
diff -N files/world-cc.in
--- files/world-cc.in	31 Jul 2010 10:48:26 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,4 +0,0 @@
-#!/bin/sh
-unset CCACHE_PATH
-export CCACHE_COMPILERCHECK=content
-exec %%PREFIX%%/%%CCLINKDIR%%/cc "$@"
Index: files/world-ccache.in
===================================================================
RCS file: files/world-ccache.in
diff -N files/world-ccache.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/world-ccache.in	17 Dec 2010 14:15:15 -0000
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+[ "${0##*/}" = "ccache" ] &&
+printf "Please, use one of the compiler links in\n%%PREFIX%%/%%CCLINKDIR%%/world\nto invoke ccache\n" >&2 &&
+exit 1
+
+unset CCACHE_PATH
+export CCACHE_COMPILERCHECK=content
+exec %%PREFIX%%/%%CCLINKDIR%%/${0##*/} "$@"

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to