NetBSD Problem Report #39377

From www@NetBSD.org  Tue Aug 19 03:20:53 2008
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 728C963B877
	for <gnats-bugs@gnats.netbsd.org>; Tue, 19 Aug 2008 03:20:53 +0000 (UTC)
Message-Id: <20080819032052.BF5E263B853@narn.NetBSD.org>
Date: Tue, 19 Aug 2008 03:20:52 +0000 (UTC)
From: dave@dtsp.co.nz
Reply-To: dave@dtsp.co.nz
To: gnats-bugs@NetBSD.org
Subject: python24 extensions fail to configure on Ubuntu Linux
X-Send-Pr-Version: www-1.0

>Number:         39377
>Category:       pkg
>Synopsis:       python24 extensions fail to configure on Ubuntu Linux
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    recht
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 19 03:25:00 +0000 2008
>Closed-Date:    Fri Jan 23 10:00:31 +0000 2009
>Last-Modified:  Fri Jan 23 10:00:31 +0000 2009
>Originator:     David Sainty
>Release:        
>Organization:
>Environment:
Linux 2.6.24-19-generic #1 SMP Fri Jul 11 23:41:49 UTC 2008 i686 GNU/Linux

>Description:
This is really a lang/python24 problem, but I see it from py-Orbit, as part of installing meta-pkgs/gnome.  net/py-ORBit fails to configure with:

checking for headers required to compile python extensions... found
checking for python libraries... not found
configure: error: could not find Python headers
*** Error code 1


From config.log:

configure:20120: gcc -pthread -o conftest -O2 -I/usr/pkgroot1/include -I/usr/pkgroot1/include/python2.4 -I/usr/include -I/usr/pkgroot1/include -I/usr/pkgroot1/include/python2.4 -I/usr/include -I/usr/pkgroot1/include/python2.4 -L/usr/pkgroot1/lib -Wl,-R/usr/pkgroot1/lib -L/usr/pkgroot1/lib/python2.4/config -Wl,-R/usr/pkgroot1/lib/python2.4/config -L/usr/lib -Wl,-R/usr/lib conftest.c  -L/usr/pkgroot1/lib -lm -lpthread -ldl -ldb4 -lutil -lpython2.4  -pthread -lpthread -lrt >&5
/usr/bin/ld: cannot find -ldb4
collect2: ld returned 1 exit status
configure:20126: $? = 1

>How-To-Repeat:
Build net/py-ORBit (or probably any other Python strap-on) where the Python libraries link with libdb4.so that isn't natively available.
>Fix:
This patch is a workaround, but it isn't correct.  The correct fix needs to determine whether Python used bdb.buildlink3.mk at build time before doing something like this.

OR, maybe the -ldb4 shouldn't be here:

fgrep -- -ldb4 /usr/pkg/lib/python2.4/config/Makefile 
LIBS=           -lpthread -ldl -ldb4 -lutil

That seems to be what is causing the link time error in py-Orbit, but it isn't really necessary:

ldd /usr/pkg/lib/libpython2.4.so|fgrep db4
        libdb4-4.6.so.6 => /usr/pkgroot1/lib/libdb4-4.6.so.6 (0xb7d4c000)


