summaryrefslogtreecommitdiff
path: root/libstdc++-v3/acinclude.m4
diff options
context:
space:
mode:
authorpme <pme@138bc75d-0d04-0410-961f-82ee72b054a4>2003-08-05 20:54:43 +0000
committerpme <pme@138bc75d-0d04-0410-961f-82ee72b054a4>2003-08-05 20:54:43 +0000
commit52fa96d362090ae55361c6c2f18a284ffa384927 (patch)
tree8f028f868a1e26f6b8c5f35ad4a2b5e60889c526 /libstdc++-v3/acinclude.m4
parentab9cc0645d903db236008c6ce7285d9bbdfcbaf0 (diff)
downloadgcc-52fa96d362090ae55361c6c2f18a284ffa384927.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70186 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r--libstdc++-v3/acinclude.m470
1 files changed, 39 insertions, 31 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 6f6b24e3078..f6f60ea67c7 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -1360,6 +1360,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
@@ -1368,17 +1369,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();
@@ -1388,27 +1389,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)
])