X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=configure.in;h=4642dcd8630b3114d1a5c1753199465a71aecbed;hb=355e54993a9ee4882605eb5187a66a32073bb7ab;hp=c1446af3470c5700d0c466982ebe19bc4ec7e718;hpb=e7d7f659739435dc2ed5af83f6eb4f269e3192f7;p=chise%2Fxemacs-chise.git.1 diff --git a/configure.in b/configure.in index c1446af..4642dcd 100644 --- a/configure.in +++ b/configure.in @@ -3219,6 +3219,7 @@ if test no != "$with_ldap";then echo "Setting ldap_libs to $ldap_libs"],dnl [AC_CHECK_LIB(ldap, ldap_open,dnl [with_ldap=yes],dnl +dnl If logic of setting these vars change, change it the same way below. [ldap_needs_lber=yes ldap_other_libs=-llber dnl This requires `AC_CACHE_VAL' (which is called by `AC_CHECK_LIB') dnl to be redefined to ignore cached (shell variable) value, as it is @@ -3240,6 +3241,55 @@ dnl variable name depends on the macro OTHER-LIBRARIES argument. $ldap_other_libs)],dnl $ldap_other_libs)],dnl $ldap_other_libs)]) + if test yes = "$with_ldap" -a yes != "$ldap_needs_lber";then +dnl Need this check since `LDAP_OPT_ON' is (currently) used only with +dnl `ldap_set_option', and the latter may not exist at all, for which +dnl is testing later. So `LDAP_OPT_ON' is not necessarily defined. + AC_CACHE_CHECK([for LDAP_OPT_ON definition],xe_cv_have_LDAP_OPT_ON, + [AC_TRY_COMPILE( +[#include +#include +#ifdef LDAP_OPT_ON +/* Relying on const defined by ac_c_const (upper case). */ +const void *const v = LDAP_OPT_ON; +#else /* !defined (LDAP_OPT_ON) */ +choke me +#endif /* !defined (LDAP_OPT_ON) */],[], + [xe_cv_have_LDAP_OPT_ON=yes], + [xe_cv_have_LDAP_OPT_ON=no])]) + if test yes = "$xe_cv_have_LDAP_OPT_ON";then + AC_CACHE_CHECK([LDAP_OPT_ON linking], + xe_cv_LDAP_OPT_ON_links, + [xe_save_LIBS="$LIBS" + LIBS="-lldap $LIBS" +AC_TRY_LINK( +[#include +#include +const void *const v = LDAP_OPT_ON;],[], + xe_cv_LDAP_OPT_ON_links=yes, + xe_cv_LDAP_OPT_ON_links=no) + LIBS="$xe_save_LIBS"]) +dnl In some openldap installations other `ldap_*' functions link with +dnl `-lldap' alone, but `LDAP_OPT_ON' requires `-llber'. + if test yes != "$xe_cv_LDAP_OPT_ON_links";then + ldap_needs_lber=yes ldap_other_libs=-llber + AC_CACHE_CHECK([LDAP_OPT_ON linking with -llber], + xe_cv_LDAP_OPT_ON_links_w_lber, + [xe_save_LIBS="$LIBS" + LIBS="-lldap $ldap_other_libs $LIBS" +AC_TRY_LINK( +[#include +#include +const void *const v = LDAP_OPT_ON;],[], + xe_cv_LDAP_OPT_ON_links_w_lber=yes, + xe_cv_LDAP_OPT_ON_links_w_lber=no) + LIBS="$xe_save_LIBS"]) + if test yes != "$xe_cv_LDAP_OPT_ON_links_w_lber";then + with_ldap=no + fi + fi + fi + fi if test yes = "$with_ldap";then if test yes = "$ldap_needs_des";then XE_PREPEND(-ldes, ldap_libs)