Previous: Using GPRconfig, Up: Configuring with GPRconfig [Contents][Index]
GPRconfig itself has no hard-coded knowledge of compilers. Thus there is no need to recompile a new version of GPRconfig when a new compiler is distributed.
The role and format of the knowledge base are irrelevant for most users of GPRconfig, and are only needed when you need to add support for new compilers. You can skip this section if you only want to learn how to use GPRconfig.
All knowledge of compilers is embedded in a set of XML files called the knowledge base. Users can easily contribute to this general knowledge base, and have GPRconfig immediately take advantage of any new data.
The knowledge base contains various kinds of information:
When it is run interactively, GPRconfig searches the user’s
PATH
for known compilers, and tries to deduce their
configuration (version, supported languages, supported targets, run-times,
…). From the knowledge base GPRconfig knows how to extract the
relevant information about a compiler.
This step is optional, since a user can also enter all the information manually. However, it is recommended that the knowledge base explicitly list its known compilers, to make configuration easier for end users.
When a compiler is used, depending on its version, target, run-time,…, some specific command line switches might have to be supplied. The knowledge base is a good place to store such information.
For instance, with the GNAT compiler, using the soft-float runtime should force gprbuild to use the -msoft-float compilation switch.
Linking a multi-language application often has some subtleties, and typically requires specific linker switches. These switches depend on the list of languages, the list of compilers,….
It is sometimes not possible to link together code compiled with two particular compilers. The knowledge base should store this information, so that end users are informed immediately when attempting to use such a compiler combination.
The end of this section will describe in more detail the format of this knowledge base, so that you can add your own information and have GPRconfig advantage of it.