Subject: Re: lang/perl58 configure fails
To: Anthony Chavez <acc@anthonychavez.org>
From: Johnny C. Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 03/23/2005 20:52:35
--4Ckj6UjgE2iN1+kY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Mar 22, 2005 at 10:17:55PM -0700, Anthony Chavez wrote:
> 
> acc@mybox:...lang/perl58> uname -rs
> OpenBSD 3.6
> acc@mybox:...lang/perl58> grep \$NetBSD: /usr/pkgsrc/mk/bsd.pkg.mk
> #       $NetBSD: bsd.pkg.mk,v 1.1601 2005/03/20 18:18:09 jmmv Exp $
> acc@mybox:...lang/perl58> sudo /usr/pkg/bin/bmake install
> ...
> I used the command:
> 
>         cc -o try -O2 -D_REENTRANT -I/usr/include -pthread -fno-strict-aliasing -pipe -I/usr/pkg/include -pthread -Wl,-E -L/usr/pkg/lib try.c -lgdbm -lm -lutil -lc
>          ./try
> 
> and I got the following output:
> 
> /usr/bin/ld: cannot find -lgdbm
> collect2: ld returned 1 exit status
> I can't compile the test program.
> You have a BIG problem.  Shall I abort Configure [y]
> Ok.  Stopping Configure.

Perl's Configure needs to be restricted from finding libraries that
we don't want it to find.  In this case, it shouldn't be looking for
the GDBM library since pkgsrc perl isn't built with GDBM support
(that's in a separate package -- databases/p5-gdbm).  The usual
buildlink techniques don't work here since the script uses a file
existence test instead of a linker test to see if the library exists.
For each operating system that we support in pkgsrc, there should be
corresponding LIBSWANTED.${OPSYS} and SYSLIBPATH.${OPSYS} definitions
in perl58/Makefile to ensure we only get what we ask for.

For OpenBSD, could you please try the attached patch?  I'm guessing
that from Perl's perspective the *BSDs are all pretty similar.  Please
let me know your results, and if this works, I'll update the OpenBSD
support in the pkgsrc perl packages.

	Thanks,

	-- Johnny Lam <jlam@NetBSD.org>

--4Ckj6UjgE2iN1+kY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="perl58.patch"

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/perl58/Makefile,v
retrieving revision 1.76
diff -u -r1.76 Makefile
--- Makefile	23 Mar 2005 16:52:02 -0000	1.76
+++ Makefile	23 Mar 2005 20:42:55 -0000
@@ -100,6 +100,7 @@
 LIBSWANTED.Interix=	m dl
 LIBSWANTED.IRIX=	m crypt
 LIBSWANTED.NetBSD=	m crypt
+LIBSWANTED.OpenBSD=	m crypt
 LIBSWANTED.SunOS=	m crypt dl socket nsl
 LIBSWANTED=		${LIBSWANTED.${OPSYS}}
 
@@ -111,6 +112,7 @@
 SYSLIBPATH.FreeBSD=	/usr/lib
 SYSLIBPATH.Interix=	/usr/lib
 SYSLIBPATH.NetBSD=	/usr/lib
+SYSLIBPATH.OpenBSD=	/usr/lib
 SYSLIBPATH.SunOS=	/usr/lib
 SYSLIBPATH=		${SYSLIBPATH.${OPSYS}}
 

--4Ckj6UjgE2iN1+kY--