httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mary Poppins" <>
Subject [users@httpd] APU build failure --with-ldap OpenLDAP #error Support for LDAP v2.0 toolkits has been removed
Date Mon, 16 Apr 2007 08:17:47 GMT
Hello, and thanks for Apache!

Apache 2.2.4, Debian 4.0, GCC 4.1.2 20061115 (prerelease) (Debian
4.1.1-21), OpenLDAP 2.3.35, Linux, x86. Can't see my issue in
Bugzilla or the list archives and Googling found nothing useful.

I'm attempting to build Apache from source with mod_ldap and mod_auth_ldap
compiled as DSOs. To do this, among other things one must build APU with
LDAP support. So I am passing --with-ldap to the top-level Apache
configure script. This causes the configure script to correctly find an
install of OpenLDAP in /home/luser/local (I am compiling with --prefix set
to this test area, and will later re-do with --prefix=/usr/local).

Configuration finishes successfully, but the 'make' step fails. The first
failed command executed is:

/bin/sh /tmp/tmp.oKWas21642/httpd-2.2.4/srclib/apr/libtool --silent
--mode=compile gcc -pthread  -I/home/luser/local/include -DHAVE_CONFIG_H
-I/tmp/tmp.oKWas21642/httpd-2.2.4/srclib/apr-util/xml/expat/lib  -o
ldap/apr_ldap_url.lo -c ldap/apr_ldap_url.c && touch ldap/apr_ldap_url.lo

The first (and only relevant) diagnostic, which is printed as a result of
running the above command, is:

In file included from ldap/apr_ldap_url.c:77:
error: #error Support for LDAP v2.0 toolkits has been removed from
apr-util. Please use an LDAP v3.0 toolkit.

This diagnostic is misleading; the problem here is not what is stated, an
attempt to use a 'LDAP v2.0 toolkit', and the solution proposed has
already been followed: OpenLDAP 2.3.35 is indeed a 'LDAP v3.0 toolkit'.
The real problem is unknown to me, but pertains to headers at least in its

apr_ldap.h:103 tests that LDAP_VERSION_MAX <= 2 and #errors if that test
succeeds. The reason that test succeeds is that at this point in the
compile, LDAP_VERSION_MAX is undefined.

I believe this is a minor bug: there should be a separate test for failure
to define LDAP_VERSION_MAX at all. Adding such a test to apr_ldap.h (ie
#ifndef LDAP_VERSION_MAX #error "LDAP includes b0rk" #endif) shows that
this symbol is undefined, rather than defined to some value less than or
equal to 2.

I see only one definition of this symbol on this particular computer, in
OpenLDAP's ldap.h, which contains:
In the OpenLDAP source, LDAP_VERSION3 is unsurprisingly a macro with the
value 3. Neither of these #defines is inside conditionals other than the
usual ones to protect against multiple inclusion. Thus, if we were to have
seen this 'ldap.h' header, apr_ldap.h:103's test would fail, and the
#error would not be encountered, and the build would proceed past this

So I think there are two problems here:

1. Nothing has included the OpenLDAP ldap.h header file, but something
needs to. I don't know why it isn't being included. This is the problem I
would like fixed.

2. apr_ldap.h has one test which catches two different symptoms, and thus
prints the same diagnostic for two different problems; in one case it is
correct and useful but in the other case it's worse than useless - it's
actively misleading. It needs a separate test for undefinedness of the
symbol, with its own specific diagnostic. But this is a less important
secondary problem.

I'm intending to work around this by patching our Apache 2.2.4 source tree
to add #includes of OpenLDAP's ldap.h where necessary. I doubt that this
is the correct general solution, so I don't intend to submit patches. Does
every supported LDAP toolkit ship an 'ldap.h' which defines
'LDAP_VERSION_MAX' acceptably? Is blindly #including some arbitrary
<ldap.h> in fact the correct fix?


Mary Poppins :-)
"A spoonful of sugar makes the medicine go down..."

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message