+case $with_context in
+ ucontext) ;;
+ pthread) ;;
+ auto) with_context=ucontext;;
+ *) AC_MSG_ERROR("--with-context must be either ucontext or pthread") ;;
+esac
+
+if test "x$with_context" = "xucontext" ; then
+ if test "x$ac_check_ucontext" = "xyes"; then
+ AC_MSG_RESULT(found ucontext.h. Great!)
+ AC_DEFINE([USE_UCONTEXT],1,[Define if we use ucontext or not])
+ else
+ ac_header=windows.h
+ as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ AC_MSG_RESULT(there is no ucontext on windows, and none is needed.")
+ else
+ AC_MSG_RESULT([[no working ucontext found. Falling back to pthreads]])
+ with_context=pthread
+ fi
+ fi
+fi