auto configure ldap support

This commit is contained in:
roberto@sirius
2011-03-10 10:40:56 +01:00
parent 35987d3741
commit 94f4be58bd
3 changed files with 11 additions and 21 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ sendfile = true
minterpreters = true
async = true
evdis = false
ldap = false
ldap = auto
pcre = auto
debug = false
unbit = false
+1 -17
View File
@@ -194,8 +194,6 @@ void uwsgi_ldap_config() {
int desired_version = LDAP_VERSION3;
int ret;
struct option *aopt, *lopt;
LDAPURLDesc *ldap_url;
if (uwsgi.ldap) {
@@ -281,21 +279,7 @@ void uwsgi_ldap_config() {
memcpy(uwsgi_val, bervalues[0]->bv_val, bervalues[0]->bv_len);
uwsgi_val[bervalues[0]->bv_len] = 0;
lopt = uwsgi.long_options;
while ((aopt = lopt)) {
if (!aopt->name)
break;
if (!strcmp(uwsgi_attr, aopt->name)) {
if (aopt->flag) {
*aopt->flag = aopt->val;
add_exported_option(0, (char*) uwsgi_attr);
}
else {
manage_opt(aopt->val, uwsgi_val);
}
}
lopt++;
}
add_exported_option((char*) uwsgi_attr, uwsgi_val, 0);
}
free(bervalues);
+9 -3
View File
@@ -377,9 +377,15 @@ class uConf(object):
self.gcc_list.append('yaml')
if self.get('ldap'):
self.cflags.append("-DUWSGI_LDAP")
self.gcc_list.append('ldap')
self.libs.append('-lldap')
if self.get('ldap') == 'auto':
if os.path.exists('/usr/include/ldap.h'):
self.cflags.append("-DUWSGI_LDAP")
self.gcc_list.append('ldap')
self.libs.append('-lldap')
else:
self.cflags.append("-DUWSGI_LDAP")
self.gcc_list.append('ldap')
self.libs.append('-lldap')
if self.get('evdis'):
self.cflags.append("-DUWSGI_EVDIS")