Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 11781 invoked by uid 6000); 23 Dec 1999 08:22:54 -0000 Received: (qmail 11724 invoked from network); 23 Dec 1999 08:22:47 -0000 Received: from slarti.muc.de (193.149.48.10) by taz.hyperreal.org with SMTP; 23 Dec 1999 08:22:47 -0000 Received: (qmail 22646 invoked by uid 66); 23 Dec 1999 08:22:10 -0000 Received: from en by slarti with UUCP; Thu Dec 23 08:22:10 1999 -0000 Received: by en1.engelschall.com (Sendmail 8.9.3+3.2W) for new-httpd@apache.org id JAA03941; Thu, 23 Dec 1999 09:20:19 +0100 (CET) Date: Thu, 23 Dec 1999 09:20:19 +0100 From: "Ralf S. Engelschall" To: new-httpd@apache.org Subject: Re: Solution for pthreads configure problem. Message-ID: <19991223092019.A3916@engelschall.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i Organization: Engelschall, Germany. X-Web-Homepage: http://www.engelschall.com/ X-PGP-Public-Key: https://www.engelschall.com/ho/rse/pgprse.asc X-PGP-Fingerprint: 00 C9 21 8E D1 AB 70 37 DD 67 A2 3A 0A 6F 8D A5 Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org Status: O 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