Let a project use libtool to make libraries.

In case of mingw build (cross-compilation) in many cases is good dll to be 
without lib prefix.
In these cases cross-compilation can create dlls with same names as native 
build and those dlls can be used instead native build.
The name of import library can left libNAME.dll.a.

When building shared libraries on unix usually Makefile.am contain lib_LTLIBRARIES = 
lib<NAME>.la and result is lib<NAME>.so...
It is similar to case for pcre.la (topic "dll names on windows") but with 
lib-prefix for la-file.


How to do this?


Notes:

- libtool macro AC_LIBTOOL_SYS_DYNAMIC_LINKER don't preserve "libname_spec" set by CONFIG_SITE so 
that I cannot use "libname_spec="\$name"" in CONFIG_SITE file;

- same for "soname_spec";

- LDFLAGS -module is only to inform automake that we use "nonstandard" name, 
i.e without lib prefix.
This is not my case since for other systems lib prefix is fine.
Also note that with argument "-module" file is installed in libdir (!) and 
without in bindir;

- to use def-file with content "LIBRARY NAME.dll" and to pass to linker by 
example with -export-symbols.
In this case import library "libNAME.dll.a" is created for "NAME.dll" but dll-name is 
"libNAME.dll".
We can rename dll (to remove lib prefix) and in file "libNAME.la" to remove 
lib-prefix in dlname.
In this case libtool will install "NAME.dll", i.e. without lib prefix, but 
create in libdir la-file with dlname='../bin/libNAME.dll' so that we should edit again.


More info:
Command:
$i386-mingw32msvc-gcc -shared  ... -o .libs/<NAME>.dll ... -Xlinker --out-implib -Xlinker 
.libs/lib<NAME>.dll.a"
create dll without lib prefix and put <NAME>.dll in import library.


Roumen



_______________________________________________
http://lists.gnu.org/mailman/listinfo/libtool

Reply via email to