libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/3] libtool: unify the global symbol transformations


From: Peter Rosin
Subject: [PATCH 2/3] libtool: unify the global symbol transformations
Date: Sat, 3 Nov 2012 00:42:15 +0100

Since it is safe for $lt_cv_sys_global_symbol_to_cdecl to match
with a simple /^T .* .*$/ type expression, it is ok for the other
transformations as well.  At least if you require at least one
$symcode at the start of the line, so that the just generated output
doesn't match the next sed expression.

* m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS): Unify the matching expressions
in the sed programs that transform the extracted symbol lines.

Signed-off-by: Peter Rosin <address@hidden>
---
 m4/libtool.m4 |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 79a4222..e59e0fb 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -3654,19 +3654,19 @@ esac
 # so use this general approach.
 lt_cv_sys_global_symbol_to_cdecl="sed -n"\
 " -e 's/^T .* \(.*\)$/extern int \1();/p'"\
-" -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
 lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
-" -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p'"\
-" -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
 
 # Transform an extracted symbol line into symbol name with lib prefix and
 # symbol address.
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
-" -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p'"\
-" -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"\
-" -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -3771,7 +3771,7 @@ lt__PROGRAM__LTX_preloaded_symbols[[]] =
 {
   { "@PROGRAM@", (void *) 0 },
 _LT_EOF
-         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) 
\&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+         $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < 
"$nlist" | $GREP -v main >> conftest.$ac_ext
          cat <<\_LT_EOF >> conftest.$ac_ext
   {0, (void *) 0}
 };
-- 
1.7.9




reply via email to

[Prev in Thread] Current Thread [Next in Thread]