>From 6b925d5364311ad57a0df041f59b34623e8b3cb2 Mon Sep 17 00:00:00 2001
From: Peter Rosin <p...@lysator.liu.se>
Date: Sun, 5 Sep 2010 17:54:21 +0200
Subject: [PATCH 6/7] Convert file name to toolchain format when invoking $NM.

* libltdl/config/ltmain.m4sh (func_generate_dlsyms)
(func_win32_libid, func_cygming_gnu_implib_p)
(func_cygming_ms_implib_p): When using the name lister to find
symbols in files, convert the file names to a format appropriate
for the tool.

Signed-off-by: Peter Rosin <p...@lysator.liu.se>
---
 ChangeLog                  |    9 +++++++++
 libltdl/config/ltmain.m4sh |   23 +++++++++++++++--------
 2 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3c6b5c4..c6a6249 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2010-09-05  Peter Rosin  <p...@lysator.liu.se>
 
+       Convert file name to toolchain format when invoking $NM.
+       * libltdl/config/ltmain.m4sh (func_generate_dlsyms)
+       (func_win32_libid, func_cygming_gnu_implib_p)
+       (func_cygming_ms_implib_p): When using the name lister to find
+       symbols in files, convert the file names to a format appropriate
+       for the tool.
+
+2010-09-05  Peter Rosin  <p...@lysator.liu.se>
+
        Convert POSIX file names to toolchain format for MSVC
        * libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG)
        [mingw] <cl>: Make sure the -outputresource: file name for the
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index e5867b6..dfa8c89 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2497,8 +2497,9 @@ extern \"C\" {
          # Add our own program objects to the symbol list.
          progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
          for progfile in $progfiles; do
-           func_verbose "extracting global C symbols from \`$progfile'"
-           $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> 
'$nlist'"
+           func_to_tool_file "$progfile"
+           func_verbose "extracting global C symbols from 
\`$func_to_tool_file_result'"
+           $opt_dry_run || eval "$NM $func_to_tool_file_result | 
$global_symbol_pipe >> '$nlist'"
          done
 
          if test -n "$exclude_expsyms"; then
@@ -2573,20 +2574,23 @@ extern \"C\" {
                    func_warning "Could not compute DLL name from $name"
                    eval '$ECHO ": $name " >> "$nlist"'
                  fi
-                 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe |
+                 func_to_tool_file "$dlprefile"
+                 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | 
$global_symbol_pipe |
                    $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> 
'$nlist'"
                }
              else # not an import lib
                $opt_dry_run || {
                  eval '$ECHO ": $name " >> "$nlist"'
-                 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> 
'$nlist'"
+                 func_to_tool_file "$dlprefile"
+                 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | 
$global_symbol_pipe >> '$nlist'"
                }
              fi
            ;;
            *)
              $opt_dry_run || {
                eval '$ECHO ": $name " >> "$nlist"'
-               eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> 
'$nlist'"
+               func_to_tool_file "$dlprefile"
+               eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | 
$global_symbol_pipe >> '$nlist'"
              }
            ;;
           esac
@@ -2748,7 +2752,8 @@ func_win32_libid ()
     # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
        $EGREP 'file format (pei*-i386(.*architecture: 
i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
-      win32_nmres=`eval $NM -f posix -A $1 |
+      func_to_tool_file "$1"
+      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
        $SED -n -e '
            1,100{
                / I /{
@@ -2860,7 +2865,8 @@ func_cygming_dll_for_implib_fallback_core ()
 func_cygming_gnu_implib_p ()
 {
   $opt_debug
-  func_cygming_gnu_implib_tmp=`$NM $1 | eval "$global_symbol_pipe" | $EGREP ' 
(_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  func_to_tool_file "$1"
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval 
"$global_symbol_pipe" | $EGREP ' 
(_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
   test -n "$func_cygming_gnu_implib_tmp"
 }
 
@@ -2871,7 +2877,8 @@ func_cygming_gnu_implib_p ()
 func_cygming_ms_implib_p ()
 {
   $opt_debug
-  func_cygming_ms_implib_tmp=`$NM $1 | eval "$global_symbol_pipe" | $GREP 
'_NULL_IMPORT_DESCRIPTOR'`
+  func_to_tool_file "$1"
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval 
"$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
   test -n "$func_cygming_ms_implib_tmp"
 }
 
-- 
1.7.1

Reply via email to