According to a comment on /usr/include/getopt.h on
FreeBSD, NetBSD introduced getopt.h on year 2000 and
the code was picked by FreeBSD too. Since FreeBSD
doesn't use the GNU library, I added BSD4_4 to the
cases where getopt.h exists.
While here I attempted to clean a bit the mess ;).
getopt cleanup