From bsdkaffee@gmail.com  Thu Aug  9 16:33:36 2012
Return-Path: <bsdkaffee@gmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B30DF106564A;
	Thu,  9 Aug 2012 16:33:32 +0000 (UTC)
	(envelope-from bsdkaffee@gmail.com)
Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 5C6148FC1B;
	Thu,  9 Aug 2012 16:33:32 +0000 (UTC)
Received: by mail-vb0-f54.google.com with SMTP id v11so753902vbm.13
        for <multiple recipients>; Thu, 09 Aug 2012 09:33:32 -0700 (PDT)
Received: by 10.58.203.3 with SMTP id km3mr19996970vec.13.1344530012197;
        Thu, 09 Aug 2012 09:33:32 -0700 (PDT)
Received: from mocha.verizon.net (c-71-61-40-68.hsd1.oh.comcast.net. [71.61.40.68])
        by mx.google.com with ESMTPS id l12sm1172691vdh.8.2012.08.09.09.33.31
        (version=TLSv1/SSLv3 cipher=OTHER);
        Thu, 09 Aug 2012 09:33:31 -0700 (PDT)
Message-Id: <1344530011.838248.70681@mocha.verizon.net>
Date: Thu, 9 Aug 2012 12:33:31 -0400
From: Jason E. Hale <bsdkaffee@gmail.com>
Reply-To: Jason E. Hale <bsdkaffee@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: hselasky@FreeBSD.org
Subject: [PATCH] multimedia/libv4l: Don't link to -lpthread 
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         170508
>Category:       ports
>Synopsis:       [PATCH] multimedia/libv4l: Don't link to -lpthread
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    hselasky
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 09 16:40:01 UTC 2012
>Closed-Date:    
>Last-Modified:  Mon Aug 13 05:42:37 UTC 2012
>Originator:     Jason E. Hale
>Release:        FreeBSD 9.0-RELEASE i386
>Organization:
none 
>Environment:
System: FreeBSD mocha.verizon.net 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Thu Jan 19 11:42:41 EST 2012 Jason@mocha.verizon.net:/usr/obj/usr/src/sys/MOCHA9 i386


	
>Description:
- multimedia/libv4l links to -lpthread instead of PTHREAD_LIBS
	
>How-To-Repeat:
- build multimedia/libv4l
	
>Fix:

	



--- 2012-08-08-libv4l.diff begins here ---
Index: Makefile
===================================================================
--- Makefile	(revision 302306)
+++ Makefile	(working copy)
@@ -7,7 +7,7 @@
 
 PORTNAME=	libv4l
 PORTVERSION=	0.8.8
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	multimedia
 MASTER_SITES=	http://linuxtv.org/downloads/v4l-utils/
 DISTNAME=	v4l-utils-${PORTVERSION}
@@ -31,6 +31,7 @@
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|$$(LIBDIR)/pkgconfig|${PREFIX}/libdata/pkgconfig|g' \
+		-e 's|-lpthread|${PTHREAD_LIBS}|g' \
 		-e 's|-lrt||g' \
 		${WRKSRC}/libv4l1/Makefile \
 		${WRKSRC}/libv4l2/Makefile \
--- 2012-08-08-libv4l.diff ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->hselasky 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Aug 9 16:40:26 UTC 2012 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

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

Date: Thu, 9 Aug 2012 18:53:49 +0200
From: Hans Petter Selasky <hselasky@c2i.net>
To: "Jason E. Hale" <bsdkaffee@gmail.com>
Cc: "FreeBSD-gnats-submit@freebsd.org" <FreeBSD-gnats-submit@freebsd.org>
Subject: Re: [PATCH] multimedia/libv4l: Don't link to -lpthread

 Does this also apply for FreeBSD 8 ?
 
 --HPS

Date: Thu, 09 Aug 2012 12:58:07 -0400
From: "Jason E. Hale" <bsdkaffee@gmail.com>
To: Hans Petter Selasky <hselasky@c2i.net>
Cc: "FreeBSD-gnats-submit@freebsd.org" <FreeBSD-gnats-submit@freebsd.org>
Subject: Re: [PATCH] multimedia/libv4l: Don't link to -lpthread

 It would apply to any version of FreeBSD.  See:
 http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/dads-pthread.html
 
 - Jason

