diff options
author | Alex Dupre <ale@FreeBSD.org> | 2006-03-21 15:06:15 +0000 |
---|---|---|
committer | Alex Dupre <ale@FreeBSD.org> | 2006-03-21 15:06:15 +0000 |
commit | 4fbf6452a68e60c78f9787e06d2400713e2bbf9f (patch) | |
tree | 73933a032620c30844b3cf0f159c521c5e586c25 /devel/ccache | |
parent | 64db82b76fbe3c64c01592a2bcf8ed408e53bae6 (diff) | |
download | ports-4fbf6452a68e60c78f9787e06d2400713e2bbf9f.tar.gz ports-4fbf6452a68e60c78f9787e06d2400713e2bbf9f.zip |
- 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
Notes
Notes:
svn path=/head/; revision=157883
Diffstat (limited to 'devel/ccache')
-rw-r--r-- | devel/ccache/Makefile | 28 | ||||
-rw-r--r-- | devel/ccache/files/ccache-howto-freebsd.txt.in | 23 | ||||
-rw-r--r-- | devel/ccache/files/patch-ccache.c | 10 | ||||
-rw-r--r-- | devel/ccache/files/patch-ccache.yo | 14 | ||||
-rw-r--r-- | devel/ccache/files/world-c++.in | 4 | ||||
-rw-r--r-- | devel/ccache/files/world-cc.in | 4 |
6 files changed, 50 insertions, 33 deletions
diff --git a/devel/ccache/Makefile b/devel/ccache/Makefile index 2ae844633459..5e36e23c015b 100644 --- a/devel/ccache/Makefile +++ b/devel/ccache/Makefile @@ -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} diff --git a/devel/ccache/files/ccache-howto-freebsd.txt.in b/devel/ccache/files/ccache-howto-freebsd.txt.in index ed0316e6f2a6..eef830d2e7fd 100644 --- a/devel/ccache/files/ccache-howto-freebsd.txt.in +++ b/devel/ccache/files/ccache-howto-freebsd.txt.in @@ -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 diff --git a/devel/ccache/files/patch-ccache.c b/devel/ccache/files/patch-ccache.c index 7ee069ace02b..caba042f50c0 100644 --- a/devel/ccache/files/patch-ccache.c +++ b/devel/ccache/files/patch-ccache.c @@ -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); + } diff --git a/devel/ccache/files/patch-ccache.yo b/devel/ccache/files/patch-ccache.yo new file mode 100644 index 000000000000..626f75610499 --- /dev/null +++ b/devel/ccache/files/patch-ccache.yo @@ -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 diff --git a/devel/ccache/files/world-c++.in b/devel/ccache/files/world-c++.in new file mode 100644 index 000000000000..d6933ff5c33b --- /dev/null +++ b/devel/ccache/files/world-c++.in @@ -0,0 +1,4 @@ +#!/bin/sh +unset CCACHE_PATH +export CCACHE_HASH_COMPILER +exec %%PREFIX%%/%%CCLINKDIR%%/c++ "$@" diff --git a/devel/ccache/files/world-cc.in b/devel/ccache/files/world-cc.in new file mode 100644 index 000000000000..bb2f8162ac8c --- /dev/null +++ b/devel/ccache/files/world-cc.in @@ -0,0 +1,4 @@ +#!/bin/sh +unset CCACHE_PATH +export CCACHE_HASH_COMPILER +exec %%PREFIX%%/%%CCLINKDIR%%/cc "$@" |