From 57db10acf0aafa3fa5160a8f5c869d5e0ae51796 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Sun, 9 Oct 2011 19:54:25 +0000 Subject: [PATCH] m4/libusb: search for "libusb-legacy" module if "libusb" module is not found --- m4/libnfc_check_libusb.m4 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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)