xref: /dragonfly/usr.bin/c89/c89.1 (revision 2cd2d2b5)
1.\"
2.\" Copyright (c) 1997 Joerg Wunsch
3.\"
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25.\"
26.\" $FreeBSD: src/usr.bin/c89/c89.1,v 1.4.2.4 2001/08/02 01:11:13 obrien Exp $
27.\" $DragonFly: src/usr.bin/c89/c89.1,v 1.2 2003/06/17 04:29:25 dillon Exp $
28.\" "
29.Dd September 17, 1997
30.Os
31.Dt C89 1
32.Sh NAME
33.Nm c89
34.Nd POSIX.2 C language compiler
35.Sh SYNOPSIS
36.Nm
37.Op Fl c
38.Op Fl D Ar name Ns Op = Ns Ar value
39.Ar ...
40.Op Fl E
41.Op Fl g
42.Op Fl I Ar directory ...
43.Op Fl L Ar directory ...
44.Op Fl o Ar outfile
45.Op Fl O
46.Op Fl s
47.Op Fl U Ar name ...
48.Ar operand ...
49.Sh DESCRIPTION
50This is the name of the C language compiler as required by the
51.St -p1003.2
52standard.
53.Pp
54The
55.Nm
56compiler accepts the following options:
57.Bl -tag -width indent
58.It Fl c
59Suppress the link-edit phase of the compilation, and do not remove any
60object files that are produced.
61.It Fl D Ar name Ns Op = Ns Ar value
62Define name as if by a C-language
63.Ic #define
64directive.  If
65no
66.Dq = Ns Ar value
67is given, a value of 1 will be used.
68Note that in order to request a
69translation as specified by
70.St -p1003.2
71you need to define
72.Dv _POSIX_SOURCE
73either in the source or using this option.  The
74.Fl D
75option has lower precedence than the
76.Fl U
77option.  That is, if
78.Ar name
79is used in both a
80.Fl U
81and a
82.Fl D
83option,
84.Ar name
85will be undefined regardless of the order of the options.  The
86.Fl D
87option may be specified more than once.
88.It Fl E
89Copy C-language source files to the standard output, expanding all
90preprocessor directives; no compilation will be performed.
91.It Fl g
92Produce symbolic information in the object or executable files.
93.It Fl I Ar directory
94Change the algorithm for searching for headers whose names are not
95absolute pathnames to look in the directory named by the
96.Ar directory
97pathname before looking in the usual places.  Thus, headers whose
98names are enclosed in double-quotes ("") will be searched for first
99in the directory of the file with the
100.Ic #include
101line, then in
102directories named in
103.Fl I
104options, and last in the usual places.  For
105headers whose names are enclosed in angle brackets (<>), the header
106will be searched for only in directories named in
107.Fl I
108options and then in the usual places.  Directories named in
109.Fl I
110options shall be searched in the order specified.  The
111.Fl I
112option may be specified more than once.
113.It Fl L Ar directory
114Change the algorithm of searching for the libraries named in the
115.Fl l
116objects to look in the directory named by the
117.Ar directory
118pathname before looking in the usual places.  Directories named in
119.Fl L
120options will be searched in the order specified.  The
121.Fl L
122option may be specified more than once.
123.It Fl o Ar outfile
124Use the pathname
125.Ar outfile ,
126instead of the default
127.Pa a.out ,
128for the executable file produced.
129.It Fl O
130Optimize the compilation.
131.It Fl s
132Produce object and/or executable files from which symbolic and other
133information not required for proper execution has been removed
134(stripped).
135.It Fl U Ar name
136Remove any initial definition of
137.Ar name .
138The
139.Fl U
140option may be specified more than once.
141.El
142.Pp
143An operand is either in the form of a pathname or the form
144.Fl l
145library.  At least one operand of the pathname form needs to be
146specified.  Supported operands are of the form:
147.Bl -tag -offset indent -width "-l library"
148.It Ar file Ns Pa .c
149A C-language source file to be compiled and optionally linked.  The
150operand must be of this form if the
151.Fl c
152option is used.
153.It Ar file Ns Pa .a
154A library of object files, as produced by
155.Xr ar 1 ,
156passed directly to the link editor.
157.It Ar file Ns Pa .o
158An object file produced by
159.Nm Fl c ,
160and passed directly to the link editor.
161.It Fl l Ar library
162Search the library named
163.Pa lib Ns Ar library Ns Pa .a .
164A library will be searched when its name is encountered, so the
165placement of a
166.Fl l
167operand is significant.
168.El
169.Sh SEE ALSO
170.Xr ar 1 ,
171.Xr cc 1
172.Sh STANDARDS
173The
174.Nm
175command is believed to comply with
176.St -p1003.2 .
177