From c9acd2da12bc7fd01c7b81702d116594205f0e85 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Mon, 19 Jul 1999 01:18:05 +0000
Subject: [PATCH] Remove getopt configure check.

---
 src/configure.in                   | 1 -
 src/include/config.h.in            | 3 ---
 src/interfaces/ecpg/preproc/ecpg.c | 9 +++------
 3 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/configure.in b/src/configure.in
index 311c36bb22b..05ad2c2ea68 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -582,7 +582,6 @@ AC_CHECK_HEADERS(dld.h)
 AC_CHECK_HEADERS(endian.h)
 AC_CHECK_HEADERS(float.h)
 AC_CHECK_HEADERS(fp_class.h)
-AC_CHECK_HEADERS(getopt.h)
 AC_CHECK_HEADERS(history.h)
 AC_CHECK_HEADERS(ieeefp.h)
 AC_CHECK_HEADERS(limits.h)
diff --git a/src/include/config.h.in b/src/include/config.h.in
index 89a573d753e..fb1d566a09e 100644
--- a/src/include/config.h.in
+++ b/src/include/config.h.in
@@ -235,9 +235,6 @@
 /* Set to 1 if you have <fp_class.h> */
 #undef HAVE_FP_CLASS_H
 
-/* Set to 1 if you have <fp_class.h> */
-#undef HAVE_GETOPT
-
 /* Set to 1 if you have <history.h> */
 #undef HAVE_HISTORY_H
 
diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c
index a75adbcfc55..07fc820df87 100644
--- a/src/interfaces/ecpg/preproc/ecpg.c
+++ b/src/interfaces/ecpg/preproc/ecpg.c
@@ -2,14 +2,11 @@
 /* (C) Michael Meskes <meskes@debian.org> Feb 5th, 1998 */
 /* Placed under the same copyright as PostgresSQL */
 
+#include <unistd.h>
 #include "postgres.h"
 
-#ifdef HAVE_GETOPT_H
-#include <getopt.h>
-#else
-#include <unistd.h>
-extern int	optind;
-extern char *optarg;
+#ifdef __CYGWIN32__
+#include "getopt.h"
 #endif
 
 #include "extern.h"
-- 
GitLab