+2003-04-14 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * automake.in (%silent_variable_override): New variable.
+ (macro_define): Warn about variable definitions overriding
+ Automake variables.
+ (rule_define): Warn about target definitions overriding
+ Automake variables. Fix $condmsg definition.
+ * automake.texi (Invoking Automake): Document the `override'
+ category.
+ * lib/Automake/ChannelDefs.pm (usage): Likewise.
+ * lib/am/texinfos.am [!%?CYGNUS] (MAKEINFO): Do not define,
+ this is already done in m4/init.m4.
+ * tests/dejagnu2.test: Run $MAKE, don't only grep. Use
+ -Wno-override, and make sure we get a warning without.
+ * tests/exeext2.test, tests/substtarg.test: Use -Wno-override,
+ and make sure we get a warning without.
+ * tests/exeext3.test, tests/java2.test, tests/nolink.test,
+ tests/subpkg.test, tests/vartest.test: Use -Wno-override.
+ * tests/txinfo13.test: Use installcheck-local instead of overriding
+ installcheck.
+ * tests/txinfo2.test: Run $MAKE on the real Makefile (this test
+ used to succeed thanks to a failure...)
+ * tests/location.test: Adjust expected messages.
+ * tests/Makefile.am (XFAIL_TESTS): Add txinfo5.test.
+
2003-04-12 Raja R Harinath <harinath@acm.org>
* lib/Automake/DisjConditions.pm (true): Don't cache answer.
maintainer-clean-vti:
-rm -f stamp-vti version.texi
+
TEXI2DVI = texi2dvi
TEXI2PDF = $(TEXI2DVI) --pdf --batch
substituted from configure.ac. This has been requested by people
dealing with non-POSIX ar implementations.
+* New warning option: -Woverride. This will warn about any user
+ target or variable definitions which override Automake definitions.
\f
New in 1.7:
* Autoconf 2.54 is required.
YACC => 'AC_PROG_YACC',
);
+# Variables that can be overriden without complaint from -Woverride
+my %silent_variable_override =
+ (AR => 1,
+ ARFLAGS => 1,
+ DEJATOOL => 1,
+ JAVAC => 1);
+
# Copyright on generated Makefile.ins.
my $gen_copyright = "\
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
&& $var_owner{$var}{$cond} != VAR_AUTOMAKE
&& $owner == VAR_AUTOMAKE)
{
+ if (! exists $silent_variable_override{$var})
+ {
+ my $condmsg = ($cond == TRUE
+ ? '' : (" in condition `" . $cond->human . "'"));
+ msg_cond_var ('override', $cond, $var,
+ "user variable `$var' defined here$condmsg...",
+ partial => 1);
+ msg ('override', $where,
+ "... overrides Automake variable `$var' defined here");
+ }
verb ("refusing to override the user definition of:\n"
. macro_dump ($var)
- ."with `$cond->human' => `$value'");
+ ."with `" . $cond->human . "' => `$value'");
}
else
{
# Don't mention true conditions in diagnostics.
my $condmsg =
- $cond == TRUE ? " in condition `" . $cond->human . "'" : '';
+ $cond == TRUE ? '' : " in condition `" . $cond->human . "'";
if ($owner == TARGET_USER)
{
- if ($oldowner eq TARGET_USER)
+ if ($oldowner == TARGET_USER)
{
# Ignore `%'-style pattern rules. We'd need the
# dependencies to detect duplicates, and they are
{
if ($oldowner == TARGET_USER)
{
+ msg_cond_target ('override', $cond, $target,
+ "user target `$target' defined here"
+ . "$condmsg...", partial => 1);
+ msg ('override', $where,
+ "... overrides Automake target `$target' defined here");
# Don't overwrite the user definition of TARGET.
return ();
}
(@pxref{Top, , , standards, The GNU Coding Standards}).
@item obsolete
obsolete features or constructions
+@item override
+user redefinitions of Automake rules or variables
@item portability
portability issues (e.g., use of Make features which are known not portable)
@item syntax
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 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
Warnings about obsolete features (silent by default).
+=item C<override>
+
+Warnings about user redefinitions of Automake rules or
+variables (silent by default).
+
=item C<portability>
Warnings about non-portable constructs.
=item C<syntax>
-Weird syntax, unused variables, typos...
+Warnings about weird syntax, unused variables, typos...
=item C<unsupported>
register_channel 'gnu', type => 'warning';
register_channel 'obsolete', type => 'warning', silent => 1;
+register_channel 'override', type => 'warning', silent => 1;
register_channel 'portability', type => 'warning', silent => 1;
register_channel 'syntax', type => 'warning';
register_channel 'unsupported', type => 'warning';
print "Warning categories include:
`gnu' GNU coding standards (default in gnu and gnits modes)
`obsolete' obsolete features or constructions
+ `override' user redefinitions of Automake rules or variables
`portability' portability issues
`syntax' dubious syntactic constructs (default)
`unsupported' unsupported or incomplete features (default)
if %?LOCAL-TEXIS%
if ! %?CYGNUS%
-MAKEINFO = @MAKEINFO@
TEXI2DVI = texi2dvi
else %?CYGNUS%
-@set UPDATED 10 April 2003
+@set UPDATED 14 April 2003
@set UPDATED-MONTH April 2003
@set EDITION 1.7a
@set VERSION 1.7a
## Process this file with automake to create Makefile.in
-XFAIL_TESTS = subdir5.test auxdir2.test cond17.test
+XFAIL_TESTS = subdir5.test auxdir2.test cond17.test txinfo5.test
TESTS = \
acinclude.test \
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
-XFAIL_TESTS = subdir5.test auxdir2.test cond17.test
+XFAIL_TESTS = subdir5.test auxdir2.test cond17.test txinfo5.test
TESTS = \
acinclude.test \
aclibobj.test \
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
. ./defs || exit 1
+set -e
+
+echo 'AC_OUTPUT' >> configure.in
+
cat > Makefile.am << 'END'
AUTOMAKE_OPTIONS = dejagnu
site.exp:
- echo foo
+ @echo foo
END
-$ACLOCAL || exit 1
-$AUTOMAKE || exit 1
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -Wno-override
grep site.exp Makefile.in
test `grep '^site\.exp:' Makefile.in | wc -l` -eq 1
+
+./configure
+$MAKE site.exp >stdout
+cat stdout
+grep foo stdout
+
+$AUTOMAKE 2>stderr && exit 1
+cat stderr
+grep 'Makefile.am:3:.*site.exp' stderr
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
$AUTOMAKE -Wnone
$AUTOMAKE -Wnone -Wobsolete 2>stderr && exit 1
cat stderr
-grep maude stderr
+grep 'deprecated.*maude' stderr
$AUTOMAKE -Wall 2>stderr && exit 1
cat stderr
-grep maude stderr
+grep 'deprecated.*maude' stderr
+grep 'overrid.*maude' stderr
echo 'AUTOMAKE_OPTIONS = no-exeext' >> Makefile.am
-$AUTOMAKE -Wall
+$AUTOMAKE -Wall -Wno-override
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
END
$ACLOCAL
-$AUTOMAKE
+$AUTOMAKE -Wno-override
$FGREP 'maude$(EXEEXT):' Makefile.in
test 1 = `grep 'maude.*:' Makefile.in | wc -l`
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
$ACLOCAL
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-override
./configure
$MAKE
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
Makefile.am:3: while processing library `libfoo.a'
program.am: target `libfoo.a$(EXEEXT)' was defined here
Makefile.am:1: while processing program `libfoo.a'
-program.am: redefinition of `libfoo.a' in condition `TRUE'...
+program.am: redefinition of `libfoo.a'...
Makefile.am:1: while processing program `libfoo.a'
library.am: ... `libfoo.a' previously defined here
Makefile.am:3: while processing library `libfoo.a'
-tags.am: redefinition of `ctags' in condition `TRUE'...
+tags.am: redefinition of `ctags'...
program.am: ... `ctags' previously defined here
Makefile.am:6: while processing program `ctags'
EOF
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
. ./defs || exit 1
+set -e
+
cat > Makefile.am << 'END'
AUTOMAKE_OPTIONS = no-exeext
cat beans.veg beef.meat > meal
END
-$ACLOCAL || exit 1
-$AUTOMAKE || exit 1
+$ACLOCAL
+$AUTOMAKE -Wno-override
grep '^meal.*:' Makefile.in | grep -v beef.meat && exit 1
$ACLOCAL
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-override
cd lib
$ACLOCAL
$AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -Wno-override
cd ..
./configure
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
set -e
$ACLOCAL
-$AUTOMAKE
+$AUTOMAKE 2>stderr && exit 1
+cat stderr
+grep 'overrid.*libfake@SUBST@.a' stderr
num=`grep '^libfake@SUBST@.a:' Makefile.in | wc -l`
test $num -eq 1
+$AUTOMAKE -Wno-override
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
info_TEXINFOS = subdir/main.texi
subdir_main_TEXINFOS = subdir/inc.texi
-installcheck:
+installcheck-local:
test -f $(infodir)/main.info
END
#! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
. ./defs || exit 1
+set -e
+
+echo AC_OUTPUT >> configure.in
+
cat > Makefile.am << 'END'
info_TEXINFOS = textutils.texi
magic:
echo '@setfilename textutils.info' > textutils.texi
: > textutils.info~
-$ACLOCAL || exit 1
-$AUTOMAKE || exit 1
-test -z "`$MAKE -s -f Makefile.in magic | grep '~'`"
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+$MAKE magic >stdout
+cat stdout
+grep '~' stdout && exit 1
+exit 0
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
. ./defs || exit 1
+set -e
+
cat > Makefile.am << 'END'
install = install
install:
$(install) install
END
-$ACLOCAL || exit 1
-$AUTOMAKE || exit 1
+$ACLOCAL
+$AUTOMAKE -Wno-override
-grep '^install = install$' Makefile.in || exit 1
+grep '^install = install$' Makefile.in
cat > target.expected <<'EOF'
install:
$(install) install
EOF
sed -n '/^install:/,/^ /p' Makefile.in > target.value
-diff target.expected target.value || exit 1
-
-exit 0
+diff target.expected target.value
-@set UPDATED 10 April 2003
+@set UPDATED 14 April 2003
@set UPDATED-MONTH April 2003
@set EDITION 1.7a
@set VERSION 1.7a