Skip to content

Commit

Permalink
Gtk3: make evdev the only driver for Linux
Browse files Browse the repository at this point in the history
Remove deprecated /dev/joy API in favor of evdev's /dev/input, which has been
the default since march 2024 anyway. One driver to rule them all ... on Linux.


git-svn-id: https://svn.code.sf.net/p/vice-emu/code/trunk@45508 379a1393-f5fb-40a0-bcee-ef074d9b53f7
  • Loading branch information
Compyx committed Feb 27, 2025
1 parent 3c6e3b4 commit 4688146
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 246 deletions.
16 changes: 2 additions & 14 deletions vice/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ VICE_ARG_ENABLE_LIST(experimental-devices, [ --enable-experimental-devices
dnl Needed for WIC64
VICE_ARG_WITH_LIST(libcurl, [ --without-libcurl disable libcurl support [[default=no]]])

dnl Linux evdev joysticks
VICE_ARG_WITH_LIST(evdev, [ --without-evdev disable Linux evdev joystick driver [[default=no]]])

dnl
dnl UI options
dnl
Expand Down Expand Up @@ -2062,22 +2059,14 @@ dnl ----- Joystick support -----
JOY_LIBS=
AM_CONDITIONAL(HAVE_LINUX_EVDEV, false)
if test x"$is_unix_x11" = "xyes" -a x"$enable_sdl1ui" != "xyes" -a x"$enable_sdl2ui" != "xyes" -a x"$enable_headlessui" != "xyes"; then
AC_CHECK_HEADER(linux/joystick.h,
[
AC_CHECK_DECL(JS_VERSION,[
LINUX_JOYSTICK_SUPPORT="yes";
AC_DEFINE(LINUX_JOYSTICK,,
[Enable support for Linux style joysticks.])
JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS joystick_linux.o";
],[],[#include <linux/joystick.h>])],)
dnl Linux evdev joystick driver
if test x"$with_evdev" != "xno" -a x"$is_unix_linux" = "xyes"; then
if test x"$is_unix_linux" = "xyes"; then
PKG_CHECK_MODULES([libevdev],
[libevdev],
[AC_DEFINE(HAVE_LINUX_EVDEV,,[Enable support for Linux evdev joysticks.])
JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS joystick_linux_evdev.o"
HAVE_LINUX_EVDEV_SUPPORT="yes"],
[AC_MSG_ERROR([Linux evdev joystick driver requested (--with-evdev) but the libevdev headers are missing.])])
[AC_MSG_ERROR([Please install libevdev headers.])])
VICE_CFLAGS="$VICE_CFLAGS $libevdev_CFLAGS"
VICE_CXXFLAGS="$VICE_CXXFLAGS $libevdev_CXXFLAGS"
LIBS="$LIBS $libevdev_LIBS"
Expand Down Expand Up @@ -3760,7 +3749,6 @@ echo "Build old x64 emulator : $X64_INCLUDED (--enable/--disable-x64)"
echo "Install XDG .desktop files : $USE_DESKTOP_FILES"
echo "icotool for Windows found : $ICOTOOL"
echo "Experimental devices emulation: $HAVE_EXPERIMENTAL_DEVICES_SUPPORT (--enable-experimental-devices)"
echo "Linux evdev joystick driver : $HAVE_LINUX_EVDEV_SUPPORT (--with-evdev)"

echo ""
echo "User CPPFLAGS: $CPPFLAGS"
Expand Down
7 changes: 2 additions & 5 deletions vice/doc/building/Linux-GTK3-Howto.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ your platform (untested).

Tested on: Linux Mint 19, 20
Ubuntu 17.10.1, 18.04, 19.04, 20.04.3-LTS 22.04 22.10 23.04 23.10
Debian 9.0-9.8, 10.0, 10.3, 10.4, 10.5, 10.6, 11.0, 11.1, 11.2 11.3
11.4 11.5 11.6 11.7 12.0
Debian 9.0-9.8, 10.0, 10.3, 10.4, 10.5, 10.6, 11.0-11.7 12.0-12.9

--------------------------------------------------------------------------------
1. adhoc build from SVN
Expand Down Expand Up @@ -41,9 +40,7 @@ $ sudo apt-get install libpulse-dev # for Pulse Audio sound support
$ sudo apt-get install libasound2-dev # for ALSA sound support
$ sudo apt-get install libglew-dev # for OpenGL hardware scaling support
$ sudo apt-get install libcurl4-openssl-dev # for WiC64, >= 7.71.0 is required
$ sudo apt-get install libevdev-dev # for Linux evdev joystick driver,
# can be omitted if `--without-evdev`
# was passed to configure
$ sudo apt-get install libevdev-dev # for Linux evdev joystick driver

If you plan on building the PDF documentation, you will also need to install
whatever package includes "epsf.tex". It was recently in "texlive-plain-generic".
Expand Down
29 changes: 25 additions & 4 deletions vice/src/arch/gtk3/joystickdrv/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,37 @@ AM_LDFLAGS = @VICE_LDFLAGS@

noinst_LIBRARIES = libjoystickdrv.a

# These sources are always linked
libjoystickdrv_a_SOURCES = \
joystick_linux.c
if WINDOWS_COMPILE
libjoystickdrv_a_SOURCES = joystick_win32_directinput.c
EXTRA_libjoystickdrv_a_SOURCES = \
joystick_bsd.c \
joystick_linux_evdev.c \
joystick_osx.c
endif

if MACOS_COMPILE
libjoystickdrv_a_SOURCES = joystick_osx.c
EXTRA_libjoystickdrv_a_SOURCES = \
joystick_bsd.c \
joystick_linux_evdev.c \
joystick_win32_directinput.c
endif

# These sources are conditionally linked
if LINUX_COMPILE
libjoystickdrv_a_SOURCES = joystick_linux_evdev.c
EXTRA_libjoystickdrv_a_SOURCES = \
joystick_bsd.c \
joystick_osx.c \
joystick_win32_directinput.c
endif

if BSD_COMPILE
libjoystickdrv_a_SOURCES = joystick_bsd.c
EXTRA_libjoystickdrv_a_SOURCES = \
joystick_linux_evdev.c \
joystick_osx.c \
joystick_win32_directinput.c
endif

libjoystickdrv_a_DEPENDENCIES = \
@JOYSTICK_DRIVERS@
Expand Down
219 changes: 0 additions & 219 deletions vice/src/arch/gtk3/joystickdrv/joystick_linux.c

This file was deleted.

4 changes: 0 additions & 4 deletions vice/src/arch/gtk3/joystickdrv/joystick_linux_evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@

#include "vice.h"

#if defined(HAVE_LINUX_EVDEV)

#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
Expand Down Expand Up @@ -480,5 +478,3 @@ void linux_joystick_evdev_init(void)
}
free(namelist);
}

#endif /* ifdef HAVE_LINUX_EVDEV */

0 comments on commit 4688146

Please sign in to comment.