AC_INIT(rlm_ldap.c) AC_REVISION($Revision: 1.9 $) AC_DEFUN(modname,[rlm_ldap]) fail= SMART_LIBS= SMART_CLFAGS= if test x$with_[]modname != xno; then AC_PROG_CC AC_CHECK_LIB(resolv, inet_aton) dnl extra argument: --with-rlm-ldap-lib-dir rlm_ldap_lib_dir= AC_ARG_WITH(rlm-ldap-lib-dir, [ --with-rlm-ldap-lib-dir=DIR Directory for LDAP library files []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-ldap-lib-dir) ;; yes) ;; *) rlm_ldap_lib_dir="$withval" ;; esac ] ) dnl extra argument: --with-rlm-ldap-include-dir rlm_ldap_inc_dir= AC_ARG_WITH(rlm-ldap-include-dir, [ --with-rlm-ldap-include-dir=DIR Directory for LDAP include files []], [ case "$withval" in no) AC_MSG_ERROR(Need rlm-ldap-include-dir) ;; yes) ;; *) rlm_ldap_include_dir="$withval" ;; esac ] ) smart_try_dir=$rlm_ldap_include_dir AC_SMART_CHECK_INCLUDE(lber.h) AC_SMART_CHECK_INCLUDE(ldap.h) AC_SMART_CHECK_LIB(sasl, sasl_encode) AC_SMART_CHECK_LIB(crypto, DH_new) AC_SMART_CHECK_LIB(ssl, SSL_new) smart_try_dir=$rlm_ldap_lib_dir AC_SMART_CHECK_LIB(lber, ber_init) if test "x$ac_cv_lib_lber_ber_init" != "xyes"; then fail="$fail liblber" else if test "x$ac_cv_header_pthread_h" = "xyes"; then AC_SMART_CHECK_LIB(ldap_r, ldap_init) if test "x$ac_cv_lib_ldap_r_ldap_init" != "xyes"; then fail="$fail libldap_r" else libldap=ldap_r fi else AC_SMART_CHECK_LIB(ldap, ldap_init) if test "x$ac_cv_lib_ldap_ldap_init" != "xyes"; then fail="$fail libldap" else libldap=ldap fi fi fi if test x"$libldap" != "x"; then AC_SMART_CHECK_LIB("$libldap", ldap_start_tls_s) if test "x${ac_cv_lib_ldap_ldap_start_tls_s}${ac_cv_lib_ldap_r_ldap_start_tls_s}" != "x"; then SMART_CFLAGS="$SMART_CFLAGS -DHAVE_LDAP_START_TLS" fi fi targetname=modname else targetname= echo \*\*\* module modname is disabled. fi if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]) if test x"$headersuggestion" != x; then AC_MSG_WARN([$headersuggestion]) fi if test x"$libsuggestion" != x; then AC_MSG_WARN([$libsuggestion]) fi targetname="" fi fi ldap_ldflags=$SMART_LIBS ldap_cflags=$SMART_CFLAGS AC_SUBST(ldap_ldflags) AC_SUBST(ldap_cflags) AC_SUBST(targetname) AC_OUTPUT(Makefile)