bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

config.status gets too many copies of precious variables [2.52, patch]


From: Aaron Ucko
Subject: config.status gets too many copies of precious variables [2.52, patch]
Date: 26 Nov 2001 12:21:25 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.3

I am one of the developers of a large project with an autoconf-
generated configure script.  Because developers often run configure
with non-default settings for compilers and --with-... flags, some are
in the habit of (indirectly) running config.status --recheck after
updating their source trees.  While this behavior is overkill in most
cases, it should theoretically be harmless.

However, when they have specified non-default compilers (a common case
around here, since Sun WorkShop is popular), the relevant variable
settings keep piling up:

running /bin/sh ./compilers/../configure  --without-debug --with-autodep CC=cc 
CXX=CC CC=cc CXX=CC CC=cc CXX=CC CC=cc CXX=CC CC=cc CXX=CC CC=cc CXX=CC CC=cc 
CXX=CC CC=cc CXX=CC CC=cc CXX=CC CC=cc CXX=CC  --no-create --no-recursion

_AC_ARG_VAR_VALIDATE mentions this issue in a comment, but seems to
classify it as purely cosmetic.  That is not so; repeated executions
of config.status will eventually cause the resulting command line to
exceed the system's limit.  As such, configure should filter out dups
after all.

Here is a patch against 2.52f that not only stops the accumulation but
also gets rid of existing duplicates:

*** lib/autoconf/general.m4.dist        Fri Oct 19 06:40:42 2001
--- lib/autoconf/general.m4     Mon Nov 26 12:14:46 2001
***************
*** 1128,1133 ****
--- 1128,1138 ----
  ac_sep=
  for ac_arg
  do
+   # Filter out dups.
+   for ac_existing_arg in $ac_configure_args; do
+     test "x$ac_arg" = "x$ac_existing_arg" && continue 2
+   done
+ 
    case $ac_arg in
    -no-create | --no-create | --no-creat | --no-crea | --no-cre \
    | --no-cr | --no-c) ;;
***************
*** 1366,1384 ****
          ac_cache_corrupted=:
        fi;;
    esac
!   # Pass precious variables to config.status.  It doesn't matter if
!   # we pass some twice (in addition to the command line arguments).
    if test "$ac_new_set" = set; then
      case $ac_new_val in
  dnl If you change this globbing pattern, test it on an old shell --
  dnl it's sensitive.  Putting any kind of quote in it causes syntax errors.
  [    *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)]
!       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
!       ac_configure_args="$ac_configure_args '$ac_arg'"
!       ;;
!     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
!        ;;
      esac
    fi
  done
  if $ac_cache_corrupted; then
--- 1371,1393 ----
          ac_cache_corrupted=:
        fi;;
    esac
!   # Pass precious variables to config.status.
    if test "$ac_new_set" = set; then
      case $ac_new_val in
  dnl If you change this globbing pattern, test it on an old shell --
  dnl it's sensitive.  Putting any kind of quote in it causes syntax errors.
  [    *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)]
!       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
!     *) ac_arg=$ac_var=$ac_new_val ;;
      esac
+     ac_arg_seen=false
+     for ac_existing_arg in $ac_configure_args; do
+       if test "x$ac_existing_arg" = "x$ac_arg"; then
+         ac_arg_seen=true
+         break
+       fi
+     done
+     test $ac_arg_seen = false && ac_configure_args="$ac_configure_args 
'$ac_arg'"
    fi
  done
  if $ac_cache_corrupted; then



reply via email to

[Prev in Thread] Current Thread [Next in Thread]