if 0;
# autom4te - Wrapper around M4 libraries.
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright 2001, 2002 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Run GNU M4 on the FILES, avoiding useless runs. If tracing, the output
consists of the traces only, otherwise output the expansion of the FILES.
-The first of the FILES may be an M4 frozen file, but then must end in \`.m4f\'.
+
+If some of the FILES are named \`FILE.m4f\' they are considered to be M4
+frozen files of all the previous files (which are therefore not loaded).
+If \`FILE.m4f\' is not found, then \`FILE.m4\' will be used, together with
+all the previous files.
+
Some files may be optional, i.e., will only be processed if found in the
include path, but then must end in \`.m4?\'; the question mark is not part of
the actual file name.
autom4te (@PACKAGE_NAME@) @VERSION@
Written by Akim Demaille.
-Copyright 2001 Free Software Foundation, Inc.
+Copyright 2001, 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
EOF
}
} while @language;
- debug "arguments: @ARGV\n";
-
# Process the arguments for real this time.
my @trace;
getopt
map { $m4_builtin_alternate_name{$_} }
grep { exists $m4_builtin_alternate_name{$_} } @preselect);
- # Only the first file can be frozen, but M4 doesn't complain if this
- # constraint is not honored.
- die "$me: the first file only can be frozen\n"
- if grep { /\.m4f/ } @ARGV[1 .. $#ARGV];
-
- $ARGV[0] =~ s/\.m4f$/.m4/
- if $melt;
-
+ # If we find frozen files, then all the files before it are
+ # discarded: the frozen file is supposed to include them all.
+ #
# We don't want to depend upon m4's --include to find the top level
- # files. Try to get a canonical name, as it's part of the key for
- # caching. And some files are optional.
- @ARGV = grep { defined $_ } map { find_file ($_, @include) } @ARGV;
+ # files, so we use `find_file' here. Try to get a canonical name,
+ # as it's part of the key for caching. And some files are optional
+ # (also handled by `find_file').
+ my @argv;
+ foreach (@ARGV)
+ {
+ if (/\.m4f$/)
+ {
+ # Frozen files are optional => pass a `?' to `find_file'.
+ my $file = find_file ("$_?", @include);
+ if (!$melt && $file)
+ {
+ @argv = ("--reload-state=$file");
+ }
+ else
+ {
+ s/\.m4f$/.m4/;
+ push @argv, find_file ($_, @include);
+ }
+ }
+ else
+ {
+ my $file = find_file ($_, @include);
+ push @argv, $file
+ if $file;
+ }
+ }
+ @ARGV = @argv;
}
{
my ($req, @macro) = @_;
- my $files;
- foreach (@ARGV)
- {
- $files .= ' ';
- $files .= '--reload-state='
- if /\.m4f$/;
- $files .= "$_";
- }
-
# The warnings are the concatenation of 1. application's defaults,
# 2. $WARNINGS, $3 command line options, in that order.
# Set them in the order expected by the M4 macros: the converse.
. ' --debug=aflq'
. " --error-output=$tcache" . $req->id
. join (' --trace=', '', sort @macro)
- . $files
+ . " @ARGV"
. ' </dev/null'
. " >$ocache" . $req->id);
verbose "running: $command";
# Definition of macro sets. -*- Makefile -*-
#
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright 2001, 2002 Free Software Foundation, Inc.
#
# This file is part of GNU Autoconf.
#
args: --language Automake-preselections
args: --language Autoreconf-preselections
args: --language Autoscan-preselections
+args: --language M4sh
end-language: "Autoconf"
begin-language: "Autotest"
# patterns: *.at
args: --include @datadir@
-args: autotest/autotest.m4
+args: autotest/autotest.m4f
args: package.m4?
args: --mode 777
args: --warning syntax
+args: --language M4sh
end-language: "Autotest"
begin-language: "M4sh"
# patterns: *.as
args: --include @datadir@
-args: m4sugar/m4sh.m4
+args: m4sugar/m4sh.m4f
args: --mode 777
args: --warning syntax
+args: --language M4sugar
end-language: "M4sh"
begin-language: "M4sugar"
# patterns: *.msh
args: --include @datadir@
-args: m4sugar/m4sugar.m4
+args: m4sugar/m4sugar.m4f
args: --warning syntax
end-language: "M4sugar"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.25.
-.TH AUTOM4TE "1" "January 2002" "autom4te 2.52h" "User Commands"
+.TH AUTOM4TE "1" "February 2002" "autom4te 2.52h" "User Commands"
.SH NAME
autom4te \- Generate files and scripts thanks to M4
.SH SYNOPSIS
.SH DESCRIPTION
Run GNU M4 on the FILES, avoiding useless runs. If tracing, the output
consists of the traces only, otherwise output the expansion of the FILES.
-The first of the FILES may be an M4 frozen file, but then must end in `.m4f'.
+.PP
+If some of the FILES are named `FILE.m4f' they are considered to be M4
+frozen files of all the previous files (which are therefore not loaded).
+If `FILE.m4f' is not found, then `FILE.m4' will be used, together with
+all the previous files.
+.PP
Some files may be optional, i.e., will only be processed if found in the
include path, but then must end in `.m4?'; the question mark is not part of
the actual file name.
.SH AUTHOR
Written by Akim Demaille.
.PP
-Copyright 2001 Free Software Foundation, Inc.
+Copyright 2001, 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.SH "REPORTING BUGS"