cvs commit: ports/Mk bsd.ruby.mk ports/lang Makefile ports UPDATING ports/lang/ruby18 Makefile pkg-plist ports/lang/ruby18_r Makefile ports/lang/ruby16 Makefile pkg-plist ports/lang/ruby16_r Makefile ports/devel/ruby-gnustep Makefile ...

Michael Nottebrock michaelnottebrock at gmx.net
Sat Feb 5 08:29:08 PST 2005


On Saturday, 5. February 2005 07:31, Jeremy Messenger wrote:
> >   Good news is that the pthread support of lang/ruby18 is now enabled by
> >   default for newer systems, which means the ruby interpreter is linked
> >   with libpthread.  This will allow threaded extension libraries to run
> >   and work properly on those systems.
>
> Thanks! But there is a very simple problem is that it uses '-lpthread',
> which it should be '-pthread' (${PTHREAD_LIBS}).

Ruby's configure check to determine the pthread library/flags to use reliably 
ends up doing the wrong thing on every version of FreeBSD (except obsolete 
5-CURRENT).

Please consider this patch, it circumvents ruby's pthread-stuff in configure 
(it essentially does the same thing however, just with the correct libraries 
& flags). This additionally makes thread support available on every version 
of FreeBSD that has threads, including 5.2.1-Release and 4.x.

-- 
   ,_,   | Michael Nottebrock               | lofi at freebsd.org
 (/^ ^\) | FreeBSD - The Power to Serve     | http://www.freebsd.org
   \u/   | K Desktop Environment on FreeBSD | http://freebsd.kde.org
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/ruby18/Makefile,v
retrieving revision 1.83
diff -u -r1.83 Makefile
--- Makefile	5 Feb 2005 04:59:24 -0000	1.83
+++ Makefile	5 Feb 2005 16:25:21 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	ruby
 PORTVERSION=	${RUBY_PORTVERSION}
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	lang ruby ipv6
 MASTER_SITES=		${MASTER_SITE_RUBY}
 MASTER_SITE_SUBDIR=	${MASTER_SITE_SUBDIR_RUBY}
@@ -58,12 +58,10 @@
 LATEST_LINK=	ruby-devel
 
 .include <bsd.port.pre.mk>
-.if ${OSVERSION} >= 502102
 RUBY_ENABLE_PTHREAD?=	public demand
-.endif
 
 .if defined(RUBY_ENABLE_PTHREAD) && ${RUBY_ENABLE_PTHREAD} != "no"
-CONFIGURE_ARGS+=	--enable-pthread
+CONFIGURE_ENV+= CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" LDFLAGS="${LDFLAGS} ${PTHREAD_LIBS}"
 
 # There seems to be a bug in either gcc or libpthread that gets
 # (mini)ruby to malfunction..
@@ -150,6 +148,9 @@
 .endif
 	${TOUCH} ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
 
+post-configure:
+	${ECHO_CMD} -e "#define _REENTRANT 1\n#define _THREAD_SAFE 1\n#define HAVE_LIBPTHREAD 1" >> ${WRKSRC}/config.h
+
 post-install:
 .if defined(STRIP) && ${STRIP} == -s
 	${STRIP_CMD} ${RUBY}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-ports/attachments/20050205/a35ee99b/attachment.bin


More information about the cvs-ports mailing list