Skip to content

Commit 41ccdea

Browse files
author
Stefan Fritsch
committed
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
1 parent e241486 commit 41ccdea

4 files changed

Lines changed: 46 additions & 10 deletions

File tree

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Changes with Apache 2.3.15
44

5+
*) configure: Enable ldap modules in 'all' and 'most' selections if ldap
6+
is compiled into apr-util. [Stefan Fritsch]
7+
58
*) core: Add ap_check_cmd_context()-check if a command is executed in
69
.htaccess file. [Stefan Fritsch]
710

acinclude.m4

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,3 +740,24 @@ if test "$ap_cv_void_ptr_lt_long" = "yes"; then
740740
AC_MSG_ERROR([Size of "void *" is less than size of "long"])
741741
fi
742742
])
743+
744+
dnl
745+
dnl APACHE_CHECK_APR_HAS_LDAP
746+
dnl
747+
dnl Check if APR_HAS_LDAP is 1
748+
dnl Unfortunately, we can't use APR_CHECK_APR_DEFINE (because it only includes apr.h)
749+
dnl or APR_CHECK_DEFINE (because it only checks for defined'ness and not for 0/1).
750+
dnl
751+
AC_DEFUN([APACHE_CHECK_APR_HAS_LDAP], [
752+
AC_CACHE_CHECK([for ldap support in apr/apr-util],ac_cv_APR_HAS_LDAP,[
753+
apache_old_cppflags="$CPPFLAGS"
754+
CPPFLAGS="$CPPFLAGS $INCLUDES"
755+
AC_EGREP_CPP(YES_IS_DEFINED, [
756+
#include <apr_ldap.h>
757+
#if APR_HAS_LDAP
758+
YES_IS_DEFINED
759+
#endif
760+
], ac_cv_APR_HAS_LDAP=yes, ac_cv_APR_HAS_LDAP=no)
761+
CPPFLAGS="$apache_old_cppflags"
762+
])
763+
])

modules/aaa/config.m4

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,20 @@ APACHE_MODULE(authz_core, core authorization provider vector module, , , yes)
3939

4040
dnl LDAP authentication module. This module has both the authn and authz
4141
dnl modules in one, so as to share the LDAP server config directives.
42-
APACHE_MODULE(authnz_ldap, LDAP based authentication, , , no, [
43-
if test -z "$apu_config" ; then
42+
APACHE_MODULE(authnz_ldap, LDAP based authentication, , , most, [
43+
APACHE_CHECK_APR_HAS_LDAP
44+
if test "$ac_cv_APR_HAS_LDAP" = "yes" ; then
45+
if test -z "$apu_config" ; then
4446
LDAP_LIBS="`$apr_config --ldap-libs`"
45-
else
47+
else
4648
LDAP_LIBS="`$apu_config --ldap-libs`"
49+
fi
50+
APR_ADDTO(MOD_AUTHNZ_LDAP_LDADD, [$LDAP_LIBS])
51+
AC_SUBST(MOD_AUTHNZ_LDAP_LDADD)
52+
else
53+
AC_MSG_WARN([apr/apr-util is compiled without ldap support])
54+
enable_authnz_ldap=no
4755
fi
48-
APR_ADDTO(MOD_AUTHNZ_LDAP_LDADD, [$LDAP_LIBS])
49-
AC_SUBST(MOD_AUTHNZ_LDAP_LDADD)
5056
])
5157

5258
dnl - host access control compatibility modules. Implements Order, Allow,

modules/ldap/config.m4

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@ dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
44
APACHE_MODPATH_INIT(ldap)
55

66
ldap_objects="util_ldap.lo util_ldap_cache.lo util_ldap_cache_mgr.lo"
7-
APACHE_MODULE(ldap, LDAP caching and connection pooling services, $ldap_objects, , no, [
8-
if test -z "$apu_config" ; then
7+
APACHE_MODULE(ldap, LDAP caching and connection pooling services, $ldap_objects, , most , [
8+
APACHE_CHECK_APR_HAS_LDAP
9+
if test "$ac_cv_APR_HAS_LDAP" = "yes" ; then
10+
if test -z "$apu_config" ; then
911
LDAP_LIBS="`$apr_config --ldap-libs`"
10-
else
12+
else
1113
LDAP_LIBS="`$apu_config --ldap-libs`"
14+
fi
15+
APR_ADDTO(MOD_LDAP_LDADD, [$LDAP_LIBS])
16+
AC_SUBST(MOD_LDAP_LDADD)
17+
else
18+
AC_MSG_WARN([apr/apr-util is compiled without ldap support])
19+
enable_ldap=no
1220
fi
13-
APR_ADDTO(MOD_LDAP_LDADD, [$LDAP_LIBS])
14-
AC_SUBST(MOD_LDAP_LDADD)
1521
])
1622

1723
APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])

0 commit comments

Comments
 (0)