From 6dff35135d4231b8973f0b5704109410f82fb572 Mon Sep 17 00:00:00 2001 From: joerg_wunsch Date: Thu, 25 Aug 2011 18:41:48 +0000 Subject: [PATCH] Add a check for FreeBSD's libusb-1.0 compatible library that is found in libusb.a/.so on FreeBSD 8+. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@980 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 6 ++++++ configure.ac | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5c5e24d1..b45324d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-08-25 Joerg Wunsch + + * configure.ac: Add a check for FreeBSD's libusb-1.0 + compatible library that is found in libusb.a/.so on + FreeBSD 8+. + 2011-08-25 Joerg Wunsch Submitted by Doug Springer, based on work by diff --git a/configure.ac b/configure.ac index 36c880e2..8a03792c 100644 --- a/configure.ac +++ b/configure.ac @@ -82,6 +82,26 @@ if test x$have_libusb_1_0 = xyes; then AC_CHECK_HEADERS([libusb-1.0/libusb.h]) AC_CHECK_HEADERS([libusb.h]) fi +AH_TEMPLATE([HAVE_LIBUSB_1_0], + [Define if USB support is enabled via a libusb-1.0 compatible libusb]) +AC_CHECK_LIB([usb], [libusb_init], [have_libusb_1_0=yes]) +if test x$have_libusb_1_0 = xyes; then + case $target in + *-*-freebsd*) + # FreeBSD 8+ has a native libusb-1.0 API compatible + # library offered by -lusb (which is also libusb-0.1 + # compatible). FreeBSD <8 does not have a libusb-1.0 + # at all so probing will fail but we do not have to + # special-case that. + LIBUSB_1_0="-lusb" + ;; + *) + LIBUSB_1_0="-lusb-1.0" + ;; + esac + AC_DEFINE([HAVE_LIBUSB_1_0]) + AC_CHECK_HEADERS([libusb.h]) +fi AC_SUBST(LIBUSB_1_0, $LIBUSB_1_0) AH_TEMPLATE([HAVE_LIBFTDI], [Define if FTDI support is enabled via libftdi])