diff --git a/ChangeLog b/ChangeLog index 3cb735ba..75435b7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-02-11 Ralf Wildenhues + + * 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 Eliminate roughly a third of the script execution time overhead diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index ec83da77..c6643c66 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -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 ;; diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index 62beff53..a78f343e 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -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