c89

NAME

c89, cc - compiler interface

SYNOPSIS

c89 [-cEgMPSsu] [-B linkspec] [-D name[=value]] ...
	[-I directory] ...  [-L directory] ...
	[-N nostdlib|nostdinc|nostdc|stdc]
	[-o outfile] [-O1|-O2] [-U name] [-X CL_options]
	[-Y LINK_options]  ... operand ...

cc [-cEgMPSsu] [-B linkspec] [-D name[=value]] ... [-I directory] ... [-L directory] ... [-M] [-N nostdlib|nostdinc|nostdc|stdc] [-o outfile] [-O1|-O2] [-U name] [-X CL_options] [-Y LINK_options] ... operand ...

DESCRIPTION

The c89(1) utility is an interface to the system C compiler (in this case, the Microsoft Visual C/C++ compiler).The operands are either the names of files to be compiled or linked (in which case they will have the file extensions .c or .obj), or they indicate libraries containing modules to be linked (in which case they will begin with the prefix -l).

The c89(1) utility can also be invoked as cc(1). If invoked as cc(1), it behaves differently in the following ways:

OPTIONS

The c89(1) and cc(1) utilities accept the following options:

-B linkspec
Use the GNU linker, ld(1), instead of the Visual C linker. If the argument linkspec is dynamic, the binary will be dynamically linked. If it is static, the binary will be statically linked.
-c
Compile but do not link, and do not remove any object files.
-D name[=value]
Define name as if the #define keyword had been used. If a value is given, it is assigned to name; otherwise, name has a value of 1. You can specify more than one -D option.
-E
Expand all C preprocessor directives and copy the C source files to standard output.
-g
Produce symbolic information in the object or executable files.
-I directory
Search directory for header files before looking in the usual places. You can specify more than one -I option.
-L directory
Search directory for library files before looking in the usual places. You can specify more than one -L option.
-M
Produce a linker map file. This option has no effect if you also specified -c, -E, or -P.
-N type
Enable or disable automatic inclusion of certain files, depending upon the value of type:
nostdc
Disable ANSI-only mode in the Visual C++ compiler and allows use of Microsoft extensions. By default, the compiler is run in ANSI C mode.
nostdinc
Disable automatic inclusion of standard header files.
nostdlib
Disable automatic inclusion of standard library files.
nostdlibdir
Do not search the standard directories for library files.
stdc
Enable ANSI-only mode in the VisualC++ compiler. This is the default.
-o outfile
Use the path name outfile instead of the default name a.out. This option cannot be used with -c.
-O1 | -O2
Optimize the code that is generated for the output file. Two levels (-O1 and -O2) are supported.
-P
Preprocess the C source file and write the results to a file with a .i extension in place of .c.
-S
Create an assembler listing; the format and file extension depend upon the underlying compiler.
-s
Strip symbolic names and other extraneous information from the object file or executable.
-U name
Undefine name as if the #undef keyword had been used. This takes precedence over any -D options given on the command line.
-u
Undefine all of the pre-defined macros.
-X CL_options
Passes the specified CL_options directly to the CL.EXE program.
-Y LINK_options
Passes the specified LINK_options directly to the LINK.EXE program.

The only optimization options allowed are -O1 and -O2, both of which invoke the /O2 option of the Microsoft Visual C compiler.

Libraries can also be specified by using the correct operand; for example, -l m specifies the math library. (For compatibility with older systems, the space between the -l and the library specifier is not required.) The order of operands is important; libraries are searched in the order they appear on the command line.

The c89(1) utility understands the following -l library operands:

-l c
Include the standard C library. When the linker is invoked, this library is opened last.
-l l
Include the lex(1) library.
-l m
Include the math library.
-l y
Include the yacc(1) library.

The c89(1) utility knows the default locations of the header files and the libraries, normally /usr/include and /usr/lib. It also knows about the default libraries, and includes them in the correct order.

This implementation defines the following macros to be 1: _POSIX_ and __INTERIX. When invoked as cc(1), it also defines unix.

FILES

The c89(1) utility makes use of the following files:
libc.a
Interix implementations of C run-time functions. This is placed before libcpsx.a so the Interix implementations of functions are picked up.
libcpsx.a
Microsoft Visual C/C++ C run-time library for POSIX.
psxdll.a
Interix POSIX subsystem entry points. This normally comes last in the command line.
psxrtl.a
C run-time startup code. This is placed before libcpsx.a in the final command line.

ENVIRONMENT VARIABLES

The c89(1) utility makes use of the following environment variables, if set:

C89_COMPILER
The compiler's complete path name. Case is significant (for example, /dev/fs/C/MSVC40/BIN/CL.EXE). Useful if you do not want to include /dev/fs/C/MSVC40/BIN in your PATH.
C89_ECHO
If this variable is set to 1, c89(1) displays the command lines it executes to run the compiler and linker.
C89_LINKER
The linker's complete path name. Case is significant (for example, /dev/fs/C/MSVC40/BIN/LINK.EXE). Useful if you do not want to include /dev/fs/C/MSVC40/BIN in your PATH.

DIAGNOSTICS

The c89(1) utility can return one of the following exit values:

0
Success.
>0
An error occurred.

NOTES

These interfaces work with the Microsoft Visual C/C++ compiler, not with gcc(1).

This implementation of c89(1) is an interface to the Microsoft Visual C++ 4.0 compiler (cl.exe) and linker (link.exe).

Because those programs do not understand the POSIX file name format, c89(1) explicitly unsets the LIB and INCLUDE environment variables before running. To search other directories for libraries and header files, use the -L and -I options, respectively.

The following file extensions are valid in operands:

.a
Library file.
.c
C source file.
.lib
Library file.
.o
Object file.
.obj
Object file.

SEE ALSO

gcc(1)