From jdc@koitsu.org  Wed Mar 12 05:27:50 2014
Return-Path: <jdc@koitsu.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id ECC96956
	for <freebsd-gnats-submit@freebsd.org>; Wed, 12 Mar 2014 05:27:50 +0000 (UTC)
Received: from qmta07.emeryville.ca.mail.comcast.net (qmta07.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:43:76:96:30:64])
	by mx1.freebsd.org (Postfix) with ESMTP id CD5953A1
	for <freebsd-gnats-submit@freebsd.org>; Wed, 12 Mar 2014 05:27:49 +0000 (UTC)
Received: from omta09.emeryville.ca.mail.comcast.net ([76.96.30.20])
	by qmta07.emeryville.ca.mail.comcast.net with comcast
	id cVTS1n0030S2fkCA7VToAk; Wed, 12 Mar 2014 05:27:48 +0000
Received: from jdc.koitsu.org ([76.102.14.35])
	by omta09.emeryville.ca.mail.comcast.net with comcast
	id cVTm1n00j0lNtxY8VVTndA; Wed, 12 Mar 2014 05:27:48 +0000
Received: by icarus.home.lan (Postfix, from userid 1000)
	id BB0AD73A3B; Tue, 11 Mar 2014 22:27:46 -0700 (PDT)
Message-Id: <20140312052746.BB0AD73A3B@icarus.home.lan>
Date: Tue, 11 Mar 2014 22:27:46 -0700 (PDT)
From: Jeremy Chadwick <jdc@koitsu.org>
Reply-To: Jeremy Chadwick <jdc@koitsu.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: lang/ruby21 -- configure has mistakes/errors relating to pthread detection
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         187472
>Category:       ports
>Synopsis:       lang/ruby21 -- configure has mistakes/errors relating to pthread detection
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    swills
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 12 05:30:00 UTC 2014
>Closed-Date:    Sun Mar 23 15:32:05 UTC 2014
>Last-Modified:  Sun Mar 23 15:40:01 UTC 2014
>Originator:     Jeremy Chadwick
>Release:        FreeBSD 9.2-STABLE amd64
>Organization:
>Environment:
System: FreeBSD icarus.home.lan 9.2-STABLE FreeBSD 9.2-STABLE #0 r262477: Tue Feb 25 01:04:30 PST 2014 root@icarus.home.lan:/usr/obj/usr/src/sys/X7SBA_RELENG_9_amd64 amd64
>Description:
	This may affect other ruby ports (ruby19, ruby20), I haven't checked.

	During configure-time, the following lines are shown (and easily
	missed because they scroll by so fast):

checking for pthread_kill in -lpthread... yes
./configure: pthread,: not found
checking for pthread_np.h... yes

	The problem appears to be around line 19613 of the configure script (not
	configure.in, I haven't reviewed that):

19608     if test x"$rb_with_pthread" = xyes; then
19609         $as_echo "#define _REENTRANT 1" >>confdefs.h
19610
19611         $as_echo "#define _THREAD_SAFE 1" >>confdefs.h
19612
19613         pthread,  MAINLIBS="-pthread $MAINLIBS",
19614         $as_echo "#define HAVE_LIBPTHREAD 1" >>confdefs.h

	This looks quite broken.  Since autoconf is used, the "source" for
	this comes from configure.in.  The code for that:

2431     if test x"$rb_with_pthread" = xyes; then
2432         AC_DEFINE(_REENTRANT)
2433         AC_DEFINE(_THREAD_SAFE)
2434         [pthread],  [MAINLIBS="-pthread $MAINLIBS"],
2435         AC_DEFINE(HAVE_LIBPTHREAD)

	Line 2434 shown above comes directly from files/patch-configure.in,
	so it appears to me someone needs to investigate the following:

	1) If files/patch-configure.in is TRULY doing the correct thing
	for ruby21 (and possibly the other ports) -- or if it's even
	necessary (someone may want to talk to the Ruby folks), and,

	2) Examination of post-patch in Makefile to make sure it's doing the
	right thing as well.

	I tried looking at the SVN annotations for this port, but the commit
	lfor the section where post-patch is is so old that it precedes use
	of Subversion thus the commit reason is unknown.
>How-To-Repeat:
	See above.
>Fix:
	Correct fix unknown at this time.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->ruby 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Mar 12 05:30:09 UTC 2014 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=187472 
