Configuration in the gcc Directory#
The gcc
directory is configured with an Autoconf-generated
script configure
. The configure
script is generated
from configure.ac
and aclocal.m4
. From the files
configure.ac
and acconfig.h
, Autoheader generates the
file config.in
. The file cstamp-h.in
is used as a
timestamp.
Scripts Used by configure#
configure
uses some other scripts to help in its work:
The standard GNU
config.sub
andconfig.guess
files, kept in the top level directory, are used.The file
config.gcc
is used to handle configuration specific to the particular target machine. The fileconfig.build
is used to handle configuration specific to the particular build machine. The fileconfig.host
is used to handle configuration specific to the particular host machine. (In general, these should only be used for features that cannot reasonably be tested in Autoconf feature tests.) See The config.build; config.host; and config.gcc Files, for details of the contents of these files.Each language subdirectory has a file
language/config-lang.in
that is used for front-end-specific configuration. See The Front End config-lang.in File, for details of this file.A helper script
configure.frag
is used as part of creating the output ofconfigure
.
The config.build; config.host; and config.gcc Files#
The config.build
file contains specific rules for particular systems
which GCC is built on. This should be used as rarely as possible, as the
behavior of the build system can always be detected by autoconf.
The config.host
file contains specific rules for particular systems
which GCC will run on. This is rarely needed.
The config.gcc
file contains specific rules for particular systems
which GCC will generate code for. This is usually needed.
Each file has a list of the shell variables it sets, with descriptions, at the top of the file.
Todo
document the contents of these files, and what variables should be set to control build, host and target configuration.
Files Created by configure#
Here we spell out what files will be set up by configure
in the
gcc
directory. Some other files are created as temporary files
in the configuration process, and are not used in the subsequent
build; these are not documented.
Makefile
is constructed fromMakefile.in
, together with the host and target fragments (see Makefile Fragments)t-target
andx-host
fromconfig
, if any, and language Makefile fragmentslanguage/Make-lang.in
.auto-host.h
contains information about the host machine determined byconfigure
. If the host machine is different from the build machine, thenauto-build.h
is also created, containing such information about the build machine.config.status
is a script that may be run to recreate the current configuration.configargs.h
is a header containing details of the arguments passed toconfigure
to configure GCC, and of the thread model used.cstamp-h
is used as a timestamp.If a language
config-lang.in
file (see The Front End config-lang.in File) setsoutputs
, then the files listed inoutputs
there are also generated.
The following configuration headers are created from the Makefile,
using mkconfig.sh
, rather than directly by configure
.
config.h
, bconfig.h
and tconfig.h
all contain the
xm-machine.h
header, if any, appropriate to the host,
build and target machines respectively, the configuration headers for
the target, and some definitions; for the host and build machines,
these include the autoconfigured headers generated by
configure
. The other configuration headers are determined by
config.gcc
. They also contain the typedefs for rtx
,
rtvec
and tree
.
config.h
, for use in programs that run on the host machine.bconfig.h
, for use in programs that run on the build machine.tconfig.h
, for use in programs and libraries for the target machine.tm_p.h
, which includes the headermachine-protos.h
that contains prototypes for functions in the targetmachine.c
file. Themachine-protos.h
header is included after thertl.h
and/ortree.h
would have been included. Thetm_p.h
also includes the headertm-preds.h
which is generated bygenpreds
program during the build to define the declarations and inline functions for the predicate functions.