autoconf-patches
[Top][All Lists]
Advanced

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

patch for problems with echo '-...' and echo '...\...'


From: Paul Eggert
Subject: patch for problems with echo '-...' and echo '...\...'
Date: Fri, 17 Nov 2006 13:10:56 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

I fixed the problems that Ralf spotted in my pre-2.61 proposal (at
least, the problems I understood... :-) and installed this patch.

2006-11-17  Paul Eggert  <address@hidden>

        'echo' has some portability problems, when given a first argument
        with a leading '-', or when given any argument containing '\'.
        Avoid using 'echo' in these cases.
        * bin/Makefile.am $(bin_SCRIPTS): Rewrite to avoid 'echo' entirely.
        * lib/autoconf/c.m4 (AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC): Likewise.
        * lib/autoconf/fortran.m4 (_AC_PROG_FC): Likewise.
        * lib/autotest/general.m4 (AT_INIT): Likewise.
        * bin/autoconf.as: Use AS_ECHO rather than plain echo, when the
        argument might be unportable.
        * lib/autoconf/c.m4 (AC_PROG_CC_C_O): Likewise.
        * lib/autoconf/erlang.m4 (AC_LANG(Erlang)): Likewise.
        * lib/autoconf/fortran.m4 (_AC_PROG_FC_V_OUTPUT):
        (_AC_FC_LIBRARY_LDFLAGS): Likewise.
        * lib/autoconf/functions.m4 (AC_FUNC_GETLOADAVG): Likewise.
        * lib/autoconf/general.m4 (_AC_INIT_PARSE_ENABLE, _AC_INIT_PREPARE):
        (_AC_ARG_VAR_VALIDATE, AC_ARG_PROGRAM, _AC_MSG_LOG_CONFTEST):
        (AC_RUN_LOG, _AC_RUN_IFELSE, _AC_LIBOBJS_NORMALIZE): Likewise.
        * lib/autoconf/lang.m4 (_AC_COMPILER_EXEEXT_DEFAULT): Likewise.
        * lib/autoconf/libs.m4 (_AC_PATH_X_DIRECT): Likewise.
        * lib/autoconf/programs.m4 (_AC_FEATURE_CHECK_LENGTH):
        (AC_PROG_MAKE_SET): Likewise.
        * lib/autoconf/status.m4 (_AC_SRCDIRS, _AC_OUTPUT_HEADER):
        (_AC_OUTPUT_SUBDIRS, _AC_OUTPUT_CONFIG_STATUS): Likewise.
        * lib/autotest/general.m4 (_AT_CREATE_DEBUGGING_SCRIPT, AT_INIT):
        (AT_CLEANUP, _AT_DECIDE_TRACEABLE, _AT_CHECK): Likewise.
        * lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE, _AS_ECHO_UNQUOTED):
        (_AS_BASENAME_SED, _AS_DIRNAME_SED, AS_MKDIR_P, AS_TMPDIR, AS_UNAME):
        (AS_TR_SH, AS_TR_CPP, AS_VAR_GET): Likewise.
        * bin/autoconf.as: Redo verbose flag implementation, as the old
        scheme wouldn't work with AS_ECHO.
        * lib/autotest/general.m4 (AT_INIT): Likewise.
        * lib/autoconf/general.m4 (AC_MSG_RESULT, AC_MSG_RESULT_UNQUOTED):
        Don't use ECHO_T, since ECHO_N is now reliable.
        * lib/autotest/general.m4 (AT_INIT): Likewise.
        * lib/autoconf/general.m4 (AC_ARG_PROGRAM): Use sed "$script"
        rather than using a here-document to put the script into a file.
        (_AC_DO_ECHO): Hoist the eval out of the echo, so that we can
        use AS_ECHO.
        * lib/m4sugar/m4sh.m4 (AS_VAR_GET): Likewise.
        * lib/autoconf/programs.m4 (_AC_FEATURE_CHECK_LENGTH): Use
        AS_ECHO_N rather than ECHO_N and ECHO_C.  This doesn't fix any
        bug, but we might as well stop using ECHO_N and ECHO_C internally.
        * lib/autotest/general.m4 (AT_SETUP): Likewise.
        * lib/m4sugar/m4sh.m4 (_AS_ECHO_N): Likewise.
        * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS):
        (_AC_OUTPUT_MAIN_LOOP): Rework echo so that it has just one
        operand, as AS_ECHO requires.  Avoid double file name expansion.
        * lib/m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Invoke _AS_ECHO_PREPARE.
        Don't set as_nl, since _AS_ECHO_PREPARE does that now.
        (_AS_PREPARE): Comment that _AS_ECHO_N_PREPARE is just for user code.
        (AS_ECHO, AS_ECHO_N, _AS_ECHO_PREPARE): New macros.
        * tests/c.at (AC_PROG_CPP without warnings, AC_PROG_CPP via CC):
        Double-quote strings that would otherwise contain M4 comments.
        * tests/m4sh.at (AS_ECHO and AS_ECHO_N): New test.

Index: bin/Makefile.am
===================================================================
RCS file: /cvsroot/autoconf/autoconf/bin/Makefile.am,v
retrieving revision 1.26
diff -u -r1.26 Makefile.am
--- bin/Makefile.am     20 Sep 2006 02:44:51 -0000      1.26
+++ bin/Makefile.am     17 Nov 2006 21:02:02 -0000
@@ -65,7 +65,9 @@
 ## Use chmod -w to prevent people from editing the wrong file by accident.
 $(bin_SCRIPTS): Makefile
        rm -f $@ address@hidden
-       $(edit) `test -f ./address@hidden || echo $(srcdir)/address@hidden 
>address@hidden
+       srcdir=''; \
+         test -f ./address@hidden || srcdir=$(srcdir)/; \
+         $(edit) address@hidden >address@hidden
        chmod +x address@hidden
        chmod a-w address@hidden
        mv address@hidden $@
Index: bin/autoconf.as
===================================================================
RCS file: /cvsroot/autoconf/autoconf/bin/autoconf.as,v
retrieving revision 1.22
diff -u -r1.22 autoconf.as
--- bin/autoconf.as     24 Oct 2006 13:13:29 -0000      1.22
+++ bin/autoconf.as     17 Nov 2006 21:02:02 -0000
@@ -71,16 +71,17 @@
 help="\
 Try \`$as_me --help' for more information."

-exit_missing_arg="\
-echo \"$as_me: option \\\`\$1' requires an argument\" >&2
-echo \"\$help\" >&2
-exit 1"
+exit_missing_arg='
+  AS_ECHO(["$as_me: option \`$[1]'\'' requires an argument"]) >&2
+  AS_ECHO(["$help"]) >&2
+  exit 1
+'

 # Variables.
 : ${AUTOM4TE='@bindir@/@autom4te-name@'}
 autom4te_options=
 outfile=
-verbose=:
+verbose=false

 # Parse command line.
 while test $# -gt 0 ; do
@@ -92,10 +93,10 @@
     --version | -V )
        echo "$version" ; exit ;;
     --help | -h )
-       echo "$usage"; exit ;;
+       AS_ECHO(["$usage"]); exit ;;

     --verbose | -v )
-       verbose=echo
+       verbose=:
        autom4te_options="$autom4te_options $1"; shift ;;

     # Arguments passed as is to autom4te.
@@ -115,11 +116,11 @@
        shift; shift ;;

     --trace=* | -t?* )
-       traces="$traces --trace='"`echo "$optarg" | sed "s/'/'\\\\\\\\''/g"`"'"
+       traces="$traces --trace='"`AS_ECHO(["$optarg"]) | sed 
"s/'/'\\\\\\\\''/g"`"'"
        shift ;;
     --trace | -t )
        test $# = 1 && eval "$exit_missing_arg"
-       traces="$traces --trace='"`echo "$2" | sed "s/'/'\\\\\\\\''/g"`"'"
+       traces="$traces --trace='"`AS_ECHO(["$[2]"]) | sed 
"s/'/'\\\\\\\\''/g"`"'"
        shift; shift ;;
     --initialization | -i )
        autom4te_options="$autom4te_options --melt"
@@ -139,8 +140,8 @@
        break ;;
     -* )
        exec >&2
-       echo "$as_me: invalid option $1"
-       echo "$help"
+       AS_ECHO(["$as_me: invalid option $[1]"])
+       AS_ECHO(["$help"])
        exit 1 ;;
     * )
        break ;;
@@ -152,22 +153,22 @@
   0)
     if test -f configure.ac; then
       if test -f configure.in; then
-       echo "$as_me: warning: both \`configure.ac' and \`configure.in' are 
present." >&2
-       echo "$as_me: warning: proceeding with \`configure.ac'." >&2
+       AS_ECHO(["$as_me: warning: both \`configure.ac' and \`configure.in' are 
present."]) >&2
+       AS_ECHO(["$as_me: warning: proceeding with \`configure.ac'."]) >&2
       fi
       infile=configure.ac
     elif test -f configure.in; then
       infile=configure.in
     else
-      echo "$as_me: no input file" >&2
+      AS_ECHO(["$as_me: no input file"]) >&2
       exit 1
     fi
     test -z "$traces" && test -z "$outfile" && outfile=configure;;
   1) # autom4te doesn't like `-'.
      test "x$1" != "x-" && infile=$1 ;;
   *) exec >&2
-     echo "$as_me: invalid number of arguments."
-     echo "$help"
+     AS_ECHO(["$as_me: invalid number of arguments."])
+     AS_ECHO(["$help"])
      (exit 1); exit 1 ;;
 esac

@@ -178,5 +179,5 @@
 eval set x $autom4te_options \
   --language=autoconf --output=\$outfile "$traces" \$infile
 shift
-$verbose "$as_me: running $AUTOM4TE $*" >&2
+$verbose && AS_ECHO(["$as_me: running $AUTOM4TE $*"]) >&2
 exec "$AUTOM4TE" "$@"
Index: lib/autoconf/c.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/c.m4,v
retrieving revision 1.238
diff -u -r1.238 c.m4
--- lib/autoconf/c.m4   8 Nov 2006 08:26:44 -0000       1.238
+++ lib/autoconf/c.m4   17 Nov 2006 21:02:02 -0000
@@ -550,7 +550,8 @@

 # Provide some information about the compiler.
 _AS_ECHO_LOG([checking for _AC_LANG compiler version])
-ac_compiler=`set X $ac_compile; echo $[2]`
+set X $ac_compile
+ac_compiler=$[2]
 _AC_DO([$ac_compiler --version >&AS_MESSAGE_LOG_FD])
 _AC_DO([$ac_compiler -v >&AS_MESSAGE_LOG_FD])
 _AC_DO([$ac_compiler -V >&AS_MESSAGE_LOG_FD])
@@ -558,7 +559,11 @@
 m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
 m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
 _AC_LANG_COMPILER_GNU
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
 _AC_PROG_CC_G
 _AC_PROG_CC_C89
 AC_LANG_POP(C)dnl
@@ -641,7 +646,7 @@
 else
   AC_MSG_CHECKING([whether cc understands -c and -o together])
 fi
-set dummy $CC; ac_cc=`echo $[2] |
+set dummy $CC; ac_cc=`AS_ECHO(["$[2]"]) |
                      sed 's/[[^a-zA-Z0-9_]]/_/g;s/^[[0-9]]/_/'`
 AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o,
 [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
@@ -780,7 +785,8 @@
 fi
 # Provide some information about the compiler.
 _AS_ECHO_LOG([checking for _AC_LANG compiler version])
-ac_compiler=`set X $ac_compile; echo $[2]`
+set X $ac_compile
+ac_compiler=$[2]
 _AC_DO([$ac_compiler --version >&AS_MESSAGE_LOG_FD])
 _AC_DO([$ac_compiler -v >&AS_MESSAGE_LOG_FD])
 _AC_DO([$ac_compiler -V >&AS_MESSAGE_LOG_FD])
@@ -788,7 +794,11 @@
 m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
 m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
 _AC_LANG_COMPILER_GNU
-GXX=`test $ac_compiler_gnu = yes && echo yes`
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
 _AC_PROG_CXX_G
 AC_LANG_POP(C++)dnl
 ])# AC_PROG_CXX
@@ -944,7 +954,8 @@
               gcc)
 # Provide some information about the compiler.
 _AS_ECHO_LOG([checking for _AC_LANG compiler version])
-ac_compiler=`set X $ac_compile; echo $[2]`
+set X $ac_compile
+ac_compiler=$[2]
 _AC_DO([$ac_compiler --version >&AS_MESSAGE_LOG_FD])
 _AC_DO([$ac_compiler -v >&AS_MESSAGE_LOG_FD])
 _AC_DO([$ac_compiler -V >&AS_MESSAGE_LOG_FD])
@@ -952,7 +963,11 @@
 m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
 m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
 _AC_LANG_COMPILER_GNU
-GOBJC=`test $ac_compiler_gnu = yes && echo yes`
+if test $ac_compiler_gnu = yes; then
+  GOBJC=yes
+else
+  GOBJC=
+fi
 _AC_PROG_OBJC_G
 AC_LANG_POP(Objective C)dnl
 ])# AC_PROG_OBJC
Index: lib/autoconf/fortran.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/fortran.m4,v
retrieving revision 1.213
diff -u -r1.213 fortran.m4
--- lib/autoconf/fortran.m4     20 Sep 2006 18:07:47 -0000      1.213
+++ lib/autoconf/fortran.m4     17 Nov 2006 21:02:02 -0000
@@ -365,7 +365,8 @@

 # Provide some information about the compiler.
 _AS_ECHO_LOG([checking for _AC_LANG compiler version])
-ac_compiler=`set X $ac_compile; echo $[2]`
+set X $ac_compile
+ac_compiler=$[2]
 _AC_DO([$ac_compiler --version >&AS_MESSAGE_LOG_FD])
 _AC_DO([$ac_compiler -v >&AS_MESSAGE_LOG_FD])
 _AC_DO([$ac_compiler -V >&AS_MESSAGE_LOG_FD])
@@ -394,7 +395,11 @@
 _AC_ARG_VAR_LDFLAGS()dnl
 _AC_ARG_VAR_LIBS()dnl
 _AC_PROG_FC([Fortran 77], [$1])
-G77=`test $ac_compiler_gnu = yes && echo yes`
+if test $ac_compiler_gnu = yes; then
+  G77=yes
+else
+  G77=
+fi
 AC_LANG_POP(Fortran 77)dnl
 ])# AC_PROG_F77

@@ -535,7 +540,7 @@
 shift
 _AS_ECHO_LOG([$[*]])
 ac_[]_AC_LANG_ABBREV[]_v_output=`eval $ac_link AS_MESSAGE_LOG_FD>&1 2>&1 | 
grep -v 'Driving:'`
-echo "$ac_[]_AC_LANG_ABBREV[]_v_output" >&AS_MESSAGE_LOG_FD
+AS_ECHO(["$ac_[]_AC_LANG_ABBREV[]_v_output"]) >&AS_MESSAGE_LOG_FD
 _AC_LANG_PREFIX[]FLAGS=$ac_save_FFLAGS

 rm -f conftest*
@@ -685,7 +690,7 @@
          esac
           ;;
         -YP,*)
-          for ac_j in `echo $ac_arg | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do
+          for ac_j in `AS_ECHO(["$ac_arg"]) | sed -e 's/-YP,/-L/;s/:/ -L/g'`; 
do
             _AC_LIST_MEMBER_IF($ac_j, $ac_cv_[]_AC_LANG_ABBREV[]_libs, ,
                                [ac_arg="$ac_arg $ac_j"
                                
ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_j"])
@@ -709,7 +714,7 @@
 # must begin with a "/").
 case `(uname -sr) 2>/dev/null` in
    "SunOS 5"*)
-      ac_ld_run_path=`echo $ac_[]_AC_LANG_ABBREV[]_v_output |
+      ac_ld_run_path=`AS_ECHO(["$ac_[]_AC_LANG_ABBREV[]_v_output"]) |
                         sed -n 's,^.*LD_RUN_PATH *= *\(/[[^ ]]*\).*$,-R\1,p'`
       test "x$ac_ld_run_path" != x &&
         _AC_LINKER_OPTION([$ac_ld_run_path], ac_cv_[]_AC_LANG_ABBREV[]_libs)
Index: lib/autoconf/erlang.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/erlang.m4,v
retrieving revision 1.3
diff -u -r1.3 erlang.m4
--- lib/autoconf/erlang.m4      5 Sep 2006 14:36:18 -0000       1.3
+++ lib/autoconf/erlang.m4      17 Nov 2006 21:02:02 -0000
@@ -112,7 +112,7 @@
 m4_define([AC_LANG(Erlang)],
 [ac_ext=erl
 ac_compile='$ERLC $ERLCFLAGS -b beam conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
-ac_link='$ERLC $ERLCFLAGS -b beam conftest.$ac_ext >&AS_MESSAGE_LOG_FD ; echo 
"#!/bin/sh" > conftest$ac_exeext ; echo "\"$ERL\" -run conftest start -run init 
stop -noshell" >> conftest$ac_exeext ; chmod +x conftest$ac_exeext'
+ac_link='$ERLC $ERLCFLAGS -b beam conftest.$ac_ext >&AS_MESSAGE_LOG_FD ; echo 
"#!/bin/sh" > conftest$ac_exeext ; AS_ECHO(["\"$ERL\" -run conftest start -run 
init stop -noshell"]) >> conftest$ac_exeext ; chmod +x conftest$ac_exeext'
 ])

 # AC_LANG_ERLANG
@@ -215,7 +215,7 @@
     [erlang_cv_lib_ver_$1],
     [AS_IF([test "$erlang_cv_lib_dir_$1" = "not found"],
         [erlang_cv_lib_ver_$1="not found"],
-        [erlang_cv_lib_ver_$1=`echo "$erlang_cv_lib_dir_$1" | sed -n -e 
's,^.*-\([[^/-]]*\)$,\1,p'`])[]dnl
+        [erlang_cv_lib_ver_$1=`AS_ECHO(["$erlang_cv_lib_dir_$1"]) | sed -n -e 
's,^.*-\([[^/-]]*\)$,\1,p'`])[]dnl
     ])
 AC_SUBST([ERLANG_LIB_DIR_$1], [$erlang_cv_lib_dir_$1])
 AC_SUBST([ERLANG_LIB_VER_$1], [$erlang_cv_lib_ver_$1])
@@ -303,4 +303,3 @@
     AC_MSG_RESULT([$ERLANG_INSTALL_LIB_DIR/$1-$2])
 fi
 ])# AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR
-
Index: lib/autoconf/functions.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/functions.m4,v
retrieving revision 1.113
diff -u -r1.113 functions.m4
--- lib/autoconf/functions.m4   15 Oct 2006 01:12:02 -0000      1.113
+++ lib/autoconf/functions.m4   17 Nov 2006 21:02:02 -0000
@@ -768,7 +768,7 @@
   ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null`
   # If we got an error (system does not support symlinks), try without -L.
   test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
-  ac_cv_group_kmem=`echo $ac_ls_output \
+  ac_cv_group_kmem=`AS_ECHO(["$ac_ls_output"]) \
     | sed -ne ['s/[     ][      ]*/ /g;
               s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\)  *.*/\1/;
               / /s/.* //;p;']`
@@ -778,7 +778,7 @@
 if test "x$ac_save_LIBS" = x; then
   GETLOADAVG_LIBS=$LIBS
 else
-  GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$ac_save_LIBS!!"`
+  GETLOADAVG_LIBS=`AS_ECHO(["$LIBS"]) | sed "s!$ac_save_LIBS!!"`
 fi
 LIBS=$ac_save_LIBS

Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.939
diff -u -r1.939 general.m4
--- lib/autoconf/general.m4     17 Nov 2006 00:37:17 -0000      1.939
+++ lib/autoconf/general.m4     17 Nov 2006 21:02:02 -0000
@@ -929,7 +929,7 @@
     # Reject names that are not valid shell variable names.
     expr "x$ac_$2" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
       AC_MSG_ERROR([invalid $2 name: $ac_$2])
-    [ac_$2=`echo $ac_$2 | sed 's/[-.]/_/g'`]
+    ac_$2=`AS_ECHO(["$ac_$2"]) | sed 's/[[-.]]/_/g'`
     eval m4_bmatch([$1], [^\(enable\|disable\)$], [enable], [with])_$ac_$2=$3 
;;dnl
 ])

@@ -1147,7 +1147,7 @@
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
     *\'*)
-      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
     1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
@@ -1206,9 +1206,9 @@
     do
       eval ac_val=\$$ac_var
       case $ac_val in
-      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      *\'\''*) ac_val=`AS_ECHO(["$ac_val"]) | sed 
"s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
       esac
-      echo "$ac_var='\''$ac_val'\''"
+      AS_ECHO(["$ac_var='\''$ac_val'\''"])
     done | sort
     echo

@@ -1219,9 +1219,9 @@
       do
        eval ac_val=\$$ac_var
        case $ac_val in
-       *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       *\'\''*) ac_val=`AS_ECHO(["$ac_val"]) | sed 
"s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
        esac
-       echo "$ac_var='\''$ac_val'\''"
+       AS_ECHO(["$ac_var='\''$ac_val'\''"])
       done | sort
       echo
     fi
@@ -1233,8 +1233,8 @@
       echo
     fi
     test "$ac_signal" != 0 &&
-      echo "$as_me: caught signal $ac_signal"
-    echo "$as_me: exit $exit_status"
+      AS_ECHO(["$as_me: caught signal $ac_signal"])
+    AS_ECHO(["$as_me: exit $exit_status"])
   } >&AS_MESSAGE_LOG_FD
   rm -f core *.core core.conftest.* &&
     rm -f -r conftest* confdefs* conf$[$]* $ac_clean_files &&
@@ -1492,7 +1492,7 @@
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`AS_ECHO(["$ac_new_val"]) | sed "s/'/'\\\\\\\\''/g"` 
;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
@@ -1534,13 +1534,10 @@
 # Use a double $ so make ignores it.
 test "$program_suffix" != NONE &&
   program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.  echo might interpret backslashes.
+# Double any \ or $.
 # By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-[s/[\\$]/&&/g;s/;s,x,x,$//]
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm -f conftest.sed
+[ac_script='s/[\\$]/&&/g;s/;s,x,x,$//']
+program_transform_name=`AS_ECHO(["$program_transform_name"]) | sed 
"$ac_script"`
 ])# AC_ARG_PROGRAM


@@ -2052,7 +2049,7 @@
 # ---------------------
 m4_define([AC_MSG_RESULT],
 [{ _AS_ECHO_LOG([result: $1])
-_AS_ECHO([${ECHO_T}$1]); }dnl
+_AS_ECHO([$1]); }dnl
 ])


@@ -2072,7 +2069,7 @@
 # _AC_MSG_LOG_CONFTEST
 # --------------------
 m4_define([_AC_MSG_LOG_CONFTEST],
-[echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
+[AS_ECHO(["$as_me: failed program was:"]) >&AS_MESSAGE_LOG_FD
 sed 's/^/| /' conftest.$ac_ext >&AS_MESSAGE_LOG_FD
 ])

@@ -2088,7 +2085,7 @@
 # No escaping, so it performed also backtick substitution.
 AU_DEFUN([AC_MSG_RESULT_UNQUOTED],
 [_AS_ECHO_UNQUOTED([$as_me:$LINENO: result: $1], AS_MESSAGE_LOG_FD)
-_AS_ECHO_UNQUOTED([${ECHO_T}$1])[]dnl
+_AS_ECHO_UNQUOTED([$1])[]dnl
 ])


@@ -2144,7 +2141,7 @@
 dnl than expanding it.  This is a hack, but it is safer, while also
 dnl typically expanding simple substrings like '$CC', which is what we want.
 dnl
-dnl The rest of this macro body is quoted, to work around misuses like
+dnl Much of this macro body is quoted, to work around misuses like
 dnl `AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))',
 dnl which underquotes the 3rd arg and would misbehave if we didn't quote here.
 dnl The "(($ac_try" instead of $ac_try avoids problems with even-worse
@@ -2157,7 +2154,8 @@
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\""]])
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""]
+AS_ECHO(["$ac_try_echo"])])

 # _AC_DO(COMMAND)
 # ---------------
@@ -2247,7 +2245,7 @@
 # -------------------
 AC_DEFUN([AC_RUN_LOG],
 [_AC_RUN_LOG([$1],
-            [echo "$as_me:$LINENO: AS_ESCAPE([$1])"])])
+            [AS_ECHO(["$as_me:$LINENO: AS_ESCAPE([$1])"])])])



@@ -2442,7 +2440,7 @@
 rm -f conftest$ac_exeext
 AS_IF([_AC_DO_VAR(ac_link) && _AC_DO_TOKENS(./conftest$ac_exeext)],
       [$2],
-      [echo "$as_me: program exited with status $ac_status" >&AS_MESSAGE_LOG_FD
+      [AS_ECHO(["$as_me: program exited with status $ac_status"]) 
>&AS_MESSAGE_LOG_FD
 _AC_MSG_LOG_CONFTEST
 m4_ifvaln([$3],
          [( exit $ac_status )
@@ -2636,7 +2634,7 @@
 for ac_i in : $LIB@&address@hidden; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
-  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  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"
Index: lib/autoconf/lang.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/lang.m4,v
retrieving revision 1.185
diff -u -r1.185 lang.m4
--- lib/autoconf/lang.m4        6 Oct 2006 17:43:55 -0000       1.185
+++ lib/autoconf/lang.m4        17 Nov 2006 21:02:02 -0000
@@ -474,7 +474,7 @@
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
 AC_MSG_CHECKING([for _AC_LANG compiler default output file name])
-ac_link_default=`echo "$ac_link" | sed ['s/ -o *conftest[^ ]*//']`
+ac_link_default=`AS_ECHO(["$ac_link"]) | sed ['s/ -o *conftest[^ ]*//']`
 #
 # List of possible output files, starting from the most likely.
 # The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
Index: lib/autoconf/libs.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/libs.m4,v
retrieving revision 1.24
diff -u -r1.24 libs.m4
--- lib/autoconf/libs.m4        15 Oct 2006 01:12:02 -0000      1.24
+++ lib/autoconf/libs.m4        17 Nov 2006 21:02:02 -0000
@@ -295,7 +295,7 @@
 # We can link X programs with no special library path.
 ac_x_libraries=],
                 [LIBS=$ac_save_LIBS
-for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+for ac_dir in `AS_ECHO(["$ac_x_includes $ac_x_header_dirs"]) | sed 
s/include/lib/g`
 do
   # Don't even attempt the hair of trying to link an X program!
   for ac_extension in a so sl; do
Index: lib/autoconf/programs.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/programs.m4,v
retrieving revision 1.62
diff -u -r1.62 programs.m4
--- lib/autoconf/programs.m4    25 Aug 2006 20:48:02 -0000      1.62
+++ lib/autoconf/programs.m4    17 Nov 2006 21:02:03 -0000
@@ -484,13 +484,13 @@
   _AC_PATH_PROG_FLAVOR_GNU([$$1],
     [$2="$$1" $1_found=:],
   [ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  AS_ECHO_N([0123456789]) >"conftest.in"
   while :
   do
     cat "conftest.in" "conftest.in" >"conftest.tmp"
     mv "conftest.tmp" "conftest.in"
     cp "conftest.in" "conftest.nl"
-    echo '$4' >> "conftest.nl"
+    AS_ECHO(['$4']) >> "conftest.nl"
     $3 < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
     ac_count=`expr $ac_count + 1`
@@ -804,7 +804,8 @@
 AN_PROGRAM([make], [AC_PROG_MAKE_SET])
 AC_DEFUN([AC_PROG_MAKE_SET],
 [AC_MSG_CHECKING([whether ${MAKE-make} sets \$(MAKE)])
-set x ${MAKE-make}; ac_make=`echo "$[2]" | sed 's/+/p/g; 
s/[[^a-zA-Z0-9_]]/_/g'`
+set x ${MAKE-make}
+ac_make=`AS_ECHO(["$[2]"]) | sed 's/+/p/g; s/[[^a-zA-Z0-9_]]/_/g'`
 AC_CACHE_VAL(ac_cv_prog_make_${ac_make}_set,
 [cat >conftest.make <<\_ACEOF
 SHELL = /bin/sh
Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.118
diff -u -r1.118 status.m4
--- lib/autoconf/status.m4      13 Sep 2006 04:48:23 -0000      1.118
+++ lib/autoconf/status.m4      17 Nov 2006 21:02:03 -0000
@@ -107,9 +107,9 @@
 case $1 in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`echo $1 | sed 's,^\.[[\\/]],,'`
+  ac_dir_suffix=/`AS_ECHO([$1]) | sed 's,^\.[[\\/]],,'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[[^\\/]]*,/..,g;s,/,,'`
+  ac_top_builddir_sub=`AS_ECHO(["$ac_dir_suffix"]) | sed 
's,/[[^\\/]]*,/..,g;s,/,,'`
   case $ac_top_builddir_sub in
   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -716,7 +716,7 @@
 echo "ac_result=$ac_in" >>$CONFIG_STATUS
 cat >>$CONFIG_STATUS <<\_ACEOF
   if test x"$ac_file" != x-; then
-    echo "/* $configure_input  */" >"$tmp/config.h"
+    AS_ECHO(["/* $configure_input  */"]) >"$tmp/config.h"
     cat "$ac_result" >>"$tmp/config.h"
     if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
       AC_MSG_NOTICE([$ac_file is unchanged])
@@ -725,7 +725,7 @@
       mv "$tmp/config.h" $ac_file
     fi
   else
-    echo "/* $configure_input  */"
+    AS_ECHO(["/* $configure_input  */"])
     cat "$ac_result"
   fi
   rm -f "$tmp/out[12]"
@@ -971,7 +971,7 @@
       ;;
     *)
       case $ac_arg in
-      *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
       esac
       ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;;
     esac
@@ -981,7 +981,7 @@
   # in subdir configurations.
   ac_arg="--prefix=$prefix"
   case $ac_arg in
-  *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+  *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
   esac
   ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"

@@ -1235,7 +1235,7 @@
 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.status[]dnl
 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
 configured by $[0], generated by m4_PACKAGE_STRING,
-  with options \\"`echo "$ac_configure_args" | sed 's/^ //; 
s/[[\\""\`\$]]/\\\\&/g'`\\"
+  with options \\"`AS_ECHO(["$ac_configure_args"]) | sed 's/^ //; 
s/[[\\""\`\$]]/\\\\&/g'`\\"

 Copyright (C) 2006 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
@@ -1275,7 +1275,7 @@
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
-    echo "$ac_cs_version"; exit ;;
+    AS_ECHO(["$ac_cs_version"]); exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
 m4_ifdef([_AC_SEEN_CONFIG(FILES)], [dnl
@@ -1295,7 +1295,7 @@
 Try `$[0] --help' for more information.]);;
 ], [  --he | --h |])dnl
   --help | --hel | -h )
-    echo "$ac_cs_usage"; exit ;;
+    AS_ECHO(["$ac_cs_usage"]); exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
@@ -1323,10 +1323,12 @@
 dnl Check this before opening the log, to avoid a bug on MinGW,
 dnl which prohibits the recursive instance from truncating an open log.
 if \$ac_cs_recheck; then
-  echo "running CONFIG_SHELL=$SHELL $SHELL $[0] "$ac_configure_args 
\$ac_configure_extra_args " --no-create --no-recursion" >&AS_MESSAGE_FD
-  CONFIG_SHELL=$SHELL
+  set X '$SHELL' '$[0]'$ac_configure_args \$ac_configure_extra_args 
--no-create --no-recursion
+  shift
+  \AS_ECHO(["running CONFIG_SHELL=$SHELL \$[*]"]) >&AS_MESSAGE_FD
+  CONFIG_SHELL='$SHELL'
   export CONFIG_SHELL
-  exec $SHELL "$[0]"$ac_configure_args \$ac_configure_extra_args --no-create 
--no-recursion
+  exec "address@hidden"
 fi

 _ACEOF
@@ -1337,7 +1339,7 @@
 {
   echo
   AS_BOX([Running $as_me.])
-  echo "$ac_log"
+  AS_ECHO(["$ac_log"])
 } >&AS_MESSAGE_LOG_FD

 _ACEOF
@@ -1462,8 +1464,9 @@
     # Let's still pretend it is `configure' which instantiates (i.e., don't
     # use $as_me), people would be surprised to read:
     #    /* config.h.  Generated by config.status.  */
-    configure_input="Generated from "`IFS=:
-         echo $[*] | sed ['s|^[^:]*/||;s|:[^:]*/|, |g']`" by configure."
+    configure_input='Generated from '`
+         AS_ECHO(["$[*]"]) | sed ['s|^[^:]*/||;s|:[^:]*/|, |g']
+       `' by configure.'
     if test x"$ac_file" != x-; then
       configure_input="$ac_file.  $configure_input"
       AC_MSG_NOTICE([creating $ac_file])
Index: lib/autotest/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.216
diff -u -r1.216 general.m4
--- lib/autotest/general.m4     27 Oct 2006 23:05:34 -0000      1.216
+++ lib/autotest/general.m4     17 Nov 2006 21:02:03 -0000
@@ -170,9 +170,8 @@
 [        {
            echo "#! /bin/sh"
            echo 'test "${ZSH_VERSION+set}" = set && alias -g 
'\''${1+"address@hidden"}'\''='\''"address@hidden"'\'''
-           echo "cd '$at_dir'"
-           echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$[0]" \
-                '-v -d' "$at_debug_args" "$at_group" '${1+"address@hidden"}'
+           AS_ECHO(["cd '$at_dir'"])
+           AS_ECHO(["exec \${CONFIG_SHELL-$SHELL} $[0] -v -d $at_debug_args 
$at_group \${1+\"address@hidden"}"])
            echo 'exit 1'
          } >$at_group_dir/run
          chmod +x $at_group_dir/run
@@ -234,9 +233,9 @@
 at_debug_args=
 # -e sets to true
 at_errexit_p=false
-# Shall we be verbose?
+# Shall we be verbose?  ':' means no, empty means yes.
 at_verbose=:
-at_quiet=echo
+at_quiet=

 # Shall we keep the debug scripts?  Must be `:' when the suite is
 # run by a debug script, so that the script doesn't remove itself.
@@ -328,7 +327,7 @@
        ;;

     --verbose | -v )
-       at_verbose=echo; at_quiet=:
+       at_verbose=; at_quiet=:
        ;;

     --trace | -x )
@@ -342,14 +341,14 @@
     # Ranges
     [[0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-])
        at_range_start=`echo $at_option |tr -d X-`
-       at_range=`echo " $at_groups_all " | \
+       at_range=`AS_ECHO([" $at_groups_all "]) | \
          sed -e 's/^.* \('$at_range_start' \)/\1/'`
        at_groups="$at_groups$at_range "
        ;;

     [-[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9]])
        at_range_end=`echo $at_option |tr -d X-`
-       at_range=`echo " $at_groups_all " | \
+       at_range=`AS_ECHO([" $at_groups_all "]) | \
          sed -e 's/\( '$at_range_end'\) .*$/\1/'`
        at_groups="$at_groups$at_range "
        ;;
@@ -367,7 +366,7 @@
          at_range_end=$at_range_start
          at_range_start=$at_tmp
        fi
-       at_range=`echo " $at_groups_all " | \
+       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 "
@@ -394,12 +393,14 @@
            ;;
          esac
          # It is on purpose that we match the test group titles too.
-         at_groups_selected=`echo "$at_groups_selected" |
+         at_groups_selected=`AS_ECHO(["$at_groups_selected"]) |
              grep -i $at_invert ["^[1-9][^;]*;.*[; ]$at_keyword[ ;]"]`
        done
-       at_groups_selected=`echo "$at_groups_selected" | sed 's/;.*//'`
        # Smash the newlines.
-       at_groups="$at_groups`echo $at_groups_selected` "
+       at_groups_selected=`AS_ECHO(["$at_groups_selected"]) | sed 's/;.*//' |
+         tr "$as_nl" ' '
+       `
+       at_groups="$at_groups$at_groups_selected "
        ;;
 m4_divert_pop([PARSE_ARGS])dnl
 dnl Process *=* last to allow for user specified --option=* type arguments.
@@ -410,15 +411,15 @@
        # Reject names that are not valid shell variable names.
        expr "x$at_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null &&
          AS_ERROR([invalid variable name: $at_envvar])
-       at_value=`echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
+       at_value=`AS_ECHO(["$at_optarg"]) | sed "s/'/'\\\\\\\\''/g"`
        eval "$at_envvar='$at_value'"
        export $at_envvar
        # Propagate to debug scripts.
        at_debug_args="$at_debug_args $at_envvar='$at_value'"
        ;;

-     *) echo "$as_me: invalid option: $at_option" >&2
-       echo "Try \`$[0] --help' for more information." >&2
+     *) AS_ECHO(["$as_me: invalid option: $at_option"]) >&2
+       AS_ECHO(["Try \`$[0] --help' for more information."]) >&2
        exit 1
        ;;
   esac
@@ -429,10 +430,10 @@
   at_groups=$at_groups_all
 else
   # Sort the tests, removing duplicates:
-  at_groups=`echo $at_groups | tr ' ' "$as_nl" | sort -nu`
+  at_groups=`AS_ECHO(["$at_groups"]) | tr ' ' "$as_nl" | sort -nu`
   # and add banners.  (Passing at_groups_all is tricky--see the comment
   # starting with "Passing at_groups is tricky.")
-  at_groups=`echo "$at_groups$as_nl $at_groups_all" |
+  at_groups=`AS_ECHO(["$at_groups$as_nl $at_groups_all"]) |
     awk ['BEGIN { FS = "@" } # Effectively switch off field splitting.
        /^$/ { next }  # Ignore the empty line.
        !/ / { groups++; selected[$ 0] = 1; next }
@@ -522,7 +523,7 @@
   # Passing at_groups is tricky.  We cannot use it to form a literal string
   # or regexp because of the limitation of AIX awk.  And Solaris' awk
   # doesn't grok more than 99 fields in a record, so we have to use `split'.
-  echo "$at_groups$as_nl$at_help_all" |
+  AS_ECHO(["$at_groups$as_nl$at_help_all"]) |
     awk 'BEGIN { FS = ";" }
         NR == 1 {
           for (n = split($ 0, a, " "); n; n--) selected[[a[n]]] = 1
@@ -539,7 +540,7 @@
 m4_divert_pop([HELP_END])dnl
 m4_divert_push([VERSION])dnl
 if $at_version_p; then
-  echo "$as_me (AT_PACKAGE_STRING)"
+  AS_ECHO(["$as_me (AT_PACKAGE_STRING)"])
   cat <<\_ACEOF
 m4_divert_pop([VERSION])dnl
 m4_divert_push([VERSION_END])dnl
@@ -556,7 +557,7 @@
 # For embedded test suites, AUTOTEST_PATH is relative to the top level
 # of the package.  Then expand it into build/src parts, since users
 # may create executables in both places.
-AUTOTEST_PATH=`echo $AUTOTEST_PATH | sed "s&:&$PATH_SEPARATOR&g"`
+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
@@ -611,8 +612,8 @@
   AS_BOX(m4_defn([AT_TESTSUITE_NAME])[.])
   echo

-  echo "$as_me: command line was:"
-  echo "  $ $[0] $at_cli_args"
+  AS_ECHO(["$as_me: command line was:"])
+  AS_ECHO(["  \$ $[0] $at_cli_args"])
   echo

   # Try to find a few ChangeLogs in case it might help determining the
@@ -624,7 +625,7 @@
     echo
     for at_file in `find "$at_top_srcdir" -name ChangeLog -print`
     do
-      echo "$as_me: $at_file:"
+      AS_ECHO(["$as_me: $at_file:"])
       sed 's/^/| /;10q' $at_file
       echo
     done
@@ -637,7 +638,7 @@
   for at_file in atconfig atlocal
   do
     test -r $at_file || continue
-    echo "$as_me: $at_file:"
+    AS_ECHO(["$as_me: $at_file:"])
     sed 's/^/| /' $at_file
     echo
   done
@@ -653,7 +654,7 @@
   _AS_PATH_WALK([$PATH], [test -f "$as_dir/$at_program" && break])
   if test -f "$as_dir/$at_program"; then
     {
-      echo "$at_srcdir/AT_LINE: $as_dir/$at_program --version"
+      AS_ECHO(["$at_srcdir/AT_LINE: $as_dir/$at_program --version"])
       "$as_dir/$at_program" --version
       echo
     } >&AS_MESSAGE_LOG_FD 2>&1
@@ -668,7 +669,7 @@

 at_start_date=`date`
 at_start_time=`date +%s 2>/dev/null`
-echo "$as_me: starting at: $at_start_date" >&AS_MESSAGE_LOG_FD
+AS_ECHO(["$as_me: starting at: $at_start_date"]) >&AS_MESSAGE_LOG_FD
 at_xpass_list=
 at_xfail_list=
 at_pass_list=
@@ -730,11 +731,11 @@
   echo 0 > "$at_status_file"

   # Clearly separate the test groups when verbose.
-  test $at_group_count != 0 && $at_verbose
+  test $at_group_count != 0 && $at_verbose echo

   # In verbose mode, append to the log file *and* show on
   # the standard output; in quiet mode only write to the log
-  if test $at_verbose = echo; then
+  if test -z "$at_verbose"; then
     at_tee_pipe='tee -a "$at_group_log"'
   else
     at_tee_pipe='cat >> "$at_group_log"'
@@ -746,7 +747,7 @@
 m4_divert_push([TESTS_END])[]dnl

   * )
-    echo "$as_me: no such test group: $at_group" >&2
+    AS_ECHO(["$as_me: no such test group: $at_group"]) >&2
     continue
     ;;
   esac
@@ -764,11 +765,11 @@
        run. This means that test suite is improperly designed.  Please
        report this failure to <AT_PACKAGE_BUGREPORT>.
 _ATEOF
-       echo "$at_setup_line" >"$at_check_line_file"
+       AS_ECHO(["$at_setup_line"]) >"$at_check_line_file"
       fi
       at_group_count=`expr 1 + $at_group_count`
-      $at_verbose $ECHO_N "$at_group. $at_setup_line: $ECHO_C"
-      echo $ECHO_N "$at_group. $at_setup_line: $ECHO_C" >> "$at_group_log"
+      $at_verbose AS_ECHO_N(["$at_group. $at_setup_line: "])
+      AS_ECHO_N(["$at_group. $at_setup_line: "]) >> "$at_group_log"
       case $at_xfail:$at_status in
        yes:0)
            at_msg="UNEXPECTED PASS"
@@ -797,7 +798,7 @@
            ;;
       esac
       # Make sure there is a separator even with long titles.
-      echo " $at_msg"
+      AS_ECHO([" $at_msg"])
       at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
       case $at_status in
        0|77)
@@ -809,8 +810,8 @@
            at_log_msg="$at_log_msg     ("`sed 1d "$at_times_file"`')'
            rm -f "$at_times_file"
           fi
-         echo "$at_log_msg" >> "$at_group_log"
-         echo "$at_log_msg" >&AS_MESSAGE_LOG_FD
+         AS_ECHO(["$at_log_msg"]) >> "$at_group_log"
+         AS_ECHO(["$at_log_msg"]) >&AS_MESSAGE_LOG_FD

          # Cleanup the group directory, unless the user wants the files.
          if $at_debug_p ; then
@@ -824,7 +825,7 @@
          # Upon failure, include the log into the testsuite's global
          # log.  The failure message is written in the group log.  It
          # is later included in the global log.
-         echo "$at_log_msg" >> "$at_group_log"
+         AS_ECHO(["$at_log_msg"]) >> "$at_group_log"

          # Upon failure, keep the group directory for autopsy, and
          # create the debugging script.
@@ -842,7 +843,7 @@
 # Compute the duration of the suite.
 at_stop_date=`date`
 at_stop_time=`date +%s 2>/dev/null`
-echo "$as_me: ending at: $at_stop_date" >&AS_MESSAGE_LOG_FD
+AS_ECHO(["$as_me: ending at: $at_stop_date"]) >&AS_MESSAGE_LOG_FD
 case $at_start_time,$at_stop_time in
   [[0-9]*,[0-9]*])
     at_duration_s=`expr $at_stop_time - $at_start_time`
@@ -851,15 +852,15 @@
     at_duration_s=`expr $at_duration_s % 60`
     at_duration_m=`expr $at_duration_m % 60`
     at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
-    echo "$as_me: test suite duration: $at_duration" >&AS_MESSAGE_LOG_FD
+    AS_ECHO(["$as_me: test suite duration: $at_duration"]) >&AS_MESSAGE_LOG_FD
     ;;
 esac

 # Wrap up the test suite with summary statistics.
-at_skip_count=`set dummy $at_skip_list; shift; echo address@hidden:@]`
-at_fail_count=`set dummy $at_fail_list; shift; echo address@hidden:@]`
-at_xpass_count=`set dummy $at_xpass_list; shift; echo address@hidden:@]`
-at_xfail_count=`set dummy $at_xfail_list; shift; echo address@hidden:@]`
+set X $at_skip_list; shift; address@hidden:@]
+set X $at_fail_list; shift; address@hidden:@]
+set X $at_xpass_list; shift; address@hidden:@]
+set X $at_xfail_list; shift; address@hidden:@]

 at_run_count=`expr $at_group_count - $at_skip_count`
 at_unexpected_count=`expr $at_xpass_count + $at_fail_count`
@@ -943,11 +944,11 @@
 esac

 if test $at_unexpected_count = 0; then
-  echo "$at_result"
-  echo "$at_result" >&AS_MESSAGE_LOG_FD
+  AS_ECHO(["$at_result"])
+  AS_ECHO(["$at_result"]) >&AS_MESSAGE_LOG_FD
 else
-  echo "ERROR: $at_result" >&2
-  echo "ERROR: $at_result" >&AS_MESSAGE_LOG_FD
+  AS_ECHO(["ERROR: $at_result"]) >&2
+  AS_ECHO(["ERROR: $at_result"]) >&AS_MESSAGE_LOG_FD
   {
     echo
     AS_BOX([Summary of the failures.])
@@ -990,18 +991,18 @@
   AS_BOX([$as_me.log was created.])

   echo
-  echo "Please send \`${at_testdir+${at_testdir}/}$as_me.log' and all 
information you think might help:"
-  echo
-  echo "   To: <AT_PACKAGE_BUGREPORT>"
-  echo "   Subject: @<:@AT_PACKAGE_STRING@:>@ $as_me:dnl
+  AS_ECHO(["Please send \`${at_testdir+${at_testdir}/}$as_me.log' and all 
information you think might help:
+
+   To: <AT_PACKAGE_BUGREPORT>
+   Subject: @<:@AT_PACKAGE_STRING@:>@ $as_me:dnl
 $at_fail_list${at_fail_list:+ failed${at_xpass_list:+,}}dnl
-$at_xpass_list${at_xpass_list:+ passed unexpectedly}"
-  echo
+$at_xpass_list${at_xpass_list:+ passed unexpectedly}
+"])
   if test $at_debug_p = false; then
     echo
     echo 'You may investigate any problem if you feel able to do so, in which'
     echo 'case the test suite provides a good starting point.  Its output may'
-    echo "be found below \`${at_testdir+${at_testdir}/}$as_me.dir'."
+    AS_ECHO(["be found below \`${at_testdir+${at_testdir}/}$as_me.dir'."])
     echo
   fi
     exit 1
@@ -1177,8 +1178,8 @@
   AT_ordinal ) @%:@ AT_ordinal. m4_defn([AT_line]): $1
     at_setup_line='m4_defn([AT_line])'
     at_desc="AS_ESCAPE([$1])"
-    $at_quiet $ECHO_N "m4_format([%3d: %-]m4_eval(47 - m4_qdelta([$1]))[s],
-                      AT_ordinal, AS_ESCAPE([[$1]]))[]$ECHO_C"
+    $at_quiet AS_ECHO_N(["m4_format([%3d: %-]m4_eval(47 - m4_qdelta([$1]))[s],
+                      AT_ordinal, AS_ESCAPE([[$1]]))[]"])
 m4_divert_push([TEST_SCRIPT])dnl
 ])

@@ -1226,7 +1227,7 @@
     AT_xfail
     echo "#                             -*- compilation -*-" >> "$at_group_log"
     (
-      echo "AT_ordinal. m4_defn([AT_line]): testing $1..."
+      AS_ECHO(["AT_ordinal. m4_defn([AT_line]): testing $1..."])
       $at_traceon
 m4_undivert([TEST_SCRIPT])dnl Insert the code here
       $at_traceoff
@@ -1419,7 +1420,7 @@
 ))dnl
 dnl
 m4_ifval(m4_defn([at_reason]),
-[echo 'Not enabling shell tracing (command contains ]m4_defn([at_reason])[)'],
+[AS_ECHO(['Not enabling shell tracing (command contains 
]m4_defn([at_reason])[)'])],
 [m4_bmatch([$1], [\$],
 dnl COMMANDS may contain parameter expansions; expand them at runtime.
 [case "AS_ESCAPE([$1], [`"\])" in
@@ -1468,7 +1469,7 @@
 #
 m4_define([_AT_CHECK],
 [$at_traceoff
-echo "$at_srcdir/AT_LINE: AS_ESCAPE([$1])"
+AS_ECHO(["$at_srcdir/AT_LINE: AS_ESCAPE([$1])"])
 echo AT_LINE >"$at_check_line_file"

 at_trace_this=
@@ -1493,14 +1494,14 @@
        ignore, [echo stderr:; cat "$at_stderr"],
        experr, [$at_diff experr "$at_stderr" || at_failed=:],
        [],     [$at_diff "$at_devnull" "$at_stderr" || at_failed=:],
-       [echo >>"$at_stderr"; echo "m4_ifval([$7],[AS_ESCAPE([$4])],[$4])" | 
$at_diff - "$at_stderr" || at_failed=:])
+       [echo >>"$at_stderr"; 
AS_ECHO(["m4_ifval([$7],[AS_ESCAPE([$4])],[$4])"]) | $at_diff - "$at_stderr" || 
at_failed=:])
 dnl Check stdout.
 m4_case([$3],
        stdout, [echo stdout:; tee stdout <"$at_stdout"],
        ignore, [echo stdout:; cat "$at_stdout"],
        expout, [$at_diff expout "$at_stdout" || at_failed=:],
        [],     [$at_diff "$at_devnull" "$at_stdout" || at_failed=:],
-       [echo >>"$at_stdout"; echo "m4_ifval([$7],[AS_ESCAPE([$3])],[$3])" | 
$at_diff - "$at_stdout" || at_failed=:])
+       [echo >>"$at_stdout"; 
AS_ECHO(["m4_ifval([$7],[AS_ESCAPE([$3])],[$3])"]) | $at_diff - "$at_stdout" || 
at_failed=:])
 dnl Check exit val.  Don't `skip' if we are precisely checking $? = 77.
 case $at_status in
 m4_if([$2], [77],
@@ -1510,13 +1511,13 @@
 m4_if([$2], [ignore],
     [   *);;],
     [   m4_default([$2], [0])) ;;
-   *) echo "$at_srcdir/AT_LINE: exit code was $at_status, expected 
m4_default([$2], [0])"
+   *) AS_ECHO(["$at_srcdir/AT_LINE: exit code was $at_status, expected 
m4_default([$2], [0])"])
       at_failed=:;;])
 esac
 AS_IF($at_failed, [$5
   m4_ifdef([AT_capture_files],
     [for file in AT_capture_files
-     do echo "$file:"; sed 's/^/> /' "$file"; done])
+     do AS_ECHO(["$file:"]); sed 's/^/> /' "$file"; done])
   echo 1 > "$at_status_file"
   exit 1], [$6])
 $at_traceon
Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.201
diff -u -r1.201 m4sh.m4
--- lib/m4sugar/m4sh.m4 15 Oct 2006 01:12:02 -0000      1.201
+++ lib/m4sugar/m4sh.m4 17 Nov 2006 21:02:03 -0000
@@ -349,6 +349,7 @@

 # PATH needs CR
 _AS_CR_PREPARE
+_AS_ECHO_PREPARE
 _AS_PATH_SEPARATOR_PREPARE
 _AS_UNSET_PREPARE

@@ -357,8 +358,6 @@
 # there to prevent editors from complaining about space-tab.
 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
 # splitting by setting IFS to empty value.)
-as_nl='
-'
 IFS=" ""       $as_nl"

 # Find who we are.  Look in the path if we contain no directory separator.
@@ -374,7 +373,7 @@
   as_myself=$[0]
 fi
 if test ! -f "$as_myself"; then
-  echo "$as_myself: error: cannot find myself; rerun with an absolute file 
name" >&2
+  AS_ECHO(["$as_myself: error: cannot find myself; rerun with an absolute file 
name"]) >&2
   AS_EXIT
 fi

@@ -427,7 +426,7 @@
 [_AS_LINENO_PREPARE

 _AS_DIRNAME_PREPARE
-_AS_ECHO_N_PREPARE
+_AS_ECHO_N_PREPARE[]dnl We do not need this ourselves but user code might.
 _AS_EXPR_PREPARE
 _AS_LN_S_PREPARE
 _AS_MKDIR_P_PREPARE
@@ -600,7 +599,7 @@
 # -----------------------------------------------
 # Perform shell expansions on STRING and echo the string to FD.
 m4_define([_AS_ECHO_UNQUOTED],
-[echo "$1" >&m4_default([$2], [AS_MESSAGE_FD])])
+[AS_ECHO(["$1"]) >&m4_default([$2], [AS_MESSAGE_FD])])


 # _AS_ECHO(STRING, [FD = AS_MESSAGE_FD])
@@ -644,9 +643,7 @@
 # ----------------------------------------
 # Same as _AS_ECHO, but echo doesn't return to a new line.
 m4_define([_AS_ECHO_N],
-[AS_REQUIRE([_AS_ECHO_N_PREPARE])dnl
-echo $ECHO_N "_AS_QUOTE([$1])$ECHO_C" >&m4_default([$2],
-                                                   [AS_MESSAGE_FD])])
+[AS_ECHO_N(["_AS_QUOTE([$1])"]) >&m4_default([$2], [AS_MESSAGE_FD])])


 # AS_MESSAGE(STRING, [FD = AS_MESSAGE_FD])
@@ -693,7 +690,7 @@
         X[]$1 : 'X\(/\)' \| .])

 m4_defun([_AS_BASENAME_SED],
-[echo X/[]$1 |
+[AS_ECHO([X/[]$1]) |
     sed ['/^.*\/\([^/][^/]*\)\/*$/{
            s//\1/
            q
@@ -747,7 +744,7 @@
         X[]$1 : 'X\(/\)' \| .])

 m4_defun([_AS_DIRNAME_SED],
-[echo X[]$1 |
+[AS_ECHO([X[]$1]) |
     sed ['/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
            s//\1/
            q
@@ -784,6 +781,55 @@
 ])# _AS_DIRNAME_PREPARE


+# AS_ECHO(WORD)
+# -------------
+# Output WORD followed by a newline.  WORD must be a single shell word
+# (typically a quoted string).  The bytes of WORD are output as-is, even
+# if it starts with "-" or contains "\".
+m4_defun([AS_ECHO],
+[AS_REQUIRE([_$0_PREPARE])dnl
+$as_echo $1])
+
+
+# AS_ECHO_N(WORD)
+# -------------
+# Like AS_ECHO(WORD), except do not output the trailing newline.
+m4_defun([AS_ECHO_N],
+[AS_REQUIRE([_AS_ECHO_PREPARE])dnl
+$as_echo_n $1])
+
+
+# _AS_ECHO_PREPARE
+# -----------------
+# Arrange for $as_echo 'FOO' to echo FOO without escape-interpretation;
+# and similarly for $as_echo_foo, which omits the trailing newline.
+# 'FOO' is an optional single argument; a missing FOO is treated as empty.
+m4_defun([_AS_ECHO_PREPARE],
+[[as_nl='
+'
+export as_nl
+case `(printf %s foo) 2>/dev/null` in
+foo)
+  as_echo='printf %s\n'
+  as_echo_n='printf %s';;
+*)
+  as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+  as_echo_n_body='eval
+    arg=$1;
+    case $arg in
+    *"$as_nl"*)
+      expr "X$arg" : "X\\(.*\\)$as_nl";
+      arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+    esac;
+    expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+  '
+  export as_echo_body as_echo_n_body
+  as_echo='sh -c $as_echo_body X'
+  as_echo_n='sh -c $as_echo_n_body X';;
+esac
+]])# _AS_ECHO_PREPARE
+
+
 # AS_TEST_X
 # ---------
 # Check whether a file has executable or search permissions.
@@ -939,7 +985,7 @@
     as_dirs=
     while :; do
       case $as_dir in #(
-      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *\'*) as_qdir=`AS_ECHO(["$as_dir"]) | sed "s/'/'\\\\\\\\''/g"`;; #(
       *) as_qdir=$as_dir;;
       esac
       as_dirs="'$as_qdir' $as_dirs"
@@ -1185,7 +1231,7 @@
   (umask 077 && mkdir "$tmp")
 } ||
 {
-   echo "$me: cannot create a temporary directory in m4_default([$2], 
[$TMPDIR])" >&2
+   AS_ECHO(["$me: cannot create a temporary directory in m4_default([$2], 
[$TMPDIR])"]) >&2
    AS_EXIT
 }dnl
 ])# AS_TMPDIR
@@ -1218,7 +1264,7 @@

 _ASUNAME

-_AS_PATH_WALK([$PATH], [echo "PATH: $as_dir"])
+_AS_PATH_WALK([$PATH], [AS_ECHO(["PATH: $as_dir"])])
 }])


@@ -1351,7 +1397,7 @@
 AS_LITERAL_IF([$1],
              [m4_bpatsubst(m4_translit([[$1]], [*+], [pp]),
                            [[^a-zA-Z0-9_]], [_])],
-             [`echo "$1" | $as_tr_sh`])])
+             [`AS_ECHO(["$1"]) | $as_tr_sh`])])


 # _AS_TR_CPP_PREPARE
@@ -1375,7 +1421,7 @@
                                        [*abcdefghijklmnopqrstuvwxyz],
                                        [PABCDEFGHIJKLMNOPQRSTUVWXYZ]),
                           [[^A-Z0-9_]], [_])],
