Here we describe the backend support.
The following additions to the GNU coding standards are required for Cygnus configure to work properly.
####
.
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 they are documented here for completeness.
info
install-info
clean-info
stage1
stage2
stage3
stage4
de-stage1
de-stage2
de-stage3
de-stage4
bootstrap
comparison
Makefile
In addition, the following Makefile targets have revised semantics:
install
all
. If the program is
not already built, make install
should fail. This allows you
to install programs 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
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 allwill fail because of intermediate files intended for host1.
Cygnus adds the following macros to all `Makefile.in' files, but you are not required to use them to run Cygnus configure.
docdir
includedir
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. Most of them describe installation directories; see also section Full descriptions of all installation subdirectories.
manext
manext
?
datadir
mandir
mandir
depends on prefix
.
infodir
infodir
depends on prefix
.
BISON
yacc
calling convention. To use
bison
, use BISON=bison -y
.
Cygnus Makefiles also conform to one additional restriction:
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.
A `configure.in' file for Cygnus configure consists of a
per-invocation 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,
which is sourced by the configure shell script at an appropriate time.
Values are passed among configure and the shell fragments through a
set of shell variables. When each section is being interpreted
(sourced) by the shell, the shell's current directory is the build
directory, and any files created by the section (or referred to by the
section) will be relative to the build directory. To reference files
in other places (such as the source directory), prepend a shell
variable such as srcdir
to the desired file name.
The beginning of the `configure.in' file begins the per-invocation section.
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' 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.
The following variables pass information between the standard parts of
configure
and the shell-script fragments in `configure.in':
srctrigger
does not
exist, configure uses the value of this variable when it prints the
error message.
configure
should
recur. You must usually set this in the per-invocation 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
(if subdirs
is empty). This can
be used to determine which directories to configure and build depending
on the host and target configurations.
Use configdirs
(instead of the subdirs
variable
described below) if you want to be able to partition the
sub-directories, or use independent Makefile fragments.
Each sub-directory can be independent, and independently re-configured.
configure
should
create a Makefile
(in addition to the current directory),
without recursively running configure
.
Use subdirs
(instead of the configdirs
variable
described above) if you want to configure all of the directories
as a unit. Since there is a single invocation of configure
that configures many directories, all the directories can use the
same Makefile fragments, and the same configure.in
.
cpu-vendor-os
There are separate variables host_cpu
, host_vendor
, and
host_os
that you can use to test each of the three parts; this
variable is useful, however, for error messages, and for testing
combinations of the three components.
cpu-vendor-os
There are separate variables target_cpu
, target_vendor
, and
target_os
that you can use to test each of the three parts; this
variable is useful, however, for error messages, and for testing
combinations of the three components.
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 differ from the system where the program is running.
no
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.
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.
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.
-srcdir=
option. Note that srcdir
is not necessarily
an absolute path.
srcdir
to be included in the resulting Makefile. If
the named file does not exist, configure
will print a warning
message. This variable is not set by configure
.
srcdir
, to be included in the resulting
Makefile. If the named file does not exist, configure
will print
a warning message. This variable is not set by configure
.
site_makefile_frag
is empty, but will have a
value if the user specified -site=
on the command line. It is
probably not a good idea to override this variable from
`configure.in', since that may defeat the configure
user's
intentions.
-rm
on the command line. That is, if removing
is non-empty, then configure is removing a configuration rather
than creating one.
per-target:
section,
then each word in its value will be the target of a symbolic link named
in the corresponding word from the links
variable.
files
variable is non-empty following the
per-target:
section, then configure
creates symbolic links
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.
configure
sources the entire shell script fragment from the start
of `configure.in' up to a line beginning with `# Per-host:'
immediately after parsing command line arguments. The variables
srctrigger
and srcname
must be set here.
You might also want to set the variable configdirs
here.
The per-host section of `configure.in' starts with the line that begins
with `# Per-host:' and ends before a line beginning 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.
The per-target section of `configure.in' starts with the line that
begins with `# Per-target:' and ends before the line that begins
with `# Post-target:', if there is such a line. 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 called
`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
.
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 is seldom needed, but you can use it to edit the Makefile
generated by configure
.
Here is a small example of a `configure.in' file.
# This file is a collection of shell script fragments used to tailor # a template configure script as appropriate for this directory. # For more information, see configure.texi. 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, `config.status'. The main purpose of this file
is to allow the Makefile for the current directory to rebuild itself, if
necessary. For this reason, `config.status' uses the
`-norecursion' option to configure
, and is therefore
probably inappropriate for reconfiguring a tree of source code.
Cygnus configure
uses three types of Makefile fragments. In a
generated Makefile they appear in the order target fragment, host
fragment, and site fragment. This allows host fragments to override
target fragments, and site fragments to override both.
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 you can also override these options on the
make
invocation line.