called out of order.
To encourage consistency, here is a suggested order for calling the
-Autoconf macros.
+Autoconf macros. Generally speaking, the things near the end of this
+list could depend on things earlier in it. For example, library
+functions could be affected by typedefs and libraries.
@display
@group
@code{AC_INIT(@var{file})}
-checks for alternative programs
+checks for programs
checks for libraries
checks for header files
checks for typedefs
-checks for library functions
checks for structures
checks for compiler characteristics
+checks for library functions
checks for system services
@code{AC_OUTPUT(@r{[}@var{file@dots{}}@r{]})}
@end group
@section Why Not Imake?
@display
-Why not use Imake, instead of @code{configure} scripts?
+Why not use Imake instead of @code{configure} scripts?
@end display
-Several people have written addressing this question, so I will include
+Several people have written addressing this question, so I include
adaptations of their explanations here.
The following answer is based on one written by Richard Pixley:
Here is some further explanation, written by Per Bothner:
One of the advantages of Imake is that it easy to generate large
-Makefiles using cpp's @samp{#include} and macro mechanisms. However,
-cpp is not programmable: it has limited conditional facilities, and no
-looping. And cpp cannot inspect its environment.
+Makefiles using @code{cpp}'s @samp{#include} and macro mechanisms.
+However, @code{cpp} is not programmable: it has limited conditional
+facilities, and no looping. And @code{cpp} cannot inspect its
+environment.
-All of these problems are solved by using @file{/bin/sh} instead of cpp.
-The shell is fully programmable, has macro substitution, can execute (or
-source) other shell scripts, and can inspect its environment.
+All of these problems are solved by using @code{sh} instead of
+@code{cpp}. The shell is fully programmable, has macro substitution,
+can execute (or source) other shell scripts, and can inspect its
+environment.
Paul Eggert elaborates more:
package's author (rather than the installer) does the preprocessing in a
standard way.
+Finally, Mark Eichin notes:
+
+Imake isn't all that extensible, either. In order to add new features to
+Imake, you need to provide you own project template, and duplicate most
+of the features of the existing one. This means that for a sophisticated
+project, using the vendor-provided Imake templates fails to provide any
+leverage---since they don't cover anything that your own project needs
+(unless it is an X11 program).
+
+On the other side, though:
+
+The one advantage that Imake has over @code{configure}:
+@file{Imakefile}s tend to be much shorter (likewise, less redundant)
+than @file{Makefile.in}s. There is a fix to this, however---at least
+for the Kerberos V5 tree, we've modified things to call in common
+@file{post.in} and @file{pre.in} @file{Makefile} fragments for the
+entire tree. This means that a lot of common things don't have to be
+duplicated, even though they normally are in @code{configure} setups.
+
@node Upgrading, History, Questions, Top
@chapter Upgrading From Version 1
and converted many GNU packages to use it. I was surprised by how
positive the reaction to it was. More people started using it than I
could keep track of, including people working on software that wasn't
-part of the GNU Project (such as TCL, FSP, and Kerberos v5).
+part of the GNU Project (such as TCL, FSP, and Kerberos V5).
Autoconf continued to improve rapidly, as many people using the
@code{configure} scripts reported problems they encountered.
sub parse_args
{
local ($usage) =
- "Usage: $0 [--macrodir=dir] [--help] [--verbose] [--version] [srcdir]\n";
+ "Usage: autoscan [--macrodir=dir] [--help] [--verbose] [--version] [srcdir]\n";
foreach $_ (@ARGV) {
if (/^--m[a-z]*=(.*)/) {
{
local ($word);
- print CONF "dnl Checks for identifiers.\n";
+ print CONF "dnl Checks for typedefs, structures, and compiler characteristics.\n";
foreach $word (sort keys %identifiers) {
&print_unique($identifiers_macros{$word});
}
{
local ($word);
- print CONF "dnl Checks for functions.\n";
+ print CONF "dnl Checks for library functions.\n";
foreach $word (sort keys %functions) {
if ($functions_macros{$word} eq 'AC_CHECK_FUNCS') {
push(@have_funcs, $word);
sub parse_args
{
local ($usage) =
- "Usage: $0 [--macrodir=dir] [--help] [--verbose] [--version] [srcdir]\n";
+ "Usage: autoscan [--macrodir=dir] [--help] [--verbose] [--version] [srcdir]\n";
foreach $_ (@ARGV) {
if (/^--m[a-z]*=(.*)/) {
{
local ($word);
- print CONF "dnl Checks for identifiers.\n";
+ print CONF "dnl Checks for typedefs, structures, and compiler characteristics.\n";
foreach $word (sort keys %identifiers) {
&print_unique($identifiers_macros{$word});
}
{
local ($word);
- print CONF "dnl Checks for functions.\n";
+ print CONF "dnl Checks for library functions.\n";
foreach $word (sort keys %functions) {
if ($functions_macros{$word} eq 'AC_CHECK_FUNCS') {
push(@have_funcs, $word);
sub parse_args
{
local ($usage) =
- "Usage: $0 [--macrodir=dir] [--help] [--verbose] [--version] [srcdir]\n";
+ "Usage: autoscan [--macrodir=dir] [--help] [--verbose] [--version] [srcdir]\n";
foreach $_ (@ARGV) {
if (/^--m[a-z]*=(.*)/) {
{
local ($word);
- print CONF "dnl Checks for identifiers.\n";
+ print CONF "dnl Checks for typedefs, structures, and compiler characteristics.\n";
foreach $word (sort keys %identifiers) {
&print_unique($identifiers_macros{$word});
}
{
local ($word);
- print CONF "dnl Checks for functions.\n";
+ print CONF "dnl Checks for library functions.\n";
foreach $word (sort keys %functions) {
if ($functions_macros{$word} eq 'AC_CHECK_FUNCS') {
push(@have_funcs, $word);
do
sed -n '
# Remove comments. Not perfect, but close enough.
-s,/\*[^/]*\*/,,g
+s%/\*[^/]*\*/%%g
# Comments that end on a later line.
-s,/\*[^/]*,,g
+s%/\*[^/]*%%g
/^[ ]*#[ ]*ifn*def[ ][ ]*\([A-Za-z0-9_]*\).*/s//\1/p
/^[ ]*#[ ]*e*l*if[ ]/{
s///
/g
p
}
-' $arg | sort -u | sed 's,$, '$arg','
+' $arg | sort -u | sed 's%$% '$arg'%'
done | awk '
{ files[$1] = files[$1] " " $2 }
END { for (sym in files) print sym files[sym] }' | sort
called out of order.
To encourage consistency, here is a suggested order for calling the
-Autoconf macros.
+Autoconf macros. Generally speaking, the things near the end of this
+list could depend on things earlier in it. For example, library
+functions could be affected by typedefs and libraries.
@display
@group
@code{AC_INIT(@var{file})}
-checks for alternative programs
+checks for programs
checks for libraries
checks for header files
checks for typedefs
-checks for library functions
checks for structures
checks for compiler characteristics
+checks for library functions
checks for system services
@code{AC_OUTPUT(@r{[}@var{file@dots{}}@r{]})}
@end group
@section Why Not Imake?
@display
-Why not use Imake, instead of @code{configure} scripts?
+Why not use Imake instead of @code{configure} scripts?
@end display
-Several people have written addressing this question, so I will include
+Several people have written addressing this question, so I include
adaptations of their explanations here.
The following answer is based on one written by Richard Pixley:
Here is some further explanation, written by Per Bothner:
One of the advantages of Imake is that it easy to generate large
-Makefiles using cpp's @samp{#include} and macro mechanisms. However,
-cpp is not programmable: it has limited conditional facilities, and no
-looping. And cpp cannot inspect its environment.
+Makefiles using @code{cpp}'s @samp{#include} and macro mechanisms.
+However, @code{cpp} is not programmable: it has limited conditional
+facilities, and no looping. And @code{cpp} cannot inspect its
+environment.
-All of these problems are solved by using @file{/bin/sh} instead of cpp.
-The shell is fully programmable, has macro substitution, can execute (or
-source) other shell scripts, and can inspect its environment.
+All of these problems are solved by using @code{sh} instead of
+@code{cpp}. The shell is fully programmable, has macro substitution,
+can execute (or source) other shell scripts, and can inspect its
+environment.
Paul Eggert elaborates more:
package's author (rather than the installer) does the preprocessing in a
standard way.
+Finally, Mark Eichin notes:
+
+Imake isn't all that extensible, either. In order to add new features to
+Imake, you need to provide you own project template, and duplicate most
+of the features of the existing one. This means that for a sophisticated
+project, using the vendor-provided Imake templates fails to provide any
+leverage---since they don't cover anything that your own project needs
+(unless it is an X11 program).
+
+On the other side, though:
+
+The one advantage that Imake has over @code{configure}:
+@file{Imakefile}s tend to be much shorter (likewise, less redundant)
+than @file{Makefile.in}s. There is a fix to this, however---at least
+for the Kerberos V5 tree, we've modified things to call in common
+@file{post.in} and @file{pre.in} @file{Makefile} fragments for the
+entire tree. This means that a lot of common things don't have to be
+duplicated, even though they normally are in @code{configure} setups.
+
@node Upgrading, History, Questions, Top
@chapter Upgrading From Version 1
and converted many GNU packages to use it. I was surprised by how
positive the reaction to it was. More people started using it than I
could keep track of, including people working on software that wasn't
-part of the GNU Project (such as TCL, FSP, and Kerberos v5).
+part of the GNU Project (such as TCL, FSP, and Kerberos V5).
Autoconf continued to improve rapidly, as many people using the
@code{configure} scripts reported problems they encountered.
do
sed -n '
# Remove comments. Not perfect, but close enough.
-s,/\*[^/]*\*/,,g
+s%/\*[^/]*\*/%%g
# Comments that end on a later line.
-s,/\*[^/]*,,g
+s%/\*[^/]*%%g
/^[ ]*#[ ]*ifn*def[ ][ ]*\([A-Za-z0-9_]*\).*/s//\1/p
/^[ ]*#[ ]*e*l*if[ ]/{
s///
/g
p
}
-' $arg | sort -u | sed 's,$, '$arg','
+' $arg | sort -u | sed 's%$% '$arg'%'
done | awk '
{ files[$1] = files[$1] " " $2 }
END { for (sym in files) print sym files[sym] }' | sort
do
sed -n '
# Remove comments. Not perfect, but close enough.
-s,/\*[^/]*\*/,,g
+s%/\*[^/]*\*/%%g
# Comments that end on a later line.
-s,/\*[^/]*,,g
+s%/\*[^/]*%%g
/^[ ]*#[ ]*ifn*def[ ][ ]*\([A-Za-z0-9_]*\).*/s//\1/p
/^[ ]*#[ ]*e*l*if[ ]/{
s///
/g
p
}
-' $arg | sort -u | sed 's,$, '$arg','
+' $arg | sort -u | sed 's%$% '$arg'%'
done | awk '
{ files[$1] = files[$1] " " $2 }
END { for (sym in files) print sym files[sym] }' | sort