]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Merge branch 'msvc' into maint
authorPeter Rosin <peda@lysator.liu.se>
Wed, 7 Mar 2012 20:08:06 +0000 (21:08 +0100)
committerPeter Rosin <peda@lysator.liu.se>
Wed, 7 Mar 2012 20:08:07 +0000 (21:08 +0100)
This merge remedies the confusing situation that some changes
destined for both the master branch and the release branch (a.k.a.
branch-1.11) currently needs to be made on the non-obvious msvc
branch and not on the more natural maint branch.  This has caused
a seemingly endless string of less than optimal commits.

The reason for the confusion stems from the fact that the changes made
on the msvc branch became too radical and was considered only suitable
for the master branch, and was thus written in a form suitable for
master and then merged there.  Later, the msvc branch was merged
directly into branch-1.11, in order to rush the new features to the
market and to keep the released scripts (lib/ar-lib, lib/compile and
lib/depcomp) consistent with those on the master branch.  However,
some changes had to be made to the features added by the msvc branch
in order for them to fit the requirements of branch-1.11, notably that
the warnings issued in the extra-portability class cannot be enabled
by -Wall in the 1.11.x maintenance releases.

In retrospect, it would have been better to not merge msvc directly
into branch-1.11, but instead do it via the maint branch (followed up
with a dummy merge from maint into master) the moment it was decided
that the msvc changes should make it into branch-1.11.

All in all, this merge is going to affect neither the master branch
nor branch-1.11, since it is followed up with dummy merges masking all
changes.  The merge is made to maintain the sanity of the poor
developers, who wishes to once again have a working maint branch.

Discussion about merging the msvc branch into branch-1.11:
http://lists.gnu.org/archive/html/automake/2011-10/msg00030.html

Discussion about why this merge hasn't happened before:
http://lists.gnu.org/archive/html/automake/2011-12/msg00051.html

Extra edits below.

* lib/Automake/ChannelDefs.pm: Use the version from branch-1.11.
* tests/ar-lib3.test: Likewise.
* tests/ar-lib4.test: Likewise.
* tests/extra-portability.test: Likewise.
* tests/extra-portability2.test: Likewise.
* tests/extradep.test: Likewise.
* tests/extradep2.test: Likewise.
* tests/list-of-tests.mk: Likewise.
* HACKING: Backport the version from branch-1.11 while at it (as the
change on branch-1.11 is also present on master via an unrelated
commit), even though this change has nothing to do with the changes
on the msvc branch.

1  2 
HACKING
lib/Automake/ChannelDefs.pm
tests/ar-lib3.test
tests/ar-lib4.test
tests/extra-portability.test
tests/extra-portability2.test
tests/extradep.test
tests/extradep2.test
tests/list-of-tests.mk

diff --cc HACKING
index 26f1d91e422a4e02bdf2d0f12e0fca7800964e50,26f1d91e422a4e02bdf2d0f12e0fca7800964e50..5420fbcad8742da8a59e62537e6f9ae438a5886b
+++ b/HACKING
  * Use `keep_testdirs=yes' to keep test directories for successful
    tests also.
  
++* Use perl coverage information to ensure your new code is thoroughly
++  tested by your new tests.
++
  * See file `tests/README' for more information.
  
  ================================================================
index aaca97920b0c7cd472f4c08b73c9487f1b6d9e60,f9f63fce714d6b055e9d3ae6d492f5e6d212ea2a..9b6d3a58422e8723cf61be549f6b3e23046913ff
@@@ -252,6 -258,6 +258,10 @@@ Else handle C<all> and C<none> for comp
  
  =cut
  
