allow non-pcre build

This commit is contained in:
roberto@goyle
2012-02-06 11:02:57 +01:00
parent f4cb3c67c1
commit d2cbb7eea2
4 changed files with 27 additions and 5 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ async = true
evdis = false
ldap = auto
pcre = auto
routing = true
routing = auto
debug = false
unbit = false
xml_implementation = libxml2
@@ -1,5 +1,7 @@
#include "../../uwsgi.h"
#ifdef UWSGI_ROUTING
extern struct uwsgi_server uwsgi;
int uwsgi_routing_func_redirect(struct wsgi_request *wsgi_req, struct uwsgi_route *ur) {
@@ -46,3 +48,8 @@ struct uwsgi_plugin router_redirect_plugin = {
.name = "router_redirect",
.on_load = router_redirect_register,
};
#else
struct uwsgi_plugin router_redirect_plugin = {
.name = "router_redirect",
};
#endif
+6 -1
View File
@@ -1,4 +1,5 @@
#include "../../uwsgi.h"
#ifdef UWSGI_ROUTING
extern struct uwsgi_server uwsgi;
@@ -114,7 +115,11 @@ void router_uwsgi_register(void) {
}
struct uwsgi_plugin router_uwsgi_plugin = {
.name = "router_uwsgi",
.on_load = router_uwsgi_register,
};
#else
struct uwsgi_plugin router_uwsgi_plugin = {
.name = "router_uwsgi",
};
#endif
+13 -3
View File
@@ -513,9 +513,7 @@ class uConf(object):
if self.get('udp'):
self.cflags.append("-DUWSGI_UDP")
if self.get('routing'):
self.gcc_list.append('routing')
self.cflags.append("-DUWSGI_ROUTING")
has_pcre = False
# re-enable after pcre fix
if self.get('pcre'):
@@ -527,6 +525,7 @@ class uConf(object):
self.cflags.append(pcreconf)
self.gcc_list.append('regexp')
self.cflags.append("-DUWSGI_PCRE")
has_pcre = True
else:
pcreconf = spcall('pcre-config --libs')
@@ -539,6 +538,17 @@ class uConf(object):
self.cflags.append(pcreconf)
self.gcc_list.append('regexp')
self.cflags.append("-DUWSGI_PCRE")
has_pcre = True
if self.get('routing'):
if self.get('pcre') == 'auto':
if has_pcre:
self.gcc_list.append('routing')
self.cflags.append("-DUWSGI_ROUTING")
else:
self.gcc_list.append('routing')
self.cflags.append("-DUWSGI_ROUTING")
if self.has_include('sys/capability.h') and uwsgi_os == 'Linux':
self.cflags.append("-DUWSGI_CAP")