Subject: CFR: Guile dl_open(3)'ing libpthread.so fix
To: None <jlam@netbsd.org>
From: Masao Uebayashi <uebayasi@pultek.co.jp>
List: tech-pkg
Date: 05/24/2003 17:09:00
Hello.

Guile (and any other programs, possibly) dies when libpthread.so is
dynamically loaded.

(According to Martin, this is a known behaviour; our native thread
doesn't support dl_open(3)'ing libpthread.so.  So we need to link
Guile against libpthread.so.)

This is the patch I've made.  Working here.  Could you (hopefully,
Johnny ;) review this?

Masao

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/guile14/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- Makefile	2003/01/24 12:36:26	1.6
+++ Makefile	2003/05/24 07:59:02
@@ -2,7 +2,7 @@
 
 DISTNAME=		guile-1.4.1
 PKGNAME=		guile14-1.4.1
-PKGREVISION=		2
+PKGREVISION=		3
 CATEGORIES=		lang
 MASTER_SITES=		${MASTER_SITE_GNU:=guile/}
 
@@ -23,6 +23,13 @@
 USE_GNU_READLINE=	YES
 
 INFO_FILES=		guile.info
+
+# Link the native thread so that Guile processes won't die when libpthread.so
+# is dl_open(3)'ed.
+.include "../../mk/pthread.buildlink2.mk"
+.if defined(PTHREAD_TYPE) && (${PTHREAD_TYPE} == "native")
+CFLAGS+=		-pthread
+.endif
 
 .include "../../devel/libtool/buildlink2.mk"
 .include "../../devel/ncurses/buildlink2.mk"