-             [`echo "$1" | $as_tr_cpp`])])
+             [`AS_ECHO(["$1"]) | $as_tr_cpp`])])


 # _AS_TR_PREPARE
@@ -1418,12 +1464,13 @@
 # Get the value of the shell VARIABLE.
 # Evaluates to $VARIABLE if there are no indirection in VARIABLE,
 # else into the appropriate `eval' sequence.
-# FIXME: This mishandles values that end in newlines, or have backslashes,
-# or are '-n'.  Fixing this will require changing the API.
+# FIXME: This mishandles values that end in newlines.
+# Fixing this will require changing the API.
 m4_define([AS_VAR_GET],
 [AS_LITERAL_IF([$1],
               [$$1],
-              [`eval echo '${'m4_bpatsubst($1, [[\\`]], [\\\&])'}'`])])
+              [`eval 'as_val=${'m4_bpatsubst([$1], [[\\`]], [\\\&])'}
+                AS_ECHO(["$as_val"])'`])])


 # AS_VAR_TEST_SET(VARIABLE)
Index: tests/c.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/c.at,v
retrieving revision 1.9
diff -u -r1.9 c.at
--- tests/c.at  8 Mar 2006 20:48:22 -0000       1.9
+++ tests/c.at  17 Nov 2006 21:02:03 -0000
@@ -141,7 +141,7 @@
 AT_SETUP([AC_PROG_CPP without warnings])

 # Ignore if /lib/cpp doesn't work
