+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
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
# 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 ;;
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.
| $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