--- pkgsrc/lang/python24/buildlink3.mk    2006-07-09 19:02:27.000000000 +1200
+++ pkgsrc/lang/python24/buildlink3.mk    2008-08-18 17:07:05.000000000 +1200
@@ -28,6 +28,7 @@

 BUILDLINK_DEPTH:=              ${BUILDLINK_DEPTH:S/+$//}

+.include "../../mk/bdb.buildlink3.mk"
 .include "../../mk/dlopen.buildlink3.mk"
 .include "../../mk/pthread.buildlink3.mk"
 .include "../../devel/gettext-lib/buildlink3.mk"


>Release-Note:

>Audit-Trail:
From: David Holland <dholland-pbugs@netbsd.org>
To: dave@dtsp.co.nz, gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/39377: python24 extensions fail to configure on Ubuntu
	Linux
Date: Tue, 19 Aug 2008 04:14:11 +0000

 On Tue, Aug 19, 2008 at 03:25:01AM +0000, dave@dtsp.co.nz wrote:
  > fgrep -- -ldb4 /usr/pkg/lib/python2.4/config/Makefile 
  > LIBS=           -lpthread -ldl -ldb4 -lutil

 If you build python against the db185 that's in NetBSD's libc (and the
 libc of every 4.4-derived system) that -ldb4 won't be there:

    % grep -- '^LIBS=' /usr/pkg/lib/python2.4/config/Makefile
    LIBS=           -lpthread  -lutil

 However, if on such a system you do build python against db4, and it's
 not there, the linker will likely find the db185 functions in libc,
 and that is extremely likely to make a mess. So it needs to be there
 in at least some cases. (And depending on exactly what this is used to
 link against, it might be needed on Linux too; one of the charming
 properties of ELF shared libs is that failing to link with needed libs
 when building one is nonfatal and silently results in an output file
 with shared lib dependencies missing, which can cause assorted subtle
 problems later on.)

 In light of these things I think your following patch is the right
 approach.

  > --- pkgsrc/lang/python24/buildlink3.mk    2006-07-09 19:02:27.000000000 +1200
  > +++ pkgsrc/lang/python24/buildlink3.mk    2008-08-18 17:07:05.000000000 +1200
  > @@ -28,6 +28,7 @@
  > 
  >  BUILDLINK_DEPTH:=              ${BUILDLINK_DEPTH:S/+$//}
  > 
  > +.include "../../mk/bdb.buildlink3.mk"
  >  .include "../../mk/dlopen.buildlink3.mk"
  >  .include "../../mk/pthread.buildlink3.mk"
  >  .include "../../devel/gettext-lib/buildlink3.mk"
  > 
  > 

 -- 
 David A. Holland
 dholland@netbsd.org

Responsible-Changed-From-To: pkg-manager->recht
Responsible-Changed-By: obache@NetBSD.org
Responsible-Changed-When: Tue, 19 Aug 2008 05:02:02 +0000
Responsible-Changed-Why:
Over to maintainer.
python21, 23 and 25 may need same fix.
I don't know why but IRIX is not linked with bdb.


From: David Sainty <dsainty@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39377 CVS commit: pkgsrc/lang
Date: Fri, 23 Jan 2009 03:05:53 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	dsainty
 Date:		Fri Jan 23 03:05:53 UTC 2009

 Modified Files:
 	pkgsrc/lang/python21: buildlink3.mk
 	pkgsrc/lang/python23: buildlink3.mk
 	pkgsrc/lang/python24: buildlink3.mk
 	pkgsrc/lang/python25: buildlink3.mk

 Log Message:
 Any package that determines libraries to link via:

   $PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('SHLIBS');"

 ... where bdb.buildlink.mk has been used and it satisfied the requirement from
 Pkgsrc (E.g. via databases/db4) would fail to build because the required -ldb4
 library was not itself buildlinked.

 To rectify this, pull in bdb.buildlink.mk in python??/buildlink3.mk under the
 same conditions as it is pulled in in the package's own makefile.

 No revision bump required, this almost certainly only affects packages and
 environments that simply wouldn't build at all prior to the fix.

 Fixes the build of py-ORBit on Linux (Python 2.4 or 2.5), and PR39377.


 To generate a diff of this commit:
 cvs rdiff -r1.9 -r1.10 pkgsrc/lang/python21/buildlink3.mk
 cvs rdiff -r1.13 -r1.14 pkgsrc/lang/python23/buildlink3.mk
 cvs rdiff -r1.7 -r1.8 pkgsrc/lang/python24/buildlink3.mk
 cvs rdiff -r1.1.1.1 -r1.2 pkgsrc/lang/python25/buildlink3.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dsainty@NetBSD.org
State-Changed-When: Fri, 23 Jan 2009 10:00:31 +0000
State-Changed-Why:
Fixed my own PR, tested on original machine.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.