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
This commit is contained in:
Joerg Wunsch 2011-08-25 18:41:48 +00:00
parent 46c7bf38ec
commit 65c37a3374
2 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2011-08-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* 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 <j.gnu@uriah.heep.sax.de> 2011-08-25 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
Submitted by Doug Springer, based on work by Submitted by Doug Springer, based on work by

View File

@ -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-1.0/libusb.h])
AC_CHECK_HEADERS([libusb.h]) AC_CHECK_HEADERS([libusb.h])
fi 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) AC_SUBST(LIBUSB_1_0, $LIBUSB_1_0)
AH_TEMPLATE([HAVE_LIBFTDI], AH_TEMPLATE([HAVE_LIBFTDI],
[Define if FTDI support is enabled via libftdi]) [Define if FTDI support is enabled via libftdi])