From a061a3f62f540d8bc5ad53a63880186810d14d09 Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Thu, 24 Jun 2004 18:55:21 +0000
Subject: [PATCH] Avoid including <sys/time.h> on platforms that don't have it.
 Per trouble report from Andreas Pflug.

---
 configure                    | 3 ++-
 configure.in                 | 4 ++--
 src/include/libpq/libpq-be.h | 5 +++--
 src/include/pg_config.h.in   | 3 +++
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 1069a016eec..bbc28a5e417 100755
--- a/configure
+++ b/configure
@@ -6957,7 +6957,8 @@ done
 
 
 
-for ac_header in crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h poll.h pwd.h sys/ipc.h sys/poll.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/un.h termios.h utime.h wchar.h wctype.h kernel/OS.h kernel/image.h SupportDefs.h
+
+for ac_header in crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h poll.h pwd.h sys/ipc.h sys/poll.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/time.h sys/un.h termios.h utime.h wchar.h wctype.h kernel/OS.h kernel/image.h SupportDefs.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
diff --git a/configure.in b/configure.in
index 676d7a532b7..32379becc2e 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-dnl $PostgreSQL: pgsql/configure.in,v 1.364 2004/06/16 03:01:32 momjian Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.365 2004/06/24 18:55:18 tgl Exp $
 dnl
 dnl Developers, please strive to achieve this order:
 dnl
@@ -670,7 +670,7 @@ fi
 ##
 
 dnl sys/socket.h is required by AC_FUNC_ACCEPT_ARGTYPES
-AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h poll.h pwd.h sys/ipc.h sys/poll.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/un.h termios.h utime.h wchar.h wctype.h kernel/OS.h kernel/image.h SupportDefs.h])
+AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h poll.h pwd.h sys/ipc.h sys/poll.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/time.h sys/un.h termios.h utime.h wchar.h wctype.h kernel/OS.h kernel/image.h SupportDefs.h])
 
 # At least on IRIX, cpp test for netinet/tcp.h will fail unless
 # netinet/in.h is included first.
diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h
index 45fc5bd76b3..b2a0ee9efbf 100644
--- a/src/include/libpq/libpq-be.h
+++ b/src/include/libpq/libpq-be.h
@@ -11,15 +11,16 @@
  * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/libpq/libpq-be.h,v 1.45 2004/05/21 05:08:04 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/libpq/libpq-be.h,v 1.46 2004/06/24 18:55:20 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
 #ifndef LIBPQ_BE_H
 #define LIBPQ_BE_H
 
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
-
+#endif
 #ifdef USE_SSL
 #include <openssl/ssl.h>
 #include <openssl/err.h>
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 5d3351a006d..73af75eaab4 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -496,6 +496,9 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
-- 
GitLab