Here is my proposal. I've tested it by s/configure.in/configure.ac/g
the test suite, and it works. I have not tested with a real package
yet though.
I was not sure where you would have preferred that automake detects
configure.ac vs configure.in: I've done this in scan_autoconf_files
(former scan_configure), but maybe the top level would have been
better.
I really apologize for the length of the patch, but I don't have
enough experience to know a priori how to segment my patch by stages.
So this is the whole stuff. It shouldn't be too hard to read though.
Akim
Index: ChangeLog
from Akim Demaille <[EMAIL PROTECTED]>
Let Automake support `configure.ac'.
* automake.in: In the comments, prefer `configure.ac' to
`configure.in'.
When using &am_conf_error, don't repeat `in configure.in', since
the function already reports it.
When referring to `configure.in' use `$configure_ac' instead.
(configure_ac): New global variable.
(scan_configure, scan_one_configure_file): Rename as...
(scan_autoconf_files, scan_one_autoconf_file): this.
(scan_autoconf_files): Compute $configure_ac.
(transform): New function.
(handle_configure): Use it to transform CONFIGURE_AC in
`remake.am' and in `remake-hdr.am'.
(common_files): Also consider `configure.ac'.
Use consistently single quotes.
* aclocal.in (configure_ac): New variable.
Use it.
* texi-vers.am: Depend on CONFIGURE_AC not configure.in.
* remake.am: Likewise.
* remake-hdr.am: Likewise.
Index: automake.texi
--- automake.texi Sat, 13 Jan 2001 18:11:09 +0100 akim (am/f/34_automake.t 1.1 644)
+++ automake.texi Sat, 13 Jan 2001 19:21:59 +0100 akim (am/f/34_automake.t 1.1 644)
@@ -112,7 +112,7 @@ @node Top, Introduction, (dir), (dir)
* Generalities:: General ideas
* Examples:: Some example packages
* Invoking Automake:: Creating a Makefile.in
-* configure:: Scanning configure.in
+* configure:: Scanning configure.ac or configure.in
* Top level:: The top-level Makefile.am
* Programs:: Building programs and libraries
* Other objects:: Other derived objects
@@ -131,8 +131,8 @@ @node Top, Introduction, (dir), (dir)
* Extending:: Extending Automake
* Distributing:: Distributing the Makefile.in
* Future:: Some ideas for the future
-* Macro and Variable Index::
-* General Index::
+* Macro and Variable Index::
+* General Index::
@end menu
@end ifinfo
@@ -166,7 +166,10 @@ @node Introduction, Generalities, Top, T
Automake does constrain a project in certain ways; for instance it
assumes that the project uses Autoconf (@pxref{Top, , Introduction,
autoconf, The Autoconf Manual}), and enforces certain restrictions on
-the @file{configure.in} contents.
+the @file{configure.in} contents@footnote{Autoconf 2.50 promotes
+@file{configure.ac} over @file{configure.in}. The rest of this
+documentation will refer to @file{configure.in} as this use is not yet
+spread, but Automake supports @file{configure.ac} too.}.
@cindex Automake requirements
@cindex Requirements, Automake
@@ -680,7 +683,7 @@ @node Hello, etags, Complete, Examples
@example
bin_PROGRAMS = hello
-hello_SOURCES = hello.c version.c getopt.c getopt1.c getopt.h system.h
+hello_SOURCES = hello.c version.c getopt.c getopt1.c getopt.h system.h
hello_LDADD = @@INTLLIBS@@ @@ALLOCA@@
localedir = $(datadir)/locale
INCLUDES = -I../intl -DLOCALEDIR=\"$(localedir)\"
@@ -1467,10 +1470,10 @@ @node Programs, Other objects, Top level
* A Shared Library:: Building a Libtool library
* Program variables:: Variables used when building a program
* Yacc and Lex:: Yacc and Lex support
-* C++ Support::
-* Fortran 77 Support::
+* C++ Support::
+* Fortran 77 Support::
* Java Support::
-* Support for Other Languages::
+* Support for Other Languages::
* ANSI:: Automatic de-ANSI-fication
* Dependencies:: Automatic dependency tracking
@end menu
@@ -1503,7 +1506,7 @@ @node A Program, A Library, Programs, Pr
into an executable:
@example
-hello_SOURCES = hello.c version.c getopt.c getopt1.c getopt.h system.h
+hello_SOURCES = hello.c version.c getopt.c getopt1.c getopt.h system.h
@end example
This causes each mentioned @samp{.c} file to be compiled into the
@@ -1866,13 +1869,13 @@ @node Yacc and Lex, C++ Support, Program
#define yylval c_lval
#define yychar c_char
#define yydebug c_debug
-#define yypact c_pact
-#define yyr1 c_r1
-#define yyr2 c_r2
-#define yydef c_def
-#define yychk c_chk
-#define yypgo c_pgo
-#define yyact c_act
+#define yypact c_pact
+#define yyr1 c_r1
+#define yyr2 c_r2
+#define yydef c_def
+#define yychk c_chk
+#define yypgo c_pgo
+#define yyact c_act
#define yyexca c_exca
#define yyerrflag c_errflag
#define yynerrs c_nerrs
@@ -1989,10 +1992,10 @@ @node Fortran 77 Support, Java Support,
These issues are covered in the following sections.
@menu
-* Preprocessing Fortran 77::
-* Compiling Fortran 77 Files::
-* Mixing Fortran 77 With C and C++::
-* Fortran 77 and Autoconf::
+* Preprocessing Fortran 77::
+* Compiling Fortran 77 Files::
+* Mixing Fortran 77 With C and C++::
+* Fortran 77 and Autoconf::
@end menu
@@ -2118,7 +2121,7 @@ @node Mixing Fortran 77 With C and C++,
@page
@menu
-* How the Linker is Chosen::
+* How the Linker is Chosen::
@end menu
@node How the Linker is Chosen, , Mixing Fortran 77 With C and C++, Mixing Fortran 77 With C and C++
Index: automake.in
--- automake.in Sat, 13 Jan 2001 18:11:09 +0100 akim (am/f/39_automake.i 1.1 755)
+++ automake.in Sat, 13 Jan 2001 20:18:33 +0100 akim (am/f/39_automake.i 1.1 755)
@@ -84,6 +84,8 @@
# Variables global to entire run.
+# Variables related to the options.
+
# TRUE if we should always generate Makefile.in.
$force_generation = 1;
@@ -116,10 +118,16 @@
# TRUE if we should always update files that we know about.
$force_missing = 0;
-# Files found by scanning configure.in for LIBOBJS.
+
+# Variables filled during files scanning.
+
+# Name of the top autoconf input: `configure.ac' or `configure.in'.
+$configure_ac = '';
+
+# Files found by scanning configure.ac for LIBOBJS.
%libsources = ();
-# True if AM_C_PROTOTYPES appears in configure.in.
+# True if AM_C_PROTOTYPES appears in configure.ac.
$am_c_prototypes = 0;
# Names used in AC_CONFIG_HEADER call. @config_fullnames holds the
@@ -130,7 +138,7 @@
@config_fullnames = ();
@config_names = ();
@config_headers = ();
-# Line number at which AC_CONFIG_HEADER appears in configure.in.
+# Line number at which AC_CONFIG_HEADER appears in configure.ac.
$config_header_line = 0;
# Directory where output files go. Actually, output files are
@@ -157,10 +165,10 @@
@config_aux_path = ('.', '..', '../..');
$config_aux_dir = '';
-# Whether AC_PROG_MAKE_SET has been seen in configure.in.
+# Whether AC_PROG_MAKE_SET has been seen in configure.ac.
$seen_make_set = 0;
-# Whether AM_GNU_GETTEXT has been seen in configure.in.
+# Whether AM_GNU_GETTEXT has been seen in configure.ac.
$seen_gettext = 0;
# Line number at which AM_GNU_GETTEXT seen.
$ac_gettext_line = 0;
@@ -175,7 +183,7 @@
# 1 if AC_PROG_INSTALL seen.
$seen_prog_install = 0;
-# Whether AC_PATH_XTRA has been seen in configure.in.
+# Whether AC_PATH_XTRA has been seen in configure.ac.
$seen_path_xtra = 0;
# TRUE if AC_DECL_YYTEXT was seen.
@@ -273,7 +281,7 @@
# Note that we do not handle this one, because it is still run
# from AM_CONFIG_HEADER. So we deal with it specially in
- # scan_configure.
+ # &scan_autoconf_files.
# 'AC_CONFIG_HEADER', "use \`AM_CONFIG_HEADER'",
'fp_C_PROTOTYPES', "use \`AM_C_PROTOTYPES'",
@@ -311,7 +319,7 @@
%language_map = ();
# This holds all the files that would go in `dist_common' which we
-# discovered while scanning configure.in. We might distribute these
+# discovered while scanning configure.ac. We might distribute these
# in the top-level Makefile.in.
%configure_dist_common = ();
@@ -385,8 +393,8 @@
# Parse command line.
&parse_arguments (@ARGV);
-# Do configure.in scan only once.
-&scan_configure;
+# Do configure.ac scan only once.
+&scan_autoconf_files;
die "automake: no \`Makefile.am' found or specified\n"
if ! @input_files;
@@ -404,7 +412,7 @@
}
}
-&am_conf_error ("AC_PROG_INSTALL must be used in configure.in")
+&am_conf_error ("AC_PROG_INSTALL must be used")
if (! $seen_prog_install);
exit $exit_status;
@@ -566,8 +574,8 @@ sub generate_makefile
# $OUTPUT is encoded. If it contains a ":" then the first element
# is the real output file, and all remaining elements are input
# files. We don't scan or otherwise deal with these input file,
- # other than to mark them as dependencies. See scan_configure for
- # details.
+ # other than to mark them as dependencies. See
+ # &scan_autoconf_files for details.
local (@secondary_inputs);
($output, @secondary_inputs) = split (/:/, $output);
@@ -672,7 +680,7 @@ sub generate_makefile
local ($am_time) = (stat ($makefile . '.am'))[9];
local ($in_time) = (stat ($out_file))[9];
# FIXME: should cache these times.
- local ($conf_time) = (stat ('configure.in'))[9];
+ local ($conf_time) = (stat ($configure_ac))[9];
# FIXME: how to do unsigned comparison?
if ($am_time < $in_time || $am_time < $conf_time)
{
@@ -878,7 +886,7 @@ sub get_object_extension
if (! $am_c_prototypes)
{
&am_line_error ('AUTOMAKE_OPTIONS',
- "option \`ansi2knr' in use but \`AM_C_PROTOTYPES' not in configure.in");
+ "option \`ansi2knr' in use but \`AM_C_PROTOTYPES' not in \`$configure_ac'");
&keyed_aclocal_warning ('AM_C_PROTOTYPES');
# Only give this error once.
$am_c_prototypes = 1;
@@ -1617,7 +1625,7 @@ sub handle_lib_objects_cond
if (! keys %libsources
&& ! &variable_defined ($1 . 'LIBOBJS'))
{
- &am_line_error ($var, "\@$1" . "LIBOBJS\@ seen but never set in \`configure.in'");
+ &am_line_error ($var, "\@$1" . "LIBOBJS\@ seen but never set in \`$configure_ac'");
}
local ($iter, $rewrite);
@@ -1656,7 +1664,7 @@ sub handle_lib_objects_cond
push (@dep_list, $lsearch);
&am_line_error ($var,
- "\@$1" . "ALLOCA\@ seen but \`AC_FUNC_ALLOCA' not in \`configure.in'")
+ "\@$1" . "ALLOCA\@ seen but \`AC_FUNC_ALLOCA' not in \`$configure_ac'")
if ! defined $libsources{'alloca.c'};
$dep_files{'$(DEPDIR)/alloca.P' . $myobjext} = 1;
&require_file_with_line ($var, $FOREIGN, 'alloca.c');
@@ -1707,7 +1715,7 @@ sub handle_programs
# If a program is installed, this is required. We only want this
# error to appear once.
- &am_conf_error ("AC_ARG_PROGRAM must be used in configure.in")
+ &am_conf_error ("AC_ARG_PROGRAM must be used")
unless $seen_arg_prog;
$seen_arg_prog = 1;
@@ -1847,7 +1855,7 @@ sub handle_libraries
{
if (&variable_defined ($key . '_LIBRARIES'))
{
- &am_line_error ($key . '_LIBRARIES', "library used but \`RANLIB' not defined in \`configure.in'");
+ &am_line_error ($key . '_LIBRARIES', "library used but \`RANLIB' not defined in \`$configure_am'");
# Only get this error once. If this is ever printed,
# we have a bug.
$configure_vars{'RANLIB'} = 'BUG';
@@ -1950,7 +1958,7 @@ sub handle_ltlibraries
{
if (!$seen_libtool)
{
- &am_line_error ($key . '_LTLIBRARIES', "library used but \`LIBTOOL' not defined in \`configure.in'");
+ &am_line_error ($key . '_LTLIBRARIES', "library used but \`LIBTOOL' not defined in \`$configure_ac'");
# Only get this error once. If this is ever printed,
# we have a bug.
$configure_vars{'LIBTOOL'} = 'BUG';
@@ -2140,7 +2148,7 @@ sub handle_scripts
{
# If a program is installed, this is required. We only want this
# error to appear once.
- &am_conf_error ("AC_ARG_PROGRAM must be used in configure.in")
+ &am_conf_error ("AC_ARG_PROGRAM must be used")
unless $seen_arg_prog;
$seen_arg_prog = 1;
}
@@ -2805,11 +2813,11 @@ sub handle_dist
}
}
- # Always require configure.in and configure at top level, even if
+ # Always require configure.ac and configure at top level, even if
# they don't exist. This is especially important for configure,
# since it won't be created until autoconf is run -- which might
# be after automake is run.
- &push_dist_common ('configure.in', 'configure')
+ &push_dist_common ($configure_ac, 'configure')
if $relative_dir eq '.';
# We might copy elements from %configure_dist_common to
@@ -3168,7 +3176,7 @@ sub handle_aclocal_m4
($seen_maint_mode
? "\@MAINTAINER_MODE_TRUE\@"
: "") ,
- "configure.in",
+ $configure_ac,
($acinclude ? ' acinclude.m4' : '')
);
@@ -3281,7 +3289,7 @@ sub handle_configure
. ': '
. ($seen_maint_mode ? "\@MAINTAINER_MODE_TRUE\@ " : '')
. $amfile . ' '
- . '$(top_srcdir)/configure.in $(ACLOCAL_M4)'
+ . '$(top_srcdir)/' . $configure_ac .' $(ACLOCAL_M4)'
. ' ' . join (' ', @include_stack)
. "\n"
. "\tcd \$(top_srcdir) && \$(AUTOMAKE) "
@@ -3312,8 +3320,10 @@ sub handle_configure
}
else
{
+ local ($xform) = &transform ("CONFIGURE_AC" => $configure_ac);
&handle_aclocal_m4;
- $output_rules .= &file_contents ('remake');
+ $output_rules .= &file_contents_with_transform ($xform,
+ 'remake');
&examine_variable ('CONFIG_STATUS_DEPENDENCIES');
&examine_variable ('CONFIGURE_DEPENDENCIES');
$top_reldir = '';
@@ -3432,14 +3442,15 @@ sub handle_configure
local ($xform) = '';
- $xform = 's,\@FILES\@,' . join (' ', @files) . ',;';
- $xform .= 's,\@CONFIG_HEADER\@,' . "${cn_sans_dir}" . ',;';
- $xform .= 's,\@CONFIG_HEADER_IN\@,' . "${ch_sans_dir}" . ',;';
- $xform .= 's,\@CONFIG_HEADER_FULL\@,' . "${one_fullname}" . ',;';
- $xform .= 's,\@STAMP\@,' . "${stamp_dir}${stamp_name}" . ',g;';
+ $xform = &transform ('CONFIGURE_AC' => $configure_ac,
+ 'FILES' => join (' ', @files),
+ 'CONFIG_HEADER' => $cn_sans_dir,
+ 'CONFIG_HEADER_IN' => $ch_sans_dir,
+ 'CONFIG_HEADER_FULL' => $one_fullname,
+ 'STAMP' => "$stamp_dir$stamp_name");
local ($out_dir) = &dirname ($ch_sans_dir);
- $xform .= 's,\@SRC_STAMP\@,' . "${out_dir}/${stamp_name}" . ',g;';
+ $xform .= &transform ('SRC_STAMP' => "${out_dir}/${stamp_name}");
$output_rules .= &file_contents_with_transform ($xform,
'remake-hdr');
@@ -3475,7 +3486,7 @@ sub handle_configure
}
&am_line_error ('CONFIG_HEADER',
- "\`CONFIG_HEADER' is an anachronism; now determined from \`configure.in'")
+ "\`CONFIG_HEADER' is an anachronism; now determined from \`$configure_ac'")
if &variable_defined ('CONFIG_HEADER');
local ($one_name);
@@ -3540,7 +3551,7 @@ sub handle_configure
if ($local eq 'stamp-h')
{
# FIXME: allow real filename.
- &am_conf_error ('configure.in', $ac_output_line,
+ &am_conf_error ($configure_ac, $ac_output_line,
'stamp-h should not appear in AC_OUTPUT');
next;
}
@@ -3589,7 +3600,7 @@ sub handle_gettext
if (! &variable_defined ('SUBDIRS'))
{
&am_conf_error
- ("AM_GNU_GETTEXT in configure.in but SUBDIRS not defined");
+ ("AM_GNU_GETTEXT used but SUBDIRS not defined");
return;
}
@@ -3599,11 +3610,11 @@ sub handle_gettext
{
&am_line_error
('SUBDIRS',
- "AM_GNU_GETTEXT in configure.in but \`po' not in SUBDIRS")
+ "AM_GNU_GETTEXT in \`$configure_ac' but \`po' not in SUBDIRS")
if $contents{'SUBDIRS'} !~ /\bpo\b/;
&am_line_error
('SUBDIRS',
- "AM_GNU_GETTEXT in configure.in but \`intl' not in SUBDIRS")
+ "AM_GNU_GETTEXT in \`$configure_ac' but \`intl' not in SUBDIRS")
if $contents{'SUBDIRS'} !~ /\bintl\b/;
}
@@ -3633,7 +3644,7 @@ sub handle_gettext
}
else
{
- &am_error ("AM_GNU_GETTEXT in configure.in but \`ALL_LINGUAS' not defined");
+ &am_error ("AM_GNU_GETTEXT in \`$configure_ac' but \`ALL_LINGUAS' not defined");
}
}
@@ -3810,7 +3821,7 @@ sub handle_merge_targets
}
}
- if (&variable_defined('lib_LTLIBRARIES') &&
+ if (&variable_defined('lib_LTLIBRARIES') &&
&variable_defined('bin_PROGRAMS'))
{
$output_rules .= "install-binPROGRAMS: install-libLTLIBRARIES\n\n";
@@ -4214,7 +4225,7 @@ sub handle_emacs_lisp
if (&variable_defined ('lisp_LISP'))
{
$varname = 'lisp_LISP';
- &am_error ("\`lisp_LISP' defined but \`AM_PATH_LISPDIR' not in \`configure.in'")
+ &am_error ("\`lisp_LISP' defined but \`AM_PATH_LISPDIR' not in \`$configure_ac'")
if ! $seen_lispdir;
}
else
@@ -4240,7 +4251,7 @@ sub handle_python
$output_rules .= &file_contents ('python-clean');
push (@clean, 'python');
- &am_error ("\`python_PYTHON' defined but \`AM_CHECK_PYTHON' not in \`configure.in'")
+ &am_error ("\`python_PYTHON' defined but \`AM_CHECK_PYTHON' not in \`$configure_ac'")
if ! $seen_pythondir && &variable_defined ('python_PYTHON');
if ($config_aux_dir eq '.' || $config_aux_dir eq '')
@@ -4305,7 +4316,7 @@ sub handle_minor_options
if ($package_version !~ /^$GNITS_VERSION_PATTERN$/)
{
# FIXME: allow real filename.
- &am_conf_line_error ('configure.in',
+ &am_conf_line_error ($configure_ac,
$package_version_line,
"version \`$package_version' doesn't follow Gnits standards");
}
@@ -4321,8 +4332,11 @@ sub handle_minor_options
################################################################
-# Scan one file for interesting things. Subroutine of scan_configure.
-sub scan_one_configure_file
+# &scan_one_autoconf_file ($FILENAME)
+# -----------------------------------
+# Scan one file for interesting things. Subroutine of
+# &scan_autoconf_files.
+sub scan_one_autoconf_file
{
local ($filename) = @_;
local (*CONFIGURE);
@@ -4346,7 +4360,7 @@ sub scan_one_configure_file
# Cygnus and hopefully nowhere else.
if (/sinclude\((.*)\)/ && -f $1)
{
- &scan_one_configure_file ($1);
+ &scan_one_autoconf_file ($1);
}
# Populate libobjs array.
@@ -4680,12 +4694,15 @@ sub scan_one_configure_file
close (CONFIGURE);
}
-# Scan configure.in and aclocal.m4 for interesting things. We must
-# scan aclocal.m4 because there might be AC_SUBSTs and such there.
-sub scan_configure
+# &scan_autoconf_files ()
+# -----------------------
+# Check whether we use `configure.ac' or `configure.in'.
+# Scan it (and possibly `aclocal.m4') for interesting things.
+# We must scan aclocal.m4 because there might be AC_SUBSTs and such there.
+sub scan_autoconf_files
{
# Reinitialize libsources here. This isn't really necessary,
- # since we currently assume there is only one configure.in. But
+ # since we currently assume there is only one configure.ac. But
# that won't always be the case.
%libsources = ();
@@ -4693,8 +4710,18 @@ sub scan_configure
local (%make_list, @make_input_list);
local ($libobj_iter);
- &scan_one_configure_file ('configure.in');
- &scan_one_configure_file ('aclocal.m4')
+ warn "automake: both \`configure.ac' and \`configure.in' present:"
+ . " ignoring \`configure.in'\n"
+ if -f 'configure.ac' && -f 'configure.in';
+ $configure_ac = 'configure.in'
+ if -f 'configure.in';
+ $configure_ac = 'configure.ac'
+ if -f 'configure.ac';
+ die "automake: \`configure.ac' or \`configure.in' is required\n"
+ if !$configure_ac;
+
+ &scan_one_autoconf_file ($configure_ac);
+ &scan_one_autoconf_file ('aclocal.m4')
if -f 'aclocal.m4';
# Set input and output files if not specified by user.
@@ -4706,12 +4733,12 @@ sub scan_configure
@configure_input_files = @make_input_list;
- &am_conf_error ("\`AM_INIT_AUTOMAKE' must be used in configure.in")
+ &am_conf_error ("\`AM_INIT_AUTOMAKE' must be used")
if ! $seen_init_automake;
# Always require AC_PROG_MAKE_SET. We might randomly use $(MAKE)
# for our own reasons.
- &am_conf_error ("\`AC_PROG_MAKE_SET' must be used in configure.in")
+ &am_conf_error ("\`AC_PROG_MAKE_SET' must be used")
if ! $seen_make_set;
# Look for some files we need. Always check for these. This
@@ -4831,7 +4858,7 @@ sub lang_c_rewrite
# Only give error once.
$seen_cc_c_o = 1;
# FIXME: line number.
- &am_error ("C objects in subdir but \`AM_PROG_CC_C_O' not in \`configure.in'");
+ &am_error ("C objects in subdir but \`AM_PROG_CC_C_O' not in \`$configure_ac'");
}
&require_file ($FOREIGN, 'compile')
@@ -5020,7 +5047,7 @@ sub lang_c_finish
if (! defined $configure_vars{'CC'})
{
# FIXME: line number.
- &am_error ("C source seen but \`CC' not defined in \`configure.in'");
+ &am_error ("C source seen but \`CC' not defined in \`$configure_ac'");
}
}
@@ -5033,7 +5060,7 @@ sub lang_cxx_finish
if (! defined $configure_vars{'CXX'})
{
- &am_error ("C++ source seen but \`CXX' not defined in \`configure.in'");
+ &am_error ("C++ source seen but \`CXX' not defined in \`$configure_ac'");
}
}
@@ -5108,7 +5135,7 @@ sub lang_yacc_finish
if (! defined $configure_vars{'YACC'})
{
- &am_error ("yacc source seen but \`YACC' not defined in \`configure.in'");
+ &am_error ("yacc source seen but \`YACC' not defined in \`$configure_ac'");
}
if (&variable_defined ('YACCFLAGS'))
{
@@ -5155,11 +5182,11 @@ sub lang_lex_finish
if (! defined $configure_vars{'LEX'})
{
- &am_error ("lex source seen but \`LEX' not defined in \`configure.in'");
+ &am_error ("lex source seen but \`LEX' not defined in \`$configure_ac'");
}
if (! $seen_decl_yytext)
{
- &am_error ("lex source seen but \`AC_DECL_YYTEXT' not in \`configure.in'");
+ &am_error ("lex source seen but \`AC_DECL_YYTEXT' not in \`$configure_ac'");
}
if ($lex_count > 1)
@@ -5191,7 +5218,7 @@ sub lang_f77_finish
if (! defined $configure_vars{'F77'})
{
- &am_error ("Fortran 77 source seen but \`F77' not defined in \`configure.in'");
+ &am_error ("Fortran 77 source seen but \`F77' not defined in \`$configure_ac'");
}
}
@@ -5238,7 +5265,7 @@ sub lang_objc_finish
if (! defined $configure_vars{'OBJC'})
{
- &am_error ("Objective C source seen but \`OBJC' not defined in \`configure.in'");
+ &am_error ("Objective C source seen but \`OBJC' not defined in \`$configure_ac'");
}
}
@@ -5251,7 +5278,7 @@ sub lang_java_finish
if (! defined $configure_vars{'GCJ'})
{
- &am_error ("Java source seen but \`GCJ' not defined in \`configure.in'");
+ &am_error ("Java source seen but \`GCJ' not defined in \`$configure_ac'");
}
}
@@ -6657,11 +6684,12 @@ sub initialize_global_constants
# DISTFILES.
@common_files =
(
- "README", "THANKS", "TODO", "NEWS", "COPYING", "COPYING.LIB",
- "INSTALL", "ABOUT-NLS", "ChangeLog", "configure", "configure.in",
- "config.guess", "config.sub", "AUTHORS", "BACKLOG", "ABOUT-GNU",
- "libversion.in", "mdate-sh", "mkinstalldirs", "install-sh",
- 'texinfo.tex', "ansi2knr.c", "ansi2knr.1", 'elisp-comp',
+ 'README', 'THANKS', 'TODO', 'NEWS', 'COPYING', 'COPYING.LIB',
+ 'INSTALL', 'ABOUT-NLS', 'ChangeLog', 'configure.ac',
+ 'configure.in', 'configure', 'config.guess', 'config.sub',
+ 'AUTHORS', 'BACKLOG', 'ABOUT-GNU', 'libversion.in',
+ 'mdate-sh', 'mkinstalldirs', 'install-sh', 'texinfo.tex',
+ 'ansi2knr.c', 'ansi2knr.1', 'elisp-comp',
# ltconfig appears here for compatibility with old versions
# of libtool.
'ylwrap', 'acinclude.m4', @libtoolize_files, @libtoolize_sometimes,
@@ -6671,8 +6699,8 @@ sub initialize_global_constants
# Commonly used files we auto-include, but only sometimes.
@common_sometimes =
(
- "aclocal.m4", "acconfig.h", "config.h.top",
- "config.h.bot", "stamp-h.in", 'stamp-vti'
+ 'aclocal.m4', 'acconfig.h', 'config.h.top',
+ 'config.h.bot', 'stamp-h.in', 'stamp-vti'
);
$USAGE = "\
@@ -7033,6 +7061,23 @@ sub file_contents
return &file_contents_with_transform ('', @_);
}
+# &transform (%PAIRS)
+# -------------------
+# Create a replacement expression suitable for file_contents_with_transform
+# to replace each key of %PAIRS by its value.
+sub transform
+{
+ local (%pairs) = @_;
+ local ($result) = '';
+
+ foreach $pattern (sort keys %pairs)
+ {
+ $result .= 's,\@' . $pattern . '\@,' . $pairs{$pattern} . ',g;';
+ }
+ print STDERR "transform: $result\n";
+ return $result;
+}
+
# Find all variable prefixes that are used for install directories. A
# prefix `zar' qualifies iff:
# * `zardir' is a variable.
@@ -7219,7 +7264,7 @@ sub am_install_var
}
}
# Check here to make sure variables defined in
- # configure.in do not imply that EXTRA_PRIMARY
+ # configure.ac do not imply that EXTRA_PRIMARY
# must be defined.
elsif (! defined $configure_vars{$one_name})
{
@@ -7575,7 +7620,7 @@ sub require_file_internal
if ($is_configure)
{
# FIXME: allow actual file to be specified.
- &am_conf_line_error ('configure.in', $line,
+ &am_conf_line_error ($configure_ac, $line,
"$message$trailer");
}
else
@@ -7589,7 +7634,7 @@ sub require_file_internal
}
# Like require_file_with_line, but error messages refer to
-# configure.in, not the current Makefile.am.
+# configure.ac, not the current Makefile.am.
sub require_file_with_conf_line
{
@require_file_paths = '.';
@@ -7643,7 +7688,7 @@ sub require_conf_file_with_line
}
}
-# Assumes that the line number is in configure.in.
+# Assumes that the line number is in configure.ac.
sub require_conf_file_with_conf_line
{
@require_file_paths = @config_aux_path;
@@ -7787,7 +7832,7 @@ sub am_line_error
}
elsif (defined $configure_vars{$symbol})
{
- # SYMBOL is a variable defined in configure.in, so add the
+ # SYMBOL is a variable defined in configure.ac, so add the
# appropriate line number.
$file = $configure_vars{$symbol};
}
@@ -7804,15 +7849,15 @@ sub am_line_error
}
}
-# Like am_error, but while scanning configure.in.
+# Like am_error, but while scanning configure.ac.
sub am_conf_error
{
# FIXME: can run in subdirs.
- warn "automake: configure.in: ", join (' ', @_), "\n";
+ warn "automake: $configure_ac: ", join (' ', @_), "\n";
$exit_status = 1;
}
-# Error message with line number referring to configure.in.
+# Error message with line number referring to configure.ac.
sub am_conf_line_error
{
local ($file, $line, @args) = @_;
@@ -7828,7 +7873,7 @@ sub am_conf_line_error
}
}
-# Warning message with line number referring to configure.in.
+# Warning message with line number referring to configure.ac.
# Does not affect exit_status
sub am_conf_line_warning
{
Index: aclocal.in
--- aclocal.in Sat, 13 Jan 2001 18:11:09 +0100 akim (am/f/41_aclocal.in 1.1 644)
+++ aclocal.in Sat, 13 Jan 2001 19:24:50 +0100 akim (am/f/41_aclocal.in 1.1 644)
@@ -2,7 +2,7 @@
# -*- perl -*-
# @configure_input@
-# aclocal - create aclocal.m4 by scanning configure.in
+# aclocal - create aclocal.m4 by scanning configure.ac
# Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -25,7 +25,7 @@
eval 'exec @PERL@ -S $0 ${1+"$@"}'
if 0;
-# aclocal - scan configure.in and generate aclocal.m4.
+# aclocal - scan configure.ac and generate aclocal.m4.
# Some constants.
$VERSION = "@VERSION@";
@@ -39,6 +39,9 @@
# Exit status.
$exit_status = 0;
+# Name of the top autoconf input: `configure.ac' or `configure.in'.
+$configure_ac = '';
+
# Text to output.
$output = '';
@@ -130,7 +133,9 @@ sub usage
local ($status) = @_;
print "Usage: aclocal [OPTIONS] ...\n\n";
- print "Generate aclocal.m4 by scanning configure.in\n
+ print "\
+Generate \`aclocal.m4' by scanning \`configure.ac' or \`configure.in'
+
--acdir=DIR directory holding config files
--help print this help, then exit
-I DIR add directory to search list for .m4 files
@@ -211,8 +216,18 @@ sub parse_arguments
sub scan_configure
{
- open (CONFIGURE, "configure.in")
- || die "aclocal: couldn't open \`configure.in': $!\n";
+ warn "aclocal: both \`configure.ac' and \`configure.in' present:"
+ . " ignoring \`configure.in'\n"
+ if -f 'configure.ac' && -f 'configure.in';
+ $configure_ac = 'configure.in'
+ if -f 'configure.in';
+ $configure_ac = 'configure.ac'
+ if -f 'configure.ac';
+ die "aclocal: \`configure.ac' or \`configure.in' is required\n"
+ if !$configure_ac;
+
+ open (CONFIGURE, $configure_ac)
+ || die "aclocal: couldn't open \`$configure_ac': $!\n";
# Make sure we include acinclude.m4 if it exists.
if (-f 'acinclude.m4')
@@ -233,7 +248,7 @@ sub scan_configure
{
$hint = '; ' . $obsolete_macros{$1};
}
- warn "aclocal: configure.in: $.: \`$1' is obsolete$hint\n";
+ warn "aclocal: $configure_ac: $.: \`$1' is obsolete$hint\n";
$exit_status = 1;
next;
}
@@ -243,7 +258,7 @@ sub scan_configure
if (! &search && /(^|\s+)(AM_[A-Z_]+)/)
{
# Macro not found, but AM_ prefix found.
- warn "aclocal: configure.in: $.: macro \`$2' not found in library\n";
+ warn "aclocal: $configure_ac: $.: macro \`$2' not found in library\n";
$exit_status = 1;
}
}
@@ -370,7 +385,7 @@ sub add_file
if (! &search && /(^|\s+)(AM_[A-Z_]+)/)
{
# Macro not found, but AM_ prefix found.
- warn "aclocal: configure.in: $.: macro \`$2' not found in library\n";
+ warn "aclocal: $configure_ac: $.: macro \`$2' not found in library\n";
$exit_status = 1;
}
}
Index: NEWS
--- NEWS Sat, 13 Jan 2001 18:11:09 +0100 akim (am/g/8_NEWS 1.1 644)
+++ NEWS Sat, 13 Jan 2001 19:16:33 +0100 akim (am/g/8_NEWS 1.1 644)
@@ -1,4 +1,5 @@
New in 1.4c:
+* Support for `configure.ac'.
New in 1.4b:
* Faster AM_INIT_AUTOMAKE (requires update of `missing' script)
@@ -36,7 +37,7 @@
Lex support in `missing', and new lex macro. Update your missing script.
* Built-in support for assembly
* aclocal gives error if `AM_' macro not found
-* Passed YFLAGS, not YACCFLAGS, to yacc
+* Passed YFLAGS, not YACCFLAGS, to yacc
* AM_PROG_CC_STDC does not have to come before AC_PROG_CPP
* Dependencies computed as a side effect of compilation
* Preliminary support for Java
Index: texi-vers.am
--- texi-vers.am Sat, 13 Jan 2001 18:11:09 +0100 akim (am/g/11_texi-vers. 1.1 644)
+++ texi-vers.am Sat, 13 Jan 2001 19:15:56 +0100 akim (am/g/11_texi-vers. 1.1 644)
@@ -18,9 +18,9 @@
$(srcdir)/@VTEXI@: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-@VTI@
@:
-## Depend on configure.in so that version number updates cause a
+## Depend on @CONFIGURE_AC@ so that version number updates cause a
## rebuild.
-$(srcdir)/stamp-@VTI@: @TEXI@ $(top_srcdir)/configure.in
+$(srcdir)/stamp-@VTI@: @TEXI@ $(top_srcdir)/@CONFIGURE_AC@
@(set `$(SHELL) @MDDIR@mdate-sh $(srcdir)/@TEXI@`; \
echo "@set UPDATED $$1 $$2 $$3"; \
echo "@set UPDATED-MONTH $$2 $$3"; \
@@ -44,4 +44,3 @@
maintainer-clean-@VTI@:
-@MAINTAINER_MODE_TRUE@rm -f $(srcdir)/stamp-@VTI@ $(srcdir)/@VTEXI@
-
Index: remake.am
--- remake.am Sat, 13 Jan 2001 18:11:09 +0100 akim (am/g/16_remake.am 1.1 644)
+++ remake.am Sat, 13 Jan 2001 19:15:31 +0100 akim (am/g/16_remake.am 1.1 644)
@@ -20,5 +20,5 @@
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
## Explicitly look in srcdir for benefit of non-GNU makes.
-$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/@CONFIGURE_AC@ $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
Index: remake-hdr.am
--- remake-hdr.am Sat, 13 Jan 2001 18:11:09 +0100 akim (am/g/17_remake-hdr 1.1 644)
+++ remake-hdr.am Sat, 13 Jan 2001 19:15:10 +0100 akim (am/g/17_remake-hdr 1.1 644)
@@ -42,7 +42,7 @@
rm -f $(srcdir)/@[email protected]; \
$(MAKE) $(srcdir)/@[email protected]; \
else :; fi
-$(srcdir)/@[email protected]: $(top_srcdir)/configure.in $(ACLOCAL_M4) @FILES@
+$(srcdir)/@[email protected]: $(top_srcdir)/@CONFIGURE_AC@ $(ACLOCAL_M4) @FILES@
@rm -f $(srcdir)/@[email protected] $(srcdir)/@[email protected]
## We used to try to get a real timestamp here. But the fear is that
## that will cause unnecessary cvs conflicts