libusb: require pkg-config support
[openocd.git] / configure.ac
index c7700dc3157b2bdce73b12dada2c2e89e87cd527..7f49ba05a99ca26cd48f0c7eb6fd1ccaeda28082 100644 (file)
@@ -19,6 +19,7 @@ AC_PROG_CC
 AC_PROG_CC_C99
 AM_PROG_CC_C_O
 AC_PROG_RANLIB
+PKG_PROG_PKG_CONFIG([0.23])
 
 dnl disable checks for C++, Fortran and GNU Java Compiler
 m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
@@ -1175,10 +1176,10 @@ fi
 # check for libusb library if necessary
 use_libusb1=no
 if test $need_usb = yes -o $need_usb_ng = yes; then
-  AC_CHECK_HEADER([libusb-1.0/libusb.h], [
-       AC_DEFINE([HAVE_LIBUSB1], [1], [Define if you have libusb-1.x])
+  PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0], [
        use_libusb1=yes
-       AC_SEARCH_LIBS([libusb_error_name], [usb-1.0],
+       AC_DEFINE([HAVE_LIBUSB1], [1], [Define if you have libusb-1.x])
+       PKG_CHECK_EXISTS([libusb-1.0 >= 1.0.9],
                [AC_DEFINE([HAVE_LIBUSB_ERROR_NAME], [1], [Define if your libusb has libusb_error_name()])],
                [AC_MSG_WARN([libusb-1.x older than 1.0.9 detected, consider updating])])
   ], [
@@ -1193,11 +1194,9 @@ fi
 
 use_libusb0=no
 if test $need_usb0 = yes; then
-       AC_CHECK_HEADERS([usb.h], [
-                       use_libusb0=yes
-               ], [
-                       AC_MSG_ERROR([libusb-0.1 is required to build some OpenOCD driver(s)])
-               ])
+       PKG_CHECK_MODULES([LIBUSB0], [libusb], [use_libusb0=yes], [
+               AC_MSG_ERROR([libusb-0.1 is required to build some OpenOCD driver(s)])
+       ])
 fi
 
 AM_CONDITIONAL([RELEASE], [test $build_release = yes])

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)