Skip to content

Commit

Permalink
configury: allow libusb-less hidapi for macosx.
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Aug 1, 2019
1 parent c37c6cb commit 59ea073
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions configure
Expand Up @@ -24221,6 +24221,12 @@ fi
CFLAGS="$save_CFLAGS"
if test x$have_libusb_h = xyes; then
hidapi_support=yes
elif test x$onlylibusb = xno; then
case "$host" in
*-*-darwin* )
hidapi_support=yes
;;
esac
fi
fi

Expand All @@ -24236,6 +24242,12 @@ $as_echo "#define SDL_JOYSTICK_HIDAPI 1" >>confdefs.h
if test x$onlylibusb = xyes; then
SOURCES="$SOURCES $srcdir/src/hidapi/libusb/hid.c"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBUSB_LIBS"
elif test x$have_libusb_h != xyes ; then
case "$host" in
*-*-darwin* )
SOURCES="$SOURCES $srcdir/src/hidapi/mac/hid.c"
;;
esac
else
if test x$have_loadso != xyes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic libusb loading" >&5
Expand Down
12 changes: 12 additions & 0 deletions configure.ac
Expand Up @@ -3236,6 +3236,12 @@ AS_HELP_STRING([--enable-hidapi], [use HIDAPI for low level joystick drivers [[d
CFLAGS="$save_CFLAGS"
if test x$have_libusb_h = xyes; then
hidapi_support=yes
elif test x$onlylibusb = xno; then
case "$host" in
*-*-darwin* )
hidapi_support=yes
;;
esac
fi
fi

Expand All @@ -3249,6 +3255,12 @@ AS_HELP_STRING([--enable-hidapi], [use HIDAPI for low level joystick drivers [[d
if test x$onlylibusb = xyes; then
SOURCES="$SOURCES $srcdir/src/hidapi/libusb/hid.c"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LIBUSB_LIBS"
elif test x$have_libusb_h != xyes ; then
case "$host" in
*-*-darwin* )
SOURCES="$SOURCES $srcdir/src/hidapi/mac/hid.c"
;;
esac
else
if test x$have_loadso != xyes; then
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic libusb loading])
Expand Down

0 comments on commit 59ea073

Please sign in to comment.