+ dnl GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS to 0 or 1.
+ dnl If they had chosen to either define it or not, we could have
+ dnl just used AC_CHECK_DECL here.
+ AC_CACHE_CHECK(if GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS,
+ emacs_cv_objc_exceptions,
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <GNUstepBase/GSConfig.h>]],
+[[#if defined BASE_NATIVE_OBJC_EXCEPTIONS && BASE_NATIVE_OBJC_EXCEPTIONS > 0
+1;
+#else
+fail;
+#endif]])], emacs_cv_objc_exceptions=yes, emacs_cv_objc_exceptions=no ) )
+ if test $emacs_cv_objc_exceptions = yes; then
+ dnl _NATIVE_OBJC_EXCEPTIONS is used by the GNUstep headers.
+ AC_DEFINE(_NATIVE_OBJC_EXCEPTIONS, 1,
+ [Define if GNUstep uses ObjC exceptions.])
+ GNU_OBJC_CFLAGS="-fobjc-exceptions"
+ fi