@@ -586,60 +586,32 @@ AS_IF([test x"$enable_seluid24" = x"yes"], [ AC_DEFINE(OF_SELUID24, 1, [Whether to use 24 bit selector UIDs]) ]) AC_MSG_CHECKING(for exception type) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ - extern void foo(); - ], [ - @try { - foo(); - } @finally { - foo(); - } - ]) - ], [ - AS_IF([$SED 's/[[^[:print:]]]//g' /dev/null], [ - exception_type="DWARF" - ]) - AS_IF([$SED 's/[[^[:print:]]]//g' /dev/null], [ + AC_EGREP_CPP(egrep_cpp_yes, [ + #ifdef __SEH__ + egrep_cpp_yes + #endif + ], [ + AC_MSG_RESULT(SEH) + exception_type="SEH" + raise_exception="_Unwind_RaiseException" + ], [ + AC_EGREP_CPP(egrep_cpp_yes, [ + #ifdef __USING_SJLJ_EXCEPTIONS__ + egrep_cpp_yes + #endif + ], [ + AC_MSG_RESULT(SjLj) exception_type="SjLj" - ]) - AS_IF([$SED 's/[[^[:print:]]]//g' /dev/null], [ - exception_type="SEH" - ]) - - case "$exception_type" in - DWARF) - AC_DEFINE(HAVE_DWARF_EXCEPTIONS, 1, - [Whether DWARF exceptions are used]) - raise_exception="_Unwind_RaiseException" - ;; - SjLj) - AC_DEFINE(HAVE_SJLJ_EXCEPTIONS, 1, - [Whether SjLj exceptions are used]) - raise_exception="_Unwind_SjLj_RaiseException" - ;; - SEH) - AC_DEFINE(HAVE_SEH_EXCEPTIONS, 1, - [Whether SEH exceptions are used]) - raise_exception="_Unwind_RaiseException" - ;; - *) - AC_MSG_RESULT(unknown) - AC_MSG_ERROR([Exception type not detected!]) - ;; - esac - - AC_MSG_RESULT($exception_type) - ], [ - AC_MSG_RESULT(exceptions unavailable!) - AC_MSG_ERROR([Exceptions not accepted by compiler!]) + raise_exception="_Unwind_SjLj_RaiseException" + ], [ + AC_MSG_RESULT(DWARF) + exception_type="DWARF" + raise_exception="_Unwind_RaiseException" + ]) ]) AC_SEARCH_LIBS($raise_exception, [c++abi gcc_s gcc unwind], [ dnl c++abi requires pthread on OpenBSD AS_IF([test x"$ac_lib" = x"c++abi"], [LIBS="$LIBS -lpthread"])