]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Fix portability regressions in today's earlier changeset.
authorGary V. Vaughan <gary@gnu.org>
Sun, 27 Jun 2010 06:57:50 +0000 (13:57 +0700)
committerGary V. Vaughan <gary@gnu.org>
Sun, 27 Jun 2010 06:57:50 +0000 (13:57 +0700)
* libltdl/m4/libtool.m4 (_LT_PROG_XSI_REPLACE): `sed -i' is not
portable; use `mv -f ...|| cp -f ...' instead.
Add an initial backslash to sed `c' substitutions with leading
whitespace, so that indentation is not removed by some non-POSIX
compliant sed implementations.
(_LT_PROG_XSI_SHELLFNS): Display a diagnostic warning message if
one or more XSI function replacements failed.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
ChangeLog
libltdl/m4/libtool.m4

index e95b8361b58bba370859091a79e4536f7e30ca2d..853ee86ab853908653737bc462af76e04017f661 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2010-06-27  Gary V. Vaughan  <gary@gnu.org>
 
+       Fix portability regressions in today's earlier changeset.
+       * libltdl/m4/libtool.m4 (_LT_PROG_XSI_REPLACE): `sed -i' is not
+       portable; use `mv -f ...|| cp -f ...' instead.
+       Add an initial backslash to sed `c' substitutions with leading
+       whitespace, so that indentation is not removed by some non-POSIX
+       compliant sed implementations.
+       (_LT_PROG_XSI_SHELLFNS): Display a diagnostic warning message if
+       one or more XSI function replacements failed.
+
        getopt.m4sh generated libtool option parser, and XSI improvements.
        * libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS): Moved portable
        shell versions of various utility functions from here...
index 0b8a00e8532701519b05254bea74e2962c72b653..2079e205e7abdc2801310a7e570d48adecb7f8f7 100644 (file)
@@ -7257,13 +7257,15 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
 # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
 m4_defun([_LT_PROG_XSI_REPLACE],
 [dnl {
-sed -i .tmp -e '/^$1 ()$/,/^} # $1 /c\
+sed -e '/^$1 ()$/,/^} # $1 /c\
 $1 ()\
 {\
-m4_bpatsubst([$2], [$], [\\])
-} # XSI $1 implementation' "$cfgfile" \
-  || (mv -f "$cfgfile.tmp" "$cfgfile"; exit 1)
-rm -f "$cfgfile.tmp"])
+m4_bpatsubsts([$2], [$], [\\], [^\([   ]\)], [\\\1])
+} # XSI $1 implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_xsi_replace_fail=:
+])
 
 
 # _LT_PROG_XSI_SHELLFNS
@@ -7315,4 +7317,8 @@ fi
 if test x"$lt_shell_append" = xyes; then
   _LT_PROG_XSI_REPLACE([func_append], [    eval "${1}+=\\${2}"])
 fi
+
+if test x"$_lt_xsi_replace_fail" = x":"; then
+  AC_MSG_WARN([Unable to substitute faster XSI functions in $ofile]) 
+fi
 ])