automake-patches
[Top][All Lists]
Advanced

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

[PATCH 2/2] Invent new extra-portability warning category for AM_PROG_AR


From: Peter Rosin
Subject: [PATCH 2/2] Invent new extra-portability warning category for AM_PROG_AR.
Date: Wed, 19 Oct 2011 23:28:31 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1

>From 1b554ab39084ecaf767fbea031763c211bc72e4e Mon Sep 17 00:00:00 2001
From: Peter Rosin <address@hidden>
Date: Wed, 19 Oct 2011 23:18:49 +0200
Subject: [PATCH 2/2] Invent new extra-portability warning category for
 AM_PROG_AR.

* lib/Automake/ChannelDefs.pm: Register new extra-portability
warning channel.
(switch_warning): Turn off extra-portability if portability is
turned off, and turn on portability if extra-portability is
turned on.
(set_strictness): Silence extra-portability for --gnits, --gnu
and --foreign.
* doc/automake.texi (Invoking Automake): Document the new warning
category and its interaction with the portability category.
* automake.in (handle_libraries, handle_ltlibraries): Move the
AM_PROG_AR warnings to the new extra-portability channel.
* tests/ar2.test: Adjust to to the new warning channel.
* tests/pr300-lib.test: Likewise.
* tests/pr300-ltlib.test: Likewise.
* tests/pr307.test: Likewise.
* tests/pr401.test: Likewise.
* tests/pr401b.test: Likewise.
* tests/pr401c.test: Likewise.
* tests/pr72.test: Likewise.
* NEWS: Likewise.

Signed-off-by: Peter Rosin <address@hidden>
---
 ChangeLog                   |   24 ++++++++++++++++++++++++
 NEWS                        |    2 +-
 automake.in                 |    4 ++--
 doc/automake.texi           |    7 +++++++
 lib/Automake/ChannelDefs.pm |   13 +++++++++++++
 tests/ar2.test              |    2 +-
 tests/pr300-lib.test        |    2 +-
 tests/pr300-ltlib.test      |    2 +-
 tests/pr307.test            |    2 +-
 tests/pr401.test            |   10 +++++-----
 tests/pr401b.test           |   10 +++++-----
 tests/pr401c.test           |   10 +++++-----
 tests/pr72.test             |    2 +-
 13 files changed, 67 insertions(+), 23 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ab1ea1f..74082b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,28 @@
 2011-10-19  Peter Rosin  <address@hidden>
+
+       Invent new extra-portability warning category for AM_PROG_AR.
+       * lib/Automake/ChannelDefs.pm: Register new extra-portability
+       warning channel.
+       (switch_warning): Turn off extra-portability if portability is
+       turned off, and turn on portability if extra-portability is
+       turned on.
+       (set_strictness): Silence extra-portability for --gnits, --gnu
+       and --foreign.
+       * doc/automake.texi (Invoking Automake): Document the new warning
+       category and its interaction with the portability category.
+       * automake.in (handle_libraries, handle_ltlibraries): Move the
+       AM_PROG_AR warnings to the new extra-portability channel.
+       * tests/ar2.test: Adjust to to the new warning channel.
+       * tests/pr300-lib.test: Likewise.
+       * tests/pr300-ltlib.test: Likewise.
+       * tests/pr307.test: Likewise.
+       * tests/pr401.test: Likewise.
+       * tests/pr401b.test: Likewise.
+       * tests/pr401c.test: Likewise.
+       * tests/pr72.test: Likewise.
+       * NEWS: Likewise.
+
+2011-10-19  Peter Rosin  <address@hidden>
            Ralf Wildenhues  <address@hidden>
            Stefano Lattarini  <address@hidden>
 
diff --git a/NEWS b/NEWS
index baddcad..d38338a 100644
--- a/NEWS
+++ b/NEWS
@@ -24,7 +24,7 @@ New in 1.11.0a:
   - New macro AM_PROG_AR that looks for an archiver and wraps it in the new
     'ar-lib' auxiliary script if the found archiver is Microsoft lib.  This
     new macro is required for LIBRARIES and LTLIBRARIES when automake is
-    run with -Wportability (or -Wall) and -Werror.
+    run with -Wextra-portability (or -Wall) and -Werror.
 
 Bugs fixed in 1.11.0a:
 
