Date: Sun, 8 Jan 2012 15:43:34 -0500 From: Maxim Khitrov <max@mxcrypt.com> To: freebsd-ports@freebsd.org Cc: Daniel Gerzo <danger@freebsd.org>, Roberto De Ioris <roberto@unbit.it> Subject: [patch] Problem building www/uwsgi on FreeBSD 9 Message-ID: <CAJcQMWdXABvnQYENGpWEUPm6N7tTFc0rkiYC2jHCZtrMBpX5Jg@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
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 do. - 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 @@ self.gcc_list.append('regexp') self.cflags.append("-DUWSGI_PCRE") - if self.has_include('sys/capability.h'): + if uwsgi_os != 'FreeBSD' and self.has_include('sys/capability.h'): self.cflags.append("-DUWSGI_CAP") self.libs.append('-lcap')
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJcQMWdXABvnQYENGpWEUPm6N7tTFc0rkiYC2jHCZtrMBpX5Jg>