libtool
[Top][All Lists]
Advanced

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

Building static-only or shared-only libraries on a per target basis


From: Ralph Schleicher
Subject: Building static-only or shared-only libraries on a per target basis
Date: 03 Aug 2003 23:26:01 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Hi,

over the last months, there were multiple discussions on the libtool
mailing list about the need for building static-only or shared-only
libraries on a per target basis.  Up to now, libtool has a -static
flag for compile and link mode but its meaning is not consistent.
In compile mode, -static forces building of an .o file but also
builds a .lo file if the host system supports shared libraries, and
libtool was configured with --enable-shared.  In link mode, on the
other hand, -static forces building a static library but does not
build a shared library even if building a shared library is supported
or configured.  Adding the -static flag for compile mode is IMHO only
meaningful when using -static for link mode, too.  Therefore -static
must not build a .lo file in compile mode.

While the -static flag allows a package maintainer to explicitly build
a static-only library, libtool has no option for building a shared-only
library.  Below is a patch against libtool CVS from 2003-07-31 together
with a ChangeLog entry.  It adds a -shared flag to libtool and changes
the behavior of -static in compile mode as described above.  I've also
attached a tiny demo project for testing.

2003-08-03  Ralph Schleicher  <address@hidden>

        * doc/libtool.texi (Link mode): Document new -shared option.
        (Compile mode): Document new -shared option, and be more specific
        about the effect of the -static option.
        * ltmain.in: Implement it.

Attachment: libtool-20030731.diff
Description: Text Data

Attachment: libtool-demo.shar
Description: Binary data

Best regards,

-- 
Ralph

reply via email to

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