⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ccache-man.html

📁 ccache2.4的源代码
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<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 &lt;compiler&gt; [COMPILER OPTIONS]<p>&lt;compiler&gt; [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 isbeing 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 &lt;maxfiles&gt;           set maximum files in cache-M &lt;maxsize&gt;            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". Wheninvoked as a compiler none of these options apply. In that case yournormal compiler options apply and you should refer to your compilersdocumentation.<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. Thestatistics are stored spread across the subdirectories of thecache. Using "ccache -s" adds up the statistics across allsubdirectories 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 andsize totals. Normally the -c option should not be necessary as ccachekeeps the cache below the specified limits at runtime and keepsstatistics up to date on each compile. This option is mostly usefulif you manually modify the cache contents or believe that the cachesize 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 inthe cache. The value is stored inside the cache directory and appliesto all future compiles. Due to the way the value is stored the actualvalue 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 specifya value in gigabytes, megabytes or kilobytes by appending a G, M or Kto the value. The default is gigabytes. The actual value stored isrounded 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 compilecommands with "ccache" or you can create a symbolic link betweenccache and the names of your compilers. The first method is mostconvenient if you just want to try out ccache or wish to use it forsome specific projects. The second method is most useful for when youwish to use ccache for all your compiles.<p>To install for usage by the first method just copy ccache to somewherein 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 willcause "interesting" problems.<p><h2>EXTRA OPTIONS</h2>    <p>When run as a compiler front end ccache usually just takes the samecommand line options as the compiler you are using. The only exceptionto this is the option '--ccache-skip'. That option can be used to tellccache that the next option is definitely not a input filename, andshould be passed along to the compiler as-is. <p>The reason this can be important is that ccache does need to parse thecommand line and determine what is an input filename and what is acompiler option, as it needs the input filename to determine the nameof the resulting object file (among other things). The heuristicccache uses in this parse is that any string on the command line thatexists as a file is treated as an input file name (usually a Cfile). By using --ccache-skip you can force an option to not betreated as an input file name and instead be passed along to thecompiler as a command line option.<p><h2>ENVIRONMENT VARIABLES</h2>    <p>ccache uses a number of environment variables to control operation. Inmost 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 specifieswhere 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 specifieswhere ccache will put temporary files. The default is the same asCCACHE_DIR. Note that the CCACHE_TEMPDIR path must be on the samefilesystem as the CCACHE_DIR path, so that renames of files betweenthe two directories can work.<p><p></p><dt><strong><strong>CCACHE_LOGFILE</strong></strong><dd> If you set the CCACHE_LOGFILE environmentvariable then ccache will write some log information on cache hitsand 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 colonseparated path where ccache will look for the real compilers. If youdon't do this then ccache will look for the first executable matchingthe compiler name in the normal PATH that isn't a symbolic link toccache itself.<p><p></p><dt><strong><strong>CCACHE_CC</strong></strong><dd> You can optionally set CCACHE_CC to force the nameof the compiler to use. If you don't do this then ccache works it outfrom the command line.<p><p></p><dt><strong><strong>CCACHE_PREFIX</strong></strong><dd> This option adds a prefix to the command linethat ccache runs when invoking the compiler. Also see the sectionbelow on using ccache with distcc.<p><p></p><dt><strong><strong>CCACHE_DISABLE</strong></strong><dd> If you set the environment variableCCACHE_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 variabletells ccache to attempt to use existing cached object files, but notto try to add anything new to the cache. If you are using this becauseyour CCACHE_DIR is read-only, then you may find that you also need toset CCACHE_TEMPDIR as otherwise ccache will fail to create thetemporary files.<p><p></p><dt><strong><strong>CCACHE_CPP2</strong></strong><dd> If you set the environment variable CCACHE_CPP2then ccache will not use the optimisation of avoiding the 2nd call tothe pre-processor by compiling the pre-processed output that was usedfor finding the hash in the case of a cache miss. This is primarily adebugging option, although it is possible that some unusual compilerswill have problems with the intermediate filename extensions used inthis optimisation, in which case this option could allow ccache to be

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -