1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-06 23:17:47 +02:00

* configure.ac: Move -lsocket and -lnsl checks before LDAP link tests so

they work properly on Solaris.  Noted by David Champion.

Also, check for the Mozilla LDAP library if the OpenLDAP library check
fails.  Put -lsocket and -lnsl in NETLIBS rather than LIBS so not all
programs are forced to link to them.
This commit is contained in:
David Shaw 2002-06-11 21:50:13 +00:00
parent ceab809f1e
commit 03d78479ff
2 changed files with 50 additions and 30 deletions

View File

@ -1,3 +1,11 @@
2002-06-11 David Shaw <dshaw@jabberwocky.com>
* configure.ac: Move -lsocket and -lnsl checks before LDAP link
tests so they work properly on Solaris. Noted by David Champion.
Also, check for the Mozilla LDAP library if the OpenLDAP library
check fails. Put -lsocket and -lnsl in NETLIBS rather than LIBS
so not all programs are forced to link to them.
2002-06-05 David Shaw <dshaw@jabberwocky.com>
* configure.ac: Add a switch for the experimental external HKP

View File

@ -295,41 +295,55 @@ if test "$NO_PIC" = yes; then
try_dynload=no
fi
# Try and link a LDAP test program to weed out unusable LDAP libraries
dnl Must check for network library requirements before doing link tests
dnl for ldap, for example. If ldap libs are static (or dynamic and without
dnl ELF runtime link paths), then link will fail and LDAP support won't
dnl be detected.
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
[NETLIBS="-lnsl $NETLIBS"]))
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
[NETLIBS="-lsocket $NETLIBS"]))
# Try and link a LDAP test program to weed out unusable LDAP
# libraries. -lldap -llber -lresolv is for OpenLDAP. -lldapssl41 is
# for Mozilla LDAP.
if test "$try_ldap" = yes ; then
_ldap_save_libs=$LIBS
LIBS="-lldap -llber -lresolv $LIBS"
for LDAPLIBS in "-lldap -llber -lresolv" "-lldapssl41"; do
_ldap_save_libs=$LIBS
LIBS="$LDAPLIBS $NETLIBS $LIBS"
AC_CACHE_CHECK([whether LDAP is sane],
[gnupg_cv_func_ldap_init],
[AC_TRY_LINK([#include <ldap.h>],
[ldap_open("foobar",1234);],
[gnupg_cv_func_ldap_init=yes],
[gnupg_cv_func_ldap_init=no])])
AC_MSG_CHECKING([whether LDAP via \"$LDAPLIBS\" is present and sane])
AC_TRY_LINK([#include <ldap.h>],[ldap_open("foobar",1234);],
[gnupg_cv_func_ldap_init=yes],[gnupg_cv_func_ldap_init=no])
AC_MSG_RESULT([$gnupg_cv_func_ldap_init])
if test $gnupg_cv_func_ldap_init = no; then
AC_CACHE_CHECK([whether I can make LDAP be sane with lber.h],
[gnupg_cv_func_ldaplber_init],
[AC_TRY_LINK([#include <lber.h>
#include <ldap.h>],
[ldap_open("foobar",1234);],
[gnupg_cv_func_ldaplber_init=yes],
[gnupg_cv_func_ldaplber_init=no])])
fi
if test $gnupg_cv_func_ldap_init = no; then
AC_MSG_CHECKING([whether I can make LDAP be sane with lber.h])
AC_TRY_LINK([#include <lber.h>
#include <ldap.h>],[ldap_open("foobar",1234);],
[gnupg_cv_func_ldaplber_init=yes],[gnupg_cv_func_ldaplber_init=no])
AC_MSG_RESULT([$gnupg_cv_func_ldaplber_init])
fi
if test "$gnupg_cv_func_ldaplber_init" = yes ; then
AC_DEFINE(NEED_LBER_H,1,[Define if the LDAP library requires including lber.h before ldap.h])
fi
if test "$gnupg_cv_func_ldaplber_init" = yes ; then
AC_DEFINE(NEED_LBER_H,1,[Define if the LDAP library requires including lber.h before ldap.h])
fi
if test "$gnupg_cv_func_ldap_init" = yes || \
test "$gnupg_cv_func_ldaplber_init" = yes ; then
GPGKEYS_LDAP="gpgkeys_ldap"
fi
if test "$gnupg_cv_func_ldap_init" = yes || \
test "$gnupg_cv_func_ldaplber_init" = yes ; then
GPGKEYS_LDAP="gpgkeys_ldap"
fi
LIBS=$_ldap_save_libs
LIBS=$_ldap_save_libs
if test "$GPGKEYS_LDAP" != "" ; then break; fi
done
fi
AC_SUBST(GPGKEYS_LDAP)
AC_SUBST(LDAPLIBS)
if test "$try_mailto" = yes ; then
AC_PATH_PROG(SENDMAIL,sendmail,,$PATH:/usr/sbin:/usr/libexec:/usr/lib)
@ -446,10 +460,6 @@ AC_SUBST(BUILD_INCLUDED_LIBINTL)
fi
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname))
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
if test "$try_dynload" = yes ; then
AC_CHECK_LIB(dl,dlopen)
if test "$ac_cv_lib_dl_dlopen" = "yes"; then
@ -889,6 +899,8 @@ if test "$GCC" = yes; then
fi
fi
AC_SUBST(NETLIBS)
# Note the \\\\ for backslashes. Autoconf eats one layer, leaving \\
AC_CONFIG_COMMANDS(g10defs.h,[[