Re: [xml] solaris and pthread library [patch]



>>  So it seems the safer option is to always link with libpthread.
>>  Any drawback I miss here?
May be better is to rewrite current test to be more portable.
According to specs file on linux gcc with -pthread  add pthread library
and define _REENTRANT.

AX_PTHREAD is an existing macro distributed under GPL.  May be current
test could be replaced to use this macro if there is no license issue.

What could be used, on solaris for pthread support, instead link with
library ?

As far as I can tell it's very similar to Linux.

If compiler is gcc is enough to set -pthreads as compiler flag (CFLAGS)

Really not expert here. But it seems that:

- Older gcc will accepts '-pthreads'.
- Newer gcc (4.x) will accepts both '-pthreads' and '-pthread'.

? What about other compilers (Sun C? ) ?

Sun C is using -mt.

---threads(5)---

 -mt compiler option
     The -mt compiler option compiles and links for multithreaded
     code.  It  compiles  source files with -D_REENTRANT and aug-
     ments the set of support libraries properly.

---

Petr



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