From: Peter Rosin Date: Wed, 7 Mar 2012 20:08:06 +0000 (+0100) Subject: Merge branch 'msvc' into maint X-Git-Tag: v1.11.3b~10^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a8146089834c5187d0b0795b9fa71a0f9bba132;p=thirdparty%2Fautomake.git Merge branch 'msvc' into maint 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. --- 3a8146089834c5187d0b0795b9fa71a0f9bba132 diff --cc HACKING index 26f1d91e4,26f1d91e4..5420fbcad --- a/HACKING +++ b/HACKING @@@ -174,6 -174,6 +174,9 @@@ * 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. ================================================================ diff --cc lib/Automake/ChannelDefs.pm index aaca97920,f9f63fce7..9b6d3a584 --- a/lib/Automake/ChannelDefs.pm +++ b/lib/Automake/ChannelDefs.pm @@@ -252,6 -258,6 +258,10 @@@ Else handle C and C 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) = @_; @@@ -266,6 -272,6 +276,8 @@@ 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') { @@@ -282,8 -288,38 +294,19 @@@ 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 diff --cc tests/ar-lib3.test index 000000000,791322f9d..8378e2a44 mode 000000,100755..100755 --- a/tests/ar-lib3.test +++ b/tests/ar-lib3.test @@@ -1,0 -1,46 +1,46 @@@ + #! /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 . + + # 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 ++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 + + : diff --cc tests/ar-lib4.test index 000000000,e05a8c2f9..9e01d6c50 mode 000000,100755..100755 --- a/tests/ar-lib4.test +++ b/tests/ar-lib4.test @@@ -1,0 -1,57 +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 . + + # 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_fails ++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 --add-missing ++$AUTOMAKE -Wextra-portability --add-missing + + : diff --cc tests/extra-portability.test index 000000000,51a9b4f3c..62a6335bc mode 000000,100755..100755 --- a/tests/extra-portability.test +++ b/tests/extra-portability.test @@@ -1,0 -1,95 +1,105 @@@ + #! /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 . + + # Check interactions between the `portability' and `extra-portability' + # warning categories: + # 1. `-Wextra-portability' must imply `-Wportability'. + # 2. `-Wno-portability' must imply `-Wno-extra-portability'. -# 3. `-Wall' must imply `-Wextra-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 <Makefile.am <> Makefile.am + -# Enabling extra-portability enables portability as well ... -AUTOMAKE_fails -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 -# ... even if it had been previously disabled. -AUTOMAKE_fails -Wno-portability -Wextra-portability ++ ++# `-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 + + : diff --cc tests/extra-portability2.test index 000000000,a44b14427..9a01e74df mode 000000,100755..100755 --- a/tests/extra-portability2.test +++ b/tests/extra-portability2.test @@@ -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 . + + # 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 <Makefile.am <> configure.in << 'END' AC_PROG_CC ++AM_PROG_AR AC_PROG_RANLIB AC_SUBST([deps], [bardep]) AM_CONDITIONAL([COND], [test -n "$cond"]) diff --cc tests/extradep2.test index 3d445122a,3d445122a..8f3f0cf7f --- a/tests/extradep2.test +++ b/tests/extradep2.test @@@ -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 diff --cc tests/list-of-tests.mk index 2b73de2d1,e974d0fcf..420b56bf8 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@@ -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 \