--- usbhid-dump/configure.ac | 7 +++---- usbhid-dump/include/uhd/dev.h | 2 +- usbhid-dump/include/uhd/libusb.h | 2 +- usbhid-dump/lib/Makefile.am | 2 ++ usbhid-dump/src/Makefile.am | 3 ++- usbhid-dump/src/usbhid-dump.c | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) --- a/usbhid-dump/lib/Makefile.am +++ b/usbhid-dump/lib/Makefile.am @@ -25,3 +25,5 @@ iface_list.c \ libusb.c \ str.c + +libuhd_la_CFLAGS = $(LIBUSB_CFLAGS) --- a/usbhid-dump/src/Makefile.am +++ b/usbhid-dump/src/Makefile.am @@ -19,4 +19,5 @@ bin_PROGRAMS = usbhid-dump usbhid_dump_SOURCES = usbhid-dump.c -usbhid_dump_LDADD = ../lib/libuhd.la +usbhid_dump_CFLAGS = $(LIBUSB_CFLAGS) +usbhid_dump_LDADD = ../lib/libuhd.la $(LIBUSB_LIBS) --- a/usbhid-dump/configure.ac +++ b/usbhid-dump/configure.ac @@ -48,10 +48,9 @@ # # Checks for libraries. # -AC_CHECK_LIB( - [usb-1.0], [libusb_init], [], - [AC_MSG_FAILURE([libusb is required, but was not found, abort. - Try installing libusb-1.0-0-dev or libusb1-devel.])]) +PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= 1.0.0) +AC_SUBST(LIBUSB_CFLAGS) +AC_SUBST(LIBUSB_LIBS) # # Checks for features --- a/usbhid-dump/include/uhd/libusb.h +++ b/usbhid-dump/include/uhd/libusb.h @@ -27,7 +27,7 @@ #ifndef __UHD_LIBUSB_H__ #define __UHD_LIBUSB_H__ -#include +#include #ifdef __cplusplus extern "C" { --- a/usbhid-dump/include/uhd/dev.h +++ b/usbhid-dump/include/uhd/dev.h @@ -28,7 +28,7 @@ #define __UHD_DEV_H__ #include -#include +#include #ifdef __cplusplus extern "C" { --- a/usbhid-dump/src/usbhid-dump.c +++ b/usbhid-dump/src/usbhid-dump.c @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include "config.h"