autoconf
[Top][All Lists]
Advanced

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

Re: autoconf, sendmail, and pthreads


From: rssh
Subject: Re: autoconf, sendmail, and pthreads
Date: Thu, 21 Dec 2000 12:54:11 +0200 (EET)

On Wed, 20 Dec 2000, Steven G. Johnson wrote:

> On Tue, 19 Dec 2000, Lars Hecking wrote:
> >  Can anyone comment on ACX_PTHREAD?
> 
> rssh wrote:
> > It does not work good with solaris and freebsd.
> 
> When you have a bug report, contacting the author is generally a good
> idea...
> 

Oh, sorry.
 I put bug report to autoconf mail list.

> As a matter of fact, I updated ACX_PTHREAD after feedback a month or three
> ago that it had problems on Solaris (the problem was that Solaris has
> broken pthread stubs in libc that confused the tests), and it should work
> 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

> rssh wrote:
> > I. e. if anybody will touch this macro, than  merging into acx_pthread
> > stuff from RSSH_CHECK_PTHREADS from corbaconf 
> > [ http://www.corbaconf.kiev.ua ] would be a good idea.
> 
> Thanks for the link, I've downloaded this code.  It looks like it only
> handles three cases: a "-mt" flag, a "-pthreads" flag (but only on
> FreeBSD, as it uses system-name lookups), and a "-lposix4" library (it
> misses many common cases that are handled by acx_pthread, e.g. -lpthread
> or -lpthreads).  However, I should add -mt and -lposix4 tests to my macro,
> so this is useful to know.
> 
> -mt is for Sun Workshop C, according to the comments in the code.  In my
> experience, Solaris has used -pthread or -lpthread; is this for an
> older/newer system?  Is -mt equivalent to -pthread, or does it do anything
> else?  (Unfortunately, I don't have an account on a Solaris machine at the
> moment.)
> 
> What system uses -lposix4 for its threads library?  And why do you test

 Sun Solaris 2.6+ with Sun Workshop and with gcc is 2 different cases: 

   -pthread -- is for gcc
   -lpthread -- is for Solaris thread 
 library (which is linked automatically by Sun CC with -mt flag)

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

> for it by looking for the "nanosleep" function instead of something in the
> pthreads API?
> 

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

> (It is easy enough to add tests for -mt and -lposix4 into acx_pthread
> without knowing what they are for, but explanatory comments are nice, and 
> testers are better.)
> 

1. I can test this on Solaris 2.6 with Sun CC 4.2
  

2. I can tell 3 cases:
   1. Solaris and GCC  -- then we must:
      1. define _POSIX_THREAD_SEMANTIC, 
        if gcc was configurated with --enable-threads
      2. additionally add -pthread for gcc-2.7.2 from sunfreesof ;)
        ( I may be wrong, becouse I was never use gcc-2.7.2 on Sun
          Solaris)
   2. Solaris and Sun C++ workshop
      1. add -mt flag to CFLAGS and CXXFLAGS 
      2. define _POSIX_THREAD_SEMANTICS 
  
   add -lpthread -lposix4 for nanosleep on Solaris in all cases .

   3. FreeBSD (I tested 4.0 + ) - add -pthread to compiler flags.

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


> Cordially,
> Steven G. Johnson
> 
> 




reply via email to

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