View | Details | Raw Unified | Return to bug 155008
Collapse All | Expand All

(-)Makefile (-8 / +8 lines)
Lines 7-12 Link Here
7
7
8
PORTNAME=	ccache
8
PORTNAME=	ccache
9
PORTVERSION=	3.1.4
9
PORTVERSION=	3.1.4
10
PORTREVISION=	1
10
CATEGORIES=	devel
11
CATEGORIES=	devel
11
MASTER_SITES=	http://samba.org/ftp/ccache/ CRITICAL
12
MASTER_SITES=	http://samba.org/ftp/ccache/ CRITICAL
12
13
Lines 26-32 Link Here
26
.if !defined(WITHOUT_COMPILER_LINKS)
27
.if !defined(WITHOUT_COMPILER_LINKS)
27
HOWTO=		ccache-howto-freebsd.txt
28
HOWTO=		ccache-howto-freebsd.txt
28
CCLINKDIR=	libexec/ccache
29
CCLINKDIR=	libexec/ccache
29
PLIST_DIRS=	${CCLINKDIR}
30
PLIST_DIRS=	${CCLINKDIR}/world ${CCLINKDIR}
30
SUB_FILES=	${HOWTO} pkg-message
31
SUB_FILES=	${HOWTO} pkg-message
31
.endif
32
.endif
32
33
Lines 42-51 Link Here
42
.if defined(EXTRA_COMPILERS)
43
.if defined(EXTRA_COMPILERS)
43
CCACHE_COMPILERS+=	${EXTRA_COMPILERS}
44
CCACHE_COMPILERS+=	${EXTRA_COMPILERS}
44
.endif
45
.endif
45
WORLD_COMPILERS=	world-cc world-c++
46
PLIST_FILES+=	${CCACHE_COMPILERS:S|^|${CCLINKDIR}/|} \
46
PLIST_FILES+=	${CCACHE_COMPILERS:S|^|${CCLINKDIR}/|} \
47
		${WORLD_COMPILERS:S|^|${CCLINKDIR}/|}
47
		${CCACHE_COMPILERS:S|^|${CCLINKDIR}/world/|} \
48
SUB_FILES+=	${WORLD_COMPILERS}
48
		${CCLINKDIR}/world/ccache
49
SUB_FILES+=	world-ccache
49
SUB_LIST+=	CCACHE_COMPILERS="${CCACHE_COMPILERS}" \
50
SUB_LIST+=	CCACHE_COMPILERS="${CCACHE_COMPILERS}" \
50
		CCLINKDIR="${CCLINKDIR}" \
51
		CCLINKDIR="${CCLINKDIR}" \
51
		ICCPREFIX="${LOCALBASE}/intel_cc_80/bin" \
52
		ICCPREFIX="${LOCALBASE}/intel_cc_80/bin" \
Lines 69-80 Link Here
69
	${INSTALL_PROGRAM} ${WRKSRC}/ccache ${PREFIX}/bin
70
	${INSTALL_PROGRAM} ${WRKSRC}/ccache ${PREFIX}/bin
70
	${INSTALL_MAN} ${WRKSRC}/${MAN1} ${PREFIX}/man/man1
71
	${INSTALL_MAN} ${WRKSRC}/${MAN1} ${PREFIX}/man/man1
71
.if !defined(WITHOUT_COMPILER_LINKS)
72
.if !defined(WITHOUT_COMPILER_LINKS)
72
	@${MKDIR} ${PREFIX}/${CCLINKDIR}
73
	@${MKDIR} ${PREFIX}/${CCLINKDIR}/world
74
	${INSTALL_SCRIPT} ${WRKDIR}/world-ccache ${PREFIX}/${CCLINKDIR}/world/ccache
73
.for link in ${CCACHE_COMPILERS}
75
.for link in ${CCACHE_COMPILERS}
74
	${LN} -sf ${PREFIX}/bin/ccache ${PREFIX}/${CCLINKDIR}/${link}
76
	${LN} -sf ${PREFIX}/bin/ccache ${PREFIX}/${CCLINKDIR}/${link}
75
.endfor
77
	${LN} -sf ccache ${PREFIX}/${CCLINKDIR}/world/${link}
76
.for script in ${WORLD_COMPILERS}
77
	${INSTALL_SCRIPT} ${WRKDIR}/${script} ${PREFIX}/${CCLINKDIR}
