[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autoconf, sendmail, and pthreads

From: Steven G. Johnson
Subject: Re: autoconf, sendmail, and pthreads
Date: Thu, 21 Dec 2000 16:20:58 -0500 (EST)

On Thu, 21 Dec 2000 address@hidden wrote:
> > there now.  I haven't heard of any problems on FreeBSD, and in fact I have
> > specifically tested it on FreeBSD systems in the past.
>  We must add -pthread to complier flags there

Already done, although the macro prefers kernel threads (-kthread and
-llthread) to the userland -pthreads on that system.  Perhaps you haven't
looked at a recent version of the macro.

>    -mt - is compiler flag for Sun C/C++, which:
>           - tell compiler to generate thread_safe code.
>           - define _REENTRANT
>           - add to default libraries.

Thanks, I'll add a check for -mt on Solaris before -lpthread.

Or, wait a minute, are you sure that -mt links in -lthread and not
-lpthread?  The former are SunOS threads, as I recall (thr_*) and not
Posix threads (pthread_*).

Although I suppose it is safe to try -mt in any case....if it doesn't link
in Posix threads, then the link test (which tries to link to
pthread_create & friends) will fail and the macro will move on to

>  Becouse pthreads require -lposix4 for nanosleep,
>   pthread_* functions are defined in libthread

Is that required for any standard use of *just* the pthreads API?  I know
I've used threads functions on Solaris before without linking that.
(For ACX_PTHREAD, I don't care about users calling nanosleep directly;
this is just a generic POSIX.1b function and not a pthreads function.)

>  And I'm not sure, that defining _POSIX_THRAD_SEMANTICS is work
>  for autoconf, may be this is must be work of application programmer.

Well, I already define -D_THREAD_SAFE on FreeBSD (and AIX), and I think
that this is appropriate for autoconfing (although it is difficult to test
for and I have to resort to looking directly at the system name, sigh...)  
Actually, ACX_PTHREAD already defines -D_REENTRANT on Solaris (although
you tell me that -mt does this too). Are you sure that
-D_POSIX_THREAD_SEMANTICS is required, or is -D_REENTRANT equivalent?  
Can you send me the relevant section of the documentation?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]