Fixed compiling on older Linux systems without libudev
authorSam Lantinga <slouken@libsdl.org>
Sun, 24 Feb 2013 12:55:51 -0800
changeset 6910 a3d4fd1ba315
parent 6907 a12c142a37cc
child 6911 c683ff6484b0
Fixed compiling on older Linux systems without libudev
configure.in
src/joystick/linux/SDL_sysjoystick.c
--- a/configure.in	Sat Feb 23 02:25:34 2013 -0800
+++ b/configure.in	Sun Feb 24 12:55:51 2013 -0800
@@ -1767,9 +1767,20 @@
             pthread_cflags="-D_REENTRANT"
             pthread_lib="-pthread"
             ;;
-        *-*-solaris*)
+        *-*-solaris2.9)
+            # From Solaris 9+, posix4's preferred name is rt.
             pthread_cflags="-D_REENTRANT"
-            pthread_lib="-lpthread -lposix4"
+            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=""
             ;;
         *-*-sysv5*)
             pthread_cflags="-D_REENTRANT -Kthread"
--- a/src/joystick/linux/SDL_sysjoystick.c	Sat Feb 23 02:25:34 2013 -0800
+++ b/src/joystick/linux/SDL_sysjoystick.c	Sun Feb 24 12:55:51 2013 -0800
@@ -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 <sys/types.h>
 #include <unistd.h>
 
-/* 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";