Oskar Liljeblad wrote: > http://autoconf-archive.cryp.to/acx_pthread.html uses a set of > tests for pthread support.
Thanks for the info. I'll use this as a reference when there's need to. > Some notes from it: > > -lpthreads > AIX (must check this before -lpthread) > (no flags) > in case threads are in libc; should be tried before -Kthread and > other compiler flags to prevent continual compiler warnings Already covered by lock.m4. > -Kthread > Sequent (threads in libc, but -Kthread needed for pthread.h) Sequent is not a porting target any more. > -kthread > FreeBSD kernel threads (preferred to -pthread since SMP-able) I thought that was -lkse ? > -llthread > LinuxThreads port on FreeBSD (also preferred to -pthread) I thought that was either dead or -lc_r ? > -pthread > Linux/gcc (kernel threads), BSD/gcc (userland threads), etc. The only platform that I encountered that needs -pthread (rather than -lpthread) is OSF/1. > -pthreads > Solaris/gcc Not needed (and not supported by gcc-2.95), since it can be emulated with -D and -l options. > -mthreads > Mingw32/gcc Interesting... I'll look at that. > Lynx/gcc Not a porting target. > -mt > Sun Workshop C (may only link SunOS threads [-lthread], but it > doesn't hurt to check since this sometimes defines pthreads too; > also defines -D_REENTRANT) Not needed, since it can be emulated with -D and -l options. > --thread-safe > KAI C++ Not a porting target. > GNU pth uses pth-config (or previously pthread-config) to determine > compiler and linker flags. These *-config scripts are unusable: they are generated for a single compiler. They are not usable for packages where the user shall have a free choice of the compiler to use. > Does gcc prefer -pthread or -lpthread? On the only platform where -lpthread is not sufficient for the native cc and cc needs -pthread, namely OSF/1, gcc doesn't support -pthread. Bruno _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib