From: Stepan Kasal Date: Sat, 1 Apr 2006 15:58:43 +0000 (+0000) Subject: Fix line numbers in the error messages of autoupdate. X-Git-Tag: AUTOCONF-2.59c~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=335e09466c32dc49fb192284c7f8efb1995d65ce;p=thirdparty%2Fautoconf.git Fix line numbers in the error messages of autoupdate. --- diff --git a/ChangeLog b/ChangeLog index 1f1fb2d27..876f7a86c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-04-01 Ralf Wildenhues + + * bin/autoupdate.in: Redefine m4_location so that warnings print + the correct lines of the input file by subtracting.. + (_au__first_line): ..this new definition. + 2006-04-01 Ralf Wildenhues * lib/autoconf/general.m4 (AC_COMPILE_CHECK): Prefer diff --git a/bin/autoupdate.in b/bin/autoupdate.in index 7ec8c1cb9..ef1e7bf63 100644 --- a/bin/autoupdate.in +++ b/bin/autoupdate.in @@ -288,6 +288,9 @@ foreach my $file (@ARGV) # Redefine __file__ to make warnings nicer; $file is replaced below. m4_define([__file__], [$file]) + # Redefine m4_location to fix the line number. + m4_define([m4_location], [__file__:m4_eval(__line__ - _au__first_line)]) + # Move all the builtins into the `_au_' pseudo namespace m4_include([m4save.m4]) @@ -373,11 +376,11 @@ foreach my $file (@ARGV) # `_au_disable' would be wrong. _au__include([unm4.m4]) - # Disable special characters. + # Disable special characters, and set the first line number. _au_m4_changequote() _au_m4_changecom() - _au__divert(0)_au_dnl + _au_m4_define(_au__first_line, _au___line__)_au__divert(0)_au_dnl EOF $input_m4 =~ s/^ //mg;