c89(1) MPE/iX Shell and Utilities c89(1)
______________________________________________________________________
NAME
c89 - generic C compiler interface
SYNOPSIS
c89 [-cEgOs] [-D name[=value]] ... [-I directory] ... [-L
directory] ...
[-o output] [-P listfile] [-T stacksize] [-U name] ... [-
-Wphase,arg...] operand...
DESCRIPTION
Note: The MPE/iX implementation of this utility does not function
exactly as this man page describes. For details, see the MPE/iX
NOTES section at the end of this man page.
c89 is an interface to the C compiler and linker on your system.
It accepts source code conforming to the C standard. The files
specified by operands are compiled and linked to produce an exe-
cutable file. By default, the executable file is written to
a.out.
Options
c89 accepts the following options:
-c suppresses the link-edit phase of the compilation and does
not delete any object files that are produced. Each operand
of the form file.c produces an object file named file.o.
-D name[=value]
defines name as if by a #define directive. If you omit
=value, c89 assumes a value of 1.
-E copies the C source to the standard output after expanding
all preprocessor directives. The source code is not com-
piled.
-g produces symbolic information for use by debuggers in the
object or executable files.
-I directory
adds directory to the search path for #include files which
do not have absolute path names. If the name of an #include
file is enclosed in double-quotes (" "), c89 first searches
the directory of the file containing the #include directive.
It then searches the directories indicated by -I options and
finally, it searches /usr/include. If the name of an
#include file is enclosed in angle brackets (< >), c89 first
searches the directories indicated by -I options, and then
/usr/include.
-L directory
adds directory to the search path for libraries. c89 first
searches the directories indicated by -L options in the
1
c89(1) MPE/iX Shell and Utilities c89(1)
______________________________________________________________________
order they appear on the command line, and then searches
/lib and /usr/lib
-O optimizes the executable output.
-o output
writes the executable output to the file output. If you
specify the -c or -E option, no executable output is
created.
-P listfile
specifies a listing file for the C compile. It passes list-
file to the file equation for cclist. At present, it is not
possible to create a listing file using the POSIX name syn-
tax. You must use traditional MPE/iX names with this
option. For example,
c89 -c -P listing.mygroup.sys foo.c
-T stacksize
passes stacksize to the link editor which uses it to set the
native mode stack size of the program. This is equivalent to
-WL,nmstack=stacksize
-s produces stripped object and/or executable files from which
symbolic and other information not required for proper exe-
cution using exec has been removed.
-U name
undefines the symbol name. If name appears in both a -D and
a -U option, it is undefined regardless of the order in
which the options were specified.
-Wphase,arg ...
passes arguments to other phases of the compile process.
phase can normally be one of two values:
c passes the arguments (arg ...) to the C compiler.
l passes the arguments (arg ...) to the linker.
On MPE/iX, however, there are two ways to pass arguments to the
link editor. As a result, phase can be one of the following
three values:
c passes the arguments to the compiler CCOMXL.PUB.SYS
l places the arguments in the indirect file passed to the
link editor LINKEDIT.PUB.SYS
2
c89(1) MPE/iX Shell and Utilities c89(1)
______________________________________________________________________
L adds the arguments to the command line of the link edi-
tor LINKEDIT.PUB.SYS
Here is an example of how these options might be used to compile
a program that uses AIFs.
c89 "-Wl, -o AIF1" -Wc,+e "-WL,cap=ph,pm,ia;PRIVLEV=2" aif1.c
-Wl is used to set the output file name.
-WL is used to set the capabilities and privilege level of
the program. It should be noted that if -WL is not
specified, cap=ph is passed to the link editor by
default. If you do specify -WL, this default is not
passed.
-Wc is used to turn on the extension in the compiler that
supports long pointers.
Operands
c89 accepts the following operands:
-l library
searches the library named liblibrary.a. c89 searches a
library when its name is encountered, so the placement of -l
operands is important.
-l c This library contains all functions defined by POSIX.1
as well as the ANSI C language bindings. This library
is searched even if you do not specify it on the com-
mand line.
-l m refers to the library containing all functions refer-
enced in <math.h>.
-l l refers to the library containing all functions required
by the C output of lex that are not available through
the -l c operand.
-l y refers to the library containing all functions required
by the C output of yacc that are not available through
the -l c operand.
file.a
is a library of object files usually produced by ar(1),
which is passed directly to the link editor.
file.c
is a C source file to be compiled and optionally linked.
file.o
is an object file created by c89 -c, which is passed
3
c89(1) MPE/iX Shell and Utilities c89(1)
______________________________________________________________________
directly to the link editor.
ENVIRONMENT VARIABLES
c89 uses the following environment variable:
TMPDIR
contains a path name that overrides the default directory
for temporary files, if any.
FILES
c89 uses the following file:
a.out
contains the executable output unless the -o output option
is specified.
DIAGNOSTICS
Possible exit status values are:
0 Successful completion.
1 An error occurred.
Messages
Message: cannot mix -g and -s options
Cause: You specified both the -g and -s options on the command
line. These two options are mutually exclusive.
Action: Consult the DESCRIPTION section and correct the command
line.
Message: cannot mix -g and -O
Cause: You specified both the -g and -O options on the command
line. These two options are mutually exclusive.
Action: Consult the DESCRIPTION section and correct the command
line.
Message: cannot mix -s and -E
Cause: You specified both the -s and -E options on the command
line. These two options are mutually exclusive.
Action: Consult the DESCRIPTION section and correct the command
line.
Message: compile failed
Cause: c89 was unable to run the C compiler.
Action: Make sure that your PATH environment variable includes
the directory containing the compiler, and that you
have the necessary permissions to run the compiler.
Message: link failed
Cause: c89 was unable to run the linkedit utility.
Action: Make sure that your PATH environment variable includes
the directory containing the linkedit utility, and that
4
c89(1) MPE/iX Shell and Utilities c89(1)
______________________________________________________________________
you have the necessary permissions to run that utility.
Message: no files specified
Cause: You failed to specify a valid operand file name on the
command line.
Action: Correct the command, making sure to specify operands.
Message: unknown file extension
Cause: You specified an operand file name with an unrecognized
file extension. The recognized extensions are .c, .a,
and .o.
Action: Correct the file name.
Message: unknown option -option
Cause: You specified an option that is not valid for c89.
Action: Check the DESCRIPTION section for a list of valid c89
options.
For specific C compiler and link editor error messages, refer to
Appendix A of the HP C/iX Reference Manual (Part Number
31506-90005) and to Appendix A of the HP Link Editor/iX Reference
Manual (Part Number 32650-90030).
PORTABILITY
POSIX.2. x/OPEN Portability Guide 4.0.
MPE/iX NOTES
The c89 command is currently implemented on MPE/iX as a script-
driven front end to the MPE/iX C compiler and link editor.
If the environment variable ECHO is defined, the c89 utility dis-
plays the commands that are passed to the MPE/iX CI for execu-
tion. For example
$ ECHO=1 c89 -o myprog test.c
displays each of the commands submitted to the MPE/iX CI.
For more information on how the current MPE/iX implementation may
affect the operation of this utility, see Appendix A, MPE/iX
Implementation Considerations.
SEE ALSO
ar(1), strip(1)
5