[gpm]Synaptic giant patch

Ben Pfaff blp@cs.stanford.edu
22 Aug 2002 00:29:01 -0700


Peter Berg Larsen <pebl@math.ku.dk> writes:

> > *** debug [synaptics.c(1418)]: Stick buttons: 4 4 0    FFFFFFFF FFFFFFFF 4
> > *** debug [synaptics.c(1418)]: Stick buttons: 0 0 4    FFFFFFFF FFFFFFFF FFFFFFFF
> ...
> 
> They look precisly as I expected and as they should, (meaning that you
> should not need to patch it). Can you describe it in more details why you
> need the patch?

My apologies: with the patch you just provided, it works fine.
The critical lines were, of course, the following:

-static int   stick_pressure_enabled  = 0; /* A (hard) press on the stick is reported as left click C*/
+static int   stick_pressure_enabled  = 1; /* A (hard) press on the stick is reported as left click C*/

As it turns out, the problem was that my gpm-syn.conf was being
ignored, because config.h had SYSCONFDIR and SBINDIR defined like
this:

    /* PATHS */
    #define SYSCONFDIR "${prefix}/etc"
    #define SBINDIR    "${exec_prefix}/sbin"

(I'd fixed this by hand in synaptics.c for some versions, but
forgot at one point.)  In turn, this is because gpm doesn't pay
attention when the Autoconf manual notes the following:

       A corollary is that you should not use these variables
    except in Makefiles.  For instance, instead of trying to
    evaluate `datadir' in `configure' and hardcoding it in
    Makefiles using e.g.  `AC_DEFINE_UNQUOTED(DATADIR,
    "$datadir")', you should add `-DDATADIR="$(datadir)"' to your
    `CPPFLAGS'.

Here is, therefore, a patch that fixes that.  With this patch,
everything works fine, since my gpm-syn.conf gets read as it
should.  First, the files that I actually modified myself:

diff -u -r1.1 acconfig.h
--- acconfig.h	2002/05/27 15:35:23	1.1
+++ acconfig.h	2002/08/22 07:25:48
@@ -9,10 +9,5 @@
 /* RMEV release number as a string. */
 #define RMEV_RELEASE ""
 
-/* PATHS */
-#define SYSCONFDIR ""
-#define SBINDIR    ""
-
-
 /* define if the __u32 type exists either in sys/types.h or in linux/types.h */
 #undef HAVE___U32
diff -u -r1.3 configure.in
--- configure.in	2002/05/29 09:12:23	1.3
+++ configure.in	2002/08/22 07:25:59
@@ -125,9 +125,7 @@
 AC_SUBST(SHARED_LIBS)
 AC_SUBST(lispdir)
 
-CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall'
+CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""'
 LDFLAGS='-L$(srcdir)'
 
-AC_DEFINE_UNQUOTED(SYSCONFDIR,"$sysconfdir")
-AC_DEFINE_UNQUOTED(SBINDIR,"$sbindir")
 AC_OUTPUT(Makefile.include Makefile doc/Makefile src/Makefile contrib/Makefile doc/doc.gpm)

Then, the files that got regenerated based on the files changed above:

diff -u -r1.3 configure
--- configure	2002/05/29 09:12:23	1.3
+++ configure	2002/08/22 07:25:59
@@ -1943,16 +1943,8 @@
 
 
 
-CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall'
+CPPFLAGS='-I$(srcdir) $(DEFS) -include headers/config.h -Wall -DSYSCONFDIR="\"$(sysconfdir)\"" -DSBINDIR="\"$(sbindir)\""'
 LDFLAGS='-L$(srcdir)'
-
-cat >> confdefs.h <<EOF
-#define SYSCONFDIR "$sysconfdir"
-EOF
-
-cat >> confdefs.h <<EOF
-#define SBINDIR "$sbindir"
-EOF
 
 trap '' 1 2 15
 cat > confcache <<\EOF
diff -u -r1.1 config.h.in
--- src/headers/config.h.in	2002/05/27 15:36:48	1.1
+++ src/headers/config.h.in	2002/08/22 07:26:12
@@ -1,4 +1,4 @@
-/* src/headers/config.h.in.  Generated automatically from configure.in by autoheader.  */
+/* src/headers/config.h.in.  Generated automatically from configure.in by autoheader 2.13.  */
 /* Copyright (C) 1998 Ian Zimmerman <itz@transbay.net> */
 /* Copyright (C) 2002 Nico Schottelius <nico@schottelius.org> */
 
@@ -30,10 +30,6 @@
 
 /* RMEV release number as a string. */
 #define RMEV_RELEASE ""
-
-/* PATHS */
-#define SYSCONFDIR ""
-#define SBINDIR    ""
 
 /* define if the __u32 type exists either in sys/types.h or in linux/types.h */
 #undef HAVE___U32

-- 
"Be circumspect in your liaisons with women.
 It is better to be seen at the opera with a man
 than at mass with a woman."
--De Maintenon