3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_ldap])
9 if test x$with_[]modname != xno; then
13 AC_CHECK_LIB(resolv, inet_aton)
15 dnl extra argument: --with-rlm-ldap-lib-dir
17 AC_ARG_WITH(rlm-ldap-lib-dir,
18 [ --with-rlm-ldap-lib-dir=DIR Directory for LDAP library files []],
21 AC_MSG_ERROR(Need rlm-ldap-lib-dir)
26 rlm_ldap_lib_dir="$withval"
31 dnl extra argument: --with-rlm-ldap-include-dir
33 AC_ARG_WITH(rlm-ldap-include-dir,
34 [ --with-rlm-ldap-include-dir=DIR Directory for LDAP include files []],
37 AC_MSG_ERROR(Need rlm-ldap-include-dir)
42 rlm_ldap_include_dir="$withval"
47 smart_try_dir=$rlm_ldap_include_dir
48 FR_SMART_CHECK_INCLUDE(lber.h)
49 if test "$ac_cv_header_lber_h" != "yes"; then
52 FR_SMART_CHECK_INCLUDE(ldap.h)
53 if test "$ac_cv_header_ldap_h" != "yes"; then
57 FR_SMART_CHECK_LIB(sasl, sasl_encode)
58 FR_SMART_CHECK_LIB(crypto, DH_new)
59 FR_SMART_CHECK_LIB(ssl, SSL_new)
61 smart_try_dir=$rlm_ldap_lib_dir
62 FR_SMART_CHECK_LIB(lber, ber_init)
63 if test "x$ac_cv_lib_lber_ber_init" != "xyes"; then
66 if test "x$ac_cv_header_pthread_h" = "xyes"; then
67 FR_SMART_CHECK_LIB(ldap_r, ldap_init)
68 if test "x$ac_cv_lib_ldap_r_ldap_init" != "xyes"; then
69 fail="$fail libldap_r"
74 FR_SMART_CHECK_LIB(ldap, ldap_init)
75 if test "x$ac_cv_lib_ldap_ldap_init" != "xyes"; then
83 if test x"$libldap" != "x"; then
84 FR_SMART_CHECK_LIB("$libldap", ldap_start_tls_s)
86 if test "x${ac_cv_lib_ldap_ldap_start_tls_s}${ac_cv_lib_ldap_r_ldap_start_tls_s}" != "x"; then
87 SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_START_TLS"
90 FR_SMART_CHECK_LIB("$libldap", ldap_initialize)
92 if test "x${ac_cv_lib_ldap_ldap_initialize}${ac_cv_lib_ldap_r_ldap_initialize}" != "x"; then
93 SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_INITIALIZE"
96 FR_SMART_CHECK_LIB("$libldap", ldap_int_tls_config)
98 if test "x${ac_cv_lib_ldap_ldap_int_tls_config}${ac_cv_lib_ldap_r_ldap_int_tls_config}" != "x"; then
99 SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_INT_TLS_CONFIG"
107 echo \*\*\* module modname is disabled.
110 if test x"$fail" != x""; then
111 if test x"${enable_strict_dependencies}" = x"yes"; then
112 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
114 AC_MSG_WARN([silently not building ]modname[.])
115 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.])
116 if test x"$headersuggestion" != x; then
117 AC_MSG_WARN([$headersuggestion])
119 if test x"$libsuggestion" != x; then
120 AC_MSG_WARN([$libsuggestion])
126 ldap_ldflags=$SMART_LIBS
127 ldap_cflags=$SMART_CFLAGS
128 AC_SUBST(ldap_ldflags)
129 AC_SUBST(ldap_cflags)