From owner-freebsd-ports@FreeBSD.ORG Sun Jan 8 20:44:06 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D36E106566B for ; Sun, 8 Jan 2012 20:44:06 +0000 (UTC) (envelope-from max@mxcrypt.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 21E608FC0A for ; Sun, 8 Jan 2012 20:44:05 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so3698453vbb.13 for ; Sun, 08 Jan 2012 12:44:05 -0800 (PST) Received: by 10.52.66.168 with SMTP id g8mr6278089vdt.71.1326055445240; Sun, 08 Jan 2012 12:44:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.150.132 with HTTP; Sun, 8 Jan 2012 12:43:34 -0800 (PST) From: Maxim Khitrov Date: Sun, 8 Jan 2012 15:43:34 -0500 Message-ID: To: freebsd-ports@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: Daniel Gerzo , Roberto De Ioris Subject: [patch] Problem building www/uwsgi on FreeBSD 9 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 20:44:06 -0000 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')