[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug#13940: Spurious target redefinition warnings with Automake condi
Re: bug#13940: Spurious target redefinition warnings with Automake conditionals
Sat, 08 Jun 2013 17:50:20 +0200
On 03/13/2013 02:40 AM, Nick Bowler wrote:
> Consider the following:
> % cat >configure.ac <<'EOF'
> AC_INIT([test], )
> AM_CONDITIONAL([FOO], [true])
> % cat >Makefile.am <<'EOF'
> if FOO
> all-local: bar
> bar: ; @echo bar
> all-local: baz
> baz: ; @echo baz
> On this input, Automake is producing the following warning:
> Makefile.am:6: warning: all-local was already defined in condition
> FOO, which is included in condition TRUE ...
> Makefile.am:2: ... 'all-local' previously defined here
> This warning makes no sense, because there is no problem with this
> Makefile.am as far as I can see. However, the warnings seem to be just
> noise as the generated Makefile.in appears correct and works fine.
> The conditional there is important: Automake only appears to warn when
> one of the all-local rules is inside a conditional and the other is not.
I've exposed the bug with the patch inlined below. Not sure when I'll
be able to attempt a proper fix. If anyone wants to give it a try in
the meantime, be my guest!
---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ----
>From b2b3692d37e9812a5895b5a054da597731d7eb08 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Sat, 8 Jun 2013 17:47:30 +0200
Subject: [PATCH] tests: expose automake bug#13940
* t/override-conditional-pr13940.sh: New test, still xfailing.
* t/list-of-tests.mk (XFAIL_TESTS, handwritten_TESTS): Add it.
Signed-off-by: Stefano Lattarini <address@hidden>
t/list-of-tests.mk | 2 ++
t/override-conditional-pr13940.sh | 44 +++++++++++++++++++++++++++++++++++++++
2 files changed, 46 insertions(+)
create mode 100644 t/override-conditional-pr13940.sh
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index fb2e444..68ca58c 100644
@@ -33,6 +33,7 @@ t/all.sh \
@@ -740,6 +741,7 @@ t/output13.sh \
diff --git a/t/override-conditional-pr13940.sh
new file mode 100644
@@ -0,0 +1,44 @@
+# Copyright (C) 2013 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/>.
+# Expose automake bug#1394: automake erroneously think that a .PHONY
+# target's rule is overridden only because we declare dependencies
+# to such targets twice: one in an Automake conditional, and once
+cat >> configure.ac << 'END'
+cat > Makefile.am << 'END'
+# The conditional here is important: Automake only appears to warn
+# when one of the all-local rules is inside a conditional and the
+# other is not.
+bar: ; @echo bar
+baz: ; @echo baz
|[Prev in Thread]
||[Next in Thread]|
- Re: bug#13940: Spurious target redefinition warnings with Automake conditionals,
Stefano Lattarini <=