Browse Source

configure: Add --without-libusb option to explicitly disable using it

Luke Dashjr 12 years ago
parent
commit
97c8deaa8c
2 changed files with 17 additions and 3 deletions
  1. 1 0
      README
  2. 16 3
      configure.ac

+ 1 - 0
README

@@ -160,6 +160,7 @@ BFGMiner specific configuration options:
 	                        (default enabled)
 	--without-libevent      Compile support for libevent stratum server (default
 	                        enabled)
+	--without-libusb        Compile using libusb (default enabled)
 	--without-libudev       Autodetect FPGAs using libudev (default enabled)
 
 Basic *nix build instructions:

+ 16 - 3
configure.ac

@@ -495,6 +495,12 @@ PKG_PROG_PKG_CONFIG()
 
 libusb=no
 libusb_include_path=""
+AC_ARG_WITH([libusb],
+	[AC_HELP_STRING([--without-libusb],[Compile using libusb (default enabled)])],
+	[want_libusb=$withval],
+	[want_libusb=yes]
+	)
+if test "x$want_libusb" = "xyes"; then
 PKG_CHECK_MODULES([LIBUSB], [libusb-1.0],[
 	libusb=yes
 ],[
@@ -521,6 +527,7 @@ PKG_CHECK_MODULES([LIBUSB], [libusb-1.0],[
 			],[#include <libusb.h>])
 	fi
 ])
+fi
 
 driverlist="$driverlist klondike"
 AC_ARG_ENABLE([klondike],
@@ -528,7 +535,9 @@ AC_ARG_ENABLE([klondike],
 	[klondike=$enableval],
 	[klondike=auto]
 	)
-if test "x$klondike$libusb" = xyesno; then
+if test "x$klondike$want_libusb" = xyesno; then
+	AC_MSG_ERROR([You disabled libusb, required for Klondike support])
+elif test "x$klondike$libusb" = xyesno; then
 	AC_MSG_ERROR([Could not find libusb, required for Klondike support])
 elif test "x$klondike" = xauto; then
 	klondike="$libusb"
@@ -551,7 +560,9 @@ AC_ARG_ENABLE([x6500],
 	[x6500=$enableval],
 	[x6500=auto]
 	)
-if test "x$x6500$libusb" = xyesno; then
+if test "x$x6500$want_libusb" = xyesno; then
+	AC_MSG_ERROR([You disabled libusb, required for X6500 support])
+elif test "x$x6500$libusb" = xyesno; then
 	AC_MSG_ERROR([Could not find libusb, required for X6500 support])
 elif test "x$x6500" = xauto; then
 	x6500="$libusb"
@@ -575,7 +586,9 @@ AC_ARG_ENABLE([ztex],
 	[ztex=$enableval],
 	[ztex=auto]
 	)
-if test "x$ztex$libusb" = xyesno; then
+if test "x$ztex$want_libusb" = xyesno; then
+	AC_MSG_ERROR([You disabled libusb, required for ZTEX support])
+elif test "x$ztex$libusb" = xyesno; then
 	AC_MSG_ERROR([Could not find libusb, required for ZTEX support])
 elif test "x$ztex" = xauto; then
 	ztex="$libusb"