Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Updated Linux joystick code to support hotplug, GUIDs, etc.
This uses libudev for hotplug, but it's optional, so we'll just try to find
 some reasonable defaults without it (maybe an older Linux box or under
 FreeBSD's Linux emulation?).
  • Loading branch information
icculus committed Dec 11, 2012
1 parent 0a130b7 commit 9df023d
Show file tree
Hide file tree
Showing 6 changed files with 534 additions and 149 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Expand Up @@ -648,7 +648,9 @@ if(UNIX AND NOT APPLE)
set(SOURCE_FILES ${SOURCE_FILES} ${HAPTIC_SOURCES})
set(HAVE_SDL_HAPTIC TRUE)
endif(SDL_HAPTIC AND HAVE_INPUT_EVENTS)
endif(LINUX

check_include_file("libudev.h" HAVE_LIBUDEV_H)
endif(LINUX)

if(INPUT_TSLIB)
check_c_source_compiles("
Expand Down
17 changes: 17 additions & 0 deletions configure.in
Expand Up @@ -1667,6 +1667,22 @@ CheckInputEvents()
fi
}

dnl See if the platform offers libudev for device enumeration and hotplugging.
CheckLibUDev()
{
AC_ARG_ENABLE(libudev,
AC_HELP_STRING([--enable-libudev], [enable libudev support [[default=yes]]]),
, enable_libudev=yes)
if test x$enable_libudev = xyes; then
AC_CHECK_HEADER(libudev.h,
have_libudev_h_hdr=yes,
have_libudev_h_hdr=no)
if test x$have_libudev_h_hdr = xyes; then
AC_DEFINE(HAVE_LIBUDEV_H, 1, [ ])
fi
fi
}

dnl See if we can use the Touchscreen input library
CheckTslib()
{
Expand Down Expand Up @@ -2191,6 +2207,7 @@ case "$host" in
CheckFusionSound
CheckOpenGLX11
CheckOpenGLESX11
CheckLibUDev
CheckInputEvents
CheckTslib
CheckUSBHID
Expand Down
1 change: 1 addition & 0 deletions include/SDL_config.h.cmake
Expand Up @@ -65,6 +65,7 @@
#cmakedefine HAVE_SIGNAL_H 1
#cmakedefine HAVE_ALTIVEC_H 1
#cmakedefine HAVE_PTHREAD_NP_H 1
#cmakedefine HAVE_LIBUDEV_H 1

/* C library functions */
#cmakedefine HAVE_MALLOC 1
Expand Down
1 change: 1 addition & 0 deletions include/SDL_config.h.in
Expand Up @@ -70,6 +70,7 @@
#undef HAVE_SIGNAL_H
#undef HAVE_ALTIVEC_H
#undef HAVE_PTHREAD_NP_H
#undef HAVE_LIBUDEV_H

/* C library functions */
#undef HAVE_MALLOC
Expand Down

0 comments on commit 9df023d

Please sign in to comment.