Subject: Re: broken libldap.so (from openldap) under Solaris/zoularis
To: None <tech-pkg@netbsd.org>
From: Pierre Bourgin <pierre.bourgin@pcotech.fr>
List: tech-pkg
Date: 09/19/2002 14:42:51
Hello again,

Some points I noticed since my previous mail:

1. the binaries provided by the openldap package (ldapsearch for instance)
   are (well) linked against libresolv.so.2 (I missed that point before)
   and against the libldap.so (from the same openldap package)

2. the libldap.so lib. is not linked against libresolv.so.2 , so each
   binary that is using this librairy must be linked againt libresolv.so
   (under Solaris 7 as far as I know)

3. I don't know how to build libldap.so against libresolv.so.2 :( (my
   knowledge of the compiling/linking systems stops before this point
   ....), and I don't know if this situation is "normal" or not.

4. as a kludge, in order to compile ap-auth-ldap, and because of 2., I
   modified the www/ap-auth-ldap/Makefile as show below:

----------------------------------------------------------------------------
 --- Makefile.orig       Thu Sep 19 13:09:29 2002
+++ Makefile    Thu Sep 19 13:25:30 2002
@@ -12,11 +12,19 @@

 DEPENDS+=      ${BUILDLINK_DEPENDS.apache}:../../www/apache

+.include "../../mk/bsd.prefs.mk"
+
+LIBS=          -lldap -llber
+
+.if ${OPSYS} == "SunOS"
+LIBS+=         -lresolv
+.endif
+
 do-build:
        @cd ${WRKSRC} && ${APXS} -c                                     \
            -D WITH_OPENLDAP                                            \
            -I ${BUILDLINK_DIR}/include                                 \
-           -L ${BUILDLINK_DIR}/lib -Wl,-R${LOCALBASE}/lib -lldap -llber \
+           -L ${BUILDLINK_DIR}/lib -Wl,-R${LOCALBASE}/lib ${LIBS}      \
            auth_ldap.c auth_ldap_cache.c auth_ldap_cache_mgr.c         \
            auth_ldap_config.c
----------------------------------------------------------------------------

If someone can explain to me 2. (and if it's right or wrong), It would be
really nice !

Pierre Bourgin