++# HACK to have `-Wextra-portability' *not* implied by `-Wall'.
++# This will go away in automake 1.12.
++my $have_extra_portability = 0;
++
  sub switch_warning ($)
  {
    my ($cat) = @_;
    if ($cat eq 'all')
      {
        setup_channel_type 'warning', silent => $has_no;
++      setup_channel 'extra-portability', silent => 1
++        unless $have_extra_portability;
      }
    elsif ($cat eq 'none')
      {
    elsif (channel_type ($cat) eq 'warning')
      {
        setup_channel $cat, silent => $has_no;
 -      #
 -      # Handling of portability warnings is trickier.  For relevant tests,
 -      # see `dollarvar2', `extra-portability' and `extra-portability3'.
 -      #
 -      # -Wportability-recursive and -Wno-portability-recursive should not
 -      # have any effect on other 'portability' or 'extra-portability'
 -      # warnings, so there's no need to handle them separately or ad-hoc.
 -      #
 -      if ($cat eq 'extra-portability' && ! $has_no) # -Wextra-portability
 +      setup_channel 'portability-recursive', silent => $has_no
 +        if $cat eq 'portability';
++      if ($cat eq 'portability' && $has_no)
+         {
 -          # -Wextra-portability must enable 'portability' and
 -          # 'portability-recursive' warnings.
 -          setup_channel 'portability', silent => 0;
 -          setup_channel 'portability-recursive', silent => 0;
++          setup_channel 'extra-portability', silent => 1;
++          $have_extra_portability = 0;
+         }
 -      if ($cat eq 'portability') # -Wportability or -Wno-portability
++      if ($cat eq 'extra-portability' && ! $has_no)
+         {
 -          if ($has_no) # -Wno-portability
 -            {
 -              # -Wno-portability must disable 'extra-portability' and
 -              # 'portability-recursive' warnings.
 -              setup_channel 'portability-recursive', silent => 1;
 -              setup_channel 'extra-portability', silent => 1;
 -            }
 -          else # -Wportability
 -            {
 -              # -Wportability must enable 'portability-recursive'
 -              # warnings.  But it should have no influence over the
 -              # 'extra-portability' warnings.
 -              setup_channel 'portability-recursive', silent => 0;
 -            }
++          setup_channel 'portability', silent => 0;
++          setup_channel 'portability-recursive', silent => 0;
++          $have_extra_portability = 1;
+         }
      }
    else
      {
@@@ -369,6 -408,6 +395,8 @@@ sub set_strictness ($
      }
  }
  
++1;
++
  =back
  
  =head1 SEE ALSO
index 0000000000000000000000000000000000000000,791322f9dc22c93d5929163e6ba87114dcd168f3..8378e2a44e656ff2bfd995689f443d4c0caf1d02
mode 000000,100755..100755
--- /dev/null
@@@ -1,0 -1,46 +1,46 @@@
 -AUTOMAKE_fails
+ #! /bin/sh
+ # Copyright (C) 2011 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
+ # the Free Software Foundation; either version 2, or (at your option)
+ # any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ # Test if lib_LIBRARIES requests AM_PROG_AR.
+ . ./defs || Exit 1
+ set -e
+ cat >> configure.in << 'END'
+ AC_PROG_CC
+ AC_PROG_RANLIB
+ END
+ cat > Makefile.am << 'END'
+ lib_LIBRARIES = libfoo.a
+ libfoo_a_SOURCES = foo.c
+ END
+ $ACLOCAL
++AUTOMAKE_fails -Wextra-portability
+ grep 'requires.*AM_PROG_AR' stderr
+ cat >> configure.in << 'END'
+ AM_PROG_AR
+ END
+ rm -rf autom4te*.cache
+ $ACLOCAL
+ $AUTOMAKE --add-missing
+ :
index 0000000000000000000000000000000000000000,e05a8c2f9223e63a709554c75670b56733ffec49..9e01d6c502410c6fe41a31906522582fc1343769
mode 000000,100755..100755
--- /dev/null
@@@ -1,0 -1,57 +1,57 @@@
 -AUTOMAKE_fails
+ #! /bin/sh
+ # Copyright (C) 2011 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
+ # the Free Software Foundation; either version 2, or (at your option)
+ # any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ # Test if lib_LTLIBRARIES requests AM_PROG_AR.
+ required=libtoolize
+ . ./defs || Exit 1
+ set -e
+ cp configure.in X
+ cat >> configure.in << 'END'
+ AC_PROG_CC
+ AC_PROG_RANLIB
+ AC_PROG_LIBTOOL
+ AC_OUTPUT
+ END
+ cat > Makefile.am << 'END'
+ lib_LTLIBRARIES = libfoo.la
+ libfoo_la_SOURCES = foo.c
+ END
+ libtoolize
+ $ACLOCAL
 -$AUTOMAKE --add-missing
++AUTOMAKE_fails -Wextra-portability
+ grep 'requires.*AM_PROG_AR' stderr
+ cp X configure.in
+ cat >> configure.in << 'END'
+ AC_PROG_CC
+ AM_PROG_AR
+ AC_PROG_RANLIB
+ AC_PROG_LIBTOOL
+ AC_OUTPUT
+ END
+ $ACLOCAL
++$AUTOMAKE -Wextra-portability --add-missing
+ :
index 0000000000000000000000000000000000000000,51a9b4f3c8e273470340f61216e3a786c1f92b7f..62a6335bcb38107b8128e1b1e9976f259ed9bec2
mode 000000,100755..100755
--- /dev/null
@@@ -1,0 -1,95 +1,105 @@@
 -#   3. `-Wall' must imply `-Wextra-portability'.
+ #! /bin/sh
+ # Copyright (C) 2011  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
+ # the Free Software Foundation; either version 2, or (at your option)
+ # any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ # Check interactions between the `portability' and `extra-portability'
+ # warning categories:
+ #   1. `-Wextra-portability' must imply `-Wportability'.
+ #   2. `-Wno-portability' must imply `-Wno-extra-portability'.
 -# -Wall enables extra-portability.
 -AUTOMAKE_fails -Wall
 -grep 'requires.*AM_PROG_AR' stderr
 -
 -# Disabling portability disables extra-portability as well.
 -$AUTOMAKE -Wextra-portability -Wno-portability
 -$AUTOMAKE -Wall -Wno-portability
++#   3. `-Wall' does *not* imply `-Wextra-portability'.
+ . ./defs || Exit 1
+ set -e
+ # We want (almost) complete control over automake options.
+ # FIXME: use $original_AUTOMAKE here once we are merged into master.
+ AUTOMAKE="`(set $AUTOMAKE && echo $1)` --foreign -Werror"
+ cat >>configure.in <<END
+ AC_PROG_CC
+ AC_PROG_RANLIB
+ AC_OUTPUT
+ END
+ $ACLOCAL
+ #
+ # First, a setup where only an extra-portability warning is present
+ # (no "simple" portability-warnings are).
+ #
+ cat >Makefile.am <<END
+ EXTRA_LIBRARIES = libfoo.a
+ libfoo_a_SOURCES = sub/foo.c
+ END
+ # Sanity check: extra-portability warnings causes the expected error.
+ AUTOMAKE_fails -Wextra-portability
+ grep 'requires.*AM_PROG_AR' stderr
+ # Warnings in extra-portability category are not enabled by default.
+ $AUTOMAKE
 -#
 -# Now, a setup where also a "simple" portability warning is present.
 -#
++# `-Wall' does not enable extra-portability warnings.
++$AUTOMAKE -Wall -Werror
 -# Per-target flags require the use of AM_PROG_CC_C_O in configure.ac.
++# Enabling extra-portability works.
++AUTOMAKE_fails -Wnone -Wextra-portability
++grep 'requires.*AM_PROG_AR' stderr
++# Disabling portability disables extra-portability.
++$AUTOMAKE -Wno-portability -Wall
++$AUTOMAKE -Wextra-portability -Wno-portability -Wall
 -# Enabling extra-portability enables portability as well ...
 -AUTOMAKE_fails -Wextra-portability
+ echo libfoo_a_CPPFLAGS = -Dwhatever >> Makefile.am
 -# ... even if it had been previously disabled.
 -AUTOMAKE_fails -Wno-portability -Wextra-portability
++# Enabling extra-portability enables portability.
++AUTOMAKE_fails -Wnone -Wextra-portability
++# The expected diagnostic is
++#    Makefile.am:2: compiling `foo.c' with per-target flags requires `AM_PROG_CC_C_O' in `configure.in'
++#    .../lib/am/library.am: `libfoo.a': linking libraries using a non-POSIX
++#    .../lib/am/library.am: archiver requires `AM_PROG_AR' in `configure.in'
++#    Makefile.am:1:   while processing library `libfoo.a'
+ grep 'requires.*AM_PROG_CC_C_O' stderr
+ grep 'requires.*AM_PROG_AR' stderr
++
++# `-Wall' does not reset extra portability warnings to their
++# default (i.e., disabled).
++AUTOMAKE_fails -Wextra-portability -Wall
+ grep 'requires.*AM_PROG_CC_C_O' stderr
+ grep 'requires.*AM_PROG_AR' stderr
+ # Disabling extra-portability leaves portability intact.
+ AUTOMAKE_fails -Wportability -Wno-extra-portability
+ grep 'requires.*AM_PROG_CC_C_O' stderr
+ grep 'requires.*AM_PROG_AR' stderr && Exit 1
++# `-Wall' does not set extra portability warnings if they have
++# been previously disabled.
++AUTOMAKE_fails -Wno-extra-portability -Wall
++grep 'requires.*AM_PROG_CC_C_O' stderr
++grep 'requires.*AM_PROG_AR' stderr && Exit 1
++
+ # Enabling portability does not enable extra-portability.
+ AUTOMAKE_fails -Wnone -Wportability
+ grep 'requires.*AM_PROG_CC_C_O' stderr
+ grep 'requires.*AM_PROG_AR' stderr && Exit 1
+ # Disabling portability disables extra-portability.
+ $AUTOMAKE -Wno-portability
+ $AUTOMAKE -Wextra-portability -Wno-portability
+ $AUTOMAKE -Wall -Wno-portability
+ :
index 0000000000000000000000000000000000000000,a44b144275be60b68e392d8fdf01115af8b2a69b..9a01e74dfbff13eb5a35549bc2b59979fa892151
mode 000000,100755..100755
--- /dev/null
@@@ -1,0 -1,53 +1,57 @@@
+ #! /bin/sh
+ # Copyright (C) 2011  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
+ # the Free Software Foundation; either version 2, or (at your option)
+ # any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ # Make sure that extra-portability warnings are not enabled by --gnits,
+ # --gnu and --foreign.
+ . ./defs || Exit 1
+ set -e
+ # Satisfy --gnits and --gnu.
+ : > INSTALL
+ : > NEWS
+ : > README
+ : > AUTHORS
+ : > ChangeLog
+ : > COPYING
+ : > THANKS
+ cat >>configure.in <<END
+ AC_PROG_CC
+ AC_PROG_RANLIB
+ AC_OUTPUT
+ END
+ cat >Makefile.am <<END
+ EXTRA_LIBRARIES = libfoo.a
+ libfoo_a_SOURCES = foo.c
+ END
+ $ACLOCAL
++# In the 1.11.x series, `extra-portability' warnings are not enabled
++# by `-Wall'.
++AUTOMAKE="$AUTOMAKE -Wextra-portability"
++
+ # Make sure the test is useful.
+ AUTOMAKE_fails
+ $AUTOMAKE --foreign
+ $AUTOMAKE --gnu
+ $AUTOMAKE --gnits
+ :
index 4cbfda5246590afa73356e01137df6318dd17168,4cbfda5246590afa73356e01137df6318dd17168..cdcb5e8ff217815630da13482d3a779c440f6ad7
@@@ -23,6 -23,6 +23,7 @@@ set -
  
  cat >> configure.in << 'END'
  AC_PROG_CC
++AM_PROG_AR
  AC_PROG_RANLIB
  AC_SUBST([deps], [bardep])
  AM_CONDITIONAL([COND], [test -n "$cond"])
index 3d445122a1f8243a9e904d13d188cb35048c6dc3,3d445122a1f8243a9e904d13d188cb35048c6dc3..8f3f0cf7f74292201eebdfa01129d79c8127893e
@@@ -23,6 -23,6 +23,7 @@@ set -
  
  cat >> configure.in << 'END'
  AC_PROG_CC
++AM_PROG_AR
  AC_PROG_LIBTOOL
  AC_SUBST([deps], [bardep])
  AC_OUTPUT
index 2b73de2d1df19d6dfc76a8919f938ab89ca0ca7d,e974d0fcf537f82f47c26208286bf2c22876fc45..420b56bf829e60bcf3719d6dae24f270c17d4a09
@@@ -360,6 -376,6 +376,9 @@@ exeext4.test 
  exsource.test \
  ext.test \
  ext2.test \
++extra-portability.test \
++extra-portability2.test \
++extra-portability3.test \
  extra.test \
  extra2.test \
  extra3.test \