diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-01 03:46:39 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-01 03:46:39 +0000 |
commit | e7d4d902e645fd90b252fa5767999f46b0d186a8 (patch) | |
tree | 3e3bcca19e5054e4df68cedcfb17b544f287f58d /libobjc/configure.ac | |
parent | 2c84ee37e873a1c01377aec424914cf3446063ab (diff) | |
download | gcc-e7d4d902e645fd90b252fa5767999f46b0d186a8.tar.gz |
2004-09-16 Andrew Pinski <pinskia@physics.uc.edu>
PR libobjc/16448
* exception.c: Include config.h
(objc_exception_throw): Change _GLIBCXX_SJLJ_EXCEPTIONS to
SJLJ_EXCEPTIONS.
* configure.ac: Find out what exception handling code we use.
* configure: Regenerate.
* config.h.in: New file, regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88379 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc/configure.ac')
-rw-r--r-- | libobjc/configure.ac | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/libobjc/configure.ac b/libobjc/configure.ac index b3c12cea40c..6c6b4309b63 100644 --- a/libobjc/configure.ac +++ b/libobjc/configure.ac @@ -167,6 +167,8 @@ esac AC_SUBST(includedirname) AC_SUBST(libext) +AC_CONFIG_HEADERS(config.h) + # -------- # Programs # -------- @@ -228,6 +230,60 @@ fi]) GTHREAD_FLAGS=$objc_cv_gthread_flags AC_SUBST(GTHREAD_FLAGS) +AC_MSG_CHECKING([for exception model to use]) +AC_LANG_PUSH(C) +AC_ARG_ENABLE(sjlj-exceptions, + AS_HELP_STRING([--enable-sjlj-exceptions], + [force use of builtin_setjmp for exceptions]), +[:], +[dnl Botheration. Now we've got to detect the exception model. +dnl Link tests against libgcc.a are problematic since -- at least +dnl as of this writing -- we've not been given proper -L bits for +dnl single-tree newlib and libgloss. +dnl +dnl This is what AC_TRY_COMPILE would do if it didn't delete the +dnl conftest files before we got a change to grep them first. +cat > conftest.$ac_ext << EOF +[#]line __oline__ "configure" +@interface Frob +@end +@implementation Frob +@end +int proc(); +int foo() +{ + @try { + return proc(); + } + @catch (Frob* ex) { + return 0; + } +} +EOF +old_CFLAGS="$CFLAGS" +dnl work around that we don't have Objective-C support in autoconf +CFLAGS="-x objective-c -fgnu-runtime -fobjc-exceptions -S" +if AC_TRY_EVAL(ac_compile); then + if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then + enable_sjlj_exceptions=yes + elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then + enable_sjlj_exceptions=no + fi +fi +CFLAGS="$old_CFLAGS" +rm -f conftest*]) +if test x$enable_sjlj_exceptions = xyes; then + AC_DEFINE(SJLJ_EXCEPTIONS, 1, + [Define if the compiler is configured for setjmp/longjmp exceptions.]) + ac_exception_model_name=sjlj +elif test x$enable_sjlj_exceptions = xno; then + ac_exception_model_name="call frame" +else + AC_MSG_ERROR([unable to detect exception model]) +fi +AC_LANG_POP(C) +AC_MSG_RESULT($ac_exception_model_name) + # ------ # Output # ------ |