libtool
[Top][All Lists]
Advanced

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

Re: static part of a shared library


From: Dan Nicholson
Subject: Re: static part of a shared library
Date: Fri, 14 Nov 2008 11:24:10 -0800

On Fri, Nov 14, 2008 at 9:40 AM, Matěj Týč <address@hidden> wrote:
> Greetings to all of you,
> I would like to use libtool with a multiplatform library that has some
> complicated structure (ASM routines, some 'main' function hijacking
> etc.) I think that libtool may be the right tool for managing the build
> and the linking afterwards.
> So imagine this situation: You want to compile a (shared) library. And
> you also have very good reasons for requiring that a part of the library
> is build as a static library ONLY and that the rest depends on it.
> So once more:
> 1. I want to build a static library "libfoo_unsharable" out of some
> sources
> 2. And I want to build a (shared) library "libfoo".
> 3. Finally, whenever I link with either static or shared version of
> "libfoo", I want libtool to link with "libfoo_unsharable" automatically.
>
> And the questions are:
> I use automake. What to write there
> 1. What LDFLAGS disable building of shared library from some sources?
> Does the -static flag ensure that shared library won't be build no
> matter what?  :-)
> 2. How to tell to libtool to link with "libfoo_unsharable" every time
> you link with "libfoo"? When I have examined the libfoo.la, there was no
> mention about "libfoo_unsharable" there...

Just create a convenience library from libfoo_unshareable.

lib_LTLIBRARIES = libfoo.la
noinst_LTLIBRARIES = libfoo_unshareable.la
libfoo_la_LIBADD = libfoo_unshareable.la

Unless you want to install the static library, too.

lib_LTLIBRARIES = libfoo.la libfoo_unshareable.la
libfoo_unshareable_la_LDFLAGS = -static
libfoo_la_LIBADD = libfoo_unshareable.la

--
Dan

reply via email to

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