From: Akim Demaille Date: Thu, 13 Sep 2001 06:56:31 +0000 (+0000) Subject: Test suites can be run independently of configure. X-Git-Tag: AUTOCONF-2.52f~157 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5216ece6a8b0b2986370e7b2b461cdd32a1bdd87;p=thirdparty%2Fautoconf.git Test suites can be run independently of configure. * lib/m4sugar/m4sh.m4 (_AS_ECHO, _AS_ECHO_N_PREPARE): New. * lib/autoconf/programs.m4 (_AC_PROG_ECHO): Remove. * lib/autoconf/general.m4 (_AC_INIT_PREPARE): Adjust: AC_SUBST ECHO_N etc. * lib/autoconf/autotest.m4 (AC_CONFIG_TESTDIR): Don't ask for at_n and at_c. * lib/autotest/general.m4: Use ECHO_*. --- diff --git a/ChangeLog b/ChangeLog index bac1858c0..31226b8c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2001-09-13 Akim Demaille + + Test suites can be run independently of configure. + + * lib/m4sugar/m4sh.m4 (_AS_ECHO, _AS_ECHO_N_PREPARE): New. + * lib/autoconf/programs.m4 (_AC_PROG_ECHO): Remove. + * lib/autoconf/general.m4 (_AC_INIT_PREPARE): Adjust: AC_SUBST + ECHO_N etc. + * lib/autoconf/autotest.m4 (AC_CONFIG_TESTDIR): Don't ask for at_n + and at_c. + * lib/autotest/general.m4: Use ECHO_*. + 2001-09-13 Akim Demaille * bin/ifnames.in: Rewrite in Perl. diff --git a/lib/autoconf/autotest.m4 b/lib/autoconf/autotest.m4 index f79e90b13..085fe5208 100644 --- a/lib/autoconf/autotest.m4 +++ b/lib/autoconf/autotest.m4 @@ -72,9 +72,6 @@ at_package_version='$at_package_version' at_package_string='$at_package_string' at_bugreport='$at_bugreport' -at_n='$at_n' -at_c='$at_c' - at_testdir='$1' srcdir='$ac_srcdir' top_srcdir='$ac_top_srcdir' @@ -90,9 +87,6 @@ at_package_version='$PACKAGE_VERSION' at_package_string='$PACKAGE_STRING' at_bugreport='$PACKAGE_BUGREPORT' -at_n='$ECHO_N' -at_c='$ECHO_C' - at_shell='$SHELL' ]) diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 01410b1f8..0f941e7e2 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -518,8 +518,8 @@ AC_DEFUN([AC_PREFIX_PROGRAM], m4_pushdef([AC_Prog], m4_toupper([$1]))dnl if test "x$prefix" = xNONE; then dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle. - echo $ECHO_N "checking for prefix by $ECHO_C" >&AS_MESSAGE_FD - AC_PATH_PROG(m4_quote(AC_Prog), [$1]) + _AS_ECHO_N([checking for prefix by]) + AC_PATH_PROG(AC_Prog, [$1]) if test -n "$ac_cv_path_[]AC_Prog"; then prefix=`AS_DIRNAME(["$ac_cv_path_[]AC_Prog"])` fi @@ -1240,11 +1240,12 @@ _AC_ARG_VAR_PRECIOUS([host_alias])dnl _AC_ARG_VAR_PRECIOUS([target_alias])dnl AC_LANG_PUSH(C) -_AC_PROG_ECHO()dnl - dnl Substitute for predefined variables. -AC_SUBST(DEFS)dnl -AC_SUBST(LIBS)dnl +AC_SUBST([DEFS])dnl +AC_SUBST([ECHO_C])dnl +AC_SUBST([ECHO_N])dnl +AC_SUBST([ECHO_T])dnl +AC_SUBST([LIBS])dnl m4_divert_pop([INIT_PREPARE])dnl ])# _AC_INIT_PREPARE @@ -1797,7 +1798,7 @@ m4_define([AC_CACHE_VAL], [$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl [where no actions should be taken])])dnl AS_VAR_SET_IF([$1], - [echo $ECHO_N "(cached) $ECHO_C" >&AS_MESSAGE_FD], + [_AS_ECHO_N([(cached)])], [$2])]) @@ -1931,19 +1932,11 @@ m4_define([AC_WARNING], ## ---------------------------------------- ## -# _AC_ECHO_N(STRING, [FD = AS_MESSAGE_FD]) -# ------------------------------------ -# Same as _AS_ECHO, but echo doesn't return to a new line. -m4_define([_AC_ECHO_N], -[echo $ECHO_N "_AS_QUOTE([$1])$ECHO_C" >&m4_default([$2], - [AS_MESSAGE_FD])]) - - # AC_MSG_CHECKING(FEATURE) # ------------------------ m4_define([AC_MSG_CHECKING], [_AS_ECHO([$as_me:__oline__: checking $1], AS_MESSAGE_LOG_FD) -_AC_ECHO_N([checking $1... ])[]dnl +_AS_ECHO_N([checking $1... ])[]dnl ]) diff --git a/lib/autoconf/programs.m4 b/lib/autoconf/programs.m4 index 8e7b2efd6..cce787364 100644 --- a/lib/autoconf/programs.m4 +++ b/lib/autoconf/programs.m4 @@ -256,28 +256,6 @@ AC_DEFUN([AC_PROG_AWK], [AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )]) -# _AC_PROG_ECHO -# ------------- -# Check whether to use -n, \c, or newline-tab to separate -# checking messages from result messages. -# Don't try to cache, since the results of this macro are needed to -# display the checking message. In addition, caching something used once -# has little interest. -# Idea borrowed from dist 3.0. Use `*c*,', not `*c,' because if `\c' -# failed there is also a new-line to match. -m4_define([_AC_PROG_ECHO], -[case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac -AC_SUBST(ECHO_C)dnl -AC_SUBST(ECHO_N)dnl -AC_SUBST(ECHO_T)dnl -])# _AC_PROG_ECHO - - # AC_PROG_INSTALL # --------------- AC_DEFUN([AC_PROG_INSTALL], diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index ada4acc37..267a8fcb0 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -474,7 +474,7 @@ _ATEOF echo "$at_setup_line" >at-check-line fi at_test_count=`expr 1 + $at_test_count` - $at_verbose $at_n "$at_test. $at_setup_line: $at_c" + $at_verbose $ECHO_N "$at_test. $at_setup_line: $ECHO_C" case $at_status in 0) at_msg="ok" ;; @@ -530,9 +530,9 @@ elif test $at_debug = false; then # Remove any debugging script resulting from a previous run. rm -f debug-*.sh echo - echo $at_n "Writing \`debug-NN.sh' scripts, with NN =$at_c" + echo $ECHO_N "Writing \`debug-NN.sh' scripts, with NN =$ECHO_C" for at_group in $at_fail_list; do - echo $at_n " $at_group$at_c" + echo $ECHO_N " $at_group$ECHO_C" ( echo "#! /bin/sh" echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$[0]" \ '-v -d' "$at_debug_args" "$at_group" '${1+"$[@]"}' @@ -619,7 +619,7 @@ m4_divert_push([TESTS])dnl AT_ordinal ) @%:@ AT_ordinal. AT_line: $1 at_setup_line='AT_line' $at_verbose "AT_ordinal. AT_line: testing $1..." - $at_quiet $at_n "m4_format([[%3d: %-18s]], AT_ordinal, AT_line)[]$at_c" + $at_quiet $ECHO_N "m4_format([[%3d: %-18s]], AT_ordinal, AT_line)[]$ECHO_C" ( $at_traceon ]) diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index 1d4b7c856..18af9d79a 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -113,6 +113,7 @@ fi dnl Moved here because the tests below can use AC_MSG_ERROR, which uses $as_me as_me=`AS_BASENAME($[0])` +_AS_ECHO_N_PREPARE _AS_EXPR_PREPARE _AS_LN_S_PREPARE _AS_PATH_SEPARATOR_PREPARE @@ -273,6 +274,33 @@ m4_define([_AS_ECHO], [_AS_ECHO_UNQUOTED([_AS_QUOTE([$1])], [$2])]) +# _AS_ECHO_N_PREPARE +# ------------------ +# Check whether to use -n, \c, or newline-tab to separate +# checking messages from result messages. +# Don't try to cache, since the results of this macro are needed to +# display the checking message. In addition, caching something used once +# has little interest. +# Idea borrowed from dist 3.0. Use `*c*,', not `*c,' because if `\c' +# failed there is also a new-line to match. +m4_define([_AS_ECHO_N_PREPARE], +[case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac +])# _AS_ECHO_N_PREPARE + + +# _AS_ECHO_N(STRING, [FD = AS_MESSAGE_FD]) +# ---------------------------------------- +# Same as _AS_ECHO, but echo doesn't return to a new line. +m4_define([_AS_ECHO_N], +[echo $ECHO_N "_AS_QUOTE([$1])$ECHO_C" >&m4_default([$2], + [AS_MESSAGE_FD])]) + + # AS_MESSAGE(STRING, [FD = AS_MESSAGE_FD]) # ---------------------------------------- m4_define([AS_MESSAGE],