This document attempts to describe the Cygnus Support version of configure.

Copyright (C) 1991 Cygnus Support Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Cygnus Support.

     START-INFO-DIR-ENTRY
     * configure: (configure.info).	Cygnus configure.
     END-INFO-DIR-ENTRY

top
***

This file documents the configuration system used and distributed by Cygnus Support.

NOTE: support for a Cygnus experimental option, -subdirs is at least temporarily suspended.  Most of the code is still in configure but the option is disabled.  This document describes that feature, but those parts are prominently marked with NOTE's like this one. FIXME-soon

Invoking
********

The usual way to invoke configure is as follows:

     configure HOST

This asks configure to prepare the source to be compiled in a HOST environment with programs and files to be installed in /usr/local.

NOTE: support for multiple hosts is at least temporarily suspended. FIXME-soon

If more than one host is specified on the command line, then configurations are created for each and -subdirs is assumed.

-datadir=DIR
     This option requests that the source be configured so that host independent files will be installed in DIR.

     This option sets the configure variable datadir.  If datadir is not empty, generated Makefiles will have their datadir variables set to this value. (See Install Details.)

-gas
     Notifies configure that the GNU assembler is available on all specified hosts.

-help
     Displays a quick summary of how to invoke configure.

-host=HOST
     FIXME-soon: I don't think this option should be documented.

     NOTE: support for this -namesubdir= is at least temporary suspended. FIXME-soon

-namesubdir=NAME
     Asks that any subdirectories created by the -subdirs option be named NAME.  Note that using multiple hosts with -namesubdir= isn't terribly useful.

-nfp
     Notifies configure that all of the specified targets have no floating point units.

-norecursion
     Asks configure to configure only this directory.  Any subdirectories are ignored.  This is used by the executable shell script config.status to reconfigure the current directory. (see config.status).

-objdir=DIR
     This option is no longer supported.  Use -srcdir= instead.

-prefix=DIR
     This option requests that the source be configured so that programs and files will be installed in DIR.

     This option sets the configure variable prefix.  If prefix is not empty, generated Makefiles will have their prefix variables set to this value. (See Install Details.)

-recurring
     This option is used internally by configure when recurring on subdirectories.  It's sole purpose is to supress status output.  It can be overriden with the -verbose option.

-rm
     Asks configure to remove a configuration rather than create one.

-site=SITE
     Asks that Makefiles be generated using site specific Makefiles for SITE.  See also Sites.

-srcdir=_DIR
     Tells configure that the sources are located in DIR.  The build directory is assumed to be ..

     NOTE: support for this -subdirs is at least temporary suspended. FIXME-soon

-subdirs
     Asks that configurations be placed in subdirectories named H-HOST of each build directory, for each host specified. If this configuration is not native, (HOST is not TARGET), then he subdir will be named X-HOST-TARGET instead.

     NOTE: support for multiple targets is at least temporarily suspended. FIXME-soon

-target=TARGET
     Requests that the sources be configured to target the TARGET machine.  If no targets are specified explicitly, the target is assumed to be the same as the host.  If multiple targets are specified, configurations for each are created and -subdirs is assumed.

-tmpdir=TMPDIR
     Sets the directory in which configure creates temporary files to TMPDIR.

-verbose

-v
     Asks that configure print status lines for each directory configured.  Normally, only the status lines for the current directory are printed.

-x
     Tells configure that MIT style X11 header files and libraries are available on the host, even if they are not normally available.

Using Configure
***************

Configure prepares source directories in anticipation of building. Source cannot be built until it has been configured.  The choices and options available at configuration time generally have valid defaults, but the defaults do not cover all cases.  The choices available include install locations, build directories, host, target, and local conventions.

Install Locations
=================

Using the default configuration, make install will create a single tree of files, some of which are programs.  The location of this tree is determined by the value of the variable prefix.  The default value of prefix is /usr/local.  This is probably correct for native tools installed on only one host.

Changing the default install directory
--------------------------------------

In the default configuration, all files are installed in subdirectories of /usr/local.  The actual location is determined by the value of the configure variable prefix which determines the value of the Makefile variable prefix.

