changeset 108554:2a91d2a1b873

Define MOUSE_, TOOLTIP_, WINDOW_SUPPORT with configure. * configure.in (GPM_MOUSE_SUPPORT): Remove. (MOUSE_SUPPORT, TOOLTIP_SUPPORT, WINDOW_SUPPORT): New output variables. (HAVE_WINDOW_SYSTEM, HAVE_MOUSE): Move out of AC_BOTTOM. * src/Makefile.in (REAL_MOUSE_SUPPORT): New constant. (GPM_MOUSE_SUPPORT): Now it's a constant. (MOUSE_SUPPORT, TOOLTIP_SUPPORT, WINDOW_SUPPORT): Set with configure, not cpp. * msdos/sed2x.inp (HAVE_WINDOW_SYSTEM): Define. * msdos/sed1x.inp (TOOLTIP_SUPPORT): Edit to ${lispsource}tooltip.elc. (WINDOW_SUPPORT): Edit to $(BASE_WINDOW_SUPPORT) $(X_WINDOW_SUPPORT). * msdos/sed1v2.inp (MOUSE_SUPPORT): Edit to $(REAL_MOUSE_SUPPORT). (TOOLTIP_SUPPORT, WINDOW_SUPPORT): Edit to empty.
author Glenn Morris <rgm@gnu.org>
date Thu, 13 May 2010 20:05:00 -0700
parents 29bd94ba8c02
children c3df6042f1d6
files ChangeLog configure.in msdos/ChangeLog msdos/sed1v2.inp msdos/sed1x.inp msdos/sed2x.inp src/ChangeLog src/Makefile.in
diffstat 8 files changed, 69 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu May 13 19:51:50 2010 -0700
+++ b/ChangeLog	Thu May 13 20:05:00 2010 -0700
@@ -1,5 +1,9 @@
 2010-05-14  Glenn Morris  <rgm@gnu.org>
 
+	* configure.in (GPM_MOUSE_SUPPORT): Remove.
+	(MOUSE_SUPPORT, TOOLTIP_SUPPORT, WINDOW_SUPPORT): New output variables.
+	(HAVE_WINDOW_SYSTEM, HAVE_MOUSE): Move out of AC_BOTTOM.
+
 	* configure.in (NS_IMPL_GNUSTEP_INC): New output variable.
 	(GNUSTEP_MAKEFILES): Do not output.
 
--- a/configure.in	Thu May 13 19:51:50 2010 -0700
+++ b/configure.in	Thu May 13 20:05:00 2010 -0700
@@ -2400,7 +2400,7 @@
 ### Use -lgpm if available, unless `--with-gpm=no'.
 HAVE_GPM=no
 LIBGPM=
-GPM_MOUSE_SUPPORT=
+MOUSE_SUPPORT=
 if test "${with_gpm}" != "no"; then
   AC_CHECK_HEADER(gpm.h,
     [AC_CHECK_LIB(gpm, Gpm_Open, HAVE_GPM=yes)])
@@ -2408,11 +2408,11 @@
   if test "${HAVE_GPM}" = "yes"; then
     AC_DEFINE(HAVE_GPM, 1, [Define to 1 if you have the gpm library (-lgpm).])
     LIBGPM=-lgpm
-    GPM_MOUSE_SUPPORT="\${lispsource}mouse.elc"
+    ## May be reset below.
+    MOUSE_SUPPORT="\$(GPM_MOUSE_SUPPORT)"
   fi
 fi
 AC_SUBST(LIBGPM)
-AC_SUBST(GPM_MOUSE_SUPPORT)
 
 dnl Check for malloc/malloc.h on darwin
 AC_CHECK_HEADER(malloc/malloc.h, [AC_DEFINE(HAVE_MALLOC_MALLOC_H, 1, [Define to 1 if you have the <malloc/malloc.h> header file.])])
@@ -3262,6 +3262,25 @@
 AC_SUBST(LIB_GCC)
 
 
+TOOLTIP_SUPPORT=
+WINDOW_SUPPORT=
+## If we're using X11/GNUstep, define some consequences.
+if test "$HAVE_X_WINDOWS" = "yes" || test "$HAVE_NS" = "yes"; then
+  AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.])
+  AC_DEFINE(HAVE_MOUSE, 1, [Define if you have mouse support.])
+  MOUSE_SUPPORT="\$(REAL_MOUSE_SUPPORT)"
+  TOOLTIP_SUPPORT="\${lispsource}mouse.elc"
+
+  WINDOW_SUPPORT="\$(BASE_WINDOW_SUPPORT)"
+  test "$HAVE_X_WINDOWS" = "yes" && \
+    WINDOW_SUPPORT="$WINDOW_SUPPORT \$(X_WINDOW_SUPPORT)"
+
+fi
+AC_SUBST(MOUSE_SUPPORT)
+AC_SUBST(TOOLTIP_SUPPORT)
+AC_SUBST(WINDOW_SUPPORT)
+
+
 AH_TOP([/* GNU Emacs site configuration template file.
    Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005,
      2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
@@ -3290,12 +3309,6 @@
 ])dnl
 
 AH_BOTTOM([
-/* If we're using X11/Carbon/GNUstep, define some consequences.  */
-#if defined(HAVE_X_WINDOWS) || defined(HAVE_NS)
-#define HAVE_WINDOW_SYSTEM
-#define HAVE_MOUSE
-#endif
-
 /* Define AMPERSAND_FULL_NAME if you use the convention
    that & in the full name stands for the login id.  */
 /* Turned on June 1996 supposing nobody will mind it.  */
@@ -3320,7 +3333,7 @@
 #endif
 #endif /* __FreeBSD__ || __NetBSD__ || __linux__  */
 
-/* If using GNU, then support inline function declarations. */
+/* If using GNU, then support inline function declarations.  */
 /* Don't try to switch on inline handling as detected by AC_C_INLINE
    generally, because even if non-gcc compilers accept `inline', they
    may reject `extern inline'.  */
@@ -3345,7 +3358,7 @@
 /* Set up some defines, C and LD flags for NeXTstep interface on GNUstep.
   (There is probably a better place to do this, but right now the Cocoa
    side does this in s/darwin.h and we cannot
-   parallel this exactly since GNUstep is multi-OS. */
+   parallel this exactly since GNUstep is multi-OS.  */
 #ifdef HAVE_NS
 # ifdef NS_IMPL_GNUSTEP
 /* GNUstep needs a bit more pure memory.  Of the existing knobs,
@@ -3442,7 +3455,7 @@
 #include "string.h"
 #endif
 #ifdef HAVE_STRINGS_H
-#include "strings.h"  /* May be needed for bcopy & al. */
+#include "strings.h"  /* May be needed for bcopy & al.  */
 #endif
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
--- a/msdos/ChangeLog	Thu May 13 19:51:50 2010 -0700
+++ b/msdos/ChangeLog	Thu May 13 20:05:00 2010 -0700
@@ -1,5 +1,11 @@
 2010-05-14  Glenn Morris  <rgm@gnu.org>
 
+	* sed2x.inp (HAVE_WINDOW_SYSTEM): Define.
+	* sed1x.inp (TOOLTIP_SUPPORT): Edit to ${lispsource}tooltip.elc.
+	(WINDOW_SUPPORT): Edit to $(BASE_WINDOW_SUPPORT) $(X_WINDOW_SUPPORT).
+	* sed1v2.inp (MOUSE_SUPPORT): Edit to $(REAL_MOUSE_SUPPORT).
+	(TOOLTIP_SUPPORT, WINDOW_SUPPORT): Edit to empty.
+
 	* sed1v2.inp (FONT_OBJ): Use the plain X version (no XFT, Freetype).
 
 	* sed1v2.inp (@NS_IMPL_GNUSTEP_INC@): Edit to nil.
--- a/msdos/sed1v2.inp	Thu May 13 19:51:50 2010 -0700
+++ b/msdos/sed1v2.inp	Thu May 13 20:05:00 2010 -0700
@@ -100,6 +100,9 @@
 /^OTHER_FILES *=/s/@OTHER_FILES@//
 /^XMENU_OBJ *=/s/@XMENU_OBJ@/xmenu.o/
 /^FONT_OBJ *=/s/@FONT_OBJ@/xfont.o/
+/^MOUSE_SUPPORT *=/s/@MOUSE_SUPPORT@/$(REAL_MOUSE_SUPPORT)/
+/^TOOLTIP_SUPPORT *=/s/@TOOLTIP_SUPPORT@//
+/^WINDOW_SUPPORT *=/s/@WINDOW_SUPPORT@//
 /^LIBGPM *=/s/@LIBGPM@//
 /^EXEEXT *=/s/@EXEEXT@/.exe/
 /^PRE_ALLOC_OBJ *=/s/@PRE_ALLOC_OBJ@/lastfile.o/
--- a/msdos/sed1x.inp	Thu May 13 19:51:50 2010 -0700
+++ b/msdos/sed1x.inp	Thu May 13 20:05:00 2010 -0700
@@ -8,6 +8,8 @@
 /^LIBXMENU *=/s!@LIBXMENU@!${OLDXMENU}!
 /^LIBX_OTHER *=/s!@LIBX_OTHER@!${LIBXT} ${LIBX_EXTRA}!
 /^LIBS_SYSTEM *=/s!= *!= -lxext -lsys!
+/^TOOLTIP_SUPPORT *=/s!= *!= ${lispsource}tooltip.elc!
+/^WINDOW_SUPPORT *=/s!= *!= $(BASE_WINDOW_SUPPORT) $(X_WINDOW_SUPPORT)!
 /^temacs *:/s!OLDXMENU!LIBXMENU!
 
 # arch-tag: 3e8a78f2-3dec-44f3-81f6-3785a562da19
--- a/msdos/sed2x.inp	Thu May 13 19:51:50 2010 -0700
+++ b/msdos/sed2x.inp	Thu May 13 20:05:00 2010 -0700
@@ -2,8 +2,8 @@
 # Extra configuration script for src/config.h for DesqView/X
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005,
-#   2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+# Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+#   2009, 2010  Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
@@ -17,6 +17,7 @@
 #
 # ----------------------------------------------------------------------
 /^#undef HAVE_X_WINDOWS *$/s/undef/define/
+/^#undef HAVE_WINDOW_SYSTEM *$/s/undef/define/
 /^#undef HAVE_X11 *$/s/undef/define/
 /^#undef HAVE_X_MENU *$/s/undef/define/
 /^#undef HAVE_XSCREENNUMBEROFSCREEN *$/s/undef/define/
--- a/src/ChangeLog	Thu May 13 19:51:50 2010 -0700
+++ b/src/ChangeLog	Thu May 13 20:05:00 2010 -0700
@@ -1,5 +1,10 @@
 2010-05-14  Glenn Morris  <rgm@gnu.org>
 
+	* Makefile.in (REAL_MOUSE_SUPPORT): New constant.
+	(GPM_MOUSE_SUPPORT): Now it's a constant.
+	(MOUSE_SUPPORT, TOOLTIP_SUPPORT, WINDOW_SUPPORT): Set with configure,
+	not cpp.
+
 	* Makefile.in (@NS_IMPL_GNUSTEP_INC@): Use in place of #ifdef.
 	(ns_appresdir): Remove, unused.
 
--- a/src/Makefile.in	Thu May 13 19:51:50 2010 -0700
+++ b/src/Makefile.in	Thu May 13 20:05:00 2010 -0700
@@ -193,10 +193,17 @@
 ## Only used if HAVE_X_WINDOWS.
 FONT_OBJ=@FONT_OBJ@
 
-## ${lispsource}mouse.elc if HAVE_GPM, otherwise empty.
-## Not used if HAVE_MOUSE.
-GPM_MOUSE_SUPPORT=@GPM_MOUSE_SUPPORT@
+## Used if HAVE_MOUSE.
+REAL_MOUSE_SUPPORT=${lispsource}mouse.elc ${lispsource}select.elc \
+  ${lispsource}scroll-bar.elc
+## Used if HAVE_GPM && !HAVE_MOUSE
+GPM_MOUSE_SUPPORT=${lispsource}mouse.elc
 LIBGPM = @LIBGPM@
+## Either of the two preceding options, or empty.
+MOUSE_SUPPORT=@MOUSE_SUPPORT@
+
+## ${lispsource}tooltip.elc if HAVE_WINDOW_SYSTEM, else empty.
+TOOLTIP_SUPPORT=@TOOLTIP_SUPPORT@
 
 BASE_WINDOW_SUPPORT=${lispsource}fringe.elc ${lispsource}image.elc \
   ${lispsource}international/fontset.elc ${lispsource}dnd.elc \
@@ -205,6 +212,10 @@
 X_WINDOW_SUPPORT=${lispsource}x-dnd.elc ${lispsource}term/common-win.elc \
   ${lispsource}term/x-win.elc ${lispsource}dynamic-setting.elc
 
+## If HAVE_X_WINDOWS, both the above
+## else if HAVE_WINDOW_SYSTEM (ie, HAVE_NS) just the former; else empty.
+WINDOW_SUPPORT=@WINDOW_SUPPORT@
+
 ## -lresolv, or empty.
 LIBRESOLV = @LIBRESOLV@
 
@@ -344,8 +355,8 @@
 ns_appsrc=@ns_appsrc@
 #endif  /* HAVE_NS */
 
-/* lastfile must follow all files
-   whose initialized data areas should be dumped as pure by dump-emacs.  */
+/* lastfile must follow all files whose initialized data areas should
+   be dumped as pure by dump-emacs.  */
 obj=    dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
 	charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \
 	cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
@@ -394,13 +405,6 @@
 otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(gmallocobj) $(rallocobj) \
   $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS)
 
-#ifdef HAVE_MOUSE
-#define MOUSE_SUPPORT ${lispsource}mouse.elc \
-  ${lispsource}select.elc ${lispsource}scroll-bar.elc
-#else
-#define MOUSE_SUPPORT $(GPM_MOUSE_SUPPORT)
-#endif
-
 #ifdef MSDOS
 #define MSDOS_SUPPORT ${lispsource}ls-lisp.elc ${lispsource}disp-table.elc \
  ${lispsource}dos-fns.elc ${lispsource}dos-w32.elc ${lispsource}dos-vars.elc \
@@ -410,18 +414,6 @@
 #define MSDOS_SUPPORT
 #endif
 
-#ifdef HAVE_WINDOW_SYSTEM
-#define TOOLTIP_SUPPORT ${lispsource}tooltip.elc
-#ifdef HAVE_X_WINDOWS
-#define WINDOW_SUPPORT $(BASE_WINDOW_SUPPORT) $(X_WINDOW_SUPPORT)
-#else
-#define WINDOW_SUPPORT $(BASE_WINDOW_SUPPORT)
-#endif /* HAVE_X_WINDOWS */
-#else
-#define TOOLTIP_SUPPORT
-#define WINDOW_SUPPORT
-#endif /* HAVE_WINDOW_SYSTEM */
-
 /* This is the platform-specific list of Lisp files loaded into the
    dumped Emacs.  It is arranged like this because it is easier to generate
    it semi-mechanically from loadup.el this way.
@@ -455,7 +447,7 @@
 	${lispsource}files.elc \
 	${lispsource}format.elc \
 	${lispsource}facemenu.elc \
-	MOUSE_SUPPORT \
+	${MOUSE_SUPPORT} \
 	${lispsource}emacs-lisp/float-sup.elc \
 	${lispsource}frame.elc \
 	${lispsource}help.elc \
@@ -518,9 +510,9 @@
 	${lispsource}vc-hooks.elc \
 	${lispsource}ediff-hook.elc \
 	${lispsource}epa-hook.elc \
-	TOOLTIP_SUPPORT \
+	${TOOLTIP_SUPPORT} \
 	MSDOS_SUPPORT \
-	WINDOW_SUPPORT \
+	${WINDOW_SUPPORT} \
 	${NS_SUPPORT} \
 	${lispsource}widget.elc \
 	${lispsource}window.elc \
@@ -757,6 +749,8 @@
 Eg callproc.c only depends on w32.h for WINDOWSNT builds.
 One way to fix this would be to replace w32.h (etc) by $(W32_H),
 a variable set by configure.  Does not seem worth the trouble.
+Since the w32 build does not even use this file, you might ask
+why these dependencies are here at all...
 
 nsgui.h: In fact, every .o file depends directly or indirectly on
 dispextern.h and hence nsgui.h under NS.  But the ones that actually