configure
changeset 12984 774ceeac9335
parent 12978 d2e027c5a389
child 12998 b87ba0fad17e
     1.1 --- a/configure	Fri Aug 02 17:20:00 2019 -0700
     1.2 +++ b/configure	Fri Aug 02 18:14:31 2019 -0700
     1.3 @@ -1675,7 +1675,7 @@
     1.4    --enable-wasapi         use the Windows WASAPI audio driver [[default=yes]]
     1.5    --enable-sdl-dlopen     use dlopen for shared object loading [[default=yes]]
     1.6    --enable-hidapi         use HIDAPI for low level joystick drivers
     1.7 -                          [[default=maybe]]
     1.8 +                          [[default=yes]]
     1.9    --enable-clock_gettime  use clock_gettime() instead of gettimeofday() on
    1.10                            UNIX [[default=yes]]
    1.11    --enable-rpath          use an rpath when linking SDL [[default=yes]]
    1.12 @@ -24105,20 +24105,16 @@
    1.13  {
    1.14      # The hidraw support doesn't catch Xbox, PS4 and Nintendo controllers,
    1.15      # so we'll just use libusb when it's available.
    1.16 -    #
    1.17 -    # libusb does not support iOS, so we default to yes on iOS.
    1.18 -    # TODO: Windows can support libusb, the hid.c file just depends on Unix APIs
    1.19 -    skiplibusb=no
    1.20      case "$host" in
    1.21 -        *-*-cygwin* | *-*-mingw32* | arm*-apple-darwin* | *-ios-* )
    1.22 +        # TODO: Windows can support libusb, the hid.c file just depends on Unix APIs
    1.23 +        *-*-cygwin* | *-*-mingw32* )
    1.24              skiplibusb=yes
    1.25              ;;
    1.26 -    esac
    1.27 -
    1.28 -    # On the other hand, *BSD specifically uses libusb only, so we make a
    1.29 -    # special case just for them.
    1.30 -    onlylibusb=no
    1.31 -    case "$host" in
    1.32 +        # libusb does not support iOS
    1.33 +        arm*-apple-darwin* | *-ios-* )
    1.34 +            skiplibusb=yes
    1.35 +            ;;
    1.36 +        # On the other hand, *BSD specifically uses libusb only
    1.37          *-*-*bsd* )
    1.38              onlylibusb=yes
    1.39              ;;
    1.40 @@ -24128,14 +24124,8 @@
    1.41  if test "${enable_hidapi+set}" = set; then :
    1.42    enableval=$enable_hidapi;
    1.43  else
    1.44 -  enable_hidapi=maybe
    1.45 -fi
    1.46 -
    1.47 -    hidapi_support=no
    1.48 -
    1.49 -    if test x$enable_hidapi = xmaybe; then
    1.50 -      enable_hidapi=$skiplibusb
    1.51 -    fi
    1.52 +  enable_hidapi=yes
    1.53 +fi
    1.54  
    1.55      if test x$enable_joystick = xyes -a x$enable_hidapi = xyes; then
    1.56          if test x$skiplibusb = xyes; then
    1.57 @@ -24221,12 +24211,10 @@
    1.58              CFLAGS="$save_CFLAGS"
    1.59              if test x$have_libusb_h = xyes; then
    1.60                  hidapi_support=yes
    1.61 -            elif test x$onlylibusb = xno; then
    1.62 -                case "$host" in
    1.63 -                *-*-darwin* )
    1.64 -                    hidapi_support=yes
    1.65 -                    ;;
    1.66 -                esac
    1.67 +            elif test x$onlylibusb = xyes; then
    1.68 +                hidapi_support=no
    1.69 +            else
    1.70 +                hidapi_support=yes
    1.71              fi
    1.72          fi
    1.73  
    1.74 @@ -24237,17 +24225,11 @@
    1.75              EXTRA_CFLAGS="$EXTRA_CFLAGS -I$srcdir/src/hidapi/hidapi"
    1.76              SOURCES="$SOURCES $srcdir/src/joystick/hidapi/*.c"
    1.77  
    1.78 -            if test x$skiplibusb = xno; then
    1.79 +            if test x$have_libusb_h = xyes; then
    1.80                  EXTRA_CFLAGS="$EXTRA_CFLAGS $LIBUSB_CFLAGS"
    1.81                  if test x$onlylibusb = xyes; then
    1.82                      SOURCES="$SOURCES $srcdir/src/hidapi/libusb/hid.c"
    1.83                      EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBUSB_LIBS"
    1.84 -                elif test x$have_libusb_h != xyes ; then
    1.85 -                    case "$host" in
    1.86 -                    *-*-darwin* )
    1.87 -                        SOURCES="$SOURCES $srcdir/src/hidapi/mac/hid.c"
    1.88 -                        ;;
    1.89 -                    esac
    1.90                  else
    1.91                      if test x$have_loadso != xyes; then
    1.92                          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic libusb loading" >&5
    1.93 @@ -24273,6 +24255,15 @@
    1.94  _ACEOF
    1.95  
    1.96                  fi
    1.97 +            else
    1.98 +                case "$host" in
    1.99 +                *-*-cygwin* | *-*-mingw32* )
   1.100 +                    SOURCES="$SOURCES $srcdir/src/hidapi/windows/hid.c"
   1.101 +                    ;;
   1.102 +                *-*-darwin* )
   1.103 +                    SOURCES="$SOURCES $srcdir/src/hidapi/mac/hid.c"
   1.104 +                    ;;
   1.105 +                esac
   1.106              fi
   1.107          fi
   1.108  
   1.109 @@ -24778,10 +24769,6 @@
   1.110              fi
   1.111              SOURCES="$SOURCES $srcdir/src/joystick/windows/*.c"
   1.112              have_joystick=yes
   1.113 -            # TODO: Remove this block once SDL_hidapi.c supports Windows!
   1.114 -            if test x$hidapi_support = xyes; then
   1.115 -                SOURCES="$SOURCES $srcdir/src/hidapi/windows/hid.c"
   1.116 -            fi
   1.117          fi
   1.118          if test x$enable_haptic = xyes; then
   1.119              if test x$have_dinput = xyes -o x$have_xinput = xyes; then