* configure.ac: Improve the detection of the Win32 HID library,

and the presence of the header ddk/hidsdi.h.  It now works
correctly under Cygwin and several flavours of MinGW.

* Makefile.am: Add new LIBHID pattern.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@719 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2007-01-12 22:41:05 +00:00
parent 2e7333d3cc
commit 6aed88281a
3 changed files with 34 additions and 22 deletions

View File

@ -1,3 +1,10 @@
2007-01-12 Joerg Wunsch <j@uriah.heep.sax.de>
* configure.ac: Improve the detection of the Win32 HID library,
and the presence of the header ddk/hidsdi.h. It now works
correctly under Cygwin and several flavours of MinGW.
* Makefile.am: Add new LIBHID pattern.
2007-01-11 Joerg Wunsch <j@uriah.heep.sax.de>
* butterfly.c (butterfly_initialize): when sending the 'T'

View File

@ -47,7 +47,7 @@ avrdude_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\"
avrdude_CFLAGS = @ENABLE_WARNINGS@
avrdude_LDADD = @LIBUSB@
avrdude_LDADD = @LIBUSB@ @LIBHID@
bin_PROGRAMS = avrdude

View File

@ -60,16 +60,36 @@ if test x$have_libusb = xyes; then
fi
AC_SUBST(LIBUSB, $LIBUSB)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([limits.h stdlib.h string.h])
AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/time.h termios.h unistd.h])
AC_CHECK_HEADERS([ddk/hidsdi.h],,,[#include <windows.h>
#include <setupapi.h>])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_TIME
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset select strcasecmp strdup strerror strncasecmp strtol strtoul gettimeofday])
AC_MSG_CHECKING([for a Win32 HID libray])
SAVED_LIBS="${LIBS}"
case $target in
*-*-mingw32*)
*-*-mingw32* | *-*-cygwin* | *-*-windows*)
LIBHID="-lhid -lsetupapi"
if test $ac_cv_header_ddk_hidsdi_h = yes
then
HIDINCLUDE="#include <ddk/hidsdi.h>"
else
HIDINCLUDE="#include \"my_ddk_hidsdi.h\""
fi
;;
*)
LIBHID="-lhid"
HIDINCLUDE='#include "my_ddk_hidsdi.h"'
LIBHID=""
;;
esac
LIBS="${LIBS} ${LIBHID}"
@ -96,22 +116,7 @@ else
LIBHID=""
fi
LIBS="${SAVED_LIBS}"
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([limits.h stdlib.h string.h])
AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/time.h termios.h unistd.h])
AC_CHECK_HEADERS([ddk/hidsdi.h],,,[#include <windows.h>
#include <setupapi.h>])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_TIME
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset select strcasecmp strdup strerror strncasecmp strtol strtoul gettimeofday])
AC_SUBST(LIBHID, $LIBHID)
# Checks for misc stuff.
@ -232,7 +237,7 @@ export confsubst
case $target in
*-*-mingw32* | *-*-cygwin* | *-*-windows*)
WINDOWS_DIRS="windows"
CFLAGS="-mno-cygwin -DWIN32NATIVE"
CFLAGS="${CFLAGS} -mno-cygwin -DWIN32NATIVE"
LDFLAGS="${LDFLAGS} -static"
;;
esac