Add to git.
[pthrlib.git] / conf / test_setcontext.sh
1 # Test for a working setcontext implementation.
2 #
3 # Copyright (C) 2003 Richard W.M. Jones <rich@annexia.org>
4 #
5 # Older versions of Linux had the setcontext/makecontext functions
6 # in glibc, but the functions were null. Duh! So the only way to
7 # determine if these functions are implemented and actually work
8 # is to try them out.
9
10 result=no
11
12 if $CC $CFLAGS \
13     $srcdir/conf/test_setcontext.c -o conf/test_setcontext 2>/dev/null
14 then
15     if conf/test_setcontext | grep 'ok' >/dev/null 2>&1; then
16         result=yes
17     fi
18 fi
19
20 if [ "x$result" = "xyes" ]; then
21     echo "#define HAVE_WORKING_SETCONTEXT 1" >> config.h
22 else
23     echo "/* #define HAVE_WORKING_SETCONTEXT 1 */" >> config.h
24 fi