From: Paolo Bonzini Date: Sun, 15 Aug 2010 17:04:08 +0000 (+0200) Subject: Factor the sed command used to make a regex from a literal. X-Git-Tag: v2.4~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d7ed1f8f9f03ff54a1c8950848ae34bca41fb5f1;p=thirdparty%2Flibtool.git Factor the sed command used to make a regex from a literal. * libltdl/config/general.m4sh (sed_make_literal_regex): New. * libltdl/config/ltmain.m4sh (func_generate_dlsyms, func_cygming_dll_for_implib_fallback_core): Use it. Suggested by Ralf Wildenhues. --- diff --git a/ChangeLog b/ChangeLog index 0d5840f61..9892427d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-08-15 Paolo Bonzini + + Factor the sed command used to make a regex from a literal. + * libltdl/config/general.m4sh (sed_make_literal_regex): New. + * libltdl/config/ltmain.m4sh + (func_cygming_dll_for_implib_fallback_core): Use it. Suggested + by Ralf Wildenhues. + 2010-08-21 Rainer Tammer (tiny change) Avoid issues with AIX resident shared libraries in old testsuite. diff --git a/libltdl/config/general.m4sh b/libltdl/config/general.m4sh index 1245fe570..1ccb9b047 100644 --- a/libltdl/config/general.m4sh +++ b/libltdl/config/general.m4sh @@ -315,6 +315,10 @@ sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*/],\\\\&,g' + # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index d334b6534..c6671a018 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -2265,7 +2265,7 @@ func_cygming_dll_for_implib () func_cygming_dll_for_implib_fallback_core () { $opt_debug - match_literal=`$ECHO "$1" | $SED 's/[].[^$\\*|]/\\\\&/g'` + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section