aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-06-11 21:50:13 +0000
committerDavid Shaw <[email protected]>2002-06-11 21:50:13 +0000
commit03d78479ff993efb061c64202ffd62bb933768dd (patch)
tree27b8341c931a2ac352c69cf595da6aca880c032f
parent* Makefile.am: link gpg with NETLIBS for the built-in HKP access. (diff)
downloadgnupg-03d78479ff993efb061c64202ffd62bb933768dd.tar.gz
gnupg-03d78479ff993efb061c64202ffd62bb933768dd.zip
* 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.
-rw-r--r--ChangeLog8
-rw-r--r--configure.ac76
2 files changed, 52 insertions, 32 deletions
diff --git a/ChangeLog b/ChangeLog
index c5b643231..9599d4d51 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2002-06-11 David Shaw <[email protected]>
+
+ * 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 <[email protected]>
* configure.ac: Add a switch for the experimental external HKP
diff --git a/configure.ac b/configure.ac
index 371b5d609..c206af453 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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"
-
- 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])])
-
- 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
+ for LDAPLIBS in "-lldap -llber -lresolv" "-lldapssl41"; do
+ _ldap_save_libs=$LIBS
+ LIBS="$LDAPLIBS $NETLIBS $LIBS"
+
+ 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_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,[[