1 \input texinfo @c -*-para-*-
3 @setfilename configure.info
4 @settitle Cygnus Configure
7 \def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
8 \xdef\manvers{\$Revision$} % For use in headers, footers too
10 @setchapternewpage off
13 This document attempts to describe the Cygnus Support version of
16 Copyright (C) 1991 Cygnus Support
17 Permission is granted to make and distribute verbatim copies of
18 this manual provided the copyright notice and this permission notice
19 are preserved on all copies.
22 Permission is granted to process this file through TeX and print the
23 results, provided the printed document carries copying permission
24 notice identical to this one except for the removal of this paragraph
25 (this paragraph not being relevant to the printed manual).
28 Permission is granted to copy and distribute modified versions of this
29 manual under the conditions for verbatim copying, provided that the entire
30 resulting derived work is distributed under the terms of a permission
31 notice identical to this one.
33 Permission is granted to copy and distribute translations of this manual
34 into another language, under the above conditions for modified versions,
35 except that this permission notice may be stated in a translation approved
41 @title{Cygnus Configure}
42 @subtitle @manvers, for Cygnus Configure version 1.84
43 @author{K. Richard Pixley, @code{rich@@cygnus.com}}
44 @author{Cygnus Support}
47 @vskip 0pt plus 1filll
48 Copyright @copyright{} 1991 Cygnus Support
50 Permission is granted to make and distribute verbatim copies of
51 this manual provided the copyright notice and this permission notice
52 are preserved on all copies.
54 Permission is granted to copy and distribute modified versions of this
55 manual under the conditions for verbatim copying, provided that the entire
56 resulting derived work is distributed under the terms of a permission
57 notice identical to this one.
59 Permission is granted to copy and distribute translations of this manual
60 into another language, under the above conditions for modified versions,
61 except that this permission notice may be stated in a translation approved
68 * configure: (configure.info). Cygnus configure.
72 @node top, What Configure Does, (dir), (dir)
75 This file documents the configuration system used and distributed by
78 NOTE: support for a Cygnus experimental option, @code{-subdirs} is at
79 least temporarily suspended. Most of the code is still in configure but
80 the option is disabled. This document describes that feature, but those
81 parts are prominently marked with NOTE's like this one. FIXME-soon
84 * What Configure Does:: What Configure Does
86 * Using Configure:: Using Configure
87 * Porting:: Porting with Configure
88 * Reference:: Gory details described
89 * Known Bugs:: Known Bugs
90 * Variables Index:: Variable Index
91 * Concept Index:: Concept Index
99 NOTE: support for a Cygnus experimental option, @code{-subdirs} is at
100 least temporarily suspended. Most of the code is still in configure but
101 the option is disabled. This document describes that feature, but those
102 parts are prominently marked with NOTE's like this one. FIXME-soon
105 @node What Configure Does, Invoking, top, top
106 @chapter What Configure Does
108 @code{configure} prepares source directories for building working
109 programs. A program cannot be built until its source has been
110 configured. When configure runs, it does the following things for each source
111 directory for each host and target combination.
113 NOTE: support for multiple hosts and targets is at least temporarily
117 @item Create build directories
118 (see @ref{Build Directories}). When you run @code{configure} with the
119 @code{-srcdir=} option, it uses the current directory as build
120 directory, creating under it a directory tree that parallels the
121 directory structure under the source directory. (See @ref{Invoking}).
123 NOTE: support for @code{-subdirs} is at least temporarily suspended.
125 When you run @code{configure} with the @code{-subdirs} option, it
126 creates a build subdirectory in each source directory.
128 If you use both @code{-subdirs} and @code{-srcdir=}, a tree that
129 parallels the source directory structure is created in the current
130 directory, and the subdirectories are created in this directory tree
131 rather than in the source directories.
133 @item Generate makefiles
134 A makefile template from the source directory, usually called
135 @file{Makefile.in}, is copied to an output file in the build directory.
136 The output file is usually named @file{Makefile}. @code{configure}
137 places definitions for a number of standard makefile
138 macros at the beginning of the output file. If @code{-prefix=} or
139 @code{-datadir=} were specified on the @code{configure} command line,
140 corresponding makefile variables are set accordingly. If host, target, or
141 site specific makefile fragments exist, these are inserted into the
142 output file. (See @ref{Makefiles, , , make, Makefiles}.)
144 @item Generate @file{.gdbinit}
145 If the source directory contains a @file{.gdbinit} file and the build
146 directory is not the same as the source directory, a @file{.gdbinit}
147 file is created in the build directory. (see @ref{Command Files, , ,
148 gdb, Command Files}.)
149 @c There doesn't seem to be anything else about this. Is the build-dir
150 @c .gdbinit identical with the source-dir one? If so should say "copy"
151 @c rather than "create" to make it clear.
153 @item Make symbolic links
154 Most directories have some symbolic links with generic names built
155 pointing to specific files in the source directory. If the system where
156 @code{configure} runs cannot support symbolic links, hard links are used
160 If the source directory has special needs, they are handled by shell
161 script fragments stored with the source. Usually there are no special
162 needs, but sometimes they involve changes to the output makefile.
164 @item Generate @file{config.status}
165 @code{configure} creates a shell script named @file{config.status} in
166 the build directory. This shell script, when run from the build
167 directory, will reconfigure the build directory (but not its
168 subdirectories). This is most often used to have a @code{Makefile} update
169 itself automatically if a new source directory is available.
170 (see @ref{Top, , , bash}.)
171 @c That's a rather extraordinary xref. What's it meant to clarify
172 @c ---shell scripts in general??
175 If the source directory has subdirectories that should also be
176 configured, @code{configure} is called for each.
179 @node Invoking, Using Configure, What Configure Does, top
182 The usual way to invoke @code{configure} is as follows:
186 This prepares the source to be compiled in a
187 @var{host} environment with programs and files to be installed in
190 NOTE: support for multiple hosts is at least temporarily suspended.
193 If more than one host is specified on the command line, then
194 configurations are created for each and @code{-subdirs} is assumed.
196 @code{configure} prepares the source as you specify by selecting and
197 using script and Makefile fragments prepared in advance, and stored with
198 the source. @code{configure}'s command line options also allow you to
199 specify other aspects of the source configuration:
202 @item -datadir=@var{dir}
203 Configure the source to install host independent files in @var{dir}.
205 This option sets the @code{configure} variable @code{datadir}. If
206 @code{datadir} is not empty, generated Makefiles will have their
207 @code{datadir} variables set to this value. (See @ref{Install Details}.)
210 Configure to use the @sc{GNU} assembler.
213 Display a quick summary of how to invoke @code{configure}.
215 @item -host=@var{host}
216 FIXME-soon: I don't think this option should be documented.
217 @c Then why does it exist? /Pesch 7jan92
219 @item -namesubdir=@var{name}
220 NOTE: support for this @code{-namesubdir=} is at least temporarily
221 suspended. FIXME-soon
223 Name any subdirectories created by the @code{-subdirs} option
226 @emph{Warning:} Avoid using this option if you specify multiple hosts
227 simultaneously. There is no way to specify separate names for
228 subdirectories, when you configure for multiple hosts in a single
229 invocation of @code{configure}.
232 @c singular "target" due to apparent direction of configure.
233 @emph{No floating point} unit available on the target; configure to
234 avoid dependencies on hardware floating point.
235 @c Can we even say "configure to use software floating point support"?
238 Configure only this directory; ignore any subdirectories. This is used
239 by the executable shell script @file{config.status} to reconfigure the
240 current directory. (see @ref{config.status}).
241 @c Why *does* that use no recursion? Speed? geometric combinations
242 @c under some other script?
245 @c This is complicated enough without "no longer supported" entries.
246 @c Should really delete this, but for ease of discourse...
247 @item -objdir=@var{dir}
248 This option is no longer supported. Use @code{-srcdir=} instead.
251 @item -prefix=@var{dir}
252 Configure the source to install programs and files under directory
255 This option sets the @code{configure} variable @code{prefix}. If
256 @code{prefix} is not empty, generated Makefiles will have their
257 @code{prefix} variables set to this value. (See @ref{Install Details}.)
260 @c Wouldn't it make more sense to call this "-quiet"?
261 This option is used internally by @code{configure} when recurring on
262 subdirectories. Its sole purpose is to suppress status output. You can
263 override this effect with the @code{-verbose} option.
266 @emph{Remove} the configuration specified by @var{host} and the other
267 command-line options, rather than creating it.
269 @item -site=@var{site}
270 Generate Makefiles using site specific Makefile fragments for
271 @var{site}. See also @ref{Sites}.
273 @item -srcdir=@var{_dir}
274 Build Makefiles to use the sources located in directory @file{@var{dir}}. The
275 build directory is assumed to be @file{.}.
278 NOTE: support for this @code{-subdirs} is at least temporary suspended.
281 Place configurations in subdirectories of each build directory.
282 @code{configure} builds a separate subdirectory for each host specified,
283 and names it @file{H-@var{host}}. If a configuration is not native,
284 (@var{host} is not @var{target}), then the subdirectory is named
285 @file{X-@var{host}-@var{target}} instead. You can also name a
286 subdirectory explicitly using the @samp{-namesubdir} option, but this is
287 effective only when you specify one configuration at a time.
289 @item -target=@var{target}
290 Requests that the sources be configured to target the @var{target}
291 machine. If no target is specified explicitly, the target is assumed
292 to be the same as the host.
294 NOTE: support for multiple targets is at least temporarily suspended.
297 If multiple targets are specified, configurations for each
298 are created and @code{-subdirs} is assumed.
300 @item -tmpdir=@var{tmpdir}
301 Use the directory @var{tmpdir} for @code{configure}'s temporary files.
306 Print status lines for each directory configured. Normally, only the
307 status lines for the initial working directory are printed.
310 Use @sc{MIT} style @sc{X11} header files and libraries on the host, even
311 if they are not normally available.
314 @node Using Configure, Porting, Invoking, top
315 @chapter Using Configure
317 The choices and options available at configuration time
318 generally have valid defaults, but the defaults do not cover all cases.
319 The choices available include install locations, build directories,
320 host, target, and local conventions.
323 * Install Locations:: Where to install things once they are built
324 * Build Directories:: Where to build object files
325 * Host:: Telling @code{configure} what will source will
327 * Target:: Telling @code{configure} what the source will
329 * Local Conventions:: Adding information about local conventions
332 @node Install Locations, Build Directories, Using Configure, Using Configure
333 @section Install Locations
334 @cindex Where to install
336 Using the default configuration, @code{make install} creates a
337 single tree of files, some of which are programs. The location of this
338 tree is determined by the value of the variable @code{prefix}. The
339 default value of @code{prefix} is @file{/usr/local}. This is
340 often correct for native tools installed on only one host.
343 * prefix:: Changing the default install directory
344 * datadir:: How to separate host independent files
345 from host dependent files when
346 installing for multiple hosts
347 * Install Details:: Full descriptions of all installation
351 @node prefix, datadir, Install Locations, Install Locations
352 @subsection Changing the default install directory
353 @cindex Changing the default install directory
354 @cindex Prefix directory
356 In the default configuration, all files are installed in subdirectories
357 of @file{/usr/local}. The location is determined by the value of
358 the @code{configure} variable @code{prefix}; in turn, this determines the
359 value of the Makefile variable of the same name (@code{prefix}).
361 You can also set the value of the Makefile variable @code{prefix}
362 explicitly each time you invoke @code{make} if you are so inclined; but
363 because many programs have this location compiled in, you must specify
364 the @code{prefix} value consistently on each invocation of @code{make},
365 or you will end up with a broken installation.
367 To make this easier, the value of the @code{configure} variable
368 @code{prefix} can be set on the command line to @code{configure}
369 using the option @code{-prefix=}.
370 @c This is self-referential. What was intended?: (See @ref{prefix}).
373 @node datadir, Install Details, prefix, Install Locations
374 @subsection Installing for multiple hosts
375 @cindex Configuring for multiple hosts
376 @cindex Sharing host independent files
377 @cindex The datadir directory
378 @cindex Installing host independent files
380 By default, host independent files are installed in subdirectories of
381 @file{@var{prefix}/lib}. The location is determined by the value of the
382 @code{configure} variable @code{datadir}, which determines the value of
383 the Makefile variable @code{datadir}. This makes it simpler to install
384 for a single host, and simplifies changing the default location for the
385 install tree; but the default doesn't allow for multiple hosts to
386 effectively share host independent files.
388 To configure so that multiple hosts can share common files, use
392 configure @var{host1} -prefix=/usr/gnu/H-@var{host1} -datadir=/usr/gnu/H-independent
393 make all info install install-info clean
395 configure @var{host2} -prefix=/usr/gnu/H-@var{host2} -datadir=/usr/gnu/H-independent
396 make all info install install-info
399 The first line configures the source for @var{host1} to place host
400 specific programs in subdirectories of @file{/usr/gnu/H-@var{host1}},
401 and host independent files in @file{/usr/gnu/H-independent}.
402 @c Self-ref? (See @ref{datadir}.)
404 The second line builds and installs all programs for @var{host1},
405 including both host independent and host specific files.
407 The third line reconfigures the source for @var{host2} to place host
408 specific programs in subdirectories of @file{/usr/gnu/H-@var{host2}},
409 and host independent files (once again) in
410 @file{/usr/gnu/H-independent}.
412 The fourth line builds and installs all programs for @var{host2}. Host
413 specific files are installed in new directories, but the host
414 independent files are installed @emph{on top of} the host
415 independent files installed for @var{host1}. This results in a single
416 copy of the host independent files, suitable for use by both hosts.
417 @c Won't make notice the installed copies aren't out of date and leave
420 NOTE: support for @code{-subdirs} and multiple hosts is at least
421 temporarily suspended. FIXME-soon
426 configure @var{host1} @var{host2} -prefix=/usr/gnu
427 @c and make something-or-other, surely?
430 @node Install Details, , datadir, Install Locations
431 @subsection Full descriptions of all installation subdirectories
433 During any install, a number of standard directories are created. Their
434 names are determined by Makefile variables. Some of the
435 defaults for Makefile variables can be changed at configure time using
436 command line options to @code{configure}. For more information on the
437 standard directories or the Makefile variables, please refer to
438 @cite{standards.text}.
440 Note that @code{configure} does not create the directory @code{srcdir}
441 at any time. @code{srcdir} is not an installation directory.
443 You can override all makefile variables on the command line to
444 @code{make}. (See @ref{Overriding, Overriding Variables, Overriding
445 Variables, make, Make}.) If you do so, you will need to specify the
446 value precisely the same way for each invocation of @code{make}, or you
447 risk ending up with a broken installation. This is because many
448 programs have the locations of other programs or files compiled into
449 them. If you find yourself overriding any of the variables frequently,
450 you should consider site dependent Makefile fragments. See also
453 During @code{make install}, a number of standard directories are
454 created and populated. The following Makefile variables define them.
455 Those whose defaults are set by corresponding @code{configure} variables
456 are marked ``Makefile and configure''.
459 @defvr {Makefile and configure} prefix
460 The root of the installation tree. You can set
461 its Makefile default with the @code{-prefix=} command line option to
462 @code{configure}. (@ref{Invoking}.) The default value for
463 @code{prefix} is @file{/usr/local}.
467 @defvr Makefile bindir
468 A directory for binary programs that users can run.
469 The default value for @code{bindir} depends on @code{prefix};
470 @code{bindir} is normally changed only indirectly through @code{prefix}.
471 The default value for @code{bindir} is @file{$(prefix)/bin}.
475 @defvr {Makefile and configure} datadir
476 A directory for host independent files. You can specify the Makefile
477 default value by using the @code{-datadir=} option to @code{configure}.
478 (See also @ref{Invoking}.) The default value for @code{datadir} is
479 @file{$(prefix)/lib}.
483 @defvr Makefile libdir
484 A directory for libraries and support programs. The default value for
485 @code{libdir} depends on @code{prefix}; @code{libdir} is normally
486 changed only indirectly through @code{prefix}. The default value for
487 @code{libdir} is @file{$(prefix)/lib}.
491 @defvr Makefile mandir
492 A directory for @code{man} format documentation (``man pages''). The
493 default value for @code{mandir} depends on @code{prefix};
494 @code{mandir} is normally changed only indirectly through @code{prefix}.
495 The default value for @code{mandir} is @file{$(datadir)/man}.
498 @vindex man@var{N}dir
499 @defvr Makefile man@var{N}dir
500 There are eight variables named @code{man1dir}, @code{man2dir}, etc.
501 They name the specific directories for each man page section. For
502 example, @code{man1dir} holds @file{emacs.1} (the man page for the emacs
503 program), while @code{man5dir} holds @file{rcsfile.5} (the man page
504 describing the @code{rcs} data file format). The default value for any
505 of the @code{man@var{N}dir} variables depends indirectly on
506 @code{prefix}, and is normally changed only through @code{prefix}. The
507 default value for @code{man@var{N}dir} is
508 @file{$(mandir)/man@var{N}}.
512 @defvr Makefile manext
513 @emph{Not supported by @code{configure}}. The @sc{gnu} coding standards
514 do not call for @code{man1ext}, @code{man2ext}, so the intended use for
515 @code{manext} is apparently not parallel to @code{mandir}. Its use is
516 not clear. (See also @ref{Makefile Extensions}.)
520 @defvr Makefile infodir
521 A directory for @emph{info} format documentation. The default value for
522 @code{infodir} depends indirectly on @code{prefix}; @code{infodir} is
523 normally changed only through @code{prefix}. The default value for
524 @code{infodir} is @file{$(datadir)/info}.
528 @defvr Makefile docdir
529 A directory for any documentation that is in a format other than those
530 used by @code{info} or @code{man}. The default value for @code{docdir}
531 depends indirectly on @code{prefix}; @code{docdir} is normally changed only
532 through @code{prefix}. The default value for @code{docdir}
533 is @file{$(datadir)/doc}. @emph{This variable is an extension to
534 the @sc{gnu} coding standards}. (See also @ref{Makefile Extensions}.)
538 @defvr Makefile includedir
539 A directory for the header files accompanying the libraries installed in
540 @code{libdir}. The default value for @code{includedir} depends on
541 @code{prefix}; @code{includedir} is normally changed only indirectly
542 through @code{prefix}. The default value for @code{includedir} is
543 @file{$(prefix)/include}.
546 @node Build Directories, Host, Install Locations, Using Configure
547 @section Build Directories
548 @cindex Build directories
550 @cindex Object directories
552 @cindex Building for multiple hosts
553 @cindex Building for multiple targets
555 Normally, @code{configure} builds a @file{Makefile} and symbolic links
556 in the same directory as the source files. This is the typical
557 @sc{un*x} way to build programs, but it has limitations. For instance,
558 using this approach, you can only build for one host at a time.
560 @c "Makefile" treated as ordinary word through most of this; I've left it
561 @c that way since that seems to agree w ordinary usage. This one was
562 @c @code'd; if the intent is to emphasize that we're now talking of it
563 @c as a file, I suggest
564 @c "...builds @file{Makefile} files"
565 We refer to the directories where @code{configure} builds a
566 Makefile as the @emph{build directories} or sometimes as
567 @emph{objdir} because these are the directories in which @code{make}
568 will build object files, among other things.
570 The default build directory is the same as the source directory.
571 You can use a different build directory with a sequence like the following:
576 configure @var{host} -srcdir=@var{sourcedirectory}
580 where @var{builddir} is the directory where you wish to build,
581 @var{host} is the host for which you want to build, and
582 @var{sourcedirectory} is the directory containing the source files.
584 If you were to do this twice with different values for @var{builddir}
585 and @var{host}, then you could @code{make} for both at the same time.
588 @emph{NOTE:} The rest of this section describes the @code{-subdirs} feature for
589 which support is at least temporarily suspended. FIXME-soon.
592 Another way to specify the build directory is with the @samp{-subdirs}
596 configure @var{host} -subdirs
599 Using this option, @code{configure} will create a subdirectory named
600 @file{H-@var{host}} to act as the build directory for each source
603 Since building for multiple hosts is so common, @code{configure}
604 recognizes this situation as special. For example:
607 configure @var{host1} @var{host2}
610 is precisely the same as:
613 configure @var{host1} -subdirs
614 configure @var{host2} -subdirs
617 That is, configuring for multiple hosts or multiple targets implies
620 When configuring for cross tools (the converse of native tools: when the
621 host is not the target), as in:
624 configure @var{host} +target=@var{targ} -subdirs
628 the subdirectories are named @file{X-@var{host}-@var{targ}}. This is
629 especially useful when configuring for multiple targets.
631 If you use both @samp{-subdirs} and @samp{-srcdir=}, a tree that
632 parallels the source directory structure is created in the current
633 directory, and the subdirectories are created in this directory
634 tree rather than in the source directories.
636 @emph{NOTE:} previously, @samp{-subdirs} built two-level subdirectories
637 as @file{./H-@var{host}/T-@var{target}}, created
638 @file{./H-@var{host}/Makefile} for building across all targets,
639 @file{./Makefile} for building across all hosts, and
640 @file{./config.status} and @file{./H-@var{host}/config.status} for
641 rebuilding these Makefiles.
643 @node Host, Target, Build Directories, Using Configure
647 @emph{NOTE:} support for multiple hosts is at least temporarily suspended.
651 The arguments to @code{configure} are @emph{hosts}. By @emph{host} we
652 mean the environment in which the source will be compiled. This need
653 not necessarily be the same as the physical machine involved,
654 although it usually is.
656 For example, if some obscure machine running an operating system other
657 than @sc{un*x} had the @sc{gnu} @sc{posix} emulation libraries
658 available, it would be possible to configure most @sc{gnu} source for a
659 @sc{posix} system and build it on the obscure host.
661 For more on this topic, see @ref{Host Environments, , cfg-paper, On
662 Configuring Development Tools}.
664 @node Target, Local Conventions, Host, Using Configure
667 For building native development tools, or most of the other @sc{gnu}
668 tools, you need not worry about the target. The @emph{target} of a
669 configuration defaults to the same as the @emph{host}.
671 For building cross development tools, please see @ref{Building
672 Development Environments, , cfg-paper, On Configuring Development
675 @node Local Conventions, , Target, Using Configure
676 @section Local Conventions
678 If you find that a tool does not get configured to your liking, or if
679 @code{configure}'s conventions differ from your local conventions, you
680 should probably consider site specific Makefile fragments. See also
683 These are probably not the right choice for options that can be set from
684 the @code{configure} command line or for differences that are host or
687 @node Porting, Reference, Using Configure, top
688 @chapter Porting with Configure
691 This section explains how to add programs, host and target configuration
692 names, and site-specific information to Cygnus configure.
695 * Programs:: Adding configure to new programs
696 * Hosts and Targets:: Adding hosts and targets
697 * Sites:: Adding site info
701 @node Programs, Hosts and Targets, Porting, Porting
702 @section Adding Configure To New Programs
704 If you are writing a new program, you probably shouldn't worry about
705 porting issues or configure until it is running reasonably on some host.
706 Then refer back to this section.
708 If the program in question currently has a configure script that meets
709 the criteria set out by @cite{standards.text}, please do not add Cygnus
710 configure. It should be possible to add this program without change to
711 a Cygnus configure style source tree.
713 If the program is not target dependent, please consider using
714 @code{autoconf} instead of Cygnus configure. @code{autoconf} will
715 be available soon from the @sc{fsf}.
717 @c ..............................pesch rev..............................
719 To add Cygnus configure to an existing program, do the following.
723 @item Bring the Makefile up to the standard
724 The coding standard for @sc{gnu} Makefiles is described in
725 @cite{standards.text}.
727 @item Add Cygnus extensions to the Makefile
728 There are described in @ref{Makefile Extensions}.
730 @item Move host support from Makefile to fragments
731 This usually involves finding sections of the Makefile that say things
732 like ``uncomment these lines for host foo'' and moving them to a new
733 file call @file{./config/mh-foo}. For more on this, see @ref{Hosts and
736 @item Choose defaults
737 If the program has compile time options that determine the way the
738 program should behave, chose reasonable defaults and make these Makefile
739 variables. Be sure the variables are assigned their default values
740 before the @code{####} line so that they can be overridden with site
741 specific Makefile fragments.
743 @item Locate configuration files
744 If there is configuration information in header files or source files,
745 separate it in such a way that the files have a generic name. Then move
746 the specific instances of those files into the @file{./config}
749 @item Separate host and target information
750 Some programs already have this information separated. If not, you will
751 need to do so. Host specific information is the information needed to
752 compile the program. Target specific information it information on the
753 format of data files that the program will read or write. This
754 information should live in separate files in the @file{./config}
755 directory with names that reflect the configuration for which they are
758 At this point you might skip this step and simply move on. If you do,
759 you should end up with a program that can be configured only to build
760 native tools, that is, tools for which the host system is also the
761 target system. Later, you could attempt to build a cross tool and
762 separate out the target specific information by figuring out what went
763 wrong. This is often simpler than combing through all of the source
766 @item Write configure.in
767 Usually this involves writing shell script fragments to map from
768 canonical configuration names into the names of the configuration files.
769 These files will then be linked at configure time from the specific
770 instances of those files in @file{./config} to file in the build
771 directory with more generic names. (see also @ref{Build Directories}).
772 The format of configure.in is described in @ref{configure.in}.
774 @item Rename the Makefile to Makefile.in
778 At this point you should have a program that can be configured by Cygnus
781 @node Hosts and Targets, Sites, Programs, Porting
782 @section Adding hosts and targets
784 To add a host or target to a program that currently uses Cygnus
785 configure, do the following.
790 Make sure the new configuration name is represented in
791 @file{config.sub}. If not, add it. For more details, see the comments
792 in the shell script @file{config.sub}.
795 If you are adding a host configuration, look in @file{configure.in}, in
796 the per-host section. Make sure that your configuration name is
797 represented in the mapping from host configuration names to
798 configuration files. If not, add it. Also see @ref{configure.in}.
801 If you are adding a target configuration, look in @file{configure.in},
802 in the per-target section. Make sure that your configuration name is
803 represented in the mapping from target configuration names to
804 configuration files. If not, add it. Also see @ref{configure.in}.
807 Look in @file{configure.in} for the assignments to the variables
808 @code{files}, @code{links}, @code{host_makefile_frag}, and
809 @code{target_makefile_frag}. These are the names of the configuration
810 files that the program uses. Make sure that copies of the files exist
811 for your host. If not, create them. See also @ref{Configure
816 This should be enough to configure for a new host or target
817 configuration name. Getting the program to compile and run properly now
818 is the hard work of the port.
821 @node Sites, , Hosts and Targets, Porting
822 @section Adding site info
824 If some of the Makefile defaults are not right for your site, you can
825 build site specific Makefile fragments. To do this, do the following.
830 Choose a name for your site. It must be less than eleven characters for
834 If the program does not have a @file{./config} directory, create it.
837 Create a file called @file{./config/ms-@var{site}} where @var{site} is
838 the name of your site. In it, set the Makefile variables of your
842 Configure the program with:
845 configure @dots{} +site=@var{site}
849 @node Reference, Known Bugs, Porting, top
850 @chapter Gory details described
853 Here we describe the backend support.
856 * Makefile Extensions:: Extensions to the @sc{gnu} coding standards
857 * configure.in:: The format of the configure.in file
858 * config.status:: config.status
859 * Makefile Fragments:: Makefile Fragments
862 @node Makefile Extensions, configure.in, Reference, Reference
863 @section Extensions to the @sc{gnu} coding standards
865 @cindex Makefile extensions
866 @cindex Cygnus extensions
868 The following additions to the @sc{gnu} coding standards are required
869 for Cygnus configure to work properly.
874 The Makefile must contain exactly one line starting with @code{####}.
875 This line should follow any default macro definitions but precede any
876 rules. Host, target, and site specific Makefile fragments will be
877 inserted immediately after this line. If the line is missing, the
878 fragments will not be inserted.
882 Cygnus adds the following targets to our Makefiles. Their existence is
883 not required for Cygnus configure but are documented here for
890 Build all info files from texinfo source.
894 Install all info files.
898 Remove all info files and any intermediate files that can be generated
923 These targets are in transition and may be removed shortly.
927 In addition, the following Makefile targets have revised semantics:
933 Should @emph{not} depend on the target @code{all}. If the program is
934 not already built, @code{make install} should fail. This allows
935 programs to be installed even when @code{make} would otherwise determine
936 them to be out of date. This can happen when the result of a @code{make
937 all} is transported via tape to another machine for installation as
938 well as in a number of other cases.
942 Should remove any file that can be regenerated by the Makefile,
943 excepting only the Makefile itself, and any links created by configure.
944 That is, @code{make all clean} should return all directories to their
945 original condition. If this is not done, then:
948 configure @var{host1} ; make all clean ; configure @var{host2} ; make all
952 will fail because of intermediate files intended for @var{host1}.
956 Cygnus adds the following macros to all Makefile.in's. Their presence
957 is not required for Cygnus configure.
963 The directory in which to install any documentation that is not either a
964 man page or an info file. For man pages, see mandir, for info, see
969 The directory in which to install any headers files that should be made
970 available to users. This is distinct from the @code{gcc} include
971 directory which is intended for @code{gcc} only. Files in
972 @code{includedir} may be used by @code{cc} as well.
976 In addition, the following macros have revised semantics.
982 is not used. The intended usage is not clear. For example, if I have a
983 @file{foo.man} and a @file{bar.man}, and @file{foo.man} is destined for
984 @file{/usr/local/lib/man/man1/foo.1} while @file{bar.man} is destined
985 for @file{/usr/local/lib/man/man5/bar.5}, then to what should the value
986 of @code{manext} be set? See also @ref{Install Details}.
990 is used for @emph{all} host independent files. This makes it possible
991 to share host independent files across multiple hosts without ersorting
992 to symlinks or multiple mount points. This also makes it possible
993 build an install tree that contains multiple host binaries, write
994 the binaries to tape, and extract any of the hosts without extracting
999 man pages are host independent so the default path for @code{mandir}
1000 depends on @code{datadir}.
1004 info files are host independent so the default path for @code{infodir}
1005 depends on @code{datadir}.
1009 is assumed to have a yacc calling convention. To use
1010 @code{bison}, use @code{BISON=bison -y}.
1014 Cygnus also adds the following restrictions on our Makefiles.
1019 When libraries are installed, the line containing the call to
1020 @code{INSTALL_DATA} should always be followed by a line containing a
1021 call to @code{RANLIB} on the installed library. This is to accomodate
1022 systems that use @code{ranlib}. Systems that do not use ranlib can set
1023 @code{RANLIB} to @code{echo} in a host specific Makefile fragment.
1027 @node configure.in, config.status, Makefile Extensions, Reference
1028 @section The format of the configure.in file
1030 @cindex configure.in
1032 A configure.in file for Cygnus configure consists of a declarations
1033 section, followed by a per-host section, followed by a per-target
1034 section, optionally followed by a post-target section. Each section is
1035 a shell script fragment sourced by configure at the appropriate time.
1036 The interface between configure and the shell fragments is through a set
1037 of shell variables. All sections are sourced in the build directory.
1039 @cindex Per-host section
1040 A line beginning with @code{# Per-host:} begins the per-host section.
1042 @cindex Per-target section
1043 A line beginning with @code{# Per-target:} begins the per-target
1046 @cindex Post-target section
1047 If it exists, the post-target section begins with @code{# Per-target:}.
1050 * Minimal:: A minimal configure.in
1051 * Configure Variables:: Variables available to configure.in
1052 * Declarations:: Per invocation
1053 * Per-host:: On a host basis
1054 * Per-target:: On a target basis
1055 * Post-target:: After each target
1056 * Example:: An example configure.in
1059 @node Minimal, Configure Variables, configure.in, configure.in
1060 @subsection A minimal configure.in
1062 @cindex Minimal configure.in example
1063 A minimal @file{configure.in} consists of four lines.
1067 srcname="source for the foo program"
1072 The per-host and per-target lines divide the file into the three
1073 required sections. The srctrigger line names a file. configure checks
1074 to see that this file exists in the source directory before
1075 configuring. If the srctrigger file does not exist, configure
1076 uses the value of srcname to print an error message about not finding
1079 This particular example uses no links, and only the default host,
1080 target, and site specific Makefile fragments if they exist.
1082 @node Configure Variables, Declarations, Minimal, configure.in
1083 @subsection Variables available to configure.in
1085 @cindex Configure.in interface
1087 The following variables are available to the shell fragments in
1088 @file{configure.in}.
1091 Contains the name of a source file that is expected to live in the
1092 source directory. This is usually set in the declations section of
1093 @file{configure.in}. Configure tests to see that this file exists. If
1094 the file does not exist, configure prints an error message. This is
1095 used as a sanity check that configure.in matches the source directory.
1099 Contains the name of the source contained in the source directory. This
1100 is usually set in the declarations section of @file{configure.in}. If
1101 the file named in @code{srctrigger} does not exist, configure uses the
1102 value of this variable when it prints the error message.
1106 Contains the names of any subdirectories on which configure should
1107 recur. This is usually set in the declarations section of
1108 @file{configure.in}. If @file{Makefile.in} contains a line starting
1109 with @code{SUBDIRS =}, then it will be replaced with an assignment to
1110 @code{SUBDIRS} using the value of @code{configdirs}. This can be used
1111 to determine which directories to configure and build depending on the
1112 host and target configurations.
1115 NOTE: support for multiple targets is currently suspended.
1117 @defvar{target_dependent}
1118 If this variable is not empty and @code{-subdirs} is in effect then
1119 configure will create separate build directories for each target. This
1120 is usually set in the declarations section of @file{configure.in}. The
1121 default is to assume that a directory is target independent, create only
1122 one real directory with symlinks from the other names. This means that
1123 a target independent directory will be built exactly once regardless of
1124 how many targets are being built.
1128 Contains the name that the user entered for the host. Since many
1129 things that the user could enter would map to the same canonical triple,
1130 this variable is innappropriate to use for picking available
1131 configurations. For that, use @code{host_cpu}, @code{host_vendor},
1132 and/or @code{host_os}. This variable is useful, however, for error
1137 Contains the first element of the canonical triple representing the host
1138 as returned by @file{config.sub}. This is occasionally used to
1139 distinguish between minor variations of a particular vendor's operating
1140 system and sometimes to determine variations in binary format between
1141 the host and the target.
1144 @defvar{host_vendor}
1145 Contains the second element of the canonical triple representing the
1146 host as returned by @file{config.sub}. This is usually used to
1147 distinguish betwen the numerous variations between @emph{common}
1152 Contains the the third element of the canonical triple representing the
1153 host as returned by @file{config.sub}.
1157 Contains the name that the user entered for the target. Since
1158 many things that the user could enter would map to the same canonical
1159 triple, this variable is innappropriate to use for picking available
1160 configurations. For that, use @code{target_cpu}, @code{target_vendor},
1161 and/or @code{target_os}. This variable is useful, however, for error
1166 Contains the first element of the canonical triple representing the
1167 target as returned by @file{config.sub}. This is used heavily by
1168 programs involved in building programs, like the compiler, assembler,
1169 linker, etc. Most programs will not need the @code{target} variables at
1170 all, but this one could conceivably be used to build a program, for
1171 instance, that operated on binary data files whose byte order or
1172 alignment are other than that of the system on which the program is
1176 @defvar{target_vendor}
1177 Contains the second element of the canonical triple representing the
1178 target as returned by @file{config.sub}. This is usually used to
1179 distinguish betwen the numerous variations between @emph{common}
1180 operating systems or object file formats. Sometimes it is used to
1181 switch between different flavors of user interfaces.
1185 Contains the the third element of the canonical triple representing the
1186 target as returned by @file{config.sub}. This variable is used by
1187 development tools to distinguish between subtle variations in object
1188 file formats that some vendors use across operating system releases. It
1189 might also be use to decide which libraries to build or what user
1190 interface the tool should provide.
1194 Is set to @code{true} if the user invoked configure with the @code{-nfp}
1195 command line option, otherwise it is empty. This is a request to target
1196 machines with @emph{no floating point} unit, even if the targets
1197 ordinarily have floating point units available. This option has no
1202 Is set to @code{true} if the user invoked configure with the @code{-gas}
1203 command line option, otherwise it is empty. This is a request to assume
1204 that all target machines have gas available even if they ordinarily do
1205 not. The converse option, @code{-no-gas} is not available.
1209 Is set to @code{true} if the user invoked configure with the @code{-x}
1210 command line option, otherwise it is empty. This is a request to assume
1211 that @sc{mit x11} compatible headers files and libraries are available
1212 on all hosts, regardless of what is normally available on them.
1215 NOTE: support for @code{-subdirs} is at least temporarily suspended.
1218 Is set to the name of the directory containing the source for this
1219 program. This will be different from @file{.} if the user has specified
1220 either the @code{-srcdir=} or the @code{-subdirs} options. Note that
1221 @code{srcdir} is not necessarily an absolute path.
1224 @defvar{host_makefile_frag}
1225 Is set to a file name representing to the default Makefile fragment for
1226 this host. It may be set in @file{configure.in} to overide this
1230 @defvar{target_makefile_frag}
1231 Is set to a file name representing to the default Makefile fragment for
1232 this target. It may be set in @file{configure.in} to overide this
1236 @defvar{site_makefile_frag}
1237 Is set to a file name representing to the default Makefile fragment for
1238 this host. It may be set in @file{configure.in} to overide this
1239 default. Normally @code{site_makefile_frag} is empty, but will have a
1240 value if the user specified @code{-site=} on the command line. This
1241 variable should probably not be overridden.
1245 Is set to the name of the generated @file{Makefile}. Normally this
1246 value is precisely @file{Makefile} but some programs may want something
1251 Is normally empty but will be set to some non-empty value if the user
1252 specified @code{-rm} on the command line. That is, if @code{removing}
1253 is non-empty, then configure is @emph{removing} a configuration rather
1258 If this variable is non-empty following the @code{per-target:} section,
1259 then each word in it's value will be the target of a symbolic link named
1260 in the @code{links} variable.
1264 If the @code{files} variable is non-empty following the
1265 @code{per-target:} section, then symbolic links will be created with the
1266 first word of links pointing to the first word of files, the second word
1267 of links pointing to the second word of files, and so on.
1271 @node Declarations, Per-host, Configure Variables, configure.in
1272 @subsection Per invocation
1274 @cindex Declarations section
1276 Everything from the start of @file{configure.in} up to a line beginning
1277 with @code{# Per-host:} is sourced by configure as a shell script
1278 fragment immediately after parsing command line arguments. The
1279 variables @code{srctrigger} and @code{srcname} @emph{must} be set here.
1281 Some other things you might want to set here are the variables
1282 @code{configdirs} or @code{target_dependent}. FIXME-soon.
1283 target_dependent isn't useful without multiple targets.
1285 @node Per-host, Per-target, Declarations, configure.in
1286 @subsection On a host basis
1288 @cindex Per-host section
1290 The per-host section of @file{configure.in} starts with a line beginning
1291 with @code{# Per-host:} and ends before a line beginning with with
1292 @code{# Per-target:}. Configure sources the per-host section once for
1295 This section usually contains a big case statement using the variables
1296 @code{host_cpu}, @code{host_vendor}, and @code{host_os} to determine
1297 appropriate values for @code{host_makefile_frag} and @code{files},
1298 although @code{files} is not usually set here. Usually, it is set
1299 at the end of the per-target section after determining the names of the
1300 target specific configuration files.
1302 @node Per-target, Post-target, Per-host, configure.in
1303 @subsection On a target basis
1305 @cindex Per-target section
1306 @cindex Target basis
1308 The per-target section of @file{configure.in} starts with a line
1309 beginning with @code{# Per-target:} and ends before a line beginning
1310 with @code{# Post-target:} if it exists. Otherwise the per-target
1311 section extends to the end of the file. Configure sources the
1312 per-target section once for each target before building any files,
1313 directories, or links.
1315 This section usually contains a big case statement using the variables
1316 @code{target_cpu}, @code{target_vendor}, and @code{target_os} to determine
1317 appropriate values for @code{target_makefile_frag} and @code{files}.
1318 The last lines in the per-target section normally set the variables
1319 @code{files} and @code{links}.
1321 @node Post-target, Example, Per-target, configure.in
1322 @subsection After each target
1324 The post-target section is optional. If it exists, the post-target
1325 section starts with a line beginning with @code{# Post-target:} and
1326 extends to the end of the file. If it exists, configure sources this
1327 section once for each target after building all files, directories, or
1330 This section seldom exists but can be used to munge the configure
1333 @node Example, , Post-target, configure.in
1334 @subsection An example configure.in
1336 @cindex Example configure.in
1337 @cindex Bison configure.in
1338 Here is a small example configure.in.
1341 # This file is a shell script fragment that supplies the information
1342 # necessary to tailor a template configure script into the configure
1343 # script appropriate for this directory. For more information, check
1344 # any existing configure script.
1347 srctrigger=warshall.c
1351 case "$@{host_os@}" in
1353 host_makefile_frag=config/mh-delta88
1359 files="bison_in.hairy"
1365 @node config.status, Makefile Fragments, configure.in, Reference
1366 @section config.status
1368 @cindex config.status
1370 The final step in configuring a directory is to create an executable
1371 shell script call @file{config.status}. This file is typically used to
1372 rebuild the Makefile for the current directory. For this reason,
1373 @file{config.status} uses the @code{-norecursion} option to configure
1374 and is therefor probably inappropriate for reconfiguring a tree
1377 @node Makefile Fragments, , config.status, Reference
1378 @section Makefile Fragments
1380 @cindex Makefile fragments
1382 Cygnus configure uses three types of Makefile fragments. In a
1383 generated Makefile they occur in the order target fragment, host
1384 fragment, and site fragment. This is so host fragments can override
1385 target fragments etc.
1387 Host specific Makefile fragments conventionally reside in the
1388 @file{./config} directory with names of the form
1389 @file{mh-@var{host}}. They are used for hosts that require
1390 odd options to the standard compiler and for compile time options based
1391 on the host configuration.
1393 Target specific Makefile fragments conventionally reside in the
1394 @file{./config} directory with names of the form @file{mt-@var{target}}.
1395 They are used for target dependent compile time options.
1397 Site specific Makefile fragments conventionally reside in the
1398 @file{./config} directory with names of the form @file{ms-@var{site}}.
1399 They are used to override host and target independent compile time
1400 options. Note that these options can also be overridden on the
1401 @code{make} invocation line.
1403 @node Known Bugs, Variables Index, Reference, top
1408 The following bugs are known to exist.
1413 There is no way to query about known hosts, known targets, or the
1414 porting or testing status of any configuration.
1417 The negations to the options @code{-gas}, @code{-x}, and @code{-nfp} are
1423 @node Variables Index, Concept Index, Known Bugs, top
1424 @appendix Variable Index
1429 @node Concept Index, , Variables Index, top
1430 @appendix Concept Index
1438 @c outline-regexp: "@chap"
1440 @c (setq outline-regexp "@chapt\\\|@unnum\\\|@setf\\\|@conte\\\|@sectio\\\|@subsect\\\|@itemize\\\|@defvar{")