You can also set the value of the Makefile variable prefix explicitly each time you invoke make if you are so inclined, but because many programs have this location compiled in, you must specify the prefix value precisely on each invocation of make or you will end up with a broken installation.

To make this easier, the value of the configure variable prefix can be set on the command line to configure using the option -prefix=.  (See prefix).

Installing for multiple hosts
-----------------------------

Host independent files are installed in subdirectories of /usr/local/lib.  The actual location is determined by the value of the configure variable datadir which determines the value of the Makefile variable datadir.  By default, the value of datadir is PREFIX/lib.  This makes single host installs simple, and simplifies changing the default location for the install tree, but doesn't allow for multiple hosts to effectively share host independent files.

To configure so that multiple hosts can share common files, use something like:

     configure HOST1 -prefix=/usr/gnu/H-HOST1 -datadir=/usr/gnu/H-independent
     make all info install install-info clean
     configure HOST2 -prefix=/usr/gnu/H-HOST2 -datadir=/usr/gnu/H-independent
     make all info install install-info

The first line configures the source for HOST1 in such a way that host specific programs will be placed in subdirectories of /usr/gnu/H-HOST1 and host independent files will be placed in /usr/gnu/H-independent.  (See datadir.)

The second line builds and installs all programs for HOST1, including both host independent and host dependent files.

The third line reconfigures the source for HOST2 in such a way that host specific programs will be placed in subdirectories of /usr/gnu/H-HOST2 and host independent files will again be placed in /usr/gnu/H-independent.

The fourth line builds and installs all programs for HOST2.  Host dependent files will be installed in new directories but the host independent files will be installed on top of the host independent files installed for HOST1.  This results in a single copy of the host independent files suitable for use by both hosts.

NOTE: support for -subdirs and multiple hosts is at least temporarily suspended. FIXME-soon

Previously this was:

     configure HOST1 HOST2 -prefix=/usr/gnu

Full descriptions of all installation subdirectories
----------------------------------------------------

In any install, a number of standard directories are created.  Their actual names are determined by Makefile variables.  Some of the defaults for Makefile variables can be changed at configure time using command line options to configure.  For more information on the standard directories or the Makefile variables, please refer to standards.text.

Note that configure does not create srcdir at any time. The directory srcdir is not an installation directory.

All makefile variables can be overridden on the command line to make.  (See Overriding Variables (Make).)  If you do so, you will need to specify the value precisely the same way for each invocation of make or you risk ending up with a broken installation.  This is because many programs have the locations of other programs or files compiled into them.  If you find yourself overriding any of the variables frequently, you should consider site dependent Makefile fragments.  See also Sites.

During make install, the following standard directories will be created and populated:

 -- Makefile and configure: prefix
     By default, the value of this variable determines the root of the installation tree.  It may be overridden with the -srcdir= command line option to configure.  (see Invoking.)  The default value for prefix is /usr/local.

 -- Makefile: bindir
     The value of this variable names a directory intended to contain binary programs that users can run.  The default value for bindir depends on prefix so bindir is normally changed only indirectly through prefix.  The default value for bindir is PREFIX/bin.

 -- Makefile and configure: datadir
     The value of this variable names a directory intended to contain host independent files.  The configure variable, which is used to set the default value of the Makefile variable, can be set at configure time using the -datadir= option to configure.  (See also Invoking.)  The default value for datadir is PREFIX/lib.

 -- Makefile: libdir
     The value of this variable names a directory intended to hold libraries and support programs.  The default value for libdir depends on prefix so libdir is normally changed only indirectly through prefix.  The default value for libdir is PREFIX/lib.

 -- Makefile: mandir
     The value of this variable names a directory intended to hold man format man pages.  The default value for mandir depends on prefix so mandir is normally changed only indirectly through prefix.  The default value for mandir is DATADIR/man.

 -- Makefile: manNdir
     There are eight of these variables named man1dir, man2dir, etc.  They are intended to name the specific directories which hold the man pages of their respective sections.  That is, man1dir holds emacs.1, the man page for the emacs program while man5dir holds the man page describing the rcs data file format, called rcsfile.5.  The default value for manNdir depends on prefix so manNdir is normally changed only indirectly through prefix.  The default value for manNdir is MANDIR/manN.

 -- Makefile: manext
     The makefile variable manext is not supported by the configure. The GNU coding standards do not call for man1ext, man2ext, so the intended use for manext is not clear. (See also Makefile Extensions.)

 -- Makefile: infodir
     The value of this variable names a directory intended to hold info format documentation.  The default value for infodir depends on prefix so infodir is normally changed only indirectly through prefix.  The default value for infodir is DATADIR/info.

 -- Makefile: docdir
     The value of this variable names a directory intended to hold any documentation that is in a format other than info or man. The default value for docdir depends on prefix so docdir is normally changed only indirectly through prefix. The default value for docdir is DATADIR/doc.  Note that this variable is an extension to the GNU coding standards. (See also Makefile Extensions.)

 -- Makefile: includedir
     The value of this variable names a directory intended to hold the headers files that accompany the libraries installed in libdir. The default value for includedir depends on prefix so includedir is normally changed only indirectly through prefix.  The default value for includedir is PREFIX/include.

