summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSascha Hlusiak <saschahlusiak@arcor.de>2007-12-05 18:00:12 +0100
committerSascha Hlusiak <saschahlusiak@arcor.de>2007-12-05 18:00:12 +0100
commit37aae4731320d4e1301f17a065bc5f1d5a3d1596 (patch)
tree88f466598137d9c41ef025895dd25abf6ec57e57 /configure.ac
parentf581e2b0daf6c79c74728ab2e21a0836ff252a65 (diff)
configure.ac: Checking for available kernel backends instead of OS
The configure script now checks for availability of several backends like Linux's joystick, Linux's evdev, BSD's usbhid. This way several backends can be compiled in and used with the same binary module. Backend selection code still missing!
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac55
1 files changed, 36 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac
index a4fd447..6b1b489 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,24 +44,6 @@ AC_PROG_CC
AH_TOP([#include "xorg-server.h"])
-case $host_os in
- linux*)
- IS_LINUX="yes"
- ;;
-
- freebsd* | kfreebsd-gnu* | netbsd* | openbsd*)
- IS_BSD="yes"
- ;;
-
- *)
- AC_MSG_ERROR([Your operating system is not supported by the joystick
- driver. Contact xorg@lists.freedesktop.org if you are
- interested in porting it.])
- ;;
-esac
-AM_CONDITIONAL(LINUX, [test "x$IS_LINUX" = xyes])
-AM_CONDITIONAL(BSD, [test "x$IS_BSD" = xyes])
-
AC_ARG_WITH(xorg-module-dir,
AC_HELP_STRING([--with-xorg-module-dir=DIR],
[Default xorg module directory
@@ -78,7 +60,7 @@ if test "x$DEBUGGING" = xyes; then
else
AC_DEFINE(NDEBUG, 1, [Disable some debugging code])
fi
-AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes])
+AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes])
inputdir=${moduledir}/input
AC_SUBST(inputdir)
@@ -99,9 +81,44 @@ AC_SUBST([CFLAGS])
# Checks for libraries.
# Checks for header files.
+linux_backend=yes
+AC_CHECK_HEADERS([linux/joystick.h],, [linux_backend=no])
+AM_CONDITIONAL(LINUX_BACKEND, [test "x$linux_backend" = xyes])
+if test "x$linux_backend" = xyes; then
+ AC_DEFINE(LINUX_BACKEND, 1, [Compile Linux joystick backend])
+fi
+
+bsd_backend=yes
+AC_CHECK_HEADERS([usbhid.h dev/usb/usb.h dev/usb/usbhid.h],, [bsd_backend=no])
+AC_CHECK_LIB([usbhid],[hid_get_item],, [bsd_backend=no])
+AM_CONDITIONAL(BSD_BACKEND, [test "x$bsd_backend" = xyes])
+if test "x$bsd_backend" = xyes; then
+ AC_DEFINE(BSD_BACKEND, 1, [Compile BSD usbhid backend])
+fi
+
+evdev_backend=yes
+AC_CHECK_HEADERS([linux/input.h],, [evdev_backend=no])
+AM_CONDITIONAL(EVDEV_BACKEND, [test "x$evdev_backend" = xyes])
+if test "x$evdev_backend" = xyes; then
+ AC_DEFINE(EVDEV_BACKEND, 1, [Compile Linux evdev backend])
+fi
+
AC_HEADER_STDC
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
AC_OUTPUT([Makefile src/Makefile man/Makefile])
+
+echo
+echo Building linux joystick backend: $linux_backend
+echo Building evdev backend: $evdev_backend
+echo Building BSD backend: $bsd_backend
+
+if test "x$linux_backend" != "xyes" -a \
+ "x$bsd_backend" != "xyes" -a \
+ "x$evdev_backend" != "xyes"; then
+ AC_MSG_ERROR([No backends were found. Your operating is not supported by the
+ joystick driver. Contact xorg@lists.freedesktop.org if you are
+ interested in porting it.])
+fi