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