]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Factor the sed command used to make a regex from a literal.
authorPaolo Bonzini <bonzini@gnu.org>
Sun, 15 Aug 2010 17:04:08 +0000 (19:04 +0200)
committerPaolo Bonzini <bonzini@gnu.org>
Sun, 22 Aug 2010 07:27:09 +0000 (09:27 +0200)
* 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.

ChangeLog
libltdl/config/general.m4sh
libltdl/config/ltmain.m4sh

index 0d5840f614695a28dfb68c54dd9779764bc93332..9892427d52ece9f57255d0a6506c73ae85d6b426 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-08-15  Paolo Bonzini  <bonzini@gnu.org>
+
+       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 <tammer@tammer.net>  (tiny change)
 
        Avoid issues with AIX resident shared libraries in old testsuite.
index 1245fe570e855b547cd0289ee5e8df0f93331a37..1ccb9b047c5f59c80176d0034a52d47e4956e8d8 100644 (file)
@@ -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.
index d334b65346ae0862146144c843f95a76aae2320b..c6671a01843c9df80e3e914464bf9fc66f0aa3cb 100644 (file)
@@ -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