libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Add an XSI replacement for func_split_short_opt.


From: Gary V. Vaughan
Subject: [PATCH] Add an XSI replacement for func_split_short_opt.
Date: Sun, 27 Jun 2010 17:58:03 +0700

Okay to push?

* libltdl/m4/libtool.m4 (_LT_CHECK_SHELL_FEATURES): Also ensure
that XSI substring extraction is supported.
(_LT_PROG_XSI_SHELLFNS): Use XSI substring extraction to split
short options to avoid unnecessary forks if the host shell
supports that.
---
 ChangeLog             |    7 +++++++
 libltdl/m4/libtool.m4 |    8 ++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2336820..c0f284a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-06-27  Gary V. Vaughan  <address@hidden>
 
+       Add an XSI replacement for func_split_short_opt.
+       * libltdl/m4/libtool.m4 (_LT_CHECK_SHELL_FEATURES): Also ensure
+       that XSI substring extraction is supported.
+       (_LT_PROG_XSI_SHELLFNS): Use XSI substring extraction to split
+       short options to avoid unnecessary forks if the host shell
+       supports that.
+
        Use TAB-SPACE in preference to SPACE-TAB.
        * libltdl/m4/libtool.m4 (_LT_PROG_XSI_REPLACE): Some editors
        might optimise away the SPACE in SPACE-TAB sequences, so use
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 8827d4a..19194dd 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -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:0:1},${_lt_dummy:2},"${_lt_dummy%"$_lt_dummy"},
 \
+      = c,a/b,a,b/c,, \
     && eval 'test $(( 1 + 1 )) -eq 2 \
     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
   && xsi_shell=yes
@@ -7301,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_name=${1:1:1}
+    func_split_short_opt_arg=${1:2}])
+
   _LT_PROG_XSI_REPLACE([func_lo2o], [dnl
     case ${1} in
       *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]