Bug 170508 - [PATCH] multimedia/libv4l: Don't link to -lpthread
Summary: [PATCH] multimedia/libv4l: Don't link to -lpthread
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Jason E. Hale
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-09 17:40 UTC by Jason E. Hale
Modified: 2015-12-29 16:28 UTC (History)
4 users (show)

See Also:


Attachments
2012-08-08-libv4l.diff (584 bytes, patch)
2012-08-09 17:40 UTC, Jason E. Hale
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason E. Hale 2012-08-09 17:40:01 UTC
- multimedia/libv4l links to -lpthread instead of PTHREAD_LIBS

How-To-Repeat: - build multimedia/libv4l
Comment 1 Edwin Groothuis freebsd_committer 2012-08-09 17:40:26 UTC
Responsible Changed
From-To: freebsd-ports-bugs->hselasky

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
Comment 2 Jason E. Hale 2012-08-09 17:58:07 UTC
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
Comment 3 Hans Petter Selasky 2012-08-09 20:22:18 UTC
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
Comment 4 Jason E. Hale 2012-08-09 21:06:10 UTC
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
Comment 5 Hans Petter Selasky 2012-08-10 18:47:10 UTC
> 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
Comment 6 Jason E. Hale 2012-08-10 20:20:27 UTC
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
Comment 7 Carlo Strub freebsd_committer 2014-09-11 20:00:15 UTC
Is this PR still relevant?
Comment 8 Jason E. Hale freebsd_committer 2014-09-12 01:18:34 UTC
(In reply to Carlo Strub from comment #7)
> Is this PR still relevant?

Apparently so.  I am the originator of this PR.  I suppose that since I have become a committer since I submitted this, I could take care of it myself since a significant amount of time has passed.
Comment 9 Carlo Strub freebsd_committer 2014-09-12 04:40:52 UTC
I am sure hselasky is happy to get rid of this PR ;-) It would be nice if you could take it over.
Comment 10 Hans Petter Selasky freebsd_committer 2014-09-12 04:49:20 UTC
Hi,

There is a new version of libv4l in the works:

svn --username anonsvn --password anonsvn \
      checkout svn://svn.turbocat.net/i4b/trunk/ports/multimedia/libv4l

--HPS
Comment 11 Tijl Coosemans freebsd_committer 2014-10-14 14:50:57 UTC
PTHREAD_CFLAGS and PTHREAD_LIBS are deprecated.  They were needed when FreeBSD had multiple threading libs but this hasn't been the case for a long time.  Either -pthread or -lpthread is fine.  They mean exactly the same.
Comment 12 Mark Linimon freebsd_committer freebsd_triage 2015-09-03 07:16:25 UTC
Maintainer was reset some time ago.  Reassign to submitter.  Add maintainer (mailing list) to Cc: .
Comment 13 Jason E. Hale freebsd_committer 2015-12-29 16:28:19 UTC
Closing this bug report as it is irrelevant now.