From: Stefan Fritsch Date: Fri, 5 Aug 2011 08:01:31 +0000 (+0000) Subject: Enable ldap modules in 'all' and 'most' selections if ldap is compiled into X-Git-Tag: 2.3.15~416 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d0c55080a315b2edf482d5519c25621c430d7f5;p=thirdparty%2Fapache%2Fhttpd.git Enable ldap modules in 'all' and 'most' selections if ldap is compiled into apr-util git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1154114 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 5eb292c712a..367f03b16dc 100644 --- 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] diff --git a/acinclude.m4 b/acinclude.m4 index 19cd90d1c30..9519ee14083 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 +#if APR_HAS_LDAP +YES_IS_DEFINED +#endif + ], ac_cv_APR_HAS_LDAP=yes, ac_cv_APR_HAS_LDAP=no) + CPPFLAGS="$apache_old_cppflags" + ]) +]) diff --git a/modules/aaa/config.m4 b/modules/aaa/config.m4 index 10958e2382e..aa324ccb0d5 100644 --- a/modules/aaa/config.m4 +++ b/modules/aaa/config.m4 @@ -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, diff --git a/modules/ldap/config.m4 b/modules/ldap/config.m4 index 2c915b5e8f0..3345bcd9535 100644 --- a/modules/ldap/config.m4 +++ b/modules/ldap/config.m4 @@ -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])