Next: Using GPRconfig, Up: Configuring with GPRconfig [Contents][Index]
GPRbuild requires one configuration file describing the languages and
toolchains to be used, and project files describing the
characteristics of the user project. Typically the configuration
file can be created automatically by GPRbuild
based on the languages
defined in your projects and the compilers on your path. In more
involved situations — such as cross compilation, or
environments with several compilers for the same language —
you may need to control more precisely the generation of
the desired configuration of toolsets. A tool, GPRconfig, described in
Configuring with GPRconfig), offers this capability. In this
chapter most of the examples can use autoconfiguration.
GPRbuild will start its build process by trying to locate a configuration file. The following tests are performed in the specified order, and the first that matches provides the configuration file to use.
<target>-<rts>.cgpr
,
<target.cgpr
, <rts>.cgpr
or default.cgpr
is found in
the default configuration files directory, this file is used. The target
and rts parameters are specified via the --target
and --RTS
switches of gprbuild
. The default directory is is share/gpr
in the installation directory of gprbuild
GPR_CONFIG
is tested
to check whether it contains the name of a valid configuration file. This
can either be an absolute path name or a base name that will be searched
in the same default directory as above.
--autoconf
switch, then
a new configuration file is automatically generated based on the specified
target and on the list of languages specified in your projects.
GPRbuild assumes that there are known compilers on your path for each of the necessary languages. It is preferable and often necessary to manually generate your own configuration file when:
GPRconfig provides several ways of generating configuration files. By default, a simple interactive mode lists all the known compilers for all known languages. You can then select a compiler for each of the languages; once a compiler has been selected, only compatible compilers for other languages are proposed. Here are a few examples of GPRconfig invocation:
<gprbuild_install_root>/share/gpr/default.cgpr)
gprconfig
gprconfig -o path/my_config.cgpr gprbuild --config=path/my_config.cgpr
gprconfig --target=ppc-elf
gprconfig --config=Ada --config=C --batch
hi
and using C for the LEON
processor.
gprconfig --target=leon-elf --config=Ada,,hi --config=C --batch -o x.cgpr