osdir.com
mailing list archive

Subject: Re: This conditional test fails in 1.6d - msg#00086

List: sysutils.automake.general

Date: Prev Next Index Thread: Prev Next Index
>>> "Pavel" == Pavel Roskin <proski@xxxxxxx> writes:

[...]

Pavel> Well, my package doesn't. Here's the test (full test
Pavel> with copyright is attached):

Thanks a lot! I'm installing the following fix.

2002-09-19 Alexandre Duret-Lutz <duret_g@xxxxxxxx>

* automake.in (require_variables): Search variable definitions
in any condition implied by $cond.
* tests/cond25.test: New file.
* tests/Makefile.am (TESTS): Add cond25.test.
Reported by Pavel Roskin.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1357
diff -u -r1.1357 automake.in
--- automake.in 18 Sep 2002 19:37:35 -0000 1.1357
+++ automake.in 19 Sep 2002 07:57:50 -0000
@@ -8947,13 +8947,26 @@
my $res = 0;
$reason .= ' but ' unless $reason eq '';

+ VARIABLE:
foreach my $var (@vars)
{
# Nothing to do if the variable exists. The $configure_vars test
# needed for strange variables like AMDEPBACKSLASH or ANSI2KNR
# that are AC_SUBST'ed but never macro_define'd.
- next if ((exists $var_value{$var} && exists $var_value{$var}{$cond})
- || exists $configure_vars{$var});
+ next VARIABLE
+ if ((exists $var_value{$var} && exists $var_value{$var}{$cond})
+ || exists $configure_vars{$var});
+
+ # If the variable exists but was not defined in $cond,
+ # look for any definition implied by $cond.
+ if (exists $var_value{$var})
+ {
+ for my $vcond (keys %{$var_value{$var}})
+ {
+ next VARIABLE
+ if (conditional_true_when ($vcond, $cond));
+ }
+ }

++$res;

Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.440
diff -u -r1.440 Makefile.am
--- tests/Makefile.am 18 Sep 2002 18:43:24 -0000 1.440
+++ tests/Makefile.am 19 Sep 2002 07:57:52 -0000
@@ -90,6 +90,7 @@
cond22.test \
cond23.test \
cond24.test \
+cond25.test \
condd.test \
condincl.test \
condincl2.test \
Index: tests/cond25.test
===================================================================
RCS file: tests/cond25.test
diff -N tests/cond25.test
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/cond25.test 19 Sep 2002 07:57:52 -0000
@@ -0,0 +1,43 @@
+#!/bin/sh
+# Copyright (C) 2002 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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.
+#
+# GNU Automake 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 autoconf; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Check that conditional primaries can use non-conditional directories.
+# From Pavel Roskin.
+
+. ./defs
+
+set -e
+
+cat >>configure.in << 'EOF'
+AM_CONDITIONAL([USE_FOO], [true])
+AC_PROG_CC
+EOF
+
+cat >Makefile.am << 'EOF'
+if USE_FOO
+foo_PROGRAMS = foo
+endif
+
+foodir = $(libdir)/foo
+foo_SOURCES = foo.c
+EOF
+
+$ACLOCAL
+$AUTOMAKE
--
Alexandre Duret-Lutz






Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

autoreconf misses ltmain.sh

Am Mit, 2002-09-18 um 23.23 schrieb Alexandre Duret-Lutz: > Please SHOUT LOUD if your package works with Automake 1.6.3 but > doesn't with 1.6d. This bug has been present with previous versions of automake and autoconf (IIRC, it also has been reported several times before). Anyway, it is still present with automake-1.6d, autoconf-2.54 and libtool-1.4.2. # ls Makefile.am configure.ac hello.c # cat configure.ac AC_PREREQ(2.54) AC_INIT([lttest],[0.0]) AC_CONFIG_SRCDIR([hello.c]) AC_CONFIG_AUX_DIR(.) AM_INIT_AUTOMAKE AC_PROG_CC AM_PROG_LIBTOOL AC_CONFIG_FILES([Makefile]) AC_OUTPUT # cat Makefile.am noinst_LTLIBRARIES = libhello.la libhello_la_SOURCES = hello.c # autoreconf -f -i autoreconf: `aclocal.m4' is created You should update your `aclocal.m4' by running aclocal. Putting files in AC_CONFIG_AUX_DIR, `..'. autoreconf: `aclocal.m4' is unchanged configure.ac: installing `./install-sh' configure.ac: installing `./mkinstalldirs' configure.ac: installing `./missing' configure.ac:9: installing `./config.guess' configure.ac:9: installing `./config.sub' Makefile.am: installing `./COPYING' Makefile.am: installing `./INSTALL' Makefile.am: required file `./NEWS' not found Makefile.am: required file `./README' not found Makefile.am: required file `./AUTHORS' not found Makefile.am: required file `./ChangeLog' not found Makefile.am: installing `./depcomp' configure.ac:9: required file `./ltmain.sh' not found # ls COPYING Makefile.in config.guess configure.ac install-sh INSTALL aclocal.m4 config.sub depcomp missing Makefile.am autom4te.cache configure hello.c mkinstalldirs => ltmain.sh is missing Consequently, subsequent configure+make runs fail: # configure [..] # make if /bin/sh ./libtool --mode=compile gcc -DPACKAGE_NAME=\"lttest\" -DPACKAGE_TARNAME=\"lttest\" -DPACKAGE_VERSION=\"0.0\" -DPACKAGE_STRING=\"lttest\ 0.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"lttest\" -DVERSION=\"0.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -I. -I. -g -O2 -MT hello.lo -MD -MP -MF ".deps/hello.Tpo" \ -c -o hello.lo `test -f 'hello.c' || echo './'`hello.c; \ then mv ".deps/hello.Tpo" ".deps/hello.Plo"; \ else rm -f ".deps/hello.Tpo"; exit 1; \ fi ./libtool: ./libtool: No such file or directory make: *** [hello.lo] Error 1 Ralf

Next Message by Date: click to view message preview

Re: .PHONY and 1.6d & Custom make rules

>>> "Ralf" == Ralf Corsepius <corsepiu@xxxxxxxxxxxxxx> writes: [...] Ralf> automake-1.6d complains about this: Ralf> # cat Makefile.am Ralf> .PHONY: foo Ralf> .PHONY: bar Ralf> # automake Ralf> Makefile.am:2: redefinition of `.PHONY'... Ralf> Makefile.am:1: ... `.PHONY' previously defined here. [...] Ralf> Using custom compilations rules in a Makefile.am: Ralf> # cat Makefile.am: Ralf> ${ARCH}/%.$(OBJEXT): %.S Ralf> test -d ${ARCH} || mkdir ${ARCH} Ralf> ${CCASCOMPILE} -o $@ -c $< Ralf> ${ARCH}/%.$(OBJEXT): %.c Ralf> test -d ${ARCH} || mkdir ${ARCH} Ralf> ${COMPILE} -o $@ -c $< Ralf> # autoreconf -fi Ralf> autoreconf: `aclocal.m4' is unchanged Ralf> Makefile.am:5: redefinition of `${ARCH}/%.$(OBJEXT)'... Ralf> Makefile.am:1: ... `${ARCH}/%.$(OBJEXT)' previously defined here. Thanks a lot. I'm installing the following patch (it addresses both errors). Automake doesn't record enough informations to diagnose duplicates in user rules, so let's disable this diagnostic until the internal handling of rules is improved. Ralf> 1. automake-1.6.3 and previous versions did not complain. Ralf> 2. automake's complaint is wrong. These are two different make rules. Ralf> Could it be that automake-1.6d is confused about variables (VAR=..) and Ralf> rules (VAR: ...)? It just that make doesn't now anything about non-POSIX `%'-style pattern rules. This looks like duplicate rules for target `${ARCH}/%.$(OBJEXT)' if you ignore what `%' means. 2002-09-19 Alexandre Duret-Lutz <duret_g@xxxxxxxx> * automake.in (rule_define): Don't diagnose duplicate user rules. * tests/phony.test, tests/percent2.test: New files. * tests/Makefile.am (TESTS): Add them. Index: automake.in =================================================================== RCS file: /cvs/automake/automake/automake.in,v retrieving revision 1.1358 diff -u -r1.1358 automake.in --- automake.in 19 Sep 2002 07:59:36 -0000 1.1358 +++ automake.in 19 Sep 2002 08:57:54 -0000 @@ -7382,7 +7382,7 @@ # rule_define ($TARGET, $SOURCE, $OWNER, $COND, $WHERE) # ----------------------------------------------------- # Define a new rule. $TARGET is the rule name. $SOURCE -# si the filename the rule comes from. $OWNER is the +# is the filename the rule comes from. $OWNER is the # owener of the rule (TARGET_AUTOMAKE or TARGET_USER). # $COND is the condition string under which the rule is defined. # $WHERE is where the rule is defined (file name and/or line number). @@ -7413,6 +7413,11 @@ $target = $noexe; + # A GNU make-style pattern rule has a single "%" in the target name. + msg ('portability', $where, + "`%'-style pattern rules are a GNU make extension") + if $target =~ /^[^%]*%[^%]*$/; + # Diagnose target redefinitions. if (exists $target_source{$target}{$cond}) { @@ -7433,9 +7438,27 @@ { if ($oldowner eq TARGET_USER) { - msg ('syntax', $where, "redefinition of `$target'$condmsg..."); - msg_cond_target ('syntax', $cond, $target, - "... `$target' previously defined here."); + # Ignore `%'-style pattern rules. We'd need the + # dependencies to detect duplicates, and they are + # already diagnosed as unportable by -Wportability. + if ($target !~ /^[^%]*%[^%]*$/) + { + ## FIXME: Presently we can't diagnose duplcate user rules + ## because we doesn't distinguish rules with commands + ## from rules that only add dependencies. E.g., + ## .PHONY: foo + ## .PHONY: bar + ## is legitimate. (This is phony.test.) + + # msg ('syntax', $where, + # "redefinition of `$target'$condmsg..."); + # msg_cond_target ('syntax', $cond, $target, + # "... `$target' previously defined here."); + } + # Return so we don't redefine the rule in our tables, + # don't check for ambiguous conditional, etc. The rule + # will be output anyway beauce &read_am_file ignore the + # return code. return (); } else @@ -7477,11 +7500,6 @@ prog_error ("Unreachable place reached."); } - # A GNU make-style pattern rule has a single "%" in the target name. - msg ('portability', $where, - "`%'-style pattern rules are a GNU make extension") - if $target =~ /^[^%]*%[^%]*$/; - # Conditions for which the rule should be defined. my @conds = $cond; @@ -7751,9 +7769,9 @@ # Found a rule. $prev_state = IN_RULE_DEF; - # For TARGET_USER rules, rule_define won't reject a rule - # without diagnosic an error. So we go on and ignore the - # return value. + # For now we have to output all definitions of user rules + # and can't diagnose duplicates (see the comment in + # rule_define). So we go on and ignore the return value. rule_define ($1, $amfile, TARGET_USER, $cond || 'TRUE', $here); check_variable_expansions ($_, $here); Index: tests/Makefile.am =================================================================== RCS file: /cvs/automake/automake/tests/Makefile.am,v retrieving revision 1.441 diff -u -r1.441 Makefile.am --- tests/Makefile.am 19 Sep 2002 07:59:37 -0000 1.441 +++ tests/Makefile.am 19 Sep 2002 08:57:56 -0000 @@ -274,6 +274,8 @@ package.test \ parse.test \ percent.test \ +percent2.test \ +phony.test \ pluseq.test \ pluseq2.test \ pluseq3.test \ Index: tests/percent2.test =================================================================== RCS file: tests/percent2.test diff -N tests/percent2.test --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ tests/percent2.test 19 Sep 2002 08:57:56 -0000 @@ -0,0 +1,46 @@ +#!/bin/sh +# Copyright (C) 2002 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake 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. +# +# GNU Automake 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 autoconf; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# Another test for -Wportability warning about %-style rules, plus +# make sure we don't warn about duplicate definition for +# `${ARCH}/%.$(OBJEXT):'. +# Report from Ralf Corsepius. + +. ./defs + +set -e + +cat >>Makefile.am << 'EOF' +${ARCH}/%.$(OBJEXT): %.S + test -d ${ARCH} || mkdir ${ARCH} + ${CCASCOMPILE} -o $@ -c $< + +${ARCH}/%.$(OBJEXT): %.c + test -d ${ARCH} || mkdir ${ARCH} + ${COMPILE} -o $@ -c $< +EOF + +$ACLOCAL +$AUTOMAKE 2>stderr && exit 1 +cat stderr +grep '%.*pattern.*rules' stderr + +# No error otherwise. +$AUTOMAKE -Wno-portability Index: tests/phony.test =================================================================== RCS file: tests/phony.test diff -N tests/phony.test --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ tests/phony.test 19 Sep 2002 08:57:56 -0000 @@ -0,0 +1,34 @@ +#!/bin/sh +# Copyright (C) 2002 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake 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. +# +# GNU Automake 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 autoconf; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# Make sure .PHONY can be given depenencies several times. +# From Ralf Corsepius. + +. ./defs + +set -e + +cat >Makefile.am << 'EOF' +.PHONY: foo +.PHONY: bar +EOF + +$ACLOCAL +$AUTOMAKE -- Alexandre Duret-Lutz

Previous Message by Thread: click to view message preview

This conditional test fails in 1.6d

Hello! > Please SHOUT LOUD if your package works with Automake 1.6.3 but > doesn't with 1.6d. Well, my package doesn't. Here's the test (full test with copyright is attached): ------------------------------------ cat >>configure.in << 'EOF' AM_CONDITIONAL([USE_FOO], [true]) AC_PROG_CC EOF cat >Makefile.am << 'EOF' if USE_FOO foo_PROGRAMS = foo endif foodir = $(libdir)/foo foo_SOURCES = foo.c EOF $ACLOCAL || exit 1 $AUTOMAKE || exit 1 ------------------------------------ === Running test ./cond25.test /usr/src/automake/tests/testSubDir Makefile.am:2: `foo_PROGRAMS' is used but `foodir' is undefined. Makefile.am:6: unused variable: `foo_SOURCES' FAIL: cond25.test Automake 1.6.3 passes this test. I'm using Autoconf 2.54, bash 2.05a, perl 5.6.1. -- Regards, Pavel Roskin cond25.test.gz Description: GNU Zip compressed data

Next Message by Thread: click to view message preview

Re: This conditional test fails in 1.6d

Hello, Alexandre! > Pavel> Well, my package doesn't. Here's the test (full test > Pavel> with copyright is attached): > > Thanks a lot! I'm installing the following fix. The fix works. GNU Midnight Commander works with CVS Automake now. Thank you! -- Regards, Pavel Roskin
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by