]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
added CCACHE_NOLINK option
authorAndrew Tridgell <tridge@samba.org>
Mon, 1 Apr 2002 06:58:31 +0000 (08:58 +0200)
committerAndrew Tridgell <tridge@samba.org>
Mon, 1 Apr 2002 06:58:31 +0000 (08:58 +0200)
ccache.1
ccache.c
ccache.yo
web/ccache-man.html

index d0e71433c187fe866e11a992e853b9b7da3e4083..58ff795a730cbfb79d2073f0de2678d9d5e9447c 100644 (file)
--- a/ccache.1
+++ b/ccache.1
@@ -139,6 +139,14 @@ If you set the environment variable
 CCACHE_NOSTATS then ccache will not update the statistics files on
 each compile\&.
 .IP 
+.IP "\fBCCACHE_NOLINK\fP" 
+If you set the environment variable
+CCACHE_NOLINK then ccache will not use hard links from the cache
+directory when creating the compiler output and will do a file copy
+instead\&. The main reason for setting this option is to avoid the
+update of the modification time on object files that are the result of
+the same compilation in a different directory\&.
+.IP 
 .IP "\fBCCACHE_NOUNIFY\fP" 
 If you set the environment variable
 CCACHE_NOUNIFY then ccache will not use the C/C++ unifier when hashing
index dfd512254381d1736d6adaed6b3299282f2e78b7..abb9ec3691f4e32544ff967ea3bb3b4d94bad81e 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -237,7 +237,11 @@ static void from_cache(int first)
        utime(stderr_file, NULL);
 
        unlink(output_file);
-       ret = link(hashname, output_file);
+       if (getenv("CCACHE_NOLINK")) {
+               ret = copy_file(hashname, output_file);
+       } else {
+               ret = link(hashname, output_file);
+       }
 
        /* the hash file might have been deleted by some external process */
        if (ret == -1 && errno == ENOENT) {
index 8646cae0c461eb64df3fce0aea8db934848c2b35..472fc7e1c74549f05f892e14da6a17b936ef08df 100644 (file)
--- a/ccache.yo
+++ b/ccache.yo
@@ -118,6 +118,13 @@ dit(bf(CCACHE_NOSTATS)) If you set the environment variable
 CCACHE_NOSTATS then ccache will not update the statistics files on
 each compile.
 
+dit(bf(CCACHE_NOLINK)) If you set the environment variable
+CCACHE_NOLINK then ccache will not use hard links from the cache
+directory when creating the compiler output and will do a file copy
+instead. The main reason for setting this option is to avoid the
+update of the modification time on object files that are the result of
+the same compilation in a different directory.
+
 dit(bf(CCACHE_NOUNIFY)) If you set the environment variable
 CCACHE_NOUNIFY then ccache will not use the C/C++ unifier when hashing
 the pre-processor output. The unifier is slower than a normal hash, so
index b8b21aa2177fc08d05ae48a52b755ea3edbc73e5..be2238122238025e122e4c1a9952440f14f41d3c 100644 (file)
@@ -116,6 +116,12 @@ bypassing the cache completely.
 <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_NOLINK</strong></strong><dd> If you set the environment variable
+CCACHE_NOLINK then ccache will not use hard links from the cache
+directory when creating the compiler output and will do a file copy
+instead. The main reason for setting this option is to avoid the
+update of the modification time on object files that are the result of
+the same compilation in a different directory.
 <p><p></p><dt><strong><strong>CCACHE_NOUNIFY</strong></strong><dd> If you set the environment variable
 CCACHE_NOUNIFY then ccache will not use the C/C++ unifier when hashing
 the pre-processor output. The unifier is slower than a normal hash, so