-# Can we rebuild the parsers?
-# We really want flex and refuse other lex. So, the parser is portable and
-# does not induce extra lib dependency
-AC_PROG_LEX
-if test "$LEX" != flex; then
- AC_MSG_NOTICE([Will not rebuild the parsers. I want flex.])
- LEX="$SHELL $missing_dir/missing flex";
-else
-changequote(<<, >>)dnl because of the regexp [[:blank:]]
- FLEX_VERSION=`flex --version`;
- FLEX_VER_MAJ=`echo $FLEX_VERSION | sed 's/[^0-9\.]*//g' | sed 's/\..*//g'`;
- FLEX_VER_MED=`echo $FLEX_VERSION | sed 's/[^0-9\.]*//g' | sed 's/[0-9]*\.\([0-9]*\)\.[0-9]*/\1/g'`;
- FLEX_VER_MIN=`echo $FLEX_VERSION | sed 's/[^0-9\.]*//g' | sed 's/.*\.//g'`;
-changequote([, ])dnl back to normality, there is no regexp afterward
- if test $FLEX_VER_MAJ -lt 2 ; then
- AC_MSG_NOTICE([Will not rebuild the parsers. Your flex is too old.])
- LEX="$SHELL $missing_dir/missing flex";
+SG_CONFIGURE_PART(Checking GRAS architecture signature...)
+# Check architecture signature begin
+GRAS_ARCH
+# Check architecture signature end
+GRAS_CHECK_STRUCT_COMPACTION
+
+
+SG_CONFIGURE_PART([Checking for threads, contexts or assimilated...])
+AC_CHECK_UCONTEXT
+AC_MSG_CHECKING(on top of what can we build the contexts)
+AC_ARG_WITH(context,
+ [ --with-context=[ucontext/pthread] Use either (System V) swapcontext or pthread [[default=auto]].],,
+ with_context=auto)
+
+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])