diff --git a/config/c-library.m4 b/config/c-library.m4
index 4990b2366efb472cc1639c9c89ffaca8a93d6ca5..10a91d43b4ff3e3a6ec1b56eb23ece98cbcff192 100644
--- a/config/c-library.m4
+++ b/config/c-library.m4
@@ -1,5 +1,5 @@
# Macros that test various C library quirks
-# $Header: /cvsroot/pgsql/config/c-library.m4,v 1.12 2002/03/29 17:32:53 petere Exp $
+# $Header: /cvsroot/pgsql/config/c-library.m4,v 1.13 2002/03/30 00:59:52 petere Exp $
# PGAC_VAR_INT_TIMEZONE
@@ -66,7 +66,7 @@ AC_SUBST(MEMCMP)dnl
# If it doesn't then one could define it as
# union semun { int val; struct semid_ds *buf; unsigned short *array; }
AC_DEFUN([PGAC_UNION_SEMUN],
-[AC_CHECK_TYPE([union semun], [], [],
+[AC_CHECK_TYPES([union semun], [], [],
[#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>])])# PGAC_UNION_SEMUN
diff --git a/configure b/configure
index e91d2388688286e1f69ed7e8dae2bce3ce2f2290..558f780cf11edf18ad7a37fcead9361c9457be0a 100755
--- a/configure
+++ b/configure
@@ -7455,8 +7455,7 @@ done
-
-for ac_header in crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h pwd.h strings.h sys/ipc.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/un.h termios.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 pwd.h sys/ipc.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/un.h termios.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
@@ -7698,6 +7697,7 @@ else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
+$ac_includes_default
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
@@ -9164,6 +9164,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_type_union_semun" >&5
echo "${ECHO_T}$ac_cv_type_union_semun" >&6
+if test $ac_cv_type_union_semun = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UNION_SEMUN 1
+_ACEOF
+
+
+fi
echo "$as_me:$LINENO: checking for struct sockaddr_un" >&5
echo $ECHO_N "checking for struct sockaddr_un... $ECHO_C" >&6
diff --git a/configure.in b/configure.in
index c4a03c52a39d02f6a039319573e3447af9d70669..ebc4b87b7276478719f373ee0af3980aed27b342 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $Header: /cvsroot/pgsql/configure.in,v 1.172 2002/03/30 00:20:15 petere Exp $
+dnl $Header: /cvsroot/pgsql/configure.in,v 1.173 2002/03/30 00:59:52 petere Exp $
dnl Developers, please strive to achieve this order:
dnl
@@ -759,7 +759,8 @@ AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h pwd.h sys/
# netinet/in.h is included first.
AC_CHECK_HEADERS([netinet/in.h])
AC_CHECK_HEADERS([netinet/tcp.h], [], [],
-[#ifdef HAVE_NETINET_IN_H
+[AC_INCLUDES_DEFAULT
+#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
])