]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtool: feed .def files verbatim to the MSVC linker
authorPeter Rosin <peda@lysator.liu.se>
Wed, 16 Jan 2013 12:39:52 +0000 (13:39 +0100)
committerPeter Rosin <peda@lysator.liu.se>
Wed, 16 Jan 2013 12:39:52 +0000 (13:39 +0100)
m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) [MSVC]
<archive_expsym_cmds>: When the symbol list isn't really a symbol list,
but instead a .def file, copy it to a file with .def extension so that
MSVC recognizes it as a module-definition file and feed it verbatim.
NEWS: Update

Signed-off-by: Peter Rosin <peda@lysator.liu.se>
NEWS
m4/libtool.m4

diff --git a/NEWS b/NEWS
index fe2c6dbd2e440a96376ae11803c957d3c736c89d..c202c43c861a7915cf1f00bda266b872286f9fc5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -62,6 +62,10 @@ NEWS - list of user-visible changes between releases of GNU Libtool
     in some corner cases.
   - Use the improved Microsoft dumpbin support to mend preloading of
     import libraries for Microsoft Visual C/C++.
+  - No longer mangle module-definition (.def) files when feeding them to
+    the Microsoft Visual C/C++ linker via the -export-symbols argument to
+    the libtool script, thus matching how .def files are handled when
+    using GNU tools.
 
 ** Important incompatible changes:
 
index f28436e833ce57ae0d42ccdba4766abc12ef73a3..526fe81b69deb3d604d318f2851a1962f8bb9009 100644 (file)
@@ -5163,7 +5163,8 @@ _LT_EOF
        # FIXME: Setting linknames here is a bad hack.
        _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
        _LT_TAGVAR(archive_expsym_cmds, $1)='if test EXPORTS = "`$SED 1q $export_symbols`"; then
-           $SED -e 1D -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+           cp "$export_symbols" "$output_objdir/$soname.def";
+           echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
          else
            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
          fi~
@@ -6154,7 +6155,8 @@ if test yes != "$_lt_caught_CXX_error"; then
          # FIXME: Setting linknames here is a bad hack.
          _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
          _LT_TAGVAR(archive_expsym_cmds, $1)='if test EXPORTS = "`$SED 1q $export_symbols`"; then
-             $SED -e 1D -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+             cp "$export_symbols" "$output_objdir/$soname.def";
+             echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
            else
              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
            fi~