From 0cc87afbdb5cd4b1a368c498d7544d82ca9fb750 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 14 Sep 2011 19:32:55 -0700 Subject: [PATCH] Make the GNUstep port at least be able to configure. Ref: http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00938.html * configure.in: (_NATIVE_OBJC_EXCEPTIONS): New AC_DEFINE. (GNU_OBJC_CFLAGS): Add -fobjc-exceptions when needed. --- ChangeLog | 6 ++++++ configure.in | 26 ++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22f9955e98b..880b8c35167 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-09-15 Glenn Morris + + * configure.in: Make configure work with recent GNUsteps. + (_NATIVE_OBJC_EXCEPTIONS): New AC_DEFINE. + (GNU_OBJC_CFLAGS): Add -fobjc-exceptions when needed. + 2011-09-11 Paul Eggert Merge from gnulib, porting to Tru64. diff --git a/configure.in b/configure.in index 5116648c32a..cfc04137470 100644 --- a/configure.in +++ b/configure.in @@ -1489,6 +1489,7 @@ tmp_CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS -x objective-c" CFLAGS="$CFLAGS -x objective-c" TEMACS_LDFLAGS2="\${LDFLAGS}" +GNU_OBJC_CFLAGS= dnl I don't think it's especially important, but src/Makefile.in dnl (now the only user of ns_appdir) used to go to the trouble of adding a dnl trailing "/" to it, so now we do it here. @@ -1521,7 +1522,28 @@ if test "${with_ns}" != no; then LIB_STANDARD= START_FILES= TEMACS_LDFLAGS2= + 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 ]], +[[#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 fi + + dnl This is only used while we test the NS headers, it gets reset below. + CFLAGS="$CFLAGS $GNU_OBJC_CFLAGS" + AC_CHECK_HEADER([AppKit/AppKit.h], [HAVE_NS=yes], [AC_MSG_ERROR([`--with-ns' was specified, but the include files are missing or cannot be compiled.])]) @@ -2555,14 +2577,14 @@ if test "${HAVE_NS}" = "yes"; then AC_DEFINE(HAVE_NS, 1, [Define to 1 if you are using the NeXTstep API, either GNUstep or Cocoa on Mac OS X.]) if test "${NS_IMPL_COCOA}" = "yes"; then AC_DEFINE(NS_IMPL_COCOA, 1, [Define to 1 if you are using NS windowing under MacOS X.]) - GNU_OBJC_CFLAGS= fi if test "${NS_IMPL_GNUSTEP}" = "yes"; then AC_DEFINE(NS_IMPL_GNUSTEP, 1, [Define to 1 if you are using NS windowing under GNUstep.]) # See also .m.o rule in Makefile.in */ # FIXME: are all these flags really needed? Document here why. */ C_SWITCH_X_SYSTEM="-D_REENTRANT -fPIC -fno-strict-aliasing" - GNU_OBJC_CFLAGS="-fgnu-runtime -Wno-import -fconstant-string-class=NSConstantString -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN -DGSDIAGNOSE" + ## Extra CFLAGS applied to src/*.m files. + GNU_OBJC_CFLAGS="$GNU_OBJC_CFLAGS -fgnu-runtime -Wno-import -fconstant-string-class=NSConstantString -DGNUSTEP_BASE_LIBRARY=1 -DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGSWARN -DGSDIAGNOSE" fi if test "${NS_HAVE_NSINTEGER}" = "yes"; then AC_DEFINE(NS_HAVE_NSINTEGER, 1, [Define to 1 if `NSInteger' is defined.]) -- 2.39.2