diff --git a/automake.in b/automake.in
index 1d1bb15..9cfd9fc 100755
--- a/automake.in
+++ b/automake.in
@@ -2826,7 +2826,7 @@ sub handle_libraries
 
       if (! $seen_ar)
        {
-         msg ('portability', $where,
+         msg ('extra-portability', $where,
               "`$onelib': linking libraries using a non-POSIX\n"
               . "archiver requires `AM_PROG_AR' in `$configure_ac'")
        }
@@ -3070,7 +3070,7 @@ sub handle_ltlibraries
 
       if (! $seen_ar)
        {
-         msg ('portability', $where,
+         msg ('extra-portability', $where,
               "`$onelib': linking libtool libraries using a non-POSIX\n"
               . "archiver requires `AM_PROG_AR' in `$configure_ac'")
        }
diff --git a/doc/automake.texi b/doc/automake.texi
index 5d0942d..b238abf 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -2680,6 +2680,8 @@ user redefinitions of Automake rules or variables
 @item portability
 portability issues (e.g., use of @command{make} features that are
 known to be not portable)
address@hidden extra-portability
+extra portability issues related to obscure tools
 @item syntax
 weird syntax, unused variables, typos
 @item unsupported
@@ -2702,6 +2704,11 @@ are enabled in @option{--gnu} and @option{--gnits} 
strictness.
 On the other hand, the @option{silent-rules} options (@pxref{Options})
 turns off portability warnings about recursive variable expansions.
 
+Turning off @samp{portability} will also turn off @samp{extra-portability},
+and similarly turning on @samp{extra-portability} will also turn on
address@hidden  However, turning on @samp{portability} or turning
+off @samp{extra-portability} will not affect the other category.
+
 @vindex WARNINGS
 The environment variable @env{WARNINGS} can contain a comma separated
 list of categories to enable.  It will be taken into account before the
diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm
index aaca979..61b4ed4 100644
--- a/lib/Automake/ChannelDefs.pm
+++ b/lib/Automake/ChannelDefs.pm
@@ -115,6 +115,10 @@ variables (silent by default).
 
 Warnings about non-portable constructs.
 
+=item C<extra-portability>
+
+Extra warnings about non-portable constructs covering obscure tools.
+
 =item C<syntax>
 
 Warnings about weird syntax, unused variables, typos...
@@ -151,6 +155,7 @@ register_channel 'automake', type => 'fatal', backtrace => 
1,
   footer => "\nPlease contact <$PACKAGE_BUGREPORT>.",
   uniq_part => UP_NONE, ordered => 0;
 
+register_channel 'extra-portability', type => 'warning', silent => 1;
 register_channel 'gnu', type => 'warning';
 register_channel 'obsolete', type => 'warning', silent => 1;
 register_channel 'override', type => 'warning', silent => 1;
@@ -180,6 +185,7 @@ sub usage ()
   `obsolete'      obsolete features or constructions
   `override'      user redefinitions of Automake rules or variables
   `portability'   portability issues (default in gnu and gnits modes)
+  `extra-portability'  extra portability issues related to obscure tools
   `syntax'        dubious syntactic constructs (default)
   `unsupported'   unsupported or incomplete features (default)
   `all'           all the warnings
@@ -284,6 +290,10 @@ sub switch_warning ($)
       setup_channel $cat, silent => $has_no;
       setup_channel 'portability-recursive', silent => $has_no
         if $cat eq 'portability';
+      setup_channel 'extra-portability', silent => $has_no
+        if ($cat eq 'portability' && $has_no);
+      setup_channel 'portability', silent => $has_no
+        if ($cat eq 'extra-portability' && ! $has_no);
     }
   else
     {
@@ -345,6 +355,7 @@ sub set_strictness ($)
       setup_channel 'error-gnu/warn', silent => 0, type => 'error';
       setup_channel 'error-gnits', silent => 1;
       setup_channel 'portability', silent => 0;
+      setup_channel 'extra-portability', silent => 1;
       setup_channel 'gnu', silent => 0;
     }
   elsif ($name eq 'gnits')
@@ -353,6 +364,7 @@ sub set_strictness ($)
       setup_channel 'error-gnu/warn', silent => 0, type => 'error';
       setup_channel 'error-gnits', silent => 0;
       setup_channel 'portability', silent => 0;
+      setup_channel 'extra-portability', silent => 1;
       setup_channel 'gnu', silent => 0;
     }
   elsif ($name eq 'foreign')
@@ -361,6 +373,7 @@ sub set_strictness ($)
       setup_channel 'error-gnu/warn', silent => 0, type => 'warning';
       setup_channel 'error-gnits', silent => 1;
       setup_channel 'portability', silent => 1;
+      setup_channel 'extra-portability', silent => 1;
       setup_channel 'gnu', silent => 1;
     }
   else
diff --git a/tests/ar2.test b/tests/ar2.test
index f8ad559..f37f514 100755
--- a/tests/ar2.test
+++ b/tests/ar2.test
@@ -33,7 +33,7 @@ libfoo_a_SOURCES = foo.c
 END
 
 $ACLOCAL
-$AUTOMAKE -Wno-portability
+$AUTOMAKE -Wno-extra-portability
 grep '^ARFLAGS =' Makefile.in
 grep '^AR =' Makefile.in
 
diff --git a/tests/pr300-lib.test b/tests/pr300-lib.test
index 0b0d963..e10be24 100755
--- a/tests/pr300-lib.test
+++ b/tests/pr300-lib.test
@@ -45,7 +45,7 @@ END
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability --copy --add-missing
+$AUTOMAKE -Wno-extra-portability --copy --add-missing
 
 ./configure --prefix "`pwd`/inst"
 
diff --git a/tests/pr300-ltlib.test b/tests/pr300-ltlib.test
index 3189fb4..5e8c052 100755
--- a/tests/pr300-ltlib.test
+++ b/tests/pr300-ltlib.test
@@ -47,7 +47,7 @@ END
 libtoolize
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability --copy --add-missing
+$AUTOMAKE -Wno-extra-portability --copy --add-missing
 
 ./configure --prefix "`pwd`/inst"
 
diff --git a/tests/pr307.test b/tests/pr307.test
index 4bf2f74..3496817 100755
--- a/tests/pr307.test
+++ b/tests/pr307.test
@@ -68,7 +68,7 @@ done
 libtoolize --force
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability -a
+$AUTOMAKE -Wno-extra-portability -a
 
 # Sanity check: make sure the variable we are attempting to force
 # is used by configure
diff --git a/tests/pr401.test b/tests/pr401.test
index d06ddb4..6009315 100755
--- a/tests/pr401.test
+++ b/tests/pr401.test
@@ -81,7 +81,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability
+$AUTOMAKE -Wno-extra-portability
 ./configure
 $MAKE distcheck
 
@@ -97,7 +97,7 @@ mv -f configure.int configure.in
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability
+$AUTOMAKE -Wno-extra-portability
 ./configure
 test ! -d lib/lib
 $MAKE distcheck
@@ -108,7 +108,7 @@ $MAKE distcheck
 
 mv -f src/Makefile.am src/t
 sed 's/LDADD = .*/LDADD = @LIBOBJS@/' src/t > src/Makefile.am
-AUTOMAKE_fails -Wno-portability
+AUTOMAKE_fails -Wno-extra-portability
 grep 'cannot be used outside.*lib' stderr
 mv -f src/t src/Makefile.am
 
@@ -139,7 +139,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability --add-missing
+$AUTOMAKE -Wno-extra-portability --add-missing
 ./configure
 test ! -d src/lib
 test ! -d 'src/$(top_builddir)'
@@ -176,7 +176,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability
+$AUTOMAKE -Wno-extra-portability
 ./configure
 $MAKE distcheck
 
diff --git a/tests/pr401b.test b/tests/pr401b.test
index 3e6c927..4bd2f36 100755
--- a/tests/pr401b.test
+++ b/tests/pr401b.test
@@ -82,7 +82,7 @@ EOF
 libtoolize
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability -a
+$AUTOMAKE -Wno-extra-portability -a
 ./configure
 $MAKE distcheck
 
@@ -99,7 +99,7 @@ mv -f configure.int configure.in
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability -a
+$AUTOMAKE -Wno-extra-portability -a
 ./configure
 test ! -d lib/lib
 $MAKE distcheck
@@ -110,7 +110,7 @@ $MAKE distcheck
 
 mv -f src/Makefile.am src/t
 sed 's/LDADD = .*/LDADD = @LTLIBOBJS@/' src/t > src/Makefile.am
-AUTOMAKE_fails -Wno-portability
+AUTOMAKE_fails -Wno-extra-portability
 grep 'cannot be used outside.*lib' stderr
 mv -f src/t src/Makefile.am
 
@@ -140,7 +140,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability --add-missing
+$AUTOMAKE -Wno-extra-portability --add-missing
 ./configure
 test ! -d src/lib
 test ! -d 'src/$(top_builddir)'
@@ -177,7 +177,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability
+$AUTOMAKE -Wno-extra-portability
 ./configure
 $MAKE distcheck
 
diff --git a/tests/pr401c.test b/tests/pr401c.test
index fc6a1ba..1d0511f 100755
--- a/tests/pr401c.test
+++ b/tests/pr401c.test
@@ -83,7 +83,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability
+$AUTOMAKE -Wno-extra-portability
 ./configure
 $MAKE distcheck
 
@@ -100,7 +100,7 @@ mv -f configure.int configure.in
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability
+$AUTOMAKE -Wno-extra-portability
 ./configure
 test ! -d lib/lib
 $MAKE distcheck
@@ -111,7 +111,7 @@ $MAKE distcheck
 
 mv -f src/Makefile.am src/t
 sed 's/LDADD = .*/LDADD = @ALLOCA@/' src/t > src/Makefile.am
-AUTOMAKE_fails -Wno-portability
+AUTOMAKE_fails -Wno-extra-portability
 grep 'cannot be used outside.*lib' stderr
 mv -f src/t src/Makefile.am
 
@@ -142,7 +142,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability --add-missing
+$AUTOMAKE -Wno-extra-portability --add-missing
 ./configure
 $MAKE
 test ! -d src/lib
@@ -179,7 +179,7 @@ EOF
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -Wno-portability
+$AUTOMAKE -Wno-extra-portability
 ./configure
 $MAKE distcheck
 
diff --git a/tests/pr72.test b/tests/pr72.test
index f2d507c..5af32ec 100755
--- a/tests/pr72.test
+++ b/tests/pr72.test
@@ -39,7 +39,7 @@ END
 : > config.sub
 
 $ACLOCAL
-$AUTOMAKE -Wno-portability
+$AUTOMAKE -Wno-extra-portability
 
 grep '^LINK =' Makefile.in
 
-- 
1.7.5.1





reply via email to

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