autoconf-patches
[Top][All Lists]
Advanced

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

[PATCH v2] AS_VAR_APPEND


From: Eric Blake
Subject: [PATCH v2] AS_VAR_APPEND
Date: Tue, 21 Oct 2008 16:40:23 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Hopefully this addresses Ralf's concerns.  The first patch is altered to 
mention the cases where AS_VAR_APPEND is likely to be useful rather than adding 
overhead.  It also mentions the difference in syntax between AS_VAR_APPEND and 
AS_VAR_SET (based on whether field splitting/file name expansion will occur).  
The second patch prunes down the set of variables that are appended to 
(favoring appends only for variables that are used repeatedly or can reflect a 
potentially long command line).

Comments or objections to this version of the patch?

>From 208cf3396c803951069b6b351b66c396ac475787 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Mon, 20 Oct 2008 05:50:01 -0600
Subject: [PATCH] Add AS_VAR_APPEND.

* lib/m4sugar/m4sh.m4 (_AS_VAR_APPEND_PREPARE)
(_AS_VAR_APPEND_WORKS, AS_VAR_APPEND): New macros.
(AS_PREPARE, _AS_PREPARE): Emit preparation.
* tests/m4sh.at (AS@&address@hidden): New test.
* doc/autoconf.texi (Polymorphic Variables) <AS_VAR_APPEND>:
Document new macro.
<AS_VAR_SET>: Mention ramification of `""` rules.
* NEWS: Mention new macro.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog           |   12 ++++++++++++
 NEWS                |    2 +-
 doc/autoconf.texi   |   30 +++++++++++++++++++++++++++++-
 lib/m4sugar/m4sh.m4 |   51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 tests/m4sh.at       |   37 ++++++++++++++++++++++++++++++++++++-
 5 files changed, 128 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e6759f4..8f7c19d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-10-21  Eric Blake  <address@hidden>
+
+       Add AS_VAR_APPEND.
+       * lib/m4sugar/m4sh.m4 (_AS_VAR_APPEND_PREPARE)
+       (_AS_VAR_APPEND_WORKS, AS_VAR_APPEND): New macros.
+       (AS_PREPARE, _AS_PREPARE): Emit preparation.
+       * tests/m4sh.at (AS@&address@hidden): New test.
+       * doc/autoconf.texi (Polymorphic Variables) <AS_VAR_APPEND>:
+       Document new macro.
+       <AS_VAR_SET>: Mention ramification of `""` rules.
+       * NEWS: Mention new macro.
+
 2008-10-21  Paolo Bonzini  <address@hidden>
        and Eric Blake  <address@hidden>
 
diff --git a/NEWS b/NEWS
index 147639b..4ac8e8a 100644
--- a/NEWS
+++ b/NEWS
@@ -17,7 +17,7 @@ GNU Autoconf NEWS - User visible changes.
    m4_set_map
 
 ** The following documented m4sh macros are new:
-   AS_LINENO_PREPARE  AS_ME_PREPARE  AS_VAR_COPY
+   AS_LINENO_PREPARE  AS_ME_PREPARE  AS_VAR_APPEND  AS_VAR_COPY
 
 ** The following m4sh macros are documented now:
    AS_ECHO  AS_ECHO_N  AS_LITERAL_IF  AS_UNSET  AS_VAR_IF  AS_VAR_POPDEF
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index eed40c5..4d44de6 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -12070,6 +12070,31 @@ Polymorphic Variables
 @end example
 @end defmac
 
