HP-UX Reference (11i v2 03/08) - 1 User Commands A-M (vol 1)

c
cc_bundled(1) cc_bundled(1)
(Bundled C Compiler - Limited Functionality)
NAME
cc - bundled C compiler
SYNOPSIS
cc [options] files
DESCRIPTION
This manual page describes the Bundled C compiler.
cc invokes the HP-UX bundled C compiler. C
source code is compiled directly to object code.
The command uses the
ctcom (Itanium(R)-based systems) or
ccom
(PA-RISC, Precision Architecture)
compiler for preprocessing, syntax and type checking, as well as for code generation.
cc accepts several types of arguments as files:
.c Suffix Arguments whose names end with
.c are understood to be C source files. Each
.c file is
compiled and the resulting object file is left in a file having the corresponding base name,
but suffixed with
.o instead of
.c. However, if a single C source file is compiled and linked
all in one step, the
.o file is deleted.
.s Suffix Arguments whose names end with
.s are understood to be assembly source files and are
assembled, producing a
.o file for each
.s file.
.i Suffix Arguments whose names end with
.i are taken to be preprocessed source files. (See the -P
option below.) Each object file is left in a file having the corresponding name, but suffixed
with
.o instead of the .i suffix.
-lx Form Arguments of the form
-lx cause the linker to search the library libx.so (Itanium-based
systems) or
libx.sl (PA-RISC) or lib
x.a in an attempt to resolve currently unresolved
external references. Because a library is searched when its name is encountered, placement
of a
-l is significant. If a file contains an unresolved external reference, the library contain-
ing the definition must be placed after the file on the command line. See ld(1) for further
details.
-l:libx.suffix Form
Arguments of the form -l:libx.suffix cause the linker to search the library
libx.so
(Itanium-based systems) or
libx.sl (PA-RISC) or libx.a (depending on suffix)inan
attempt to resolve currently unresolved external references. It is similar to the
-l option
except the current state of the -Wl,-a option is not important.
Other Suffixes
All other arguments, such as those names ending with
.o, .a,or.so are taken to be relo-
catable object files and are passed to ld (see ld(1)) to be included in the link operation.
Arguments and options can be passed to the compiler through the
CCOPTS environment variable as well
as on the command line. The compiler reads the value of CCOPTS and divides these options into two sets;
those options which appear before a vertical bar (|) delimited by whitespace, and those options which
appear after the vertical bar. The first set of options is placed before any of the command-line parame-
ters to cc; the second set of options is placed after the command-line parameters to cc. If the vertical
bar is not present, all options are placed before the command-line parameters. For example (in sh(1)
notation),
CCOPTS=-v | -lm
export CCOPTS
cc -p prog.c
is equivalent to
cc -v -p prog.c -lm
When set, the TMPDIR environment variable specifies a directory to be used by the compiler for tem-
porary files, overriding the default directory /var/tmp.
Options
NOTE: for more information about any option, see the HP C Online Help. To invoke the online help, use
your HTML browser to use the URL file:/opt/ansic/html/$LANG/guide/index.htm
(Itanium-based systems) or file:/opt/ansic/html/guide/$LANG/index.htm (PA-RISC).
Section 162 Hewlett-Packard Company 1 HP-UX 11i Version 2: August 2003