Merge branch 'vendor/DIFFUTILS'
[dragonfly.git] / usr.bin / c89 / c89.1
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.11 2007/03/10 07:10:01 ru Exp $
27 .\" $DragonFly: src/usr.bin/c89/c89.1,v 1.3 2007/09/22 21:13:47 pavalos 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 cEgOs
38 .Oo Fl D Ar name Ns Oo = Ns Ar value Oc Oc ...
39 .Oo Fl I Ar directory Oc ...
40 .Oo Fl L Ar directory Oc ...
41 .Op Fl o Ar outfile
42 .Oo Fl U Ar name Oc ...
43 .Ar operand ...
44 .Sh DESCRIPTION
45 This is the name of the C language compiler as required by the
46 .St -p1003.2
47 standard.
48 .Pp
49 The
50 .Nm
51 compiler accepts the following options:
52 .Bl -tag -width indent
53 .It Fl c
54 Suppress the link-edit phase of the compilation, and do not remove any
55 object files that are produced.
56 .It Fl D Ar name Ns Op = Ns Ar value
57 Define name as if by a C-language
58 .Ic #define
59 directive.
60 If no
61 .Dq = Ns Ar value
62 is given, a value of 1 will be used.
63 Note that in order to request a
64 translation as specified by
65 .St -p1003.2
66 you need to define
67 .Dv _POSIX_SOURCE
68 either in the source or using this option.
69 The
70 .Fl D
71 option has lower precedence than the
72 .Fl U
73 option.
74 That is, if
75 .Ar name
76 is used in both a
77 .Fl U
78 and a
79 .Fl D
80 option,
81 .Ar name
82 will be undefined regardless of the order of the options.
83 The
84 .Fl D
85 option may be specified more than once.
86 .It Fl E
87 Copy C-language source files to the standard output, expanding all
88 preprocessor directives; no compilation will be performed.
89 .It Fl g
90 Produce symbolic information in the object or executable files.
91 .It Fl I Ar directory
92 Change the algorithm for searching for headers whose names are not
93 absolute pathnames to look in the directory named by the
94 .Ar directory
95 pathname before looking in the usual places.
96 Thus, headers whose
97 names are enclosed in double-quotes
98 .Pq Qq
99 will be searched for first
100 in the directory of the file with the
101 .Ic #include
102 line, then in
103 directories named in
104 .Fl I
105 options, and last in the usual places.
106 For headers whose names are enclosed in angle brackets
107 .Pq Aq ,
108 the header
109 will be searched for only in directories named in
110 .Fl I
111 options and then in the usual places.
112 Directories named in
113 .Fl I
114 options shall be searched in the order specified.
115 The
116 .Fl I
117 option may be specified more than once.
118 .It Fl L Ar directory
119 Change the algorithm of searching for the libraries named in the
120 .Fl l
121 objects to look in the directory named by the
122 .Ar directory
123 pathname before looking in the usual places.
124 Directories named in
125 .Fl L
126 options will be searched in the order specified.
127 The
128 .Fl L
129 option may be specified more than once.
130 .It Fl o Ar outfile
131 Use the pathname
132 .Ar outfile ,
133 instead of the default
134 .Pa a.out ,
135 for the executable file produced.
136 .It Fl O
137 Optimize the compilation.
138 .It Fl s
139 Produce object and/or executable files from which symbolic and other
140 information not required for proper execution has been removed
141 (stripped).
142 .It Fl U Ar name
143 Remove any initial definition of
144 .Ar name .
145 The
146 .Fl U
147 option may be specified more than once.
148 .El
149 .Pp
150 An operand is either in the form of a pathname or the form
151 .Fl l
152 library.
153 At least one operand of the pathname form needs to be specified.
154 Supported operands are of the form:
155 .Bl -tag -offset indent -width ".Fl l Ar library"
156 .It Ar file Ns Pa .c
157 A C-language source file to be compiled and optionally linked.
158 The operand must be of this form if the
159 .Fl c
160 option is used.
161 .It Ar file Ns Pa .a
162 A library of object files, as produced by
163 .Xr ar 1 ,
164 passed directly to the link editor.
165 .It Ar file Ns Pa .o
166 An object file produced by
167 .Nm Fl c ,
168 and passed directly to the link editor.
169 .It Fl l Ar library
170 Search the library named
171 .Pa lib Ns Ar library Ns Pa .a .
172 A library will be searched when its name is encountered, so the
173 placement of a
174 .Fl l
175 operand is significant.
176 .El
177 .Sh SEE ALSO
178 .Xr ar 1 ,
179 .Xr c99 1 ,
180 .Xr cc 1
181 .Sh STANDARDS
182 The
183 .Nm
184 utility is believed to comply with
185 .St -p1003.2 .