]>
Commit | Line | Data |
---|---|---|
8f861f08 | 1 | \input texinfo @c -*-para-*- |
ce947b9d | 2 | @c %**start of header |
8f861f08 RP |
3 | @setfilename configure.info |
4 | @settitle Cygnus Configure | |
ce947b9d | 5 | @c %**end of header |
e59aa15a | 6 | @synindex ky cp |
d1cde16a RP |
7 | @tex |
8 | \def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ | |
9 | \xdef\manvers{\$Revision$} % For use in headers, footers too | |
10 | @end tex | |
f3b7efd5 RP |
11 | @setchapternewpage off |
12 | ||
01b8752d DZ |
13 | @ifinfo |
14 | @format | |
15 | START-INFO-DIR-ENTRY | |
16 | * configure: (configure). Cygnus configure. | |
17 | END-INFO-DIR-ENTRY | |
18 | @end format | |
19 | @end ifinfo | |
20 | ||
f3b7efd5 RP |
21 | @ifinfo |
22 | This document attempts to describe the Cygnus Support version of | |
23 | @code{configure}. | |
24 | ||
d0fbd756 | 25 | Copyright 1991, 1992 Free Software Foundation, Inc. |
f3b7efd5 RP |
26 | Permission is granted to make and distribute verbatim copies of |
27 | this manual provided the copyright notice and this permission notice | |
28 | are preserved on all copies. | |
29 | ||
30 | @ignore | |
31 | Permission is granted to process this file through TeX and print the | |
32 | results, provided the printed document carries copying permission | |
33 | notice identical to this one except for the removal of this paragraph | |
34 | (this paragraph not being relevant to the printed manual). | |
35 | ||
36 | @end ignore | |
37 | Permission is granted to copy and distribute modified versions of this | |
38 | manual under the conditions for verbatim copying, provided that the entire | |
39 | resulting derived work is distributed under the terms of a permission | |
40 | notice identical to this one. | |
41 | ||
42 | Permission is granted to copy and distribute translations of this manual | |
43 | into another language, under the above conditions for modified versions, | |
44 | except that this permission notice may be stated in a translation approved | |
45 | by Cygnus Support. | |
46 | @end ifinfo | |
8f861f08 | 47 | |
ce947b9d RP |
48 | @titlepage |
49 | @sp 10 | |
50 | @title{Cygnus Configure} | |
d1cde16a | 51 | @subtitle @manvers, for Cygnus Configure version 1.84 |
f3b7efd5 RP |
52 | @author{K. Richard Pixley, @code{rich@@cygnus.com}} |
53 | @author{Cygnus Support} | |
ce947b9d | 54 | @page |
f3b7efd5 | 55 | |
ce947b9d | 56 | @vskip 0pt plus 1filll |
d0fbd756 | 57 | Copyright @copyright{} 1991, 1992 Free Software Foundation, Inc. |
ce947b9d | 58 | |
f3b7efd5 RP |
59 | Permission is granted to make and distribute verbatim copies of |
60 | this manual provided the copyright notice and this permission notice | |
61 | are preserved on all copies. | |
ce947b9d | 62 | |
f3b7efd5 RP |
63 | Permission is granted to copy and distribute modified versions of this |
64 | manual under the conditions for verbatim copying, provided that the entire | |
65 | resulting derived work is distributed under the terms of a permission | |
66 | notice identical to this one. | |
67 | ||
68 | Permission is granted to copy and distribute translations of this manual | |
69 | into another language, under the above conditions for modified versions, | |
70 | except that this permission notice may be stated in a translation approved | |
71 | by Cygnus Support. | |
72 | @end titlepage | |
ce947b9d RP |
73 | |
74 | @ifinfo | |
f3b7efd5 | 75 | |
d1cde16a | 76 | @node top, What Configure Does, (dir), (dir) |
ce947b9d | 77 | @top top |
8f861f08 RP |
78 | |
79 | This file documents the configuration system used and distributed by | |
80 | Cygnus Support. | |
81 | ||
82 | @menu | |
d1cde16a | 83 | * What Configure Does:: What Configure Does |
8f861f08 | 84 | * Invoking:: Invoking |
ce947b9d | 85 | * Using Configure:: Using Configure |
ce947b9d | 86 | * Porting:: Porting with Configure |
f3b7efd5 | 87 | * Reference:: Gory details described |
ce947b9d RP |
88 | * Known Bugs:: Known Bugs |
89 | * Variables Index:: Variable Index | |
90 | * Concept Index:: Concept Index | |
91 | ||
787c6bfe RP |
92 | --- The Detailed Node Listing --- |
93 | ||
94 | Using Configure | |
95 | ||
96 | * Install Locations:: Where to install things once they are built | |
97 | * Build Directories:: Where to build object files | |
98 | * Host:: Telling @code{configure} what will source will | |
99 | be built | |
100 | * Target:: Telling @code{configure} what the source will | |
101 | target | |
102 | * Local Conventions:: Adding information about local conventions | |
103 | ||
104 | Install Locations | |
105 | ||
106 | * prefix:: Changing the default install directory | |
107 | * exec_prefix:: How to separate host independent files | |
108 | from host dependent files when | |
109 | installing for multiple hosts | |
110 | * Install Details:: Full descriptions of all installation | |
111 | subdirectories | |
112 | ||
113 | Porting with Configure | |
114 | ||
115 | * Programs:: Adding configure to new programs | |
116 | * Hosts and Targets:: Adding hosts and targets | |
117 | * Sites:: Adding site info | |
118 | ||
119 | Gory details described | |
120 | ||
121 | * Makefile Extensions:: Extensions to the @sc{gnu} coding standards | |
122 | * configure.in:: The format of the configure.in file | |
123 | * config.status:: config.status | |
124 | * Makefile Fragments:: Makefile Fragments | |
125 | ||
126 | The format of the @file{configure.in} file | |
127 | ||
128 | * Minimal:: A minimal configure.in | |
129 | * Configure Variables:: Variables available to configure.in | |
130 | * Declarations:: For each invocation | |
131 | * Per-host:: For each host | |
132 | * Per-target:: For each target | |
133 | * Post-target:: After each target | |
134 | * Example:: An example configure.in | |
8f861f08 | 135 | @end menu |
f3b7efd5 | 136 | |
ce947b9d | 137 | @end ifinfo |
8f861f08 | 138 | |
d1cde16a RP |
139 | @node What Configure Does, Invoking, top, top |
140 | @chapter What Configure Does | |
141 | ||
142 | @code{configure} prepares source directories for building working | |
143 | programs. A program cannot be built until its source has been | |
787c6bfe | 144 | configured. When configure runs, it does the following things. |
d1cde16a RP |
145 | |
146 | @table @emph | |
147 | @item Create build directories | |
148 | (see @ref{Build Directories}). When you run @code{configure} with the | |
149 | @code{-srcdir=} option, it uses the current directory as build | |
150 | directory, creating under it a directory tree that parallels the | |
151 | directory structure under the source directory. (See @ref{Invoking}). | |
152 | ||
d1cde16a RP |
153 | @item Generate makefiles |
154 | A makefile template from the source directory, usually called | |
155 | @file{Makefile.in}, is copied to an output file in the build directory. | |
156 | The output file is usually named @file{Makefile}. @code{configure} | |
787c6bfe RP |
157 | places definitions for a number of standard makefile macros at the |
158 | beginning of the output file. If @code{-prefix=} or @code{-exec_prefix} | |
159 | were specified on the @code{configure} command line, corresponding | |
160 | makefile variables are set accordingly. If host, target, or site | |
161 | specific makefile fragments exist, these are inserted into the output | |
162 | file. (See @ref{Makefiles, , , make, Makefiles}.) | |
d1cde16a | 163 | |
bccfae16 JG |
164 | @item Generate @file{.gdbinit} If the source directory contains a |
165 | @file{.gdbinit} file and the build directory is not the same as the | |
166 | source directory, a @file{.gdbinit} file is created in the build | |
167 | directory. This @file{.gdbinit} file contains @code{dir} commands and | |
168 | a @code{source} command, which will cause the @file{.gdbinit} file from | |
169 | the source directory to be read by GDB, and will allow GDB to find | |
170 | source files in either the source directory or the build directory. | |
171 | (see @ref{Command Files, , , gdb, Command Files}.) | |
d1cde16a RP |
172 | |
173 | @item Make symbolic links | |
174 | Most directories have some symbolic links with generic names built | |
175 | pointing to specific files in the source directory. If the system where | |
176 | @code{configure} runs cannot support symbolic links, hard links are used | |
177 | instead. | |
178 | ||
179 | @item Miscellaneous | |
180 | If the source directory has special needs, they are handled by shell | |
181 | script fragments stored with the source. Usually there are no special | |
182 | needs, but sometimes they involve changes to the output makefile. | |
183 | ||
184 | @item Generate @file{config.status} | |
185 | @code{configure} creates a shell script named @file{config.status} in | |
186 | the build directory. This shell script, when run from the build | |
187 | directory, will reconfigure the build directory (but not its | |
188 | subdirectories). This is most often used to have a @code{Makefile} update | |
189 | itself automatically if a new source directory is available. | |
d1cde16a RP |
190 | |
191 | @item Recursion | |
192 | If the source directory has subdirectories that should also be | |
193 | configured, @code{configure} is called for each. | |
194 | @end table | |
195 | ||
196 | @node Invoking, Using Configure, What Configure Does, top | |
8f861f08 RP |
197 | @chapter Invoking |
198 | ||
199 | The usual way to invoke @code{configure} is as follows: | |
200 | @example | |
201 | configure @var{host} | |
202 | @end example | |
d1cde16a | 203 | This prepares the source to be compiled in a |
8f861f08 RP |
204 | @var{host} environment with programs and files to be installed in |
205 | @file{/usr/local}. | |
206 | ||
d1cde16a RP |
207 | @code{configure} prepares the source as you specify by selecting and |
208 | using script and Makefile fragments prepared in advance, and stored with | |
209 | the source. @code{configure}'s command line options also allow you to | |
210 | specify other aspects of the source configuration: | |
8f861f08 | 211 | |
d1cde16a | 212 | @table @code |
787c6bfe RP |
213 | @item -exec_prefix=@var{dir} |
214 | Configure the source to install host dependent files in @var{dir}. | |
8f861f08 | 215 | |
787c6bfe RP |
216 | This option sets the @code{configure} variable @code{exec_prefix}. |
217 | Generated Makefiles will have their @code{exec_prefix} variables set to | |
218 | this value. (See @ref{Install Details}.) | |
8f861f08 RP |
219 | |
220 | @item -gas | |
d1cde16a | 221 | Configure to use the @sc{GNU} assembler. |
8f861f08 RP |
222 | |
223 | @item -help | |
d1cde16a | 224 | Display a quick summary of how to invoke @code{configure}. |
8f861f08 RP |
225 | |
226 | @item -host=@var{host} | |
ce947b9d | 227 | FIXME-soon: I don't think this option should be documented. |
d1cde16a | 228 | @c Then why does it exist? /Pesch 7jan92 |
ce947b9d | 229 | |
8f861f08 | 230 | @item -nfp |
d1cde16a RP |
231 | @emph{No floating point} unit available on the target; configure to |
232 | avoid dependencies on hardware floating point. | |
8f861f08 RP |
233 | |
234 | @item -norecursion | |
d1cde16a RP |
235 | Configure only this directory; ignore any subdirectories. This is used |
236 | by the executable shell script @file{config.status} to reconfigure the | |
237 | current directory. (see @ref{config.status}). | |
8f861f08 | 238 | |
8f861f08 | 239 | @item -prefix=@var{dir} |
d1cde16a RP |
240 | Configure the source to install programs and files under directory |
241 | @file{@var{dir}}. | |
8f861f08 | 242 | |
3a07a6ac RP |
243 | This option sets the @code{configure} variable @code{prefix}. Generated |
244 | Makefiles will have their @code{prefix} variables set to this value. | |
245 | (See @ref{Install Details}.) | |
8f861f08 | 246 | |
d257b46f ILT |
247 | @item -program_prefix=@var{string} |
248 | Configure the source to install certain programs using @var{string} as a | |
249 | prefix. This applies to programs which might be used for cross-compilation, | |
250 | such as the compiler and the binutils, and also to programs which have the same | |
251 | name as a common Unix program, such as make. | |
252 | ||
253 | This option sets the @code{configure} variable @code{program_prefix}. | |
254 | Generated Makefiles will have their @code{program_prefix} variables set to this | |
255 | value. (See @ref{Install Details}.) | |
256 | ||
257 | @item -program_suffix=@var{string} | |
258 | Configure the source to install certain programs using @var{string} as a | |
259 | suffix. This applies to programs which might be used for cross-compilation. | |
260 | ||
261 | @item -program_transform_name=@var{sed-pattern} | |
262 | Configure the source to install certain programs using the names that result | |
263 | from passing the usual name through @code{sed} invoked with @var{sed-pattern}. | |
264 | This option may be given multiple times; each @var{sed-pattern} will be applied | |
265 | in turn. This applies to programs which might be used for cross-compilation. | |
266 | ||
267 | This option sets the @code{configure} variable @code{program_transform_name}. | |
268 | Generated Makefiles will have their @code{program_transform_name} variables set | |
269 | to this value. (See @ref{Install Details}.) | |
270 | ||
8f861f08 | 271 | @item -recurring |
f8f3c853 | 272 | @c Wouldn't it make more sense to call this "-quiet"? (FIXME). |
8f861f08 | 273 | This option is used internally by @code{configure} when recurring on |
d1cde16a RP |
274 | subdirectories. Its sole purpose is to suppress status output. You can |
275 | override this effect with the @code{-verbose} option. | |
8f861f08 RP |
276 | |
277 | @item -rm | |
d1cde16a RP |
278 | @emph{Remove} the configuration specified by @var{host} and the other |
279 | command-line options, rather than creating it. | |
8f861f08 RP |
280 | |
281 | @item -site=@var{site} | |
d1cde16a RP |
282 | Generate Makefiles using site specific Makefile fragments for |
283 | @var{site}. See also @ref{Sites}. | |
8f861f08 RP |
284 | |
285 | @item -srcdir=@var{_dir} | |
d1cde16a | 286 | Build Makefiles to use the sources located in directory @file{@var{dir}}. The |
8f861f08 RP |
287 | build directory is assumed to be @file{.}. |
288 | ||
8f861f08 RP |
289 | @item -target=@var{target} |
290 | Requests that the sources be configured to target the @var{target} | |
d1cde16a RP |
291 | machine. If no target is specified explicitly, the target is assumed |
292 | to be the same as the host. | |
293 | ||
8f861f08 | 294 | @item -tmpdir=@var{tmpdir} |
d1cde16a | 295 | Use the directory @var{tmpdir} for @code{configure}'s temporary files. |
f8f3c853 RP |
296 | The default is the value of the environment variable TMPDIR, or |
297 | @file{/tmp} if the environment variable is not set. | |
8f861f08 RP |
298 | |
299 | @item -verbose | |
d1cde16a RP |
300 | @itemx -v |
301 | Print status lines for each directory configured. Normally, only the | |
302 | status lines for the initial working directory are printed. | |
8f861f08 RP |
303 | |
304 | @item -x | |
d1cde16a RP |
305 | Use @sc{MIT} style @sc{X11} header files and libraries on the host, even |
306 | if they are not normally available. | |
8f861f08 RP |
307 | @end table |
308 | ||
d1cde16a | 309 | @node Using Configure, Porting, Invoking, top |
8f861f08 RP |
310 | @chapter Using Configure |
311 | ||
d1cde16a RP |
312 | The choices and options available at configuration time |
313 | generally have valid defaults, but the defaults do not cover all cases. | |
314 | The choices available include install locations, build directories, | |
315 | host, target, and local conventions. | |
8f861f08 RP |
316 | |
317 | @menu | |
318 | * Install Locations:: Where to install things once they are built | |
319 | * Build Directories:: Where to build object files | |
ce947b9d RP |
320 | * Host:: Telling @code{configure} what will source will |
321 | be built | |
322 | * Target:: Telling @code{configure} what the source will | |
323 | target | |
324 | * Local Conventions:: Adding information about local conventions | |
8f861f08 RP |
325 | @end menu |
326 | ||
ce947b9d | 327 | @node Install Locations, Build Directories, Using Configure, Using Configure |
8f861f08 | 328 | @section Install Locations |
8f861f08 RP |
329 | @cindex Where to install |
330 | ||
d1cde16a | 331 | Using the default configuration, @code{make install} creates a |
8f861f08 | 332 | single tree of files, some of which are programs. The location of this |
f3b7efd5 RP |
333 | tree is determined by the value of the variable @code{prefix}. The |
334 | default value of @code{prefix} is @file{/usr/local}. This is | |
d1cde16a | 335 | often correct for native tools installed on only one host. |
8f861f08 RP |
336 | |
337 | @menu | |
d1cde16a | 338 | * prefix:: Changing the default install directory |
787c6bfe | 339 | * exec_prefix:: How to separate host independent files |
8f861f08 RP |
340 | from host dependent files when |
341 | installing for multiple hosts | |
d1cde16a | 342 | * Install Details:: Full descriptions of all installation |
8f861f08 RP |
343 | subdirectories |
344 | @end menu | |
345 | ||
787c6bfe | 346 | @node prefix, exec_prefix, Install Locations, Install Locations |
8f861f08 | 347 | @subsection Changing the default install directory |
8f861f08 | 348 | @cindex Changing the default install directory |
ce947b9d | 349 | @cindex Prefix directory |
8f861f08 RP |
350 | |
351 | In the default configuration, all files are installed in subdirectories | |
d1cde16a RP |
352 | of @file{/usr/local}. The location is determined by the value of |
353 | the @code{configure} variable @code{prefix}; in turn, this determines the | |
354 | value of the Makefile variable of the same name (@code{prefix}). | |
8f861f08 | 355 | |
f3b7efd5 | 356 | You can also set the value of the Makefile variable @code{prefix} |
d1cde16a | 357 | explicitly each time you invoke @code{make} if you are so inclined; but |
8f861f08 | 358 | because many programs have this location compiled in, you must specify |
d1cde16a | 359 | the @code{prefix} value consistently on each invocation of @code{make}, |
8f861f08 RP |
360 | or you will end up with a broken installation. |
361 | ||
362 | To make this easier, the value of the @code{configure} variable | |
f3b7efd5 | 363 | @code{prefix} can be set on the command line to @code{configure} |
d1cde16a | 364 | using the option @code{-prefix=}. |
8f861f08 RP |
365 | |
366 | ||
787c6bfe | 367 | @node exec_prefix, Install Details, prefix, Install Locations |
8f861f08 | 368 | @subsection Installing for multiple hosts |
8f861f08 RP |
369 | @cindex Configuring for multiple hosts |
370 | @cindex Sharing host independent files | |
787c6bfe | 371 | @cindex The @file{exec_prefix} directory |
8f861f08 RP |
372 | @cindex Installing host independent files |
373 | ||
787c6bfe RP |
374 | By default, host dependent files are installed in subdirectories of |
375 | @file{@var{exec_prefix}}. The location is determined by the value of the | |
376 | @code{configure} variable @code{exec_prefix}, which determines the value of | |
377 | the Makefile variable @code{exec_prefix}. This makes it simpler to install | |
d1cde16a RP |
378 | for a single host, and simplifies changing the default location for the |
379 | install tree; but the default doesn't allow for multiple hosts to | |
8f861f08 RP |
380 | effectively share host independent files. |
381 | ||
382 | To configure so that multiple hosts can share common files, use | |
383 | something like: | |
384 | ||
385 | @example | |
787c6bfe | 386 | configure @var{host1} -prefix=/usr/gnu -exec_prefix=/usr/gnu/H-host1 |
8f861f08 | 387 | make all info install install-info clean |
d1cde16a | 388 | |
787c6bfe | 389 | configure @var{host2} -prefix=/usr/gnu -exec_prefix=/usr/gnu/H-host2 |
8f861f08 RP |
390 | make all info install install-info |
391 | @end example | |
392 | ||
d1cde16a | 393 | The first line configures the source for @var{host1} to place host |
787c6bfe | 394 | specific programs in subdirectories of @file{/usr/gnu/H-@var{host1}}. |
8f861f08 RP |
395 | |
396 | The second line builds and installs all programs for @var{host1}, | |
d1cde16a | 397 | including both host independent and host specific files. |
8f861f08 | 398 | |
d1cde16a | 399 | The third line reconfigures the source for @var{host2} to place host |
787c6bfe | 400 | specific programs in subdirectories of @file{/usr/gnu/H-@var{host2}}. |
8f861f08 RP |
401 | |
402 | The fourth line builds and installs all programs for @var{host2}. Host | |
d1cde16a RP |
403 | specific files are installed in new directories, but the host |
404 | independent files are installed @emph{on top of} the host | |
8f861f08 | 405 | independent files installed for @var{host1}. This results in a single |
d1cde16a | 406 | copy of the host independent files, suitable for use by both hosts. |
8f861f08 | 407 | |
787c6bfe | 408 | @node Install Details, , exec_prefix, Install Locations |
8f861f08 RP |
409 | @subsection Full descriptions of all installation subdirectories |
410 | ||
d1cde16a RP |
411 | During any install, a number of standard directories are created. Their |
412 | names are determined by Makefile variables. Some of the | |
8f861f08 RP |
413 | defaults for Makefile variables can be changed at configure time using |
414 | command line options to @code{configure}. For more information on the | |
415 | standard directories or the Makefile variables, please refer to | |
416 | @cite{standards.text}. | |
417 | ||
d1cde16a RP |
418 | Note that @code{configure} does not create the directory @code{srcdir} |
419 | at any time. @code{srcdir} is not an installation directory. | |
8f861f08 | 420 | |
d1cde16a RP |
421 | You can override all makefile variables on the command line to |
422 | @code{make}. (See @ref{Overriding, Overriding Variables, Overriding | |
8f861f08 | 423 | Variables, make, Make}.) If you do so, you will need to specify the |
d1cde16a | 424 | value precisely the same way for each invocation of @code{make}, or you |
8f861f08 RP |
425 | risk ending up with a broken installation. This is because many |
426 | programs have the locations of other programs or files compiled into | |
427 | them. If you find yourself overriding any of the variables frequently, | |
87081339 | 428 | you should consider site dependent Makefile fragments. See also |
d1cde16a | 429 | @ref{Sites}. |
8f861f08 | 430 | |
d1cde16a RP |
431 | During @code{make install}, a number of standard directories are |
432 | created and populated. The following Makefile variables define them. | |
433 | Those whose defaults are set by corresponding @code{configure} variables | |
434 | are marked ``Makefile and configure''. | |
8f861f08 RP |
435 | |
436 | @vindex prefix | |
437 | @defvr {Makefile and configure} prefix | |
d1cde16a RP |
438 | The root of the installation tree. You can set |
439 | its Makefile default with the @code{-prefix=} command line option to | |
440 | @code{configure}. (@ref{Invoking}.) The default value for | |
441 | @code{prefix} is @file{/usr/local}. | |
8f861f08 RP |
442 | @end defvr |
443 | ||
444 | @vindex bindir | |
445 | @defvr Makefile bindir | |
d1cde16a RP |
446 | A directory for binary programs that users can run. |
447 | The default value for @code{bindir} depends on @code{prefix}; | |
448 | @code{bindir} is normally changed only indirectly through @code{prefix}. | |
449 | The default value for @code{bindir} is @file{$(prefix)/bin}. | |
8f861f08 RP |
450 | @end defvr |
451 | ||
787c6bfe RP |
452 | @vindex exec_prefix |
453 | @defvr {Makefile and configure} exec_prefix | |
454 | A directory for host dependent files. You can specify the Makefile | |
455 | default value by using the @code{-exec_prefix=} option to @code{configure}. | |
456 | (See also @ref{Invoking}.) The default value for @code{exec_prefix} is | |
457 | @file{$(prefix)}. | |
8f861f08 RP |
458 | @end defvr |
459 | ||
460 | @vindex libdir | |
461 | @defvr Makefile libdir | |
d1cde16a RP |
462 | A directory for libraries and support programs. The default value for |
463 | @code{libdir} depends on @code{prefix}; @code{libdir} is normally | |
464 | changed only indirectly through @code{prefix}. The default value for | |
465 | @code{libdir} is @file{$(prefix)/lib}. | |
8f861f08 RP |
466 | @end defvr |
467 | ||
468 | @vindex mandir | |
469 | @defvr Makefile mandir | |
d1cde16a RP |
470 | A directory for @code{man} format documentation (``man pages''). The |
471 | default value for @code{mandir} depends on @code{prefix}; | |
472 | @code{mandir} is normally changed only indirectly through @code{prefix}. | |
787c6bfe | 473 | The default value for @code{mandir} is @file{$(prefix)/man}. |
8f861f08 RP |
474 | @end defvr |
475 | ||
476 | @vindex man@var{N}dir | |
477 | @defvr Makefile man@var{N}dir | |
d1cde16a RP |
478 | There are eight variables named @code{man1dir}, @code{man2dir}, etc. |
479 | They name the specific directories for each man page section. For | |
480 | example, @code{man1dir} holds @file{emacs.1} (the man page for the emacs | |
481 | program), while @code{man5dir} holds @file{rcsfile.5} (the man page | |
482 | describing the @code{rcs} data file format). The default value for any | |
483 | of the @code{man@var{N}dir} variables depends indirectly on | |
484 | @code{prefix}, and is normally changed only through @code{prefix}. The | |
485 | default value for @code{man@var{N}dir} is | |
486 | @file{$(mandir)/man@var{N}}. | |
8f861f08 RP |
487 | @end defvr |
488 | ||
489 | @vindex manext | |
490 | @defvr Makefile manext | |
d1cde16a RP |
491 | @emph{Not supported by @code{configure}}. The @sc{gnu} coding standards |
492 | do not call for @code{man1ext}, @code{man2ext}, so the intended use for | |
493 | @code{manext} is apparently not parallel to @code{mandir}. Its use is | |
494 | not clear. (See also @ref{Makefile Extensions}.) | |
8f861f08 RP |
495 | @end defvr |
496 | ||
497 | @vindex infodir | |
498 | @defvr Makefile infodir | |
d1cde16a RP |
499 | A directory for @emph{info} format documentation. The default value for |
500 | @code{infodir} depends indirectly on @code{prefix}; @code{infodir} is | |
501 | normally changed only through @code{prefix}. The default value for | |
787c6bfe | 502 | @code{infodir} is @file{$(prefix)/info}. |
8f861f08 RP |
503 | @end defvr |
504 | ||
505 | @vindex docdir | |
506 | @defvr Makefile docdir | |
d1cde16a RP |
507 | A directory for any documentation that is in a format other than those |
508 | used by @code{info} or @code{man}. The default value for @code{docdir} | |
509 | depends indirectly on @code{prefix}; @code{docdir} is normally changed only | |
510 | through @code{prefix}. The default value for @code{docdir} | |
511 | is @file{$(datadir)/doc}. @emph{This variable is an extension to | |
512 | the @sc{gnu} coding standards}. (See also @ref{Makefile Extensions}.) | |
8f861f08 RP |
513 | @end defvr |
514 | ||
515 | @vindex includedir | |
516 | @defvr Makefile includedir | |
d1cde16a RP |
517 | A directory for the header files accompanying the libraries installed in |
518 | @code{libdir}. The default value for @code{includedir} depends on | |
519 | @code{prefix}; @code{includedir} is normally changed only indirectly | |
520 | through @code{prefix}. The default value for @code{includedir} is | |
521 | @file{$(prefix)/include}. | |
8f861f08 RP |
522 | @end defvr |
523 | ||
ce947b9d | 524 | @node Build Directories, Host, Install Locations, Using Configure |
8f861f08 | 525 | @section Build Directories |
ce947b9d | 526 | @cindex Build directories |
e59aa15a | 527 | @kindex objdir |
ce947b9d | 528 | @cindex Object directories |
e59aa15a | 529 | @kindex subdirs |
ce947b9d RP |
530 | @cindex Building for multiple hosts |
531 | @cindex Building for multiple targets | |
8f861f08 | 532 | |
87081339 | 533 | Normally, @code{configure} builds a @file{Makefile} and symbolic links |
ce947b9d | 534 | in the same directory as the source files. This is the typical |
d1cde16a | 535 | @sc{un*x} way to build programs, but it has limitations. For instance, |
ce947b9d | 536 | using this approach, you can only build for one host at a time. |
8f861f08 | 537 | |
d1cde16a RP |
538 | We refer to the directories where @code{configure} builds a |
539 | Makefile as the @emph{build directories} or sometimes as | |
ce947b9d RP |
540 | @emph{objdir} because these are the directories in which @code{make} |
541 | will build object files, among other things. | |
8f861f08 | 542 | |
ce947b9d | 543 | The default build directory is the same as the source directory. |
d1cde16a | 544 | You can use a different build directory with a sequence like the following: |
8f861f08 | 545 | |
ce947b9d RP |
546 | @example |
547 | mkdir @var{builddir} | |
548 | cd @var{builddir} | |
549 | configure @var{host} -srcdir=@var{sourcedirectory} | |
f3b7efd5 | 550 | @end example |
8f861f08 | 551 | |
d1cde16a RP |
552 | @noindent |
553 | where @var{builddir} is the directory where you wish to build, | |
ce947b9d RP |
554 | @var{host} is the host for which you want to build, and |
555 | @var{sourcedirectory} is the directory containing the source files. | |
8f861f08 | 556 | |
ce947b9d | 557 | If you were to do this twice with different values for @var{builddir} |
f3b7efd5 | 558 | and @var{host}, then you could @code{make} for both at the same time. |
8f861f08 | 559 | |
ce947b9d RP |
560 | @node Host, Target, Build Directories, Using Configure |
561 | @section Host | |
8f861f08 | 562 | |
ce947b9d RP |
563 | The arguments to @code{configure} are @emph{hosts}. By @emph{host} we |
564 | mean the environment in which the source will be compiled. This need | |
d1cde16a | 565 | not necessarily be the same as the physical machine involved, |
ce947b9d | 566 | although it usually is. |
8f861f08 | 567 | |
ce947b9d | 568 | For example, if some obscure machine running an operating system other |
d1cde16a | 569 | than @sc{un*x} had the @sc{gnu} @sc{posix} emulation libraries |
ce947b9d RP |
570 | available, it would be possible to configure most @sc{gnu} source for a |
571 | @sc{posix} system and build it on the obscure host. | |
8f861f08 | 572 | |
e59aa15a RP |
573 | For more on this topic, see @ref{Host Environments, , Host Environments, |
574 | cfg-paper, On Configuring Development Tools}. | |
8f861f08 | 575 | |
ce947b9d RP |
576 | @node Target, Local Conventions, Host, Using Configure |
577 | @section Target | |
8f861f08 | 578 | |
d1cde16a RP |
579 | For building native development tools, or most of the other @sc{gnu} |
580 | tools, you need not worry about the target. The @emph{target} of a | |
581 | configuration defaults to the same as the @emph{host}. | |
8f861f08 | 582 | |
d1cde16a | 583 | For building cross development tools, please see @ref{Building |
e59aa15a RP |
584 | Development Environments, , Building Development Environments, |
585 | cfg-paper, On Configuring Development Tools}. | |
8f861f08 | 586 | |
ce947b9d RP |
587 | @node Local Conventions, , Target, Using Configure |
588 | @section Local Conventions | |
8f861f08 | 589 | |
d1cde16a RP |
590 | If you find that a tool does not get configured to your liking, or if |
591 | @code{configure}'s conventions differ from your local conventions, you | |
87081339 | 592 | should probably consider site specific Makefile fragments. See also |
d1cde16a | 593 | @ref{Sites}. |
8f861f08 | 594 | |
ce947b9d RP |
595 | These are probably not the right choice for options that can be set from |
596 | the @code{configure} command line or for differences that are host or | |
597 | target dependent. | |
8f861f08 | 598 | |
d1cde16a | 599 | @node Porting, Reference, Using Configure, top |
ce947b9d | 600 | @chapter Porting with Configure |
f3b7efd5 | 601 | @cindex Porting |
d1cde16a RP |
602 | |
603 | This section explains how to add programs, host and target configuration | |
604 | names, and site-specific information to Cygnus configure. | |
8f861f08 RP |
605 | |
606 | @menu | |
87081339 RP |
607 | * Programs:: Adding configure to new programs |
608 | * Hosts and Targets:: Adding hosts and targets | |
609 | * Sites:: Adding site info | |
8f861f08 RP |
610 | @end menu |
611 | ||
8f861f08 | 612 | |
87081339 RP |
613 | @node Programs, Hosts and Targets, Porting, Porting |
614 | @section Adding Configure To New Programs | |
8f861f08 | 615 | |
f3b7efd5 RP |
616 | If you are writing a new program, you probably shouldn't worry about |
617 | porting issues or configure until it is running reasonably on some host. | |
618 | Then refer back to this section. | |
ce947b9d | 619 | |
f3b7efd5 | 620 | If the program in question currently has a configure script that meets |
d1cde16a | 621 | the criteria set out by @cite{standards.text}, please do not add Cygnus |
f3b7efd5 RP |
622 | configure. It should be possible to add this program without change to |
623 | a Cygnus configure style source tree. | |
ce947b9d | 624 | |
f3b7efd5 | 625 | If the program is not target dependent, please consider using |
d1cde16a RP |
626 | @code{autoconf} instead of Cygnus configure. @code{autoconf} will |
627 | be available soon from the @sc{fsf}. | |
628 | ||
e59aa15a | 629 | To add Cygnus configure to an existing program, do the following: |
8f861f08 | 630 | |
f3b7efd5 | 631 | @table @asis |
e59aa15a | 632 | @item Make sure the Makefile conforms to @sc{gnu} standard |
f3b7efd5 RP |
633 | The coding standard for @sc{gnu} Makefiles is described in |
634 | @cite{standards.text}. | |
8f861f08 | 635 | |
f3b7efd5 | 636 | @item Add Cygnus extensions to the Makefile |
e59aa15a | 637 | These are described in @ref{Makefile Extensions}. |
f3b7efd5 RP |
638 | |
639 | @item Move host support from Makefile to fragments | |
640 | This usually involves finding sections of the Makefile that say things | |
641 | like ``uncomment these lines for host foo'' and moving them to a new | |
e59aa15a RP |
642 | file called @file{./config/mh-foo}. For more information, see @ref{Hosts |
643 | and Targets}. | |
87081339 RP |
644 | |
645 | @item Choose defaults | |
646 | If the program has compile time options that determine the way the | |
647 | program should behave, chose reasonable defaults and make these Makefile | |
648 | variables. Be sure the variables are assigned their default values | |
e59aa15a RP |
649 | before the @code{####} line so that site specific Makefile fragments can |
650 | override them (@pxref{Makefile Extensions,,Extensions to the @sc{gnu} | |
651 | coding standards}). | |
f3b7efd5 RP |
652 | |
653 | @item Locate configuration files | |
654 | If there is configuration information in header files or source files, | |
655 | separate it in such a way that the files have a generic name. Then move | |
87081339 RP |
656 | the specific instances of those files into the @file{./config} |
657 | directory. | |
f3b7efd5 RP |
658 | |
659 | @item Separate host and target information | |
e59aa15a RP |
660 | Some programs already have this information separated. If yours does |
661 | not, you will need to separate these two kinds of configuration | |
662 | information. @dfn{Host specific} information is the information needed to | |
663 | compile the program. @dfn{Target specific} information is information on the | |
f3b7efd5 RP |
664 | format of data files that the program will read or write. This |
665 | information should live in separate files in the @file{./config} | |
666 | directory with names that reflect the configuration for which they are | |
667 | intended. | |
668 | ||
669 | At this point you might skip this step and simply move on. If you do, | |
670 | you should end up with a program that can be configured only to build | |
671 | native tools, that is, tools for which the host system is also the | |
672 | target system. Later, you could attempt to build a cross tool and | |
673 | separate out the target specific information by figuring out what went | |
674 | wrong. This is often simpler than combing through all of the source | |
675 | code. | |
676 | ||
e59aa15a | 677 | @item Write @code{configure.in} |
f3b7efd5 RP |
678 | Usually this involves writing shell script fragments to map from |
679 | canonical configuration names into the names of the configuration files. | |
680 | These files will then be linked at configure time from the specific | |
681 | instances of those files in @file{./config} to file in the build | |
d1cde16a RP |
682 | directory with more generic names. (see also @ref{Build Directories}). |
683 | The format of configure.in is described in @ref{configure.in}. | |
f3b7efd5 | 684 | |
e59aa15a | 685 | @item Rename @file{Makefile} to @file{Makefile.in} |
f3b7efd5 RP |
686 | @end table |
687 | ||
e59aa15a RP |
688 | At this point you should have a program that can be configured using |
689 | Cygnus @code{configure}. | |
f3b7efd5 | 690 | |
87081339 RP |
691 | @node Hosts and Targets, Sites, Programs, Porting |
692 | @section Adding hosts and targets | |
693 | ||
e59aa15a | 694 | To add a host or target to a program that already uses Cygnus |
87081339 RP |
695 | configure, do the following. |
696 | ||
697 | @itemize @bullet | |
698 | ||
699 | @item | |
700 | Make sure the new configuration name is represented in | |
701 | @file{config.sub}. If not, add it. For more details, see the comments | |
702 | in the shell script @file{config.sub}. | |
703 | ||
704 | @item | |
705 | If you are adding a host configuration, look in @file{configure.in}, in | |
706 | the per-host section. Make sure that your configuration name is | |
707 | represented in the mapping from host configuration names to | |
d1cde16a | 708 | configuration files. If not, add it. Also see @ref{configure.in}. |
87081339 RP |
709 | |
710 | @item | |
711 | If you are adding a target configuration, look in @file{configure.in}, | |
712 | in the per-target section. Make sure that your configuration name is | |
713 | represented in the mapping from target configuration names to | |
d1cde16a | 714 | configuration files. If not, add it. Also see @ref{configure.in}. |
87081339 RP |
715 | |
716 | @item | |
e59aa15a RP |
717 | Look in @file{configure.in} for the variables @samp{files}, |
718 | @samp{links}, @samp{host_makefile_frag}, and | |
719 | @samp{target_makefile_frag}. The values assigned to these variables are | |
bcdbe02f RP |
720 | the names of the configuration files, relative to @code{srcdir} that the |
721 | program uses. Make sure that copies of the files exist for your host. | |
722 | If not, create them. See also @ref{Configure Variables}. | |
87081339 RP |
723 | @end itemize |
724 | ||
725 | This should be enough to configure for a new host or target | |
e59aa15a RP |
726 | configuration name. Getting the program to compile and run properly |
727 | remains the hard work of the port. | |
f3b7efd5 | 728 | |
87081339 RP |
729 | @node Sites, , Hosts and Targets, Porting |
730 | @section Adding site info | |
f3b7efd5 | 731 | |
87081339 RP |
732 | If some of the Makefile defaults are not right for your site, you can |
733 | build site specific Makefile fragments. To do this, do the following. | |
f3b7efd5 | 734 | |
87081339 | 735 | @itemize @bullet |
f3b7efd5 | 736 | |
87081339 RP |
737 | @item |
738 | Choose a name for your site. It must be less than eleven characters for | |
739 | now. | |
740 | ||
741 | @item | |
e59aa15a | 742 | If the program source does not have a @file{./config} directory, create it. |
87081339 RP |
743 | |
744 | @item | |
745 | Create a file called @file{./config/ms-@var{site}} where @var{site} is | |
e59aa15a RP |
746 | the name of your site. In it, set whatever Makefile variables you need |
747 | to override to match your site's conventions. | |
87081339 RP |
748 | |
749 | @item | |
750 | Configure the program with: | |
f3b7efd5 | 751 | |
87081339 RP |
752 | @example |
753 | configure @dots{} +site=@var{site} | |
754 | @end example | |
755 | ||
756 | @end itemize | |
e59aa15a | 757 | |
f3b7efd5 RP |
758 | @node Reference, Known Bugs, Porting, top |
759 | @chapter Gory details described | |
760 | ||
761 | @cindex Backends | |
762 | Here we describe the backend support. | |
8f861f08 RP |
763 | |
764 | @menu | |
f3b7efd5 RP |
765 | * Makefile Extensions:: Extensions to the @sc{gnu} coding standards |
766 | * configure.in:: The format of the configure.in file | |
767 | * config.status:: config.status | |
768 | * Makefile Fragments:: Makefile Fragments | |
8f861f08 RP |
769 | @end menu |
770 | ||
f3b7efd5 RP |
771 | @node Makefile Extensions, configure.in, Reference, Reference |
772 | @section Extensions to the @sc{gnu} coding standards | |
8f861f08 | 773 | |
f3b7efd5 RP |
774 | @cindex Makefile extensions |
775 | @cindex Cygnus extensions | |
776 | ||
777 | The following additions to the @sc{gnu} coding standards are required | |
778 | for Cygnus configure to work properly. | |
8f861f08 RP |
779 | |
780 | @itemize @bullet | |
f3b7efd5 RP |
781 | @item |
782 | The Makefile must contain exactly one line starting with @code{####}. | |
783 | This line should follow any default macro definitions but precede any | |
784 | rules. Host, target, and site specific Makefile fragments will be | |
785 | inserted immediately after this line. If the line is missing, the | |
786 | fragments will not be inserted. | |
8f861f08 RP |
787 | @end itemize |
788 | ||
f3b7efd5 | 789 | Cygnus adds the following targets to our Makefiles. Their existence is |
e59aa15a | 790 | not required for Cygnus configure, but they are documented here for |
f3b7efd5 | 791 | completeness. |
8f861f08 | 792 | |
f3b7efd5 | 793 | @table @code |
e59aa15a | 794 | @kindex info |
f3b7efd5 RP |
795 | @item info |
796 | Build all info files from texinfo source. | |
797 | ||
e59aa15a | 798 | @kindex install-info |
f3b7efd5 RP |
799 | @item install-info |
800 | Install all info files. | |
801 | ||
e59aa15a | 802 | @kindex clean-info |
f3b7efd5 RP |
803 | @item clean-info |
804 | Remove all info files and any intermediate files that can be generated | |
805 | from texinfo source. | |
806 | ||
e59aa15a | 807 | @kindex stage1 |
f3b7efd5 | 808 | @item stage1 |
e59aa15a RP |
809 | @kindex stage2 |
810 | @itemx stage2 | |
811 | @kindex stage3 | |
812 | @itemx stage3 | |
813 | @kindex stage4 | |
814 | @itemx stage4 | |
815 | @kindex de-stage1 | |
816 | @itemx de-stage1 | |
817 | @kindex de-stage2 | |
818 | @itemx de-stage2 | |
819 | @kindex de-stage3 | |
820 | @itemx de-stage3 | |
821 | @kindex de-stage4 | |
822 | @itemx de-stage4 | |
823 | @kindex bootstrap | |
824 | @itemx bootstrap | |
825 | @kindex comparison | |
826 | @itemx comparison | |
827 | @kindex Makefile | |
828 | @itemx Makefile | |
f3b7efd5 | 829 | These targets are in transition and may be removed shortly. |
f3b7efd5 RP |
830 | @end table |
831 | ||
832 | In addition, the following Makefile targets have revised semantics: | |
833 | ||
834 | @table @code | |
e59aa15a | 835 | @kindex install |
f3b7efd5 RP |
836 | @item install |
837 | Should @emph{not} depend on the target @code{all}. If the program is | |
e59aa15a RP |
838 | not already built, @code{make install} should fail. This allows you |
839 | to install programs even when @code{make} would otherwise determine | |
f3b7efd5 RP |
840 | them to be out of date. This can happen when the result of a @code{make |
841 | all} is transported via tape to another machine for installation as | |
842 | well as in a number of other cases. | |
843 | ||
e59aa15a | 844 | @kindex clean |
f3b7efd5 RP |
845 | @item clean |
846 | Should remove any file that can be regenerated by the Makefile, | |
847 | excepting only the Makefile itself, and any links created by configure. | |
848 | That is, @code{make all clean} should return all directories to their | |
849 | original condition. If this is not done, then: | |
8f861f08 | 850 | |
f3b7efd5 RP |
851 | @example |
852 | configure @var{host1} ; make all clean ; configure @var{host2} ; make all | |
8f861f08 RP |
853 | @end example |
854 | ||
f3b7efd5 RP |
855 | @noindent |
856 | will fail because of intermediate files intended for @var{host1}. | |
f3b7efd5 RP |
857 | @end table |
858 | ||
e59aa15a RP |
859 | Cygnus adds the following macros to all @file{Makefile.in} files, but |
860 | you are not required to use them to run Cygnus configure. | |
f3b7efd5 RP |
861 | |
862 | @table @code | |
e59aa15a | 863 | @kindex docdir |
f3b7efd5 RP |
864 | @item docdir |
865 | The directory in which to install any documentation that is not either a | |
866 | man page or an info file. For man pages, see mandir, for info, see | |
867 | infodir. | |
868 | ||
e59aa15a | 869 | @kindex includedir |
f3b7efd5 RP |
870 | @item includedir |
871 | The directory in which to install any headers files that should be made | |
872 | available to users. This is distinct from the @code{gcc} include | |
873 | directory which is intended for @code{gcc} only. Files in | |
874 | @code{includedir} may be used by @code{cc} as well. | |
f3b7efd5 RP |
875 | @end table |
876 | ||
e59aa15a RP |
877 | In addition, the following macros have revised semantics. Most of them |
878 | describe installation directories; see also @ref{Install Details,,Full | |
879 | description of all installation subdirectories}. | |
f3b7efd5 RP |
880 | |
881 | @table @code | |
882 | ||
e59aa15a | 883 | @kindex manext |
f3b7efd5 | 884 | @item manext |
e59aa15a | 885 | is not used. The intended usage is not clear. For example, if you have a |
f3b7efd5 RP |
886 | @file{foo.man} and a @file{bar.man}, and @file{foo.man} is destined for |
887 | @file{/usr/local/lib/man/man1/foo.1} while @file{bar.man} is destined | |
e59aa15a RP |
888 | for @file{/usr/local/lib/man/man5/bar.5}, then what is the desired value |
889 | of @code{manext}? | |
f3b7efd5 | 890 | |
e59aa15a | 891 | @kindex datadir |
f3b7efd5 | 892 | @item datadir |
787c6bfe | 893 | is used for host independent data files. |
f3b7efd5 | 894 | |
e59aa15a | 895 | @kindex mandir |
f3b7efd5 | 896 | @item mandir |
787c6bfe | 897 | The default path for @code{mandir} depends on @code{prefix}. |
f3b7efd5 | 898 | |
e59aa15a | 899 | @kindex infodir |
f3b7efd5 | 900 | @item infodir |
787c6bfe | 901 | The default path for @code{infodir} depends on @code{prefix}. |
f3b7efd5 | 902 | |
e59aa15a | 903 | @kindex BISON |
f3b7efd5 | 904 | @item BISON |
e59aa15a | 905 | is assumed to have a @code{yacc} calling convention. To use |
f3b7efd5 | 906 | @code{bison}, use @code{BISON=bison -y}. |
f3b7efd5 RP |
907 | @end table |
908 | ||
e59aa15a | 909 | Cygnus Makefiles also conform to one additional restriction: |
8f861f08 RP |
910 | |
911 | @itemize @bullet | |
f3b7efd5 RP |
912 | @item |
913 | When libraries are installed, the line containing the call to | |
914 | @code{INSTALL_DATA} should always be followed by a line containing a | |
87081339 | 915 | call to @code{RANLIB} on the installed library. This is to accomodate |
e59aa15a RP |
916 | systems that use @code{ranlib}. Systems that do not use @code{ranlib} |
917 | can set @code{RANLIB} to @code{echo} in a host specific Makefile | |
918 | fragment. | |
8f861f08 RP |
919 | @end itemize |
920 | ||
f3b7efd5 | 921 | @node configure.in, config.status, Makefile Extensions, Reference |
e59aa15a RP |
922 | @section The format of the @file{configure.in} file |
923 | @kindex configure.in | |
924 | ||
e59aa15a RP |
925 | A @file{configure.in} file for Cygnus configure consists of a |
926 | @dfn{per-invocation} section, followed by a @dfn{per-host} section, | |
927 | followed by a @dfn{per-target} section, optionally followed by a | |
442b8598 JG |
928 | @dfn{post-target} section. Each section is a shell script fragment, |
929 | which is sourced by the configure shell script at an appropriate time. | |
930 | Values are passed among configure and the shell fragments through a | |
931 | set of shell variables. When each section is being interpreted | |
932 | (sourced) by the shell, the shell's current directory is the build | |
933 | directory, and any files created by the section (or referred to by the | |
934 | section) will be relative to the build directory. To reference files | |
935 | in other places (such as the source directory), prepend a shell | |
936 | variable such as @code{srcdir} to the desired file name. | |
e59aa15a RP |
937 | |
938 | @cindex Per-invocation section | |
939 | The beginning of the @file{configure.in} file begins the per-invocation | |
940 | section. | |
8f861f08 | 941 | |
87081339 | 942 | @cindex Per-host section |
f3b7efd5 RP |
943 | A line beginning with @code{# Per-host:} begins the per-host section. |
944 | ||
87081339 | 945 | @cindex Per-target section |
f3b7efd5 RP |
946 | A line beginning with @code{# Per-target:} begins the per-target |
947 | section. | |
948 | ||
87081339 RP |
949 | @cindex Post-target section |
950 | If it exists, the post-target section begins with @code{# Per-target:}. | |
f3b7efd5 RP |
951 | |
952 | @menu | |
953 | * Minimal:: A minimal configure.in | |
954 | * Configure Variables:: Variables available to configure.in | |
e59aa15a RP |
955 | * Declarations:: For each invocation |
956 | * Per-host:: For each host | |
957 | * Per-target:: For each target | |
f3b7efd5 RP |
958 | * Post-target:: After each target |
959 | * Example:: An example configure.in | |
960 | @end menu | |
961 | ||
962 | @node Minimal, Configure Variables, configure.in, configure.in | |
e59aa15a | 963 | @subsection A minimal @file{configure.in} |
f3b7efd5 | 964 | |
e59aa15a | 965 | @cindex Minimal @file{configure.in} example |
f3b7efd5 RP |
966 | A minimal @file{configure.in} consists of four lines. |
967 | ||
968 | @example | |
969 | srctrigger=foo.c | |
970 | srcname="source for the foo program" | |
971 | # Per-host: | |
972 | # Per-target: | |
973 | @end example | |
974 | ||
e59aa15a RP |
975 | The @samp{Per-host} and @samp{Per-target} lines divide the file into the |
976 | three required sections. The @samp{srctrigger} line names a file. | |
977 | @code{configure} checks to see that this file exists in the source | |
978 | directory before configuring. If the @samp{srctrigger} file does not | |
979 | exist, @code{configure} uses the value of @samp{srcname} to print an | |
980 | error message about not finding the source. | |
f3b7efd5 | 981 | |
87081339 RP |
982 | This particular example uses no links, and only the default host, |
983 | target, and site specific Makefile fragments if they exist. | |
f3b7efd5 RP |
984 | |
985 | @node Configure Variables, Declarations, Minimal, configure.in | |
986 | @subsection Variables available to configure.in | |
987 | ||
e59aa15a | 988 | @cindex @file{configure.in} interface |
f3b7efd5 | 989 | |
e59aa15a RP |
990 | The following variables pass information between the standard parts of |
991 | @code{configure} and the shell-script fragments in @file{configure.in}: | |
f3b7efd5 RP |
992 | |
993 | @defvar{srctrigger} | |
994 | Contains the name of a source file that is expected to live in the | |
e59aa15a RP |
995 | source directory. You must usually set this in the per-invocation |
996 | section of @file{configure.in}. Configure tests to see that this file | |
997 | exists. If the file does not exist, configure prints an error message. | |
998 | This is used as a sanity check that configure.in matches the source | |
999 | directory. | |
f3b7efd5 RP |
1000 | @end defvar |
1001 | ||
1002 | @defvar{srcname} | |
e59aa15a RP |
1003 | Contains the name of the source collection contained in the source |
1004 | directory. You must usually set this in the per-invocation section of | |
1005 | @file{configure.in}. If the file named in @code{srctrigger} does not | |
1006 | exist, configure uses the value of this variable when it prints the | |
1007 | error message. | |
f3b7efd5 RP |
1008 | @end defvar |
1009 | ||
1010 | @defvar{configdirs} | |
e59aa15a RP |
1011 | Contains the names of any subdirectories where @code{configure} should |
1012 | recur. You must usually set this in the per-invocation section of | |
8becd045 PB |
1013 | @file{configure.in}. |
1014 | If @file{Makefile.in} contains a line starting with @code{SUBDIRS =}, | |
1015 | then it will be replaced with an assignment to @code{SUBDIRS} using | |
888cf679 | 1016 | the value of @code{configdirs} (if @code{subdirs} is empty). This can |
8becd045 PB |
1017 | be used to determine which directories to configure and build depending |
1018 | on the host and target configurations. | |
f8f3c853 RP |
1019 | @c Most other matching makefile/config vars use the same name. Why not |
1020 | @c this? (FIXME). | |
8becd045 PB |
1021 | @c Can we get rid of SUBDIRS-substitution? It doesn't work well with subdirs. |
1022 | Use @code{configdirs} (instead of the @code{subdirs} variable | |
1023 | described below) if you want to be able to partition the | |
1024 | sub-directories, or use independent Makefile fragments. | |
1025 | Each sub-directory can be independent, and independently re-configured. | |
1026 | @end defvar | |
1027 | ||
1028 | @defvar{subdirs} | |
1029 | Contains the names of any subdirectories where @code{configure} should | |
1030 | create a @code{Makefile} (in addition to the current directory), | |
1031 | @emph{without} recursively running @code{configure}. | |
1032 | Use @code{subdirs} (instead of the @code{configdirs} variable | |
1033 | described above) if you want to configure all of the directories | |
1034 | as a unit. Since there is a single invocation of @code{configure} | |
1035 | that configures many directories, all the directories can use the | |
1036 | same Makefile fragments, and the same @code{configure.in}. | |
f3b7efd5 RP |
1037 | @end defvar |
1038 | ||
8f861f08 | 1039 | @defvar{host} |
3a005587 RP |
1040 | Contains the full configuration name (generated by the script |
1041 | @file{config.sub} from the name that the user entered) for the host. | |
1042 | This is a three-part name of the form | |
1043 | ||
1044 | @example | |
1045 | @var{cpu}-@var{vendor}-@var{os} | |
1046 | @end example | |
1047 | ||
1048 | @noindent | |
1049 | There are separate variables @code{host_cpu}, @code{host_vendor}, and | |
1050 | @code{host_os} that you can use to test each of the three parts; this | |
1051 | variable is useful, however, for error messages, and for testing | |
1052 | combinations of the three components. | |
8f861f08 RP |
1053 | @end defvar |
1054 | ||
1055 | @defvar{host_cpu} | |
1056 | Contains the first element of the canonical triple representing the host | |
f3b7efd5 | 1057 | as returned by @file{config.sub}. This is occasionally used to |
8f861f08 RP |
1058 | distinguish between minor variations of a particular vendor's operating |
1059 | system and sometimes to determine variations in binary format between | |
1060 | the host and the target. | |
1061 | @end defvar | |
1062 | ||
1063 | @defvar{host_vendor} | |
1064 | Contains the second element of the canonical triple representing the | |
f3b7efd5 | 1065 | host as returned by @file{config.sub}. This is usually used to |
8f861f08 RP |
1066 | distinguish betwen the numerous variations between @emph{common} |
1067 | operating systems. | |
e59aa15a RP |
1068 | @c "@emph{common} OS" doesn't convey much to me. Is this meant to cover |
1069 | @c cases like Unix, widespread but with many variations? | |
8f861f08 RP |
1070 | @end defvar |
1071 | ||
1072 | @defvar{host_os} | |
1073 | Contains the the third element of the canonical triple representing the | |
f3b7efd5 | 1074 | host as returned by @file{config.sub}. |
8f861f08 RP |
1075 | @end defvar |
1076 | ||
1077 | @defvar{target} | |
3a005587 RP |
1078 | Contains the full configuration name (generated by the script |
1079 | @file{config.sub} from the name that the user entered) for the target. | |
1080 | This is a three-part name of the form | |
1081 | ||
1082 | @example | |
1083 | @var{cpu}-@var{vendor}-@var{os} | |
1084 | @end example | |
1085 | ||
1086 | @noindent | |
1087 | There are separate variables @code{target_cpu}, @code{target_vendor}, and | |
1088 | @code{target_os} that you can use to test each of the three parts; this | |
1089 | variable is useful, however, for error messages, and for testing | |
1090 | combinations of the three components. | |
8f861f08 RP |
1091 | @end defvar |
1092 | ||
1093 | @defvar{target_cpu} | |
1094 | Contains the first element of the canonical triple representing the | |
f3b7efd5 | 1095 | target as returned by @file{config.sub}. This is used heavily by |
8f861f08 RP |
1096 | programs involved in building programs, like the compiler, assembler, |
1097 | linker, etc. Most programs will not need the @code{target} variables at | |
1098 | all, but this one could conceivably be used to build a program, for | |
1099 | instance, that operated on binary data files whose byte order or | |
e59aa15a | 1100 | alignment differ from the system where the program is running. |
8f861f08 RP |
1101 | @end defvar |
1102 | ||
1103 | @defvar{target_vendor} | |
1104 | Contains the second element of the canonical triple representing the | |
f3b7efd5 | 1105 | target as returned by @file{config.sub}. This is usually used to |
8f861f08 RP |
1106 | distinguish betwen the numerous variations between @emph{common} |
1107 | operating systems or object file formats. Sometimes it is used to | |
87081339 | 1108 | switch between different flavors of user interfaces. |
e59aa15a | 1109 | @c above query re "@emph{common} OS" applies here too |
8f861f08 RP |
1110 | @end defvar |
1111 | ||
1112 | @defvar{target_os} | |
1113 | Contains the the third element of the canonical triple representing the | |
f3b7efd5 | 1114 | target as returned by @file{config.sub}. This variable is used by |
8f861f08 RP |
1115 | development tools to distinguish between subtle variations in object |
1116 | file formats that some vendors use across operating system releases. It | |
1117 | might also be use to decide which libraries to build or what user | |
1118 | interface the tool should provide. | |
1119 | @end defvar | |
1120 | ||
72754842 DZ |
1121 | @defvar{floating_point} |
1122 | Is set to @code{no} if the user invoked configure with the @code{-nfp} | |
8f861f08 | 1123 | command line option, otherwise it is empty. This is a request to target |
87081339 RP |
1124 | machines with @emph{no floating point} unit, even if the targets |
1125 | ordinarily have floating point units available. This option has no | |
f3b7efd5 | 1126 | negation. |
8f861f08 RP |
1127 | @end defvar |
1128 | ||
1129 | @defvar{gas} | |
1130 | Is set to @code{true} if the user invoked configure with the @code{-gas} | |
1131 | command line option, otherwise it is empty. This is a request to assume | |
e59aa15a RP |
1132 | that all target machines have @sc{gas} available even if they ordinarily do |
1133 | not. The converse option @samp{-no-gas} is not available. | |
8f861f08 RP |
1134 | @end defvar |
1135 | ||
1136 | @defvar{x} | |
1137 | Is set to @code{true} if the user invoked configure with the @code{-x} | |
1138 | command line option, otherwise it is empty. This is a request to assume | |
87081339 RP |
1139 | that @sc{mit x11} compatible headers files and libraries are available |
1140 | on all hosts, regardless of what is normally available on them. | |
8f861f08 RP |
1141 | @end defvar |
1142 | ||
1143 | @defvar{srcdir} | |
1144 | Is set to the name of the directory containing the source for this | |
f3b7efd5 | 1145 | program. This will be different from @file{.} if the user has specified |
787c6bfe RP |
1146 | the @code{-srcdir=} option. Note that @code{srcdir} is not necessarily |
1147 | an absolute path. | |
8f861f08 RP |
1148 | @end defvar |
1149 | ||
1150 | @defvar{host_makefile_frag} | |
bcdbe02f RP |
1151 | If set by @file{configure.in}, this variable should be the name a file, |
1152 | relative to @code{srcdir} to be included in the resulting Makefile. If | |
1153 | the named file does not exist, @code{configure} will print a warning | |
1154 | message. This variable is not set by @code{configure}. | |
8f861f08 RP |
1155 | @end defvar |
1156 | ||
1157 | @defvar{target_makefile_frag} | |
bcdbe02f RP |
1158 | If set by @file{configure.in}, this variable should be the name of a |
1159 | file, relative to @code{srcdir}, to be included in the resulting | |
1160 | Makefile. If the named file does not exist, @code{configure} will print | |
1161 | a warning message. This variable is not set by @code{configure}. | |
8f861f08 RP |
1162 | @end defvar |
1163 | ||
e59aa15a | 1164 | @defvar{site_makefile_frag} |
8f861f08 | 1165 | Is set to a file name representing to the default Makefile fragment for |
e59aa15a | 1166 | this host. It may be set in @file{configure.in} to override this |
8f861f08 | 1167 | default. Normally @code{site_makefile_frag} is empty, but will have a |
e59aa15a RP |
1168 | value if the user specified @code{-site=} on the command line. It is |
1169 | probably not a good idea to override this variable from | |
1170 | @file{configure.in}, since that may defeat the @code{configure} user's | |
1171 | intentions. | |
8f861f08 RP |
1172 | @end defvar |
1173 | ||
1174 | @defvar{Makefile} | |
1175 | Is set to the name of the generated @file{Makefile}. Normally this | |
1176 | value is precisely @file{Makefile} but some programs may want something | |
1177 | else. | |
1178 | @end defvar | |
1179 | ||
1180 | @defvar{removing} | |
1181 | Is normally empty but will be set to some non-empty value if the user | |
1182 | specified @code{-rm} on the command line. That is, if @code{removing} | |
1183 | is non-empty, then configure is @emph{removing} a configuration rather | |
1184 | than creating one. | |
1185 | @end defvar | |
1186 | ||
1187 | @defvar{files} | |
1188 | If this variable is non-empty following the @code{per-target:} section, | |
e59aa15a RP |
1189 | then each word in its value will be the target of a symbolic link named |
1190 | in the corresponding word from the @code{links} variable. | |
8f861f08 RP |
1191 | @end defvar |
1192 | ||
1193 | @defvar{links} | |
1194 | If the @code{files} variable is non-empty following the | |
e59aa15a RP |
1195 | @code{per-target:} section, then @code{configure} creates symbolic links |
1196 | with the first word of @code{links} pointing to the first word of | |
1197 | @code{files}, the second word of @code{links} pointing to the second | |
1198 | word of @code{files}, and so on. | |
8f861f08 RP |
1199 | @end defvar |
1200 | ||
f3b7efd5 | 1201 | @node Declarations, Per-host, Configure Variables, configure.in |
e59aa15a | 1202 | @subsection For each invocation |
ce947b9d | 1203 | |
f3b7efd5 | 1204 | @cindex Declarations section |
ce947b9d | 1205 | |
e59aa15a RP |
1206 | @code{configure} sources the entire shell script fragment from the start |
1207 | of @file{configure.in} up to a line beginning with @samp{# Per-host:} | |
1208 | immediately after parsing command line arguments. The variables | |
1209 | @code{srctrigger} and @code{srcname} @emph{must} be set here. | |
ce947b9d | 1210 | |
787c6bfe | 1211 | You might also want to set the variable @code{configdirs} here. |
ce947b9d | 1212 | |
f3b7efd5 | 1213 | @node Per-host, Per-target, Declarations, configure.in |
e59aa15a RP |
1214 | @subsection For each host |
1215 | @cindex per-host section | |
1216 | @cindex host shell-script fragment | |
ce947b9d | 1217 | |
e59aa15a RP |
1218 | The per-host section of @file{configure.in} starts with the line that begins |
1219 | with @samp{# Per-host:} and ends before a line beginning with | |
1220 | @samp{# Per-target:}. @code{configure} sources the per-host section once for | |
f3b7efd5 | 1221 | each host. |
ce947b9d | 1222 | |
f3b7efd5 | 1223 | This section usually contains a big case statement using the variables |
e59aa15a RP |
1224 | @samp{host_cpu}, @samp{host_vendor}, and @samp{host_os} to determine |
1225 | appropriate values for @samp{host_makefile_frag} and @samp{files}, | |
1226 | although @samp{files} is not usually set here. Usually, it is set | |
f3b7efd5 RP |
1227 | at the end of the per-target section after determining the names of the |
1228 | target specific configuration files. | |
8f861f08 | 1229 | |
f3b7efd5 | 1230 | @node Per-target, Post-target, Per-host, configure.in |
e59aa15a RP |
1231 | @subsection For each target |
1232 | @cindex per-target section | |
1233 | @cindex target shell-script fragment | |
1234 | ||
1235 | The per-target section of @file{configure.in} starts with the line that | |
1236 | begins with @samp{# Per-target:} and ends before the line that begins | |
1237 | with @samp{# Post-target:}, if there is such a line. Otherwise the | |
1238 | per-target section extends to the end of the file. @code{configure} sources | |
1239 | the per-target section once for each target before building any files, | |
f3b7efd5 | 1240 | directories, or links. |
ce947b9d | 1241 | |
e59aa15a RP |
1242 | This section usually contains a big case statement using the variables called |
1243 | @samp{target_cpu}, @samp{target_vendor}, and @samp{target_os} to determine | |
1244 | appropriate values for @samp{target_makefile_frag} and @samp{files}. | |
f3b7efd5 RP |
1245 | The last lines in the per-target section normally set the variables |
1246 | @code{files} and @code{links}. | |
ce947b9d | 1247 | |
f3b7efd5 RP |
1248 | @node Post-target, Example, Per-target, configure.in |
1249 | @subsection After each target | |
ce947b9d | 1250 | |
f3b7efd5 RP |
1251 | The post-target section is optional. If it exists, the post-target |
1252 | section starts with a line beginning with @code{# Post-target:} and | |
e59aa15a | 1253 | extends to the end of the file. If it exists, @code{configure} sources this |
f3b7efd5 RP |
1254 | section once for each target after building all files, directories, or |
1255 | links. | |
ce947b9d | 1256 | |
e59aa15a RP |
1257 | This section is seldom needed, but you can use it to edit the Makefile |
1258 | generated by @code{configure}. | |
ce947b9d | 1259 | |
f3b7efd5 | 1260 | @node Example, , Post-target, configure.in |
e59aa15a RP |
1261 | @subsection An example @file{configure.in} |
1262 | @cindex example @file{configure.in} | |
1263 | @cindex sample @file{configure.in} | |
1264 | @cindex Bison @file{configure.in} | |
8f861f08 | 1265 | |
e59aa15a | 1266 | Here is a small example of a @file{configure.in} file. |
8f861f08 | 1267 | |
f3b7efd5 | 1268 | @example |
e59aa15a RP |
1269 | # This file is a collection of shell script fragments used to tailor |
1270 | # a template configure script as appropriate for this directory. | |
f8f3c853 | 1271 | # For more information, see configure.texi. |
8f861f08 | 1272 | |
f3b7efd5 RP |
1273 | configdirs= |
1274 | srctrigger=warshall.c | |
1275 | srcname="bison" | |
1276 | ||
1277 | # per-host: | |
87081339 | 1278 | case "$@{host_os@}" in |
f3b7efd5 RP |
1279 | m88kbcs) |
1280 | host_makefile_frag=config/mh-delta88 | |
1281 | ;; | |
1282 | esac | |
ce947b9d | 1283 | |
f3b7efd5 | 1284 | # per-target: |
ce947b9d | 1285 | |
f3b7efd5 RP |
1286 | files="bison_in.hairy" |
1287 | links="bison.hairy" | |
ce947b9d | 1288 | |
f3b7efd5 RP |
1289 | # post-target: |
1290 | @end example | |
ce947b9d | 1291 | |
f3b7efd5 | 1292 | @node config.status, Makefile Fragments, configure.in, Reference |
e59aa15a | 1293 | @section @code{config.status} |
ce947b9d | 1294 | |
e59aa15a | 1295 | @kindex config.status |
ce947b9d | 1296 | |
87081339 | 1297 | The final step in configuring a directory is to create an executable |
e59aa15a RP |
1298 | shell script, @file{config.status}. The main purpose of this file |
1299 | is to allow the Makefile for the current directory to rebuild itself, if | |
1300 | necessary. For this reason, @file{config.status} uses the | |
1301 | @samp{-norecursion} option to @code{configure}, and is therefore | |
1302 | probably inappropriate for reconfiguring a tree of source code. | |
ce947b9d | 1303 | |
f3b7efd5 RP |
1304 | @node Makefile Fragments, , config.status, Reference |
1305 | @section Makefile Fragments | |
ce947b9d | 1306 | |
f3b7efd5 | 1307 | @cindex Makefile fragments |
ce947b9d | 1308 | |
e59aa15a RP |
1309 | Cygnus @code{configure} uses three types of Makefile fragments. In a |
1310 | generated Makefile they appear in the order target fragment, host | |
1311 | fragment, and site fragment. This allows host fragments to override | |
1312 | target fragments, and site fragments to override both. | |
87081339 RP |
1313 | |
1314 | Host specific Makefile fragments conventionally reside in the | |
1315 | @file{./config} directory with names of the form | |
1316 | @file{mh-@var{host}}. They are used for hosts that require | |
1317 | odd options to the standard compiler and for compile time options based | |
1318 | on the host configuration. | |
1319 | ||
1320 | Target specific Makefile fragments conventionally reside in the | |
1321 | @file{./config} directory with names of the form @file{mt-@var{target}}. | |
1322 | They are used for target dependent compile time options. | |
1323 | ||
1324 | Site specific Makefile fragments conventionally reside in the | |
1325 | @file{./config} directory with names of the form @file{ms-@var{site}}. | |
1326 | They are used to override host and target independent compile time | |
787c6bfe | 1327 | options. Note that you can also override these options on the |
87081339 | 1328 | @code{make} invocation line. |
ce947b9d | 1329 | |
f3b7efd5 | 1330 | @node Known Bugs, Variables Index, Reference, top |
8f861f08 RP |
1331 | @chapter Known Bugs |
1332 | ||
f3b7efd5 RP |
1333 | @cindex bugs |
1334 | ||
e59aa15a | 1335 | We know of the following bugs: |
8f861f08 RP |
1336 | |
1337 | @itemize @bullet | |
1338 | ||
1339 | @item | |
1340 | There is no way to query about known hosts, known targets, or the | |
1341 | porting or testing status of any configuration. | |
1342 | ||
1343 | @item | |
1344 | The negations to the options @code{-gas}, @code{-x}, and @code{-nfp} are | |
1345 | not available. | |
1346 | ||
1347 | @end itemize | |
1348 | ||
f3b7efd5 | 1349 | @page |
8f861f08 | 1350 | @node Variables Index, Concept Index, Known Bugs, top |
ce947b9d | 1351 | @appendix Variable Index |
8f861f08 RP |
1352 | |
1353 | @printindex vr | |
1354 | ||
f3b7efd5 | 1355 | @page |
8f861f08 | 1356 | @node Concept Index, , Variables Index, top |
ce947b9d | 1357 | @appendix Concept Index |
8f861f08 RP |
1358 | |
1359 | @printindex cp | |
8f861f08 RP |
1360 | @contents |
1361 | @bye | |
1362 | ||
1363 | @c Local Variables: | |
1364 | @c fill-column: 79 | |
1365 | @c outline-regexp: "@chap" | |
1366 | @c End: | |
1367 | @c (setq outline-regexp "@chapt\\\|@unnum\\\|@setf\\\|@conte\\\|@sectio\\\|@subsect\\\|@itemize\\\|@defvar{") |