That patch essentially negates the point of the test, which is that
getopt should be visible from unistd.h. I'd rather fix the problem than
nuke the test.
Could you explain what the Gnulib problem is here? I can't really see it
in your email. A self-contained example would help.
For what it's worth, I could not reproduce the problem on Fedora 26 by
doing this in Gnulib (this tells 'configure' to use Gnulib-supplied
getopt.h and getopt.c):
./gnulib-tool --create-testdir --dir foo getopt-posix
cd foo
./configure gl_cv_func_getopt_posix=no ac_cv_header_getopt_h=no
make
make check