[AC_DEFINE(HAVE_EVENTFD, 1, [Have eventfd extension.])])])
AM_CONDITIONAL(WITH_EVENTFD, [ test "$with_eventfd" = "yes" ])
+# disable OpenLDAP support
+AC_ARG_WITH([openldap],
+ [AS_HELP_STRING([--without-openldap], [Disable OpenLDAP support (RGW)])])
+if test "x$with_openldap" != "xno"; then
+ AC_CHECK_HEADER([ldap.h], [],
+ AC_MSG_ERROR([ldap.h not found (openldap-dev, openldap-devel)]))
+ AC_CHECK_LIB([ldap], [ldap_initialize], [true],
+ AC_MSG_FAILURE([libldap not found]))
+ AC_DEFINE([HAVE_OPENLDAP], [1], [Defined if OpenLDAP enabled])
+ have_openldap="yes"
+fi
+AM_CONDITIONAL(WITH_OPENLDAP, [ test "$have_openldap" = "yes" ])
+
# Checks for typedefs, structures, and compiler characteristics.
#AC_HEADER_STDBOOL
#AC_C_CONST
rgw/rgw_http_client.cc \
rgw/rgw_json_enc.cc \
rgw/rgw_keystone.cc \
- rgw/rgw_ldap.cc \
rgw/rgw_loadgen.cc \
rgw/rgw_log.cc \
rgw/rgw_metadata.cc \
rgw/rgw_xml_enc.cc \
rgw/rgw_website.cc
+if WITH_OPENLDAP
+librgw_la_SOURCES += rgw/rgw_ldap.cc
+endif
+
librgw_la_CXXFLAGS = -Woverloaded-virtual -fPIC -I$(srcdir)/xxHash \
${AM_CXXFLAGS}
# noinst_LTLIBRARIES += librgw.la
namespace rgw {
+#if defined(HAVE_OPENLDAP)
+
class LDAPHelper
{
std::string uri;
ldap_unbind(ldap);
}
- };
+ }; /* LDAPHelper */
+
+#else
+
+ class LDAPHelper
+ {
+ public:
+ LDAPHelper(std::string _uri, std::string _binddn, std::string _searchdn,
+ std::string _dnattr)
+ {}
+
+ int init() {
+ return -ENOTSUP;
+ }
+
+ int bind() {
+ return -ENOTSUP;
+ }
+
+ int auth(const std::string uid, const std::string pwd) {
+ return -EACCES;
+ }
+
+ ~LDAPHelper() {}
+
+ }; /* LDAPHelper */
+
+
+#endif /* HAVE_OPENLDAP */
} /* namespace rgw */