From: Ralf Wildenhues Date: Tue, 20 Apr 2010 05:43:59 +0000 (+0200) Subject: Fix -Werror handling for presence of configure.in and configure.ac. X-Git-Tag: v1.11.1b~86^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53ac1719ca6b8ecaf1b64176ec72905432a7d8f4;p=thirdparty%2Fautomake.git Fix -Werror handling for presence of configure.in and configure.ac. * lib/Automake/Variable.pm (Automake::Variable): Do not initialize $configure_ac at the global level, before command-line arguments have been parsed. (require_variables): Initialize it here. * tests/configure.test: New test. * tests/Makefile.am: Update. Report by Stefano Lattarini. --- diff --git a/ChangeLog b/ChangeLog index 08e3c737e..97e03ecec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2010-04-20 Ralf Wildenhues + + Fix -Werror handling for presence of configure.in and configure.ac. + * lib/Automake/Variable.pm (Automake::Variable): Do not initialize + $configure_ac at the global level, before command-line arguments + have been parsed. + (require_variables): Initialize it here. + * tests/configure.test: New test. + * tests/Makefile.am: Update. + Report by Stefano Lattarini. + 2010-04-20 Stefano Lattarini Avoid possible false negatives in confh5.test. diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index 8a5b56875..326136031 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -193,7 +193,7 @@ my %_ac_macro_for_var = ); # The name of the configure.ac file. -my $configure_ac = find_configure_ac; +my $configure_ac; # Variables that can be overridden without complaint from -Woverride my %_silent_variable_override = @@ -1132,6 +1132,9 @@ sub require_variables ($$$@) my $res = 0; $reason .= ' but ' unless $reason eq ''; + $configure_ac = find_configure_ac + unless defined $configure_ac; + VARIABLE: foreach my $var (@vars) { diff --git a/tests/Makefile.am b/tests/Makefile.am index f09e843eb..ea81c854c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -211,6 +211,7 @@ condinc2.test \ condlib.test \ condman.test \ condman2.test \ +configure.test \ conf2.test \ confdeps.test \ conff.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 0c557d465..539e94d36 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -449,6 +449,7 @@ condinc2.test \ condlib.test \ condman.test \ condman2.test \ +configure.test \ conf2.test \ confdeps.test \ conff.test \ diff --git a/tests/configure.test b/tests/configure.test new file mode 100755 index 000000000..4b0f28df6 --- /dev/null +++ b/tests/configure.test @@ -0,0 +1,51 @@ +#! /bin/sh +# Copyright (C) 2010 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 . + +# Diagnose if both configure.in and configure.ac are present, prefer +# configure.ac. + +. ./defs || Exit 1 + +set -e + +cat >configure.ac <<\EOF +AC_INIT +AM_INIT_AUTOMAKE([configure], [1.0]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT +EOF + +: >Makefile.am + +$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; } +cat stderr >&2 +grep 'configure.ac.*configure.in.*both present' stderr + +$ACLOCAL -Wno-error 2>stderr +cat stderr >&2 +grep 'configure.ac.*configure.in.*both present' stderr +grep 'proceeding.*configure.ac' stderr + +# Ensure we really proceed with configure.ac. +AUTOMAKE_fails -Werror +grep 'configure.ac.*configure.in.*both present' stderr +grep 'proceeding.*configure.ac' stderr + +AUTOMAKE_run 0 -Wno-error +grep 'configure.ac.*configure.in.*both present' stderr +grep 'proceeding.*configure.ac' stderr + +: