Name
tccenv — TCC Environments
Description
tcc environments are used to configure the behaviour of tcc, a special case of which is specifying the APIs used. The standard environments supplied with the release are used to represent a number of commonly used APIs, implement certain tcc command-line options, and provide a means of implementing system-specific options. User-defined environments can easily be written to correspond to a user-defined API, or to group together a number of tcc command-line options into a single file.
An environment is just a file which is interpreted by tcc when it is specified with the command-line option -Ystr, where str is the name of the file. Each environment file consists of lines of the form
*IDENTIFIER "text"
where IDENTIFIER is one of the environmental identifiers, text tells tcc how to modify the value given by this identifier, and * stands for one of the environment prefixes + < and >.
User-Defined Environments
The simplest example of a user-defined environment contains lines of the form
+FLAG "text"
which tells tcc to interpret text as if it were passed on the command-line. So, for example, an environment consisting of the lines
+FLAG "-Yposix" +FLAG "-Xs" +FLAG "-I/home/user/include"
will modify tcc to use the POSIX 1003.1 API with strict checks, and add the directory /home/user/include to the search path for #include
d files.
By default, tcc looks for environments in the current working directory and in the default environments directory. In addition, if the system variable TCCENV
is defined, this specifies a colon-separated list of directories along which tcc searches for any environment which is not a full pathname.
Supported APIs
The following standard APIs are supported in the form of TenDRA headers:
API Name | Type | Description |
---|---|---|
ansi | base (default) | ANSI X3.159 |
iso | base | ISO MSE 9899:1990 (Ammendment 1:1993 (E)) |
posix | base | POSIX 1003.1 |
posix2 | base | POSIX 1003.2 |
xpg3 | base | X/Open Portability Guide 3 |
xpg4 | base | X/Open Portability Guide 4 |
cose [a] | base | COSE 1170 |
svid3 | base | System V Interface Definition 3rd Edition |
aes | base | AES Revision A |
bsd_extn [b] | extension | BSD-like extension for use with POSIX etc. |
x5_lib | extension | X11 (Release 5) X Library |
x5_t [c] | extension | X11 (Release 5) Intrinsics Toolkit |
x5_mu | extension | X11 (Release 5) Miscellaneous Utilities |
x5_aw | extension | X11 (Release 5) Athena Widgets |
x5_mit [d] | extension | X11 (Release 5) MIT implementation |
x5_proto | extension | X11 (Release 5) Protocol Extension |
x5_ext | extension | X11 (Release 5) Extensions |
motif | extension | Motif 1.1 |
system | – | System headers as main API |
system+ | – | System headers as last resort extension API |
- [a]
This API description is based on an early version of the COSE 1170 specification and may be subject to revision.
- [b]
The BSD extension API consists of a pragmatic collection of BSD types and functions which are commonly found on non-BSD machines. It roughly corresponds to the BSD component of COSE (it contains sockets, select, etc.).
- [c]
The X11 private headers are further protected. If the private headers are required the option -Yx5_private should also be given.
- [d]
This API is designed to cover some of the commonly used features from MIT-based X11 implementations which are not actually part of the X11 specification.
Each API is specified to tcc by means of an environment with the same name as the API. Thus, for example, -Yposix specifies POSIX 1003.1. APIs are divided into two types, base APIs, such as POSIX 1003.1, and extension APIs, such as the X11 (Release 5) Toolkit. A program API consists of a base API plus an number of extension APIs, for example, POSIX plus the X11 Toolkit. This example would be specified by means of the options -Yposix -Yx5_t, in that order (base APIs override the previous API, extension APIs add to it).
Information on the current API may be printed by passing the -info option to tcc.
Full Environment List
The majority of the standard environments can be divided into two classes: those which correspond to APIs and those which implement tcc command-line options. (In addition to these, a small number are used to enable extra tools and to specify minimum integer sizes.)
The API environments are subdivided into base APIs (such as ANSI, POSIX) and extension APIs (such as the X11 environments):
API Name | Type | Description |
---|---|---|
ansi | base (default) | ANSI X3.159 |
iso | base | ISO/IEC 9899:1990 (Amendment 1:L1995 (E)) |
posix | base | the POSIX (IEEE 1003.1:1988) |
posix1 | base | the POSIX.1 (ISO/IEC 9945-1:1990) |
posix2 | base | the POSIX.2 (ISO/IEC 9945-2:1993) |
xpg3 | base | the X/Open Portability Guide 3 |
xpg4 | base | the X/Open Portability Guide 4 |
unix95 | base | the X/Open Single UNIX Specification (Spec 1170) |
svid3 | base | the System V Interface Definition (3rd Edition) |
aes | base | Application Environment Specification (Revision A) |
bsd_extn | extension | BSD-like extension for use with POSIX, etc. |
x5_lib | extension | X11 (Release 5) X Library |
x5_t | extension | X11 (Release 5) Intrinsics Toolkit |
x5_mu | extension | X11 (Release 5) Miscellaneous Utilities |
x5_aw | extension | X11 (Release 5) Athena Widgets |
x5_mit | extension | X11 (Release 5) MIT Implementation |
x5_proto | extension | X11 (Release 5) Protocol Extension |
x5_ext | extension | X11 (Release 5) Extensions |
motif_1_1 | extension | Motif (Release 1.1) |
motif_1_2 | extension | Motif (Release 1.2) |
system | extension | System headers as main API |
system+ | extension | System headers as last resort extension API |
tdf_ext | extension | compilation using TDF Version 4.0 extensions |
Some environments are available which modify access to previously specified APIs:
Environment | Description |
---|---|
x5_private | permit access to X11 Release 5 private headers (*P.h) |
motif_private | permit access to Motif private headers (*P.h) |
Note that TDF token libraries for all these APIs will not be available on all platforms, so it may not be possible run installers for programs compiled with all API environments. It will always be possible to check code with any API environment using tcc -ch
.
The following environments are used to specify the use of particular tools (where available) which are not enabled by default:
Environment | Description |
---|---|
c++ | enables the C++ producer/checker tcpplus. |
pl_tdf | enables the PL_TDF compiler tpl. |
tnc | enables the TDF notation compiler tnc. |
The default behaviour of tcc is to assume the minimal sizes of integer types allowed by ANSI. This behaviour can be modified with the following environments:
Environment | Description |
---|---|
16bit | specifies minimal integer sizes allowed by ANSI (default) |
32bit | specifies integer sizes found on most 32-bit machines |
In addition to these, the following implement target-specific options:
Environment | Description |
---|---|
aout | Use a.out instead of ELF format (386 Linux ELF only). |
static | Use static instead of dynamic linking (Alpha only). |
Environmental Identifiers
In the following list, the environmental prefix * must be replaced by one of + (which replaces the existing value), < (which adds a value to the beginning of the existing list), or > (which adds a value to the end of the existing list).
Identifier | Description |
---|---|
*API_NAME | modifies the list of API analysis environment names |
*AS | modifies the system assembler executable |
*AS1 | modifies the auxiliary assembler executable (MIPS and Alpha only) |
*CC | modifies the system compiler executable |
*CPP_SPEC_LINK | modifies the C++ spec linker executable |
*CRT0 | modifies the first list of initial default .o files |
*CRT1 | modifies the second list of initial default .o files |
*CRTP_N | modifies the list of additional default .o files (-Yprom only) |
*CRTN | modifies the list of final default .o files |
*DISP | modifies the TDF pretty printer executable |
*DUMP_ANAL | modifies the dump-file analyser executable |
*DUMP_LINK | modifies the dump linker executable |
*DYN_LINK | modifies the dynamic-initialisation linker executable (RS6000 and Sparc only) |
+ENVDIR | sets the default environment directory |
+FLAG | passes a flag to tcc |
+FLAG_AS | passes a flag to the assembler |
+FLAG_AS1 | passes a flag to the auxiliary assembler (MIPS and Alpha only) |
+FLAG_CC | passes a flag to the system compiler |
+FLAG_CPP_SPEC_LINK | passes a flag to the C++ spec linker |
+FLAG_DISP | passes a flag to the TDF pretty printer |
+FLAG_DUMP_ANAL | passes a flag to the dump-file analyser |
+FLAG_DUMP_LINK | passes a flag to the dump linker |
+FLAG_DYN_LINK | passes a flag to the dynamic-initialisation linker ((RS6000 and Sparc only) |
+FLAG_INSTALL | passes a flag to the TDF archive builder |
+FLAG_LD | passes a flag to the system linker |
+FLAG_PL_TDF | passes a flag to the PL_TDF compiler |
+FLAG_SPEC_LINKER | passes a flag to the C spec linker |
+FLAG_TCPPLUS | passes a flag to the C++ producer |
+FLAG_TCPPLUSPP | passes a flag to the C++ preprocessor |
+FLAG_TDFC | passes a flag to the C producer |
+FLAG_TDFCPP | passes a flag to the C preprocessor |
+FLAG_TLD | passes a flag to the TDF linker |
+FLAG_TNC | passes a flag to the TDF notation compiler |
+FLAG_TRANS | passes a flag to the TDF translator |
*INCL | modifies the list of default include file directories |
*INFO | modifies the list of API information |
*LD | modifies the system linker executable |
*LIB | modifies the list of default TDF libraries |
+LINE_START | inserts a line in the tcc built-in start-up file |
+LINE_END | inserts a line in the tcc built-in end-up file |
*LINK | modifies the list of default TDF library directories |
*LINK_ENTRY | modifies the linker options specifying the entry point |
+PORTABILITY | sets the producer portability table |
*PL_TDF | modifies the PL_TDF compiler executable |
*SPEC_LINK | modifies the C spec linker executable |
*STARTUP | modifies the list of default C producer start-up files |
*STARTUP_DIR | modifies the list of default C producer start-up directories |
*STARTUP_CPP | modifies the list of default C++ producer start-up files |
*STARTUP_CPP_DIR | modifies the list of default C++ producer start-up directories |
*SUFFIX_CPP | sets the filename suffix override for C++ source files |
*SYS_LIB | modifies the list of default system libraries |
*SYS_LIBC | modifies the list of standard system libraries |
*SYS_LINK | modifies the list of default system library directories |
*TCPPLUS | modifies the C++ producer executable |
*TCPPLUSPP | modifies the C++ preprocessor executable |
*TDFC | modifies the C producer executable |
*TDFCPP | modifies the C preprocessor executable |
+TEMP | sets the temporary directory |
*TLD | modifies the TDF linker executable |
*TNC | modifies the TDF notation compiler executable |
*TRANS | modifies the TDF translator executable |
Environment Identifiers
The following tcc environment identifiers are recognised:
Identifier | Description |
---|---|
*AS | Modifies the system assembler executable |
*AS1 | Modifies the auxilliary system assembler executable (Mips only) |
*CC | Modifies the system compiler executable |
*CRT0 | Modifies the first list of initial default .o files |
*CRT1 | Modifies the second list of initial default .o files |
*CRTN | Modifies the list of final default .o files |
*DISP | Modifies the TDF pretty printer executable |
+ENVDIR | Sets the main environment directory |
+FLAG | Passes a flag to tcc |
+FLAG_AS | Passes a flag to the assembler |
+FLAG_CC | Passes a flag to the system compiler |
+FLAG_DISP | Passes a flag to the TDF pretty printer |
+FLAG_INSTALL | Passes a flag to the TDF archive builder |
+FLAG_LD | Passes a flag to the system linker |
+FLAG_SPEC_LINK | Passes a flag to the C spec linker |
+FLAG_TDFC | Passes a flag to the producer |
+FLAG_TDFCPP | Passes a flag to the preprocessor |
+FLAG_TLD | Passes a flag to the TDF linker |
+FLAG_TNC | Passes a flag to the TDF notation compiler |
+FLAG_TRANS | Passes a flag to the TDF translator |
*INCL | Modifies the list of default include file directories |
*INFO | Modifies the list of API information |
*LD | Modifies the system linker executable |
*LIB | Modifies the list of default TDF libraries |
+LINE_START | Inserts a line in the tcc built-in start-up file |
+LINE_END | Inserts a line in the tcc built-in end-up file |
*LINK | Modifies the list of default TDF library directories |
+PORTABILITY | Sets the producer portability table |
*SPEC_LINK | Modifies the C spec linker executable |
*STARTUP | Modifies the list of default producer start-up files |
*STARTUP_DIR | Modifies the list of default start-up directories |
*SYS_LIB | Modifies the list of default system libraries |
*SYS_LIBC | Modifies the list of standard system libraries |
*SYS_LINK | Modifies the list of default system library directories |
*TDFC | Modifies the producer executable |
*TDFCPP | Modifies the preprocessor executable |
+TEMP | Sets the temporary directory [e] |
*TLD | Modifies the TDF linker executable |
*TNC | Modifies the TDF notation compiler executable |
*TRANS | Modifies the TDF translator executable |
- [e]
The temporary directory can also be set using the TMPDIR system variable on those machines which implement the XPG3 tempnam system routine.
*
stands for any of the allowed environment modifiers +
, <
or >
.
Standard Environments
In addition to the environments implementing the supported APIs (see section 7.5. on page 31), the following environments are standard; those which alter the compilation phases:
Environment | Description |
---|---|
default | Default settings (built into tcc) |
16bit | Specifies the minimal integer sizes allowed by ANSI |
32bit | Specifies the integer sizes found on most 32-bit machines |
common | Equivalent to 32bit |
makelib | Used to construct TDF libraries |
pl_tdf | Used to specify the use of the PL_TDF compiler |
status | Causes the environment status to be reported |
tdp | Used in TDF library building |
tnc | Used to specify the use of the TDF notation compiler |
and those which form part of the implementation for command-line options:
Environment | Option Implemented |
---|---|
tcc_diag | -g |
tcc_pp | -E and -P |
tcc_prof | -p |
tcc_time | -time |
wsl | -wsl |
Goption | -G |
K-item | -K item |
Versions | -V |
Xmode | -X mode |
Z-str | -Z str |