@node Config.Subr Calling Convention, Definition Of Canonical Triples, Canonical Triples And Config.Subr, Canonical Triples And Config.Subr
@section Config.Subr Calling Convention
where @var{builddir} is the directory in which you wish to build,
@var{host} is the host for which you want to build, and
@var{sourcedirectory} is the directory containing the source files.
If you were to do this twice with different values for @var{builddir}
and @vr{host}, then you could @code{make} for both at the same time.
@node Definition Of Canonical Triples, Maps Aliases To Canonical Triples, Config.Subr Calling Convention, Canonical Triples And Config.Subr
@section Definition Of Canonical Triples
NOTE: The rest of this section describes the @code{-subdirs} feature for
which support is at least temporarily suspended. FIXME-soon.
Another way to specify the build directory is with the @code{-subdirs}
option. For example:
@node Maps Aliases To Canonical Triples, Validates Canonical Triples, Definition Of Canonical Triples, Canonical Triples And Config.Subr
@section Maps Aliases To Canonical Triples
@example
configure @var{host} -subdirs
@end example
Using this option, @code{configure} will create a subdirectory named
@file{H-@var{host}} to act as the build directory for each source
directory.
@node Validates Canonical Triples, , Maps Aliases To Canonical Triples, Canonical Triples And Config.Subr
@section Validates Canonical Triples
Since building for multiple hosts is so common, @code{configure}
recognizes this situation as special. For example:
@example
configure @var{host1} @var{host2}
@end example
is precisely the same as:
@node Native Ports, Adding Hosts Or Targets, Canonical Triples And Config.Subr, top
@chapter Native Ports
@example
configure @var{host1} -subdirs
configure @var{host2} -subdirs
#end example
That is, when configuring for multiple hosts or multiple targets,
@code{-subdir} is assumed.
When configuring for cross tools, that is, the host is not the target,
as in:
@menu
* Add A Host:: Add A Host
* Port An Existing Target:: Port An Existing Target
* Add A Target:: Add A Target
* Build Host & Target:: Build Host & Target
* Build New Target On Some Other Host:: Build New Target On Some Other Host
@end menu
@example
configure @var{host} +target=@var{targ} -subdirs
@end example
@node Add A Host, Port An Existing Target, Native Ports, Native Ports
@section Add A Host
the subdirectories are named @file{X-@var{host}-@var{targ}}. This is
especially useful when configuring for multiple targets.
If both @code{-subdirs} and @code{-srcdir=} are given, a tree that
parallels the source directory structure is created in the current
directory, except that the current directory represents the source
directory itself, and the subdirectories are created in this directory
tree rather than in the source directories.
@node Port An Existing Target, Add A Target, Add A Host, Native Ports
@section Port An Existing Target
NOTE: previously, -subdirs built two level subdirectories as
./H-host/T-target, created ./H-host/Makefile for building across all
targets, ./Makefile for building across all hosts, and ./config.status
and ./H-host/config.status for rebuilding these Makefiles.
@node Host, Target, Build Directories, Using Configure
@section Host
@node Add A Target, Build Host & Target, Port An Existing Target, Native Ports
@section Add A Target
NOTE: support for multiple hosts is at least temporarily suspended.
FIXME-soon.
The arguments to @code{configure} are @emph{hosts}. By @emph{host} we
mean the environment in which the source will be compiled. This need
not necessarily be the same as the actual physical machine involved,
although it usually is.
@node Build Host & Target, Build New Target On Some Other Host, Add A Target, Native Ports
@section Build Host & Target
For example, if some obscure machine running an operating system other
than @sc{un*x} actually had the @sc{gnu} @sc{posix} emulation libraries
available, it would be possible to configure most @sc{gnu} source for a
@sc{posix} system and build it on the obscure host.
For more on this topic, see @xref{Host Environments, , cfg-paper, On
Configuring Development Tools}.
@node Build New Target On Some Other Host, , Build Host & Target, Native Ports
@section Build New Target On Some Other Host
@node Target, Local Conventions, Host, Using Configure
@section Target
For building native development tools, or most of the other tools in the
@sc{gnu} collection, you need not worry about the target. The
@emph{target} of a configuration defaults to the same as the
@emph{host}.
For building cross development tools, please see @xref{Building
Development Environments, , cfg-paper, On Configuring Development
Tools}.
@node Adding Hosts Or Targets, Adding Configure To Existing Programs, Native Ports, top
@chapter Adding Hosts Or Targets
@node Local Conventions, , Target, Using Configure
@section Local Conventions
If you find that a tool does not get configured to your liking or that
@code{configure}'s conventions are not your local conventions, you
should probably consider site specific Makefile fragments. (see
@xref{FIXME-now: site specific makefile fragments})
These are probably not the right choice for options that can be set from
the @code{configure} command line or for differences that are host or
target dependent.
@menu
* Add Canonical Triple To Config.Subr (Cf Config.Subr):: Add Canonical Triple To Config.Subr (Cf Config.Subr)
* (Optional) Add Alias (Cf Config.Subr)::
* Monte Carlo - Configure ; Make:: Monte Carlo - Configure ; Make
* Remedies:: Remedies
@end menu
@node Add Canonical Triple To Config.Subr (Cf Config.Subr), (Optional) Add Alias (Cf Config.Subr), Adding Hosts Or Targets, Adding Hosts Or Targets
@section Add Canonical Triple To Config.Subr (Cf Config.Subr)
@node What Configure Does, Porting, Using Configure, top
@chapter What Configure Does
When configure runs, it does the following things for each source
directory for each host and target combination.
@node (Optional) Add Alias (Cf Config.Subr), Monte Carlo - Configure ; Make, Add Canonical Triple To Config.Subr (Cf Config.Subr), Adding Hosts Or Targets
@section (Optional) Add Alias (Cf Config.Subr)
NOTE: support for multiple hosts and targets is at least temporarily
suspended.
@itemize @bullet
@node Monte Carlo - Configure ; Make, Remedies, (Optional) Add Alias (Cf Config.Subr), Adding Hosts Or Targets
@section Monte Carlo - Configure ; Make
@item Create Build Directories
(see @xref{Build Directories}) When @code{configure} is run with the
@code{-srcdir=} option, a directory tree is created that parallels the
directory structure of the source directory except that the current
directory is treated as the build directory for the source directory
proper. (see @xref{Invoking}).
NOTE: support for @code{-subdirs} is at least temporarily suspended.
When @code{configure} is run with the @code{-subdirs} option, a build
directory is created in each source directory.
If both @code{-subdirs} and @code{-srcdir=} are given, a tree that
parallels the source directory structure is created in the current
directory, except that the current directory represents the source
directory itself, and the subdirectories are created in this directory
tree rather than in the source directories.
@item Generate Makefiles
A makefile template, usually called @file{Makefile.in} from the source
directory is copied to an output file in the build directory. The
output file is usually named @file{Makefile}. A number of makefile
macros are prepended to the output file. If @code{-prefix=} or
@code{-datadir=} were specified on the @code{configure} command line,
then the makefile variables are set accordingly. If host, target, or
site, specific makefile fragments exist, they are inserted into the
output file. (see @xref{Makefiles, , , make, Makefiles})
@item Generate .gdbinit
If the source directory contains a .gdbinit file and the build directory
is different from the source directory, a .gdbinit file is created in
the build directory. (see @xref{Command Files, , , gdb, Command Files})
@item Make Symbolic Links
Most directories have some symbolic links with generic names built
pointing to specific files in the source directory. If the system on
which @code{configure} is run cannot support symbolic links, then hard
links are used instead.
@item Miscellaneous
If the source directory has special needs, they are handled. Usually
there are none, but sometimes they involve changes to the output
makefile.
@item Generate config.status
A shell script named @file{config.status} is created in the build
directory. This shell script, when run from the build directory, will
reconfigure the build directory except that subdirectories are not
reconfigured. This is most often used by @code{make} to rebuild the
output makefile. (see @xref{Top, , , bash})
@item Recursion
If the source directory has subdirectories that should also be
configured, then @code{configure} is called for each.
@end itemize
@node Remedies, , Monte Carlo - Configure ; Make, Adding Hosts Or Targets
@section Remedies
@node Porting, Known Bugs, What Configure Does, top
@chapter Porting with Configure
This section explains briefly how to port configure for:
@node Native Ports, Adding Hosts Or Targets, Porting, Porting
@section Native Ports
To port a GNU tool that uses the Cygnus Configure system, do the
following.
@itemize @asis
@item Add A Host
@item Port An Existing Target
@item Add A Target
@item Build Host & Target
@item Build New Target On Some Other Host
@end table
@node Adding Hosts Or Targets, Reference, Native Ports, Porting
@section Adding Hosts Or Targets
@menu
* Should Be Used If Prep'D Files Don'T Exist:: Should Be Used If Prep'D Files Don'T Exist
* Add Canonical Triple To Config.Subr (Cf Config.Subr):: Add Canonical Triple To Config.Subr (Cf Config.Subr)
* (Optional) Add Alias (Cf Config.Subr)::
* Monte Carlo - Configure ; Make:: Monte Carlo - Configure ; Make
* Remedies:: Remedies
* Adding Configure To Existing Programs:: Adding Configure To Existing Programs
@end menu
@node Should Be Used If Prep'D Files Don'T Exist, , Automagic Configuration, Automagic Configuration
@subsection Should Be Used If Prep'D Files Don'T Exist
@node Add Canonical Triple To Config.Subr (Cf Config.Subr), (Optional) Add Alias (Cf Config.Subr), Adding Hosts Or Targets, Adding Hosts Or Targets
@subsection Add Canonical Triple To Config.Subr (Cf Config.Subr)
@node (Optional) Add Alias (Cf Config.Subr), Monte Carlo - Configure ; Make, Add Canonical Triple To Config.Subr (Cf Config.Subr), Adding Hosts Or Targets
@subsection (Optional) Add Alias (Cf Config.Subr)
@node Monte Carlo - Configure ; Make, Remedies, (Optional) Add Alias (Cf Config.Subr), Adding Hosts Or Targets
@subsection Monte Carlo - Configure ; Make
@node Remedies, Adding Configure To Existing Programs, Monte Carlo - Configure ; Make, Adding Hosts Or Targets
@subsection Remedies
@node Known Bugs, Variables Index, Adding Configure To Existing Programs, top