OSDN Git Service

Introduce compact WAL record for the common case of commit (non-DDL).
[pg-rex/syncrep.git] / configure
index edb15ee..9b8cb48 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for PostgreSQL 9.0devel.
+# Generated by GNU Autoconf 2.63 for PostgreSQL 9.2devel.
 #
 # Report bugs to <pgsql-bugs@postgresql.org>.
 #
@@ -9,7 +9,7 @@
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 #
-# Copyright (c) 1996-2010, PostgreSQL Global Development Group
+# Copyright (c) 1996-2011, PostgreSQL Global Development Group
 ## --------------------- ##
 ## M4sh Initialization.  ##
 ## --------------------- ##
@@ -598,8 +598,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='PostgreSQL'
 PACKAGE_TARNAME='postgresql'
-PACKAGE_VERSION='9.0devel'
-PACKAGE_STRING='PostgreSQL 9.0devel'
+PACKAGE_VERSION='9.2devel'
+PACKAGE_STRING='PostgreSQL 9.2devel'
 PACKAGE_BUGREPORT='pgsql-bugs@postgresql.org'
 
 ac_unique_file="src/backend/access/common/heaptuple.c"
@@ -667,6 +667,7 @@ PTHREAD_CFLAGS
 PTHREAD_LIBS
 PTHREAD_CC
 acx_pthread_config
+have_win32_dbghelp
 HAVE_IPV6
 LIBOBJS
 OSSP_UUID_LIBS
@@ -704,6 +705,7 @@ ld_R_works
 with_gnu_ld
 LD
 LDFLAGS_SL
+LDFLAGS_EX
 ELF_SYS
 EGREP
 GREP
@@ -713,6 +715,7 @@ with_libxslt
 with_libxml
 XML2_CONFIG
 with_ossp_uuid
+with_selinux
 with_openssl
 with_bonjour
 with_ldap
@@ -835,6 +838,7 @@ with_pam
 with_ldap
 with_bonjour
 with_openssl
+with_selinux
 with_readline
 with_libedit_preferred
 with_ossp_uuid
@@ -856,6 +860,7 @@ LDFLAGS
 LIBS
 CPPFLAGS
 CPP
+LDFLAGS_EX
 LDFLAGS_SL
 DOCBOOKSTYLE'
 
