(Obtained from patch #8717: pattch for mcprog and libhidapi support)

* configure.ac: Probe for libhidapi
* Makefile.am: Add @LIBHIDAPI@




git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1380 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2016-02-17 21:48:37 +00:00
parent aac9fc6365
commit 45cdd4a906
3 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2016-02-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
(Obtained from patch #8717: pattch for mcprog and libhidapi support)
* configure.ac: Probe for libhidapi
* Makefile.am: Add @LIBHIDAPI@
2016-02-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de> 2016-02-16 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* doc/avrdude.texi: Bump copyright year. * doc/avrdude.texi: Bump copyright year.

View File

@ -66,7 +66,7 @@ avrdude_CFLAGS = @ENABLE_WARNINGS@
libavrdude_a_CFLAGS = @ENABLE_WARNINGS@ libavrdude_a_CFLAGS = @ENABLE_WARNINGS@
libavrdude_la_CFLAGS = $(libavrdude_a_CFLAGS) libavrdude_la_CFLAGS = $(libavrdude_a_CFLAGS)
avrdude_LDADD = $(top_builddir)/$(noinst_LIBRARIES) @LIBUSB_1_0@ @LIBUSB@ @LIBFTDI1@ @LIBFTDI@ @LIBHID@ @LIBELF@ @LIBPTHREAD@ -lm avrdude_LDADD = $(top_builddir)/$(noinst_LIBRARIES) @LIBUSB_1_0@ @LIBHIDAPI@ @LIBUSB@ @LIBFTDI1@ @LIBFTDI@ @LIBHID@ @LIBELF@ @LIBPTHREAD@ -lm
bin_PROGRAMS = avrdude bin_PROGRAMS = avrdude

View File

@ -150,6 +150,25 @@ if test x$have_libusb_1_0 = xyes; then
AC_CHECK_HEADERS([libusb.h]) AC_CHECK_HEADERS([libusb.h])
fi fi
AC_SUBST(LIBUSB_1_0, $LIBUSB_1_0) AC_SUBST(LIBUSB_1_0, $LIBUSB_1_0)
AH_TEMPLATE([HAVE_LIBHIDAPI],
[Define if HID support is enabled via libhidapi])
AC_SEARCH_LIBS([hid_init], [hidapi hidapi-libusb hidapi-hidraw], [have_libhidapi=yes])
if test x$have_libhidapi = xyes; then
case $target in
*-*-darwin*)
LIBHIDAPI="-lhidapi -iframework CoreFoundation -framework IOKit"
;;
*)
LIBHIDAPI="$ac_cv_lib_hid_init"
;;
esac
AC_DEFINE([HAVE_LIBHIDAPI])
AC_CHECK_HEADERS([hidapi/hidapi.h])
fi
AC_SUBST(LIBHIDAPI, $LIBHIDAPI)
AH_TEMPLATE([HAVE_LIBFTDI1], AH_TEMPLATE([HAVE_LIBFTDI1],
[Define if FTDI support is enabled via libftdi1]) [Define if FTDI support is enabled via libftdi1])
AH_TEMPLATE([HAVE_LIBFTDI], AH_TEMPLATE([HAVE_LIBFTDI],
@ -521,6 +540,12 @@ else
echo "DON'T HAVE libhid" echo "DON'T HAVE libhid"
fi fi
if test x$have_libhidapi = xyes; then
echo "DO HAVE libhidapi"
else
echo "DON'T HAVE libhidapi"
fi
if test x$have_pthread = xyes; then if test x$have_pthread = xyes; then
echo "DO HAVE pthread" echo "DO HAVE pthread"
else else