changeset 108150:66c73788b432

Set GPM part of MOUSE_SUPPORT with configure, not cpp. * configure.in (GPM_MOUSE_SUPPORT): New output variable. * src/Makefile.in (GPM_MOUSE_SUPPORT): New, set by configure. (MOUSE_SUPPORT) [!HAVE_MOUSE]: Use $GPM_MOUSE_SUPPORT.
author Glenn Morris <rgm@gnu.org>
date Wed, 28 Apr 2010 00:15:10 -0700
parents 1af337cb46c4
children 582ce1d4716e
files ChangeLog configure.in src/ChangeLog src/Makefile.in
diffstat 4 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Apr 28 00:08:53 2010 -0700
+++ b/ChangeLog	Wed Apr 28 00:15:10 2010 -0700
@@ -1,5 +1,7 @@
 2010-04-28  Glenn Morris  <rgm@gnu.org>
 
+	* configure.in (GPM_MOUSE_SUPPORT): New output variable.
+
 	* configure.in (FONT_OBJ): New output variable.
 
 	* configure.in (LIBXMU): New output variable.
--- a/configure.in	Wed Apr 28 00:08:53 2010 -0700
+++ b/configure.in	Wed Apr 28 00:15:10 2010 -0700
@@ -2291,6 +2291,7 @@
 ### Use -lgpm if available, unless `--with-gpm=no'.
 HAVE_GPM=no
 LIBGPM=
+GPM_MOUSE_SUPPORT=
 if test "${with_gpm}" != "no"; then
   AC_CHECK_HEADER(gpm.h,
     [AC_CHECK_LIB(gpm, Gpm_Open, HAVE_GPM=yes)])
@@ -2298,9 +2299,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"
   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.])])
--- a/src/ChangeLog	Wed Apr 28 00:08:53 2010 -0700
+++ b/src/ChangeLog	Wed Apr 28 00:15:10 2010 -0700
@@ -1,5 +1,8 @@
 2010-04-28  Glenn Morris  <rgm@gnu.org>
 
+	* Makefile.in (GPM_MOUSE_SUPPORT): New, set by configure.
+	(MOUSE_SUPPORT) [!HAVE_MOUSE]: Use $GPM_MOUSE_SUPPORT.
+
 	* Makefile.in (FONT_OBJ): New, set by configure.
 	(FONT_DRIVERS): Use $FONT_OBJ.
 
--- a/src/Makefile.in	Wed Apr 28 00:08:53 2010 -0700
+++ b/src/Makefile.in	Wed Apr 28 00:15:10 2010 -0700
@@ -112,6 +112,10 @@
 ## Only used if HAVE_X_WINDOWS and HAVE_WINDOW_SYSTEM.
 FONT_OBJ=@FONT_OBJ@
 
+## ${lispsource}mouse.elc if HAVE_GPM, otherwise empty.
+## Not used if HAVE_MOUSE.
+GPM_MOUSE_SUPPORT=@GPM_MOUSE_SUPPORT@
+
 LIBSELINUX_LIBS = @LIBSELINUX_LIBS@
 
 INTERVALS_H = dispextern.h intervals.h composite.h
@@ -452,11 +456,7 @@
 #define MOUSE_SUPPORT ${lispsource}mouse.elc \
   ${lispsource}select.elc ${lispsource}scroll-bar.elc
 #else
-#ifdef HAVE_GPM
-#define MOUSE_SUPPORT ${lispsource}mouse.elc
-#else
-#define MOUSE_SUPPORT
-#endif
+#define MOUSE_SUPPORT $(GPM_MOUSE_SUPPORT)
 #endif
 
 #ifdef MSDOS