78
.endfor
78
.endfor
79
.endif
79
.endif
80
.if !defined(NOPORTDOCS)
80
.if !defined(NOPORTDOCS)
(-)files/ccache-howto-freebsd.txt.in (-5 / +14 lines)
Lines 2-13 Link Here
2
# $FreeBSD: ports/devel/ccache/files/ccache-howto-freebsd.txt.in,v 1.13 2010/11/17 18:41:35 ehaupt Exp $
2
# $FreeBSD: ports/devel/ccache/files/ccache-howto-freebsd.txt.in,v 1.13 2010/11/17 18:41:35 ehaupt Exp $
3
#
3
#
4
4
5
To use ccache add the following to /etc/make.conf
5
To use ccache add the following to /etc/make.conf.
6
You can replace cc and c++ with the compilers of your choice.
7
(remember that only GCC and Clang can build world and kernel)
6
8
7
.if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*))
9
.if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*))
8
.if !defined(NOCCACHE)
10
.if !defined(NOCCACHE)
9
CC:=${CC:C,^cc,%%PREFIX%%/%%CCLINKDIR%%/world-cc,1}
11
CC:=${CC:C,^cc,%%PREFIX%%/%%CCLINKDIR%%/world/cc,1}
10
CXX:=${CXX:C,^c\+\+,%%PREFIX%%/%%CCLINKDIR%%/world-c++,1}
12
CXX:=${CXX:C,^c\+\+,%%PREFIX%%/%%CCLINKDIR%%/world/c++,1}
11
.endif
13
.endif
12
.endif
14
.endif
13
15
Lines 47-64 Link Here
47
Ccache has installed links for the following compilers
49
Ccache has installed links for the following compilers
48
%%CCACHE_COMPILERS%%
50
%%CCACHE_COMPILERS%%
49
in %%PREFIX%%/%%CCLINKDIR%%
51
in %%PREFIX%%/%%CCLINKDIR%%
52
and %%PREFIX%%/%%CCLINKDIR%%/world
53
54
Clang will return a lot of 'unused argument' warnings: they are harmless.
55
Just add this to /etc/make.conf if you want to hide them:
56
.if ${CC:T} == "clang"
57
CFLAGS+=	-Qunused-arguments
58
.endif
50
59
51
!!! WARNING !!!
60
!!! WARNING !!!
52
Please make sure you have the compiler installed before you do this or your
61
Please make sure you have the compiler installed before you do this or your
53
build will fail because it will not be able to find the compiler.
62
build will fail because it will not be able to find the compiler.
54
63
55
Any time you change CC/CXX you need to reinstall devel/libtool15 or you 
64
Any time you change CC/CXX you need to reinstall devel/libtool or you
56
will run in to problems.
65
will run in to problems.
57
66
58
--
67
--
59
68
60
Ccache's default cache size is 1GB and this is larger than the default size of
69
Ccache's default cache size is 1GB and this is larger than the default size of
61
the root partition (/) on FreeBSD. To over come this you may specify a new 
70
the root partition (/) on FreeBSD. To over come this you may specify a new
62
cache location on a different partition with the following examples.
71
cache location on a different partition with the following examples.
63
72
64
For Korn/Bourne shells Add the following to /etc/profile:
73
For Korn/Bourne shells Add the following to /etc/profile:
(-)files/world-c++.in (-4 lines)
Removed Link Here
1
#!/bin/sh
2
unset CCACHE_PATH
3
export CCACHE_COMPILERCHECK=content
4
exec %%PREFIX%%/%%CCLINKDIR%%/c++ "$@"
(-)files/world-cc.in (-4 lines)
Removed Link Here
1
#!/bin/sh
2
unset CCACHE_PATH
3
export CCACHE_COMPILERCHECK=content
4
exec %%PREFIX%%/%%CCLINKDIR%%/cc "$@"
(-)files/world-ccache.in (+9 lines)
Added Link Here
1
#!/bin/sh
2
3
[ "${0##*/}" = "ccache" ] &&
4
printf "Please, use one of the compiler links in\n%%PREFIX%%/%%CCLINKDIR%%/world\nto invoke ccache\n" >&2 &&
5
exit 1
6
7
unset CCACHE_PATH
8
export CCACHE_COMPILERCHECK=content
9
exec %%PREFIX%%/%%CCLINKDIR%%/${0##*/} "$@"

Return to bug 155008