# [PATCH] Make Pthread link flags configurable

4 messages from 2008-11-02 to 2008-11-03. Participants: david.syzdek@acsalaska.net, Jakub Narebski, David Syzdek.
Thread: https://gitlist.dev/t/16142

## david.syzdek@acsalaska.net, 2008-11-02 23:43

Subject: [PATCH] Make Pthread link flags configurable
Message-ID: <1225669400-79505-1-git-send-email-david.syzdek@acsalaska.net>
URL: https://gitlist.dev/e/1225669400-79505-1-git-send-email-david.syzdek%40acsalaska.net

```
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(-)

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, 2008-11-03 09:44

Subject: Re: [PATCH] Make Pthread link flags configurable
Message-ID: <m3hc6pf8k6.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m3hc6pf8k6.fsf%40localhost.localdomain
In-Reply-To: <1225669400-79505-1-git-send-email-david.syzdek@acsalaska.net>

```
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)?

-- 
Jakub Narebski
Poland
ShadeHawk on #git

```

## David Syzdek, 2008-11-03 18:18

Subject: Re: [PATCH] Make Pthread link flags configurable
Message-ID: <9a0027270811031018t2b90ee64kcd2ef5e9afa73f6a@mail.gmail.com>
URL: https://gitlist.dev/e/9a0027270811031018t2b90ee64kcd2ef5e9afa73f6a%40mail.gmail.com
In-Reply-To: <m3hc6pf8k6.fsf@localhost.localdomain>

```
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.

```

## Jakub Narebski, 2008-11-03 18:26

Subject: Re: [PATCH] Make Pthread link flags configurable
Message-ID: <200811031926.29302.jnareb@gmail.com>
URL: https://gitlist.dev/e/200811031926.29302.jnareb%40gmail.com
In-Reply-To: <9a0027270811031018t2b90ee64kcd2ef5e9afa73f6a@mail.gmail.com>

```
David Syzdek wrote:
> 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

```
