ccontrol1
Wrapper to control distcc, ccache and more
Usage
gcc
cc
c++
make
ld
ccontrol [--section=<section>]
<name> ...
ccontrol [--section=<section>]
The following
settings
are
available:
cc
c++
ld
make
ccache
distcc
distcc-hosts
distc++-hosts
cpus
no-parallel
nice
include
add make
add env
verbose
lock-file
Overview
The ccontrol(1) program takes over the roles of the compiler and linker, and reads a configuration file to decide what to do before invoking them. This is particularly useful for centralized control over commands and options, such as enabling distcc(1) and ccache(1).
When ccontrol(1) is invoked under its own name with no arguments, it prints out the settings which apply in this directory (unless --section is specified).
Versions are named after the last person to report a bug.
Options
Normally ccontrol(1) is invoked as a symboling link to cc, make, etc, so it can identify what is being invoked by examining its own name. It can also be invoked under its own name, in which case ccontrol-specific arguments can be supplied. The first non-option argument will be used to identify the invocation, eg. "ccontrol gcc ...".
The following options are supported, when invoked as ccontrol:
-
--section=<section> -
This is treated as the "current directory" for the purposes of evaluating the configuration file. As all real directories must begin with a "/" using an argument which does not, is a good way of overriding configuration for this particular invocation.
Configuration file
ccontrol’s configuration file is $HOME/.ccontrol/config. If this cannot be read (and written), your compilations will all fail. It is normal to have several different configuration files in this directory, and make default a symbolic link.
Examples
This is the minimal configuration file:
[*]
cc = /usr/bin/gcc
c++ = /usr/bin/g++
ld = /usr/bin/ld
make = /usr/bin/make
If you have multiple locations (such as a laptop) it is common to have a "global" file which is included from every configuration file, like so:
# Configuration file for when I'm at work. Lots of distcc hosts!
include = ~/.ccontrol/global
[*]
distcc-hosts = snab swarm1 swarm3 swarm4 swarm5 fandango2 mingo
distc++-hosts = snab mingo
Here is a complete configuration file with several common scenarios:
[*]
cc = /usr/bin/gcc-4.0
c++ = /usr/bin/g++-4.0
ld = /usr/bin/ld
make = /usr/bin/make
# Comment this back in for debugging
# verbose
distcc = /usr/bin/distcc
distcc-hosts = snab swarm1 swarm3 swarm4 swarm5 fandango2 mingo
distc++-hosts = snab mingo
ccache = /usr/bin/ccache
# make check should not generally be run in parallel
no-parallel = check
# Wesnoth doesn't compile with g++ 4.0
[*wesnoth*]
c++ = /usr/bin/g++-3.4
# Stupid third-party modules don't build in parallel.
[/usr/src/modules/*]
no-parallel = *
# Using distcc when testing module-init-tools causes strange effects.
[*module-init-tools*/tests/*]
distcc disable
Notes
- 1.
-
mailto:[email protected]
Releases
7 releases since Debian 4.0 (Etch); the text changed 3 times.