[Top][All Lists]

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

Re: assistance

From: NightStrike
Subject: Re: assistance
Date: Sun, 21 Oct 2007 13:07:37 -0400

On 10/21/07, Ralf Wildenhues <address@hidden> wrote:
> * NightStrike wrote on Fri, Oct 19, 2007 at 09:25:08PM CEST:
> >
> > crt_SCRIPTS = libcrtdll.a libmsvcrt.a libmsvcr80.a
> > libcrtdll.a libmsvcrt.a libmsvcr80.a:
> >         base=`echo $@ | sed -e 's/\.a//' -e 's/^lib//'`; \
> >         $(DLLTOOL) $(DLLOPTS) --dllname $${base}.dll --def
> > $(top_srcdir)/$${base}.def
> >
> > To generate those three libraries, I do nothing other than run
> > dlltool, passing in the appropriate .def file.
> Let's deal with one library only.  For the moment, leave Automake out of
> the picture, this is a mere issue of how to write 'make' rules.

> Am I right in that the input files to dlltool in this case are
> foo.dll and foo.def, and the output is the import library libfoo.a?

Sort of.  foo.dll is not an actual file.

> Then write
>   libfoo.a: foo.dll foo.def
>         rule...
> for each library.  If you can require GNU make (which I guess you can),
> then you can write one pattern rule
>   lib%.a: %.dll %.def
>         rule...

I sort of did that for the very very long list of .a libs appended to
crt_DATA.  I wrote this further down in the makefile:

        $(DLLTOOL) $(DLLOPTS) --def $(top_srcdir)/lib/$*.def

But I didn't know how to adapt that for the extra command to dlltool,
which is '--dllname=foo.dll'

So what I did was the following (committed it as revision 151, too, so
you can see it in the svn repository) :
--- (revision 151)
+++ (working copy)
@@ -36,9 +36,13 @@ dllcrt1.o:
        $(COMPILE) -c $(top_srcdir)/crtdll.c -o $@ -D__MSVCRT__ -U__CRTDLL__

-libcrtdll.a libmsvcrt.a libmsvcr80.a:
-       base=`echo $@ | sed -e 's/\.a//' -e 's/^lib//'`; \
-       $(DLLTOOL) $(DLLOPTS) --dllname $${base}.dll --def
+#libcrtdll.a libmsvcrt.a libmsvcr80.a:
+#      base=`echo $@ | sed -e 's/\.a//' -e 's/^lib//'`; \
+#      $(DLLTOOL) $(DLLOPTS) --dllname $${base}.dll --def
+lib%.a: %.def
+       $(DLLTOOL) $(DLLOPTS) --dllname $*.dll --def=$(top_srcdir)/$*.def
 #      $(DLLTOOL) --as=$(AS) -k --dllname crtdll.dll --output-lib $@
--def $(top_srcdir)/crtdll.def

Now, however, I have two rules called lib%.a that do different things.
 Somehow, make is getting it right, but I have no idea why.

> > Do you know how to achieve the above effect with using the _LIBRARIES
> > primary instead of overriding the use of _SCRIPTS?
> Well, I could tell you that Libtool can create DLLs plus import
> libraries (it names them libfoo.dll.a), but I don't think you want
> to hear that at this point.  ;-)

I'd love to hear about it.  If libtool can do this better, then I'll
use it.  I must confess, though, that I couldn't figure it out.  It
seemed to require as output libs instead of foo.a.

reply via email to

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