Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
test whether ucontext actually work, not only whether they're here
[simgrid.git] / acmacro / context.m4
1 dnl AC_CHECK_UCONTEXT: Check whether ucontext are working
2
3 dnl it uses AC_RUN and assume the worse while cross-compiling
4
5 AC_DEFUN([AC_CHECK_UCONTEXT],
6  [
7 AC_MSG_CHECKING([whether ucontext'es exist and are usable...])
8 AC_RUN_IFELSE(AC_LANG_PROGRAM([#include <ucontext.h>],
9                               [ucontext_t uc; 
10                                if (getcontext (&uc) != 0) return -1;
11                               ]),
12               AC_MSG_RESULT(yes)
13               ac_check_ucontext=yes,
14               AC_MSG_RESULT(no)
15               ac_check_ucontext=no,
16               AC_MSG_RESULT(assuming the worse in cross-compilation)
17               ac_check_ucontext=no)
18 ])