[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
By 1992, four different systems had been developed to help with source code portability:
These systems all split building a program into two steps: a
configuration step, and a build step. For all the systems, the build
step used the standard Unix make
program. The make
program reads a set of rules in a ‘Makefile’, and uses them to
build a program. The configuration step would generate
‘Makefile’s, and perhaps other files, which would then be used
during the build step.
Metaconfig and Autoconf both use feature tests to determine the capabilities of the system. They use Bourne shell scripts (all variants of Unix support the Bourne shell in one form or another) to run various tests to see what the system can support.
The Cygnus ‘configure’ script and the original GCC
‘configure’ script are also Bourne shell scripts. They rely on
little configuration files for each system variant, both header files
and ‘Makefile’ fragments. In early versions, the user compiling
the program had to tell the script which type of system the program
should be built for; they were later enhanced with a shell script
written by Per Bothner which determines the system type based on the
standard Unix uname
program and other information.
Imake is a portable C program. Imake can be customized for a particular system, and run as part of building a package. However, it is more normally distributed with a package, including all the configuration information needed for supported systems.
Metaconfig and Autoconf are programs used by program authors. They produce a shell script which is distributed with the program’s source code. A user who wants to build the program runs the shell script in order to configure the source code for the particular system on which it is to be built.
The Cygnus and GCC ‘configure’ scripts, and imake
,
do not have this clear distinction between use by the developer and use
by the user.
The Cygnus and GCC ‘configure’ scripts included features to support cross development, both to support building a cross-compiler which compiles code to be run on another system, and to support building a program using a cross-compiler.
Autoconf, Metaconfig and Imake did not have these features (they were later added to Autoconf); they only worked for building a program on the system on which it was to run.
The scripts generated by Metaconfig are interactive by default: they ask questions of the user as they go along. This permits them to determine certain characteristics of the system which it is difficult or impossible to test, such as the behavior of setuid programs.
The Cygnus and GCC ‘configure’ scripts, and the scripts
generated by autoconf
, and the imake
program, are
not interactive: they determine everything themselves. When using
Autoconf, the package developer normally writes the script to accept
command line options for features which can not be tested for, or
sometimes requires the user to edit a header file after the
‘configure’ script has run.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by Ben Elliston on July 10, 2015 using texi2html 1.82.