aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1998-02-18 01:26:02 +0000
committerMarc G. Fournier <scrappy@hub.org>1998-02-18 01:26:02 +0000
commit922ea913b114371113563b09e29929282e51b730 (patch)
tree265662b585364a1739412af5bb0c748e3b374e87 /src
parent6ab7e31efd6b9f37fdf2414f5ae4cd7ed7315e22 (diff)
downloadpostgresql-922ea913b114371113563b09e29929282e51b730.tar.gz
postgresql-922ea913b114371113563b09e29929282e51b730.zip
Check for and include <getopt.h>
Diffstat (limited to 'src')
-rw-r--r--src/configure.in2
-rw-r--r--src/include/config.h.in3
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.c6
3 files changed, 9 insertions, 2 deletions
diff --git a/src/configure.in b/src/configure.in
index 8b86ede2bbb..5654ea2d578 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -419,7 +419,7 @@ dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(limits.h unistd.h termios.h values.h sys/select.h)
-AC_CHECK_HEADERS(sys/resource.h netdb.h arpa/inet.h)
+AC_CHECK_HEADERS(sys/resource.h netdb.h arpa/inet.h getopt.h)
AC_CHECK_HEADERS(readline.h history.h dld.h crypt.h endian.h float.h)
AC_CHECK_HEADERS(readline/history.h ieeefp.h fp_class.h)
diff --git a/src/include/config.h.in b/src/include/config.h.in
index 5a3893feaab..abde7c5f658 100644
--- a/src/include/config.h.in
+++ b/src/include/config.h.in
@@ -14,6 +14,9 @@
* The following is set using configure.
*/
+/* Set to 1 if you have <getopt.h> */
+#undef HAVE_GETOPT_H
+
/* Set to 1 if you have <fp_class.h> */
#undef HAVE_FP_CLASS_H
diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c
index a06c27b24eb..c5d7beeece3 100644
--- a/src/interfaces/ecpg/preproc/ecpg.c
+++ b/src/interfaces/ecpg/preproc/ecpg.c
@@ -3,7 +3,11 @@
/* Placed under the same copyright as PostgresSQL */
#include <stdio.h>
-#include <getopt.h>
+#if HAVE_GETOPT_H
+# include <getopt.h>
+#else
+# include <unistd.h>
+#endif
#include <stdlib.h>
#include <strings.h>