Responsible-Changed-From-To: ruby->swills 
Responsible-Changed-By: swills 
Responsible-Changed-When: Thu Mar 13 19:36:28 UTC 2014 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=187472 

From: Steve Wills <swills@FreeBSD.org>
To: bug-followup@FreeBSD.org, jdc@koitsu.org
Cc:  
Subject: Re: ports/187472: lang/ruby21 -- configure has mistakes/errors
 relating to pthread detection
Date: Thu, 20 Mar 2014 06:03:24 +0000

 --GID0FwUMdk1T2AWN
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Hi,
 
 Thanks for the report. You are indeed right. It seems I broke this in r292221,
 a long time ago, so it's in all lang/ruby* ports. Please see attached patch
 which at least undoes the damage.
 
 I'm really not sure the thread related changes need to be done at all any more,
 figuring that out will take a little more time.
 
 Steve
 
 --GID0FwUMdk1T2AWN
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="ruby_thread_fix_1.diff.txt"
 
 Index: lang/ruby19/files/patch-configure.in
 ===================================================================
 --- lang/ruby19/files/patch-configure.in	(revision 348605)
 +++ lang/ruby19/files/patch-configure.in	(working copy)
 @@ -1,6 +1,6 @@
 ---- configure.in.orig	2013-02-11 14:33:14.000000000 +0000
 -+++ configure.in	2013-02-11 14:30:13.000000000 +0000
 -@@ -1129,11 +1129,11 @@
 +--- configure.in.orig	2014-03-20 05:49:55.847385089 +0000
 ++++ configure.in	2014-03-20 05:50:09.238383528 +0000
 +@@ -1139,11 +1139,11 @@
   [superux*], [	ac_cv_func_setitimer=no
   		],
   [	LIBS="-lm $LIBS"])
 @@ -17,7 +17,7 @@
   if test "${enable_win95}" = maybe; then
       AC_HAVE_LIBRARY(unicows, [enable_win95=yes], [enable_win95=no])
   fi
 -@@ -1828,7 +1828,7 @@
 +@@ -1789,7 +1789,7 @@
   fi
   
   if test x"$enable_pthread" = xyes; then
 @@ -26,15 +26,15 @@
   	AC_CHECK_LIB($pthread_lib, pthread_kill,
   		     rb_with_pthread=yes, rb_with_pthread=no)
   	if test "$rb_with_pthread" = "yes"; then break; fi
 -@@ -1836,6 +1836,7 @@
 -     if test x"$rb_with_pthread" = xyes; then
 - 	AC_DEFINE(_REENTRANT)
 - 	AC_DEFINE(_THREAD_SAFE)
 +@@ -1803,6 +1803,7 @@
 + 	[c],    [],
 + 	[root], [],
 + 	[c_r],  [MAINLIBS="-pthread $MAINLIBS"],
  +	[pthread],  [MAINLIBS="-pthread $MAINLIBS"],
 - 	AC_DEFINE(HAVE_LIBPTHREAD)
 - 	AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
 - 	AS_CASE([$pthread_lib],
 -@@ -2080,7 +2081,6 @@
 + 	        [AS_CASE(["$target_os"],
 + 		    [openbsd*], [LIBS="-pthread $LIBS"],
 + 		    [LIBS="-l$pthread_lib $LIBS"])])
 +@@ -2041,7 +2042,6 @@
   			: ${LDSHARED='$(CC) -shared'}
   			if test "$rb_cv_binary_elf" = yes; then
   			    LDFLAGS="$LDFLAGS -rdynamic"
 @@ -42,7 +42,7 @@
   			else
   			  test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED="ld -Bshareable"
   			fi
 -@@ -2385,6 +2385,7 @@
 +@@ -2348,6 +2348,7 @@
       [freebsd*|dragonfly*], [
   	SOLIBS='$(LIBS)'
   	LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
 Index: lang/ruby20/files/patch-configure.in
 ===================================================================
 --- lang/ruby20/files/patch-configure.in	(revision 348605)
 +++ lang/ruby20/files/patch-configure.in	(working copy)
 @@ -1,5 +1,5 @@
 ---- configure.in.orig	2014-02-17 23:37:01.241643774 +0000
 -+++ configure.in	2014-02-17 23:38:03.349639470 +0000
 +--- configure.in.orig	2014-03-20 05:47:33.807394460 +0000
 ++++ configure.in	2014-03-20 05:47:49.855394229 +0000
  @@ -1386,11 +1386,11 @@
   AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
   @%:@include <errno.h>])
 @@ -26,14 +26,14 @@
   	AC_CHECK_LIB($pthread_lib, pthread_kill,
   		     rb_with_pthread=yes, rb_with_pthread=no)
   	if test "$rb_with_pthread" = "yes"; then break; fi
 -@@ -2089,6 +2089,7 @@
 -     if test x"$rb_with_pthread" = xyes; then
 - 	AC_DEFINE(_REENTRANT)
 - 	AC_DEFINE(_THREAD_SAFE)
 +@@ -2095,6 +2095,7 @@
 + 	[c],    [],
 + 	[root], [],
 + 	[c_r],  [MAINLIBS="-pthread $MAINLIBS"],
  +	[pthread],  [MAINLIBS="-pthread $MAINLIBS"],
 - 	AC_DEFINE(HAVE_LIBPTHREAD)
 - 	AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
 - 	AS_CASE([$pthread_lib],
 + 	        [AS_CASE(["$target_os"],
 + 		    [openbsd*], [LIBS="-pthread $LIBS"],
 + 		    [LIBS="-l$pthread_lib $LIBS"])])
  @@ -2326,7 +2327,6 @@
   			: ${LDSHARED='$(CC) -shared'}
   			if test "$rb_cv_binary_elf" = yes; then
 Index: lang/ruby21/files/patch-configure.in
 ===================================================================
 --- lang/ruby21/files/patch-configure.in	(revision 348605)
 +++ lang/ruby21/files/patch-configure.in	(working copy)
 @@ -1,5 +1,5 @@
 ---- configure.in.orig	2014-02-21 23:32:34.000000000 +0000
 -+++ configure.in	2014-02-24 14:54:59.432610152 +0000
 +--- configure.in.orig	2014-03-20 05:40:57.873422152 +0000
 ++++ configure.in	2014-03-20 05:40:57.873422152 +0000
  @@ -1084,10 +1084,10 @@
     ],
   [	LIBS="-lm $LIBS"])
 @@ -33,14 +33,14 @@
   	AC_CHECK_LIB($pthread_lib, pthread_kill,
   		     rb_with_pthread=yes, rb_with_pthread=no)
   	if test "$rb_with_pthread" = "yes"; then break; fi
 -@@ -2431,6 +2431,7 @@
 -     if test x"$rb_with_pthread" = xyes; then
 - 	AC_DEFINE(_REENTRANT)
 - 	AC_DEFINE(_THREAD_SAFE)
 +@@ -2437,6 +2437,7 @@
 + 	[c],    [],
 + 	[root], [],
 + 	[c_r],  [MAINLIBS="-pthread $MAINLIBS"],
  +	[pthread],  [MAINLIBS="-pthread $MAINLIBS"],
 - 	AC_DEFINE(HAVE_LIBPTHREAD)
 - 	AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
 - 	AS_CASE([$pthread_lib],
 + 	        [AS_CASE(["$target_os"],
 + 		    [openbsd*|mirbsd*], [LIBS="-pthread $LIBS"],
 + 		    [LIBS="-l$pthread_lib $LIBS"])])
  @@ -2668,7 +2669,6 @@
   			: ${LDSHARED='$(CC) -shared'}
   			if test "$rb_cv_binary_elf" = yes; then
 
 --GID0FwUMdk1T2AWN--
