httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoj Kasichainula <man...@io.com>
Subject Re: cvs commit: apache-2.0/src buildconf configure.in
Date Tue, 21 Dec 1999 18:38:09 GMT
On Tue, Dec 21, 1999 at 05:25:05PM +0100, Sascha Schumann wrote:
>     Well, it is not that easy. First, -pthread isn't relevant to
>     the compile stage. It should be put into LDFLAGS (it causes
>     -lc_r or -lpthread on FreeBSD or Linux, respectively).

On Linux systems that I've checked, -pthread implies -lpthread, and it
seems to be working for me in just the CFLAGS. In fact, it's curious
that nothing is needed in LDFLAGS; I guess that since gcc is used as
the linker, autoconf is also appending CFLAGS. *shrug*

>     Second, a number of macros are needed. On Linux, it is
>     _REENTRANT (see <features.h>).

-pthread also turns on -D_REENTRANT on my Linux box.

>      On FreeBSD, no special flags are needed (AFAIK; the fact that
>      the thread-safe PHP binary builds flawlessly supports this.

Actually, I don't think not including -D_REENTRANT will make any
compiles fail if you try compiling threaded code; it will just make
your code not work :(. If FreeBSD doesn't also add an implied
-D_REENTRANT, then yeah, we should do so.

>     On Solaris, you need _POSIX_PTHREAD_SEMANTICS. 

Noted.

>     Third, you should check for pthread_kill in -lpthread, if the
>     function is not available when you use -pthread (Solaris,
>     Tru64, probably other O/S as well). Why not check for
>     pthread_create? Because on Tru64, -lpthread does not contain
>     pthread_create.

Ouch. Is it a macro or something?

So there are two ways I can go about adding these changes. I can
either try to cover all OSes without OS detection. (-D_REENTRANT
-D_POSIX_PTHREAD_SEMANTICS -D...) or just bite the bullet and check
the OS first. I guess we should do the latter.

Are there any good autoconf macros that have all this stuff
encapsulated already?

Mime
View raw message