]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Use documented M4sh interfaces.
authorPaolo Bonzini <bonzini@gnu.org>
Mon, 10 Nov 2008 07:25:24 +0000 (08:25 +0100)
committerPaolo Bonzini <bonzini@gnu.org>
Tue, 11 Nov 2008 09:08:38 +0000 (10:08 +0100)
* 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.

ChangeLog
clcommit.m4sh
libltdl/config/general.m4sh
libltdl/config/ltmain.m4sh
libltdl/config/mailnotify.m4sh
libltdl/m4/libtool.m4
libtoolize.m4sh
tests/defs.m4sh
tests/testsuite.at

index 7450c7b27e0ca3ce8271d1b74533780d62a9956d..ca5db44940cd13056aa74b9f63470bfd5ecd71b3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+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.
index 0d3ba42fc871289a58c97e0b6151c6c84686d8fb..73719ccf8ff171c5388c0433854f4324bfe35853 100644 (file)
@@ -1,5 +1,4 @@
-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
@@ -80,9 +79,7 @@ test -f "libltdl/config/$MKSTAMP" && MKSTAMP="libltdl/config/$MKSTAMP"
 
 PROGRAM=clcommit
 
-AS_SHELL_SANITIZE
-$as_unset CDPATH
-
+m4_divert_pop
 m4_include([getopt.m4sh])
 
 M4SH_VERBATIM([[
index 53ff5ea0fe075acca23136a63d2185205bd9fd08..cde7354852a21bd32382027def3284358a5de3a3 100644 (file)
@@ -30,6 +30,19 @@ or obtained by writing to the Free Software Foundation, Inc.,
 
 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"}
@@ -87,13 +100,6 @@ func_dirname_and_basename ()
 
 # 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:
index e7a5ff0cf598eda6c781d18e0447430d2c1b0e92..363ab932c29c5c948e0f018c1825b6e81ebeda4b 100644 (file)
@@ -111,6 +111,10 @@ done
 
 $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([[
index 20d6b832a54cc974b2bc830158216868a67af69f..a95f201a0ed3bfaa6ecb4b254bafaedd7fbd1ecb 100644 (file)
@@ -1,5 +1,4 @@
-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
@@ -63,9 +62,7 @@ m4_divert_push([SCRIPT])#!/bin/sh
 
 PROGRAM=mailnotify
 
-AS_SHELL_SANITIZE
-$as_unset CDPATH
-
+m4_divert_pop
 m4_include([getopt.m4sh])
 
 M4SH_VERBATIM([[
index caf88b1874e8c670c3ec22778ab0a7df21675bd6..23f3142bd686ae79cfa5098043d663cbd79322ab 100644 (file)
@@ -553,6 +553,35 @@ esac
 _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
 # ---------
@@ -562,20 +591,11 @@ _LT_OUTPUT_LIBTOOL_INIT
 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
index 456b4cfe0508044ca7b3a207a01df093f4524f56..30c3e3b1a44d55826413e4d3865fbe01e98bb881 100644 (file)
@@ -1,7 +1,5 @@
 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@
@@ -72,9 +70,7 @@ m4_divert_push([SCRIPT])dnl
 
 PROGRAM=libtoolize
 
-AS_SHELL_SANITIZE
-$as_unset CDPATH
-
+m4_divert_pop
 m4_include([getopt.m4sh])
 
 M4SH_VERBATIM([[
index c46781804f6c9349d160cf5bd04f43aec8697228..48d1d37229038bb791de963134e7e17c1385448e 100644 (file)
@@ -1,5 +1,5 @@
-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
@@ -26,9 +26,7 @@ m4_divert_push([SCRIPT])# @configure_input@
 # 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([[
index d5b0fe85b39a752e4e2758570d25a151c357367a..5990291448b8357ef843664ffa10f5280ad5d307 100644 (file)
@@ -23,6 +23,8 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 ####
 
+AT_INIT
+
 m4_divert_push([PREPARE_TESTS])dnl
 : ${tst_dist=dist}
 : ${ACLOCAL=aclocal}
@@ -371,5 +373,4 @@ dnl AT_TESTED([grep autoreconf autom4te automake])
 ## The suite.  ##
 ## ----------- ##
 
-AT_INIT
-# The other tests will be appended here by the Makefile rule.
+# Tests will be appended here by the Makefile rule.