Date: Thu, 9 Aug 2012 21:22:18 +0200
From: Hans Petter Selasky <hselasky@c2i.net>
To: "Jason E. Hale" <bsdkaffee@gmail.com>
Cc: "FreeBSD-gnats-submit@freebsd.org" <FreeBSD-gnats-submit@freebsd.org>
Subject: Re: [PATCH] multimedia/libv4l: Don't link to -lpthread

 Does this also apply for multimedia/webcamd ?
 
 BTW: I just committed a patch there:
 
 ===================================================================
 --- Makefile	(revision 2368)
 +++ Makefile	(working copy)
 @@ -116,6 +116,7 @@
  NOGCCERROR=
  MLINKS=
  BITS_PER_LONG!=${CC} -o long_size_test ${.CURDIR}/tests/long_size_test.c && 
 ./long_size_test
 +PTHREAD_LIBS?=	-lpthread
  
  .include "${.CURDIR}/build/obj-y/Makefile"
  
 @@ -171,7 +172,7 @@
  #
  # List of linker flags
  #
 -LDFLAGS+= -L${LIBDIR} -lusb -lcuse4bsd -lpthread -lutil
 +LDFLAGS+= -L${LIBDIR} -lusb -lcuse4bsd ${PTHREAD_LIBS} -lutil
  
  #
  # List of Linux specific sources
 
 --HPS

Date: Thu, 09 Aug 2012 16:06:10 -0400
From: "Jason E. Hale" <bsdkaffee@gmail.com>
To: Hans Petter Selasky <hselasky@c2i.net>
Cc: "FreeBSD-gnats-submit@freebsd.org" <FreeBSD-gnats-submit@freebsd.org>
Subject: Re: [PATCH] multimedia/libv4l: Don't link to -lpthread

 On Thursday, August 09, 2012 21:22:18 Hans Petter Selasky wrote:
 > 
 > Does this also apply for multimedia/webcamd ?
 > 
 Yes.  I see in multimedia/webcamd the Makefile has:
 LDFLAGS+= -L${LIBDIR} -lusb -lcuse4bsd -lpthread -lutil
 
 -lpthread should be replaced with PTHREAD_LIBS
 
 > BTW: I just committed a patch there:
 > 
 > ===================================================================
 > --- Makefile	(revision 2368)
 > +++ Makefile	(working copy)
 > @@ -116,6 +116,7 @@
 >  NOGCCERROR=
 >  MLINKS=
 >  BITS_PER_LONG!=${CC} -o long_size_test ${.CURDIR}/tests/long_size_test.c &&
 > ./long_size_test
 > +PTHREAD_LIBS?=	-lpthread
 > 
 >  .include "${.CURDIR}/build/obj-y/Makefile"
 > 
 > @@ -171,7 +172,7 @@
 >  #
 >  # List of linker flags
 >  #
 > -LDFLAGS+= -L${LIBDIR} -lusb -lcuse4bsd -lpthread -lutil
 > +LDFLAGS+= -L${LIBDIR} -lusb -lcuse4bsd ${PTHREAD_LIBS} -lutil
 > 
 >  #
 >  # List of Linux specific sources
 > 
 
 That's fine, but the port Makefile would still need:
 MAKE_ENV+=      PTHREAD_LIBS="${PTHREAD_LIBS}"
 
 -Jason

Date: Fri, 10 Aug 2012 19:47:10 +0200
From: Hans Petter Selasky <hselasky@c2i.net>
To: "Jason E. Hale" <bsdkaffee@gmail.com>
Cc: "FreeBSD-gnats-submit@freebsd.org" <FreeBSD-gnats-submit@freebsd.org>
Subject: Re: [PATCH] multimedia/libv4l: Don't link to -lpthread

 > That's fine, but the port Makefile would still need:
 > MAKE_ENV+=      PTHREAD_LIBS="${PTHREAD_LIBS}"
 
 Do you mean, MAKE_ENV or MAKE_ARGS?
 
 MAKE_ARGS+=      PTHREAD_LIBS="${PTHREAD_LIBS}"
 
 Currently webcamd is using MAKE_ARGS for passing variables.
 
 --HPS

Date: Fri, 10 Aug 2012 15:20:27 -0400
From: "Jason E. Hale" <bsdkaffee@gmail.com>
To: Hans Petter Selasky <hselasky@c2i.net>
Cc: "FreeBSD-gnats-submit@freebsd.org" <FreeBSD-gnats-submit@freebsd.org>
Subject: Re: [PATCH] multimedia/libv4l: Don't link to -lpthread

 On Friday, August 10, 2012 19:47:10 Hans Petter Selasky wrote:
 > On Thursday 09 August 2012 22:06:10 Jason E. Hale wrote:
 > > That's fine, but the port Makefile would still need:
 > > MAKE_ENV+=      PTHREAD_LIBS="${PTHREAD_LIBS}"
 > 
 > Do you mean, MAKE_ENV or MAKE_ARGS?
 > 
 > MAKE_ARGS+=      PTHREAD_LIBS="${PTHREAD_LIBS}"
 > 
 > Currently webcamd is using MAKE_ARGS for passing variables.
 > 
 I guess that's up to you.  It's really a matter of precedence.  An environment 
 variable in make has the lowest precedence.  In this case, it would work 
 either way since PTHREAD_LIBS is defined with "?=".  If it were defined wtih 
 "=" then MAKE_ARGS would be necessary.
 
 -Jason
>Unformatted:
