39 |
my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; |
my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; |
40 |
my $autoconf = "$autom4te --language=autoconf"; |
my $autoconf = "$autom4te --language=autoconf"; |
41 |
# We need to find m4sugar. |
# We need to find m4sugar. |
42 |
|
my @prepend_include; |
43 |
my @include = ('@datadir@'); |
my @include = ('@datadir@'); |
44 |
my $force = 0; |
my $force = 0; |
45 |
# m4. |
# m4. |
59 |
-V, --version print version number, then exit |
-V, --version print version number, then exit |
60 |
-v, --verbose verbosely report processing |
-v, --verbose verbosely report processing |
61 |
-d, --debug don't remove temporary files |
-d, --debug don't remove temporary files |
62 |
-I, --include=DIR look for input files in DIR (cumulative) |
-B, --prepend-include=DIR prepend directory DIR to search path |
63 |
|
-I, --include=DIR append directory DIR to search path |
64 |
-f, --force consider all files obsolete |
-f, --force consider all files obsolete |
65 |
|
|
66 |
Report bugs to <bug-autoconf\@gnu.org>. |
Report bugs to <bug-autoconf\@gnu.org>. |
89 |
my $srcdir; |
my $srcdir; |
90 |
|
|
91 |
getopt ('I|include|A|autoconf-dir|m|macrodir|l|localdir=s' => \@include, |
getopt ('I|include|A|autoconf-dir|m|macrodir|l|localdir=s' => \@include, |
92 |
|
'B|prepend-include=s' => \@prepend_include, |
93 |
'f|force' => \$force); |
'f|force' => \$force); |
94 |
|
|
95 |
if (! @ARGV) |
if (! @ARGV) |
229 |
$autoconf .= " --force" if $force; |
$autoconf .= " --force" if $force; |
230 |
$autoconf .= " --verbose" if $verbose; |
$autoconf .= " --verbose" if $verbose; |
231 |
$autoconf .= join (' --include=', '', @include); |
$autoconf .= join (' --include=', '', @include); |
232 |
|
$autoconf .= join (' --prepend-include=', '', @prepend_include); |
233 |
|
|
234 |
mktmpdir ('au'); |
mktmpdir ('au'); |
235 |
handle_m4_macros; |
handle_m4_macros; |
386 |
or die "$me: cannot close $tmp/input.m4: $!\n"; |
or die "$me: cannot close $tmp/input.m4: $!\n"; |
387 |
|
|
388 |
# Now ask m4 to perform the update. |
# Now ask m4 to perform the update. |
389 |
# M4 and I don't agree on the associativity of `--include': reverse! |
xsystem ("$m4 --include=$tmp" |
390 |
xsystem ("$m4" |
. join (' --include=', '', reverse (@prepend_include)) |
391 |
. join (' --include=', '', reverse (@include, $tmp)) |
. join (' --include=', '', @include) |
392 |
. " $tmp/input.m4 >$tmp/updated"); |
. " $tmp/input.m4 >$tmp/updated"); |
393 |
update_file ("$tmp/updated", |
update_file ("$tmp/updated", |
394 |
"$file" eq "$tmp/stdin" ? '-' : "$file"); |
"$file" eq "$tmp/stdin" ? '-' : "$file"); |