Fixed compiling on older Linux systems without libudev
authorSam Lantinga <slouken@libsdl.org>
Sun, 24 Feb 2013 12:55:51 -0800
changeset 6910a3d4fd1ba315
parent 6907 a12c142a37cc
child 6911 c683ff6484b0
Fixed compiling on older Linux systems without libudev
configure.in
src/joystick/linux/SDL_sysjoystick.c
     1.1 --- a/configure.in	Sat Feb 23 02:25:34 2013 -0800
     1.2 +++ b/configure.in	Sun Feb 24 12:55:51 2013 -0800
     1.3 @@ -1767,9 +1767,20 @@
     1.4              pthread_cflags="-D_REENTRANT"
     1.5              pthread_lib="-pthread"
     1.6              ;;
     1.7 +        *-*-solaris2.9)
     1.8 +            # From Solaris 9+, posix4's preferred name is rt.
     1.9 +            pthread_cflags="-D_REENTRANT"
    1.10 +            pthread_lib="-lpthread -lrt"
    1.11 +            ;;
    1.12 +        *-*-solaris2.10)
    1.13 +            # Solaris 10+ merged pthread into libc.
    1.14 +            pthread_cflags="-D_REENTRANT"
    1.15 +            pthread_lib="-lrt"
    1.16 +            ;;
    1.17          *-*-solaris*)
    1.18 +            # Solaris 11+ merged rt into libc.
    1.19              pthread_cflags="-D_REENTRANT"
    1.20 -            pthread_lib="-lpthread -lposix4"
    1.21 +            pthread_lib=""
    1.22              ;;
    1.23          *-*-sysv5*)
    1.24              pthread_cflags="-D_REENTRANT -Kthread"
     2.1 --- a/src/joystick/linux/SDL_sysjoystick.c	Sat Feb 23 02:25:34 2013 -0800
     2.2 +++ b/src/joystick/linux/SDL_sysjoystick.c	Sun Feb 24 12:55:51 2013 -0800
     2.3 @@ -47,6 +47,11 @@
     2.4  #include "../../events/SDL_events_c.h"
     2.5  #endif
     2.6  
     2.7 +/* This isn't defined in older Linux kernel headers */
     2.8 +#ifndef SYN_DROPPED
     2.9 +#define SYN_DROPPED 3
    2.10 +#endif
    2.11 +
    2.12  /*
    2.13   * !!! FIXME: move all the udev stuff to src/core/linux, so I can reuse it
    2.14   * !!! FIXME:  for audio hardware disconnects.
    2.15 @@ -59,11 +64,6 @@
    2.16  #include <sys/types.h>
    2.17  #include <unistd.h>
    2.18  
    2.19 -/* This isn't defined in older Linux kernel headers */
    2.20 -#ifndef SYN_DROPPED
    2.21 -#define SYN_DROPPED 3
    2.22 -#endif
    2.23 -
    2.24  /* we never link directly to libudev. */
    2.25  /* !!! FIXME: can we generalize this? ALSA, etc, do the same things. */
    2.26  static const char *udev_library = "libudev.so.0";