NetBSD Problem Report #46459
From www@NetBSD.org Thu May 17 17:10:42 2012
Received: from mail.netbsd.org (mail.netbsd.org [188.8.131.52])
by www.NetBSD.org (Postfix) with ESMTP id 14DA763B89C
for <gnats-bugs@gnats.NetBSD.org>; Thu, 17 May 2012 17:10:42 +0000 (UTC)
Date: Thu, 17 May 2012 17:10:41 +0000 (UTC)
Subject: lang/python27: don't pass OPT to Python configure
>Synopsis: lang/python27: don't pass OPT to Python configure
>Arrival-Date: Thu May 17 17:15:00 +0000 2012
>Originator: Roger Pau Monne
>Release: amd64 6.0BETA
NetBSD build 6.0_BETA NetBSD 6.0_BETA (GENERIC) amd64
pkgsrc is passing "OPT" to Python27 configure script, which is saved in /usr/pkg/lib/python2.7/config/Makefile after the package compilation finishes.
This file is then parsed by distutils when building extensions (see /usr/pkg/lib/python2.7/sysconfig.py:283). The main problem with this variables is that it gets appended to gcc CFLAGS before the ones that the user sets manually. Since OPT contained -I/usr/include and -I/usr/pkg/include, if the user wanted to use custom headers already present in /usr/include or /usr/pkg/include instead of the system ones it would get a compilation error, because system headers were always read before user supplied ones.
Try to build an extension that has a custom version of a header already present in /usr/include or /usr/pkg/include.
The following patch removes this option. I've checked that the package compiles fine (under NetBSD 6.0BETA), and extensions also build ok when this is removed.
diff --git a/lang/python27/Makefile b/lang/python27/Makefile
index d5e7116..5e0bdc6 100644
@@ -17,7 +17,6 @@ CONFLICTS+= python-[0-9]*
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.