Don't rely on availability of getopt_long
diff --git a/configure.ac b/configure.ac
index 8f7f5fd..bbc57c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -267,6 +267,11 @@
 		[AC_MSG_ERROR([Either open_memstream or tmpfile required.])])])
 
 #
+# Define HAVE_GETOPT_LONG if that is available.
+#
+AC_CHECK_HEADER([getopt.h], [AC_CHECK_FUNCS([getopt_long])])
+
+#
 # Debugging
 #
 AC_MSG_CHECKING([whether to enable debugging])