Build Directories
=================

Normally, configure builds a Makefile and symbolic links in the same directory as the source files.  This is the typical UN*X way to build programs but it has limitations.  For instance, using this approach, you can only build for one host at a time.

We refer to the directories in which configure builds a Makefile as the build directories or sometimes as objdir because these are the directories in which make will build object files, among other things.

The default build directory is the same as the source directory.

You can change the build directory with a sequence like the following:

     mkdir BUILDDIR
     cd BUILDDIR
     configure HOST -srcdir=SOURCEDIRECTORY

where BUILDDIR is the directory in which you wish to build, HOST is the host for which you want to build, and SOURCEDIRECTORY is the directory containing the source files.

If you were to do this twice with different values for BUILDDIR and HOST, then you could make for both at the same time.

NOTE: The rest of this section describes the -subdirs feature for which support is at least temporarily suspended.  FIXME-soon.

Another way to specify the build directory is with the -subdirs option.  For example:

     configure HOST -subdirs

Using this option, configure will create a subdirectory named H-HOST to act as the build directory for each source directory.

Since building for multiple hosts is so common, configure recognizes this situation as special.  For example:

     configure HOST1 HOST2

is precisely the same as:

     configure HOST1 -subdirs
     configure HOST2 -subdirs

That is, when configuring for multiple hosts or multiple targets, -subdir is assumed.

When configuring for cross tools, that is, the host is not the target, as in:

     configure HOST +target=TARG -subdirs

the subdirectories are named X-HOST-TARG.  This is especially useful when configuring for multiple targets.

If both -subdirs and -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.

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.

Host
====

NOTE: support for multiple hosts is at least temporarily suspended. FIXME-soon.

The arguments to configure are hosts.  By 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.

For example, if some obscure machine running an operating system other than UN*X actually had the GNU POSIX emulation libraries available, it would be possible to configure most GNU source for a POSIX system and build it on the obscure host.

For more on this topic, see cfg-paper (On Configuring Development Tools).

Target
======

For building native development tools, or most of the other tools in the GNU collection, you need not worry about the target.  The target of a configuration defaults to the same as the host.

For building cross development tools, please see cfg-paper (On Configuring Development Tools).

Local Conventions
=================

If you find that a tool does not get configured to your liking or that configure's conventions are not your local conventions, you should probably consider site specific Makefile fragments.  See also Sites.

These are probably not the right choice for options that can be set from the configure command line or for differences that are host or target dependent.

What Configure Does
*******************

When configure runs, it does the following things for each source directory for each host and target combination.

