+Unreleased
+  * (bugfix) Fix compatibility issue with AIX (#69, @blentzgh)
+
 2017-01-11  David Schweikert  <david@schweikert.ch>
   * Version 3.15
   * (bugfix) Fix compiler errors on platforms other than Linux (related
 
 #include <errno.h>
 #include <time.h>
 #include <signal.h>
-#include <getopt.h>
 #include <stdarg.h>
 
 #include "config.h"
 #include <netdb.h>
 #include <ctype.h>
 
+/* RS6000 hasn't getopt.h */
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#endif /* HAVE_GETOPT_H */
+
 /* RS6000 has sys/select.h */
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 
 extern char *optarg;
 extern int optind,opterr;
+#ifndef h_errno
 extern int h_errno;
+#endif
 
 #ifdef __cplusplus
 }