[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Building static library with PIC
From: |
Jan Engelhardt |
Subject: |
Building static library with PIC |
Date: |
Tue, 9 Dec 2008 00:10:51 +0100 (CET) |
User-agent: |
Alpine 1.10 (LNX 962 2008-03-14) |
Hi,
at the moment, the pam_mount project uses the following hack to
workaround a libtool warning message:
# Makefile.am (abridged)
bin_PROGRAMS = mount.crypt
mount_crypt_SOURCES = nlt-loop.c ...
lib_LTLIBRARYES = pam_mount.la
pam_mount_la_SOURCES = loop.c ...
pam_mount_la_LDFLAGS = -module -avoid-version
/* nlt-loop.c */
#include "loop.c"
Warning message that is avoided by doing so:
src/Makefile.am: object `loop.$(OBJEXT)' created both with
libtool and without
Because it is a bit tiring of updating two _SOURCES lists, I thought
about putting all the files in a temporary .la, for example:
libinternal_la_SOURCES = loop.c
mount_crypt_LDADD = libinternal.la
pam_mount_la_LIBADD = libinternal.la
This has further implications, the following of which I can think of.
libinternal.la will be backed by a libinternal.so, which gets
dynamically linked into mount.crypt. This however is an unwanted
effect. `configure --disable-shared` is “not working out” because
pam_mount is supposed to be delivered in a .so file and I cannot just
turn shared library generation off. This probably leaves me with
mount_crypt_LDFLAGS = -static
Also, libinternal.so will have -fPIC code, which is not needed for
mount.crypt (non-PIC would do).
I'm out of options. What hidden solution does automake/libtool
offer me in this case?
- Building static library with PIC,
Jan Engelhardt <=