diff -purd postgresql-8.4.5-org/config.status postgresql-8.4.5/config.status
--- postgresql-8.4.5-org/config.status  2010-12-20 11:52:19 +0100
+++ postgresql-8.4.5/config.status      2010-12-20 12:04:26 +0100
@@ -567,7 +567,7 @@ s,@enable_dtrace@,|#_!!_#|no,g
 s,@CC@,|#_!!_#|cc -Ae,g
 s,@CFLAGS@,|#_!!_#|-Ae -z +Z +DD64 -O2,g
 s,@LDFLAGS@,|#_!!_#| -L/usr/local/ia64/lib -L/usr/lib/hpux64 -L/usr/contrib/X11R6/lib/hpux64 -s -L/usr/local/lib -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib ,g
-s,@CPPFLAGS@,|#_!!_#| -D_XOPEN_SOURCE_EXTENDED ,g
+s,@CPPFLAGS@,|#_!!_#| ,g
 s,@ac_ct_CC@,|#_!!_#|,g
 s,@EXEEXT@,|#_!!_#|,g
 s,@OBJEXT@,|#_!!_#|o,g
@@ -981,8 +981,8 @@ s,^\([       #]*\)[^         ]*\([   ]*SIZEOF_OFF_T\)
 s,^\([  #]*\)[^         ]*\([   ]*HAVE_INT_TIMEZONE\)[  (].*,\1define\2  ,
 s,^\([  #]*\)[^         ]*\([   ]*ACCEPT_TYPE_RETURN\)[         (].*,\1define\2 int ,
 s,^\([  #]*\)[^         ]*\([   ]*ACCEPT_TYPE_ARG1\)[   (].*,\1define\2 int ,
-s,^\([  #]*\)[^         ]*\([   ]*ACCEPT_TYPE_ARG2\)[   (].*,\1define\2 struct sockaddr * ,
-s,^\([  #]*\)[^         ]*\([   ]*ACCEPT_TYPE_ARG3\)[   (].*,\1define\2 size_t ,
+s,^\([  #]*\)[^         ]*\([   ]*ACCEPT_TYPE_ARG2\)[   (].*,\1define\2 void * ,
+s,^\([  #]*\)[^         ]*\([   ]*ACCEPT_TYPE_ARG3\)[   (].*,\1define\2 int ,
 s,^\([  #]*\)[^         ]*\([   ]*HAVE_CBRT\)[  (].*,\1define\2 1 ,
 s,^\([  #]*\)[^         ]*\([   ]*HAVE_DLOPEN\)[        (].*,\1define\2 1 ,
 s,^\([  #]*\)[^         ]*\([   ]*HAVE_FCVT\)[  (].*,\1define\2 1 ,
diff -purd postgresql-8.4.5-org/src/Makefile.global postgresql-8.4.5/src/Makefile.global
--- postgresql-8.4.5-org/src/Makefile.global    2010-12-20 11:52:19 +0100
+++ postgresql-8.4.5/src/Makefile.global        2010-12-20 12:05:17 +0100
@@ -199,8 +199,8 @@ DOCBOOK2MAN =

 # Compilers

-CPP = cc -Ae -E
-CPPFLAGS =  -D_XOPEN_SOURCE_EXTENDED
+CPP = cc -E
+CPPFLAGS =

 ifdef PGXS
 override CPPFLAGS := -I$(includedir_server) -I$(includedir_internal) $(CPPFLAGS)
@@ -211,7 +211,7 @@ override CPPFLAGS := -I$(top_builddir)/s
 endif
 endif # not PGXS

-CC = cc -Ae
+CC = cc
 GCC =
 SUN_STUDIO_CC = no
 CFLAGS = -Ae -z +Z +DD64 -O2
diff -purd postgresql-8.4.5-org/src/Makefile.port postgresql-8.4.5/src/Makefile.port
--- postgresql-8.4.5-org/src/Makefile.port      2010-10-01 15:35:31 +0200
+++ postgresql-8.4.5/src/Makefile.port  2010-12-20 11:58:53 +0100
@@ -8,7 +8,7 @@ endif
 # Using X/Open Networking Interfaces requires to link with libxnet.
 # Without specifying this, bind(), getpeername() and so on don't work
 # correctly in the LP64 data model.
-LIBS := -lxnet $(LIBS)
+#LIBS := -lxnet $(LIBS)

 # Set up rpath so that the executables don't need SHLIB_PATH to be set.
 # (Note: --disable-rpath is a really bad idea on this platform...)
diff -purd postgresql-8.4.5-org/src/include/pg_config.h postgresql-8.4.5/src/include/pg_config.h
--- postgresql-8.4.5-org/src/include/pg_config.h        2010-12-20 11:52:19 +0100
+++ postgresql-8.4.5/src/include/pg_config.h    2010-12-20 12:04:27 +0100
@@ -5,10 +5,10 @@
 #define ACCEPT_TYPE_ARG1 int

 /* Define to the type of arg 2 of 'accept' */
-#define ACCEPT_TYPE_ARG2 struct sockaddr *
+#define ACCEPT_TYPE_ARG2 void *

 /* Define to the type of arg 3 of 'accept' */
-#define ACCEPT_TYPE_ARG3 size_t
+#define ACCEPT_TYPE_ARG3 int

 /* Define to the return type of 'accept' */
 #define ACCEPT_TYPE_RETURN int
diff -purd postgresql-8.4.5-org/src/makefiles/Makefile.hpux postgresql-8.4.5/src/makefiles/Makefile.hpux
--- postgresql-8.4.5-org/src/makefiles/Makefile.hpux    2010-10-01 15:35:31 +0200
+++ postgresql-8.4.5/src/makefiles/Makefile.hpux        2010-12-20 11:58:53 +0100
@@ -8,7 +8,7 @@ endif
 # Using X/Open Networking Interfaces requires to link with libxnet.
 # Without specifying this, bind(), getpeername() and so on don't work
 # correctly in the LP64 data model.
-LIBS := -lxnet $(LIBS)
+#LIBS := -lxnet $(LIBS)

 # Set up rpath so that the executables don't need SHLIB_PATH to be set.
 # (Note: --disable-rpath is a really bad idea on this platform...)
diff -purd postgresql-8.4.5-org/src/template/hpux postgresql-8.4.5/src/template/hpux
--- postgresql-8.4.5-org/src/template/hpux      2010-10-01 15:35:31 +0200
+++ postgresql-8.4.5/src/template/hpux  2010-12-20 11:58:20 +0100
@@ -1,6 +1,6 @@
 # $PostgreSQL: pgsql/src/template/hpux,v 1.16 2006/12/12 19:43:19 petere Exp $

-CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
+#CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"

 if test "$GCC" != yes ; then
   CC="$CC -Ae"
