Hi Paul,
> - AC_CHECK_DECLS([optreset], [],
> - [AC_CHECK_DECLS([getopt_clip], [], [],
> - [[#include <getopt.h>]])
> - ],
> - [[#include <getopt.h>]])
...
> + AC_COMPILE_IFELSE(
> + [AC_LANG_PROGRAM(
> + [[#include <unistd.h>]],
> + [[int *p = &optreset; return optreset;]])],
Is it intentional that you replaced the #include <getopt.h> with
#include <unistd.h>?
As far as I can see, all platform that have this variable declare it in both
<getopt.h> and <unistd.h>:
- On MacOS X 10.3, FreeBSD 5.2.1, and NetBSD 5.0, optreset is declared in
<unistd.h> but <getopt.h> #includes <unistd.h>.
- On Cygwin 1.5.x, optreset is declared in <getopt.h> but <unistd.h> includes
<sys/unistd.h> which includes <getopt.h>.
- On mingw, optreset is declared in <getopt.h> but <unistd.h> includes it.
Is it because of the BSD manual pages [1]?
Bruno
[1] http://fuse4bsd.creo.hu/localcgi/man-cgi.cgi?getopt+3