[patch] Problem building www/uwsgi on FreeBSD 9

Maxim Khitrov max at mxcrypt.com
Sun Jan 8 20:44:06 UTC 2012

Hi all,

I'm not sure whether this is a FreeBSD or uwsgi problem, but the
current port (uwsgi 1.0) isn't compiling on FreeBSD 9.0-RELEASE amd64
for the following reasons:

1. In uwsgiconfig.py:534 uwsgi checks for the existence of
sys/capability.h. This header isn't present on my 7.x or 8.x systems,
but it is there in FreeBSD 9.

2. If the check succeeds, UWSGI_CAP is defined for compilation.

3. In uwsgi.h:1169 the presence of UWSGI_CAP causes "cap_value_t
*cap;" to be defined.

4. The FreeBSD version of sys/capability.h does not define cap_value_t
(which seems to be a simple int typedef on Linux).

The net effect of this is a long series of errors when compiling utils.c:

In file included from utils.c:2:
uwsgi.h:1169: error: expected specifier-qualifier-list before 'cap_value_t'
utils.c: In function 'inc_harakiri':
utils.c:93: error: 'struct uwsgi_server' has no member named 'master_process'
utils.c:94: error: 'struct uwsgi_server' has no member named 'workers'
utils.c:94: error: 'struct uwsgi_server' has no member named 'mywid'
utils.c:97: error: 'struct uwsgi_server' has no member named 'shared'
*** uWSGI compiling server core ***
[cc] utils.o
*** Error code 1
1 error
*** Error code 1

Stop in /usr/ports/www/uwsgi.

Should sys/capability.h have a typedef for cap_value_t or should uwsgi
be patched not to define UWSGI_CAP on FreeBSD 9? The patch below fixes
the problem for me by removing UWSGI_CAP definition, but I'm not sure
what capability.h is used for, so maybe this isn't the right thing to

- Max

--- uwsgiconfig.py.orig 2012-01-08 15:17:32.000000000 -0500
+++ uwsgiconfig.py      2012-01-08 15:20:06.000000000 -0500
@@ -531,7 +531,7 @@

-        if self.has_include('sys/capability.h'):
+        if uwsgi_os != 'FreeBSD' and self.has_include('sys/capability.h'):

More information about the freebsd-ports mailing list