threads / patch / 16142

patchMake Pthread link flags configurable

Subject: [PATCH] Make Pthread link flags configurable

## tl;dr

4 messages between Nov 2, 2008 and Nov 3, 2008. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

david.syzdek@acsalaska.net· Nov 2, 2008, 23:43 UTC · lore
From: David M. Syzdek <david.syzdek@acsalaska.net>

FreeBSD 4.x systems use the linker flags `-pthread' instead of the linker flags `-lpthread' when linking against the pthread library.

Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
---
 Makefile |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Show changes to Makefile +3 −1
diff --git a/Makefile b/Makefile
index 489774d..6737cb0 100644
--- a/Makefile
+++ b/Makefile
@@ -229,6 +229,7 @@ INSTALL = install
 RPMBUILD = rpmbuild
 TCL_PATH = tclsh
 TCLTK_PATH = wish
+PTHREAD_LIBS = -lpthread
 
 export TCL_PATH TCLTK_PATH
 
@@ -691,6 +692,7 @@ ifeq ($(uname_S),FreeBSD)
 	DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease
 	THREADED_DELTA_SEARCH = YesPlease
 	ifeq ($(shell expr "$(uname_R)" : '4\.'),2)
+		PTHREAD_LIBS = -pthread
 		NO_UINTMAX_T = YesPlease
 		NO_STRTOUMAX = YesPlease
 	endif
@@ -1017,7 +1019,7 @@ endif
 
 ifdef THREADED_DELTA_SEARCH
 	BASIC_CFLAGS += -DTHREADED_DELTA_SEARCH
-	EXTLIBS += -lpthread
+	EXTLIBS += $(PTHREAD_LIBS)
 	LIB_OBJS += thread-utils.o
 endif
 ifdef DIR_HAS_BSD_GROUP_SEMANTICS
-- 
1.6.0.2.GIT
Jakub Narebski· Nov 3, 2008, 09:44 UTC · re: david.syzdek@acsalaska.net · lore

Re: [PATCH] Make Pthread link flags configurable

david.syzdek@acsalaska.net writes:
Show 9 quoted lines
> From: David M. Syzdek <david.syzdek@acsalaska.net>
> 
> FreeBSD 4.x systems use the linker flags `-pthread' instead of the
> linker flags `-lpthread' when linking against the pthread library.
> 
> Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
> ---
>  Makefile |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)

Would it be possible to add support for this also to configure.ac (and config.mak.in)?

-- 
Jakub Narebski
Poland
ShadeHawk on #git
David Syzdek· Nov 3, 2008, 18:18 UTC · re: Jakub Narebski · lore

Re: [PATCH] Make Pthread link flags configurable

On Mon, Nov 3, 2008 at 12:44 AM, Jakub Narebski <jnareb@gmail.com> wrote:
Show 15 quoted lines
> david.syzdek@acsalaska.net writes:
>
>> From: David M. Syzdek <david.syzdek@acsalaska.net>
>>
>> FreeBSD 4.x systems use the linker flags `-pthread' instead of the
>> linker flags `-lpthread' when linking against the pthread library.
>>
>> Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
>> ---
>>  Makefile |    4 +++-
>>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> Would it be possible to add support for this also to configure.ac
> (and config.mak.in)?
>
I just sent a patch to the list that adds autoconf tests for pthreads.
 If the test is able to determine which flag to use, then it also sets
THREADED_DELTA_SEARCH.
Jakub Narebski· Nov 3, 2008, 18:26 UTC · re: David Syzdek · lore

Re: [PATCH] Make Pthread link flags configurable

David Syzdek wrote:
Show 20 quoted lines
> On Mon, Nov 3, 2008 at 12:44 AM, Jakub Narebski <jnareb@gmail.com> wrote:
>> david.syzdek@acsalaska.net writes:
>>
>>> From: David M. Syzdek <david.syzdek@acsalaska.net>
>>>
>>> FreeBSD 4.x systems use the linker flags `-pthread' instead of the
>>> linker flags `-lpthread' when linking against the pthread library.
>>>
>>> Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
>>> ---
>>>  Makefile |    4 +++-
>>>  1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> Would it be possible to add support for this also to configure.ac
>> (and config.mak.in)?
>>
> 
> I just sent a patch to the list that adds autoconf tests for pthreads.
>  If the test is able to determine which flag to use, then it also sets
> THREADED_DELTA_SEARCH.
Thanks a lot.
-- 
Jakub Narebski
Poland

← back to recent threads