summaryrefslogtreecommitdiff
path: root/libstdc++-v3/aclocal.m4
diff options
context:
space:
mode:
authorPhil Edwards <pme@gcc.gnu.org>2003-08-05 20:54:43 +0000
committerPhil Edwards <pme@gcc.gnu.org>2003-08-05 20:54:43 +0000
commit1260d70fb61e50255cf7f185efff31f568a7049c (patch)
tree8f028f868a1e26f6b8c5f35ad4a2b5e60889c526 /libstdc++-v3/aclocal.m4
parent0196f4e0a514180bb0813f7a28f73beac5e47f13 (diff)
downloadgcc-1260d70fb61e50255cf7f185efff31f568a7049c.tar.gz
acinclude.m4 (GLIBCXX_ENABLE_SJLJ_EXCEPTIONS): Put down the crack pipe...
2003-08-05 Phil Edwards <pme@gcc.gnu.org> * acinclude.m4 (GLIBCXX_ENABLE_SJLJ_EXCEPTIONS): Put down the crack pipe, open the window to let out the fumes, redo the option-handling logic to properly execute the detection test. * aclocal.m4, configure: Regenerate. From-SVN: r70186
Diffstat (limited to 'libstdc++-v3/aclocal.m4')
-rw-r--r--libstdc++-v3/aclocal.m470
1 files changed, 39 insertions, 31 deletions
diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4
index 79cb7599c9b..27aed6a1195 100644
--- a/libstdc++-v3/aclocal.m4
+++ b/libstdc++-v3/aclocal.m4
@@ -1373,6 +1373,7 @@ dnl target may or may not support call frame exceptions.
dnl
dnl --enable-sjlj-exceptions forces the use of builtin setjmp.
dnl --disable-sjlj-exceptions forces the use of call frame unwinding.
+dnl Neither one forces an attempt at detection.
dnl
dnl Defines:
dnl _GLIBCXX_SJLJ_EXCEPTIONS if the compiler is configured for it
@@ -1381,17 +1382,17 @@ AC_DEFUN(GLIBCXX_ENABLE_SJLJ_EXCEPTIONS, [
AC_MSG_CHECKING([for exception model to use])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
- GLIBCXX_ENABLE(sjlj-exceptions,no,,
+ GLIBCXX_ENABLE(sjlj-exceptions,auto,,
[force use of builtin_setjmp for exceptions],
- [:],
- [# Botheration. Now we've got to detect the exception model.
- # Link tests against libgcc.a are problematic since -- at least
- # as of this writing -- we've not been given proper -L bits for
- # single-tree newlib and libgloss.
- #
- # This is what AC_TRY_COMPILE would do if it didn't delete the
- # conftest files before we got a change to grep them first.
- cat > conftest.$ac_ext << EOF
+ [permit yes|no|auto])
+
+ if test $enable_sjlj_exceptions = auto; then
+ # Botheration. Now we've got to detect the exception model. Link tests
+ # against libgcc.a are problematic since we've not been given proper -L
+ # bits for single-tree newlib and libgloss.
+ #
+ # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
+ cat > conftest.$ac_ext << EOF
[#]line __oline__ "configure"
struct S { ~S(); };
void bar();
@@ -1401,27 +1402,34 @@ void foo()
bar();
}
EOF
- old_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS=-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
- CXXFLAGS="$old_CXXFLAGS"
- rm -f conftest*
- ])
- if test $enable_sjlj_exceptions = yes; then
- AC_DEFINE(_GLIBCXX_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
+ old_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS=-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
+ CXXFLAGS="$old_CXXFLAGS"
+ rm -f conftest*
+ fi
+
+ # This is a tad weird, for hysterical raisins. We have to map enable/disable
+ # to two different models.
+ case $enable_sjlj_exceptions in
+ yes)
+ AC_DEFINE(_GLIBCXX_SJLJ_EXCEPTIONS, 1,
+ [Define if the compiler is configured for setjmp/longjmp exceptions.])
+ ac_exception_model_name=sjlj
+ ;;
+ no)
+ ac_exception_model_name="call frame"
+ ;;
+ *)
+ AC_MSG_ERROR([unable to detect exception model])
+ ;;
+ esac
AC_LANG_RESTORE
AC_MSG_RESULT($ac_exception_model_name)
])