diff --git a/avrdude/ChangeLog b/avrdude/ChangeLog index 7e00cbc7..ca8859f1 100644 --- a/avrdude/ChangeLog +++ b/avrdude/ChangeLog @@ -1,3 +1,13 @@ +2012-01-20 Joerg Wunsch + + * configure.ac: Check for presence of lusb_usb.h as an alternative + to usb.h; libusb-win32 switched to this name in version 1.2.5.0. + * avrftdi.c: Decide whether to include , or . + * ser_avrdoper.c: (Dito.) + * usbasp.c: (Dito.) + * usb_libusb.c: (Dito.) + * usbtiny.c: (Dito.) + 2012-01-19 Rene Liebscher * avr.c: Unsigned variable was used for return code of paged_write/load diff --git a/avrdude/avrftdi.c b/avrdude/avrftdi.c index b968e93f..558b7975 100644 --- a/avrdude/avrftdi.c +++ b/avrdude/avrftdi.c @@ -42,7 +42,13 @@ #ifdef HAVE_LIBFTDI #include -#include +#if defined(HAVE_USB_H) +# include +#elif defined(HAVE_LUSB0_USB_H) +# include +#else +# error "libusb needs either or " +#endif /* This is for running the code without having a FTDI-device. * The generated code is useless! For debugging purposes only. diff --git a/avrdude/configure.ac b/avrdude/configure.ac index 2581c213..6d909163 100644 --- a/avrdude/configure.ac +++ b/avrdude/configure.ac @@ -69,6 +69,8 @@ if test x$have_libusb = xyes; then ;; esac AC_DEFINE([HAVE_LIBUSB]) + AC_CHECK_HEADERS([usb.h]) + AC_CHECK_HEADERS([lusb0_usb.h]) fi AC_SUBST(LIBUSB, $LIBUSB) diff --git a/avrdude/ser_avrdoper.c b/avrdude/ser_avrdoper.c index 5a8e59fa..375d2cc7 100644 --- a/avrdude/ser_avrdoper.c +++ b/avrdude/ser_avrdoper.c @@ -248,7 +248,13 @@ static int usbGetReport(union filedescriptor *fdp, int reportType, int reportNum /* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */ -#include +#if defined(HAVE_USB_H) +# include +#elif defined(HAVE_LUSB0_USB_H) +# include +#else +# error "libusb needs either or " +#endif /* ------------------------------------------------------------------------- */ diff --git a/avrdude/usb_libusb.c b/avrdude/usb_libusb.c index cc476a6d..2bb34b08 100644 --- a/avrdude/usb_libusb.c +++ b/avrdude/usb_libusb.c @@ -36,7 +36,13 @@ #include #include -#include +#if defined(HAVE_USB_H) +# include +#elif defined(HAVE_LUSB0_USB_H) +# include +#else +# error "libusb needs either or " +#endif #include "avrdude.h" #include "serial.h" diff --git a/avrdude/usbasp.c b/avrdude/usbasp.c index df5637b7..683cf72c 100644 --- a/avrdude/usbasp.c +++ b/avrdude/usbasp.c @@ -53,7 +53,13 @@ # include # endif #else -# include +# if defined(HAVE_USB_H) +# include +# elif defined(HAVE_LUSB0_USB_H) +# include +# else +# error "libusb needs either or " +# endif #endif #ifdef USE_LIBUSB_1_0 diff --git a/avrdude/usbtiny.c b/avrdude/usbtiny.c index 7fe8c857..e594ccdc 100644 --- a/avrdude/usbtiny.c +++ b/avrdude/usbtiny.c @@ -40,7 +40,13 @@ #include "usbtiny.h" #if defined(HAVE_LIBUSB) // we use LIBUSB to talk to the board -#include +#if defined(HAVE_USB_H) +# include +#elif defined(HAVE_LUSB0_USB_H) +# include +#else +# error "libusb needs either or " +#endif #ifndef HAVE_UINT_T typedef unsigned int uint_t;