NetBSD Problem Report #46459

From www@NetBSD.org  Thu May 17 17:10:42 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 14DA763B89C
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 17 May 2012 17:10:42 +0000 (UTC)
Message-Id: <20120517171041.36B3863B882@www.NetBSD.org>
Date: Thu, 17 May 2012 17:10:41 +0000 (UTC)
From: roger.pau@citrix.com
Reply-To: roger.pau@citrix.com
To: gnats-bugs@NetBSD.org
Subject: lang/python27: don't pass OPT to Python configure
X-Send-Pr-Version: www-1.0

>Number:         46459
>Category:       pkg
>Synopsis:       lang/python27: don't pass OPT to Python configure
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 17 17:15:00 +0000 2012
>Originator:     Roger Pau Monne
>Release:        amd64 6.0BETA
>Organization:
Citrix
>Environment:
NetBSD build 6.0_BETA NetBSD 6.0_BETA (GENERIC) amd64
>Description:
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.
>How-To-Repeat:
Try to build an extension that has a custom version of a header already present in /usr/include or /usr/pkg/include.
>Fix:
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
--- a/lang/python27/Makefile
+++ b/lang/python27/Makefile
@@ -17,7 +17,6 @@ CONFLICTS+=   python-[0-9]*
 GNU_CONFIGURE=         yes
 CONFIGURE_ARGS+=       --with-threads
 CONFIGURE_ARGS+=       --enable-shared
-CONFIGURE_ARGS+=       OPT=${CFLAGS:Q}
 CONFIGURE_ARGS+=       --with-system-ffi
 CONFIGURE_ARGS+=       --with-dbmliborder=ndbm:bdb

NetBSD Home
NetBSD PR Database Search

(Contact us) $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.