By default it defines LIBCGETOPT and tries to find getopt.h header in system include dir: gcc -c -DLIBCGETOPT=1 -DLOCALEDIR=\"/usr/local/share/locale\" -DNOT_UTIL_LINUX -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wmissing-declarations -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -O3 -fno-strength-reduce getopt.c -o getopt.o getopt.c:49:20: error: getopt.h: No such file or directory I was able to merge getopt with patch below.
Created attachment 205448 [details, diff] Patch to switch off LIBCGETOPT define
the way you did it, libcgetopt variable will always be 0, so it possibly breaks on other systems (having getopt in libc). always pay attention to not break others. i have now done it like this: [[ ${CHOST} == *-interix* ]] && libcgetopt=0 which turns it off on interix, and remains the same on all others.
>the way you did it, libcgetopt variable will always be 0, so it possibly breaks >on other systems (having getopt in libc). always pay attention to not break >others. Thanks, will pay more attention to it from now.