-AT_CHECK([echo '#include <stdio.h>' | /lib/cpp || exit 77],
+AT_CHECK([[echo '#include <stdio.h>' | /lib/cpp || exit 77]],
   [], [ignore], [ignore])

 # A cpp which exit status is meaningless.
@@ -179,7 +179,7 @@
 AT_SETUP([AC_PROG_CPP via CC])

 # Ignore if /lib/cpp doesn't work
-AT_CHECK([echo '#include <stdio.h>' | /lib/cpp || exit 77],
+AT_CHECK([[echo '#include <stdio.h>' | /lib/cpp || exit 77]],
   [], [ignore], [ignore])

 AT_DATA([mycc],
Index: tests/m4sh.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/m4sh.at,v
retrieving revision 1.48
diff -u -r1.48 m4sh.at
--- tests/m4sh.at       15 Oct 2006 01:12:02 -0000      1.48
+++ tests/m4sh.at       17 Nov 2006 21:02:03 -0000
@@ -155,6 +155,54 @@



+## --------- ##
+## AS_ECHO.  ##
+## --------- ##
+
+# Build nested dirs.
+AT_SETUP([AS@&address@hidden and AS@&address@hidden)
+
+AT_DATA_M4SH([script.as],
+[[AS_INIT
+
+m4_define([ECHO_TEST],
+[echo=`AS_ECHO(['$1'])`
+test "X$echo" = 'X$1' ||
+  echo "AS@&address@hidden('"'$1'"') outputs '$echo'" >&2
+
+echo=`AS_ECHO_N(['$1'])`
+test "X$echo" = 'X$1' ||
+  echo "AS@&address@hidden('"'$1'"') outputs '$echo'" >&2])
+
+ECHO_TEST([-])
+ECHO_TEST([--])
+ECHO_TEST([---...---])
+ECHO_TEST([     ])
+ECHO_TEST([-e])
+ECHO_TEST([-E])
+ECHO_TEST([-n])
+ECHO_TEST([-n -n])
+ECHO_TEST([-e -n])
+ECHO_TEST([ab\ncd])
+ECHO_TEST([abcd\c])
+ECHO_TEST([\a\b\c\f\n\r\t\v\"\])
+ECHO_TEST([ab
+cd
+e])
+ECHO_TEST([
+ ])
+ECHO_TEST([
+\c])
+AS_EXIT(0)
+]])
+
+AT_CHECK_M4SH
+AT_CHECK([./script])
+
+AT_CLEANUP
+
+
+
 ## ------------- ##
 ## AS_BASENAME.  ##
 ## ------------- ##




reply via email to

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