[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: libtool/automake: how to build and use an internal library.
From: |
Andreas Jellinghaus |
Subject: |
Re: libtool/automake: how to build and use an internal library. |
Date: |
07 May 2003 15:19:54 +0200 |
Hi,
> You want so-called 'convenience library', see the docs for details.
>
> Built by:
> foo/Makefile.am
> noinst_LTLIBRARIES=libfoo.la
> libfoo_la_SOURCES=foo.c
> Makefile.am
> SUBDIRS=foo
> lib_LTLIBRARIES=libbar.la
> libbar_la_LIBADD=foo/libfoo.la
> libbar_la_SOURCES=
> libbar_la_LDFLAGS=-release $(VERSION)
> ./.libs/libbar.so will be the final library with './foo/foo.c'.
sorry, that does not work correctly.
libbar.so is linked using bar.lo and libfoo.la which contains foo.lo.
so all files are created with -fPIC -DPIC, the so file is fine.
but libbar.a is created from bar.o (compiled without pic) and
.libs/libfoo.al/foo.lo (compiled with -fPIC -DPIC).
I tested this on linux/x86 where it might not be an issue, but other
plattforms do not like mixing pic and nonpic code AFAIK.
debian unstable with automake 1.7.4-1 and libtool 1.4.3-7.
log file excerpt (I can put the whole file somewhere if needed,
the actual source is current opensc cvs code):
ar cru .libs/opensc-pkcs11.a pkcs11-global.o pkcs11-session.o pkcs11-object.o m
isc.o slot.o mechanism.o openssl.o secretkey.o framework-pkcs15.o framework-pkcs
15init.o debug.o .libs/opensc-pkcs11.lax/libscrandom.al/scrandom.lo
.o and .lo mix as you can see.
Is there a way to avoid this? how?
Regards, Andreas