+2008-10-09 Paolo Bonzini <bonzini@gnu.org>
+
+ * m4sugar/m4sh.m4 (AS_SHELL_SANITIZE): Delay setting as_me
+ until the M4SH-INIT diversion using _AS_ME_PREPARE.
+ (_AS_PREPARE): Invoke _AS_EXPR_PREPARE before _AS_BASENAME_PREPARE
+ and _AS_DIRNAME_PREPARE, and _AS_BASENAME_PREPARE and _AS_ME_PREPARE
+ before _AS_LINENO_PREPARE.
+ (AS_PREPARE): Include all the AS_REQUIREs manually.
+ (_AS_ME_PREPARE): New.
+ (_AS_LINENO_PREPARE): Use m4_defun.
+
2008-10-09 Paolo Bonzini <bonzini@gnu.org>
* m4sugar/m4sh.m4 (_AS_BASENAME_EXPR, _AS_DIRNAME_EXPR): Do not
* GNUmakefile: Resync from upstream, via new 'make fetch'.
* build-aux/config.guess: Likewise.
-2008-09-18 Paolo Bonzini <bonzini@gnu.org>
+2008-10-08 Paolo Bonzini <bonzini@gnu.org>
* lib/m4sugar/m4sh.m4 (_AS_SHELL_FN_SPY): Remove.
(AS_INIT): Do not call it.
-2008-09-18 Paolo Bonzini <bonzini@gnu.org>
+2008-10-08 Paolo Bonzini <bonzini@gnu.org>
* lib/m4sugar/m4sh.m4 (_AS_DETECT_BETTER_SHELL): Expand
_AS_UNSET_PREPARE in M4SH-SANITIZE.
# there are so many _AS_PREPARE_* below, and that's also why it is
# important not to forget some: config.status needs them.
m4_defun([_AS_PREPARE],
-[_AS_LINENO_PREPARE
-
-_AS_DIRNAME_PREPARE
+[_AS_EXPR_PREPARE
_AS_BASENAME_PREPARE
+_AS_DIRNAME_PREPARE
+_AS_ME_PREPARE
+_AS_LINENO_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
_AS_TEST_PREPARE
_AS_TR_SH_PREPARE
])
-
# AS_PREPARE
# ----------
# Output all the M4sh possible initialization into the initialization
-# diversion.
+# diversion. We do not use _AS_PREPARE so that the m4_provide symbols for
+# AS_REQUIRE and AS_REQUIRE_SHELL_FN are defined properly, and so that
+# shell functions are placed in M4SH-INIT-FN.
m4_defun([AS_PREPARE],
-[m4_divert_text([M4SH-INIT], [_AS_PREPARE])])
+[AS_REQUIRE([_AS_EXPR_PREPARE])
+AS_REQUIRE([_AS_BASENAME_PREPARE])
+AS_REQUIRE([_AS_DIRNAME_PREPARE])
+AS_REQUIRE([_AS_ME_PREPARE])
+AS_REQUIRE([_AS_LINENO_PREPARE])
+AS_REQUIRE([_AS_ECHO_N_PREPARE])
+AS_REQUIRE([_AS_LN_S_PREPARE])
+AS_REQUIRE([_AS_MKDIR_P_PREPARE])
+AS_REQUIRE([_AS_TEST_PREPARE])
+AS_REQUIRE([_AS_TR_CPP_PREPARE])
+AS_REQUIRE([_AS_TR_SH_PREPARE])
+])
# AS_REQUIRE(NAME-TO-CHECK, [BODY-TO-EXPAND = NAME-TO-CHECK],
LANGUAGE=C
export LANGUAGE
-# Required to use basename.
-_AS_EXPR_PREPARE
-_AS_BASENAME_PREPARE
-
-# Name of the executable.
-as_me=`AS_BASENAME("$[0]")`
+dnl Delay this until after shell functions are defined.
+AS_REQUIRE([_AS_ME_PREPARE])
# CDPATH.
$as_unset CDPATH
])# _AS_EXPR_PREPARE
+# _AS_ME_PREPARE
+# --------------
+# Define $as_me to the basename of the executable file's name.
+m4_defun([_AS_ME_PREPARE],
+[AS_REQUIRE([_AS_BASENAME_PREPARE])dnl
+as_me=`AS_BASENAME("$[0]")`
+])
+
# _AS_LINENO_WORKS
# ---------------
# Succeed if the currently executing shell supports LINENO.
# the case of embedded executables (such as config.status within
# configure) you'd compare LINENO wrt config.status vs. _oline_ wrt
# configure.
-m4_define([_AS_LINENO_PREPARE],
+m4_defun([_AS_LINENO_PREPARE],
[AS_REQUIRE([_AS_CR_PREPARE])dnl
+AS_REQUIRE([_AS_ME_PREPARE])dnl
_AS_DETECT_SUGGESTED([_AS_LINENO_WORKS])
_AS_LINENO_WORKS || {