From: Akim Demaille Date: Thu, 31 Oct 2002 11:42:22 +0000 (+0000) Subject: * automake.in (&read_am_file): Use $last_where to register the X-Git-Tag: Release-1-7b~392 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=99b1dafb59ba8f29a6ab68f03c463c72997dd945;p=automake.git * automake.in (&read_am_file): Use $last_where to register the _first_ line of a variable definition as location instead of the last one. (&conditional_ambiguous_p): Don't forget to ->string the Conditionals. (&rule_define): Likewise. * tests/location.test: Adjust to exercise this. --- diff --git a/ChangeLog b/ChangeLog index f8a6cb2e..74b820e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-10-31 Akim Demaille + + * automake.in (&read_am_file): Use $last_where to register the + _first_ line of a variable definition as location instead of the + last one. + (&conditional_ambiguous_p): Don't forget to ->string the + Conditionals. + (&rule_define): Likewise. + * tests/location.test: Adjust to exercise this. + 2002-10-25 Charles Wilson * tests/defs.in: Add explicit stanza for python -V. diff --git a/automake.in b/automake.in index 49f23e69..519d9ca0 100755 --- a/automake.in +++ b/automake.in @@ -6089,6 +6089,7 @@ sub check_ambiguous_conditional ($$$) sub conditional_ambiguous_p ($$@) { my ($var, $cond, @conds) = @_; + foreach my $vcond (@conds) { # Note that these rules doesn't consider the following @@ -6106,17 +6107,18 @@ sub conditional_ambiguous_p ($$@) my $message; if ($vcond eq $cond) { - return ("$var multiply defined in condition $cond", $vcond); + return ("$var multiply defined in condition ". $cond->string, + $vcond); } elsif ($vcond->true_when ($cond)) { return ("$var was already defined in condition $vcond, " - . "which implies condition $cond", $vcond); + . "which implies condition ". $cond->string, $vcond); } elsif ($cond->true_when ($vcond)) { return ("$var was already defined in condition $vcond, " - . "which is implied by condition $cond", $vcond); + . "which is implied by condition " . $cond->string, $vcond); } } return ('', ''); @@ -7479,7 +7481,7 @@ sub rule_define ($$$$$) my $oldowner = $target_owner{$target}{$cond}; # Don't mention true conditions in diagnostics. - my $condmsg = $cond == TRUE ? " in condition `$cond'" : ''; + my $condmsg = $cond == TRUE ? " in condition `" . $cond->string . "'" : ''; if ($owner == TARGET_USER) { @@ -7723,6 +7725,7 @@ sub read_am_file ($$) my $last_var_name = ''; my $last_var_type = ''; my $last_var_value = ''; + my $last_where; # FIXME: shouldn't use $_ in this loop; it is too big. while ($_) { @@ -7791,7 +7794,7 @@ sub read_am_file ($$) $comment = $spacing = ''; macro_define ($last_var_name, VAR_MAKEFILE, $last_var_type, $cond, - $last_var_value, $where) + $last_var_value, $last_where) if $cond != FALSE; push (@var_list, $last_var_name); } @@ -7836,6 +7839,7 @@ sub read_am_file ($$) $last_var_name = $1; $last_var_type = $2; $last_var_value = $3; + $last_where = $where->clone; if ($3 ne '' && substr ($3, -1) eq "\\") { # We preserve the `\' because otherwise the long lines @@ -7852,7 +7856,7 @@ sub read_am_file ($$) macro_define ($last_var_name, VAR_MAKEFILE, $last_var_type, $cond, - $last_var_value, $where) + $last_var_value, $last_where) if $cond != FALSE; push (@var_list, $last_var_name); } diff --git a/configure b/configure index 607a9819..08d6f152 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.54 for GNU Automake 1.7a. +# Generated by GNU Autoconf 2.54c for GNU Automake 1.7a. # # Report bugs to . # @@ -84,15 +84,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH="/nonexistent;."; conftest.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conftest.sh + rm -f conf$$.sh fi @@ -849,7 +849,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF GNU Automake configure 1.7a -generated by GNU Autoconf 2.54 +generated by GNU Autoconf 2.54c Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. @@ -864,7 +864,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GNU Automake $as_me 1.7a, which was -generated by GNU Autoconf 2.54. Invocation command line was +generated by GNU Autoconf 2.54c. Invocation command line was $ $0 $@ @@ -917,23 +917,49 @@ _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= +ac_configure_args0= +ac_configure_args1= ac_sep= -for ac_arg +ac_must_keep_next=false +for ac_pass in 1 2 do - case $ac_arg in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n ) continue ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there @@ -1789,7 +1815,7 @@ _ACEOF t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache -if cmp -s $cache_file confcache; then :; else +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file @@ -1960,15 +1986,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH="/nonexistent;."; conftest.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conftest.sh + rm -f conf$$.sh fi @@ -2131,7 +2157,7 @@ _ASBOX cat >&5 <<_CSEOF This file was extended by GNU Automake $as_me 1.7a, which was -generated by GNU Autoconf 2.54. Invocation command line was +generated by GNU Autoconf 2.54c. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -2185,7 +2211,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ GNU Automake config.status 1.7a -configured by $0, generated by GNU Autoconf 2.54, +configured by $0, generated by GNU Autoconf 2.54c, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 @@ -2296,6 +2322,9 @@ if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { @@ -2304,17 +2333,17 @@ $debug || } # Create a (secure) tmp directory for tmp files. -: ${TMPDIR=/tmp} + { - tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=$TMPDIR/cs$$-$RANDOM + tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { - echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } diff --git a/stamp-vti b/stamp-vti index bcad8382..8f44e545 100644 --- a/stamp-vti +++ b/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 10 October 2002 +@set UPDATED 17 October 2002 @set UPDATED-MONTH October 2002 @set EDITION 1.7a @set VERSION 1.7a diff --git a/tests/location.test b/tests/location.test index ac785ee2..ad97f3c2 100755 --- a/tests/location.test +++ b/tests/location.test @@ -39,6 +39,13 @@ endif if COND1 bin_PROGRAMS += ctags endif +VAR = 1 \ + 2 \ + 3 + +VAR = 1 \ + 2 \ + 3 END $ACLOCAL @@ -49,3 +56,5 @@ grep 'Makefile\.am:3:.*library.*libfoo\.a' stderr grep 'Makefile\.am:6:.*program.*ctags' stderr grep 'redefinition of.*libfoo\.a' stderr grep 'redefinition of.*ctags' stderr +grep 'Makefile.am:12: VAR multiply defined in condition TRUE' stderr +grep 'Makefile.am:8: ... .VAR. previously defined here' stderr diff --git a/version.texi b/version.texi index bcad8382..8f44e545 100644 --- a/version.texi +++ b/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 10 October 2002 +@set UPDATED 17 October 2002 @set UPDATED-MONTH October 2002 @set EDITION 1.7a @set VERSION 1.7a