Commit d0c10b78beadc677d3079a8393db1f9af3d37195

Peter Stuge 2012-11-16T00:59:21

configure.ac: Don't use pkg-config to search for libusb-1.0 on FreeBSD

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/configure.ac b/configure.ac
index 8c235d0..d36b1ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -346,7 +346,15 @@ 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])])
+  case $target in
+    *-*-freebsd*)
+      LIBUSB_LIBS="-lusb"
+      LIBUSB_CFLAGS=""
+      ;;
+    *)
+      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])])
+      ;;
+  esac
   USB_LIBS="$LIBUSB_LIBS"
   USB_FLAGS="$LIBUSB_CFLAGS"
 fi