libtool
[Top][All Lists]
Advanced

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

Problems with libtool libraries when converting Visual Studio 2003 VC7.1


From: laszlo . szakony
Subject: Problems with libtool libraries when converting Visual Studio 2003 VC7.1 project files to gnu autotool files (makefile.am, configure.ac)
Date: Thu, 20 Jan 2005 11:16:13 +0100


Hi,

I try to write a conversion utility that converts VC7.1 solution/project files
 to corresponding (configure.ac and makefile.am) sets, and I have some problems,
that future releases of libtool may solve.
The philosophy of Microsoft is different from GNU (now: regarding handling of libraries).
Here is an incomplete comparison list:

+--------------+---------------+---------------+---------------------------+
| Input        |      Output   | Microsoft lib |  GNU libtool lib          |
+--------------+---------------+---------------+---------------------------+
| obj files    |  static lib   | *.lib         | *.la, *.a, (no)inst       |
+--------------+---------------+---------------+---------------------------+
| obj files    |  shared lib   | *.lib, *.dll  | *.la, *.yyy,  (no)inst,   |
|              |               | search path   | it should be installed    |
+--------------+---------------+---------------+---------------------------+
| static libs  |  static lib   | *.lib         | -all-static:Inputs must be|
|              |               |               | uninstalled               |
+--------------+---------------+---------------+---------------------------+
| static libs  |  shared lib   | *.lib, *.dll  | -L,-l works only for      |
|              |               | search path   | installed inputs          |
+--------------+---------------+---------------+---------------------------+

The main problem is, that building a static lib from static libs
I need the uninstalled inputs, and building a shared lib
with -L and -l I need the installed ones.

Problem1: Let two input static libs: st1.la and st2.la and output static lib st3.la = st1.la+st2.la.
If I define the '-all-static flag', st1.la and st2.la must be uninstalled.
If I omit the '-all-static' flag, the shared lib for st3.la will be built as well.
The static counterpart however will include the static st1.la and st2.la.
The build behavior for the static lib is depends on the '-all-static' flag,
though in my opinion it simply should not build the shared lib.

Problem2: -L and -l are working only for installed libs.
(this is not a problem, if '-all-static' includes installed libs in problem1).
 Microsoft uses flags like -L and -l.

Suggestion: '-all-static' should not influence the way of building the static lib
and the target static lib should include all installed input static libs. Or just have the option to do it.

Question: As VC7.1 project files includes options like -L and -l,
I made a workaround to build an installed and an uninstalled lib (only for static libs) with a suffix '_noi'.
The makefile.am looks like:

libdir = ${MY_TARGET_DIR}/libs
lib_LTLIBRARIES = libst0.la
EXTRA_LTLIBRARIES = libst0_noi.la

libst0_la_SOURCES = func_st0.cpp func_st01.cpp
libst0_la_LDFLAGS = -all-static
libst0_la_DEPENDENCIES = libst0_noi.la

libst0_noi_la_SOURCES = $(libst0_la_SOURCES)
libst0_noi_la_LDFLAGS = $(libst0_la_LDFLAGS)

install-exec-local:
        mkdir -p $(libdir)/.libs && \
        cp libst0_noi.la $(libdir) && \
        cp .libs/libst0_noi.a $(libdir)/.libs

Is this OK, or is a better solution to build (and access) both installed and uninstalled libs?

*****

László
___________________________________________________
László   Szakony
Philips Austria GmbH
Philips Speech Recognition Systems
Triester Str. 64, A-1101 Vienna  
Tel.+43 1 601 01 2102         Fax +43 1 601 01 4145
E-mail: address@hidden
___________________________________________________

reply via email to

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