Talk about punting and not going to any trouble to DTRT:
contrib/binutils/include/getopt.h
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */
so manually define HAVE_DECL_GETOPT since configure doesn't offer any way
to set it... and its unistd.h not stdlib.h dang it.