mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
- Add CCACHE_CACHE_COMPILER patch
- Improve examples - Add two new scripts to enhance buildworld/buildkernel ccache may now be used safely and effectively to build the FreeBSD source tree. Follow the pkg-message tips to exploit it. Approved by: maintainer
This commit is contained in:
parent
64db82b76f
commit
4fbf6452a6
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=157883
6 changed files with 50 additions and 33 deletions
|
@ -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 @@ PORTDOCS= index.html \
|
|||
|
||||
.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 @@ CCACHE_COMPILERS+= icc icpc
|
|||
.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 @@ pre-everything::
|
|||
@${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 @@ do-install:
|
|||
.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}
|
||||
|
|
|
@ -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 @@ For csh/tcsh Add the following to /etc/csh.cshrc:
|
|||
|
||||
--
|
||||
|
||||
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
|
||||
|
|
|
@ -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);
|
||||
+ }
|
||||
|
|
14
devel/ccache/files/patch-ccache.yo
Normal file
14
devel/ccache/files/patch-ccache.yo
Normal file
|
@ -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
|
4
devel/ccache/files/world-c++.in
Normal file
4
devel/ccache/files/world-c++.in
Normal file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
unset CCACHE_PATH
|
||||
export CCACHE_HASH_COMPILER
|
||||
exec %%PREFIX%%/%%CCLINKDIR%%/c++ "$@"
|
4
devel/ccache/files/world-cc.in
Normal file
4
devel/ccache/files/world-cc.in
Normal file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
unset CCACHE_PATH
|
||||
export CCACHE_HASH_COMPILER
|
||||
exec %%PREFIX%%/%%CCLINKDIR%%/cc "$@"
|
Loading…
Add table
Reference in a new issue