annotate lib/swig/swigwin-2.0.11/CCache/debian/README.Debian @ 2564:f9bdfe26d03d

.
author a.parshin
date Wed, 20 May 2015 00:56:07 +0200
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 Installing ccache
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2 -----------------
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 The recommended way to use this with Debian is to either create "cc"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 and "gcc" symlinks to /usr/bin/ccache in your private bin directory
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 (which must be before the real cc and gcc in your path), or use
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 CC="ccache gcc" on the make command line.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 Another option is to just prepend /usr/lib/ccache in your PATH
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 environment variable, like
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 export PATH="/usr/lib/ccache:$PATH"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 Note that ccache works with both native and cross compilers.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 Ignoring whitespace
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 -------------------
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 If you wish to set up ccache so that it ignores blank lines, have a
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 look at the CCACHE_UNIFY option. However, please note that this
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 option is off by default since the reported line numbers may not
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 match the source files anymore.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25 NFS Issues
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 ----------
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 (from John Coiner <john.coiner@amd.com> on the ccache mailing list)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 When CCache creates a hardlinked output file, it calls utime() to update
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31 the timestamp on the object, so that Make realizes that the object has
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32 changed.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 On NFS, utime() has no coherency guarantee, AFAIK. When utime() runs on
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 host A, and our parallel implementation of Make is running on host B,
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 sometimes Make doesn't see the new timestamp soon enough -- and neglects
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37 to relink the final binary. That's a one-way ticket to Silent Mysterious
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 Failure Town.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 Instead of relying on the object file timestamp, we create a dummy file
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 with a reliable timestamp:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43 objs/foo.o objs/foo.o.built :
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 if ( ccache gcc -o foo.o -c foo.c ) ; \
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45 then touch objs/foo.o.built ; \
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46 else exit 1; \
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47 fi
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
49 binary : objs/foo.o.built
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
50 gcc -o binary objs/foo.o
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52 NFS does make a coherency guarantee, that if a file is written and
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53 close()d on host A, and subsequently open()ed on host B, that the second
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54 open() will reflect all modifications and attributes from the close().
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55 Since Make does open() when checking timestamps, and the dummy file is
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
56 close()d when it's created, the binary will always relink after the
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
57 object is recompiled.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
58
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
59 -- Francois Marier <francois@debian.org> Sun, 20 May 2007 17:35:36 +1200