NOTE: support for multiple hosts and targets is at least temporarily suspended.

  * Create Build Directories (see Build Directories) When configure is run with the -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 Invoking).

     NOTE: support for -subdirs is at least temporarily suspended.

     When configure is run with the -subdirs option, a build directory is created in each source directory.

     If both -subdirs and -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.

  * Generate Makefiles A makefile template, usually called Makefile.in from the source directory is copied to an output file in the build directory.  The output file is usually named Makefile.  A number of makefile macros are prepended to the output file.  If -prefix= or -datadir= were specified on the 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 Makefiles.)

  * 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 Command Files.)

  * 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 configure is run cannot support symbolic links, then hard links are used instead.

  * Miscellaneous If the source directory has special needs, they are handled.  Usually there are none, but sometimes they involve changes to the output makefile.

  * Generate config.status A shell script named 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 make to rebuild the output makefile.  (see bash.)

  * Recursion If the source directory has subdirectories that should also be configured, then configure is called for each.

Porting with Configure
**********************

This section explains briefly how to add programs, host and target configuration names, and sites to Cygnus configure.

Adding Configure To New Programs
================================

If you are writing a new program, you probably shouldn't worry about porting issues or configure until it is running reasonably on some host. Then refer back to this section.

If the program in question currently has a configure script that meets the criterion set out by standards.text, please do not add Cygnus configure.  It should be possible to add this program without change to a Cygnus configure style source tree.

If the program is not target dependent, please consider using autoconf instead of Cygnus configure.  Autoconf will soon be available from the FSF.

To add Cygnus configure to an existing program, do the following.

Bring the Makefile up to the standard
     The coding standard for GNU Makefiles is described in standards.text.

Add Cygnus extensions to the Makefile
     There are described in see Makefile Extensions.

Move host support from Makefile to fragments
     This usually involves finding sections of the Makefile that say things like ``uncomment these lines for host foo'' and moving them to a new file call ./config/mh-foo. For more on this, see Hosts and Targets.

Choose defaults
     If the program has compile time options that determine the way the program should behave, chose reasonable defaults and make these Makefile variables.  Be sure the variables are assigned their default values before the #### line so that they can be overridden with site specific Makefile fragments.

Locate configuration files
     If there is configuration information in header files or source files, separate it in such a way that the files have a generic name.  Then move the specific instances of those files into the ./config directory.

Separate host and target information
     Some programs already have this information separated.  If not, you will need to do so.  Host specific information is the information needed to compile the program.  Target specific information it information on the format of data files that the program will read or write.  This information should live in separate files in the ./config directory with names that reflect the configuration for which they are intended.

     At this point you might skip this step and simply move on.  If you do, you should end up with a program that can be configured only to build native tools, that is, tools for which the host system is also the target system.  Later, you could attempt to build a cross tool and separate out the target specific information by figuring out what went wrong.  This is often simpler than combing through all of the source code.

Write configure.in
     Usually this involves writing shell script fragments to map from canonical configuration names into the names of the configuration files. These files will then be linked at configure time from the specific instances of those files in ./config to file in the build directory with more generic names.  (see also Build Directories). The format of configure.in is described in see configure.in.

Rename the Makefile to Makefile.in

At this point you should have a program that can be configured by Cygnus configure.

Adding hosts and targets
========================

To add a host or target to a program that currently uses Cygnus configure, do the following.

  * Make sure the new configuration name is represented in config.sub.  If not, add it.  For more details, see the comments in the shell script config.sub.

  * If you are adding a host configuration, look in configure.in, in the per-host section.  Make sure that your configuration name is represented in the mapping from host configuration names to configuration files.  If not, add it.  Also see configure.in.

  * If you are adding a target configuration, look in configure.in, in the per-target section.  Make sure that your configuration name is represented in the mapping from target configuration names to configuration files.  If not, add it.  Also see configure.in.

  * Look in configure.in for the assignments to the variables files, links, host_makefile_frag, and target_makefile_frag.  These are the names of the configuration files that the program uses.  Make sure that copies of the files exist for your host.  If not, create them.  See also Configure Variables.

This should be enough to configure for a new host or target configuration name.  Getting the program to compile and run properly now is the hard work of the port.

Adding site info
================

