config/wscons: Fix build and add support for NetBSD
Signed-off-by: Nia Alarie <nia@NetBSD.org>
This commit is contained in:
parent
4c03b67d33
commit
bcee84c3e4
|
@ -19,7 +19,7 @@ if build_udev
|
|||
config_dep += udev_dep
|
||||
endif
|
||||
|
||||
if host_machine.system() == 'openbsd'
|
||||
if host_machine.system() == 'netbsd' or host_machine.system() == 'openbsd'
|
||||
srcs_config += 'wscons.c'
|
||||
endif
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include <sys/ioctl.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -54,7 +55,10 @@ struct nameint {
|
|||
char *name;
|
||||
} kbdenc[] = {
|
||||
KB_OVRENC,
|
||||
KB_ENCTAB,
|
||||
KB_ENCTAB
|
||||
#ifndef __NetBSD__
|
||||
,
|
||||
#endif
|
||||
{0}
|
||||
};
|
||||
|
||||
|
@ -220,7 +224,11 @@ wscons_add_pointers(void)
|
|||
for (i = 0; i < 4; i++) {
|
||||
snprintf(devname, sizeof(devname), "%s%d", WSCONS_MOUSE_PREFIX, i);
|
||||
LogMessageVerb(X_INFO, 10, "wsmouse: checking %s\n", devname);
|
||||
fd = open_device(devnamem O_RDWR | O_NONBLOCK | O_EXCL);
|
||||
#ifdef HAVE_OPEN_DEVICE
|
||||
fd = open_device(devname, O_RDWR | O_NONBLOCK | O_EXCL);
|
||||
#else
|
||||
fd = open(devname, O_RDWR | O_NONBLOCK | O_EXCL);
|
||||
#endif
|
||||
if (fd == -1) {
|
||||
LogMessageVerb(X_WARNING, 10, "%s: %s\n", devname, strerror(errno));
|
||||
continue;
|
||||
|
@ -233,9 +241,11 @@ wscons_add_pointers(void)
|
|||
}
|
||||
close(fd);
|
||||
switch (wsmouse_type) {
|
||||
#ifdef WSMOUSE_TYPE_SYNAPTICS
|
||||
case WSMOUSE_TYPE_SYNAPTICS:
|
||||
wscons_add_pointer(devname, "synaptics", ATTR_TOUCHPAD);
|
||||
break;
|
||||
#endif
|
||||
case WSMOUSE_TYPE_TPANEL:
|
||||
wscons_add_pointer(devname, "ws", ATTR_TOUCHSCREEN);
|
||||
break;
|
||||
|
|
|
@ -157,6 +157,7 @@ conf_data.set('HAVE_GETZONEID', cc.has_function('getzoneid') ? '1' : false)
|
|||
conf_data.set('HAVE_MEMFD_CREATE', cc.has_function('memfd_create') ? '1' : false)
|
||||
conf_data.set('HAVE_MKOSTEMP', cc.has_function('mkostemp') ? '1' : false)
|
||||
conf_data.set('HAVE_MMAP', cc.has_function('mmap') ? '1' : false)
|
||||
conf_data.set('HAVE_OPEN_DEVICE', cc.has_function('open_device') ? '1' : false)
|
||||
conf_data.set('HAVE_POLL', cc.has_function('poll') ? '1' : false)
|
||||
conf_data.set('HAVE_POLLSET_CREATE', cc.has_function('pollset_create') ? '1' : false)
|
||||
conf_data.set('HAVE_POSIX_FALLOCATE', cc.has_function('posix_fallocate') ? '1' : false)
|
||||
|
|
Loading…
Reference in New Issue