State-Changed-From-To: open->closed 
State-Changed-By: swills 
State-Changed-When: Sun Mar 23 15:32:04 UTC 2014 
State-Changed-Why:  
Patch committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=187472 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/187472: commit references a PR
Date: Sun, 23 Mar 2014 15:31:48 +0000 (UTC)

 Author: swills
 Date: Sun Mar 23 15:31:43 2014
 New Revision: 348863
 URL: http://svnweb.freebsd.org/changeset/ports/348863
 QAT: https://qat.redports.org/buildarchive/r348863/
 
 Log:
   - Fix patch broken in r292221
   
   PR:		ports/187472
   Redported by:	Jeremy Chadwick <jdc@koitsu.org>
 
 Modified:
   head/Mk/bsd.ruby.mk
   head/lang/ruby19/files/patch-configure.in
   head/lang/ruby20/files/patch-configure.in
   head/lang/ruby21/files/patch-configure.in
 
 Modified: head/Mk/bsd.ruby.mk
 ==============================================================================
 --- head/Mk/bsd.ruby.mk	Sun Mar 23 15:22:36 2014	(r348862)
 +++ head/Mk/bsd.ruby.mk	Sun Mar 23 15:31:43 2014	(r348863)
 @@ -177,7 +177,7 @@ RUBY?=			${LOCALBASE}/bin/${RUBY_NAME}
  # Ruby 1.9
  #
  RUBY_RELVERSION=	1.9.3
 -RUBY_PORTREVISION=	1
 +RUBY_PORTREVISION=	2
  RUBY_PORTEPOCH=		1
  RUBY_PATCHLEVEL=	484
  
 @@ -193,7 +193,7 @@ RUBY21=			"@comment "
  # Ruby 2.0
  #
  RUBY_RELVERSION=	2.0.0
 -RUBY_PORTREVISION=	4
 +RUBY_PORTREVISION=	5
  RUBY_PORTEPOCH=		1
  RUBY_PATCHLEVEL=	353
  
 @@ -209,7 +209,7 @@ RUBY21=			"@comment "
  # Ruby 2.1
  #
  RUBY_RELVERSION=	2.1.1
 -RUBY_PORTREVISION=	0
 +RUBY_PORTREVISION=	1
  RUBY_PORTEPOCH=		1
  RUBY_PATCHLEVEL=	0
  
 
 Modified: head/lang/ruby19/files/patch-configure.in
 ==============================================================================
 --- head/lang/ruby19/files/patch-configure.in	Sun Mar 23 15:22:36 2014	(r348862)
 +++ head/lang/ruby19/files/patch-configure.in	Sun Mar 23 15:31:43 2014	(r348863)
 @@ -1,6 +1,6 @@
 ---- configure.in.orig	2013-02-11 14:33:14.000000000 +0000
 -+++ configure.in	2013-02-11 14:30:13.000000000 +0000
 -@@ -1129,11 +1129,11 @@
 +--- configure.in.orig	2014-03-20 05:49:55.847385089 +0000
 ++++ configure.in	2014-03-20 05:50:09.238383528 +0000
 +@@ -1139,11 +1139,11 @@
   [superux*], [	ac_cv_func_setitimer=no
   		],
   [	LIBS="-lm $LIBS"])
 @@ -17,7 +17,7 @@
   if test "${enable_win95}" = maybe; then
       AC_HAVE_LIBRARY(unicows, [enable_win95=yes], [enable_win95=no])
   fi
 -@@ -1828,7 +1828,7 @@
 +@@ -1789,7 +1789,7 @@
   fi
   
   if test x"$enable_pthread" = xyes; then
 @@ -26,15 +26,15 @@
   	AC_CHECK_LIB($pthread_lib, pthread_kill,
   		     rb_with_pthread=yes, rb_with_pthread=no)
   	if test "$rb_with_pthread" = "yes"; then break; fi
 -@@ -1836,6 +1836,7 @@
 -     if test x"$rb_with_pthread" = xyes; then
 - 	AC_DEFINE(_REENTRANT)
 - 	AC_DEFINE(_THREAD_SAFE)
 +@@ -1803,6 +1803,7 @@
 + 	[c],    [],
 + 	[root], [],
 + 	[c_r],  [MAINLIBS="-pthread $MAINLIBS"],
  +	[pthread],  [MAINLIBS="-pthread $MAINLIBS"],
 - 	AC_DEFINE(HAVE_LIBPTHREAD)
 - 	AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
 - 	AS_CASE([$pthread_lib],
 -@@ -2080,7 +2081,6 @@
 + 	        [AS_CASE(["$target_os"],
 + 		    [openbsd*], [LIBS="-pthread $LIBS"],
 + 		    [LIBS="-l$pthread_lib $LIBS"])])
 +@@ -2041,7 +2042,6 @@
   			: ${LDSHARED='$(CC) -shared'}
   			if test "$rb_cv_binary_elf" = yes; then
   			    LDFLAGS="$LDFLAGS -rdynamic"
 @@ -42,7 +42,7 @@
   			else
   			  test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED="ld -Bshareable"
   			fi
 -@@ -2385,6 +2385,7 @@
 +@@ -2348,6 +2348,7 @@
       [freebsd*|dragonfly*], [
   	SOLIBS='$(LIBS)'
   	LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)'
 
 Modified: head/lang/ruby20/files/patch-configure.in
 ==============================================================================
 --- head/lang/ruby20/files/patch-configure.in	Sun Mar 23 15:22:36 2014	(r348862)
 +++ head/lang/ruby20/files/patch-configure.in	Sun Mar 23 15:31:43 2014	(r348863)
 @@ -1,5 +1,5 @@
 ---- configure.in.orig	2014-02-17 23:37:01.241643774 +0000
 -+++ configure.in	2014-02-17 23:38:03.349639470 +0000
 +--- configure.in.orig	2014-03-20 05:47:33.807394460 +0000
 ++++ configure.in	2014-03-20 05:47:49.855394229 +0000
  @@ -1386,11 +1386,11 @@
   AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default
   @%:@include <errno.h>])
 @@ -26,14 +26,14 @@
   	AC_CHECK_LIB($pthread_lib, pthread_kill,
   		     rb_with_pthread=yes, rb_with_pthread=no)
   	if test "$rb_with_pthread" = "yes"; then break; fi
 -@@ -2089,6 +2089,7 @@
 -     if test x"$rb_with_pthread" = xyes; then
 - 	AC_DEFINE(_REENTRANT)
 - 	AC_DEFINE(_THREAD_SAFE)
 +@@ -2095,6 +2095,7 @@
 + 	[c],    [],
 + 	[root], [],
 + 	[c_r],  [MAINLIBS="-pthread $MAINLIBS"],
  +	[pthread],  [MAINLIBS="-pthread $MAINLIBS"],
 - 	AC_DEFINE(HAVE_LIBPTHREAD)
 - 	AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
 - 	AS_CASE([$pthread_lib],
 + 	        [AS_CASE(["$target_os"],
 + 		    [openbsd*], [LIBS="-pthread $LIBS"],
 + 		    [LIBS="-l$pthread_lib $LIBS"])])
  @@ -2326,7 +2327,6 @@
   			: ${LDSHARED='$(CC) -shared'}
   			if test "$rb_cv_binary_elf" = yes; then
 
 Modified: head/lang/ruby21/files/patch-configure.in
 ==============================================================================
 --- head/lang/ruby21/files/patch-configure.in	Sun Mar 23 15:22:36 2014	(r348862)
 +++ head/lang/ruby21/files/patch-configure.in	Sun Mar 23 15:31:43 2014	(r348863)
 @@ -1,5 +1,5 @@
 ---- configure.in.orig	2014-02-21 23:32:34.000000000 +0000
 -+++ configure.in	2014-02-24 14:54:59.432610152 +0000
 +--- configure.in.orig	2014-03-20 05:40:57.873422152 +0000
 ++++ configure.in	2014-03-20 05:40:57.873422152 +0000
  @@ -1084,10 +1084,10 @@
     ],
   [	LIBS="-lm $LIBS"])
 @@ -33,14 +33,14 @@
   	AC_CHECK_LIB($pthread_lib, pthread_kill,
   		     rb_with_pthread=yes, rb_with_pthread=no)
   	if test "$rb_with_pthread" = "yes"; then break; fi
 -@@ -2431,6 +2431,7 @@
 -     if test x"$rb_with_pthread" = xyes; then
 - 	AC_DEFINE(_REENTRANT)
 - 	AC_DEFINE(_THREAD_SAFE)
 +@@ -2437,6 +2437,7 @@
 + 	[c],    [],
 + 	[root], [],
 + 	[c_r],  [MAINLIBS="-pthread $MAINLIBS"],
  +	[pthread],  [MAINLIBS="-pthread $MAINLIBS"],
 - 	AC_DEFINE(HAVE_LIBPTHREAD)
 - 	AC_CHECK_HEADERS(pthread_np.h, [], [], [@%:@include <pthread.h>])
 - 	AS_CASE([$pthread_lib],
 + 	        [AS_CASE(["$target_os"],
 + 		    [openbsd*|mirbsd*], [LIBS="-pthread $LIBS"],
 + 		    [LIBS="-l$pthread_lib $LIBS"])])
  @@ -2668,7 +2669,6 @@
   			: ${LDSHARED='$(CC) -shared'}
   			if test "$rb_cv_binary_elf" = yes; then
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
