3 058b0118 2005-01-03 devnull 9c, 9a, 9l, 9ar \- C compiler, assembler, linker, archiver
4 058b0118 2005-01-03 devnull .SH SYNOPSIS
24 058b0118 2005-01-03 devnull .I target
26 058b0118 2005-01-03 devnull .I object
29 058b0118 2005-01-03 devnull .I library
33 058b0118 2005-01-03 devnull .BI -L path
37 c8b6342d 2005-01-13 devnull .BI -l name
44 058b0118 2005-01-03 devnull .I posname
51 058b0118 2005-01-03 devnull .SH DESCRIPTION
52 058b0118 2005-01-03 devnull These programs are shell scripts that invoke the appropriate standard tools
53 058b0118 2005-01-03 devnull for the current operating system and architecture.
54 058b0118 2005-01-03 devnull One can use them to write portable recipes for mkfiles.
57 058b0118 2005-01-03 devnull compiles the named C
59 058b0118 2005-01-03 devnull into object files for the current system.
60 c8b6342d 2005-01-13 devnull The system C compiler is invoked with warnings enabled.
63 c8b6342d 2005-01-13 devnull option adds
65 c8b6342d 2005-01-13 devnull to the include path,
68 c8b6342d 2005-01-13 devnull option defines
70 c8b6342d 2005-01-13 devnull in the C preprocessor.
73 c8b6342d 2005-01-13 devnull defines the symbol
74 058b0118 2005-01-03 devnull .B PLAN9PORT
75 c8b6342d 2005-01-13 devnull defined in the C preprocessor and adds
76 058b0118 2005-01-03 devnull .B $PLAN9/include
77 c8b6342d 2005-01-13 devnull to the include path.
80 058b0118 2005-01-03 devnull also defines
81 058b0118 2005-01-03 devnull .B __sun__
82 058b0118 2005-01-03 devnull on SunOS systems and
83 058b0118 2005-01-03 devnull .B __Linux26__
84 058b0118 2005-01-03 devnull on Linux systems with 2.6-series kernels.
87 058b0118 2005-01-03 devnull assembles the named files into object files for the current system.
88 058b0118 2005-01-03 devnull Unlike some system assemblers, it does
90 058b0118 2005-01-03 devnull promise to run the C preprocessor on the source files.
93 058b0118 2005-01-03 devnull links the named object files and libraries to create the target executable.
96 058b0118 2005-01-03 devnull option specifies that a library named
97 c8b6342d 2005-01-13 devnull .BI lib name .a
98 058b0118 2005-01-03 devnull be found and linked.
101 058b0118 2005-01-03 devnull option adds directories to the library search path.
103 058b0118 2005-01-03 devnull invokes the system linker with
104 058b0118 2005-01-03 devnull .B $PLAN9/lib
105 058b0118 2005-01-03 devnull already on the library search path.
108 c8b6342d 2005-01-13 devnull searches the named objects and libraries for symbols of the form
109 c8b6342d 2005-01-13 devnull .BI __p9l_autolib_ name \fR,
110 c8b6342d 2005-01-13 devnull which it takes as indication that it should link
111 c8b6342d 2005-01-13 devnull .BI $PLAN9/lib/lib name .a
112 c8b6342d 2005-01-13 devnull as well.
113 c8b6342d 2005-01-13 devnull It also examines such libraries to find their own dependencies.
114 c8b6342d 2005-01-13 devnull A single
116 c8b6342d 2005-01-13 devnull option at the beginning of the command line disables this behavior.
117 c8b6342d 2005-01-13 devnull The symbol
118 c8b6342d 2005-01-13 devnull .BI __p9l_autolib_ name
119 c8b6342d 2005-01-13 devnull is added to an object file by the macro
120 c8b6342d 2005-01-13 devnull .B AUTOLIB( name )\fR,
121 c8b6342d 2005-01-13 devnull defined in
122 c8b6342d 2005-01-13 devnull .B <u.h>.
123 c8b6342d 2005-01-13 devnull Header files associated with libraries contain
124 c8b6342d 2005-01-13 devnull .B AUTOLIB
125 c8b6342d 2005-01-13 devnull annotations; ordinary programs need not use them.
126 c8b6342d 2005-01-13 devnull Due to shortcomings in the implementation, a source file may not
127 c8b6342d 2005-01-13 devnull contain the same
128 c8b6342d 2005-01-13 devnull .B AUTOLIB
129 c8b6342d 2005-01-13 devnull statement multiple times.
132 058b0118 2005-01-03 devnull maintains object file archives called libraries.
133 058b0118 2005-01-03 devnull The exact set of valid command keys varies from system to system,
136 058b0118 2005-01-03 devnull always provides the following key characters:
140 058b0118 2005-01-03 devnull .I files
141 058b0118 2005-01-03 devnull from the archive file.
145 058b0118 2005-01-03 devnull .I files
146 058b0118 2005-01-03 devnull in the archive file, or add them if missing.
149 058b0118 2005-01-03 devnull List a table of contents of the archive.
150 058b0118 2005-01-03 devnull If names are given, only those files are listed.
153 058b0118 2005-01-03 devnull Extract the named files.
154 058b0118 2005-01-03 devnull If no names are given, all files in the archive are
155 058b0118 2005-01-03 devnull extracted.
156 058b0118 2005-01-03 devnull In neither case does
158 058b0118 2005-01-03 devnull alter the archive file.
161 058b0118 2005-01-03 devnull Verbose.
162 058b0118 2005-01-03 devnull Give a file-by-file
163 058b0118 2005-01-03 devnull description of the making of a
164 058b0118 2005-01-03 devnull new archive file from the old archive and the constituent files.
167 058b0118 2005-01-03 devnull give a long listing of all information about the files,
168 058b0118 2005-01-03 devnull somewhat like a listing by
169 058b0118 2005-01-03 devnull .IR ls (1),
175 058b0118 2005-01-03 devnull mode uid/gid size date name
179 058b0118 2005-01-03 devnull Normally
181 058b0118 2005-01-03 devnull will create a new archive when
182 058b0118 2005-01-03 devnull .I afile
183 058b0118 2005-01-03 devnull does not exist, and give a warning.
186 058b0118 2005-01-03 devnull discards any old contents and suppresses the warning.
195 058b0118 2005-01-03 devnull is specified,
197 058b0118 2005-01-03 devnull inserts a table of contents, required by the linker, at
198 058b0118 2005-01-03 devnull the front of the library.
199 058b0118 2005-01-03 devnull The table of contents is
200 058b0118 2005-01-03 devnull rebuilt whenever the archive is modified.
201 c8b6342d 2005-01-13 devnull .SH EXAMPLES
204 058b0118 2005-01-03 devnull 9c file1.c file2.c file3.c
205 058b0118 2005-01-03 devnull Compile three C source files.
208 058b0118 2005-01-03 devnull 9a file4.s
209 058b0118 2005-01-03 devnull Assemble one assembler source file.
212 058b0118 2005-01-03 devnull 9ar rvc lib.a file[12].o
213 058b0118 2005-01-03 devnull Archive the first two object files into a library.
216 058b0118 2005-01-03 devnull 9l -o prog file3.o file4.o lib.a
217 058b0118 2005-01-03 devnull Link the final two object files and any necessary objects from the library
218 058b0118 2005-01-03 devnull into an executable.
219 058b0118 2005-01-03 devnull .SH SOURCE
220 c3674de4 2005-01-11 devnull .B \*9/bin