[sr #110530] Missing #include <string.h> in AC_FUNC_MEMCMP

Paul Eggert <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
Update of sr #110530 (project autoconf):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 
        Operating System:                  Mac OS => None                   

    _______________________________________________________

Follow-up Comment #10:

> However, *none* of that should affect AC_FUNC_MEMCMP, because it *doesn't*
use either of those, and string.h is (or should be) automatically included via
AC_INCLUDES_DEFAULT.  Something else must be wrong.
Yes, the thing that's wrong is that the configure.ac in question is busted: it
has an AC_CHECK_HEADER nested inside a shell "if", and AC_CHECK_HEADERS's
prerequisites are thus being skipped which means HAVE_STRING_H isn't set.
Here's a simple fix:


diff --git a/configure.ac b/configure.ac
index 233b7b1..77c1ac0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,7 +37,8 @@ if test "$disable_libusb_1_0" = "no"; then
   fi
 fi
 
-if test "$have_libusb_1_0" = "no"; then
+AS_IF([test "$have_libusb_1_0" = "no"],
+[
   dnl Fallback to the old libusb
   dnl libusb >= 0.1.8 is required, as we need usb_interrupt_read()
   AS_ECHO("using libusb");
@@ -45,7 +46,7 @@ if test "$have_libusb_1_0" = "no"; then
                   AC_CHECK_LIB(usb, usb_interrupt_read,
                                [LIBS="$LIBS -lusb"
                                 HAVE_USB=yes]))
-fi
+])
 
 dnl The following logic is useful for distributions.  If they force
 dnl USB support with --enable-libusb=yes then configure will fail


I'd report this to dfu-programmer except I don't see where the project says
how to report bugs and I've spent too much time on this already. There are
lots of other problems with that configure.ac: current Autoconf generates a
blizzard of warnings about it.

Perhaps somebody else has the time to figure out how to report the fix and
further problems to the dfu-programmer developers. In the meantime I'm closing
the Autoconf bug report, as this is not an Autoconf bug.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?110530>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.