aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schink <jaylink-dev@marcschink.de>2017-01-03 11:36:45 +0100
committerMarc Schink <jaylink-dev@marcschink.de>2017-07-12 14:30:15 +0200
commit39a06e9feadc7d153e7f07ffacf3180d26ce18a9 (patch)
tree5a50ce745a1fa657c8439279ebe761f23fe259a6
parentdf1dbe3ded5cbdeb75c9c67049f989b8448cc457 (diff)
configure.ac: Add switch to disable libusb support
Signed-off-by: Marc Schink <jaylink-dev@marcschink.de>
-rw-r--r--configure.ac27
1 files changed, 18 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 916291c..e63400c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,17 +54,8 @@ PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.9],
[HAVE_LIBUSB=yes], [HAVE_LIBUSB=no])
AS_IF([test "x$HAVE_LIBUSB" = "xyes"],
- [AC_DEFINE([HAVE_LIBUSB], [1], [Define to 1 if libusb is available.])])
-
-AS_IF([test "x$HAVE_LIBUSB" = "xyes"],
- [JAYLINK_PKG_LIBS="libusb-1.0"])
-
-AS_IF([test "x$HAVE_LIBUSB" = "xyes"],
[libusb_msg="yes"], [libusb_msg="no (missing: libusb-1.0)"])
-AM_CONDITIONAL([HAVE_LIBUSB],
- [test "x$HAVE_LIBUSB" = "xyes"])
-
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
@@ -88,6 +79,24 @@ AC_ARG_ENABLE([subproject-build], AS_HELP_STRING([--enable-subproject-build],
AM_CONDITIONAL([SUBPROJECT_BUILD],
[test "x$enable_subproject_build" = "xyes"])
+AC_ARG_WITH([libusb], [AS_HELP_STRING([--without-libusb],
+ [disable libusb support [default=detect]])])
+
+AS_IF([test "x$with_libusb" != "xno"],
+ [with_libusb="yes"])
+
+AS_IF([test "x$with_libusb$HAVE_LIBUSB" = "xyesyes"],
+ [AC_DEFINE([HAVE_LIBUSB], [1], [Define to 1 if libusb is available.])])
+
+AS_IF([test "x$with_libusb" != "xyes"],
+ [libusb_msg="no (disabled)"])
+
+AS_IF([test "x$with_libusb$HAVE_LIBUSB" = "xyesyes"],
+ [JAYLINK_PKG_LIBS="libusb-1.0"])
+
+AM_CONDITIONAL([HAVE_LIBUSB],
+ [test "x$with_libusb$HAVE_LIBUSB" = "xyesyes"])
+
# Libtool interface version is not used for sub-project build as libjaylink is
# built as libtool convenience library.
AS_IF([test "x$enable_subproject_build" != "xyes"],