Building some code on Android 9 that uses the getopt-gnu module, I found that HAVE_SYS_CDEFS_H was empty.
This looks wrong, but I see that it is set to empty on my GNU system which uses glibc, and hence doesn't need getopt replacing, so the value of HAVE_SYS_CDEFS_H (which is tested in getopt-cdefs.h) is not substituted after #if, where its emptiness causes a syntax error on Android.
Oddly, the config.log on Android suggests that sys/cdefs.h is indeed found.
So I'm not clear what the real problem is here.
Very happy to perform further debugging if anyone can give me any pointers as to what to look for!
(I was using a commit of gnulib from last year, and no relevant code seems to have changed since then, but I've tested with current git master HEAD just to confirm I get the same result.)