address@hidden AS_VAR_APPEND (@var{var}, @var{text})
address@hidden
+Emit shell code to append the shell expansion of @var{text} to the end
+of the current contents of the polymorphic shell variable @var{var},
+taking advantage of shells that provide the @samp{+=} extension for more
+efficient scaling.
+
+For situations where the final contents of @var{var} are relatively
+short (less than 256 bytes), it is more efficient to use the simpler
+code sequence of @address@hidden"address@hidden@address@hidden@var{text}"} (or 
its
+polymorphic equivalent of @code{AS_VAR_COPY([tmp], address@hidden)} and
address@hidden(address@hidden, ["$tmp"@var{text}])}).  But in the case
+when the script will be repeatedly appending text into @code{var},
+issues of scaling start to become apparent.  A naive implementation
+requires execution time linear to the length of the current contents of
address@hidden as well as the length of @var{text} for a single append, for
+an overall quadratic scaling with multiple appends.  This macro takes
+advantage of shells which provide the extension
address@hidden@address@hidden, which can provide amortized constant time
+for a single append, for an overall linear scaling with multiple
+appends.  Note that unlike @code{AS_VAR_SET}, this macro requires that
address@hidden be quoted properly to avoid field splitting and file name
+expansion.
address@hidden defmac
+
 @defmac AS_VAR_COPY (@var{dest}, @var{source})
 @asindex{VAR_COPY}
 Emit shell code to assign the contents of the polymorphic shell variable
@@ -12163,7 +12188,10 @@ Polymorphic Variables
 @defmac AS_VAR_SET (@var{var}, @ovar{value})
 @asindex{VAR_SET}
 Emit shell code to assign the contents of the polymorphic shell variable
address@hidden to the shell expansion of @var{value}.
address@hidden to the shell expansion of @var{value}.  @var{value} is not
+subject to field splitting or file name expansion, so if command
+substitution is used, it should be done with @samp{`""`} rather than
address@hidden"`""`"} (@pxref{Shell Substitutions}).
 @end defmac
 
 @defmac AS_VAR_SET_IF (@var{var}, @ovar{if-set}, @ovar{if-undef})
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 9ef15f5..f27898b 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -280,6 +280,7 @@ _AS_TEST_PREPARE
 _AS_TR_CPP_PREPARE
 _AS_TR_SH_PREPARE
 _AS_UNSET_PREPARE
+_AS_VAR_APPEND_PREPARE
 m4_popdef([AS_REQUIRE])dnl
 ])
 
@@ -303,6 +304,7 @@ AS_REQUIRE([_AS_TEST_PREPARE])
 AS_REQUIRE([_AS_TR_CPP_PREPARE])
 AS_REQUIRE([_AS_TR_SH_PREPARE])
 AS_REQUIRE([_AS_UNSET_PREPARE])
+AS_REQUIRE([_AS_VAR_APPEND_PREPARE], [], [M4SH-INIT-FN])
 m4_divert_pop[]dnl
 ])
 
@@ -1637,6 +1639,52 @@ AS_REQUIRE([_AS_TR_CPP_PREPARE])dnl
 # when passed through eval, and a polymorphic name is either type.
 
 
+# _AS_VAR_APPEND_PREPARE
+# ----------------------
+# Define as_func_append to the optimum definition for the current
+# shell (bash and zsh provide the += assignment operator to avoid
+# quadratic append growth).
+m4_defun([_AS_VAR_APPEND_PREPARE],
+[AS_FUNCTION_DESCRIBE([as_func_append], [VAR VALUE],
+[Append the text in VALUE to the end of the definition contained in
+VAR.  Take advantage of any shell optimizations that allow amortized
+linear growth, instead of the typical quadratic growth present in
+naive implementations.])
+AS_IF([_AS_RUN(["AS_ESCAPE([_AS_VAR_APPEND_WORKS])"])],
+[eval "AS_ESCAPE([as_func_append ()
+  {
+    eval $[]1+=\$[]2
+  }])"],
+[as_func_append ()
+  {
+    eval $[]1=\$$[]1\$[]2
+  }]) # as_func_append
+])
+
+
+# _AS_VAR_APPEND_WORKS
+# --------------------
+# Output a shell test to discover whether += works.
+m4_define([_AS_VAR_APPEND_WORKS],
+[as_var=1; as_var+=2; test x$as_var = x12])
+
+
+# AS_VAR_APPEND(VAR, VALUE)
+# -------------------------
+# Append the shell expansion of VALUE to the end of the existing
+# contents of the polymorphic shell variable VAR, taking advantage of
+# any shell optimizations that allow repeated appends to result in
+# amortized linear scaling rather than quadratic behavior.  This macro
+# is not worth the overhead unless the expected final size of the
+# contents of VAR outweigh the typical VALUE size of repeated appends.
+# Note that unlike AS_VAR_SET, VALUE must be properly quoted to avoid
+# field splitting and file name expansion.
+m4_define([AS_VAR_APPEND],
+[_AS_DETECT_SUGGESTED([_AS_VAR_APPEND_WORKS])dnl
+AS_REQUIRE([_AS_VAR_APPEND_PREPARE], [], [M4SH-INIT-FN])dnl
+as_func_append $1 $2])
+
+
 # AS_VAR_COPY(DEST, SOURCE)
 # -------------------------
 # Set the polymorphic shell variable DEST to the contents of the polymorphic
