Permalink
Browse files

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
  • Loading branch information...
1 parent 0a9014e commit cd0227d4984cea8845847b49184cc75b60c135bf Joerg Wunsch committed Aug 25, 2011
Showing with 26 additions and 0 deletions.
  1. +6 −0 ChangeLog
  2. +20 −0 configure.ac
View
@@ -1,5 +1,11 @@
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>
+
Submitted by Doug Springer, based on work by
Wolfgang Moser, Ville Voipio, Hannes Weisbach
patch #7486: Patch to add FT2232C/D, FT2232H, FT4232H,
View
@@ -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])

0 comments on commit cd0227d

Please sign in to comment.