[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)


at the moment, the pam_mount project uses the following hack to 
workaround a libtool warning message:

        # (abridged)
        bin_PROGRAMS         = mount.crypt
        mount_crypt_SOURCES  = nlt-loop.c ...
        lib_LTLIBRARYES      =
        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/ 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      =
        pam_mount_la_LIBADD    =

This has further implications, the following of which I can think of. will be backed by a, 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, 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?

reply via email to

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