aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 7 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index c7700dc3..7f49ba05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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])