summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac31
-rw-r--r--tools/vmmouse_iopl.c9
2 files changed, 37 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 212f083..248fde9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,6 +148,37 @@ case $host_os in
;;
esac
+case $host_cpu in
+ i*86)
+ case $host_os in
+ *freebsd*) AC_DEFINE(USE_DEV_IO) ;;
+ *netbsd*) AC_DEFINE(USE_I386_IOPL)
+ use_i386_iopl=yes ;;
+ *openbsd*) AC_DEFINE(USE_I386_IOPL)
+ use_i386_iopl=yes ;;
+ esac
+ ;;
+ x86_64*|amd64*)
+ case $host_os in
+ *freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
+ *netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl])
+ use_i386_iopl=yes ;;
+ *openbsd*) AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl])
+ use_amd64_iopl=yes ;;
+ esac
+ ;;
+esac
+
+if test x$use_i386_iopl = xyes; then
+ AC_CHECK_LIB(i386, i386_iopl,[],
+ [AC_MSG_ERROR([cannot find library for i386_iopl])])
+fi
+
+if test x$use_amd64_iopl = xyes; then
+ AC_CHECK_LIB(amd64, amd64_iopl,[],
+ [AC_MSG_ERROR([cannot find library for amd64_iopl])])
+fi
+
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1] xproto $REQUIRED_MODULES)
PKG_CHECK_EXISTS([xorg-server >= 1.1.0],
diff --git a/tools/vmmouse_iopl.c b/tools/vmmouse_iopl.c
index 3b3fc0b..8794622 100644
--- a/tools/vmmouse_iopl.c
+++ b/tools/vmmouse_iopl.c
@@ -43,10 +43,9 @@
#include <stdbool.h>
#if defined(VMMOUSE_OS_BSD)
-#define HAVE_WRAPPER_DECLS
-#include "xf86_OSlib.h"
-#include "xf86OSpriv.h"
+#include <sys/types.h>
#ifdef USE_I386_IOPL
+#include <machine/sysarch.h>
/***************************************************************************/
/* I/O Permissions section */
/***************************************************************************/
@@ -80,6 +79,7 @@ xf86DisableIO()
#endif /* USE_I386_IOPL */
#ifdef USE_AMD64_IOPL
+#include <machine/sysarch.h>
/***************************************************************************/
/* I/O Permissions section */
/***************************************************************************/
@@ -114,6 +114,9 @@ xf86DisableIO()
#endif /* USE_AMD64_IOPL */
#ifdef USE_DEV_IO
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
static int IoFd = -1;
bool