I'm running into weird problems with libtool and building shared libraries
that have inter-library dependencies (this is under Solaris 2.6 with
the unbundled C compiler and native linker).

(If it matters, I am trying to build a the Cyrus SASL library with the
GSSAPI authentication mechanism).

The Cyrus SASL library wants to build "plugins" that are shared libraries
to be loaded at runtime.  Okay, fine, not a problem.  In the case of
the GSSAPI plugin, it depends on other shared libraries to be loaded as
well.  The libtool command line used to build this plugin is (line wrapped
for clarity):

/bin/sh ../libtool --mode=link cc  -g -L/usr/local/lib -R/usr/local/lib \
        -L/usr/krb5/lib -L/usr/krb5/lib -export-dynamic -rpath /usr/lib/sasl \
        -o libgssapiv2.la  -version-info 1:8:0 gssapi.lo -L/usr/krb5/lib \
        -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err -lresolv  -lsocket -lnsl \
        -lresolv -lresolv

Underneath everything else, the linker command line from this libtool command
is:

/usr/ccs/bin/ld -G -h libgssapiv2.so.1 -o .libs/libgssapiv2.so.1.0.8  \
        gssapi.lo  -L/usr/local/lib -L/usr/krb5/lib -lgssapi_krb5 -lkrb5 \
        -lcrypto -lcom_err -lresolv -lsocket -lnsl -lresolv -lresolv -lc

However, this isn't quite correct.  For the pathname of the -lkrb5 library
to be included in the shared library, the -R command line option must
be added to the linker command (-R/usr/krb5/lib).  This obviously isn't
being done.  Adding -R/usr/krb5/lib to the libtool command line has no
effect.  The only thing _to_ do is add -R/usr/krb5/lib to the linker command
line and run it by hand.

I've looked at the libtool documentation and stared at the source code,
and I think I'm missing something obvious here.  There's code in libtool
to do what I want, but it's not being invoked in this case.

Can anyone help me out?  (Please cc me on any responses, since I'm not
on this list).

Thanks in advance,

--Ken

Reply via email to