refine Makefile targets for documentation generation and remove generated ccache documentation from svn
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10976 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a883849b45
commit
47a0b98067
6 changed files with 31 additions and 732 deletions
|
|
@ -25,7 +25,7 @@ HEADERS = ccache.h mdfour.h
|
|||
|
||||
all: $(PACKAGE_NAME)$(EXEEXT)
|
||||
|
||||
docs: $(PACKAGE_NAME).1 web/$(PACKAGE_NAME)-man.html
|
||||
docs: $(PACKAGE_NAME).1 web/ccache-man.html
|
||||
|
||||
$(PACKAGE_NAME)$(EXEEXT): $(OBJS) $(HEADERS)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
|
||||
|
|
@ -33,9 +33,9 @@ $(PACKAGE_NAME)$(EXEEXT): $(OBJS) $(HEADERS)
|
|||
$(PACKAGE_NAME).1: ccache.yo
|
||||
-yodl2man -o $(PACKAGE_NAME).1 ccache.yo
|
||||
|
||||
web/$(PACKAGE_NAME)-man.html: ccache.yo
|
||||
web/ccache-man.html: ccache.yo
|
||||
mkdir -p man
|
||||
yodl2html -o web/$(PACKAGE_NAME)-man.html ccache.yo
|
||||
yodl2html -o web/ccache-man.html ccache.yo
|
||||
|
||||
install: $(PACKAGE_NAME)$(EXEEXT) $(PACKAGE_NAME).1
|
||||
${INSTALLCMD} -d $(DESTDIR)${bindir}
|
||||
|
|
@ -50,6 +50,9 @@ uninstall: $(PACKAGE_NAME)$(EXEEXT) $(PACKAGE_NAME).1
|
|||
clean:
|
||||
/bin/rm -f $(OBJS) *~ $(PACKAGE_NAME)$(EXEEXT)
|
||||
|
||||
clean-docs:
|
||||
rm -f $(PACKAGE_NAME).1 web/ccache-man.html
|
||||
|
||||
check : test
|
||||
|
||||
test: test.sh
|
||||
|
|
|
|||
404
CCache/ccache.1
404
CCache/ccache.1
|
|
@ -1,404 +0,0 @@
|
|||
.TH "ccache" "1" "April 2002" "" ""
|
||||
.SH "NAME"
|
||||
ccache \- a fast compiler cache
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
ccache [OPTION]
|
||||
.PP
|
||||
ccache <compiler> [COMPILER OPTIONS]
|
||||
.PP
|
||||
<compiler> [COMPILER OPTIONS]
|
||||
.PP
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
ccache is a compiler cache\&. It speeds up re-compilation of C/C++ code
|
||||
by caching previous compiles and detecting when the same compile is
|
||||
being done again\&.
|
||||
.PP
|
||||
.SH "OPTIONS SUMMARY"
|
||||
.PP
|
||||
Here is a summary of the options to ccache\&.
|
||||
.PP
|
||||
|
||||
.nf
|
||||
|
||||
|
||||
-s show statistics summary
|
||||
-z zero statistics
|
||||
-c run a cache cleanup
|
||||
-C clear the cache completely
|
||||
-F <maxfiles> set maximum files in cache
|
||||
-M <maxsize> set maximum size of cache (use G, M or K)
|
||||
-h this help page
|
||||
-V print version number
|
||||
|
||||
.fi
|
||||
|
||||
|
||||
.PP
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
These options only apply when you invoke ccache as "ccache"\&. When
|
||||
invoked as a compiler none of these options apply\&. In that case your
|
||||
normal compiler options apply and you should refer to your compilers
|
||||
documentation\&.
|
||||
.PP
|
||||
.IP "\fB-h\fP"
|
||||
Print a options summary page
|
||||
.IP
|
||||
.IP "\fB-s\fP"
|
||||
Print the current statistics summary for the cache\&. The
|
||||
statistics are stored spread across the subdirectories of the
|
||||
cache\&. Using "ccache \-s" adds up the statistics across all
|
||||
subdirectories and prints the totals\&.
|
||||
.IP
|
||||
.IP "\fB-z\fP"
|
||||
Zero the cache statistics\&.
|
||||
.IP
|
||||
.IP "\fB-V\fP"
|
||||
Print the ccache version number
|
||||
.IP
|
||||
.IP "\fB-c\fP"
|
||||
Clean the cache and re-calculate the cache file count and
|
||||
size totals\&. Normally the \-c option should not be necessary as ccache
|
||||
keeps the cache below the specified limits at runtime and keeps
|
||||
statistics up to date on each compile\&. This option is mostly useful
|
||||
if you manually modify the cache contents or believe that the cache
|
||||
size statistics may be inaccurate\&.
|
||||
.IP
|
||||
.IP "\fB-C\fP"
|
||||
Clear the entire cache, removing all cached files\&.
|
||||
.IP
|
||||
.IP "\fB-F maxfiles\fP"
|
||||
This sets the maximum number of files allowed in
|
||||
the cache\&. The value is stored inside the cache directory and applies
|
||||
to all future compiles\&. Due to the way the value is stored the actual
|
||||
value used is always rounded down to the nearest multiple of 16\&.
|
||||
.IP
|
||||
.IP "\fB-M maxsize\fP"
|
||||
This sets the maximum cache size\&. You can specify
|
||||
a value in gigabytes, megabytes or kilobytes by appending a G, M or K
|
||||
to the value\&. The default is gigabytes\&. The actual value stored is
|
||||
rounded down to the nearest multiple of 16 kilobytes\&.
|
||||
.IP
|
||||
.PP
|
||||
.SH "INSTALLATION"
|
||||
.PP
|
||||
There are two ways to use ccache\&. You can either prefix your compile
|
||||
commands with "ccache" or you can create a symbolic link between
|
||||
ccache and the names of your compilers\&. The first method is most
|
||||
convenient if you just want to try out ccache or wish to use it for
|
||||
some specific projects\&. The second method is most useful for when you
|
||||
wish to use ccache for all your compiles\&.
|
||||
.PP
|
||||
To install for usage by the first method just copy ccache to somewhere
|
||||
in your path\&.
|
||||
.PP
|
||||
To install for the second method do something like this:
|
||||
|
||||
.nf
|
||||
|
||||
|
||||
cp ccache /usr/local/bin/
|
||||
ln \-s /usr/local/bin/ccache /usr/local/bin/gcc
|
||||
ln \-s /usr/local/bin/ccache /usr/local/bin/g++
|
||||
ln \-s /usr/local/bin/ccache /usr/local/bin/cc
|
||||
|
||||
.fi
|
||||
|
||||
|
||||
This will work as long as /usr/local/bin comes before the path to gcc
|
||||
(which is usually in /usr/bin)\&. After installing you may wish to run
|
||||
"which gcc" to make sure that the correct link is being used\&.
|
||||
.PP
|
||||
Note! Do not use a hard link, use a symbolic link\&. A hardlink will
|
||||
cause "interesting" problems\&.
|
||||
.PP
|
||||
.SH "EXTRA OPTIONS"
|
||||
.PP
|
||||
When run as a compiler front end ccache usually just takes the same
|
||||
command line options as the compiler you are using\&. The only exception
|
||||
to this is the option \&'\-\-ccache-skip\&'\&. That option can be used to tell
|
||||
ccache that the next option is definitely not a input filename, and
|
||||
should be passed along to the compiler as-is\&.
|
||||
.PP
|
||||
The reason this can be important is that ccache does need to parse the
|
||||
command line and determine what is an input filename and what is a
|
||||
compiler option, as it needs the input filename to determine the name
|
||||
of the resulting object file (among other things)\&. The heuristic
|
||||
ccache uses in this parse is that any string on the command line that
|
||||
exists as a file is treated as an input file name (usually a C
|
||||
file)\&. By using \-\-ccache-skip you can force an option to not be
|
||||
treated as an input file name and instead be passed along to the
|
||||
compiler as a command line option\&.
|
||||
.PP
|
||||
.SH "ENVIRONMENT VARIABLES"
|
||||
.PP
|
||||
ccache uses a number of environment variables to control operation\&. In
|
||||
most cases you won\&'t need any of these as the defaults will be fine\&.
|
||||
.PP
|
||||
.IP
|
||||
.IP "\fBCCACHE_DIR\fP"
|
||||
the CCACHE_DIR environment variable specifies
|
||||
where ccache will keep its cached compiler output\&. The default is
|
||||
"$HOME/\&.ccache"\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_TEMPDIR\fP"
|
||||
the CCACHE_TEMPDIR environment variable specifies
|
||||
where ccache will put temporary files\&. The default is the same as
|
||||
CCACHE_DIR\&. Note that the CCACHE_TEMPDIR path must be on the same
|
||||
filesystem as the CCACHE_DIR path, so that renames of files between
|
||||
the two directories can work\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_LOGFILE\fP"
|
||||
If you set the CCACHE_LOGFILE environment
|
||||
variable then ccache will write some log information on cache hits
|
||||
and misses in that file\&. This is useful for tracking down problems\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_PATH\fP"
|
||||
You can optionally set CCACHE_PATH to a colon
|
||||
separated path where ccache will look for the real compilers\&. If you
|
||||
don\&'t do this then ccache will look for the first executable matching
|
||||
the compiler name in the normal PATH that isn\&'t a symbolic link to
|
||||
ccache itself\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_CC\fP"
|
||||
You can optionally set CCACHE_CC to force the name
|
||||
of the compiler to use\&. If you don\&'t do this then ccache works it out
|
||||
from the command line\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_PREFIX\fP"
|
||||
This option adds a prefix to the command line
|
||||
that ccache runs when invoking the compiler\&. Also see the section
|
||||
below on using ccache with distcc\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_DISABLE\fP"
|
||||
If you set the environment variable
|
||||
CCACHE_DISABLE then ccache will just call the real compiler,
|
||||
bypassing the cache completely\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_READONLY\fP"
|
||||
the CCACHE_READONLY environment variable
|
||||
tells ccache to attempt to use existing cached object files, but not
|
||||
to try to add anything new to the cache\&. If you are using this because
|
||||
your CCACHE_DIR is read-only, then you may find that you also need to
|
||||
set CCACHE_TEMPDIR as otherwise ccache will fail to create the
|
||||
temporary files\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_CPP2\fP"
|
||||
If you set the environment variable CCACHE_CPP2
|
||||
then ccache will not use the optimisation of avoiding the 2nd call to
|
||||
the pre-processor by compiling the pre-processed output that was used
|
||||
for finding the hash in the case of a cache miss\&. This is primarily a
|
||||
debugging option, although it is possible that some unusual compilers
|
||||
will have problems with the intermediate filename extensions used in
|
||||
this optimisation, in which case this option could allow ccache to be
|
||||
used\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_NOSTATS\fP"
|
||||
If you set the environment variable
|
||||
CCACHE_NOSTATS then ccache will not update the statistics files on
|
||||
each compile\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_NLEVELS\fP"
|
||||
The environment variable CCACHE_NLEVELS allows
|
||||
you to choose the number of levels of hash in the cache directory\&. The
|
||||
default is 2\&. The minimum is 1 and the maximum is 8\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_HARDLINK\fP"
|
||||
If you set the environment variable
|
||||
CCACHE_HARDLINK then ccache will attempt to use hard links from the
|
||||
cache directory when creating the compiler output rather than using a
|
||||
file copy\&. Using hard links is faster, but can confuse programs like
|
||||
\&'make\&' that rely on modification times\&. Hard links are never made for
|
||||
compressed cache files\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_RECACHE\fP"
|
||||
This forces ccache to not use any cached
|
||||
results, even if it finds them\&. New results are still cached, but
|
||||
existing cache entries are ignored\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_UMASK\fP"
|
||||
This sets the umask for ccache and all child
|
||||
processes (such as the compiler)\&. This is mostly useful when you wish
|
||||
to share your cache with other users\&. Note that this also affects the
|
||||
file permissions set on the object files created from your
|
||||
compilations\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_HASHDIR\fP"
|
||||
This tells ccache to hash the current working
|
||||
directory when calculating the hash that is used to distinguish two
|
||||
compiles\&. This prevents a problem with the storage of the current
|
||||
working directory in the debug info of a object file, which can lead
|
||||
ccache to give a cached object file that has the working directory in
|
||||
the debug info set incorrectly\&. This option is off by default as the
|
||||
incorrect setting of this debug info rarely causes problems\&. If you
|
||||
strike problems with gdb not using the correct directory then enable
|
||||
this option\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_UNIFY\fP"
|
||||
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
|
||||
normal hash, so setting this environment variable loses a little bit
|
||||
of speed, but it means that ccache can take advantage of not
|
||||
recompiling when the changes to the source code consist of
|
||||
reformatting only\&. Note that using CCACHE_UNIFY changes the hash, so
|
||||
cached compiles with CCACHE_UNIFY set cannot be used when
|
||||
CCACHE_UNIFY is not set and vice versa\&. The reason the unifier is off
|
||||
by default is that it can give incorrect line number information in
|
||||
compiler warning messages\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_EXTENSION\fP"
|
||||
Normally ccache tries to automatically
|
||||
determine the extension to use for intermediate C pre-processor files
|
||||
based on the type of file being compiled\&. Unfortunately this sometimes
|
||||
doesn\&'t work, for example when using the aCC compiler on HP-UX\&. On
|
||||
systems like this you can use the CCACHE_EXTENSION option to override
|
||||
the default\&. On HP-UX set this environment variable to "i" if you use
|
||||
the aCC compiler\&.
|
||||
.IP
|
||||
.IP "\fBCCACHE_NOCOMPRESS\fP"
|
||||
If you set the environment variable
|
||||
CCACHE_NOCOMPRESS then there is no compression used on files that go
|
||||
into the cache\&.
|
||||
.IP
|
||||
.PP
|
||||
.SH "CACHE SIZE MANAGEMENT"
|
||||
.PP
|
||||
By default ccache has a one gigabyte limit on the cache size and no
|
||||
maximum number of files\&. You can set a different limit using the
|
||||
"ccache \-M" and "ccache \-F" options, which set the size and number of
|
||||
files limits\&.
|
||||
.PP
|
||||
When these limits are reached ccache will reduce the cache to 20%
|
||||
below the numbers you specified in order to avoid doing the cache
|
||||
clean operation too often\&.
|
||||
.PP
|
||||
.SH "CACHE COMPRESSION"
|
||||
.PP
|
||||
By default ccache will compress all files it puts into the cache
|
||||
using the zlib compression\&. While this involves a negligible
|
||||
performance slowdown, it significantly increases the number of files
|
||||
that fit in the cache\&. You can turn off compression setting the
|
||||
CCACHE_NOCOMPRESS environment variable\&.
|
||||
.PP
|
||||
.SH "HOW IT WORKS"
|
||||
.PP
|
||||
The basic idea is to detect when you are compiling exactly the same
|
||||
code a 2nd time and use the previously compiled output\&. You detect
|
||||
that it is the same code by forming a hash of:
|
||||
.PP
|
||||
.IP o
|
||||
the pre-processor output from running the compiler with \-E
|
||||
.IP o
|
||||
the command line options
|
||||
.IP o
|
||||
the real compilers size and modification time
|
||||
.IP o
|
||||
any stderr output generated by the compiler
|
||||
.PP
|
||||
These are hashed using md4 (a strong hash) and a cache file is formed
|
||||
based on that hash result\&. When the same compilation is done a second
|
||||
time ccache is able to supply the correct compiler output (including
|
||||
all warnings etc) from the cache\&.
|
||||
.PP
|
||||
ccache has been carefully written to always produce exactly the same
|
||||
compiler output that you would get without the cache\&. If you ever
|
||||
discover a case where ccache changes the output of your compiler then
|
||||
please let me know\&.
|
||||
.PP
|
||||
.SH "USING CCACHE WITH DISTCC"
|
||||
.PP
|
||||
distcc is a very useful program for distributing compilation across a
|
||||
range of compiler servers\&. It is often useful to combine distcc with
|
||||
ccache, so that compiles that are done are sped up by distcc, but that
|
||||
ccache avoids the compile completely where possible\&.
|
||||
.PP
|
||||
To use distcc with ccache I recommend using the CCACHE_PREFIX
|
||||
option\&. You just need to set the environment variable CCACHE_PREFIX to
|
||||
\&'distcc\&' and ccache will prefix the command line used with the
|
||||
compiler with the command \&'distcc\&'\&.
|
||||
.PP
|
||||
.SH "SHARING A CACHE"
|
||||
.PP
|
||||
A group of developers can increase the cache hit rate by sharing a
|
||||
cache directory\&. The hard links however cause unwanted side effects,
|
||||
as all links to a cached file share the file\&'s modification timestamp\&.
|
||||
This results in false dependencies to be triggered by timestamp-based
|
||||
build systems whenever another user links to an existing
|
||||
file\&. Typically, users will see that their libraries and binaries are
|
||||
relinked without reason\&. To share a cache without side effects, the
|
||||
following conditions need to be met:
|
||||
.PP
|
||||
.IP o
|
||||
Use the same \fBCCACHE_DIR\fP environment variable setting
|
||||
.IP o
|
||||
Set the \fBCCACHE_NOLINK\fP environment variable
|
||||
.IP o
|
||||
Make sure everyone sets the CCACHE_UMASK environment variable
|
||||
to 002, this ensures that cached files are accessible to everyone in
|
||||
the group\&.
|
||||
.IP o
|
||||
Make sure that all users have write permission in the entire
|
||||
cache directory (and that you trust all users of the shared cache)\&.
|
||||
.IP o
|
||||
Make sure that the setgid bit is set on all directories in the
|
||||
cache\&. This tells the filesystem to inherit group ownership for new
|
||||
directories\&. The command "chmod g+s `find $CCACHE_DIR \-type d`" might
|
||||
be useful for this\&.
|
||||
.PP
|
||||
.SH "HISTORY"
|
||||
.PP
|
||||
ccache was inspired by the compilercache shell script script written
|
||||
by Erik Thiele and I would like to thank him for an excellent piece of
|
||||
work\&. See
|
||||
http://www\&.erikyyy\&.de/compilercache/
|
||||
for the Erik\&'s scripts\&.
|
||||
.PP
|
||||
I wrote ccache because I wanted to get a bit more speed out of a
|
||||
compiler cache and I wanted to remove some of the limitations of the
|
||||
shell-script version\&.
|
||||
.PP
|
||||
.SH "DIFFERENCES FROM COMPILERCACHE"
|
||||
.PP
|
||||
The biggest differences between Erik\&'s compilercache script and ccache
|
||||
are:
|
||||
.IP o
|
||||
ccache is written in C, which makes it a bit faster (calling out to
|
||||
external programs is mostly what slowed down the scripts)\&.
|
||||
.IP o
|
||||
ccache can automatically find the real compiler
|
||||
.IP o
|
||||
ccache keeps statistics on hits/misses
|
||||
.IP o
|
||||
ccache can do automatic cache management
|
||||
.IP o
|
||||
ccache can cache compiler output that includes warnings\&. In many
|
||||
cases this gives ccache a much higher cache hit rate\&.
|
||||
.IP o
|
||||
ccache can handle a much wider ranger of compiler options
|
||||
.IP o
|
||||
ccache avoids a double call to cpp on a cache miss
|
||||
.PP
|
||||
.SH "CREDITS"
|
||||
.PP
|
||||
Thanks to the following people for their contributions to ccache
|
||||
.IP o
|
||||
Erik Thiele for the original compilercache script
|
||||
.IP o
|
||||
Luciano Rocha for the idea of compiling the pre-processor output
|
||||
to avoid a 2nd cpp pass
|
||||
.IP o
|
||||
Paul Russell for many suggestions and the debian packaging
|
||||
.PP
|
||||
.SH "AUTHOR"
|
||||
.PP
|
||||
ccache was written by Andrew Tridgell
|
||||
http://samba\&.org/~tridge/
|
||||
.PP
|
||||
If you wish to report a problem or make a suggestion then please email
|
||||
bugs@ccache\&.samba\&.org
|
||||
.PP
|
||||
ccache is released under the GNU General Public License version 2 or
|
||||
later\&. Please see the file COPYING for license details\&.
|
||||
|
|
@ -1,318 +0,0 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<html><head><title>ccache</title>
|
||||
|
||||
<link rev="made" href="mailto:bugs@ccache.samba.org">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<hr>
|
||||
|
||||
<h1>ccache</h1>
|
||||
<h2>April 2002</h2>
|
||||
|
||||
|
||||
|
||||
<h2>NAME</h2>
|
||||
ccache - a fast compiler cache
|
||||
<h2>SYNOPSIS</h2>
|
||||
|
||||
<p>ccache [OPTION]
|
||||
<p>ccache <compiler> [COMPILER OPTIONS]
|
||||
<p><compiler> [COMPILER OPTIONS]
|
||||
<p><h2>DESCRIPTION</h2>
|
||||
|
||||
<p>ccache is a compiler cache. It speeds up re-compilation of C/C++ code
|
||||
by caching previous compiles and detecting when the same compile is
|
||||
being done again.
|
||||
<p><h2>OPTIONS SUMMARY</h2>
|
||||
|
||||
<p>Here is a summary of the options to ccache.
|
||||
<p><pre>
|
||||
|
||||
-s show statistics summary
|
||||
-z zero statistics
|
||||
-c run a cache cleanup
|
||||
-C clear the cache completely
|
||||
-F <maxfiles> set maximum files in cache
|
||||
-M <maxsize> set maximum size of cache (use G, M or K)
|
||||
-h this help page
|
||||
-V print version number
|
||||
|
||||
</pre>
|
||||
|
||||
<p><h2>OPTIONS</h2>
|
||||
|
||||
<p>These options only apply when you invoke ccache as "ccache". When
|
||||
invoked as a compiler none of these options apply. In that case your
|
||||
normal compiler options apply and you should refer to your compilers
|
||||
documentation.
|
||||
<p><dl>
|
||||
<p></p><dt><strong><strong>-h</strong></strong><dd> Print a options summary page
|
||||
<p><p></p><dt><strong><strong>-s</strong></strong><dd> Print the current statistics summary for the cache. The
|
||||
statistics are stored spread across the subdirectories of the
|
||||
cache. Using "ccache -s" adds up the statistics across all
|
||||
subdirectories and prints the totals.
|
||||
<p><p></p><dt><strong><strong>-z</strong></strong><dd> Zero the cache statistics.
|
||||
<p><p></p><dt><strong><strong>-V</strong></strong><dd> Print the ccache version number
|
||||
<p><p></p><dt><strong><strong>-c</strong></strong><dd> Clean the cache and re-calculate the cache file count and
|
||||
size totals. Normally the -c option should not be necessary as ccache
|
||||
keeps the cache below the specified limits at runtime and keeps
|
||||
statistics up to date on each compile. This option is mostly useful
|
||||
if you manually modify the cache contents or believe that the cache
|
||||
size statistics may be inaccurate.
|
||||
<p><p></p><dt><strong><strong>-C</strong></strong><dd> Clear the entire cache, removing all cached files.
|
||||
<p><p></p><dt><strong><strong>-F maxfiles</strong></strong><dd> This sets the maximum number of files allowed in
|
||||
the cache. The value is stored inside the cache directory and applies
|
||||
to all future compiles. Due to the way the value is stored the actual
|
||||
value used is always rounded down to the nearest multiple of 16.
|
||||
<p><p></p><dt><strong><strong>-M maxsize</strong></strong><dd> This sets the maximum cache size. You can specify
|
||||
a value in gigabytes, megabytes or kilobytes by appending a G, M or K
|
||||
to the value. The default is gigabytes. The actual value stored is
|
||||
rounded down to the nearest multiple of 16 kilobytes.
|
||||
<p></dl>
|
||||
<p><h2>INSTALLATION</h2>
|
||||
|
||||
<p>There are two ways to use ccache. You can either prefix your compile
|
||||
commands with "ccache" or you can create a symbolic link between
|
||||
ccache and the names of your compilers. The first method is most
|
||||
convenient if you just want to try out ccache or wish to use it for
|
||||
some specific projects. The second method is most useful for when you
|
||||
wish to use ccache for all your compiles.
|
||||
<p>To install for usage by the first method just copy ccache to somewhere
|
||||
in your path.
|
||||
<p>To install for the second method do something like this:
|
||||
<pre>
|
||||
|
||||
cp ccache /usr/local/bin/
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/gcc
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/g++
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/cc
|
||||
|
||||
</pre>
|
||||
|
||||
This will work as long as /usr/local/bin comes before the path to gcc
|
||||
(which is usually in /usr/bin). After installing you may wish to run
|
||||
"which gcc" to make sure that the correct link is being used.
|
||||
<p>Note! Do not use a hard link, use a symbolic link. A hardlink will
|
||||
cause "interesting" problems.
|
||||
<p><h2>EXTRA OPTIONS</h2>
|
||||
|
||||
<p>When run as a compiler front end ccache usually just takes the same
|
||||
command line options as the compiler you are using. The only exception
|
||||
to this is the option '--ccache-skip'. That option can be used to tell
|
||||
ccache that the next option is definitely not a input filename, and
|
||||
should be passed along to the compiler as-is.
|
||||
<p>The reason this can be important is that ccache does need to parse the
|
||||
command line and determine what is an input filename and what is a
|
||||
compiler option, as it needs the input filename to determine the name
|
||||
of the resulting object file (among other things). The heuristic
|
||||
ccache uses in this parse is that any string on the command line that
|
||||
exists as a file is treated as an input file name (usually a C
|
||||
file). By using --ccache-skip you can force an option to not be
|
||||
treated as an input file name and instead be passed along to the
|
||||
compiler as a command line option.
|
||||
<p><h2>ENVIRONMENT VARIABLES</h2>
|
||||
|
||||
<p>ccache uses a number of environment variables to control operation. In
|
||||
most cases you won't need any of these as the defaults will be fine.
|
||||
<p><dl>
|
||||
<p><p></p><dt><strong><strong>CCACHE_DIR</strong></strong><dd> the CCACHE_DIR environment variable specifies
|
||||
where ccache will keep its cached compiler output. The default is
|
||||
"$HOME/.ccache".
|
||||
<p><p></p><dt><strong><strong>CCACHE_TEMPDIR</strong></strong><dd> the CCACHE_TEMPDIR environment variable specifies
|
||||
where ccache will put temporary files. The default is the same as
|
||||
CCACHE_DIR. Note that the CCACHE_TEMPDIR path must be on the same
|
||||
filesystem as the CCACHE_DIR path, so that renames of files between
|
||||
the two directories can work.
|
||||
<p><p></p><dt><strong><strong>CCACHE_LOGFILE</strong></strong><dd> If you set the CCACHE_LOGFILE environment
|
||||
variable then ccache will write some log information on cache hits
|
||||
and misses in that file. This is useful for tracking down problems.
|
||||
<p><p></p><dt><strong><strong>CCACHE_PATH</strong></strong><dd> You can optionally set CCACHE_PATH to a colon
|
||||
separated path where ccache will look for the real compilers. If you
|
||||
don't do this then ccache will look for the first executable matching
|
||||
the compiler name in the normal PATH that isn't a symbolic link to
|
||||
ccache itself.
|
||||
<p><p></p><dt><strong><strong>CCACHE_CC</strong></strong><dd> You can optionally set CCACHE_CC to force the name
|
||||
of the compiler to use. If you don't do this then ccache works it out
|
||||
from the command line.
|
||||
<p><p></p><dt><strong><strong>CCACHE_PREFIX</strong></strong><dd> This option adds a prefix to the command line
|
||||
that ccache runs when invoking the compiler. Also see the section
|
||||
below on using ccache with distcc.
|
||||
<p><p></p><dt><strong><strong>CCACHE_DISABLE</strong></strong><dd> If you set the environment variable
|
||||
CCACHE_DISABLE then ccache will just call the real compiler,
|
||||
bypassing the cache completely.
|
||||
<p><p></p><dt><strong><strong>CCACHE_READONLY</strong></strong><dd> the CCACHE_READONLY environment variable
|
||||
tells ccache to attempt to use existing cached object files, but not
|
||||
to try to add anything new to the cache. If you are using this because
|
||||
your CCACHE_DIR is read-only, then you may find that you also need to
|
||||
set CCACHE_TEMPDIR as otherwise ccache will fail to create the
|
||||
temporary files.
|
||||
<p><p></p><dt><strong><strong>CCACHE_CPP2</strong></strong><dd> If you set the environment variable CCACHE_CPP2
|
||||
then ccache will not use the optimisation of avoiding the 2nd call to
|
||||
the pre-processor by compiling the pre-processed output that was used
|
||||
for finding the hash in the case of a cache miss. This is primarily a
|
||||
debugging option, although it is possible that some unusual compilers
|
||||
will have problems with the intermediate filename extensions used in
|
||||
this optimisation, in which case this option could allow ccache to be
|
||||
used.
|
||||
<p><p></p><dt><strong><strong>CCACHE_NOSTATS</strong></strong><dd> If you set the environment variable
|
||||
CCACHE_NOSTATS then ccache will not update the statistics files on
|
||||
each compile.
|
||||
<p><p></p><dt><strong><strong>CCACHE_NLEVELS</strong></strong><dd> The environment variable CCACHE_NLEVELS allows
|
||||
you to choose the number of levels of hash in the cache directory. The
|
||||
default is 2. The minimum is 1 and the maximum is 8.
|
||||
<p><p></p><dt><strong><strong>CCACHE_HARDLINK</strong></strong><dd> If you set the environment variable
|
||||
CCACHE_HARDLINK then ccache will attempt to use hard links from the
|
||||
cache directory when creating the compiler output rather than using a
|
||||
file copy. Using hard links is faster, but can confuse programs like
|
||||
'make' that rely on modification times.
|
||||
<p><p></p><dt><strong><strong>CCACHE_RECACHE</strong></strong><dd> This forces ccache to not use any cached
|
||||
results, even if it finds them. New results are still cached, but
|
||||
existing cache entries are ignored.
|
||||
<p><p></p><dt><strong><strong>CCACHE_UMASK</strong></strong><dd> This sets the umask for ccache and all child
|
||||
processes (such as the compiler). This is mostly useful when you wish
|
||||
to share your cache with other users. Note that this also affects the
|
||||
file permissions set on the object files created from your
|
||||
compilations.
|
||||
<p><p></p><dt><strong><strong>CCACHE_HASHDIR</strong></strong><dd> This tells ccache to hash the current working
|
||||
directory when calculating the hash that is used to distinguish two
|
||||
compiles. This prevents a problem with the storage of the current
|
||||
working directory in the debug info of a object file, which can lead
|
||||
ccache to give a cached object file that has the working directory in
|
||||
the debug info set incorrectly. This option is off by default as the
|
||||
incorrect setting of this debug info rarely causes problems. If you
|
||||
strike problems with gdb not using the correct directory then enable
|
||||
this option.
|
||||
<p><p></p><dt><strong><strong>CCACHE_UNIFY</strong></strong><dd> 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
|
||||
normal hash, so setting this environment variable loses a little bit
|
||||
of speed, but it means that ccache can take advantage of not
|
||||
recompiling when the changes to the source code consist of
|
||||
reformatting only. Note that using CCACHE_UNIFY changes the hash, so
|
||||
cached compiles with CCACHE_UNIFY set cannot be used when
|
||||
CCACHE_UNIFY is not set and vice versa. The reason the unifier is off
|
||||
by default is that it can give incorrect line number information in
|
||||
compiler warning messages.
|
||||
<p><p></p><dt><strong><strong>CCACHE_EXTENSION</strong></strong><dd> Normally ccache tries to automatically
|
||||
determine the extension to use for intermediate C pre-processor files
|
||||
based on the type of file being compiled. Unfortunately this sometimes
|
||||
doesn't work, for example when using the aCC compiler on HP-UX. On
|
||||
systems like this you can use the CCACHE_EXTENSION option to override
|
||||
the default. On HP-UX set this environment variable to "i" if you use
|
||||
the aCC compiler.
|
||||
<p></dl>
|
||||
<p><h2>CACHE SIZE MANAGEMENT</h2>
|
||||
|
||||
<p>By default ccache has a one gigabyte limit on the cache size and no
|
||||
maximum number of files. You can set a different limit using the
|
||||
"ccache -M" and "ccache -F" options, which set the size and number of
|
||||
files limits.
|
||||
<p>When these limits are reached ccache will reduce the cache to 20%
|
||||
below the numbers you specified in order to avoid doing the cache
|
||||
clean operation too often.
|
||||
<p><h2>HOW IT WORKS</h2>
|
||||
|
||||
<p>The basic idea is to detect when you are compiling exactly the same
|
||||
code a 2nd time and use the previously compiled output. You detect
|
||||
that it is the same code by forming a hash of:
|
||||
<p><ul>
|
||||
<li > the pre-processor output from running the compiler with -E
|
||||
<li > the command line options
|
||||
<li > the real compilers size and modification time
|
||||
<li > any stderr output generated by the compiler
|
||||
</ul>
|
||||
<p>These are hashed using md4 (a strong hash) and a cache file is formed
|
||||
based on that hash result. When the same compilation is done a second
|
||||
time ccache is able to supply the correct compiler output (including
|
||||
all warnings etc) from the cache.
|
||||
<p>ccache has been carefully written to always produce exactly the same
|
||||
compiler output that you would get without the cache. If you ever
|
||||
discover a case where ccache changes the output of your compiler then
|
||||
please let me know.
|
||||
<p><h2>USING CCACHE WITH DISTCC</h2>
|
||||
|
||||
<p>distcc is a very useful program for distributing compilation across a
|
||||
range of compiler servers. It is often useful to combine distcc with
|
||||
ccache, so that compiles that are done are sped up by distcc, but that
|
||||
ccache avoids the compile completely where possible.
|
||||
<p>To use distcc with ccache I recommend using the CCACHE_PREFIX
|
||||
option. You just need to set the environment variable CCACHE_PREFIX to
|
||||
'distcc' and ccache will prefix the command line used with the
|
||||
compiler with the command 'distcc'.
|
||||
<p><h2>SHARING A CACHE</h2>
|
||||
|
||||
<p>A group of developers can increase the cache hit rate by sharing a
|
||||
cache directory. The hard links however cause unwanted side effects,
|
||||
as all links to a cached file share the file's modification timestamp.
|
||||
This results in false dependencies to be triggered by timestamp-based
|
||||
build systems whenever another user links to an existing
|
||||
file. Typically, users will see that their libraries and binaries are
|
||||
relinked without reason. To share a cache without side effects, the
|
||||
following conditions need to be met:
|
||||
<p><ul>
|
||||
<li > Use the same <strong>CCACHE_DIR</strong> environment variable setting
|
||||
<li > Set the <strong>CCACHE_NOLINK</strong> environment variable
|
||||
<li > Make sure everyone sets the CCACHE_UMASK environment variable
|
||||
to 002, this ensures that cached files are accessible to everyone in
|
||||
the group.
|
||||
<li > Make sure that all users have write permission in the entire
|
||||
cache directory (and that you trust all users of the shared cache).
|
||||
<li > Make sure that the setgid bit is set on all directories in the
|
||||
cache. This tells the filesystem to inherit group ownership for new
|
||||
directories. The command "chmod g+s `find $CCACHE_DIR -type d`" might
|
||||
be useful for this.
|
||||
</ul>
|
||||
<p><h2>HISTORY</h2>
|
||||
|
||||
<p>ccache was inspired by the compilercache shell script script written
|
||||
by Erik Thiele and I would like to thank him for an excellent piece of
|
||||
work. See
|
||||
<a href="http://www.erikyyy.de/compilercache/">http://www.erikyyy.de/compilercache/</a>
|
||||
for the Erik's scripts.
|
||||
<p>I wrote ccache because I wanted to get a bit more speed out of a
|
||||
compiler cache and I wanted to remove some of the limitations of the
|
||||
shell-script version.
|
||||
<p><h2>DIFFERENCES FROM COMPILERCACHE</h2>
|
||||
|
||||
<p>The biggest differences between Erik's compilercache script and ccache
|
||||
are:
|
||||
<ul>
|
||||
<li > ccache is written in C, which makes it a bit faster (calling out to
|
||||
external programs is mostly what slowed down the scripts).
|
||||
<li > ccache can automatically find the real compiler
|
||||
<li > ccache keeps statistics on hits/misses
|
||||
<li > ccache can do automatic cache management
|
||||
<li > ccache can cache compiler output that includes warnings. In many
|
||||
cases this gives ccache a much higher cache hit rate.
|
||||
<li > ccache can handle a much wider ranger of compiler options
|
||||
<li > ccache avoids a double call to cpp on a cache miss
|
||||
</ul>
|
||||
<p><h2>BUGS</h2>
|
||||
|
||||
<p>When the cache is stored on an NFS filesystem, the filesystem must be
|
||||
exported with the <strong>no_subtree_check</strong> option to make renames between
|
||||
directories reliable.
|
||||
<p><h2>CREDITS</h2>
|
||||
|
||||
<p>Thanks to the following people for their contributions to ccache
|
||||
<ul>
|
||||
<li > Erik Thiele for the original compilercache script
|
||||
<li > Luciano Rocha for the idea of compiling the pre-processor output
|
||||
to avoid a 2nd cpp pass
|
||||
<li > Paul Russell for many suggestions and the debian packaging
|
||||
</ul>
|
||||
<p><h2>AUTHOR</h2>
|
||||
|
||||
<p>ccache was written by Andrew Tridgell
|
||||
<a href="http://samba.org/~tridge/">http://samba.org/~tridge/</a>
|
||||
<p>If you wish to report a problem or make a suggestion then please email
|
||||
bugs@ccache.samba.org
|
||||
<p>ccache is released under the GNU General Public License version 2 or
|
||||
later. Please see the file COPYING for license details.
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -45,11 +45,13 @@ swightml.book:
|
|||
echo "Sections.html" >> swightml.book
|
||||
cat chapters >> swightml.book
|
||||
|
||||
clean:
|
||||
clean: clean-baks
|
||||
rm -f swightml.book
|
||||
rm -f swigpdf.book
|
||||
rm -f SWIGDocumentation.html
|
||||
rm -f SWIGDocumentation.pdf
|
||||
|
||||
clean-baks:
|
||||
rm -f *.bak
|
||||
|
||||
test:
|
||||
|
|
|
|||
26
Makefile.in
26
Makefile.in
|
|
@ -35,7 +35,18 @@ libfiles: $(srcdir)/Lib/swigwarn.swg
|
|||
maintainer: libfiles
|
||||
@cd $(SOURCE) && $(MAKE) CParse/parser.h
|
||||
|
||||
.PHONY: source libfiles maintainer
|
||||
#####################################################################
|
||||
# Documentation
|
||||
#####################################################################
|
||||
|
||||
docs: docs-main docs-ccache
|
||||
|
||||
docs-main:
|
||||
@echo making docs
|
||||
@test -d $(DOCS) || exit 0; cd $(DOCS) && $(MAKE) all clean-baks
|
||||
|
||||
docs-ccache:
|
||||
test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) docs)
|
||||
|
||||
#####################################################################
|
||||
# All the languages SWIG speaks (when it wants to)
|
||||
|
|
@ -353,13 +364,18 @@ clean-%-test-suite:
|
|||
clean-%-gifplot:
|
||||
@$(MAKE) -k -s check-$*-gifplot ACTION=clean
|
||||
|
||||
clean-docs:
|
||||
@echo cleaning Docs
|
||||
@test -d $(DOCS) || exit 0; cd $(DOCS) && $(MAKE) -s clean
|
||||
|
||||
clean-ccache:
|
||||
test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) -s clean)
|
||||
|
||||
clean-docs: clean-docs-main clean-docs-ccache
|
||||
|
||||
clean-docs-main:
|
||||
@echo cleaning Docs
|
||||
@test -d $(DOCS) || exit 0; cd $(DOCS) && $(MAKE) clean
|
||||
|
||||
clean-docs-ccache:
|
||||
@test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) clean-docs)
|
||||
|
||||
maintainer-clean: clean-libfiles
|
||||
@cd $(SOURCE) && $(MAKE) maintainer-clean
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ os.system("find "+dirname+" -name autom4te.cache -exec rm -rf {} \\;")
|
|||
|
||||
# Build documentation
|
||||
print "Building documentation"
|
||||
os.system("cd "+dirname+"/Doc/Manual && make && rm *.bak") == 0 or failed()
|
||||
os.system("cd "+dirname+" && make docs") == 0 or failed()
|
||||
|
||||
# Build the tar-ball
|
||||
os.system("tar -cf "+dirname+".tar "+dirname) == 0 or failed()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue