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.subandconfig.guessfiles, kept in the top level directory, are used.The file
config.gccis used to handle configuration specific to the particular target machine. The fileconfig.buildis used to handle configuration specific to the particular build machine. The fileconfig.hostis 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.inthat is used for front-end-specific configuration. See The Front End config-lang.in File, for details of this file.A helper script
configure.fragis 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.
Makefileis constructed fromMakefile.in, together with the host and target fragments (see Makefile Fragments)t-targetandx-hostfromconfig, if any, and language Makefile fragmentslanguage/Make-lang.in.auto-host.hcontains information about the host machine determined byconfigure. If the host machine is different from the build machine, thenauto-build.his also created, containing such information about the build machine.config.statusis a script that may be run to recreate the current configuration.configargs.his a header containing details of the arguments passed toconfigureto configure GCC, and of the thread model used.cstamp-his used as a timestamp.If a language
config-lang.infile (see The Front End config-lang.in File) setsoutputs, then the files listed inoutputsthere 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.hthat contains prototypes for functions in the targetmachine.cfile. Themachine-protos.hheader is included after thertl.hand/ortree.hwould have been included. Thetm_p.halso includes the headertm-preds.hwhich is generated bygenpredsprogram during the build to define the declarations and inline functions for the predicate functions.