If some of the Makefile defaults are not right for your site, you can build site specific Makefile fragments.  To do this, do the following.

  * Choose a name for your site.  It must be less than eleven characters for now.

  * If the program does not have a ./config directory, create it.

  * Create a file called ./config/ms-SITE where SITE is the name of your site.  In it, set the Makefile variables of your choice.

  * Configure the program with:

          configure ... +site=SITE

Gory details described
**********************

Here we describe the backend support.

Extensions to the GNU coding standards
======================================

The following additions to the GNU coding standards are required for Cygnus configure to work properly.

  * The Makefile must contain exactly one line starting with ####. This line should follow any default macro definitions but precede any rules.  Host, target, and site specific Makefile fragments will be inserted immediately after this line.  If the line is missing, the fragments will not be inserted.

Cygnus adds the following targets to our Makefiles.  Their existence is not required for Cygnus configure but are documented here for completeness.

info
     Build all info files from texinfo source.

install-info
     Install all info files.

clean-info
     Remove all info files and any intermediate files that can be generated from texinfo source.

stage1

stage2

stage3

stage4

de-stage1

de-stage2

de-stage3

de-stage4

bootstrap

comparison

Makefile
     These targets are in transition and may be removed shortly.

In addition, the following Makefile targets have revised semantics:

install
     Should not depend on the target all.  If the program is not already built, make install should fail.  This allows programs to be installed even when make would otherwise determine them to be out of date.  This can happen when the result of a make all is transported via tape to another machine for installation as well as in a number of other cases.

clean
     Should remove any file that can be regenerated by the Makefile, excepting only the Makefile itself, and any links created by configure. That is, make all clean should return all directories to their original condition.  If this is not done, then:

          configure HOST1 ; make all clean ; configure HOST2 ; make all

     will fail because of intermediate files intended for HOST1.

Cygnus adds the following macros to all Makefile.in's.  Their presence is not required for Cygnus configure.

docdir
     The directory in which to install any documentation that is not either a man page or an info file.  For man pages, see mandir, for info, see infodir.

includedir
     The directory in which to install any headers files that should be made available to users.  This is distinct from the gcc include directory which is intended for gcc only.  Files in includedir may be used by cc as well.

In addition, the following macros have revised semantics.

manext
     is not used.  The intended usage is not clear.  For example, if I have a foo.man and a bar.man, and foo.man is destined for /usr/local/lib/man/man1/foo.1 while bar.man is destined for /usr/local/lib/man/man5/bar.5, then to what should the value of manext be set?  See also Install Details.

datadir
     is used for all host independent files.  This makes it possible to share host independent files across multiple hosts without ersorting to symlinks or multiple mount points.  This also makes it possible build an install tree that contains multiple host binaries, write the binaries to tape, and extract any of the hosts without extracting the others.

mandir
     man pages are host independent so the default path for mandir depends on datadir.

infodir
     info files are host independent so the default path for infodir depends on datadir.

BISON
     is assumed to have a yacc calling convention.  To actually use bison, use BISON=bison -y.

Cygnus also adds the following restrictions on our Makefiles.

  * When libraries are installed, the line containing the call to INSTALL_DATA should always be followed by a line containing a call to RANLIB on the installed library.  This is to accomodate systems that use ranlib.  Systems that do not use ranlib can set RANLIB to echo in a host specific Makefile fragment.

The format of the configure.in file
===================================

A configure.in file for Cygnus configure consists of a declarations section, followed by a per-host section, followed by a per-target section, optionally followed by a post-target section.  Each section is a shell script fragment sourced by configure at the appropriate time. The interface between configure and the shell fragments is through a set of shell variables.  All sections are sourced in the build directory.

A line beginning with # Per-host: begins the per-host section.

A line beginning with # Per-target: begins the per-target section.

If it exists, the post-target section begins with # Per-target:.

A minimal configure.in
----------------------

A minimal configure.in consists of four lines.

     srctrigger=foo.c
     srcname="source for the foo program"
     # Per-host:
     # Per-target:

The per-host and per-target lines divide the file into the three required sections.  The srctrigger line names a file.  configure checks to see that this file exists in the source directory before configuring.  If the srctrigger file does not exist, configure uses the value of srcname to print an error message about not finding the source.

