diff --git a/config/cxx_find_exception_flags.m4 b/config/cxx_find_exception_flags.m4 index bc95fafd5a..ac3ce20196 100644 --- a/config/cxx_find_exception_flags.m4 +++ b/config/cxx_find_exception_flags.m4 @@ -43,13 +43,13 @@ elif test "$GXX" = "yes"; then AC_LANG_SAVE AC_LANG_CPLUSPLUS - AC_TRY_COMPILE(, [try { int i = 0; } catch(...) { int j = 2; }], lam_happy=1, lam_happy=0) + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[try { int i = 0; } catch(...) { int j = 2; }]]), lam_happy=1, lam_happy=0) if test "$lam_happy" = "1"; then lam_exflags="-fexceptions"; else CXXFLAGS="$CXXFLAGS_SAVE -fhandle-exceptions" - AC_TRY_COMPILE(, [try { int i = 0; } catch(...) { int j = 2; }], lam_happy=1, lam_happy=0) + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[try { int i = 0; } catch(...) { int j = 2; }]]), lam_happy=1, lam_happy=0) if test "$lam_happy" = "1"; then lam_exflags="-fhandle-exceptions"; fi diff --git a/config/cxx_have_exceptions.m4 b/config/cxx_have_exceptions.m4 index 89b68350dd..65f9a0d71b 100644 --- a/config/cxx_have_exceptions.m4 +++ b/config/cxx_have_exceptions.m4 @@ -17,7 +17,7 @@ define([LAM_CXX_HAVE_EXCEPTIONS],[ AC_MSG_CHECKING([for throw/catch]) AC_LANG_SAVE AC_LANG_CPLUSPLUS -AC_TRY_COMPILE(, int i=1; throw(i);, +AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[int i=1; throw(i);]]), LAM_CXX_EXCEPTIONS=1, LAM_CXX_EXCPTIONS=0) if test "$LAM_CXX_EXCEPTIONS" = "1"; then AC_MSG_RESULT([yes])