@@ -1410,7 +1415,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures PostgreSQL 9.0devel to adapt to many kinds of systems.
+\`configure' configures PostgreSQL 9.2devel to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1475,7 +1480,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of PostgreSQL 9.0devel:";;
+     short | recursive ) echo "Configuration of PostgreSQL 9.2devel:";;
    esac
   cat <<\_ACEOF
 
@@ -1530,11 +1535,11 @@ Optional Packages:
   --with-ldap             build with LDAP support
   --with-bonjour          build with Bonjour support
   --with-openssl          build with OpenSSL support
+  --with-selinux          build with SELinux support
   --without-readline      do not use GNU Readline nor BSD Libedit for editing
   --with-libedit-preferred
                           prefer BSD Libedit over GNU Readline
-  --with-ossp-uuid        use OSSP UUID library when building
-                          contrib/uuid-ossp
+  --with-ossp-uuid        build contrib/uuid-ossp, requires OSSP UUID library
   --with-libxml           build with XML support
   --with-libxslt          use XSLT support when building contrib/xml2
   --with-system-tzdata=DIR
@@ -1551,7 +1556,8 @@ Some influential environment variables:
   CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
-  LDFLAGS_SL  linker flags for shared library linking
+  LDFLAGS_EX  extra linker flags for linking executables only
+  LDFLAGS_SL  extra linker flags for linking shared libraries only
   DOCBOOKSTYLE
               location of DocBook stylesheets
 
@@ -1621,7 +1627,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-PostgreSQL configure 9.0devel
+PostgreSQL configure 9.2devel
 generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1629,7 +1635,7 @@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 
-Copyright (c) 1996-2010, PostgreSQL Global Development Group
+Copyright (c) 1996-2011, PostgreSQL Global Development Group
 _ACEOF
   exit
 fi
@@ -1637,7 +1643,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by PostgreSQL $as_me 9.0devel, which was
+It was created by PostgreSQL $as_me 9.2devel, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
@@ -2187,6 +2193,7 @@ case $host_os in
     bsdi*) template=bsdi ;;
   cygwin*) template=cygwin ;;
   darwin*) template=darwin ;;
+dragonfly*) template=netbsd ;;
     dgux*) template=dgux ;;
  freebsd*) template=freebsd ;;
     hpux*) template=hpux ;;
@@ -3996,10 +4003,15 @@ fi
 if test "$GCC" = yes -a "$ICC" = no; then
   CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith"
   # These work in some but not all gcc versions
-  { $as_echo "$as_me:$LINENO: checking if $CC supports -Wdeclaration-after-statement" >&5
-$as_echo_n "checking if $CC supports -Wdeclaration-after-statement... " >&6; }
-pgac_save_CFLAGS=$CFLAGS
+  { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wdeclaration-after-statement" >&5
+$as_echo_n "checking whether $CC supports -Wdeclaration-after-statement... " >&6; }
+if test "${pgac_cv_prog_cc_cflags__Wdeclaration_after_statement+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_CFLAGS=$CFLAGS
 CFLAGS="$pgac_save_CFLAGS -Wdeclaration-after-statement"
+ac_save_c_werror_flag=$ac_c_werror_flag
+ac_c_werror_flag=yes
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4033,23 +4045,33 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+  pgac_cv_prog_cc_cflags__Wdeclaration_after_statement=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       CFLAGS="$pgac_save_CFLAGS"
-                    { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+       pgac_cv_prog_cc_cflags__Wdeclaration_after_statement=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_c_werror_flag=$ac_save_c_werror_flag
+CFLAGS="$pgac_save_CFLAGS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" >&5
+$as_echo "$pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" >&6; }
+if test x"$pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" = x"yes"; then
+  CFLAGS="$CFLAGS -Wdeclaration-after-statement"
+fi
 
-  { $as_echo "$as_me:$LINENO: checking if $CC supports -Wendif-labels" >&5
-$as_echo_n "checking if $CC supports -Wendif-labels... " >&6; }
-pgac_save_CFLAGS=$CFLAGS
+  { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wendif-labels" >&5
+$as_echo_n "checking whether $CC supports -Wendif-labels... " >&6; }
+if test "${pgac_cv_prog_cc_cflags__Wendif_labels+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_CFLAGS=$CFLAGS
 CFLAGS="$pgac_save_CFLAGS -Wendif-labels"
+ac_save_c_werror_flag=$ac_c_werror_flag
+ac_c_werror_flag=yes
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4083,24 +4105,95 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+  pgac_cv_prog_cc_cflags__Wendif_labels=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       CFLAGS="$pgac_save_CFLAGS"
-                    { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+       pgac_cv_prog_cc_cflags__Wendif_labels=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_c_werror_flag=$ac_save_c_werror_flag
+CFLAGS="$pgac_save_CFLAGS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__Wendif_labels" >&5
+$as_echo "$pgac_cv_prog_cc_cflags__Wendif_labels" >&6; }
+if test x"$pgac_cv_prog_cc_cflags__Wendif_labels" = x"yes"; then
+  CFLAGS="$CFLAGS -Wendif-labels"
+fi
+
+  # This was included in -Wall/-Wformat in older GCC versions
+  { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wformat-security" >&5
+$as_echo_n "checking whether $CC supports -Wformat-security... " >&6; }
+if test "${pgac_cv_prog_cc_cflags__Wformat_security+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_CFLAGS=$CFLAGS
+CFLAGS="$pgac_save_CFLAGS -Wformat-security"
+ac_save_c_werror_flag=$ac_c_werror_flag
+ac_c_werror_flag=yes
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  pgac_cv_prog_cc_cflags__Wformat_security=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       pgac_cv_prog_cc_cflags__Wformat_security=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_c_werror_flag=$ac_save_c_werror_flag
+CFLAGS="$pgac_save_CFLAGS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__Wformat_security" >&5
+$as_echo "$pgac_cv_prog_cc_cflags__Wformat_security" >&6; }
+if test x"$pgac_cv_prog_cc_cflags__Wformat_security" = x"yes"; then
+  CFLAGS="$CFLAGS -Wformat-security"
+fi
 
   # Disable strict-aliasing rules; needed for gcc 3.3+
-  { $as_echo "$as_me:$LINENO: checking if $CC supports -fno-strict-aliasing" >&5
-$as_echo_n "checking if $CC supports -fno-strict-aliasing... " >&6; }
-pgac_save_CFLAGS=$CFLAGS
+  { $as_echo "$as_me:$LINENO: checking whether $CC supports -fno-strict-aliasing" >&5
+$as_echo_n "checking whether $CC supports -fno-strict-aliasing... " >&6; }
+if test "${pgac_cv_prog_cc_cflags__fno_strict_aliasing+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_CFLAGS=$CFLAGS
 CFLAGS="$pgac_save_CFLAGS -fno-strict-aliasing"
+ac_save_c_werror_flag=$ac_c_werror_flag
+ac_c_werror_flag=yes
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4134,24 +4227,34 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+  pgac_cv_prog_cc_cflags__fno_strict_aliasing=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       CFLAGS="$pgac_save_CFLAGS"
-                    { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+       pgac_cv_prog_cc_cflags__fno_strict_aliasing=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_c_werror_flag=$ac_save_c_werror_flag
+CFLAGS="$pgac_save_CFLAGS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&5
+$as_echo "$pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&6; }
+if test x"$pgac_cv_prog_cc_cflags__fno_strict_aliasing" = x"yes"; then
+  CFLAGS="$CFLAGS -fno-strict-aliasing"
+fi
 
   # Disable optimizations that assume no overflow; needed for gcc 4.3+
-  { $as_echo "$as_me:$LINENO: checking if $CC supports -fwrapv" >&5
-$as_echo_n "checking if $CC supports -fwrapv... " >&6; }
-pgac_save_CFLAGS=$CFLAGS
+  { $as_echo "$as_me:$LINENO: checking whether $CC supports -fwrapv" >&5
+$as_echo_n "checking whether $CC supports -fwrapv... " >&6; }
+if test "${pgac_cv_prog_cc_cflags__fwrapv+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_CFLAGS=$CFLAGS
 CFLAGS="$pgac_save_CFLAGS -fwrapv"
+ac_save_c_werror_flag=$ac_c_werror_flag
+ac_c_werror_flag=yes
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4185,26 +4288,36 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+  pgac_cv_prog_cc_cflags__fwrapv=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       CFLAGS="$pgac_save_CFLAGS"
-                    { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+       pgac_cv_prog_cc_cflags__fwrapv=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_c_werror_flag=$ac_save_c_werror_flag
+CFLAGS="$pgac_save_CFLAGS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__fwrapv" >&5
+$as_echo "$pgac_cv_prog_cc_cflags__fwrapv" >&6; }
+if test x"$pgac_cv_prog_cc_cflags__fwrapv" = x"yes"; then
+  CFLAGS="$CFLAGS -fwrapv"
+fi
 
 elif test "$ICC" = yes; then
   # Intel's compiler has a bug/misoptimization in checking for
   # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS.
-  { $as_echo "$as_me:$LINENO: checking if $CC supports -mp1" >&5
-$as_echo_n "checking if $CC supports -mp1... " >&6; }
-pgac_save_CFLAGS=$CFLAGS
+  { $as_echo "$as_me:$LINENO: checking whether $CC supports -mp1" >&5
+$as_echo_n "checking whether $CC supports -mp1... " >&6; }
+if test "${pgac_cv_prog_cc_cflags__mp1+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_CFLAGS=$CFLAGS
 CFLAGS="$pgac_save_CFLAGS -mp1"
+ac_save_c_werror_flag=$ac_c_werror_flag
+ac_c_werror_flag=yes
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4238,24 +4351,34 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+  pgac_cv_prog_cc_cflags__mp1=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       CFLAGS="$pgac_save_CFLAGS"
-                    { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+       pgac_cv_prog_cc_cflags__mp1=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_c_werror_flag=$ac_save_c_werror_flag
+CFLAGS="$pgac_save_CFLAGS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__mp1" >&5
+$as_echo "$pgac_cv_prog_cc_cflags__mp1" >&6; }
+if test x"$pgac_cv_prog_cc_cflags__mp1" = x"yes"; then
+  CFLAGS="$CFLAGS -mp1"
+fi
 
   # Make sure strict aliasing is off (though this is said to be the default)
-  { $as_echo "$as_me:$LINENO: checking if $CC supports -fno-strict-aliasing" >&5
-$as_echo_n "checking if $CC supports -fno-strict-aliasing... " >&6; }
-pgac_save_CFLAGS=$CFLAGS
+  { $as_echo "$as_me:$LINENO: checking whether $CC supports -fno-strict-aliasing" >&5
+$as_echo_n "checking whether $CC supports -fno-strict-aliasing... " >&6; }
+if test "${pgac_cv_prog_cc_cflags__fno_strict_aliasing+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_CFLAGS=$CFLAGS
 CFLAGS="$pgac_save_CFLAGS -fno-strict-aliasing"
+ac_save_c_werror_flag=$ac_c_werror_flag
+ac_c_werror_flag=yes
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4289,25 +4412,35 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+  pgac_cv_prog_cc_cflags__fno_strict_aliasing=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       CFLAGS="$pgac_save_CFLAGS"
-                    { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+       pgac_cv_prog_cc_cflags__fno_strict_aliasing=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_c_werror_flag=$ac_save_c_werror_flag
+CFLAGS="$pgac_save_CFLAGS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&5
+$as_echo "$pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&6; }
+if test x"$pgac_cv_prog_cc_cflags__fno_strict_aliasing" = x"yes"; then
+  CFLAGS="$CFLAGS -fno-strict-aliasing"
+fi
 
 elif test "$PORTNAME" = "aix"; then
   # AIX's xlc has to have strict aliasing turned off too
-  { $as_echo "$as_me:$LINENO: checking if $CC supports -qnoansialias" >&5
-$as_echo_n "checking if $CC supports -qnoansialias... " >&6; }
-pgac_save_CFLAGS=$CFLAGS
+  { $as_echo "$as_me:$LINENO: checking whether $CC supports -qnoansialias" >&5
+$as_echo_n "checking whether $CC supports -qnoansialias... " >&6; }
+if test "${pgac_cv_prog_cc_cflags__qnoansialias+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_CFLAGS=$CFLAGS
 CFLAGS="$pgac_save_CFLAGS -qnoansialias"
+ac_save_c_werror_flag=$ac_c_werror_flag
+ac_c_werror_flag=yes
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4341,18 +4474,86 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+  pgac_cv_prog_cc_cflags__qnoansialias=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       CFLAGS="$pgac_save_CFLAGS"
-                    { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+       pgac_cv_prog_cc_cflags__qnoansialias=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_c_werror_flag=$ac_save_c_werror_flag
+CFLAGS="$pgac_save_CFLAGS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__qnoansialias" >&5
+$as_echo "$pgac_cv_prog_cc_cflags__qnoansialias" >&6; }
+if test x"$pgac_cv_prog_cc_cflags__qnoansialias" = x"yes"; then
+  CFLAGS="$CFLAGS -qnoansialias"
+fi
+
+elif test "$PORTNAME" = "hpux"; then
+  # On some versions of HP-UX, libm functions do not set errno by default.
+  # Fix that by using +Olibmerrno if the compiler recognizes it.
+  { $as_echo "$as_me:$LINENO: checking whether $CC supports +Olibmerrno" >&5
+$as_echo_n "checking whether $CC supports +Olibmerrno... " >&6; }
+if test "${pgac_cv_prog_cc_cflags_pOlibmerrno+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_CFLAGS=$CFLAGS
+CFLAGS="$pgac_save_CFLAGS +Olibmerrno"
+ac_save_c_werror_flag=$ac_c_werror_flag
+ac_c_werror_flag=yes
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  pgac_cv_prog_cc_cflags_pOlibmerrno=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       pgac_cv_prog_cc_cflags_pOlibmerrno=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_c_werror_flag=$ac_save_c_werror_flag
+CFLAGS="$pgac_save_CFLAGS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags_pOlibmerrno" >&5
+$as_echo "$pgac_cv_prog_cc_cflags_pOlibmerrno" >&6; }
+if test x"$pgac_cv_prog_cc_cflags_pOlibmerrno" = x"yes"; then
+  CFLAGS="$CFLAGS +Olibmerrno"
+fi
 
 fi
 
@@ -5311,6 +5512,40 @@ fi
 $as_echo "$with_openssl" >&6; }
 
 
+#
+# SELinux
+#
+{ $as_echo "$as_me:$LINENO: checking whether to build with SELinux support" >&5
+$as_echo_n "checking whether to build with SELinux support... " >&6; }
+
+
+
+# Check whether --with-selinux was given.
+if test "${with_selinux+set}" = set; then
+  withval=$with_selinux;
+  case $withval in
+    yes)
+      :
+      ;;
+    no)
+      :
+      ;;
+    *)
+      { { $as_echo "$as_me:$LINENO: error: no argument expected for --with-selinux option" >&5
+$as_echo "$as_me: error: no argument expected for --with-selinux option" >&2;}
+   { (exit 1); exit 1; }; }
+      ;;
+  esac
+
+else
+  with_selinux=no
+
+fi
+
+
+
+{ $as_echo "$as_me:$LINENO: result: $with_selinux" >&5
+$as_echo "$with_selinux" >&6; }
 
 #
 # Readline
@@ -5788,6 +6023,7 @@ LDFLAGS="$LDFLAGS $LIBDIRS"
 
 
 
+
 # Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
   withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
@@ -6734,15 +6970,15 @@ fi
 
 if test -z "$BISON"; then
   { $as_echo "$as_me:$LINENO: WARNING:
-*** Without Bison you will not be able to build PostgreSQL from CVS nor
+*** Without Bison you will not be able to build PostgreSQL from Git nor
 *** change any of the parser definition files.  You can obtain Bison from
-*** a GNU mirror site.  (If you are using the bundled distribution of
+*** a GNU mirror site.  (If you are using the official distribution of
 *** PostgreSQL then you do not need to worry about this, because the Bison
 *** output is pre-generated.)" >&5
 $as_echo "$as_me: WARNING:
-*** Without Bison you will not be able to build PostgreSQL from CVS nor
+*** Without Bison you will not be able to build PostgreSQL from Git nor
 *** change any of the parser definition files.  You can obtain Bison from
-*** a GNU mirror site.  (If you are using the bundled distribution of
+*** a GNU mirror site.  (If you are using the official distribution of
 *** PostgreSQL then you do not need to worry about this, because the Bison
 *** output is pre-generated.)" >&2;}
 fi
@@ -6798,15 +7034,15 @@ fi
 $as_echo "$pgac_cv_path_flex" >&6; }
 if test x"$pgac_cv_path_flex" = x"no"; then
   { $as_echo "$as_me:$LINENO: WARNING:
-*** Without Flex you will not be able to build PostgreSQL from CVS nor
+*** Without Flex you will not be able to build PostgreSQL from Git nor
 *** change any of the scanner definition files.  You can obtain Flex from
-*** a GNU mirror site.  (If you are using the bundled distribution of
+*** a GNU mirror site.  (If you are using the official distribution of
 *** PostgreSQL then you do not need to worry about this because the Flex
 *** output is pre-generated.)" >&5
 $as_echo "$as_me: WARNING:
-*** Without Flex you will not be able to build PostgreSQL from CVS nor
+*** Without Flex you will not be able to build PostgreSQL from Git nor
 *** change any of the scanner definition files.  You can obtain Flex from
-*** a GNU mirror site.  (If you are using the bundled distribution of
+*** a GNU mirror site.  (If you are using the official distribution of
 *** PostgreSQL then you do not need to worry about this because the Flex
 *** output is pre-generated.)" >&2;}
 
@@ -6867,7 +7103,7 @@ fi
 fi
 
 if test "$PERL"; then
-  pgac_perl_version=`$PERL -v 2>/dev/null | sed -n 's/This is perl, v[a-z ]*//p' | sed 's/ .*//'`
+  pgac_perl_version=`$PERL -v 2>/dev/null | sed -n 's/This is perl.*v[a-z ]*\([0-9]\.[0-9][0-9.]*\).*$/\1/p'`
   { $as_echo "$as_me:$LINENO: using perl $pgac_perl_version" >&5
 $as_echo "$as_me: using perl $pgac_perl_version" >&6;}
   if echo "$pgac_perl_version" | sed 's/[.a-z_]/ /g' | \
@@ -6885,14 +7121,14 @@ fi
 
 if test -z "$PERL"; then
   { $as_echo "$as_me:$LINENO: WARNING:
-*** Without Perl you will not be able to build PostgreSQL from CVS.
+*** Without Perl you will not be able to build PostgreSQL from Git.
 *** You can obtain Perl from any CPAN mirror site.
-*** (If you are using the bundled distribution of PostgreSQL then you do not
+*** (If you are using the official distribution of PostgreSQL then you do not
 *** need to worry about this, because the Perl output is pre-generated.)" >&5
 $as_echo "$as_me: WARNING:
-*** Without Perl you will not be able to build PostgreSQL from CVS.
+*** Without Perl you will not be able to build PostgreSQL from Git.
 *** You can obtain Perl from any CPAN mirror site.
-*** (If you are using the bundled distribution of PostgreSQL then you do not
+*** (If you are using the official distribution of PostgreSQL then you do not
 *** need to worry about this, because the Perl output is pre-generated.)" >&2;}
 fi
 
@@ -7033,7 +7269,7 @@ else
        python_libspec="-L${python_libdir} -lpython${python_version}"
 fi
 
-python_additional_libs=`${PYTHON} -c "import distutils.sysconfig,string; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','LOCALMODLIBS','BASEMODLIBS'))))"`
+python_additional_libs=`${PYTHON} -c "import distutils.sysconfig,string; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','BASEMODLIBS'))))"`
 
 { $as_echo "$as_me:$LINENO: result: ${python_libspec} ${python_additional_libs}" >&5
 $as_echo "${python_libspec} ${python_additional_libs}" >&6; }
@@ -8077,6 +8313,8 @@ fi
 if test "$with_readline" = yes; then
 
 
+{ $as_echo "$as_me:$LINENO: checking for library containing readline" >&5
+$as_echo_n "checking for library containing readline... " >&6; }
 if test "${pgac_cv_check_readline+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
@@ -8087,8 +8325,6 @@ then      READLINE_ORDER="-lreadline -ledit"
 else   READLINE_ORDER="-ledit -lreadline"
 fi
 for pgac_rllib in $READLINE_ORDER ; do
-  { $as_echo "$as_me:$LINENO: checking for ${pgac_rllib}" >&5
-$as_echo_n "checking for ${pgac_rllib}... " >&6; }
   for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
     LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
@@ -8160,18 +8396,14 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
   done
   if test "$pgac_cv_check_readline" != no ; then
-    { $as_echo "$as_me:$LINENO: result: yes ($pgac_cv_check_readline)" >&5
-$as_echo "yes ($pgac_cv_check_readline)" >&6; }
     break
-  else
-    { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
   fi
 done
 LIBS=$pgac_save_LIBS
 
 fi
-
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_check_readline" >&5
+$as_echo "$pgac_cv_check_readline" >&6; }
 if test "$pgac_cv_check_readline" != no ; then
   LIBS="$pgac_cv_check_readline $LIBS"
 
@@ -9241,6 +9473,89 @@ fi
 
 fi
 
+# for contrib/sepgsql
+if test "$with_selinux" = yes; then
+
+{ $as_echo "$as_me:$LINENO: checking for selinux_sepgsql_context_path in -lselinux" >&5
+$as_echo_n "checking for selinux_sepgsql_context_path in -lselinux... " >&6; }
+if test "${ac_cv_lib_selinux_selinux_sepgsql_context_path+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lselinux  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char selinux_sepgsql_context_path ();
+int
+main ()
+{
+return selinux_sepgsql_context_path ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_selinux_selinux_sepgsql_context_path=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_selinux_selinux_sepgsql_context_path=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_selinux_selinux_sepgsql_context_path" >&5
+$as_echo "$ac_cv_lib_selinux_selinux_sepgsql_context_path" >&6; }
+if test "x$ac_cv_lib_selinux_selinux_sepgsql_context_path" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSELINUX 1
+_ACEOF
+
+  LIBS="-lselinux $LIBS"
+
+else
+  { { $as_echo "$as_me:$LINENO: error: library 'libselinux', version 2.0.93 or newer, is required for SELinux support" >&5
+$as_echo "$as_me: error: library 'libselinux', version 2.0.93 or newer, is required for SELinux support" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+
 # for contrib/uuid-ossp
 if test "$with_ossp_uuid" = yes ; then
   { $as_echo "$as_me:$LINENO: checking for uuid_export in -lossp-uuid" >&5
@@ -9675,7 +9990,8 @@ done
 
 
 
-for ac_header in crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h poll.h pwd.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h kernel/OS.h kernel/image.h SupportDefs.h
+
+for ac_header in crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h poll.h pwd.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.h sys/ucred.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h kernel/OS.h kernel/image.h SupportDefs.h
 do
 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -14638,9 +14954,10 @@ _ACEOF
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for signed types" >&5
-$as_echo_n "checking for signed types... " >&6; }
-if test "${pgac_cv_c_signed+set}" = set; then
+
+  { $as_echo "$as_me:$LINENO: checking for flexible array members" >&5
+$as_echo_n "checking for flexible array members... " >&6; }
+if test "${ac_cv_c_flexmember+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -14649,11 +14966,18 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+#include <stdlib.h>
+           #include <stdio.h>
+           #include <stddef.h>
+           struct s { int n; double d[]; };
 int
 main ()
 {
-signed char c; signed short s; signed int i;
+int m = getchar ();
+           struct s *p = malloc (offsetof (struct s, d)
+                                 + m * sizeof (double));
+           p->d[0] = 0.0;
+           return p->d != (double *) NULL;
   ;
   return 0;
 }
@@ -14676,32 +15000,95 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  pgac_cv_c_signed=yes
+  ac_cv_c_flexmember=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       pgac_cv_c_signed=no
+       ac_cv_c_flexmember=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $pgac_cv_c_signed" >&5
-$as_echo "$pgac_cv_c_signed" >&6; }
-if test x"$pgac_cv_c_signed" = xno ; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_flexmember" >&5
+$as_echo "$ac_cv_c_flexmember" >&6; }
+  if test $ac_cv_c_flexmember = yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define signed /**/
+#define FLEXIBLE_ARRAY_MEMBER /**/
 _ACEOF
 
-fi
-{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5
-$as_echo_n "checking for working volatile... " >&6; }
-if test "${ac_cv_c_volatile+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+  else
+    cat >>confdefs.h <<\_ACEOF
+#define FLEXIBLE_ARRAY_MEMBER 1
+_ACEOF
+
+  fi
+
+{ $as_echo "$as_me:$LINENO: checking for signed types" >&5
+$as_echo_n "checking for signed types... " >&6; }
+if test "${pgac_cv_c_signed+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+signed char c; signed short s; signed int i;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  pgac_cv_c_signed=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       pgac_cv_c_signed=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_c_signed" >&5
+$as_echo "$pgac_cv_c_signed" >&6; }
+if test x"$pgac_cv_c_signed" = xno ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define signed /**/
+_ACEOF
+
+fi
+{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5
+$as_echo_n "checking for working volatile... " >&6; }
+if test "${ac_cv_c_volatile+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 
 
 
-{ $as_echo "$as_me:$LINENO: checking for struct cmsgcred" >&5
-$as_echo_n "checking for struct cmsgcred... " >&6; }
-if test "${ac_cv_type_struct_cmsgcred+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for long long int" >&5
+$as_echo_n "checking for long long int... " >&6; }
+if test "${ac_cv_type_long_long_int+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_type_struct_cmsgcred=no
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+  cat >conftest.$ac_ext <<_ACEOF
+
+  /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/ucred.h>
-
+/* For now, do not test the preprocessor; as of 2007 there are too many
+        implementations with broken preprocessors.  Perhaps this can
+        be revisited in 2012.  In the meantime, code should not expect
+        #if to work with literals wider than 32 bits.  */
+      /* Test literals.  */
+      long long int ll = 9223372036854775807ll;
+      long long int nll = -9223372036854775807LL;
+      unsigned long long int ull = 18446744073709551615ULL;
+      /* Test constant expressions.   */
+      typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
+                    ? 1 : -1)];
+      typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
+                    ? 1 : -1)];
+      int i = 63;
 int
 main ()
 {
-if (sizeof (struct cmsgcred))
-       return 0;
+/* Test availability of runtime routines for shift and division.  */
+      long long int llmax = 9223372036854775807ll;
+      unsigned long long int ullmax = 18446744073709551615ull;
+      return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+             | (llmax / ll) | (llmax % ll)
+             | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
+             | (ullmax / ull) | (ullmax % ull));
   ;
   return 0;
 }
+
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -16492,95 +16894,118 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+                       if test "$cross_compiling" = yes; then
+  ac_cv_type_long_long_int=yes
+else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/ucred.h>
-
+#include <limits.h>
+              #ifndef LLONG_MAX
+              # define HALF \
+                       (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+              # define LLONG_MAX (HALF - 1 + HALF)
+              #endif
 int
 main ()
 {
-if (sizeof ((struct cmsgcred)))
-         return 0;
+long long int n = 1;
+              int i;
+              for (i = 0; ; i++)
+                {
+                  long long int m = n << i;
+                  if (m >> i != n)
+                    return 1;
+                  if (LLONG_MAX / 2 < m)
+                    break;
+                }
+              return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_long_long_int=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_struct_cmsgcred=yes
+( exit $ac_status )
+ac_cv_type_long_long_int=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
+       ac_cv_type_long_long_int=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_cmsgcred" >&5
-$as_echo "$ac_cv_type_struct_cmsgcred" >&6; }
-if test "x$ac_cv_type_struct_cmsgcred" = x""yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5
+$as_echo "$ac_cv_type_long_long_int" >&6; }
+  if test $ac_cv_type_long_long_int = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_CMSGCRED 1
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LONG_LONG_INT 1
 _ACEOF
 
+  fi
+
 
-fi
-{ $as_echo "$as_me:$LINENO: checking for struct fcred" >&5
-$as_echo_n "checking for struct fcred... " >&6; }
-if test "${ac_cv_type_struct_fcred+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for locale_t" >&5
+$as_echo_n "checking for locale_t... " >&6; }
+if test "${pgac_cv_type_locale_t+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_type_struct_fcred=no
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/ucred.h>
-
+#include <locale.h>
+locale_t x;
 int
 main ()
 {
-if (sizeof (struct fcred))
-       return 0;
+
   ;
   return 0;
 }
@@ -16603,22 +17028,23 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  cat >conftest.$ac_ext <<_ACEOF
+  pgac_cv_type_locale_t=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/ucred.h>
-
+#include <xlocale.h>
+locale_t x;
 int
 main ()
 {
-if (sizeof ((struct fcred)))
-         return 0;
+
   ;
   return 0;
 }
@@ -16641,55 +17067,57 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  :
+  pgac_cv_type_locale_t='yes (in xlocale.h)'
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_struct_fcred=yes
+       pgac_cv_type_locale_t=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_fcred" >&5
-$as_echo "$ac_cv_type_struct_fcred" >&6; }
-if test "x$ac_cv_type_struct_fcred" = x""yes; then
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_type_locale_t" >&5
+$as_echo "$pgac_cv_type_locale_t" >&6; }
+if test "$pgac_cv_type_locale_t" != no; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_FCRED 1
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LOCALE_T 1
 _ACEOF
 
+fi
+if test "$pgac_cv_type_locale_t" = 'yes (in xlocale.h)'; then
+
+cat >>confdefs.h <<\_ACEOF
+#define LOCALE_T_IN_XLOCALE 1
+_ACEOF
 
 fi
-{ $as_echo "$as_me:$LINENO: checking for struct sockcred" >&5
-$as_echo_n "checking for struct sockcred... " >&6; }
-if test "${ac_cv_type_struct_sockcred+set}" = set; then
+
+{ $as_echo "$as_me:$LINENO: checking for struct cmsgcred" >&5
+$as_echo_n "checking for struct cmsgcred... " >&6; }
+if test "${ac_cv_type_struct_cmsgcred+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_type_struct_sockcred=no
+  ac_cv_type_struct_cmsgcred=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/param.h>
-#include <sys/types.h>
 #include <sys/socket.h>
+#ifdef HAVE_SYS_UCRED_H
 #include <sys/ucred.h>
+#endif
 
 int
 main ()
 {
-if (sizeof (struct sockcred))
+if (sizeof (struct cmsgcred))
        return 0;
   ;
   return 0;
@@ -16719,15 +17147,15 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/param.h>
-#include <sys/types.h>
 #include <sys/socket.h>
+#ifdef HAVE_SYS_UCRED_H
 #include <sys/ucred.h>
+#endif
 
 int
 main ()
 {
-if (sizeof ((struct sockcred)))
+if (sizeof ((struct cmsgcred)))
          return 0;
   ;
   return 0;
@@ -16756,7 +17184,7 @@ else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_struct_sockcred=yes
+       ac_cv_type_struct_cmsgcred=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockcred" >&5
-$as_echo "$ac_cv_type_struct_sockcred" >&6; }
-if test "x$ac_cv_type_struct_sockcred" = x""yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_cmsgcred" >&5
+$as_echo "$ac_cv_type_struct_cmsgcred" >&6; }
+if test "x$ac_cv_type_struct_cmsgcred" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_SOCKCRED 1
+#define HAVE_STRUCT_CMSGCRED 1
 _ACEOF
 
 
@@ -18315,8 +18743,8 @@ else
      if test "${ac_cv_func_accept_arg3+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-      for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL'; do
-      for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do
+      for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET'; do
+      for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do
        for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
         for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do
          cat >conftest.$ac_ext <<_ACEOF
@@ -18494,7 +18922,8 @@ fi
 
 
 
-for ac_func in cbrt dlopen fcvt fdatasync getifaddrs getpeereid getpeerucred getrlimit memmove poll pstat readlink setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs
+
+for ac_func in cbrt dlopen fcvt fdatasync getifaddrs getpeerucred getrlimit memmove poll pstat readlink scandir setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs wcstombs_l
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -20065,7 +20494,8 @@ LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
 
 
 
-for ac_func in crypt erand48 getopt getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul
+
+for ac_func in crypt erand48 getopt getpeereid getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -20555,6 +20985,23 @@ esac
 
 fi
 
+# mingw has adopted a GNU-centric interpretation of optind/optreset,
+# so always use our version on Windows.
+if test "$PORTNAME" = "win32"; then
+  case " $LIBOBJS " in
+  *" getopt.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS getopt.$ac_objext"
+ ;;
+esac
+
+  case " $LIBOBJS " in
+  *" getopt_long.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext"
+ ;;
+esac
+
+fi
+
 # Cygwin's erand48() is broken (always returns zero) in some releases,
 # so force use of ours.
 if test "$PORTNAME" = "cygwin"; then
 done
 
 
-case " $LIBOBJS " in
+  case " $LIBOBJS " in
   *" kill.$ac_objext "* ) ;;
   *) LIBOBJS="$LIBOBJS kill.$ac_objext"
  ;;
 esac
 
-case " $LIBOBJS " in
+  case " $LIBOBJS " in
   *" open.$ac_objext "* ) ;;
   *) LIBOBJS="$LIBOBJS open.$ac_objext"
  ;;
 esac
 
-case " $LIBOBJS " in
+  case " $LIBOBJS " in
   *" win32env.$ac_objext "* ) ;;
   *) LIBOBJS="$LIBOBJS win32env.$ac_objext"
  ;;
 esac
 
-case " $LIBOBJS " in
+  case " $LIBOBJS " in
   *" win32error.$ac_objext "* ) ;;
   *) LIBOBJS="$LIBOBJS win32error.$ac_objext"
  ;;
@@ -20706,12 +21153,137 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_SYMLINK 1
 _ACEOF
 
+  { $as_echo "$as_me:$LINENO: checking for MINIDUMP_TYPE" >&5
+$as_echo_n "checking for MINIDUMP_TYPE... " >&6; }
+if test "${ac_cv_type_MINIDUMP_TYPE+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_type_MINIDUMP_TYPE=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <string.h>
+#include <dbghelp.h>
+
+int
+main ()
+{
+if (sizeof (MINIDUMP_TYPE))
+       return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <string.h>
+#include <dbghelp.h>
+
+int
+main ()
+{
+if (sizeof ((MINIDUMP_TYPE)))
+         return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_type_MINIDUMP_TYPE=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_MINIDUMP_TYPE" >&5
+$as_echo "$ac_cv_type_MINIDUMP_TYPE" >&6; }
+if test "x$ac_cv_type_MINIDUMP_TYPE" = x""yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_MINIDUMP_TYPE 1
+_ACEOF
+
+pgac_minidump_type=yes
+else
+  pgac_minidump_type=no
+fi
+
+fi
+if test x"$pgac_minidump_type" = x"yes" ; then
+  have_win32_dbghelp=yes
+
+else
+  have_win32_dbghelp=no
+
 fi
 
 if test "$with_readline" = yes; then
   { $as_echo "$as_me:$LINENO: checking for rl_completion_append_character" >&5
 $as_echo_n "checking for rl_completion_append_character... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+if test "${pgac_cv_var_rl_completion_append_character+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -20753,24 +21325,27 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1
-_ACEOF
-
+  pgac_cv_var_rl_completion_append_character=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+       pgac_cv_var_rl_completion_append_character=no
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_var_rl_completion_append_character" >&5
+$as_echo "$pgac_cv_var_rl_completion_append_character" >&6; }
+if test x"$pgac_cv_var_rl_completion_append_character" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1
+_ACEOF
+
+fi
 
 
 for ac_func in rl_completion_matches rl_filename_completion_function
 
 { $as_echo "$as_me:$LINENO: checking for sigsetjmp" >&5
 $as_echo_n "checking for sigsetjmp... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+if test "${pgac_cv_func_sigsetjmp+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -21016,24 +21594,27 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SIGSETJMP 1
-_ACEOF
-
-{ $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+  pgac_cv_func_sigsetjmp=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+       pgac_cv_func_sigsetjmp=no
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_func_sigsetjmp" >&5
+$as_echo "$pgac_cv_func_sigsetjmp" >&6; }
+if test x"$pgac_cv_func_sigsetjmp" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SIGSETJMP 1
+_ACEOF
+
+fi
 
 { $as_echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5
 $as_echo_n "checking whether sys_siglist is declared... " >&6; }
@@ -22173,7 +22754,8 @@ main (int argc, char **argv)
 }
 _ACEOF
             rm -f conftest.$ac_objext conftest$ac_exeext
-            if test "`(eval $ac_link 2>&1 1>&5)`" = ""; then
+            # Check both linking and compiling, because they might tolerate different options.
+            if test "`(eval $ac_link 2>&1 1>&5)`" = "" && test "`(eval $ac_compile 2>&1 1>&5)`" = ""; then
                 # we continue with more flags because Linux needs -lpthread
                 # for libpq builds on PostgreSQL.  The test above only
                 # tests for building binaries, not shared libraries.
@@ -27615,6 +28197,13 @@ _ACEOF
   SHMEM_IMPLEMENTATION="src/backend/port/win32_shmem.c"
 fi
 
+# Select latch implementation type.
+if test "$PORTNAME" != "win32"; then
+  LATCH_IMPLEMENTATION="src/backend/port/unix_latch.c"
+else
+  LATCH_IMPLEMENTATION="src/backend/port/win32_latch.c"
+fi
+
 # If not set in template file, set bytes to use libc memset()
 if test x"$MEMSET_LOOP_LIMIT" = x"" ; then
   MEMSET_LOOP_LIMIT=1024
     CPPFLAGS=$ac_save_CPPFLAGS
 fi
 
+# check for <Python.h>
+if test "$with_python" = yes; then
+  ac_save_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$python_includespec $CPPFLAGS"
+  if test "${ac_cv_header_Python_h+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for Python.h" >&5
+$as_echo_n "checking for Python.h... " >&6; }
+if test "${ac_cv_header_Python_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_Python_h" >&5
+$as_echo "$ac_cv_header_Python_h" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking Python.h usability" >&5
+$as_echo_n "checking Python.h usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <Python.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking Python.h presence" >&5
+$as_echo_n "checking Python.h presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <Python.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: Python.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: Python.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: Python.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: Python.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: Python.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: Python.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: Python.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: Python.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: Python.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: Python.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: Python.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: Python.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: Python.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: Python.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: Python.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: Python.h: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ---------------------------------------- ##
+## Report this to pgsql-bugs@postgresql.org ##
+## ---------------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for Python.h" >&5
+$as_echo_n "checking for Python.h... " >&6; }
+if test "${ac_cv_header_Python_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_header_Python_h=$ac_header_preproc
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_Python_h" >&5
+$as_echo "$ac_cv_header_Python_h" >&6; }
+
+fi
+if test "x$ac_cv_header_Python_h" = x""yes; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: header file <Python.h> is required for Python" >&5
+$as_echo "$as_me: error: header file <Python.h> is required for Python" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+  CPPFLAGS=$ac_save_CPPFLAGS
+fi
+
 #
 # Check for DocBook and tools
 #
@@ -28672,7 +29409,6 @@ fi
 # If compiler will take -Wl,--as-needed (or various platform-specific
 # spellings thereof) then add that to LDFLAGS.  This is much easier than
 # trying to filter LIBS to the minimum for each executable.
-# (Note that shared library links won't use this switch, though.)
 # On (at least) some Red-Hat-derived systems, this switch breaks linking to
 # libreadline; therefore we postpone testing it until we know what library
 # dependencies readline has.  The test code will try to link with $LIBS.
@@ -28683,14 +29419,15 @@ else
 fi
 
 if test "$PORTNAME" = "darwin"; then
-  { $as_echo "$as_me:$LINENO: checking if $CC supports -Wl,-dead_strip_dylibs" >&5
-$as_echo_n "checking if $CC supports -Wl,-dead_strip_dylibs... " >&6; }
-pgac_save_LDFLAGS=$LDFLAGS
+  { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wl,-dead_strip_dylibs" >&5
+$as_echo_n "checking whether $CC supports -Wl,-dead_strip_dylibs... " >&6; }
+if test "${pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_LDFLAGS=$LDFLAGS
 LDFLAGS="$pgac_save_LDFLAGS -Wl,-dead_strip_dylibs"
 if test "$cross_compiling" = yes; then
-  LDFLAGS="$pgac_save_LDFLAGS"
-               { $as_echo "$as_me:$LINENO: result: assuming no" >&5
-$as_echo "assuming no" >&6; }
+  pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs="assuming no"
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -28729,33 +29466,38 @@ $as_echo "$ac_try_echo") >&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+  pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=yes
 else
   $as_echo "$as_me: program exited with status $ac_status" >&5
 $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-LDFLAGS="$pgac_save_LDFLAGS"
-               { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=no
 fi
 rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
+LDFLAGS="$pgac_save_LDFLAGS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&5
+$as_echo "$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&6; }
+if test x"$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" = x"yes"; then
+  LDFLAGS="$LDFLAGS -Wl,-dead_strip_dylibs"
+fi
 
 elif test "$PORTNAME" = "openbsd"; then
-  { $as_echo "$as_me:$LINENO: checking if $CC supports -Wl,-Bdynamic" >&5
-$as_echo_n "checking if $CC supports -Wl,-Bdynamic... " >&6; }
-pgac_save_LDFLAGS=$LDFLAGS
+  { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wl,-Bdynamic" >&5
+$as_echo_n "checking whether $CC supports -Wl,-Bdynamic... " >&6; }
+if test "${pgac_cv_prog_cc_ldflags__Wl__Bdynamic+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_LDFLAGS=$LDFLAGS
 LDFLAGS="$pgac_save_LDFLAGS -Wl,-Bdynamic"
 if test "$cross_compiling" = yes; then
-  LDFLAGS="$pgac_save_LDFLAGS"
-               { $as_echo "$as_me:$LINENO: result: assuming no" >&5
-$as_echo "assuming no" >&6; }
+  pgac_cv_prog_cc_ldflags__Wl__Bdynamic="assuming no"
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -28794,33 +29536,38 @@ $as_echo "$ac_try_echo") >&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+  pgac_cv_prog_cc_ldflags__Wl__Bdynamic=yes
 else
   $as_echo "$as_me: program exited with status $ac_status" >&5
 $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-LDFLAGS="$pgac_save_LDFLAGS"
-               { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+pgac_cv_prog_cc_ldflags__Wl__Bdynamic=no
 fi
 rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
+LDFLAGS="$pgac_save_LDFLAGS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&5
+$as_echo "$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&6; }
+if test x"$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" = x"yes"; then
+  LDFLAGS="$LDFLAGS -Wl,-Bdynamic"
+fi
 
 else
-  { $as_echo "$as_me:$LINENO: checking if $CC supports -Wl,--as-needed" >&5
-$as_echo_n "checking if $CC supports -Wl,--as-needed... " >&6; }
-pgac_save_LDFLAGS=$LDFLAGS
+  { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wl,--as-needed" >&5
+$as_echo_n "checking whether $CC supports -Wl,--as-needed... " >&6; }
+if test "${pgac_cv_prog_cc_ldflags__Wl___as_needed+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  pgac_save_LDFLAGS=$LDFLAGS
 LDFLAGS="$pgac_save_LDFLAGS -Wl,--as-needed"
 if test "$cross_compiling" = yes; then
-  LDFLAGS="$pgac_save_LDFLAGS"
-               { $as_echo "$as_me:$LINENO: result: assuming no" >&5
-$as_echo "assuming no" >&6; }
+  pgac_cv_prog_cc_ldflags__Wl___as_needed="assuming no"
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -28859,23 +29606,27 @@ $as_echo "$ac_try_echo") >&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+  pgac_cv_prog_cc_ldflags__Wl___as_needed=yes
 else
   $as_echo "$as_me: program exited with status $ac_status" >&5
 $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-LDFLAGS="$pgac_save_LDFLAGS"
-               { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+pgac_cv_prog_cc_ldflags__Wl___as_needed=no
 fi
 rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
+LDFLAGS="$pgac_save_LDFLAGS"
+fi
+{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_ldflags__Wl___as_needed" >&5
+$as_echo "$pgac_cv_prog_cc_ldflags__Wl___as_needed" >&6; }
+if test x"$pgac_cv_prog_cc_ldflags__Wl___as_needed" = x"yes"; then
+  LDFLAGS="$LDFLAGS -Wl,--as-needed"
+fi
 
 fi
 
@@ -28891,7 +29642,8 @@ $as_echo "$as_me: using LDFLAGS=$LDFLAGS" >&6;}
 
 # Create compiler version string
 if test x"$GCC" = x"yes" ; then
-  cc_string="GCC `${CC} --version | sed q`"
+  cc_string=`${CC} --version | sed q`
+  case $cc_string in [A-Za-z]*) ;; *) cc_string="GCC $cc_string";; esac
 elif test x"$SUN_STUDIO_CC" = x"yes" ; then
   cc_string=`${CC} -V 2>&1 | sed q`
 else
@@ -28941,7 +29693,7 @@ fi
 ac_config_files="$ac_config_files GNUmakefile src/Makefile.global"
 
 
-ac_config_links="$ac_config_links src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} src/include/dynloader.h:src/backend/port/dynloader/${template}.h src/include/pg_config_os.h:src/include/port/${template}.h src/Makefile.port:src/makefiles/Makefile.${template}"
+ac_config_links="$ac_config_links src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} src/backend/port/pg_latch.c:${LATCH_IMPLEMENTATION} src/include/dynloader.h:src/backend/port/dynloader/${template}.h src/include/pg_config_os.h:src/include/port/${template}.h src/Makefile.port:src/makefiles/Makefile.${template}"
 
 
 if test "$PORTNAME" = "win32"; then
@@ -29375,7 +30127,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by PostgreSQL $as_me 9.0devel, which was
+This file was extended by PostgreSQL $as_me 9.2devel, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -29442,7 +30194,7 @@ Report bugs to <bug-autoconf@gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-PostgreSQL config.status 9.0devel
+PostgreSQL config.status 9.2devel
 configured by $0, generated by GNU Autoconf 2.63,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -29565,6 +30317,7 @@ do
     "src/backend/port/dynloader.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c" ;;
     "src/backend/port/pg_sema.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}" ;;
     "src/backend/port/pg_shmem.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}" ;;
+    "src/backend/port/pg_latch.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_latch.c:${LATCH_IMPLEMENTATION}" ;;
     "src/include/dynloader.h") CONFIG_LINKS="$CONFIG_LINKS src/include/dynloader.h:src/backend/port/dynloader/${template}.h" ;;
     "src/include/pg_config_os.h") CONFIG_LINKS="$CONFIG_LINKS src/include/pg_config_os.h:src/include/port/${template}.h" ;;
     "src/Makefile.port") CONFIG_LINKS="$CONFIG_LINKS src/Makefile.port:src/makefiles/Makefile.${template}" ;;