* clcommit.m4sh: Do not unset CDPATH, use AS_INIT and M4sh diversions.
* libltdl/config/mailnotify.m4sh: Likewise.
* libtoolize.m4sh: Likewise.
* tests/defs.m4sh: Likewise.
* tests/testsuite.at: Move AT_INIT invocation at the top.
* libltdl/m4/libtool.m4 (_LT_GENERATED_FILE_INIT): New.
(LT_OUTPUT): Use it.
* libltdl/config/general.m4sh (M4SH_IN_HEADER): New.
(progpath): Move setting before $0 could be clobbered.
* libltdl/config/ltmain.m4sh (M4SH_IN_HEADER): New.
+2008-11-10 Paolo Bonzini <bonzini@gnu.org>
+
+ Use documented M4sh interfaces.
+ * clcommit.m4sh: Do not unset CDPATH, use AS_INIT and M4sh diversions.
+ * libltdl/config/mailnotify.m4sh: Likewise.
+ * libtoolize.m4sh: Likewise.
+ * tests/defs.m4sh: Likewise.
+ * tests/testsuite.at: Move AT_INIT invocation at the top.
+
+ * libltdl/m4/libtool.m4 (_LT_INIT_GENERATED): New.
+ (LT_OUTPUT): Use it.
+
+ * libltdl/config/general.m4sh (M4SH_IN_HEADER): New.
+ (progpath): Move setting before $0 could be clobbered.
+ * libltdl/config/ltmain.m4sh (M4SH_IN_HEADER): New.
+
2008-11-10 Paolo Bonzini <bonzini@gnu.org>
Run sh.test on the M4sh source.
-m4_define([_m4_divert(SCRIPT)], 100)
-m4_divert_push([SCRIPT])#!/bin/sh
+AS_INIT[]m4_divert_push([HEADER-COPYRIGHT])dnl
# @configure_input@
# clcommit (GNU @PACKAGE@) version 2.0
PROGRAM=clcommit
-AS_SHELL_SANITIZE
-$as_unset CDPATH
-
+m4_divert_pop
m4_include([getopt.m4sh])
M4SH_VERBATIM([[
m4_define([M4SH_VERBATIM], [$1])dnl
+m4_ifndef([M4SH_IN_HEADER],
+[m4_define([M4SH_IN_HEADER],
+[m4_divert_text([HEADER-COPYRIGHT], [$1])])])
+
+M4SH_IN_HEADER([dnl
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+])
+
M4SH_VERBATIM([[
: ${CP="cp -f"}
: ${ECHO="echo"}
# Generated shell functions inserted here.
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
-
# The name of this program:
# In the unlikely event $progname began with a '-', it would play havoc with
# func_echo (imagine progname=-n), so we prepend ./ in that case:
$lt_unset CDPATH
+dnl This script is generated by config.status, so we cannot put things
+dnl in the header.
+m4_define([M4SH_IN_HEADER], [$1])dnl
+
m4_include([getopt.m4sh])
M4SH_VERBATIM([[
-m4_define([_m4_divert(SCRIPT)], 100)
-m4_divert_push([SCRIPT])#!/bin/sh
+AS_INIT[]m4_divert_push([HEADER-COPYRIGHT])dnl
# @configure_input@
# mailnotify (GNU @PACKAGE@) version 0.6
PROGRAM=mailnotify
-AS_SHELL_SANITIZE
-$as_unset CDPATH
-
+m4_divert_pop
m4_include([getopt.m4sh])
M4SH_VERBATIM([[
_LT_OUTPUT_LIBTOOL_INIT
])
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
# LT_OUTPUT
# ---------
AC_DEFUN([LT_OUTPUT],
[: ${CONFIG_LT=./config.lt}
AC_MSG_NOTICE([creating $CONFIG_LT])
-cat >"$CONFIG_LT" <<_LTEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate a libtool stub with the current configuration.
-
-lt_cl_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_LTEOF
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
cat >>"$CONFIG_LT" <<\_LTEOF
-AS_SHELL_SANITIZE
-_AS_PREPARE
-
-exec AS_MESSAGE_FD>&1
+lt_cl_silent=false
exec AS_MESSAGE_LOG_FD>>config.log
{
echo
m4_pattern_allow([dnl])
-m4_define([_m4_divert(SCRIPT)], 100)
-m4_divert_push([SCRIPT])dnl
-#! /bin/sh
+AS_INIT[]m4_divert_push([HEADER-COPYRIGHT])dnl
# @configure_input@
# libtoolize (GNU @PACKAGE@@TIMESTAMP@) @VERSION@
PROGRAM=libtoolize
-AS_SHELL_SANITIZE
-$as_unset CDPATH
-
+m4_divert_pop
m4_include([getopt.m4sh])
M4SH_VERBATIM([[
-m4_define([_m4_divert(SCRIPT)], 100)
-m4_divert_push([SCRIPT])# @configure_input@
+AS_INIT[]m4_divert_push([HEADER-COPYRIGHT])dnl
+# @configure_input@
# defs -- Defines for Libtool testing environment.
#
# Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
####
-AS_SHELL_SANITIZE
-$as_unset CDPATH
-
+m4_divert_pop
m4_include([general.m4sh])
M4SH_VERBATIM([[
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
####
+AT_INIT
+
m4_divert_push([PREPARE_TESTS])dnl
: ${tst_dist=dist}
: ${ACLOCAL=aclocal}
## The suite. ##
## ----------- ##
-AT_INIT
-# The other tests will be appended here by the Makefile rule.
+# Tests will be appended here by the Makefile rule.