Revert "Find libusb-1.0 using pkg-config and correct the libusb.h #include path" This reverts commit 171c3d0c72e749bc9d82a6742955119decf7b09c. Rollback breakage.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
diff --git a/configure.ac b/configure.ac
index 8c235d0..0a2bbc0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -343,14 +343,16 @@ if test "x$bitforce$modminer" != xnono; then
fi
AM_CONDITIONAL([HAVE_LIBUDEV], [test x$libudev != xno])
-PKG_PROG_PKG_CONFIG()
-
if test "x$ztex" != xno; then
- PKG_CHECK_MODULES(LIBUSB, libusb-1.0, [AC_DEFINE(HAVE_LIBUSB, 1, [Define if you have libusb-1.0])], [AC_MSG_ERROR([Could not find usb library - please install libusb-1.0])])
- USB_LIBS="$LIBUSB_LIBS"
- USB_FLAGS="$LIBUSB_CFLAGS"
+ AC_CHECK_LIB(usb-1.0, libusb_init, ,
+ AC_MSG_ERROR([Could not find usb library - please install libusb]))
+ AC_DEFINE([HAVE_LIBUSB], [1], [Defined to 1 if libusb is wanted])
+ USB_LIBS="-lusb-1.0"
+ USB_FLAGS=""
fi
+PKG_PROG_PKG_CONFIG()
+
PKG_CHECK_MODULES([LIBCURL], [libcurl >= 7.18.2], ,[AC_MSG_ERROR([Missing required libcurl dev >= 7.18.2])])
AC_SUBST(LIBCURL_LIBS)
diff --git a/libztex.h b/libztex.h
index 4b5dab3..d424545 100644
--- a/libztex.h
+++ b/libztex.h
@@ -22,7 +22,7 @@
#ifndef __LIBZTEX_H__
#define __LIBZTEX_H__
-#include <libusb.h>
+#include <libusb-1.0/libusb.h>
#define LIBZTEX_MAX_DESCRIPTORS 512
#define LIBZTEX_SNSTRING_LEN 10
diff --git a/miner.h b/miner.h
index f098e23..7d261c5 100644
--- a/miner.h
+++ b/miner.h
@@ -103,7 +103,7 @@ static inline int fsync (int fd)
#endif
#ifdef HAVE_LIBUSB
- #include <libusb.h>
+ #include <libusb-1.0/libusb.h>
#endif
#ifdef USE_ZTEX