[PATCH:xf86-input-keyboard 21/21] Add some NetBSD feature detection code.

Thomas Klausner wiz at NetBSD.org
Sun Jul 28 07:18:40 PDT 2013


On Sat, Jul 27, 2013 at 01:47:10PM +0200, Mark Kettenis wrote:
> > From: Thomas Klausner <wiz at NetBSD.org>
> > Date: Fri, 26 Jul 2013 23:24:16 +0200
> > 
> > Signed-off-by: Thomas Klausner <wiz at NetBSD.org>
> 
> There should be no need to add -DPCVT_SUPPORT and -DWSCONS_SUPPORT.
> Those defines should come from <xorg-server.h>.

Oh, good point. I've reduced the diff.

> Can you explain why the "standard" protocol doesn't work on
> powerpc/sparc/sparc64/vax in NetBSD?  It works fine on OpenBSD/macppc
> and OpenBSD/sparc64 for me.

It's also for evbarm, sgimips, shark.

I think the idea on NetBSD is to DEFAULT_TO_WSKBD everywhere, however,
it's work in progress. There is a comment in the Makefile in xsrc:

1.12         (macallan 28-Apr-11): # turns out we can't use wskbd everywhere without a couple more translation
1.12         (macallan 28-Apr-11): # tables in the X driver so make it the default only where we know it will work

I don't know what the issue with "standard" is, sorry. I'll ask on
tech-x11 at NetBSD to find out.

New patch attached.
 Thomas
-------------- next part --------------
>From edb7c1054981866820646690f9a6a1de8e9abcab Mon Sep 17 00:00:00 2001
From: Thomas Klausner <wiz at NetBSD.org>
Date: Fri, 26 Jul 2013 23:18:02 +0200
Subject: [PATCH:xf86-input-keyboard 21/21] Add some NetBSD feature detection
 code.

Signed-off-by: Thomas Klausner <wiz at NetBSD.org>
---
 configure.ac    | 16 ++++++++++++++++
 src/Makefile.am |  2 +-
 src/kbd.c       |  8 ++++++++
 3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index c699f6e..27206c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,6 +79,22 @@ case $host_os in
                   porting it.])
     ;;
 esac
+case $host_os in
+  netbsd*)
+    case $host in
+      *powerpc-*|*sparc-*|*sparc64-*|*vax-*)
+        OS_FLAGS="$OS_FLAGS -DDEFAULT_TO_WSKBD"
+        ;;
+    esac
+    case "$(uname -m 2>&1)" in
+      evbarm|sgimips|shark)
+        OS_FLAGS="$OS_FLAGS -DDEFAULT_TO_WSKBD"
+        ;;
+    esac
+    ;;
+esac
+AC_SUBST([OS_FLAGS])
+
 AM_CONDITIONAL(LINUX, [test "x$IS_LINUX" = xyes])
 AM_CONDITIONAL(BSD, [test "x$IS_BSD" = xyes])
 AM_CONDITIONAL(SOLARIS, [test "x$IS_SOLARIS" = xyes])
diff --git a/src/Makefile.am b/src/Makefile.am
index d5d3ef4..8612c87 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,7 +18,7 @@
 #  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS)
+AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS) $(OS_FLAGS)
 
 kbd_drv_la_LTLIBRARIES = kbd_drv.la
 kbd_drv_la_LDFLAGS = -avoid-version -module
diff --git a/src/kbd.c b/src/kbd.c
index 9a013b7..189adca 100644
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -85,7 +85,15 @@ _X_EXPORT InputDriverRec KEYBOARD = {
 };
 
 static const char *kbdDefaults[] = {
+#ifdef __NetBSD__
+#ifdef DEFAULT_TO_WSKBD
+    "Protocol",		"wskbd",
+#else
+    "Protocol",		"standard",
+#endif
+#else /* NetBSD */
     "Protocol",		"standard",
+#endif /* NetBSD */
     "XkbRules",		"base",
     "XkbModel",		"pc105",
     "XkbLayout",	"us",
-- 
1.8.3.3



More information about the xorg-devel mailing list