diff --git a/ChangeLog b/ChangeLog index 80c5ae07..65561683 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-01-18 Joerg Wunsch + + Submitted by Simone: + patch #8128: Added new option to configure.ac script + * configure.ac (disable-libusb_1_0): New option + 2018-01-18 Joerg Wunsch Submitted by Jan Egil Ruud: diff --git a/NEWS b/NEWS index 2dd31129..73125fc1 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ Current: - TPI support for USBtinyISP - AVR Doper uses libhidapi rather than raw libusb (patch #9033) - -P net:host:port can use IPv6 now (Posix systems only) + - New configure option: -disable-libusb_1_0 * New devices supported: @@ -62,6 +63,7 @@ Current: patch #9185: Add extended_param to usbasp.c - erasing patch #8311: Add IPv6 support to the -Pnet:host:port option patch #9542: Correct "usersig" on avr8x devices + patch #8128: Added new option to configure.ac script * Internals: - New avrdude.conf keyword "family_id", used to verify SIB attributes diff --git a/configure.ac b/configure.ac index c049be31..4c0d9f43 100644 --- a/configure.ac +++ b/configure.ac @@ -115,10 +115,22 @@ if test x$have_libusb = xyes; then fi AC_SUBST(LIBUSB, $LIBUSB) +AC_ARG_ENABLE( + [libusb_1_0], + AC_HELP_STRING( + [--disable-libusb_1_0], + [Allow to build with libusb instead of libusb_1_0 if both are present]), + [case "${enableval}" in + yes) enabled_libusb_1_0=yes ;; + no) enabled_libusb_1_0=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for enable-libusb_1_0 option) ;; + esac], + [enabled_libusb_1_0=yes]) + AH_TEMPLATE([HAVE_LIBUSB_1_0], [Define if USB support is enabled via libusb 1.0]) AC_CHECK_LIB([usb-1.0], [libusb_init], [have_libusb_1_0=yes]) -if test x$have_libusb_1_0 = xyes; then +if test x$have_libusb_1_0 = xyes && test x$enabled_libusb_1_0 = xyes; then case $target in *-*-darwin*) LIBUSB_1_0="-lusb-1.0 -framework CoreFoundation -framework IOKit" @@ -134,7 +146,7 @@ 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 +if test x$have_libusb_1_0 = xyes test x$have_libusb_1_0 = xyes; then case $target in *-*-freebsd*) # FreeBSD 8+ has a native libusb-1.0 API compatible @@ -517,7 +529,11 @@ else fi if test x$have_libusb_1_0 = xyes; then - echo "DO HAVE libusb_1_0" + if test x$enabled_libusb_1_0 = xyes; then + echo "DO HAVE libusb_1_0" + else + echo "DISABLED libusb_1_0" + fi else echo "DON'T HAVE libusb_1_0" fi