This particular example uses no links, and only the default host, target, and site specific Makefile fragments if they exist.

Variables available to configure.in
-----------------------------------

The following variables are available to the shell fragments in configure.in.

srctrigger Contains the name of a source file that is expected to live in the source directory.  This is usually set in the declations section of configure.in.  Configure tests to see that this file exists.  If the file does not exist, configure prints an error message.  This is used as a sanity check that configure.in matches the source directory.

srcname Contains the name of the source contained in the source directory.  This is usually set in the declarations section of configure.in.  If the file named in srctrigger does not exist, configure uses the value of this variable when it prints the error message.

configdirs Contains the names of any subdirectories on which configure should recur.  This is usually set in the declarations section of configure.in.  If Makefile.in contains a line starting with SUBDIRS =, then it will be replaced with an assignment to SUBDIRS using the value of configdirs.  This can be used to determine which directories to configure and build depending on the host and target configurations.

NOTE: support for multiple targets is currently suspended.

target_dependent If this variable is not empty and -subdirs is in effect then configure will create separate build directories for each target.  This is usually set in the declarations section of configure.in.  The default is to assume that a directory is target independent, create only one real directory with symlinks from the other names.  This means that a target independent directory will be built exactly once regardless of how many targets are being built.

host Contains the actual name that the user entered for the host.  Since many things that the user could enter would map to the same canonical triple, this variable is innappropriate to use for picking available configurations.  For that, use host_cpu, host_vendor, and/or host_os.  This variable is useful, however, for error messages.

host_cpu Contains the first element of the canonical triple representing the host as returned by config.sub.  This is occasionally used to distinguish between minor variations of a particular vendor's operating system and sometimes to determine variations in binary format between the host and the target.

host_vendor Contains the second element of the canonical triple representing the host as returned by config.sub.  This is usually used to distinguish betwen the numerous variations between common operating systems.

host_os Contains the the third element of the canonical triple representing the host as returned by config.sub.

target Contains the actual name that the user entered for the target.  Since many things that the user could enter would map to the same canonical triple, this variable is innappropriate to use for picking available configurations.  For that, use target_cpu, target_vendor, and/or target_os.  This variable is useful, however, for error messages.

target_cpu Contains the first element of the canonical triple representing the target as returned by config.sub.  This is used heavily by programs involved in building programs, like the compiler, assembler, linker, etc.  Most programs will not need the target variables at all, but this one could conceivably be used to build a program, for instance, that operated on binary data files whose byte order or alignment are other than that of the system on which the program is running.

target_vendor Contains the second element of the canonical triple representing the target as returned by config.sub.  This is usually used to distinguish betwen the numerous variations between common operating systems or object file formats.  Sometimes it is used to switch between different flavors of user interfaces.

target_os Contains the the third element of the canonical triple representing the target as returned by config.sub.  This variable is used by development tools to distinguish between subtle variations in object file formats that some vendors use across operating system releases.  It might also be use to decide which libraries to build or what user interface the tool should provide.

nfp Is set to true if the user invoked configure with the -nfp command line option, otherwise it is empty.  This is a request to target machines with no floating point unit, even if the targets ordinarily have floating point units available.  This option has no negation.

gas Is set to true if the user invoked configure with the -gas command line option, otherwise it is empty.  This is a request to assume that all target machines have gas available even if they ordinarily do not.  The converse option, -no-gas is not available.

x Is set to true if the user invoked configure with the -x command line option, otherwise it is empty.  This is a request to assume that MIT X11 compatible headers files and libraries are available on all hosts, regardless of what is normally available on them.

NOTE: support for -subdirs is at least temporarily suspended.

srcdir Is set to the name of the directory containing the source for this program.  This will be different from . if the user has specified either the -srcdir= or the -subdirs options.  Note that srcdir is not necessarily an absolute path.

host_makefile_frag Is set to a file name representing to the default Makefile fragment for this host.  It may be set in configure.in to overide this default.

