+ dnl see if the pkgconfig module 'libusb' is available
+ PKG_CHECK_MODULES(USB, libusb, [
+ libusbok=yes
+ LIBUSB_PKG_CONFIG_NAME='libusb'
+ ], [libusbok=no])
+ dnl PKG_CHECK_MODULES does not work correctly when embedded
+ if test $libusbok = no; then
+ dnl if not, see if the pkgconfig module 'libusb-legacy' is available
+ PKG_CHECK_MODULES(USB, [libusb-legacy], [
+ libusbok=yes
+ LIBUSB_PKG_CONFIG_NAME='libusb-legacy'
+ ], [libusbok=no])
+ fi
+ dnl set variables for further testing
+ usb_header='usb.h'
+ usb_lib_func='usb_bulk_write'
+ usb_lib_name='usb'
+ fi
+ AC_SUBST(LIBUSB_PKG_CONFIG_NAME)
+ if test x$1 != xyes || test $have_libusb1 = yes; then
+ dnl Either (1) libusb1 was specified and found; or
+ dnl (2) libusb1 was not specified. Restart checking.
+ libusbok=yes