automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCHES] Better error messages if obsolete macros are used


From: Stefano Lattarini
Subject: Re: [PATCHES] Better error messages if obsolete macros are used
Date: Mon, 31 Dec 2012 10:05:37 +0100

On 12/30/2012 07:08 PM, Paolo Bonzini wrote:
> Il 30/12/2012 11:23, Stefano Lattarini ha scritto:
>> +AC_DEFUN([AM_CONFIG_HEADER],
>> +[AC_FATAL(['$0': this macro is obsolete.
>> +    You should use the 'AC][_CONFIG_HEADERS' macro instead.])])
>> +
> 
> What's the point in doing this instead of
> 
> m4_defun([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS])
> 
> or something like that?
>
Issuing a fatal error will force users to upgrade to AC_CONFIG_HEADERS,
thus allowing us to remove AM_CONFIG_HEADER altogether in future
Automake versions (probably 1.15). 4, or maybe 1.15).

> Your patch is even longer than keeping backwards-compatibility...
> 
While this is true, consider that my new code is only meant to be
temporary, lasting few releases in order to smooth the transition
to the "blessed" AC_CONFIG_HEADERS.

It is probably worth to add comments explaining this to the
definitions in 'm4/obsolete-err.m4' file.  And do the same for
other obsolete/obsolescent constructs.  I intend to push the
patch below for that purpose.

---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ----

>From 3324c4a67dfc1643cfbb3c2262ffe75c7b04205d Mon Sep 17 00:00:00 2001
Message-Id: <address@hidden>
From: Stefano Lattarini <address@hidden>
Date: Mon, 31 Dec 2012 09:53:43 +0100
Subject: [PATCH] maint: state when compatibility cruft should be removed or
 warned about

* automake.in: Here.
* lib/Automake/Options.pm: And here.
* m4/obsolete-err.m4: And here.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 automake.in             | 6 ++++++
 lib/Automake/Options.pm | 3 +++
 m4/obsolete-err.m4      | 3 +++
 3 files changed, 12 insertions(+)

diff --git a/automake.in b/automake.in
index 3194c99..2c5e803 100644
--- a/automake.in
+++ b/automake.in
@@ -2131,6 +2131,7 @@ sub handle_source_transform ($$$$%)
        msg_var ('unsupported', $ext_var, $ext_var->name . " can assume at most 
one value")
          if $default_source_ext =~ /[\t ]/;
        (my $default_source = $unxformed) =~ 
s,(\.[^./\\]*)?$,$default_source_ext,;
+        # TODO: Remove this backward-compatibility hack in Automake 1.14.
        if ($old_default_source ne $default_source
            && !$ext_var
            && (rule $old_default_source
@@ -3014,6 +3015,8 @@ sub scan_texinfo_file ($)
     }

   my $infobase = basename ($filename);
+  # TODO: In Automake 1.14 (or even 1.13.2), start warning against
+  # TODO: suffixes =! ".texi", to ease transition to Automake-NG.
   $infobase =~ s/\.te?xi(nfo)?$//;
   return ($outfile, $vfile);
 }
@@ -4134,6 +4137,9 @@ sub handle_configure ($$$@)
   # Distribute and define mkinstalldirs only if it is already present
   # in the package, for backward compatibility (some people may still
   # use $(mkinstalldirs)).
+  # TODO: start warning abut this in Automake 1.13.2, and have
+  # TODO: Automake 1.14 or 1.15 drop it (and the mkinstalldirs script
+  # TODO: as well).
   my $mkidpath = "$config_aux_dir/mkinstalldirs";
   if (-f $mkidpath)
     {
diff --git a/lib/Automake/Options.pm b/lib/Automake/Options.pm
index 186d4ca..9e06599 100644
--- a/lib/Automake/Options.pm
+++ b/lib/Automake/Options.pm
@@ -315,16 +315,19 @@ sub _process_option_list (\%@)
         {
           set_strictness ($_);
         }
+      # TODO: Remove this special check in Automake 1.14 or 1.15.
       elsif (/^(.*\/)?ansi2knr$/)
         {
           # Obsolete (and now removed) de-ANSI-fication support.
           error ($where,
                  "automatic de-ANSI-fication support has been removed");
         }
+      # TODO: Remove this special check in Automake 1.15.
       elsif ($_ eq 'cygnus')
         {
           error $where, "support for Cygnus-style trees has been removed";
         }
+      # TODO: Remove this special check in Automake 1.14 or 1.15.
       elsif ($_ eq 'dist-lzma')
         {
           error ($where, "support for lzma-compressed distribution " .
diff --git a/m4/obsolete-err.m4 b/m4/obsolete-err.m4
index eb23dc4..01c2d6e 100644
--- a/m4/obsolete-err.m4
+++ b/m4/obsolete-err.m4
@@ -8,16 +8,19 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.

+dnl TODO: Remove in Automake 1.15.
 AC_DEFUN([AM_CONFIG_HEADER],
 [AC_FATAL(['$0': this macro is obsolete.
     You should use the 'AC][_CONFIG_HEADERS' macro instead.])])

+dnl TODO: Remove in Automake 1.15.
 AC_DEFUN([AM_PROG_CC_STDC],
 [AC_FATAL(['$0': this macro is obsolete.
     You should simply use the 'AC][_PROG_CC' macro instead.
     Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
     but upon 'ac_cv_prog_cc_stdc'.])])

+dnl TODO: Remove in Automake 1.14.
 AC_DEFUN([AM_C_PROTOTYPES],
          [AC_FATAL([automatic de-ANSI-fication support has been removed])])
 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
-- 
1.8.1.rc3.27.g3b73c7d





reply via email to

[Prev in Thread] Current Thread [Next in Thread]