@@ -1724,7 +1772,8 @@ m4_pushdef([$1], [$as_[$1]])])])
 # AS_VAR_SET(VARIABLE, VALUE)
 # ---------------------------
 # Set the contents of the polymorphic shell VARIABLE to the shell
-# expansion of VALUE.
+# expansion of VALUE.  VALUE is immune to field splitting and file
+# name expansion.
 m4_define([AS_VAR_SET],
 [AS_LITERAL_IF([$1],
               [$1=$2],
diff --git a/tests/m4sh.at b/tests/m4sh.at
index b0ddafd..6ea6358 100644
--- a/tests/m4sh.at
+++ b/tests/m4sh.at
@@ -926,7 +926,7 @@ AT_CLEANUP
 ## AS_VAR_*.  ##
 ## ---------- ##
 
-AT_SETUP([AS@&address@hidden)
+AT_SETUP([AS@&address@hidden basics])
 AT_KEYWORDS([m4sh AS@&address@hidden AS@&address@hidden AS@&address@hidden)
 AT_KEYWORDS([AS@&address@hidden AS@&address@hidden AS@&address@hidden)
 AT_KEYWORDS([AS@&address@hidden AS@&address@hidden)
@@ -1018,6 +1018,41 @@ ok
 AT_CLEANUP
 
 
+## --------------- ##
+## AS_VAR_APPEND.  ##
+## --------------- ##
+
+AT_SETUP([AS@&address@hidden)
+AT_KEYWORDS([m4sh AS@&address@hidden)
+
+AT_DATA_M4SH([script.as], [[dnl
+AS_INIT
+# Literals.
+AS_VAR_APPEND([foo], ["hello,  "])
+AS_VAR_APPEND([foo], [world])
+echo "$foo"
+# Indirects via shell vars.
+num=1
+AS_VAR_APPEND([foo$num], ['hello,  '])
+AS_VAR_APPEND([foo$num], [`echo "world"`])
+echo "$foo1"
+# Indirects via command substitution.
+h=hello w=',  world'
+AS_VAR_APPEND([`echo foo2`], [${h}])
+AS_VAR_APPEND([`echo foo2`], ["$w"])
+echo "$foo2"
+]])
+
+AT_CHECK_M4SH
+AT_CHECK([./script], [],
+[[hello,  world
+hello,  world
+hello,  world
+]])
+
+AT_CLEANUP
+
+
 ## ----------------- ##
 ## AS_INIT cleanup.  ##
 ## ----------------- ##
-- 
1.6.0.2


>From f4ba9e9bbe8cb0862a5f75ac1d4c5a94adf7fd52 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Tue, 21 Oct 2008 10:28:19 -0600
Subject: [PATCH] Use AS_VAR_APPEND.

* lib/autoconf/functions.m4 (AC_CHECK_FUNCS_ONCE): Use new macro.
* lib/autoconf/general.m4 (_AC_INIT_PREPARE)
(_AC_LIBOBJS_NORMALIZE): Likewise.
* lib/autoconf/headers.m4 (AC_CHECK_HEADERS_ONCE): Likewise.
* lib/autoconf/status.m4 (_AC_OUTPUT_SUBDIRS)
(_AC_OUTPUT_CONFIG_STATUS, _AC_OUTPUT_MAIN_LOOP): Likewise.
* lib/autotest/general.m4 (AT_INIT): Likewise.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog                 |    9 +++++++++
 lib/autoconf/functions.m4 |    6 +++---
 lib/autoconf/general.m4   |   12 ++++++------
 lib/autoconf/headers.m4   |    6 +++---
 lib/autoconf/status.m4    |   10 +++++-----
 lib/autotest/general.m4   |   24 ++++++++++++------------
 6 files changed, 38 insertions(+), 29 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8f7c19d..ded5c63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2008-10-21  Eric Blake  <address@hidden>
 
+       Use AS_VAR_APPEND.
+       * lib/autoconf/functions.m4 (AC_CHECK_FUNCS_ONCE): Use new macro.
+       * lib/autoconf/general.m4 (_AC_INIT_PREPARE)
+       (_AC_LIBOBJS_NORMALIZE): Likewise.
+       * lib/autoconf/headers.m4 (AC_CHECK_HEADERS_ONCE): Likewise.
+       * lib/autoconf/status.m4 (_AC_OUTPUT_SUBDIRS)
+       (_AC_OUTPUT_CONFIG_STATUS, _AC_OUTPUT_MAIN_LOOP): Likewise.
+       * lib/autotest/general.m4 (AT_INIT): Likewise.
+
        Add AS_VAR_APPEND.
        * lib/m4sugar/m4sh.m4 (_AS_VAR_APPEND_PREPARE)
        (_AS_VAR_APPEND_WORKS, AS_VAR_APPEND): New macros.
diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4
index c325f30..4788139 100644
--- a/lib/autoconf/functions.m4
+++ b/lib/autoconf/functions.m4
@@ -1,7 +1,7 @@
 # This file is part of Autoconf.                       -*- Autoconf -*-
 # Checking for functions.
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-# Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# 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
@@ -104,7 +104,7 @@ AC_DEFUN([AC_CHECK_FUNCS_ONCE],
   m4_foreach_w([AC_Func], [$1],
     [AC_DEFUN([_AC_Func_]m4_defn([AC_Func]),
        [m4_divert_text([INIT_PREPARE],
-         [ac_func_list="$ac_func_list AC_Func"])
+         [AS_VAR_APPEND([ac_func_list], [" AC_Func"])])
        _AC_FUNCS_EXPANSION])
      AC_REQUIRE([_AC_Func_]m4_defn([AC_Func]))])
 ])
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index b5c720d..ed32e24 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -1226,9 +1226,9 @@ do
       ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
-    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    1) AS_VAR_APPEND([ac_configure_args0], [" '$ac_arg'"]) ;;
     2)
-      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      AS_VAR_APPEND([ac_configure_args1], [" '$ac_arg'"])
 dnl If trying to remove duplicates, be sure to (i) keep the *last*
 dnl value (e.g. --prefix=1 --prefix=2 --prefix=1 might keep 2 only),
 dnl and (ii) not to strip long options (--prefix foo --prefix bar might
@@ -1250,7 +1250,7 @@ dnl exit don't matter.
          -* ) ac_must_keep_next=true ;;
        esac
       fi
-      ac_configure_args="$ac_configure_args '$ac_arg'"
+      AS_VAR_APPEND([ac_configure_args], [" '$ac_arg'"])
       ;;
     esac
   done
@@ -1594,7 +1594,7 @@ for ac_var in $ac_precious_vars; do
     esac
     case " $ac_configure_args " in
       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+      *) AS_VAR_APPEND([ac_configure_args], [" '$ac_arg'"]) ;;
     esac
   fi
 done
@@ -2784,8 +2784,8 @@ for ac_i in : $LIB@&address@hidden; do test "x$ac_i" = x: 
&& 
continue
   ac_i=`AS_ECHO(["$ac_i"]) | sed "$ac_script"`
   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
   #    will be set to the directory where LIBOBJS objects are built.
-  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+  AS_VAR_APPEND([ac_libobjs], [" \${LIBOBJDIR}$ac_i\$U.$ac_objext"])
+  AS_VAR_APPEND([ac_ltlibobjs], [" \${LIBOBJDIR}$ac_i"'$U.lo'])
 done
 AC_SUBST([LIB@&address@hidden, [$ac_libobjs])
 AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4
index 16b2737..cb9f653 100644
--- a/lib/autoconf/headers.m4
+++ b/lib/autoconf/headers.m4
@@ -1,8 +1,8 @@
 # This file is part of Autoconf.                       -*- Autoconf -*-
 # Checking for headers.
 #
-# Copyright (C) 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software
-# Foundation, Inc.
+# Copyright (C) 1988, 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2008
+# 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
@@ -212,7 +212,7 @@ AC_DEFUN([AC_CHECK_HEADERS_ONCE],
   m4_foreach_w([AC_Header], [$1],
     [AC_DEFUN([_AC_Header_]m4_quote(m4_translit(AC_Header, [./-], [___])),
        [m4_divert_text([INIT_PREPARE],
-         [ac_header_list="$ac_header_list AC_Header"])
+         [AS_VAR_APPEND([ac_header_list], [" AC_Header"])])
        _AC_HEADERS_EXPANSION])
      AC_REQUIRE([_AC_Header_]m4_quote(m4_translit(AC_Header, [./-], [___])))])
 ])
diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4
index 26fa2cf..3cbf618 100644
--- a/lib/autoconf/status.m4
+++ b/lib/autoconf/status.m4
@@ -1151,7 +1151,7 @@ if test "$no_recursion" != yes; then
       case $ac_arg in
       *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
       esac
-      ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;;
+      AS_VAR_APPEND([ac_sub_configure_args], [" '$ac_arg'"]) ;;
     esac
   done
 
@@ -1485,7 +1485,7 @@ m4_ifdef([_AC_SEEN_CONFIG(FILES)], [dnl
     case $ac_optarg in
     *\'*) ac_optarg=`AS_ECHO(["$ac_optarg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
-    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    AS_VAR_APPEND([CONFIG_FILES], [" '$ac_optarg'"])
     ac_need_defaults=false;;
 ])dnl
 m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [dnl
@@ -1494,7 +1494,7 @@ m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [dnl
     case $ac_optarg in
     *\'*) ac_optarg=`AS_ECHO(["$ac_optarg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
-    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    AS_VAR_APPEND([CONFIG_HEADERS], [" '$ac_optarg'"])
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
@@ -1511,7 +1511,7 @@ Try `$[0] --help' for more information.]);;
   -*) AC_MSG_ERROR([unrecognized option: $[1]
 Try `$[0] --help' for more information.]) ;;
 
-  *) ac_config_targets="$ac_config_targets $[1]"
+  *) AS_VAR_APPEND([ac_config_targets], [" $[1]"])
      ac_need_defaults=false ;;
 
   esac
@@ -1671,7 +1671,7 @@ do
           AC_MSG_ERROR([cannot find input file: $ac_f]);;
       esac
       case $ac_f in *\'*) ac_f=`AS_ECHO(["$ac_f"]) | 
sed "s/'/'\\\\\\\\''/g"`;; esac
-      ac_file_inputs="$ac_file_inputs '$ac_f'"
+      AS_VAR_APPEND([ac_file_inputs], [" '$ac_f'"])
     done
 
     # Let's still pretend it is `configure' which instantiates (i.e., don't
diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index 8df9395..149fff1 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -510,7 +510,7 @@ do
 
     [[0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]])
        at_func_validate_ranges at_option
-       at_groups="$at_groups$at_option "
+       AS_VAR_APPEND([at_groups], ["$at_option "])
        ;;
 
     # Ranges
@@ -519,7 +519,7 @@ do
        at_func_validate_ranges at_range_start
        at_range=`AS_ECHO([" $at_groups_all "]) | \
          sed -e 's/^.* \('$at_range_start' \)/\1/'`
-       at_groups="$at_groups$at_range "
+       AS_VAR_APPEND([at_groups], ["$at_range "])
        ;;
 
     [-[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]])
@@ -527,7 +527,7 @@ do
        at_func_validate_ranges at_range_end
        at_range=`AS_ECHO([" $at_groups_all "]) | \
          sed -e 's/\( '$at_range_end'\) .*$/\1/'`
-       at_groups="$at_groups$at_range "
+       AS_VAR_APPEND([at_groups], ["$at_range "])
        ;;
 
     [[0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9]] | \
@@ -547,7 +547,7 @@ do
        at_range=`AS_ECHO([" $at_groups_all "]) | \
          sed -e 's/^.*\( '$at_range_start' \)/\1/' \
              -e 's/\( '$at_range_end'\) .*$/\1/'`
-       at_groups="$at_groups$at_range "
+       AS_VAR_APPEND([at_groups], ["$at_range "])
        ;;
 
     # Directory selection.
@@ -603,7 +603,7 @@ do
        at_groups_selected=`AS_ECHO(["$at_groups_selected"]) | sed 's/;.*//' |
          tr "$as_nl" ' '
        `
-       at_groups="$at_groups$at_groups_selected "
+       AS_VAR_APPEND([at_groups], ["$at_groups_selected "])
        ;;
 m4_divert_pop([PARSE_ARGS])dnl
 dnl Process *=* last to allow for user specified --option=* type arguments.
@@ -619,7 +619,7 @@ m4_divert_push([PARSE_ARGS_END])dnl
        at_value=`AS_ECHO(["$at_optarg"]) | sed "s/'/'\\\\\\\\''/g"`
        # Export now, but save eval for later and for debug scripts.
        export $at_envvar
-       at_debug_args="$at_debug_args $at_envvar='$at_value'"
+       AS_VAR_APPEND([at_debug_args], [" $at_envvar='$at_value'"])
        ;;
 
      *) AS_ECHO(["$as_me: invalid option: $at_option"]) >&2
