[Top][All Lists]

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

Re: MinGW DLLs and autoconf parsing

From: Roumen Petrov
Subject: Re: MinGW DLLs and autoconf parsing
Date: Sun, 13 Jul 2008 23:00:06 +0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20080329 SeaMonkey/1.1.9

Jason Curl wrote:

Recently some info was posted about using resource files with Windows 
compilers. I'm trying to generate a reasonably simple Version resource and 
there's some information I'm not sure how I can extract from the build process. 
I'm using libtool-1.5.27a on MSYS-1.0.10 with MinGW-5.1.4.

Question 1:
One of the fields is "OriginalFilename". When the shared DLL is built, it is installed 
"libfoo-1.dll". I've created a "" file that autoconf generates for me, 
substituting information from the build process directly into this resource file.

However, how might I get the name of the library before it is built?

You may create library with name "libfoo.dll" if you call make with
Also you may set this flag in configure script for mingw host.
libtool don't preserve LIBRARY statement specified by def-file.

The string "-1" is suffix appended by libtool for cygwin/mingw host. The
number is equal to  "$current - $age" from version info.

Question 2:
The second task is the versioning. There are two fields, both of the format:
FILEVERSION major,minor,revision,build

I need to substitute them based on the version information given to libtool 
during the linking phase.

How can I convert the string "1:0:0" to a major.minor.revision field? How does 
this work?

awk, sed , shell ?
- born shell sample:
IFS=:; set -- `echo a:b:c`; echo $1.$2.$3

Question 3:
As the libtool --tag=RC doesn't work for 1.5.27a (it complained about an 
unknown tag), I wrote the rule:

I guess that configure script is without macro AC_LIBTOOL_RC

        $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=CC --mode=compile 
$(RC) $(RCFLAGS) $< -o $@

where RC=windres and RCFLAGS is empty. It works, but is it safe? I don't know 
when MinGW will upgrade the autotools.

May be you need two rules : one to create %.lo file and one for object
file (%.o):
LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)

        $(LTRCCOMPILE) -i "$<" -o "$@"

        $(RCCOMPILE) -i "$<" -o "$@"

Thanks & Best Regards,


reply via email to

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