target_makefile_frag Is set to a file name representing to the default Makefile fragment for this target.  It may be set in configure.in to overide this default.

site_makefile_frag Is set to a file name representing to the default Makefile fragment for this host.  It may be set in configure.in to overide this default.  Normally site_makefile_frag is empty, but will have a value if the user specified -site= on the command line.  This variable should probably not be overridden.

Makefile Is set to the name of the generated Makefile.  Normally this value is precisely Makefile but some programs may want something else.

removing Is normally empty but will be set to some non-empty value if the user specified -rm on the command line.  That is, if removing is non-empty, then configure is removing a configuration rather than creating one.

files If this variable is non-empty following the per-target: section, then each word in it's value will be the target of a symbolic link named in the links variable.

links If the files variable is non-empty following the per-target: section, then symbolic links will be created with the first word of links pointing to the first word of files, the second word of links pointing to the second word of files, and so on.

Per invocation
--------------

Everything from the start of configure.in up to a line beginning with # Per-host: is sourced by configure as a shell script fragment immediately after parsing command line arguments.  The variables srctrigger and srcname must be set here.

Some other things you might want to set here are the variables configdirs or target_dependent.  FIXME-soon. target_dependent isn't useful without multiple targets.

On a host basis
---------------

The per-host section of configure.in starts with a line beginning with # Per-host: and ends before a line beginning with with # Per-target:.  Configure sources the per-host section once for each host.

This section usually contains a big case statement using the variables host_cpu, host_vendor, and host_os to determine appropriate values for host_makefile_frag and files, although files is not usually set here.  Usually, it is set at the end of the per-target section after determining the names of the target specific configuration files.

On a target basis
-----------------

The per-target section of configure.in starts with a line beginning with # Per-target: and ends before a line beginning with # Post-target: if it exists.  Otherwise the per-target section extends to the end of the file.  Configure sources the per-target section once for each target before building any files, directories, or links.

This section usually contains a big case statement using the variables target_cpu, target_vendor, and target_os to determine appropriate values for target_makefile_frag and files. The last lines in the per-target section normally set the variables files and links.

After each target
-----------------

The post-target section is optional.  If it exists, the post-target section starts with a line beginning with # Post-target: and extends to the end of the file.  If it exists, configure sources this section once for each target after building all files, directories, or links.

This section seldom exists but can be used to munge the configure generated Makefile.

An example configure.in
-----------------------

Here is a small example configure.in.

     # This file is a shell script fragment that supplies the information
     # necessary to tailor a template configure script into the configure
     # script appropriate for this directory.  For more information, check
     # any existing configure script.

     configdirs=
     srctrigger=warshall.c
     srcname="bison"

     # per-host:
     case "${host_os}" in
     m88kbcs)
     	host_makefile_frag=config/mh-delta88
     	;;
     esac

     # per-target:

     files="bison_in.hairy"
     links="bison.hairy"

     # post-target:

config.status
=============

The final step in configuring a directory is to create an executable shell script call config.status.  This file is typically used to rebuild the Makefile for the current directory.  For this reason, config.status uses the -norecursion option to configure and is therefor probably inappropriate for actually reconfiguring a tree of source code.

Makefile Fragments
==================

Cygnus configure uses three types of Makefile fragments.  In a generated Makefile they occur in the order target fragment, host fragment, and site fragment.  This is so host fragments can override target fragments etc.

Host specific Makefile fragments conventionally reside in the ./config directory with names of the form mh-HOST.  They are used for hosts that require odd options to the standard compiler and for compile time options based on the host configuration.

Target specific Makefile fragments conventionally reside in the ./config directory with names of the form mt-TARGET. They are used for target dependent compile time options.

Site specific Makefile fragments conventionally reside in the ./config directory with names of the form ms-SITE. They are used to override host and target independent compile time options.  Note that these options can also be overridden on the make invocation line.

Known Bugs
**********

The following bugs are known to exist.

  * There is no way to query about known hosts, known targets, or the porting or testing status of any configuration.

  * The negations to the options -gas, -x, and -nfp are not available.