mirror of
git://git.savannah.gnu.org/libtool.git
synced 2025-01-24 14:24:59 +08:00
* 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.
This commit is contained in:
parent
f3186c9c01
commit
9ebe7b436b
@ -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
|
||||
|
@ -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 ;;
|
||||
|
18
libltdl/m4/libtool.m4
vendored
18
libltdl/m4/libtool.m4
vendored
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user