fix AC_CHECK_HEADER for libusb.h

main
Ozkan Sezer 2021-01-19 14:55:20 +03:00
parent 4fbb9f31ab
commit 282558379e
2 changed files with 9 additions and 7 deletions

8
configure vendored
View File

@ -24574,15 +24574,17 @@ else
$as_echo "yes" >&6; }
have_libusb=yes
fi
save_CFLAGS="$CFLAGS"
CFLAGS="$save_CFLAGS $LIBUSB_CFLAGS"
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$save_CPPFLAGS $LIBUSB_CFLAGS"
ac_fn_c_check_header_mongrel "$LINENO" "libusb.h" "ac_cv_header_libusb_h" "$ac_includes_default"
if test "x$ac_cv_header_libusb_h" = xyes; then :
have_libusb_h=yes
else
have_libusb_h=no
fi
CFLAGS="$save_CFLAGS"
CPPFLAGS="$save_CPPFLAGS"
if test x$have_libusb_h = xno && test x$require_hidapi_libusb = xyes; then
hidapi_support=no
fi

View File

@ -3415,10 +3415,10 @@ AS_HELP_STRING([--enable-hidapi-libusb], [use libusb for low level joystick driv
hidapi_support=yes
if test x$enable_hidapi_libusb = xyes; then
PKG_CHECK_MODULES([LIBUSB], [libusb-1.0], have_libusb=yes, have_libusb=no)
save_CFLAGS="$CFLAGS"
CFLAGS="$save_CFLAGS $LIBUSB_CFLAGS"
AC_CHECK_HEADER(libusb.h, have_libusb_h=yes)
CFLAGS="$save_CFLAGS"
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$save_CPPFLAGS $LIBUSB_CFLAGS"
AC_CHECK_HEADER(libusb.h, have_libusb_h=yes, have_libusb_h=no)
CPPFLAGS="$save_CPPFLAGS"
if test x$have_libusb_h = xno && test x$require_hidapi_libusb = xyes; then
hidapi_support=no
fi