]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Enable ldap modules in 'all' and 'most' selections if ldap is compiled into
authorStefan Fritsch <sf@apache.org>
Fri, 5 Aug 2011 08:01:31 +0000 (08:01 +0000)
committerStefan Fritsch <sf@apache.org>
Fri, 5 Aug 2011 08:01:31 +0000 (08:01 +0000)
apr-util

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1154114 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
acinclude.m4
modules/aaa/config.m4
modules/ldap/config.m4

diff --git a/CHANGES b/CHANGES
index 5eb292c712aa8d14f5a71cd397d855cbc9c12e7a..367f03b16dcf765518080b408da1d46674503b33 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.3.15
 
+  *) configure: Enable ldap modules in 'all' and 'most' selections if ldap
+     is compiled into apr-util. [Stefan Fritsch]
+
   *) core: Add ap_check_cmd_context()-check if a command is executed in
      .htaccess file. [Stefan Fritsch]
 
index 19cd90d1c30316ba8877dc0b3c85116d01491713..9519ee1408371303d5a3ceaf88128fe7a15bfbd6 100644 (file)
@@ -740,3 +740,24 @@ if test "$ap_cv_void_ptr_lt_long" = "yes"; then
     AC_MSG_ERROR([Size of "void *" is less than size of "long"])
 fi
 ])
+
+dnl
+dnl APACHE_CHECK_APR_HAS_LDAP
+dnl
+dnl Check if APR_HAS_LDAP is 1
+dnl Unfortunately, we can't use APR_CHECK_APR_DEFINE (because it only includes apr.h)
+dnl or APR_CHECK_DEFINE (because it only checks for defined'ness and not for 0/1).
+dnl
+AC_DEFUN([APACHE_CHECK_APR_HAS_LDAP], [
+  AC_CACHE_CHECK([for ldap support in apr/apr-util],ac_cv_APR_HAS_LDAP,[
+    apache_old_cppflags="$CPPFLAGS"
+    CPPFLAGS="$CPPFLAGS $INCLUDES"
+    AC_EGREP_CPP(YES_IS_DEFINED, [
+#include <apr_ldap.h>
+#if APR_HAS_LDAP
+YES_IS_DEFINED
+#endif
+    ], ac_cv_APR_HAS_LDAP=yes, ac_cv_APR_HAS_LDAP=no)
+    CPPFLAGS="$apache_old_cppflags"
+  ])
+])
index 10958e2382ecf55942bba64abc7c85e48d7ca2bd..aa324ccb0d5fd3244341df6c155d9bb916f4d285 100644 (file)
@@ -39,14 +39,20 @@ APACHE_MODULE(authz_core, core authorization provider vector module, , , yes)
 
 dnl LDAP authentication module. This module has both the authn and authz
 dnl modules in one, so as to share the LDAP server config directives.
-APACHE_MODULE(authnz_ldap, LDAP based authentication, , , no, [
-  if test -z "$apu_config" ; then
+APACHE_MODULE(authnz_ldap, LDAP based authentication, , , most, [
+  APACHE_CHECK_APR_HAS_LDAP
+  if test "$ac_cv_APR_HAS_LDAP" = "yes" ; then
+    if test -z "$apu_config" ; then
       LDAP_LIBS="`$apr_config --ldap-libs`"
-  else
+    else
       LDAP_LIBS="`$apu_config --ldap-libs`"
+    fi
+    APR_ADDTO(MOD_AUTHNZ_LDAP_LDADD, [$LDAP_LIBS])
+    AC_SUBST(MOD_AUTHNZ_LDAP_LDADD)
+  else
+    AC_MSG_WARN([apr/apr-util is compiled without ldap support])
+    enable_authnz_ldap=no
   fi
-  APR_ADDTO(MOD_AUTHNZ_LDAP_LDADD, [$LDAP_LIBS])
-  AC_SUBST(MOD_AUTHNZ_LDAP_LDADD)
 ])
 
 dnl - host access control compatibility modules. Implements Order, Allow,
index 2c915b5e8f04118534eb65f55426fac439c92822..3345bcd953548480db60814739040cc0763fc52c 100644 (file)
@@ -4,14 +4,20 @@ dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
 APACHE_MODPATH_INIT(ldap)
 
 ldap_objects="util_ldap.lo util_ldap_cache.lo util_ldap_cache_mgr.lo"
-APACHE_MODULE(ldap, LDAP caching and connection pooling services, $ldap_objects, , no, [
-  if test -z "$apu_config" ; then
+APACHE_MODULE(ldap, LDAP caching and connection pooling services, $ldap_objects, , most , [
+  APACHE_CHECK_APR_HAS_LDAP
+  if test "$ac_cv_APR_HAS_LDAP" = "yes" ; then
+    if test -z "$apu_config" ; then
       LDAP_LIBS="`$apr_config --ldap-libs`"
-  else
+    else
       LDAP_LIBS="`$apu_config --ldap-libs`"
+    fi
+    APR_ADDTO(MOD_LDAP_LDADD, [$LDAP_LIBS])
+    AC_SUBST(MOD_LDAP_LDADD)
+  else
+    AC_MSG_WARN([apr/apr-util is compiled without ldap support])
+    enable_ldap=no
   fi
-  APR_ADDTO(MOD_LDAP_LDADD, [$LDAP_LIBS])
-  AC_SUBST(MOD_LDAP_LDADD)
 ])
 
 APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])