From 31e93c3e96325a20b79856d8b76af403ad7f0fbc Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 24 Feb 2013 12:55:51 -0800 Subject: [PATCH] Fixed compiling on older Linux systems without libudev --- configure.in | 13 ++++++++++++- src/joystick/linux/SDL_sysjoystick.c | 10 +++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 56f96054a..f2f6b6468 100644 --- a/configure.in +++ b/configure.in @@ -1767,9 +1767,20 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]]) pthread_cflags="-D_REENTRANT" pthread_lib="-pthread" ;; + *-*-solaris2.9) + # From Solaris 9+, posix4's preferred name is rt. + pthread_cflags="-D_REENTRANT" + pthread_lib="-lpthread -lrt" + ;; + *-*-solaris2.10) + # Solaris 10+ merged pthread into libc. + pthread_cflags="-D_REENTRANT" + pthread_lib="-lrt" + ;; *-*-solaris*) + # Solaris 11+ merged rt into libc. pthread_cflags="-D_REENTRANT" - pthread_lib="-lpthread -lposix4" + pthread_lib="" ;; *-*-sysv5*) pthread_cflags="-D_REENTRANT -Kthread" diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c index c402a625b..956316c7e 100644 --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -47,6 +47,11 @@ #include "../../events/SDL_events_c.h" #endif +/* This isn't defined in older Linux kernel headers */ +#ifndef SYN_DROPPED +#define SYN_DROPPED 3 +#endif + /* * !!! FIXME: move all the udev stuff to src/core/linux, so I can reuse it * !!! FIXME: for audio hardware disconnects. @@ -59,11 +64,6 @@ #include #include -/* This isn't defined in older Linux kernel headers */ -#ifndef SYN_DROPPED -#define SYN_DROPPED 3 -#endif - /* we never link directly to libudev. */ /* !!! FIXME: can we generalize this? ALSA, etc, do the same things. */ static const char *udev_library = "libudev.so.0";