Renamed from xm-svr4.h xm-sysv4.h
[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
RP
5@c %**end of header
6@c @setchapternewpage odd
8f861f08 7
ce947b9d
RP
8@titlepage
9@sp 10
10@title{Cygnus Configure}
11@author{K. Richard Pixley}
12@page
13@vskip 0pt plus 1filll
14Copyright @copyright{} 1991 Cygnus Support
15@end titlepage
16
17@ifinfo
18This document attempts to describe the configuration system used and
19distributed by Cygnus Support.
20
21Copyright @copyright{} 1991 Cygnus Support
22@end ifinfo
23
24@ifinfo
25@node top, Invoking, (dir), (dir)
26@top top
8f861f08
RP
27
28This file documents the configuration system used and distributed by
29Cygnus Support.
30
ce947b9d
RP
31NOTE: support for a Cygnus experimental option, @code{-subdirs} is at
32least temporarily suspended. Most of the code is still in configure but
33the option is disabled. This document describes that feature, but those
34parts are prominently marked with NOTE's like this one. FIXME-soon
35
8f861f08 36@menu
8f861f08 37* Invoking:: Invoking
ce947b9d
RP
38* Using Configure:: Using Configure
39* What Configure Does:: What Configure Does
40* Porting:: Porting with Configure
41* Known Bugs:: Known Bugs
42* Variables Index:: Variable Index
43* Concept Index:: Concept Index
44
45 --- The Detailed Node Listing ---
46
47Using Configure
48
49* Install Locations:: Where to install things once they are built
50* Build Directories:: Where to build object files
51* Host:: Telling @code{configure} what will source will
52 be built
53* Target:: Telling @code{configure} what the source will
54 target
55* Local Conventions:: Adding information about local conventions
56
57Install Locations
58
59* prefix:: Changing the default install directory
60* datadir:: How to separate host independent files
61 from host dependent files when
62 installing for multiple hosts
63* Install Details:: Full descriptions of all installation
64 subdirectories
65
66Porting with Configure
67
8f861f08
RP
68* Native Ports:: Native Ports
69* Adding Hosts Or Targets:: Adding Hosts Or Targets
ce947b9d
RP
70* Reference:: Reference
71
72Native Ports
73
74* Add A Host:: Add A Host
75* Port An Existing Target:: Port An Existing Target
76* Add A Target:: Add A Target
77* Build Host & Target:: Build Host & Target
78* Build New Target On Some Other Host:: Build New Target On Some Other Host
79
80Adding Hosts Or Targets
81
82* Add Canonical Triple To Config.Subr (Cf Config.Subr):: Add Canonical Triple To Config.Subr (Cf Config.Subr)
83* (Optional) Add Alias (Cf Config.Subr)::
84* Monte Carlo - Configure ; Make:: Monte Carlo - Configure ; Make
85* Remedies:: Remedies
8f861f08 86* Adding Configure To Existing Programs:: Adding Configure To Existing Programs
ce947b9d
RP
87
88Remedies
89
90* Automagic Config:: Automagic Config
91* Symlinked Files:: Symlinked Files
92* Makefile Fragments (Cf Configure.In):: Makefile Fragments (Cf Configure.In)
93
94Adding Configure To Existing Programs
95
8f861f08 96* Makefile Support:: Makefile Support
ce947b9d
RP
97* Add Standard Macros (Template Follows):: Add Standard Macros (Template Follows)
98
99Adding Configure To Existing Programs
100
101* Makefile Host Support - Move It To Host Fragments:: Makefile Host Support - Move It To Host Fragments
8f861f08 102@end menu
ce947b9d 103@end ifinfo
8f861f08 104
ce947b9d 105@node Invoking, Using Configure, top, top
8f861f08
RP
106@chapter Invoking
107
108The usual way to invoke @code{configure} is as follows:
109@example
110configure @var{host}
111@end example
112This asks @code{configure} to prepare the source to be compiled in a
113@var{host} environment with programs and files to be installed in
114@file{/usr/local}.
115
116NOTE: support for multiple hosts is at least temporarily suspended.
ce947b9d 117FIXME-soon
8f861f08
RP
118
119If more than one host is specified on the command line, then
120configurations are created for each and @code{-subdirs} is assumed.
121
122@table @code
123
124@item -datadir=@var{dir}
125This option requests that the source be configured so that host
126independent files will be installed in @var{dir}.
127
128This option sets the @code{configure} variable @code{datadir}. If
129@code{datadir} is not empty, generated Makefiles will have their
130@code{datadir} variables set to this value. (See @xref{Install Details}.)
131
132@item -gas
133Notifies @code{configure} that the @sc{GNU} assembler is available on
134all specified hosts.
135
136@item -help
137Displays a quick summary of how to invoke @code{configure}.
138
139@item -host=@var{host}
ce947b9d
RP
140FIXME-soon: I don't think this option should be documented.
141
142NOTE: support for this @code{-namesubdir=} is at least temporary
143suspended. FIXME-soon
8f861f08
RP
144
145@item -namesubdir=@var{name}
146Asks that any subdirectories created by the @code{-subdirs} option be
147named @var{name}. Note that using multiple hosts with
148@code{-namesubdir=} isn't terribly useful.
149
8f861f08
RP
150@item -nfp
151Notifies @code{configure} that all of the specified hosts have @emph{no
152floating point} units.
153
154@item -norecursion
155Asks @code{configure} to configure only this directory. Any
156subdirectories are ignored. This is used by the executable shell script
157@file{config.status} to reconfigure the current directory.
ce947b9d 158(@xref{FIXME-now:config.status}.
8f861f08
RP
159
160@item -objdir=@var{dir}
ce947b9d 161This option is no longer supported. Use @code{-srcdir=} instead.
8f861f08
RP
162
163@item -prefix=@var{dir}
164This option requests that the source be configured so that programs and
165files will be installed in @var{dir}.
166
167This option sets the @code{configure} variable @code{prefix}. If
168@code{prefix} is not empty, generated Makefiles will have their
169@code{prefix} variables set to this value. (See @xref{Install Details}.)
170
171@item -recurring
172This option is used internally by @code{configure} when recurring on
173subdirectories. It's sole purpose is to supress status output. It can
174be overriden with the @code{-verbose} option.
175
176@item -rm
177Asks @code{configure} to @emph{remove} a configuration rather than
178create one.
179
180@item -site=@var{site}
181Asks that Makefiles be generated using site specific Makefiles for
ce947b9d 182@var{site}. (@xref{FIXME-now: site specific Makefiles}.)
8f861f08
RP
183
184@item -srcdir=@var{_dir}
185Tells @code{configure} that the sources are located in @var{dir}. The
186build directory is assumed to be @file{.}.
187
ce947b9d
RP
188NOTE: support for this @code{-subdirs} is at least temporary suspended.
189FIXME-soon
190
8f861f08
RP
191@item -subdirs
192Asks that configurations be placed in subdirectories named
193@file{H-@var{host}} of each build directory, for each host specified.
194If this configuration is not native, (@var{host} is not @var{target}),
195then he subdir will be named @file{X-@var{host}-@var{target}} instead.
196
ce947b9d
RP
197NOTE: support for multiple targets is at least temporarily suspended.
198FIXME-soon
8f861f08
RP
199
200@item -target=@var{target}
201Requests that the sources be configured to target the @var{target}
202machine. If no targets are specified explicitly, the target is assumed
203to be the same as the host. If multiple targets are specified,
204configurations for each are created and @code{-subdirs} is assumed.
205
8f861f08
RP
206@item -tmpdir=@var{tmpdir}
207Sets the directory in which @code{configure} creates temporary files to
208@var{tmpdir}.
209
210@item -verbose
211@item -v
212Asks that @code{configure} print status lines for each directory
213configured. Normally, only the status lines for the current directory
214are printed.
215
216@item -x
217Tells @code{configure} that @sc{MIT} style @sc{X11} header files and
218libraries are available on this machine, even if they are not normally
219available.
220
221@end table
222
ce947b9d 223@node Using Configure, What Configure Does, Invoking, top
8f861f08
RP
224@chapter Using Configure
225
226Configure prepares source directories in anticipation of building.
227Source cannot be built until it has been configured. The choices
228and options available at configuration time generally have valid
229defaults, but the defaults do not cover all cases. The choices
230available include:
231
232@menu
233* Install Locations:: Where to install things once they are built
234* Build Directories:: Where to build object files
ce947b9d
RP
235* Host:: Telling @code{configure} what will source will
236 be built
237* Target:: Telling @code{configure} what the source will
238 target
239* Local Conventions:: Adding information about local conventions
8f861f08
RP
240@end menu
241
ce947b9d 242@node Install Locations, Build Directories, Using Configure, Using Configure
8f861f08
RP
243@section Install Locations
244
245@cindex Where to install
246
247Using the default configuration, @code{make install} will create a
248single tree of files, some of which are programs. The location of this
249tree is determined by the value of the variable @code{$(prefix)}. The
250default value of @code{$(prefix)} is @file{/usr/local}. This is
251probably correct for native tools installed on only one host.
252
253@menu
ce947b9d
RP
254* prefix:: Changing the default install directory
255* datadir:: How to separate host independent files
8f861f08
RP
256 from host dependent files when
257 installing for multiple hosts
ce947b9d 258* Install Details:: Full descriptions of all installation
8f861f08
RP
259 subdirectories
260@end menu
261
262@node prefix, datadir, Install Locations, Install Locations
263@subsection Changing the default install directory
264
265@cindex Changing the default install directory
ce947b9d 266@cindex Prefix directory
8f861f08
RP
267
268In the default configuration, all files are installed in subdirectories
269of @file{/usr/local}. The actual location is determined by the value of
270the @code{configure} variable @code{$@{prefix@}} which determines the
271value of the Makefile variable @code{$(prefix)}.
272
273You can also set the value of the Makefile variable @code{$(prefix)}
274explicitly each time you invoke @code{make} if you are so inclined, but
275because many programs have this location compiled in, you must specify
276the @code{$(prefix)} value precisely on each invocation of @code{make}
277or you will end up with a broken installation.
278
279To make this easier, the value of the @code{configure} variable
280@code{$@{prefix@}} can be set on the command line to @code{configure}
281using the option @code{-prefix=}. (See @xref{prefix}).
282
283
284@node datadir, Install Details, prefix, Install Locations
285@subsection Installing for multiple hosts
286
287@cindex Configuring for multiple hosts
288@cindex Sharing host independent files
289@cindex The datadir directory
290@cindex Installing host independent files
291
292Host independent files are installed in subdirectories of
293@file{/usr/local/lib}. The actual location is determined by the value
294of the @code{configure} variable @code{$@{datadir@}} which determines
295the value of the Makefile variable @code{$(datadir)}. By default, the
296value of @code{$@{datadir@}} is @code{$@{prefix@}/lib}. This makes
297single host installs simple, and simplifies changing the default
298location for the install tree, but doesn't allow for multiple hosts to
299effectively share host independent files.
300
301To configure so that multiple hosts can share common files, use
302something like:
303
304@example
305configure @var{host1} -prefix=/usr/gnu/H-@var{host1} -datadir=/usr/gnu/H-independent
306make all info install install-info clean
307configure @var{host2} -prefix=/usr/gnu/H-@var{host2} -datadir=/usr/gnu/H-independent
308make all info install install-info
309@end example
310
311The first line configures the source for @var{host1} in such a way that
312host specific programs will be placed in subdirectories of
313@file{/usr/gnu/H-@var{host1}} and host independent files will be placed
314in @file{/usr/gnu/H-independent}. (See @xref{datadir}.)
315
316The second line builds and installs all programs for @var{host1},
317including both host independent and host dependent files.
318
319The third line reconfigures the source for @var{host2} in such a way
320that host specific programs will be placed in subdirectories of
321@file{/usr/gnu/H-@var{host2}} and host independent files will again be
322placed in @file{/usr/gnu/H-independent}.
323
324The fourth line builds and installs all programs for @var{host2}. Host
325dependent files will be installed in new directories but the host
326independent files will be installed @emph{on top of} the host
327independent files installed for @var{host1}. This results in a single
328copy of the host independent files suitable for use by both hosts.
329
ce947b9d
RP
330NOTE: support for -subdirsa and multiple hosts is at least temporarily
331suspended. FIXME-soon
332
333Previously this was:
334
335@example
336configure @var{host1} @var{host2} -prefix=/usr/gnu
337@end example
8f861f08
RP
338
339@node Install Details, , datadir, Install Locations
340@subsection Full descriptions of all installation subdirectories
341
342In any install, a number of standard directories are created. Their
343actual names are determined by Makefile variables. Some of the
344defaults for Makefile variables can be changed at configure time using
345command line options to @code{configure}. For more information on the
346standard directories or the Makefile variables, please refer to
347@cite{standards.text}.
348
349Note that @code{configure} does not create @code{srcdir} at any time.
ce947b9d
RP
350The directory @code{srcdir} is not an installation directory.
351(@xref{FIXME-now}.)
8f861f08
RP
352
353All makefile variables can be overridden on the command line to
354@code{make}. (See @xref{Overriding, Overriding Variables, Overriding
355Variables, make, Make}.) If you do so, you will need to specify the
356value precisely the same way for each invocation of @code{make} or you
357risk ending up with a broken installation. This is because many
358programs have the locations of other programs or files compiled into
359them. If you find yourself overriding any of the variables frequently,
ce947b9d 360you should consider site depedent Makefile fragments. (See @xref{FIXME-now}.)
8f861f08
RP
361
362During @code{make install}, the following standard directories will be
363created and populated:
364
365@vindex prefix
366@defvr {Makefile and configure} prefix
367By default, the value of this variable determines the root of the
368installation tree. It may be overridden with the @code{-srcdir=}
369command line option to @code{configure}. (@xref{Invoking}.) The
370default value for @code{prefix} is @file{/usr/local}.
371@end defvr
372
373@vindex bindir
374@defvr Makefile bindir
375The value of this variable names a directory intended to contain binary
376programs that users can run. The default value for @code{bindir}
377depends on @code{prefix} so @code{bindir} is normally changed
378only indirectly through @code{prefix}. The default value for
379@code{$(bindir)} is @code{prefix}@file{/bin}.
380@end defvr
381
382@vindex datadir
383@defvr {Makefile and configure} datadir
384The value of this variable names a directory intended to contain host
385independent files. The @code{configure} variable, which is used to set
386the default value of the Makefile variable, can be set at configure time
387using the @code{-datadir=} option to @code{configure}.
388(@xref{Invoking}.) The default value for @code{datadir} is
389@code{prefix}@file{/lib}.
390@end defvr
391
392@vindex libdir
393@defvr Makefile libdir
394The value of this variable names a directory intended to hold libraries
395and support programs. The default value for @code{libdir}
396depends on @code{prefix} so @code{libdir} is normally changed
397only indirectly through @code{prefix}. The default value for
398@code{libdir} is @code{prefix}@file{/lib}.
399@end defvr
400
401@vindex mandir
402@defvr Makefile mandir
403The value of this variable names a directory intended to hold @emph{man}
404format man pages. The default value for @code{mandir}
405depends on @code{prefix} so @code{mandir} is normally changed
406only indirectly through @code{prefix}. The default value for
407@code{mandir} is @code{datadir}@file{/man}.
408@end defvr
409
410@vindex man@var{N}dir
411@defvr Makefile man@var{N}dir
412There are eight of these variables named @code{man1dir}, @code{man2dir},
413etc. They are intended to name the specific directories which hold the
414man pages of their respective sections. That is, @code{man1dir} holds
415@file{emacs.1}, the man page for the emacs program while @code{man5dir}
416holds the man page describing the @code{rcs} data file format, called
417@file{rcsfile.5}. The default value for @code{man@var{N}dir}
418depends on @code{prefix} so @code{man@var{N}dir} is normally changed
419only indirectly through @code{prefix}. The default value for
420@code{man@var{N}dir} is @code{mandir}@file{/man@var{N}}.
421@end defvr
422
423@vindex manext
424@defvr Makefile manext
425The makefile variable manext is not supported by the @code{configure}.
426The @sc{gnu} coding standards do not call for @code{man1ext},
427@code{man2ext}, so the intended use for @code{manext} is not clear.
ce947b9d 428(See also @xref{FIXME-now:extensions}.)
8f861f08
RP
429@end defvr
430
431@vindex infodir
432@defvr Makefile infodir
433The value of this variable names a directory intended to hold
434@emph{info} format documentation. The default value for @code{infodir}
435depends on @code{prefix} so @code{infodir} is normally changed
436only indirectly through @code{prefix}. The default value for
437@code{infodir} is @code{datadir}@file{/info}.
438@end defvr
439
440@vindex docdir
441@defvr Makefile docdir
442The value of this variable names a directory intended to hold any
443documentation that is in a format other than @emph{info} or @emph{man}.
444The default value for @code{docdir} depends on @code{prefix} so
445@code{docdir} is normally changed only indirectly through @code{prefix}.
446The default value for @code{docdir} is @code{datadir}@file{/doc}. Note
447that this variable is an extension to the @sc{gnu} coding standards.
ce947b9d 448(See also @xref{FIXME-now:extensions}.)
8f861f08
RP
449@end defvr
450
451@vindex includedir
452@defvr Makefile includedir
453The value of this variable names a directory intended to hold the
454headers files that accompany the libraries installed in @code{libdir}.
455The default value for @code{includedir} depends on @code{prefix} so
456@code{includedir} is normally changed only indirectly through @code{prefix}. The default value for
457@code{includedir} is @code{prefix}@file{/include}.
458@end defvr
459
460
ce947b9d 461@node Build Directories, Host, Install Locations, Using Configure
8f861f08
RP
462@section Build Directories
463
ce947b9d
RP
464@cindex Build directories
465@cindex objdir
466@cindex Object directories
467@cindex subdirs
468@cindex Building for multiple hosts
469@cindex Building for multiple targets
8f861f08 470
ce947b9d
RP
471Normally, @code{configure} builds @file{Makefile}'s and symbolic links
472in the same directory as the source files. This is the typical
473@sc{un*x} way to build programs but it has limitations. For instance,
474using this approach, you can only build for one host at a time.
8f861f08 475
ce947b9d
RP
476We refer to the directories in which @code{configure} builds
477@file{Makefile}'s as the @emph{build directories} or sometimes as
478@emph{objdir} because these are the directories in which @code{make}
479will build object files, among other things.
8f861f08 480
ce947b9d 481The default build directory is the same as the source directory.
8f861f08 482
ce947b9d 483You can change the build directory with a sequence like the following:
8f861f08 484
ce947b9d
RP
485@example
486mkdir @var{builddir}
487cd @var{builddir}
488configure @var{host} -srcdir=@var{sourcedirectory}
489@example
8f861f08 490
ce947b9d
RP
491where @var{builddir} is the directory in which you wish to build,
492@var{host} is the host for which you want to build, and
493@var{sourcedirectory} is the directory containing the source files.
8f861f08 494
ce947b9d
RP
495If you were to do this twice with different values for @var{builddir}
496and @vr{host}, then you could @code{make} for both at the same time.
8f861f08 497
ce947b9d
RP
498NOTE: The rest of this section describes the @code{-subdirs} feature for
499which support is at least temporarily suspended. FIXME-soon.
8f861f08 500
ce947b9d
RP
501Another way to specify the build directory is with the @code{-subdirs}
502option. For example:
8f861f08 503
ce947b9d
RP
504@example
505configure @var{host} -subdirs
506@end example
8f861f08 507
ce947b9d
RP
508Using this option, @code{configure} will create a subdirectory named
509@file{H-@var{host}} to act as the build directory for each source
510directory.
8f861f08 511
ce947b9d
RP
512Since building for multiple hosts is so common, @code{configure}
513recognizes this situation as special. For example:
8f861f08 514
ce947b9d
RP
515@example
516configure @var{host1} @var{host2}
517@end example
8f861f08 518
ce947b9d 519is precisely the same as:
8f861f08 520
ce947b9d
RP
521@example
522configure @var{host1} -subdirs
523configure @var{host2} -subdirs
524#end example
8f861f08 525
ce947b9d
RP
526That is, when configuring for multiple hosts or multiple targets,
527@code{-subdir} is assumed.
8f861f08 528
ce947b9d
RP
529When configuring for cross tools, that is, the host is not the target,
530as in:
8f861f08 531
ce947b9d
RP
532@example
533configure @var{host} +target=@var{targ} -subdirs
534@end example
8f861f08 535
ce947b9d
RP
536the subdirectories are named @file{X-@var{host}-@var{targ}}. This is
537especially useful when configuring for multiple targets.
8f861f08 538
ce947b9d
RP
539If both @code{-subdirs} and @code{-srcdir=} are given, a tree that
540parallels the source directory structure is created in the current
541directory, except that the current directory represents the source
542directory itself, and the subdirectories are created in this directory
543tree rather than in the source directories.
8f861f08 544
ce947b9d
RP
545NOTE: previously, -subdirs built two level subdirectories as
546./H-host/T-target, created ./H-host/Makefile for building across all
547targets, ./Makefile for building across all hosts, and ./config.status
548and ./H-host/config.status for rebuilding these Makefiles.
8f861f08 549
ce947b9d
RP
550@node Host, Target, Build Directories, Using Configure
551@section Host
8f861f08 552
ce947b9d
RP
553NOTE: support for multiple hosts is at least temporarily suspended.
554FIXME-soon.
8f861f08 555
ce947b9d
RP
556The arguments to @code{configure} are @emph{hosts}. By @emph{host} we
557mean the environment in which the source will be compiled. This need
558not necessarily be the same as the actual physical machine involved,
559although it usually is.
8f861f08 560
ce947b9d
RP
561For example, if some obscure machine running an operating system other
562than @sc{un*x} actually had the @sc{gnu} @sc{posix} emulation libraries
563available, it would be possible to configure most @sc{gnu} source for a
564@sc{posix} system and build it on the obscure host.
8f861f08 565
ce947b9d
RP
566For more on this topic, see @xref{Host Environments, , cfg-paper, On
567Configuring Development Tools}.
8f861f08 568
ce947b9d
RP
569@node Target, Local Conventions, Host, Using Configure
570@section Target
8f861f08 571
ce947b9d
RP
572For building native development tools, or most of the other tools in the
573@sc{gnu} collection, you need not worry about the target. The
574@emph{target} of a configuration defaults to the same as the
575@emph{host}.
8f861f08 576
ce947b9d
RP
577For building cross development tools, please see @xref{Building
578Development Environments, , cfg-paper, On Configuring Development
579Tools}.
8f861f08 580
ce947b9d
RP
581@node Local Conventions, , Target, Using Configure
582@section Local Conventions
8f861f08 583
ce947b9d
RP
584If you find that a tool does not get configured to your liking or that
585@code{configure}'s conventions are not your local conventions, you
586should probably consider site specific Makefile fragments. (see
587@xref{FIXME-now: site specific makefile fragments})
8f861f08 588
ce947b9d
RP
589These are probably not the right choice for options that can be set from
590the @code{configure} command line or for differences that are host or
591target dependent.
8f861f08 592
8f861f08 593
ce947b9d
RP
594@node What Configure Does, Porting, Using Configure, top
595@chapter What Configure Does
8f861f08 596
ce947b9d
RP
597When configure runs, it does the following things for each source
598directory for each host and target combination.
8f861f08 599
ce947b9d
RP
600NOTE: support for multiple hosts and targets is at least temporarily
601suspended.
8f861f08 602
ce947b9d 603@itemize @bullet
8f861f08 604
ce947b9d
RP
605@item Create Build Directories
606(see @xref{Build Directories}) When @code{configure} is run with the
607@code{-srcdir=} option, a directory tree is created that parallels the
608directory structure of the source directory except that the current
609directory is treated as the build directory for the source directory
610proper. (see @xref{Invoking}).
611
612NOTE: support for @code{-subdirs} is at least temporarily suspended.
613
614When @code{configure} is run with the @code{-subdirs} option, a build
615directory is created in each source directory.
616
617If both @code{-subdirs} and @code{-srcdir=} are given, a tree that
618parallels the source directory structure is created in the current
619directory, except that the current directory represents the source
620directory itself, and the subdirectories are created in this directory
621tree rather than in the source directories.
622
623@item Generate Makefiles
624A makefile template, usually called @file{Makefile.in} from the source
625directory is copied to an output file in the build directory. The
626output file is usually named @file{Makefile}. A number of makefile
627macros are prepended to the output file. If @code{-prefix=} or
628@code{-datadir=} were specified on the @code{configure} command line,
629then the makefile variables are set accordingly. If host, target, or
630site, specific makefile fragments exist, they are inserted into the
631output file. (see @xref{Makefiles, , , make, Makefiles})
632
633@item Generate .gdbinit
634If the source directory contains a .gdbinit file and the build directory
635is different from the source directory, a .gdbinit file is created in
636the build directory. (see @xref{Command Files, , , gdb, Command Files})
637
638@item Make Symbolic Links
639Most directories have some symbolic links with generic names built
640pointing to specific files in the source directory. If the system on
641which @code{configure} is run cannot support symbolic links, then hard
642links are used instead.
643
644@item Miscellaneous
645If the source directory has special needs, they are handled. Usually
646there are none, but sometimes they involve changes to the output
647makefile.
648
649@item Generate config.status
650A shell script named @file{config.status} is created in the build
651directory. This shell script, when run from the build directory, will
652reconfigure the build directory except that subdirectories are not
653reconfigured. This is most often used by @code{make} to rebuild the
654output makefile. (see @xref{Top, , , bash})
655
656@item Recursion
657If the source directory has subdirectories that should also be
658configured, then @code{configure} is called for each.
8f861f08 659
ce947b9d 660@end itemize
8f861f08 661
ce947b9d
RP
662@node Porting, Known Bugs, What Configure Does, top
663@chapter Porting with Configure
8f861f08 664
ce947b9d 665This section explains briefly how to port configure for:
8f861f08
RP
666
667@menu
ce947b9d
RP
668* Programs:: Adding configure to existing programs
669* Hosts:: Adding new hosts to existing programs
670* Targets:: Adding new targets to existing programs
671* Reference:: Reference
8f861f08
RP
672@end menu
673
ce947b9d
RP
674@node Programs, , Remedies, Adding Hosts Or Targets
675@subsection Adding Configure To Existing Programs
8f861f08
RP
676
677If you are writing a new program, don't worry about porting issues or
678configure until it is running reasonably on some host. Then refer
679back to this section.
680
ce947b9d
RP
681If your
682
683@c marker
684
8f861f08
RP
685@menu
686* Makefile Support:: Makefile Support
ce947b9d 687* Add Standard Macros (Template Follows):: Add Standard Macros (Template Follows)
8f861f08
RP
688@end menu
689
ce947b9d
RP
690@node Makefile Support, Add Standard Macros (Template Follows), Adding Configure To Existing Programs, Adding Configure To Existing Programs
691@subsubsection Makefile Support
8f861f08
RP
692
693
694@menu
695* Makefile Host Support - Move It To Host Fragments:: Makefile Host Support - Move It To Host Fragments
8f861f08
RP
696@end menu
697
8f861f08 698
ce947b9d
RP
699@node Add Standard Macros (Template Follows), , Makefile Support, Adding Configure To Existing Programs
700@subsubsection Add Standard Macros (Template Follows)
8f861f08
RP
701
702@itemize @bullet
703@item as defined in standards.text
704@item also add
705
706@itemize @minus
707@item includedir
708This macro defines the directory in which to install any headers files that should be made available to users.
709@item docdir
710This macro defines where to install any documentation that is not either a man page or an info file. For man pages, see mandir,
711for info, see infodir.
712@end itemize
713
714@item template
715
716@example
717
718# Makefile for GNU tar program.
719
720#
721# Makefile
722# Copyright (C) 1990, 1991 Cygnus Support
723#
724# This file is free software; you can redistribute it and/or modify
725# it under the terms of the GNU General Public License as published by
726# the Free Software Foundation; either version 2 of the License, or
727# (at your option) any later version.
728#
729# This program is distributed in the hope that it will be useful,
730# but WITHOUT ANY WARRANTY; without even the implied warranty of
731# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
732# GNU General Public License for more details.
733#
734# You should have received a copy of the GNU General Public License
735# along with this program; if not, write to the Free Software
736# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
737#
738
739srcdir = .
740
741prefix = /usr/local
742
743bindir = $(prefix)/bin
744datadir = $(prefix)/lib
745libdir = $(prefix)/lib
746mandir = $(datadir)/man
747man1dir = $(mandir)/man1
748man2dir = $(mandir)/man2
749man3dir = $(mandir)/man3
750man4dir = $(mandir)/man4
751man5dir = $(mandir)/man5
752man6dir = $(mandir)/man6
753man7dir = $(mandir)/man7
754man8dir = $(mandir)/man8
755man9dir = $(mandir)/man9
756infodir = $(datadir)/info
757includedir = $(prefix)/include
758docdir = $(datadir)/doc
759
760SHELL = /bin/sh
761
762INSTALL = install -c
763INSTALL_PROGRAM = $(INSTALL)
764INSTALL_DATA = $(INSTALL)
765
766AR = ar
767AR_FLAGS = qv
768BISON = bison
769MAKEINFO = makeinfo
770RANLIB = ranlib
771
772# In order to disable remote-tape support, add -DNO_REMOTE to the
773# appropriate DEFS line, and remove rtape_lib.* from LOCAL_@{SRC,OBJ@}
774# For Ultrix 3.1, you will have to compile rtape_lib.c with -DUSG.
775# Add -DUSE_REXEC to use rexec for remote tape operations
776# instead of forking rsh or remsh.
777#
778# If tar fails to properly print error msgs, or core-dumps doing same,
779# you may need to change which version of msg...() you are using.
780# To do so, add one of the following to your DEFS= line
781# -DSTDC_MSG If you are using an ANSI compiler, and have vfprintf().
782# -DVARARGS_MSG If you have varargs.h and vfprintf()
783# -DDOPRNT_MSG If you have _doprnt(), and no useful varargs support
784# -DLOSING_MSG If nothing else works.
785#
786# Some non-BSD systems may have to add -DNEED_TZSET in order to have getdate.y
787# compile correctly.
788#
789# If you have a system V system which defines size_t, add -DHAVE_SIZE_T.
790# If you have a system which defines strstr, add -DHAVE_STRSTR.
791#
792# If you can't use remote tar with the rmt library, you can still get
793# some stuff to work right by adding -DUSE_REXEC.
794#
795# Some people's systems define a prototype for signal handlers which
796# require them to be declared as void. If you get such problems in
797# rtape_lib, function command, then define -DSIGNAL_VOID.
798#
799# getdate.y has 8 shift/reduce conflicts.
800#
801# In addition to setting DEFS appropriately for your system, you might
802# have to hand edit the #defines and #undefs in port.c.
803#
804
805## GNU version
806DEFS = -DBSD42
807LOCAL_SRC =
808LOCAL_OBJ =
809LDFLAGS =
810LIBS = -lutils
811LINT = lint
812LINTFLAGS = -abchx
813DEF_AR_FILE = \"-\"
814DEFBLOCKING = 20
815O = o
816@end example
817
818#### Host, target, and site specific Makefile fragments come in here.
819###
820
821@itemize @bullet
822@item Identify Nonstandard Macros
823@itemize @minus
824@item Put Defaults Before The Fragment Hook (Cf)
825@item Move Non-Defaults To Makefile Fragments (Cf)
826@item Map To Those Fragments In Configure.In (Cf)
827@end itemize
828
829@item Fragment Hook
830
831@itemize @minus
832@item Should Follow Standard And Non-Standard Macros
833@item Should Preceed All Targets
834@item Looks Like
835#### Host, target, and site specific Makefile fragments come in here.
836###
837
838The line beginning with four hashes is the important part. The comment and the line beginning with three hashes are only
839a conventional convenience.
840@end itemize
841
842@item Makefile Fragments
843@item Host
844@item Target
845@item Site
846@item Mv Makefile Makefile.In
847@item Standard Targets
848@item All (Should Be The Default)
849@item Install
850@item Clean
851@item Info
852@item Install-Info
853@item Clean-Info
854@item The Config Subdirectory
855@item Configure.In
856@item Declarations
857@item Srctrigger
858@item Srcname
859@item Configdirs
860@item Target_Dependent
861@item Per-Host
862@item Per-Target
863@item Post-Target
864@item Available Variables
865
866@defvar{host}
867Contains the actual name that the user entered for the host. Since many
868things that the user could enter would map to the same canonical triple,
869this variable is innappropriate to use for picking available
870configurations. For that, use @code{host_cpu}, @code{host_vendor},
871and/or @code{host_os}. This variable is useful, however, for error
872messages.
873@end defvar
874
875@defvar{host_cpu}
876Contains the first element of the canonical triple representing the host
877as returned by @file{config.subr}. This is occasionally used to
878distinguish between minor variations of a particular vendor's operating
879system and sometimes to determine variations in binary format between
880the host and the target.
881@end defvar
882
883@defvar{host_vendor}
884Contains the second element of the canonical triple representing the
885host as returned by @file{config.subr}. This is usually used to
886distinguish betwen the numerous variations between @emph{common}
887operating systems.
888@end defvar
889
890@defvar{host_os}
891Contains the the third element of the canonical triple representing the
892host as returned by @file{config.subr}.
893@end defvar
894
895@defvar{target}
896Contains the actual name that the user entered for the target. Since many
897things that the user could enter would map to the same canonical triple,
898this variable is innappropriate to use for picking available
899configurations. For that, use @code{target_cpu}, @code{target_vendor},
900and/or @code{target_os}. This variable is useful, however, for error
901messages.
902@end defvar
903
904@defvar{target_cpu}
905Contains the first element of the canonical triple representing the
906target as returned by @file{config.subr}. This is used heavily by
907programs involved in building programs, like the compiler, assembler,
908linker, etc. Most programs will not need the @code{target} variables at
909all, but this one could conceivably be used to build a program, for
910instance, that operated on binary data files whose byte order or
911alignment are other than that of the system on which the program is
912running.
913@end defvar
914
915@defvar{target_vendor}
916Contains the second element of the canonical triple representing the
917target as returned by @file{config.subr}. This is usually used to
918distinguish betwen the numerous variations between @emph{common}
919operating systems or object file formats. Sometimes it is used to
920switch between different flavors of users interfaces.
921@end defvar
922
923@defvar{target_os}
924Contains the the third element of the canonical triple representing the
925target as returned by @file{config.subr}. This variable is used by
926development tools to distinguish between subtle variations in object
927file formats that some vendors use across operating system releases. It
928might also be use to decide which libraries to build or what user
929interface the tool should provide.
930@end defvar
931
932@defvar{nfp}
933Is set to @code{true} if the user invoked configure with the @code{-nfp}
934command line option, otherwise it is empty. This is a request to target
935a machine with @emph{no floating point} unit, even if the machine ordinarily
936has a floating point unit available. This option has no negation.
937@end defvar
938
939@defvar{gas}
940Is set to @code{true} if the user invoked configure with the @code{-gas}
941command line option, otherwise it is empty. This is a request to assume
942that the target machine has gas available even if it ordinarily does
943not. The converse option, @code{-no-gas} is not available.
944@end defvar
945
946@defvar{x}
947Is set to @code{true} if the user invoked configure with the @code{-x}
948command line option, otherwise it is empty. This is a request to assume
949that @sc{mit x11} compatible headers files and libraries are available,
950regardless of what is normally available on this host.
951@end defvar
952
953@defvar{srcdir}
954Is set to the name of the directory containing the source for this
955program. This will be different from @file{.} if the user has
956specified either the @code{-srcdir=} or the @code{-subdirs} options.
957Note that @code{srcdir} is not necessarily an absolute path.
958@end defvar
959
960@defvar{host_makefile_frag}
961Is set to a file name representing to the default Makefile fragment for
962this host. It may be set in @file{configure.in} to overide this
963default.
964@end defvar
965
966@defvar{target_makefile_frag}
967Is set to a file name representing to the default Makefile fragment for
968this target. It may be set in @file{configure.in} to overide this
969default.
970@end defvar
971
972@defvar{site_makefile_frag}
973Is set to a file name representing to the default Makefile fragment for
974this host. It may be set in @file{configure.in} to overide this
975default. Normally @code{site_makefile_frag} is empty, but will have a
976value if the user specified @code{-site=} on the command line. This
977variable should probably not be overridden.
978@end defvar
979
980@defvar{Makefile}
981Is set to the name of the generated @file{Makefile}. Normally this
982value is precisely @file{Makefile} but some programs may want something
983else.
984@end defvar
985
986@defvar{removing}
987Is normally empty but will be set to some non-empty value if the user
988specified @code{-rm} on the command line. That is, if @code{removing}
989is non-empty, then configure is @emph{removing} a configuration rather
990than creating one.
991@end defvar
992
993@defvar{files}
994If this variable is non-empty following the @code{per-target:} section,
995then each word in it's value will be the target of a symbolic link
996named in the @code{links} variable.
997@end defvar
998
999@defvar{links}
1000If the @code{files} variable is non-empty following the
1001@code{per-target:} section, then symbolic links will be created with the
1002first word of links pointing to the first word of files, the second word of
1003links pointing to the second word of files, and so on.
1004@end defvar
1005
1006@end itemize
1007@end itemize
1008
ce947b9d
RP
1009@node Native Ports, Adding Hosts Or Targets, Porting, Porting
1010@section Native Ports
1011
1012To port a GNU tool that uses the Cygnus Configure system, do the
1013following.
1014
1015@itemize @asis
1016
1017@item Add A Host
1018@item Port An Existing Target
1019@item Add A Target
1020@item Build Host & Target
1021@item Build New Target On Some Other Host
1022
1023@end table
1024
1025@node Adding Hosts Or Targets, Reference, Native Ports, Porting
1026@section Adding Hosts Or Targets
1027
8f861f08
RP
1028
1029
1030@menu
ce947b9d
RP
1031* Add Canonical Triple To Config.Subr (Cf Config.Subr):: Add Canonical Triple To Config.Subr (Cf Config.Subr)
1032* (Optional) Add Alias (Cf Config.Subr)::
1033* Monte Carlo - Configure ; Make:: Monte Carlo - Configure ; Make
1034* Remedies:: Remedies
1035* Adding Configure To Existing Programs:: Adding Configure To Existing Programs
8f861f08
RP
1036@end menu
1037
ce947b9d
RP
1038@node Add Canonical Triple To Config.Subr (Cf Config.Subr), (Optional) Add Alias (Cf Config.Subr), Adding Hosts Or Targets, Adding Hosts Or Targets
1039@subsection Add Canonical Triple To Config.Subr (Cf Config.Subr)
1040
1041
1042@node (Optional) Add Alias (Cf Config.Subr), Monte Carlo - Configure ; Make, Add Canonical Triple To Config.Subr (Cf Config.Subr), Adding Hosts Or Targets
1043@subsection (Optional) Add Alias (Cf Config.Subr)
1044
1045
1046@node Monte Carlo - Configure ; Make, Remedies, (Optional) Add Alias (Cf Config.Subr), Adding Hosts Or Targets
1047@subsection Monte Carlo - Configure ; Make
1048
8f861f08 1049
ce947b9d
RP
1050@node Remedies, Adding Configure To Existing Programs, Monte Carlo - Configure ; Make, Adding Hosts Or Targets
1051@subsection Remedies
8f861f08
RP
1052
1053
ce947b9d
RP
1054@menu
1055* Automagic Config:: Automagic Config
1056* Symlinked Files:: Symlinked Files
1057* Makefile Fragments (Cf Configure.In):: Makefile Fragments (Cf Configure.In)
1058@end menu
1059
1060@node Automagic Config, Symlinked Files, Remedies, Remedies
1061@subsubsection Automagic Config
1062
1063
1064@node Symlinked Files, Makefile Fragments (Cf Configure.In), Automagic Config, Remedies
1065@subsubsection Symlinked Files
1066
1067
1068@node Makefile Fragments (Cf Configure.In), , Symlinked Files, Remedies
1069@subsubsection Makefile Fragments (Cf Configure.In)
1070
1071@node Reference, , Adding Hosts Or Targets, Porting
1072@section Reference
1073
1074
1075
1076Automagic Configuration Should Be Used If Prep'D Files Don'T Exist.
1077
1078@node Known Bugs, Variables Index, Porting, top
8f861f08
RP
1079@chapter Known Bugs
1080
1081The following bugs are known to exist.
1082
1083@itemize @bullet
1084
1085@item
1086There is no way to query about known hosts, known targets, or the
1087porting or testing status of any configuration.
1088
1089@item
1090The negations to the options @code{-gas}, @code{-x}, and @code{-nfp} are
1091not available.
1092
1093@end itemize
1094
1095@node Variables Index, Concept Index, Known Bugs, top
ce947b9d 1096@appendix Variable Index
8f861f08
RP
1097
1098@printindex vr
1099
1100@node Concept Index, , Variables Index, top
ce947b9d 1101@appendix Concept Index
8f861f08
RP
1102
1103@printindex cp
8f861f08
RP
1104@contents
1105@bye
1106
1107@c Local Variables:
1108@c fill-column: 79
1109@c outline-regexp: "@chap"
1110@c End:
1111@c (setq outline-regexp "@chapt\\\|@unnum\\\|@setf\\\|@conte\\\|@sectio\\\|@subsect\\\|@itemize\\\|@defvar{")
This page took 0.065989 seconds and 4 git commands to generate.