]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Use a real XSI compliant func_split_short_opt substitution.
authorGary V. Vaughan <gary@gnu.org>
Tue, 29 Jun 2010 09:29:30 +0000 (16:29 +0700)
committerGary V. Vaughan <gary@gnu.org>
Tue, 29 Jun 2010 09:29:30 +0000 (16:29 +0700)
* libtool/m4/libtool.m4 (_LT_CHECK_SHELL_FEATURES): Remove
test ${foo:n:m} substrings, instead adding a ${foo%??} check
to the existing XSI tests.
(_LT_PROG_XSI_SHELLFNS): Remove the ${foo:n:m} based
func_split_short_opt substitution in favour of a properly
XSI compliant substitution.
Suggested by Paolo Bonzini.

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

index e939f4358419f8ac4d80fcffc04f49c3bdc19159..0a09fae2c94c0bdfddd694280ad0d5476c2196f6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-06-29  Gary V. Vaughan  <gary@gnu.org>
+
+       Use a real XSI compliant func_split_short_opt substitution.
+       * libtool/m4/libtool.m4 (_LT_CHECK_SHELL_FEATURES): Remove
+       test ${foo:n:m} substrings, instead adding a ${foo%??} check
+       to the existing XSI tests.
+       (_LT_PROG_XSI_SHELLFNS): Remove the ${foo:n:m} based
+       func_split_short_opt substitution in favour of a properly
+       XSI compliant substitution.
+       Suggested by Paolo Bonzini.
+
 2010-06-28  Gary V. Vaughan  <gary@gnu.org>
 
        Add func_append_quoted and do inline func_append substitutions.
index 01a9c41c7da81176cb77aa3e94de2de58da7dc32..7140627952fcea574668515164da86e1399541f7 100644 (file)
@@ -7211,8 +7211,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES],
 # Try some XSI features
 xsi_shell=no
 ( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,, \
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
     && eval 'test $(( 1 + 1 )) -eq 2 \
     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
   && xsi_shell=yes
@@ -7227,14 +7227,6 @@ lt_shell_append=no
 AC_MSG_RESULT([$lt_shell_append])
 _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
 
-AC_MSG_CHECKING([whether the shell understands variable substring :-syntax])
-lt_shell_substring=no
-( _lt_dummy="-bar"
-  test "${_lt_dummy:0:2},${_lt_dummy:2}" = -b,ar ) >/dev/null 2>&1 \
-&& lt_shell_substring=yes
-AC_MSG_RESULT([$lt_shell_substring])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_substring='$lt_shell_substring'])
-
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   lt_unset=unset
 else
@@ -7309,6 +7301,10 @@ m4_defun([_LT_PROG_XSI_SHELLFNS],
     func_split_long_opt_name=${1%%=*}
     func_split_long_opt_arg=${1#*=}])
 
+  _LT_PROG_XSI_REPLACE([func_split_short_opt], [dnl
+    func_split_short_opt_arg=${1#??}
+    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
   _LT_PROG_XSI_REPLACE([func_lo2o], [dnl
     case ${1} in
       *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
@@ -7343,12 +7339,6 @@ else
   test 0 -eq $? || _lt_xsi_replace_fail=:
 fi
 
-if test x"$lt_shell_substring" = xyes; then
-  _LT_PROG_XSI_REPLACE([func_split_short_opt], [dnl
-    func_split_short_opt_name=${1:0:2}
-    func_split_short_opt_arg=${1:2}])
-fi
-
 if test x"$_lt_xsi_replace_fail" = x":"; then
   AC_MSG_WARN([Unable to substitute faster XSI functions in $ofile]) 
 fi