@@ -840,19 +840,19 @@ fi
 AUTOTEST_PATH=`AS_ECHO(["$AUTOTEST_PATH"]) | sed "s|:|$PATH_SEPARATOR|g"`
 at_path=
 _AS_PATH_WALK([$AUTOTEST_PATH $PATH],
-[test -n "$at_path" && at_path=$at_path$PATH_SEPARATOR
+[test -n "$at_path" && AS_VAR_APPEND([at_path], [$PATH_SEPARATOR])
 case $as_dir in
   [[\\/]]* | ?:[[\\/]]* )
-    at_path=$at_path$as_dir
+    AS_VAR_APPEND([at_path], ["$as_dir"])
     ;;
   * )
     if test -z "$at_top_build_prefix"; then
       # Stand-alone test suite.
-      at_path=$at_path$as_dir
+      AS_VAR_APPEND([at_path], ["$as_dir"])
     else
       # Embedded test suite.
-      at_path=$at_path$at_top_build_prefix$as_dir$PATH_SEPARATOR
-      at_path=$at_path$at_top_srcdir/$as_dir
+      AS_VAR_APPEND([at_path], ["$at_top_build_prefix$as_dir$PATH_SEPARATOR"])
+      AS_VAR_APPEND([at_path], ["$at_top_srcdir/$as_dir"])
     fi
     ;;
 esac])
@@ -871,7 +871,7 @@ esac
 case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
   *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
   $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
-  *) at_new_path=$at_new_path$PATH_SEPARATOR$as_dir ;;
+  *) AS_VAR_APPEND([at_new_path], ["$PATH_SEPARATOR$as_dir"]) ;;
 esac])
 PATH=$at_new_path
 export PATH
-- 
1.6.0.2







reply via email to

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