httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject Re: Solution for pthreads configure problem.
Date Thu, 23 Dec 1999 08:20:19 GMT

In article <19991222144847.G19766@holly.calldei.com> you wrote:
> On Wed, Dec 22, 1999, Ryan Bloom wrote:
>> > Yeah, as we discussed before, we need a good per-OS routine to
>> > determine flags for eah platform. This will be done.
>> 
>> This is my work for the next few hours and tomorrow morning.  My plan:
>> 
>> If --with-threads=pth is specified for Apache, we use the flags Ralf has
>> specified as necessary to build with pth.  If not, we check for
>> libpthreads, and if it is around, we try to compile with --pthread.  If
>> this works, we specify it in the LD_FLAGS variable. 
> 
>    It will not work.  Under FreeBSD, as I mentioned in a previous
> post on this thread, there _is_ no libpthread; it's libc_r.  I
> like Greg Stein's idea of checking whether gcc -pthread will
> actually properly compile a threaded program, and then use that
> if it works, or try other methods (such as attempting to link
> with -lpthread if it exists).

I personally would do it this way:

1. compile a pthread.h/pthread_create program with the
   user supplied or default CFLAGS, LDFLAGS, etc.
   if it works, fine. Then either pthreads in in
   the vendors libc or the user provided GNU Pth, etc.

2. check in a loop for various possibilities and
   combinations:
   for CFLAGS:
      1. CFLAGS="$CFLAGS -pthread"
      2. CFLAGS="$CFLAGS -D_REENTRANT"
          :
   for LDFLAGS:
      1. LDFLAGS="$LDFLAGS -lpthread"
      2. LDFLAGS="$LDFLAGS -lc_r"
          :
   every time compile a program which includes
   pthread.h and uses pthread_create.

And only if all two steps fail, assume that no Pthread is available.

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Mime
View raw message