msysgit/mingw/doc/reimp
..
README

README

README for reimp
================

* Overview 

`reimp' is a tool to convert Microsoft's new-style (short) import
libraries to import libraries for win32 ports of GNU tools (mingw32,
cygwin).

`reimp' reads an MS import library and writes all imports to the
corresponding .DEF file(s) that it feeds to `dlltool' that creates the
import library.


* Invocation

Usage: reimp [options] IMPLIB

Options:
  -s, --dump-symbols      dump symbols to stdout
  -d, --only-def          only create .def files
  -c, --keep-case         keep case in lib*.a file names
  --dlltool <name>        use <name> for dlltool
  --as <name>             use <name> for assembler

The `--dump-symbols' option makes `reimp' use a quick method for
finding imported symbols and sending the names of found symbols to
stdout. If the input library contain non-imported symbols they will be
listed as well. The output symbols will have all decoration preserved
(i.e '_' will prefix most symbols), so if you feed it to dlltool you
should strip leading underscores. For example

        echo EXPORTS > imp.def
        reimp imp.lib | sed 's/_//' >> imp.def
        dlltool -k --def imp.def --output-lib libimp.a --dllname imp.dll

The `--only-def' option makes `reimp' stop after generating the .DEF
file(s).

By default `reimp' converts all output library names to lower-case. By
using the `keep-case' option `reimp' will use exactly the case of the
DLL imported from when creating an import library. KERNEL32.dll will
generate libKERNEL32.a and not libkernel32.a as it would be default.


* Notes on mixed libraries

If an input library contain regular objects (non-imports, i.e code and
data) `reimp' will write out those objects unless you specify one of
the `--only-def' and `--dump-symbols' options. You probably want to
include those objects as well in the generated library. `reimp'
doesn't do that automatically so you have to do it manually using
`ar', like this

        reimp imp.lib          # this generates several .o or .obj files.
        ar rcs libimp.a *.obj  # add them to library


* Contact information

URL: http://www.acc.umu.se/~anorland/gnu-win32/
Anders Norlander <anorland@hem2.passagen.se>