From: Stefan Fritsch Date: Sat, 23 Jul 2011 17:16:54 +0000 (+0000) Subject: Revert r1131393: X-Git-Tag: 2.3.14^2~30^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=533704a7fa7a89d346ff5d1027323abf41fd749f;p=apache Revert r1131393: Several fixes for the ap_ldap build logic. This should fix compilation without --with-ldap. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/revert-ap-ldap@1150165 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/build/find_ldap.m4 b/build/find_ldap.m4 index b23417d18c..a0e6a066a0 100644 --- a/build/find_ldap.m4 +++ b/build/find_ldap.m4 @@ -39,7 +39,6 @@ AC_DEFUN([AP_FIND_LDAPLIB], [ AC_CHECK_LIB(${ldaplib}, ldapssl_init, ap_has_ldapssl_init="1", , ${extralib}) AC_CHECK_LIB(${ldaplib}, ldapssl_install_routines, ap_has_ldapssl_install_routines="1", , ${extralib}) ap_has_ldap="1"; - AC_DEFINE(AP_HAS_LDAP, 1, [Defined if httpd is compiled with ldap support]) ], , ${extralib}) fi ]) diff --git a/configure.in b/configure.in index 4233a9dd97..4fa01c2701 100644 --- a/configure.in +++ b/configure.in @@ -457,9 +457,6 @@ if test "$ac_cv_gettid" = "yes"; then AC_DEFINE(HAVE_GETTID, 1, [Define if you have gettid()]) fi -dnl check for LDAP support, needed by modules/aaa and modules/ldap -AP_FIND_LDAP - dnl ## Check for the tm_gmtoff field in struct tm to get the timezone diffs AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, [AC_TRY_COMPILE([#include diff --git a/include/ap_ldap.h.in b/include/ap_ldap.h.in index 130c6dd016..b847db3da3 100644 --- a/include/ap_ldap.h.in +++ b/include/ap_ldap.h.in @@ -51,6 +51,9 @@ #define LDAP_DECLARE_DATA __declspec(dllimport) #endif +/* this will be defined if LDAP support was compiled into apr-util */ +#define AP_HAS_LDAP @ap_has_ldap@ + /* identify the LDAP toolkit used */ #define AP_HAS_NETSCAPE_LDAPSDK @ap_has_ldap_netscape@ #define AP_HAS_SOLARIS_LDAPSDK @ap_has_ldap_solaris@ diff --git a/include/ap_ldap_init.h b/include/ap_ldap_init.h index 0fe0bcc6c1..ce2ae2c0a6 100644 --- a/include/ap_ldap_init.h +++ b/include/ap_ldap_init.h @@ -26,10 +26,10 @@ * @{ */ -#if AP_HAS_LDAP - #include "ap_ldap.h" +#if AP_HAS_LDAP + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/include/ap_ldap_option.h b/include/ap_ldap_option.h index 6e73e5044f..9c4898a225 100644 --- a/include/ap_ldap_option.h +++ b/include/ap_ldap_option.h @@ -26,10 +26,10 @@ * @{ */ -#if AP_HAS_LDAP - #include "ap_ldap.h" +#if AP_HAS_LDAP + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/include/ap_ldap_rebind.h b/include/ap_ldap_rebind.h index 7bc5a5cda9..5601a861ea 100644 --- a/include/ap_ldap_rebind.h +++ b/include/ap_ldap_rebind.h @@ -25,23 +25,23 @@ * @brief Apache LDAP library */ -#ifndef AP_LDAP_REBIND_H -#define AP_LDAP_REBIND_H +#ifndef APU_LDAP_REBIND_H +#define APU_LDAP_REBIND_H /** * @addtogroup AP_Util_LDAP * @{ **/ +#if defined(DOXYGEN) +#include "ap_ldap.h" +#endif + /* * Handle the case when LDAP is enabled */ #if AP_HAS_LDAP -#if defined(DOXYGEN) -#include "ap_ldap.h" -#endif - /** * LDAP initialize rebind lock * @@ -94,5 +94,5 @@ LDAP_DECLARE(apr_status_t) ap_ldap_rebind_remove(LDAP *ld); /** @} */ -#endif /* AP_LDAP_REBIND_H */ +#endif /* APU_LDAP_REBIND_H */ diff --git a/include/ap_ldap_url.h b/include/ap_ldap_url.h index 996b4b5a9a..d8c4095822 100644 --- a/include/ap_ldap_url.h +++ b/include/ap_ldap_url.h @@ -26,15 +26,15 @@ * @{ */ +#if defined(DOXYGEN) +#include "ap_ldap.h" +#endif + #if AP_HAS_LDAP #include "apu.h" #include "apr_pools.h" -#if defined(DOXYGEN) -#include "ap_ldap.h" -#endif - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/include/util_ldap.h b/include/util_ldap.h index d5e5b3d1cc..5ee3fb6043 100644 --- a/include/util_ldap.h +++ b/include/util_ldap.h @@ -28,6 +28,9 @@ #include "apr_thread_rwlock.h" #include "apr_tables.h" #include "apr_time.h" +#include "ap_ldap.h" +#include "ap_ldap_rebind.h" + #if AP_HAS_MICROSOFT_LDAPSDK #define AP_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN \ ||(s) == LDAP_UNAVAILABLE) @@ -40,6 +43,9 @@ #include "apr_shm.h" #endif +/* this whole thing disappears if LDAP is not enabled */ +#if AP_HAS_LDAP + /* Apache header files */ #include "ap_config.h" #include "httpd.h" @@ -50,12 +56,6 @@ #include "http_request.h" #include "apr_optional.h" -/* this whole thing disappears if LDAP is not enabled */ -#if AP_HAS_LDAP - -#include "ap_ldap.h" -#include "ap_ldap_rebind.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/modules/aaa/config.m4 b/modules/aaa/config.m4 index 38a83cecf0..7688e2a791 100644 --- a/modules/aaa/config.m4 +++ b/modules/aaa/config.m4 @@ -39,11 +39,12 @@ 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. +dnl XXX FIXME APACHE_MODULE(authnz_ldap, LDAP based authentication, , , no, [ - if test "$ap_has_ldap" = "1" ; then + if test -z "$apu_config" ; then APR_ADDTO(MOD_AUTHNZ_LDAP_LDADD, [$LDADD_ldap]) else - enable_authnz_ldap=no + APR_ADDTO(MOD_AUTHNZ_LDAP_LDADD, [$LDADD_ldap]) fi AC_SUBST(MOD_AUTHNZ_LDAP_LDADD) ]) diff --git a/modules/ldap/config.m4 b/modules/ldap/config.m4 index 35921526d8..85e3d84fc7 100644 --- a/modules/ldap/config.m4 +++ b/modules/ldap/config.m4 @@ -14,10 +14,11 @@ ap_ldap_url.lo dnl " APACHE_MODULE(ldap, LDAP caching and connection pooling services, $ldap_objects, , no, [ - if test "$ap_has_ldap" = "1" ; then - APR_ADDTO(MOD_LDAP_LDADD, [$LDADD_ldap]) + AP_FIND_LDAP + if test -z "$apu_config" ; then + APR_ADDTO(MOD_LDAP_LDADD, [$LDADD_ldap]) else - enable_ldap=no + APR_ADDTO(MOD_LDAP_LDADD, [$LDADD_ldap]) fi AC_SUBST(MOD_LDAP_LDADD) ])