[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Building a static library consisting of libraries
From: |
Norbert Sendetzky |
Subject: |
Re: Building a static library consisting of libraries |
Date: |
Tue, 13 Jun 2006 10:32:47 +0200 |
User-agent: |
KMail/1.9.1 |
On Tuesday 13 June 2006 09:03, Ralf Wildenhues wrote:
> > My Makefile.am in lib:
> >
> > include_HEADERS = odbx.h
> >
> > lib_LTLIBRARIES = libopendbx.la
> > libopendbx_la_SOURCES = odbxlib.c odbxlib.h odbx.c odbxdrv.h
> > libopendbx_la_CFLAGS = @PKGCFLAGS@
> > libopendbx_la_CPPFLAGS = -DLIBPATH=\"$(pkglibdir)/\"
> > libopendbx_la_LDFLAGS = -version-info @LIBVERSION@
> >
> > lib_LIBRARIES = libopendbx.a
> > libopendbx_a_SOURCES = odbxlib.c odbxlib.h odbx.c odbxdrv.h
> > libopendbx_a_CFLAGS = @PKGCFLAGS@
> > libopendbx_a_CPPFLAGS = -DODBX_STATIC
> > libopendbx_a_LDFLAGS = -static
> > libopendbx_a_LIBADD = $(top_builddir)/backends/mysql/libmysqlstatic.la
>
> OK now?
Almost :-)
In the backends I already created static convenience libraries, so the last
question is how do I create a static libopendbx(.a) file automatically using
the static convenience libraries of the backends and a static libopendbx
(convenience) library?
I could easily write:
lib_LTLIBRARIES = libopendbx.la liboendbx-static.la
libopendbx_static_la_SOURCES = odbxlib.c odbxlib.h odbx.c odbxdrv.h
libopendbx_static_la_CFLAGS = @PKGCFLAGS@
libopendbx_static_a_CPPFLAGS = -DODBX_STATIC
libopendbx_static_a_LDFLAGS = -static
libopendbx_static_a_LIBADD = $(top_builddir)/backends/mysql/libmysqlstatic.la
But that would create two separate libraries (libopendbx and
libopendbx-static) instead of building libopendbx (only with that name) in a
shared and static version.
That was the main point I never found in the docs.
Norbert
--
OpenPGP public key
http://www.linuxnetworks.de/norbert.pubkey.asc
pgpROV5OCHcxZ.pgp
Description: PGP signature