From: Andrew Tridgell Date: Mon, 1 Apr 2002 06:58:31 +0000 (+0200) Subject: added CCACHE_NOLINK option X-Git-Tag: v1.4~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b46104d09d31da3baf856eed841cffa79acea4e;p=thirdparty%2Fccache.git added CCACHE_NOLINK option --- diff --git a/ccache.1 b/ccache.1 index d0e71433c..58ff795a7 100644 --- 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 diff --git a/ccache.c b/ccache.c index dfd512254..abb9ec369 100644 --- 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) { diff --git a/ccache.yo b/ccache.yo index 8646cae0c..472fc7e1c 100644 --- 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 diff --git a/web/ccache-man.html b/web/ccache-man.html index b8b21aa21..be2238122 100644 --- a/web/ccache-man.html +++ b/web/ccache-man.html @@ -116,6 +116,12 @@ bypassing the cache completely.

CCACHE_NOSTATS
If you set the environment variable CCACHE_NOSTATS then ccache will not update the statistics files on each compile. +

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.

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