]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS): New function
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 11 Feb 2007 16:19:09 +0000 (16:19 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 11 Feb 2007 16:19:09 +0000 (16:19 +0000)
func_opt_split, for XSI and portable shell.
* libltdl/config/ltmain.m4sh: Move the insertion point for the
configure-generated shell functions to before the first option
parsing loop.  Rewrite the separation of the long options to use
func_opt_split.

ChangeLog
libltdl/config/ltmain.m4sh
libltdl/m4/libtool.m4

index 3cb735ba1a390968a24c46d049ad57d16b420ce5..75435b7c95c82740aacba0ae05a81c8f6c89411b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-02-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * libltdl/m4/libtool.m4 (_LT_PROG_XSI_SHELLFNS): New function
+       func_opt_split, for XSI and portable shell.
+       * libltdl/config/ltmain.m4sh: Move the insertion point for the
+       configure-generated shell functions to before the first option
+       parsing loop.  Rewrite the separation of the long options to use
+       func_opt_split.
+
 2007-02-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Eliminate roughly a third of the script execution time overhead
index ec83da77d0b9974664d8ed1b6d2057bcc30c0571..c6643c66e0b5ad3f08388cf50b7c3f26b70309c2 100644 (file)
@@ -425,14 +425,12 @@ Otherwise, only FILE itself is deleted using RM."
     exit $?
 }
 
+# Generated shell functions inserted here.
+
+
 # Parse options once, thoroughly.  This comes as soon as possible in
 # the script to make things like `libtool --version' happen quickly.
 {
-  # sed scripts:
-  my_sed_single_opt='1s/^\(..\).*$/\1/;q'
-  my_sed_single_rest='1s/^..\(.*\)$/\1/;q'
-  my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
-  my_sed_long_arg='1s/^-[[^=]]*=//'
 
   # Shorthand for --mode=foo, only valid as the first argument
   case $1 in
@@ -524,28 +522,11 @@ Otherwise, only FILE itself is deleted using RM."
 
       # Separate optargs to long options:
       -dlopen=*|--mode=*|--tag=*)
-                       arg=`$ECHO "X$opt" | $Xsed -e "$my_sed_long_arg"`
-                       opt=`$ECHO "X$opt" | $Xsed -e "$my_sed_long_opt"`
-                       set dummy "$opt" "$arg" ${1+"$@"}
+                       func_opt_split "$opt"
+                       set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
                        shift
                        ;;
 
-      # Separate optargs to short options:
-#      -x*|-y*)
-#                      arg=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_rest"`
-#                      opt=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_opt"`
-#                      set dummy "$opt" "$arg" ${1+"$@"}
-#                      shift
-#                      ;;
-
-      # Separate non-argument short options:
-#      -z*|-z*|-y*)
-#                      rest=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_rest"`
-#                      opt=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_opt"`
-#                      set dummy "$opt" "-$rest" ${1+"$@"}
-#                      shift
-#                      ;;
-
       -\?|-h)          func_usage                                      ;;
       --help)          opt_help=:                                      ;;
       --version)       func_version                                    ;;
index 62beff5304d785a61f3dcf04ab8c12ed6e7d917f..a78f343e2a8d03bf12e54f4df6fca8557778f037 100644 (file)
@@ -7040,6 +7040,13 @@ func_stripname ()
   func_stripname_result=${func_stripname_result#"${1}"}
   func_stripname_result=${func_stripname_result%"${2}"}
 }
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=${1%%=*}
+  func_opt_split_arg=${1#*=}
+}
 _LT_EOF
     ;;
   *) # Bourne compatible functions.
@@ -7079,6 +7086,17 @@ func_stripname ()
            | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
   esac
 }
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[[^=]]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
 _LT_EOF
 esac