?RCS: $Id$
?RCS:
?RCS: Copyright (c) 2001 Jarkko Hietaniemi
?RCS:
?RCS: You may distribute under the terms of either the GNU General Public
?RCS: License or the Artistic License, as specified in the README file.
?RCS:
?MAKE:d_pthread_atfork: Inlibc cat Compile usethreads Setvar
?MAKE:	-pick add $@ %<
?S:d_pthread_atfork:
?S:	This variable conditionally defines the HAS_PTHREAD_ATFORK symbol,
?S:	which indicates to the C program that the pthread_atfork()
?S:	routine is available.
?S:.
?C:HAS_PTHREAD_ATFORK:
?C:	This symbol, if defined, indicates that the pthread_atfork routine
?C:	is available to setup fork handlers.
?C:.
?H:#$d_pthread_atfork HAS_PTHREAD_ATFORK		/**/
?H:.
?LINT:set d_pthread_atfork
: see whether the pthread_atfork exists
$cat >try.c <<EOP
#include <pthread.h>
#include <stdio.h>
int main() {
#ifdef  PTHREAD_ATFORK
        pthread_atfork(NULL,NULL,NULL);
#endif
}
EOP

: see if pthread_atfork exists
set try -DPTHREAD_ATFORK
if eval $compile; then
    val="$define"
else
    val="$undef"
fi
case "$usethreads" in
$define)
        case "$val" in
        $define) echo 'pthread_atfork found.' >&4        ;;
        *)       echo 'pthread_atfork NOT found.' >&4    ;;
        esac
esac
set d_pthread_atfork
eval $setvar

