From 15e6848716a0a61333b3280be709ea39e2ad810f Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Sun, 2 Apr 2023 04:53:11 +0300 Subject: [PATCH] build on IRIX --- configure | 7 ++++++- src/dev_usb.c | 2 ++ src/dummy_usb.c | 4 ---- src/proto.h | 6 ++++++ src/proto_unix.c | 3 +++ src/xdetect.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 src/xdetect.c diff --git a/configure b/configure index 2b77b0a..5abad3b 100755 --- a/configure +++ b/configure @@ -138,6 +138,8 @@ echo "" HAVE_ALLOCA_H=`check_header alloca.h` HAVE_MALLOC_H=`check_header malloc.h` +HAVE_STDINT_H=`check_header stdint.h` +HAVE_INTTYPES_H=`check_header inttypes.h` if [ "$X11" = "no" ]; then echo "WARNING: you have disabled the X11 interface, the resulting daemon \ @@ -169,13 +171,14 @@ if [ "$OPT" = 'yes' ]; then fi if [ "$X11" = 'yes' ]; then - echo 'xlib = -L/usr/X11/lib -lX11' >>Makefile + echo 'xlib = -L/usr/X11/lib' >>Makefile if [ -n "$HAVE_XINPUT2_H" ]; then echo 'xlib += -lXi' >>Makefile fi if [ -n "$HAVE_XTEST_H" ]; then echo xlib += -lXtst >>Makefile fi + echo 'xlib += -lX11 -lXext' >>Makefile fi if [ -n "$CFLAGS" ]; then @@ -209,6 +212,8 @@ echo >>$cfgheader # check for alloca.h [ -n "$HAVE_ALLOCA_H" ] && echo $HAVE_ALLOCA_H >>$cfgheader [ -n "$HAVE_MALLOC_H" ] && echo $HAVE_MALLOC_H >>$cfgheader +[ -n "$HAVE_STDINT_H" ] && echo $HAVE_STDINT_H >>$cfgheader +[ -n "$HAVE_INTTYPES_H" ] && echo $HAVE_INTTYPES_H >>$cfgheader [ -n "$HAVE_XINPUT2_H" ] && echo $HAVE_XINPUT2_H >>$cfgheader [ -n "$HAVE_XTEST_H" ] && echo $HAVE_XTEST_H >>$cfgheader echo >>$cfgheader diff --git a/src/dev_usb.c b/src/dev_usb.c index 245b1c9..13331eb 100644 --- a/src/dev_usb.c +++ b/src/dev_usb.c @@ -15,6 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "config.h" + #include #include #include diff --git a/src/dummy_usb.c b/src/dummy_usb.c index bf39b39..efee065 100644 --- a/src/dummy_usb.c +++ b/src/dummy_usb.c @@ -31,10 +31,6 @@ struct usb_dev_info *find_usb_devices(int (*match)(const struct usb_dev_info*)) return 0; } -void free_usb_devices_list(struct usb_dev_info *list) -{ -} - int open_dev_usb(struct device *dev) { return -1; diff --git a/src/proto.h b/src/proto.h index 5b2a712..c61c3a9 100644 --- a/src/proto.h +++ b/src/proto.h @@ -1,7 +1,13 @@ #ifndef PROTO_H_ #define PROTO_H_ +#include "config.h" + +#ifdef HAVE_STDINT_H_ #include +#elif defined(HAVE_INTTYPES_H_) +#include +#endif /* maximum supported protocol version */ #define MAX_PROTO_VER 1 diff --git a/src/proto_unix.c b/src/proto_unix.c index 2681785..3caa484 100644 --- a/src/proto_unix.c +++ b/src/proto_unix.c @@ -34,6 +34,9 @@ along with this program. If not, see . #include "kbemu.h" #endif +#ifndef isfinite +#define isfinite(x) (!isnan(x)) +#endif static int lsock = -1; diff --git a/src/xdetect.c b/src/xdetect.c new file mode 100644 index 0000000..8f3b261 --- /dev/null +++ b/src/xdetect.c @@ -0,0 +1,44 @@ +/* +spacenavd - a free software replacement driver for 6dof space-mice. +Copyright (C) 2007-2023 John Tsiombikas + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +/* this must be the inverse of all the other xdetect_*.c ifdefs */ +#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__APPLE__) +#include +#include "xdetect.h" + +int xdet_start(void) +{ + return -1; +} + +void xdet_stop(void) +{ +} + +int xdet_get_fd(void) +{ + return -1; +} + +int handle_xdet_events(fd_set *rset) +{ + return -1; +} +#else +int spacenav_xdetect_none_shut_up_empty_source_warning; +#endif