[Top][All Lists]

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


From: Brian Dessent
Subject: Re: AM_LIBS / AM_LDADD
Date: Tue, 06 Nov 2007 11:06:22 -0800

NightStrike wrote:

> Regarding libtool, maybe I just don't understand how libtool works.  I
> can't figure out how to use libtool to generate lib*.a.  It seems
> intent on restricting outputs to only lib*.la.  I eventually gave up
> and started manually invoking dlltool myself to build the lib*.a from
> the *.def files.  Originally, I tried supplying the *.def files to the
> lib_LIBRARIES primary, but I couldn't ever figure out how to get the
> .def file recognized as a valid source file (even using SUFFIXES =
> .def and .def.a: $(DLLTOOL) etc ).  So basically, what it comes down
> to is that I think maybe my project is too limited to blend with
> automake as simply as I initially envisioned, and my knowledge of
> automake is too limited to make it do what I want without asking you
> tons of questions (which you have been extremely kind in answering, I
> might add... though it may not seem like it, I am learning a lot from
> you, so thank you for that).

You're getting yourself all confused because you're trying to compare
apples and oranges.  Creating an import library from a .def file is
nothing at all like creating a library from source code.  An import
library is not even a real library, in that it doesn't contain any
code.  It's just a listing of function and variable names that some DLL
exports.  Normally an import library is created as a side effect of
actually linking the DLL; you get it for free just by adding
"-Wl,-out-implib,libfoo.dll.a" to the link command that creates the
DLL.  dlltool normally never enters the picture at all.

But that's not your situation -- you have some existing library (like
MSVCRT.DLL, MSVCR70.DLL, MSVCR80.DLL, etc.) that is provided by MS, and
all you're doing is creating an import lib for it based on a list of
exports in a .def file.  Don't confuse an import library with a static
library, even though they are both 'ar' archives and often have the same
naming form, especially in the mingw-runtime and w32api where import
libraries are named like libmsvcrt.a or libkernel32.a (instead of the
more modern libfoo.dll.a to differentiate them as not being real
libraries.)  The lib*.a that libtool would create (i.e. a static archive
containing compiled objects) is a totally different thing than an import
library, though they might have similar looking names.  Of course
libtool can also create import libraries, but they are named .dll.a and
they are created as side effects of linking the .dll.  And again,
libtool is of no use when you aren't actually building the library.


reply via email to

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