From 275170eb46640787a4634b6301617166d584c0ae Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Sun, 13 Oct 2013 11:13:36 +0200 Subject: [PATCH] Use libusb-1.0 instead of libusb-0.1 --- m4/libnfc_check_libusb.m4 | 42 +++------------------------------------ 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/m4/libnfc_check_libusb.m4 b/m4/libnfc_check_libusb.m4 index 0d5b197..02e8365 100644 --- a/m4/libnfc_check_libusb.m4 +++ b/m4/libnfc_check_libusb.m4 @@ -7,23 +7,10 @@ AC_DEFUN([LIBNFC_CHECK_LIBUSB], if test x"$libusb_required" = "xyes"; then HAVE_LIBUSB=0 - AC_ARG_WITH([libusb-win32], - [AS_HELP_STRING([--with-libusb-win32], [use libusb-win32 from the following location])], - [LIBUSB_WIN32_DIR=$withval], - [LIBUSB_WIN32_DIR=""]) - - # --with-libusb-win32 directory have been set - if test "x$LIBUSB_WIN32_DIR" != "x"; then - AC_MSG_NOTICE(["use libusb-win32 from $LIBUSB_WIN32_DIR"]) - libusb_CFLAGS="-I$LIBUSB_WIN32_DIR/include" - libusb_LIBS="-L$LIBUSB_WIN32_DIR/lib/gcc -lusb" - HAVE_LIBUSB=1 - fi - # 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]) + PKG_CHECK_MODULES([libusb], [libusb-1.0], [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," @@ -33,33 +20,10 @@ 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) - if test x"$libusb_CONFIG" != "x" ; then - libusb_CFLAGS=`$libusb_CONFIG --cflags` - libusb_LIBS=`$libusb_CONFIG --libs` - HAVE_LIBUSB=1 - fi - fi - # Search the library and headers directly (last chance) if test x"$HAVE_LIBUSB" = "x0"; then - AC_CHECK_HEADER(usb.h, [], [AC_MSG_ERROR([The libusb headers are missing])]) - AC_CHECK_LIB(usb, libusb_init, [], [AC_MSG_ERROR([The libusb library is missing])]) + AC_CHECK_HEADER(libusb.h, [], [AC_MSG_ERROR([The libusb headers are missing])]) + AC_CHECK_LIB(usb-1.0, libusb_init, [], [AC_MSG_ERROR([The libusb library is missing])]) libusb_LIBS="-lusb" HAVE_LIBUSB=1