From e8f178bd6831ef3610e1b23c538503ca91ef8926 Mon Sep 17 00:00:00 2001 From: mquinson Date: Fri, 5 Jan 2007 21:31:31 +0000 Subject: [PATCH] If the user wants to force the use of ucontext on a box where they are not usable, we fail instead of falling back to pthreads. The user must know. When doing so, we fail with code 77 so that testing infrastructures understand that the test is 'not applicable'. This value comes from tools like dejagnu and autotest; Do some minor cleanups on the way git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3041 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- configure.ac | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index ca8d990af7..e019a2ee99 100644 --- a/configure.ac +++ b/configure.ac @@ -84,9 +84,7 @@ dnl # dnl # check for MCSC method AC_MSG_CHECKING(on top of what can we build the contexts) -AC_CHECK_HEADER(ucontext.h,,, [#include ]) -AC_CHECK_FUNCS(makecontext swapcontext getcontext setcontext) -AC_CHECK_MCSC(mcsc=yes, mcsc=no) +AC_CHECK_MCSC(mcsc=yes, mcsc=no) dnl # check for pthread method AC_CHECK_HEADERS([pthread.h]) @@ -121,12 +119,17 @@ AC_ARG_WITH(pthread, [ --with-pthread Use pthread instead of ucontext.],with_ AC_ARG_WITH(context, [ --with-context=[ucontext/pthread] Use either (System V) swapcontext or pthread [[default=auto]].],, with_context=auto) + +if test "x$with_context$mcsc" = "xucontextno" ; then + AC_MSG_ERROR([--with-context=ucontext specified but ucontext unusable. Relaunch configure without this argument.], 77) +fi + case $with_context in ucontext) ;; pthread) ;; windows) ;; auto) with_context=ucontext;; - *) AC_MSG_ERROR("--with-context must be either ucontext or pthread") ;; + *) AC_MSG_ERROR([--with-context must be either ucontext or pthread]) ;; esac if test "x$with_context" = "xucontext" ; then -- 2.20.1