Updates avrftdi to use libftdi1

This includes adding libftdi1 to configure.ac and Makefile.am.
avrftdi code is changed to use libftdi1. At the same time device
discovery is moved to libftdi1. Some error and debug messages in
avrftdi are corrected and/or updated. avrftdi_print is updated,
to print all messages whose verbosity level is less or equal to
the global verbosity level, so that messages with level 0 are always
printed.
This change is tested on OS X 10.6.8, Ubuntu 12.04.2 and Win7 x86_64.
The Win7 version was cross-compiled on OS X 10.6.8.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1141 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Hannes Weisbach
2013-04-27 20:52:01 +00:00
parent 81a0c06013
commit 295b6f3711
4 changed files with 63 additions and 92 deletions

View File

@@ -152,12 +152,16 @@ AC_CHECK_LIB([ftdi], [ftdi_usb_get_strings], [have_libftdi=yes], [], [-lusb])
if test x$have_libftdi = xyes; then
LIBFTDI="-lftdi -lusb"
AC_DEFINE([HAVE_LIBFTDI])
AC_CHECK_DECL(TYPE_232H,[have_libftdi_FT232H=yes], [], [[#include <ftdi.h>]])
if test x$have_libftdi_FT232H = xyes; then
AC_DEFINE([HAVE_LIBFTDI_TYPE_232H])
fi
fi
AC_SUBST(LIBFTDI, $LIBFTDI)
AH_TEMPLATE([HAVE_LIBFTDI1],
[Define if FTDI support is enabled via libftdi1])
AC_CHECK_LIB([ftdi1], [ftdi_new], [have_libftdi1=yes], [], [-lusb-1.0])
if test x$have_libftdi1 = xyes; then
LIBFTDI1="-lftdi1"
AC_DEFINE([HAVE_LIBFTDI1])
fi
AC_SUBST(LIBFTDI1, $LIBFTDI1)
AC_CHECK_HEADERS([pthread.h])
# as there exits header file only pthread implementations for Windows, check if we have a library
AC_CHECK_LIB([pthread], [pthread_create], [have_pthread=yes])
@@ -488,6 +492,12 @@ else
echo "DON'T HAVE libftdi"
fi
if test x$have_libftdi1 = xyes; then
echo "DO HAVE libftdi1"
else
echo "DON'T HAVE libftdi1"
fi
if test x$have_libhid = xyes; then
echo "DO HAVE libhid"
else