diff --git a/m4/libnfc_check_libusb.m4 b/m4/libnfc_check_libusb.m4 index 9a02d8f..0d5b197 100644 --- a/m4/libnfc_check_libusb.m4 +++ b/m4/libnfc_check_libusb.m4 @@ -20,7 +20,7 @@ AC_DEFUN([LIBNFC_CHECK_LIBUSB], HAVE_LIBUSB=1 fi - # Search using pkg-config + # Search using libusb module using pkg-config if test x"$HAVE_LIBUSB" = "x0"; then if test x"$PKG_CONFIG" != "x"; then PKG_CHECK_MODULES([libusb], [libusb], [HAVE_LIBUSB=1], [HAVE_LIBUSB=0]) @@ -33,6 +33,19 @@ AC_DEFUN([LIBNFC_CHECK_LIBUSB], fi fi + # Search using libusb-legacy module using pkg-config + if test x"$HAVE_LIBUSB" = "x0"; then + if test x"$PKG_CONFIG" != "x"; then + PKG_CHECK_MODULES([libusb], [libusb-legacy], [HAVE_LIBUSB=1], [HAVE_LIBUSB=0]) + if test x"$HAVE_LIBUSB" = "x1"; then + if test x"$PKG_CONFIG_REQUIRES" != x""; then + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES," + fi + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libusb" + fi + fi + fi + # Search using libusb-config if test x"$HAVE_LIBUSB" = "x0"; then AC_PATH_PROG(libusb_CONFIG,libusb-config)