Reference

tccenv(5)

Environments for tcc

NAME

tccenv - Environments for tcc

DESCRIPTION

Tcc environments are used to configure the behaviour of tcc(1), 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(1) 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(1) command-line options into a single file.

An environment is just a file which is interpreted by tcc(1) when it is specified with the command-line option -Ystring, where string 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(1) 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(1) 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(1) to use the POSIX 1003.1 API with strict checks, and add the directory /home/user/include to the search path for #included files.

By default, tcc(1) 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(1) searches for any environment which is not a full pathname.

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(1) 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):

ansithe ANSI X3.159 API (this is the default API environment)
isothe ISO/IEC 9899:1990 (Amendment 1:L1995 (E)) API
posixthe POSIX (IEEE 1003.1:1988) API
posix1the POSIX.1 (ISO/IEC 9945-1:1990) API
posix2the POSIX.2 (ISO/IEC 9945-2:1993) API
xpg3the X/Open Portability Guide 3
xpg4the X/Open Portability Guide 4
unix95the X/Open Single UNIX Specification (Spec 1170)
svid3the System V Interface Definition (3rd Edition)
aesthe Application Environment Specification (Revision A) API
bsd_extnBSD-like extension for use with POSIX, etc.
x5_libX11 (Release 5) X Library
x5_tX11 (Release 5) Intrinsics Toolkit
x5_muX11 (Release 5) Miscellaneous Utilities
x5_awX11 (Release 5) Athena Widgets
x5_mitX11 (Release 5) MIT Implementation
x5_protoX11 (Release 5) Protocol Extension
x5_extX11 (Release 5) Extensions
motif_1_1Motif (Release 1.1)
motif_1_2Motif (Release 1.2)
systemSystem headers as main API
system+System headers as last resort extension API
tdf_extcompilation using TDF Version 4.0 extensions

Some environments are available which modify access to previously specified APIs:

x5_privatepermit access to X11 Release 5 private headers (*P.h)
motif_privatepermit 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 tchk(1).

The following environments are used to specify the use of particular tools (where available) which are not enabled by default:

c++enables the C++ producer/checker tcpplus.
pl_tdfenables the PL_TDF compiler pl.
tncenables the TDF notation compiler tnc.

The default behaviour of tcc(1) is to assume the minimal sizes of integer types allowed by ANSI. This behaviour can be modified with the following environments:

16bitspecifies minimal integer sizes allowed by ANSI (default)
32bitspecifies integer sizes found on most 32-bit machines

In addition to these, the following implement target-specific options:

aoutUse a.out instead of ELF format (386 Linux ELF only).
staticUse 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).

*API_NAMEmodifies the list of API analysis environment names
*ASmodifies the system assembler executable
*AS1modifies the auxiliary assembler executable (Mips and Alpha only)
*CCmodifies the system compiler executable
*CPP_SPEC_LINKmodifies the C++ spec linker executable
*CRT0modifies the first list of initial default .o files
*CRT1modifies the second list of initial default .o files
*CRTP_Nmodifies the list of additional default .o files (-Yprom only)
*CRTNmodifies the list of final default .o files
*DISPmodifies the TDF pretty printer executable
*DUMP_ANALmodifies the dump-file analyser executable
*DUMP_LINKmodifies the dump linker executable
*DYN_LINKmodifies the dynamic-initialisation linker executable (RS6000 and Sparc only)
+ENVDIRsets the default environment directory
+FLAGpasses a flag to tcc(1)
+FLAG_ASpasses a flag to the assembler
+FLAG_AS1passes a flag to the auxiliary assembler (Mips and Alpha only)
+FLAG_CCpasses a flag to the system compiler
+FLAG_CPP_SPEC_LINKpasses a flag to the C++ spec linker
+FLAG_DISPpasses a flag to the TDF pretty printer
+FLAG_DUMP_ANALpasses a flag to the dump-file analyser
+FLAG_DUMP_LINKpasses a flag to the dump linker
+FLAG_DYN_LINKpasses a flag to the dynamic-initialisation linker ((RS6000 and Sparc only)
+FLAG_INSTALLpasses a flag to the TDF archive builder
+FLAG_LDpasses a flag to the system linker
+FLAG_PL_TDFpasses a flag to the PL_TDF compiler
+FLAG_SPEC_LINKERpasses a flag to the C spec linker
+FLAG_TCPPLUSpasses a flag to the C++ producer
+FLAG_TCPPLUSPPpasses a flag to the C++ preprocessor
+FLAG_TDFCpasses a flag to the C producer
+FLAG_TDFCPPpasses a flag to the C preprocessor
+FLAG_TLDpasses a flag to the TDF linker
+FLAG_TNCpasses a flag to the TDF notation compiler
+FLAG_TRANSpasses a flag to the TDF translator
*INCLmodifies the list of default include file directories
*INFOmodifies the list of API information
*LDmodifies the system linker executable
*LIBmodifies the list of default TDF libraries
+LINE_STARTinserts a line in the tcc(1) built-in start-up file
+LINE_ENDinserts a line in the tcc(1) built-in end-up file
*LINKmodifies the list of default TDF library directories
*LINK_ENTRYmodifies the linker options specifying the entry point
+MACHINEsets the target machine type
+PORTABILITYsets the producer portability table
*PL_TDFmodifies the PL_TDF compiler executable
*SPEC_LINKmodifies the C spec linker executable
*STARTUPmodifies the list of default C producer start-up files
*STARTUP_DIRmodifies the list of default C producer start-up directories
*STARTUP_CPPmodifies the list of default C++ producer start-up files
*STARTUP_CPP_DIRmodifies the list of default C++ producer start-up directories
*SUFFIX_CPPsets the filename suffix override for C++ source files
*SYS_LIBmodifies the list of default system libraries
*SYS_LIBCmodifies the list of standard system libraries
*SYS_LINKmodifies the list of default system library directories
*TCPPLUSmodifies the C++ producer executable
*TCPPLUSPPmodifies the C++ preprocessor executable
*TDFCmodifies the C producer executable
*TDFCPPmodifies the C preprocessor executable
+TEMPsets the temporary directory
*TLDmodifies the TDF linker executable
*TNCmodifies the TDF notation compiler executable
*TRANSmodifies the TDF translator executable
+VERSIONsets the target machine version (Mips only)

SEE ALSO

tcc(1), tchk(1), tcpplus(1), pl(1), tnc(1).