>From 53b047e7fdf813fd415cbeb1bad5ea124e2155e6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 22 Jan 2015 16:06:20 -0800 Subject: [PATCH] Use gnustep-config if available * configure.ac (--with-gnustep): Document this. (NS_GNUSTEP_CONFIG): New variable, set if gnustep-config works. If gnustep-config works, use 'gnustep-config --objc-flags' and 'gnustep-config --gui-libs' to compute GNUstep configuration variables, instead of attempting to infer them individually. * etc/NEWS: Document this. Fixes: bug#19507 --- ChangeLog | 10 ++++++++++ configure.ac | 34 +++++++++++++++++++++++----------- etc/ChangeLog | 5 +++++ etc/NEWS | 4 ++++ 4 files changed, 42 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index b02203d..3f0897a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2015-01-22 Paul Eggert + + Use gnustep-config if available + * configure.ac (--with-gnustep): Document this. + (NS_GNUSTEP_CONFIG): New variable, set if gnustep-config works. + If gnustep-config works, use 'gnustep-config --objc-flags' and + 'gnustep-config --gui-libs' to compute GNUstep configuration + variables, instead of attempting to infer them individually. + Fixes: bug#19507 + 2015-01-21 Ulrich Müller * configure.ac (gamegroup): New AC_SUBST. diff --git a/configure.ac b/configure.ac index 47b36fe..10af840 100644 --- a/configure.ac +++ b/configure.ac @@ -414,7 +414,9 @@ esac AC_ARG_WITH([gnustep-conf],dnl [AS_HELP_STRING([--with-gnustep-conf=FILENAME], - [name of GNUstep.conf; default $GNUSTEP_CONFIG_FILE, or /etc/GNUstep/GNUstep.conf])]) + [name of GNUstep configuration file to use on systems where the command + 'gnustep-config' does not work; default $GNUSTEP_CONFIG_FILE, or + /etc/GNUstep/GNUstep.conf])]) test "X${with_gnustep_conf}" != X && test "${with_gnustep_conf}" != yes && \ GNUSTEP_CONFIG_FILE="${with_gnustep_conf}" test "X$GNUSTEP_CONFIG_FILE" = "X" && \ @@ -1752,6 +1754,7 @@ else fi HAVE_NS=no +NS_GNUSTEP_CONFIG=no NS_IMPL_COCOA=no NS_IMPL_GNUSTEP=no tmp_CPPFLAGS="$CPPFLAGS" @@ -1768,13 +1771,13 @@ if test "${with_ns}" != no; then ns_appresdir=${ns_appdir}/Contents/Resources ns_appsrc=Cocoa/Emacs.base ns_fontfile=macfont.o + elif flags=$( (gnustep-config --objc-flags) 2>/dev/null); then + NS_IMPL_GNUSTEP=yes + NS_GNUSTEP_CONFIG=yes + GNU_OBJC_CFLAGS=$flags + LIBS_GNUSTEP=$(gnustep-config --gui-libs) || exit elif test -f $GNUSTEP_CONFIG_FILE; then NS_IMPL_GNUSTEP=yes - ns_appdir=`pwd`/nextstep/Emacs.app - ns_appbindir=${ns_appdir} - ns_appresdir=${ns_appdir}/Resources - ns_appsrc=GNUstep/Emacs.base - ns_fontfile=nsfont.o dnl FIXME sourcing this several times in subshells seems inefficient. GNUSTEP_SYSTEM_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_HEADERS)" GNUSTEP_SYSTEM_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_LIBRARIES)" @@ -1807,6 +1810,13 @@ fail; GNU_OBJC_CFLAGS="-fobjc-exceptions" fi fi + if test $NS_IMPL_GNUSTEP = yes; then + ns_appdir=`pwd`/nextstep/Emacs.app + ns_appbindir=${ns_appdir} + ns_appresdir=${ns_appdir}/Resources + ns_appsrc=GNUstep/Emacs.base + ns_fontfile=nsfont.o + fi dnl This is only used while we test the NS headers, it gets reset below. CFLAGS="$CFLAGS $GNU_OBJC_CFLAGS" @@ -3375,11 +3385,13 @@ if test "${HAVE_NS}" = "yes"; then 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. */ - GNUSTEP_CFLAGS="-D_REENTRANT -fPIC -fno-strict-aliasing -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}" - ## 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" + if test $NS_GNUSTEP_CONFIG != yes; then + # See also .m.o rule in src/Makefile.in. */ + # FIXME: are all these flags really needed? Document here why. */ + GNUSTEP_CFLAGS="-D_REENTRANT -fPIC -fno-strict-aliasing -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}" + ## 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 fi OTHER_FILES=ns-app fi diff --git a/etc/ChangeLog b/etc/ChangeLog index 47f61f4..bea0c1d 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,8 @@ +2015-01-23 Paul Eggert + + Use gnustep-config if available + * NEWS: Document this. + 2015-01-22 Paul Eggert Don't downcase system diagnostics' first letters diff --git a/etc/NEWS b/etc/NEWS index db47033..b8a862e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -36,6 +36,10 @@ should be able to work around the problem either by porting the Emacs undumping code to GCC under IRIX, or by configuring --with-wide-int, or by sticking with Emacs 24.4. +** 'configure' now prefers gnustep-config when configuring GNUstep. +If gnustep-config is not available, 'configure' falls back on its old +heuristics for GNUstep configuration. + --- ** The configure option `--with-pkg-config-prog' has been removed. Use './configure PKG_CONFIG=/full/name/of/pkg-config' if you need to. -- 2.1.0