aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2013-05-31 14:57:56 +0400
committerSpencer Oliver <spen@spen-soft.co.uk>2013-06-12 14:40:16 +0000
commit71ee5f6b5f3172901135640de4ca827b14747465 (patch)
tree6c7ce79d61ecbeb613c5ff78281238ed1006dcb0 /configure.ac
parent703781c5abaa7e3a93e56e179c2eb4fca53b7550 (diff)
downloadriscv-openocd-71ee5f6b5f3172901135640de4ca827b14747465.zip
riscv-openocd-71ee5f6b5f3172901135640de4ca827b14747465.tar.gz
riscv-openocd-71ee5f6b5f3172901135640de4ca827b14747465.tar.bz2
libusb1_common, ftdi: clarify libusb_open error message
Print a user-friendly message when libusb_open() fails, e.g. Error: libusb_open() failed with LIBUSB_ERROR_ACCESS when there's a permissions problem. Also output a configure warning if libusb older than 1.0.9 is detected. Change-Id: I800f71f06672fe06c0a98a4e469f853b5021bcfe Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1430 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 8 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 4388573..2d50bee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1200,9 +1200,14 @@ use_libusb0=no
use_libusb1=no
if test $build_usb = yes -o $build_usb_ng = yes; then
if test $check_libusb0 = no -a $build_usb_ng = yes; then
- AC_CHECK_HEADER([libusb-1.0/libusb.h],
- [AC_DEFINE(HAVE_LIBUSB1, 1, [Define if you have libusb-1.0]) check_libusb0=no use_libusb1=yes ],
- [ check_libusb0=yes use_libusb1=no ])
+ AC_CHECK_HEADER([libusb-1.0/libusb.h], [
+ AC_DEFINE(HAVE_LIBUSB1, 1, [Define if you have libusb-1.0])
+ check_libusb0=no use_libusb1=yes
+ AC_SEARCH_LIBS([libusb_error_name], [usb-1.0],
+ [AC_DEFINE(HAVE_LIBUSB_ERROR_NAME, 1, [Define if your libusb has libusb_error_name()])],
+ [AC_MSG_WARN([libusb-1 older than 1.0.9 detected, consider updating])])
+ ], [
+ check_libusb0=yes use_libusb1=no ])
fi
if test $check_libusb0 = yes -o $build_usb = yes; then