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:
-L and -o become operands, not options: they can
be in any position in the command line. When invoked as
c89(1), the -L and -o arguments are options
and must come before any operands. In c89(1), the
libraries are operands, not options (even though they begin
with -l), and must be placed at the end of the command
line.
The option -Dunix is passed, so the macro
unix is defined.
Compiler extensions to the ANSI C standard (such as additional
keywords) are allowed. (c89(1) does not allow extensions.)
The c89(1) and cc(1) utilities accept the
following options:
-Blinkspec
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.
-Dname[=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.
-Idirectory
Search directory for header files before looking in the
usual places. You can specify more than one -I option.
-Ldirectory
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.
-Ntype
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.
-ooutfile
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.
-Uname
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.
-XCL_options
Passes the specified CL_options directly to the
CL.EXE program.
-YLINK_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.
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.
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: