]> granicus.if.org Git - postgresql/blobdiff - configure
Code cleanup: use "bool" for Boolean variables, rather than "int".
[postgresql] / configure
index 089573a0a71b582abbf431f8eeab0882761d30b8..e4ba96391e6b4399ef2c92c05fe31b8de04d08aa 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.59 for PostgreSQL 8.2devel.
+# Generated by GNU Autoconf 2.59 for PostgreSQL 8.3devel.
 #
 # Report bugs to <pgsql-bugs@postgresql.org>.
 #
@@ -8,7 +8,7 @@
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 #
-# Copyright (c) 1996-2005, PostgreSQL Global Development Group
+# Copyright (c) 1996-2007, PostgreSQL Global Development Group
 ## --------------------- ##
 ## M4sh Initialization.  ##
 ## --------------------- ##
@@ -271,8 +271,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='PostgreSQL'
 PACKAGE_TARNAME='postgresql'
-PACKAGE_VERSION='8.2devel'
-PACKAGE_STRING='PostgreSQL 8.2devel'
+PACKAGE_VERSION='8.3devel'
+PACKAGE_STRING='PostgreSQL 8.3devel'
 PACKAGE_BUGREPORT='pgsql-bugs@postgresql.org'
 
 ac_unique_file="src/backend/access/common/heaptuple.c"
@@ -314,7 +314,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS configure_args build build_cpu build_vendor build_os host host_cpu host_vendor host_os PORTNAME docdir enable_nls WANTED_LANGUAGES default_port enable_shared enable_rpath enable_debug CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GCC TAS autodepend INCLUDES enable_thread_safety with_tcl with_perl with_python with_krb5 krb_srvtab with_pam with_bonjour with_openssl with_zlib EGREP ELF_SYS LDFLAGS_SL AWK FLEX FLEXFLAGS LN_S LD with_gnu_ld ld_R_works RANLIB ac_ct_RANLIB LORDER TAR STRIP ac_ct_STRIP STRIP_STATIC_LIB STRIP_SHARED_LIB YACC YFLAGS PERL perl_archlibexp perl_privlibexp perl_useshrplib perl_embed_ldflags PYTHON python_version python_configdir python_includespec python_libdir python_libspec python_additional_libs HAVE_IPV6 LIBOBJS acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS HAVE_POSIX_SIGNALS MSGFMT MSGMERGE XGETTEXT localedir TCLSH TCL_CONFIG_SH TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIBS TCL_LIB_SPEC TCL_SHARED_BUILD TCL_SHLIB_LD_LIBS NSGMLS JADE have_docbook DOCBOOKSTYLE COLLATEINDEX SGMLSPL vpath_build LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS configure_args build build_cpu build_vendor build_os host host_cpu host_vendor host_os PORTNAME docdir enable_nls WANTED_LANGUAGES default_port enable_shared enable_rpath enable_debug enable_profiling DTRACE DTRACEFLAGS enable_dtrace CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GCC TAS autodepend INCLUDES enable_thread_safety with_tcl with_perl with_python with_krb5 krb_srvtab with_pam with_ldap with_bonjour with_openssl with_ossp_uuid XML2_CONFIG with_libxml with_libxslt with_zlib EGREP ELF_SYS LDFLAGS_SL AWK FLEX FLEXFLAGS LN_S LD with_gnu_ld ld_R_works RANLIB ac_ct_RANLIB TAR STRIP ac_ct_STRIP STRIP_STATIC_LIB STRIP_SHARED_LIB YACC YFLAGS PERL perl_archlibexp perl_privlibexp perl_useshrplib perl_embed_ldflags PYTHON python_version python_configdir python_includespec python_libdir python_libspec python_additional_libs HAVE_IPV6 LIBOBJS acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS LDAP_LIBS_FE LDAP_LIBS_BE HAVE_POSIX_SIGNALS MSGFMT MSGMERGE XGETTEXT localedir TCLSH TCL_CONFIG_SH TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIBS TCL_LIB_SPEC TCL_SHARED_BUILD TCL_SHLIB_LD_LIBS NSGMLS JADE have_docbook DOCBOOKSTYLE COLLATEINDEX SGMLSPL vpath_build LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -791,7 +791,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 8.2devel to adapt to many kinds of systems.
+\`configure' configures PostgreSQL 8.3devel to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -852,7 +852,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of PostgreSQL 8.2devel:";;
+     short | recursive ) echo "Configuration of PostgreSQL 8.3devel:";;
    esac
   cat <<\_ACEOF
 
@@ -865,6 +865,8 @@ Optional Features:
   --disable-rpath         do not embed shared library search path in executables
   --disable-spinlocks     do not use spinlocks
   --enable-debug          build with debugging symbols (-g)
+  --enable-profiling      build with profiling enabled
+  --enable-dtrace         build with DTrace support
   --enable-depend         turn on automatic dependency tracking
   --enable-cassert        enable assertion checks (for debugging)
   --enable-thread-safety  make client libraries thread-safe
@@ -880,7 +882,7 @@ Optional Packages:
   --with-includes=DIRS    look for additional header files in DIRS
   --with-libraries=DIRS   look for additional libraries in DIRS
   --with-libs=DIRS        alternative spelling of --with-libraries
-  --with-pgport=PORTNUM   change default port number 5432
+  --with-pgport=PORTNUM   change default port number [5432]
   --with-tcl              build Tcl modules (PL/Tcl)
   --with-tclconfig=DIR    tclConfig.sh is in DIR
   --with-perl             build Perl modules (PL/Perl)
@@ -888,10 +890,14 @@ Optional Packages:
   --with-krb5             build with Kerberos 5 support
   --with-krb-srvnam=NAME  name of the default service principal in Kerberos [postgres]
   --with-pam              build with PAM support
+  --with-ldap             build with LDAP support
   --with-bonjour          build with Bonjour support
   --with-openssl          build with OpenSSL support
+  --without-readline      do not use GNU Readline nor BSD Libedit for editing
   --with-libedit-preferred  prefer BSD Libedit over GNU Readline
-  --without-readline      do not use GNU Readline / BSD Libedit line editing
+  --with-ossp-uuid        build with OSSP UUID library for UUID generation
+  --with-libxml           build with XML support
+  --with-libxslt          build with XSLT support
   --without-zlib          do not use Zlib
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
 
@@ -1006,14 +1012,14 @@ fi
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
-PostgreSQL configure 8.2devel
+PostgreSQL configure 8.3devel
 generated by GNU Autoconf 2.59
 
 Copyright (C) 2003 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 
-Copyright (c) 1996-2005, PostgreSQL Global Development Group
+Copyright (c) 1996-2007, PostgreSQL Global Development Group
 _ACEOF
   exit 0
 fi
@@ -1022,7 +1028,7 @@ cat >&5 <<_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 8.2devel, which was
+It was created by PostgreSQL $as_me 8.3devel, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
@@ -1457,6 +1463,7 @@ echo "$as_me:$LINENO: checking which template to use" >&5
 echo $ECHO_N "checking which template to use... $ECHO_C" >&6
 
 
+pgac_args="$pgac_args with_template"
 
 
 # Check whether --with-template or --without-template was given.
@@ -1496,7 +1503,6 @@ else
 
 case $host_os in
      aix*) template=aix ;;
-    beos*) template=beos ;;
     bsdi*) template=bsdi ;;
   cygwin*) template=cygwin ;;
   darwin*) template=darwin ;;
@@ -1511,7 +1517,6 @@ case $host_os in
 nextstep*) template=nextstep ;;
  openbsd*) template=openbsd ;;
      osf*) template=osf ;;
-     qnx*) template=qnx4 ;;
      sco*) template=sco ;;
  solaris*) template=solaris ;;
    sunos*) template=sunos4 ;;
@@ -1576,6 +1581,7 @@ tas_file=dummy.s
 # Installation directory for documentation
 #
 
+pgac_args="$pgac_args with_docdir"
 
 
 # Check whether --with-docdir or --without-docdir was given.
@@ -1607,6 +1613,7 @@ fi;
 # Add non-standard directories to the include path
 #
 
+pgac_args="$pgac_args with_includes"
 
 
 # Check whether --with-includes or --without-includes was given.
@@ -1637,6 +1644,7 @@ fi;
 # Add non-standard directories to the library search path
 #
 
+pgac_args="$pgac_args with_libraries"
 
 
 # Check whether --with-libraries or --without-libraries was given.
@@ -1663,6 +1671,7 @@ fi;
 
 
 
+pgac_args="$pgac_args with_libs"
 
 
 # Check whether --with-libs or --without-libs was given.
@@ -1695,6 +1704,7 @@ fi;
 echo "$as_me:$LINENO: checking whether to build with 64-bit integer date/time support" >&5
 echo $ECHO_N "checking whether to build with 64-bit integer date/time support... $ECHO_C" >&6
 
+pgac_args="$pgac_args enable_integer_datetimes"
 
 # Check whether --enable-integer-datetimes or --disable-integer-datetimes was given.
 if test "${enable_integer_datetimes+set}" = set; then
@@ -1733,6 +1743,7 @@ echo "${ECHO_T}$enable_integer_datetimes" >&6
 echo "$as_me:$LINENO: checking whether NLS is wanted" >&5
 echo $ECHO_N "checking whether NLS is wanted... $ECHO_C" >&6
 
+pgac_args="$pgac_args enable_nls"
 
 # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
@@ -1775,6 +1786,7 @@ echo "${ECHO_T}$enable_nls" >&6
 echo "$as_me:$LINENO: checking for default port number" >&5
 echo $ECHO_N "checking for default port number... $ECHO_C" >&6
 
+pgac_args="$pgac_args with_pgport"
 
 
 # Check whether --with-pgport or --without-pgport was given.
@@ -1820,6 +1832,7 @@ _ACEOF
 # Option to disable shared libraries
 #
 
+pgac_args="$pgac_args enable_shared"
 
 # Check whether --enable-shared or --disable-shared was given.
 if test "${enable_shared+set}" = set; then
@@ -1850,6 +1863,7 @@ fi;
 # '-rpath'-like feature can be disabled
 #
 
+pgac_args="$pgac_args enable_rpath"
 
 # Check whether --enable-rpath or --disable-rpath was given.
 if test "${enable_rpath+set}" = set; then
@@ -1880,6 +1894,7 @@ fi;
 # Spinlocks
 #
 
+pgac_args="$pgac_args enable_spinlocks"
 
 # Check whether --enable-spinlocks or --disable-spinlocks was given.
 if test "${enable_spinlocks+set}" = set; then
@@ -1909,6 +1924,7 @@ fi;
 # --enable-debug adds -g to compiler flags
 #
 
+pgac_args="$pgac_args enable_debug"
 
 # Check whether --enable-debug or --disable-debug was given.
 if test "${enable_debug+set}" = set; then
@@ -1935,6 +1951,118 @@ fi;
 
 
 
+#
+# --enable-profiling enables gcc profiling
+#
+
+pgac_args="$pgac_args enable_profiling"
+
+# Check whether --enable-profiling or --disable-profiling was given.
+if test "${enable_profiling+set}" = set; then
+  enableval="$enable_profiling"
+
+  case $enableval in
+    yes)
+      :
+      ;;
+    no)
+      :
+      ;;
+    *)
+      { { echo "$as_me:$LINENO: error: no argument expected for --enable-profiling option" >&5
+echo "$as_me: error: no argument expected for --enable-profiling option" >&2;}
+   { (exit 1); exit 1; }; }
+      ;;
+  esac
+
+else
+  enable_profiling=no
+
+fi;
+
+
+
+#
+# DTrace
+#
+
+pgac_args="$pgac_args enable_dtrace"
+
+# Check whether --enable-dtrace or --disable-dtrace was given.
+if test "${enable_dtrace+set}" = set; then
+  enableval="$enable_dtrace"
+
+  case $enableval in
+    yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define ENABLE_DTRACE 1
+_ACEOF
+
+for ac_prog in dtrace
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_DTRACE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DTRACE"; then
+  ac_cv_prog_DTRACE="$DTRACE" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DTRACE="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+DTRACE=$ac_cv_prog_DTRACE
+if test -n "$DTRACE"; then
+  echo "$as_me:$LINENO: result: $DTRACE" >&5
+echo "${ECHO_T}$DTRACE" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$DTRACE" && break
+done
+
+if test -z "$DTRACE"; then
+  { { echo "$as_me:$LINENO: error: dtrace not found" >&5
+echo "$as_me: error: dtrace not found" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+      ;;
+    no)
+      :
+      ;;
+    *)
+      { { echo "$as_me:$LINENO: error: no argument expected for --enable-dtrace option" >&5
+echo "$as_me: error: no argument expected for --enable-dtrace option" >&2;}
+   { (exit 1); exit 1; }; }
+      ;;
+  esac
+
+else
+  enable_dtrace=no
+
+fi;
+
+
+
 #
 # C compiler
 #
@@ -1943,6 +2071,7 @@ fi;
 # to use, although the standard way to do this is to set the CC environment
 # variable.
 
+pgac_args="$pgac_args with_CC"
 
 
 # Check whether --with-CC or --without-CC was given.
@@ -2714,12 +2843,66 @@ else
   fi
 fi
 
+# Some versions of GCC support some additional useful warning flags.
+# Check whether they are supported, and add them to CFLAGS if so.
+
 if test "$GCC" = yes; then
-  CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith -Winline"
 
-  # Some versions of GCC support some additional useful warning flags.
-  # Check whether they are supported, and add them to CFLAGS if so.
-  echo "$as_me:$LINENO: checking if $CC supports -Wdeclaration-after-statement" >&5
+# ICC pretends to be GCC but it's lying; it doesn't support these options.
+# So we have to check if "GCC" is really ICC.
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __INTEL_COMPILER
+choke me
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ICC=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ICC=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+  if test "$ICC" = no; then
+    CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith -Winline"
+
+    echo "$as_me:$LINENO: checking if $CC supports -Wdeclaration-after-statement" >&5
 echo $ECHO_N "checking if $CC supports -Wdeclaration-after-statement... $ECHO_C" >&6
 pgac_save_CFLAGS=$CFLAGS
 CFLAGS="$pgac_save_CFLAGS -Wdeclaration-after-statement"
@@ -2772,7 +2955,7 @@ echo "${ECHO_T}no" >&6
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
-  echo "$as_me:$LINENO: checking if $CC supports -Wendif-labels" >&5
+    echo "$as_me:$LINENO: checking if $CC supports -Wendif-labels" >&5
 echo $ECHO_N "checking if $CC supports -Wendif-labels... $ECHO_C" >&6
 pgac_save_CFLAGS=$CFLAGS
 CFLAGS="$pgac_save_CFLAGS -Wendif-labels"
@@ -2825,6 +3008,64 @@ echo "${ECHO_T}no" >&6
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
+  else
+    # Intel compiler has a bug/misoptimization in checking for
+    # division by NAN (NaN == 0), -mp1 fixes it, so add it to the
+    # CFLAGS.
+    echo "$as_me:$LINENO: checking if $CC supports -mp1" >&5
+echo $ECHO_N "checking if $CC supports -mp1... $ECHO_C" >&6
+pgac_save_CFLAGS=$CFLAGS
+CFLAGS="$pgac_save_CFLAGS -mp1"
+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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+CFLAGS="$pgac_save_CFLAGS"
+                    echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+  fi
 
   # Disable strict-aliasing rules; needed for gcc 3.3+
   echo "$as_me:$LINENO: checking if $CC supports -fno-strict-aliasing" >&5
@@ -2880,6 +3121,61 @@ echo "${ECHO_T}no" >&6
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
+elif test x"${CC}" = x"xlc"; then
+  # AIX xlc has to have strict aliasing turned off too
+  echo "$as_me:$LINENO: checking if $CC supports -qnoansialias" >&5
+echo $ECHO_N "checking if $CC supports -qnoansialias... $ECHO_C" >&6
+pgac_save_CFLAGS=$CFLAGS
+CFLAGS="$pgac_save_CFLAGS -qnoansialias"
+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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+CFLAGS="$pgac_save_CFLAGS"
+                    echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
 
 # supply -g if --enable-debug
@@ -2887,6 +3183,22 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
   CFLAGS="$CFLAGS -g"
 fi
 
+# enable profiling if --enable-profiling
+if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then
+  if test "$GCC" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define PROFILE_PID_DIR 1
+_ACEOF
+
+    CFLAGS="$CFLAGS -pg"
+  else
+    { { echo "$as_me:$LINENO: error: --enable-profiling is supported only when using GCC" >&5
+echo "$as_me: error: --enable-profiling is supported only when using GCC" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
 { echo "$as_me:$LINENO: using CFLAGS=$CFLAGS" >&5
 echo "$as_me: using CFLAGS=$CFLAGS" >&6;}
 
@@ -2898,7 +3210,6 @@ fi
 # Check if the compiler still works with the template settings
 echo "$as_me:$LINENO: checking whether the C compiler still works" >&5
 echo $ECHO_N "checking whether the C compiler still works... $ECHO_C" >&6
-
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -3272,6 +3583,7 @@ fi
 # Automatic dependency tracking
 #
 
+pgac_args="$pgac_args enable_depend"
 
 # Check whether --enable-depend or --disable-depend was given.
 if test "${enable_depend+set}" = set; then
@@ -3303,6 +3615,7 @@ fi;
 # Enable assert checks
 #
 
+pgac_args="$pgac_args enable_cassert"
 
 # Check whether --enable-cassert or --disable-cassert was given.
 if test "${enable_cassert+set}" = set; then
@@ -3372,7 +3685,9 @@ IFS=$ac_save_IFS
 #
 echo "$as_me:$LINENO: checking allow thread-safe client libraries" >&5
 echo $ECHO_N "checking allow thread-safe client libraries... $ECHO_C" >&6
+if test "$PORTNAME" != "win32"; then
 
+pgac_args="$pgac_args enable_thread_safety"
 
 # Check whether --enable-thread-safety or --disable-thread-safety was given.
 if test "${enable_thread_safety+set}" = set; then
@@ -3397,11 +3712,14 @@ else
 
 fi;
 
+else
+# Win32 should always use threads
 
+pgac_args="$pgac_args enable_thread_safety"
 
-# Check whether --enable-thread-safety-force or --disable-thread-safety-force was given.
-if test "${enable_thread_safety_force+set}" = set; then
-  enableval="$enable_thread_safety_force"
+# Check whether --enable-thread-safety or --disable-thread-safety was given.
+if test "${enable_thread_safety+set}" = set; then
+  enableval="$enable_thread_safety"
 
   case $enableval in
     yes)
@@ -3411,18 +3729,46 @@ if test "${enable_thread_safety_force+set}" = set; then
       :
       ;;
     *)
-      { { echo "$as_me:$LINENO: error: no argument expected for --enable-thread-safety-force option" >&5
-echo "$as_me: error: no argument expected for --enable-thread-safety-force option" >&2;}
+      { { echo "$as_me:$LINENO: error: no argument expected for --enable-thread-safety option" >&5
+echo "$as_me: error: no argument expected for --enable-thread-safety option" >&2;}
    { (exit 1); exit 1; }; }
       ;;
   esac
 
 else
-  enable_thread_safety_force=no
+  enable_thread_safety=yes
 
 fi;
 
-if test "$enable_thread_safety" = yes -o \
+fi
+
+
+pgac_args="$pgac_args enable_thread_safety_force"
+
+# Check whether --enable-thread-safety-force or --disable-thread-safety-force was given.
+if test "${enable_thread_safety_force+set}" = set; then
+  enableval="$enable_thread_safety_force"
+
+  case $enableval in
+    yes)
+      :
+      ;;
+    no)
+      :
+      ;;
+    *)
+      { { echo "$as_me:$LINENO: error: no argument expected for --enable-thread-safety-force option" >&5
+echo "$as_me: error: no argument expected for --enable-thread-safety-force option" >&2;}
+   { (exit 1); exit 1; }; }
+      ;;
+  esac
+
+else
+  enable_thread_safety_force=no
+
+fi;
+
+if test "$enable_thread_safety" = yes -o \
         "$enable_thread_safety_force" = yes; then
   enable_thread_safety="yes"   # for 'force'
 
@@ -3441,6 +3787,7 @@ echo "${ECHO_T}$enable_thread_safety" >&6
 echo "$as_me:$LINENO: checking whether to build with Tcl" >&5
 echo $ECHO_N "checking whether to build with Tcl... $ECHO_C" >&6
 
+pgac_args="$pgac_args with_tcl"
 
 
 # Check whether --with-tcl or --without-tcl was given.
@@ -3474,6 +3821,7 @@ echo "${ECHO_T}$with_tcl" >&6
 # This will override the use of tclsh to find the paths to search.
 
 
+pgac_args="$pgac_args with_tclconfig"
 
 
 # Check whether --with-tclconfig or --without-tclconfig was given.
@@ -3505,6 +3853,7 @@ fi;
 echo "$as_me:$LINENO: checking whether to build Perl modules" >&5
 echo $ECHO_N "checking whether to build Perl modules... $ECHO_C" >&6
 
+pgac_args="$pgac_args with_perl"
 
 
 # Check whether --with-perl or --without-perl was given.
@@ -3540,6 +3889,7 @@ echo "${ECHO_T}$with_perl" >&6
 echo "$as_me:$LINENO: checking whether to build Python modules" >&5
 echo $ECHO_N "checking whether to build Python modules... $ECHO_C" >&6
 
+pgac_args="$pgac_args with_python"
 
 
 # Check whether --with-python or --without-python was given.
@@ -3575,6 +3925,7 @@ echo "${ECHO_T}$with_python" >&6
 echo "$as_me:$LINENO: checking whether to build with Kerberos 5 support" >&5
 echo $ECHO_N "checking whether to build with Kerberos 5 support... $ECHO_C" >&6
 
+pgac_args="$pgac_args with_krb5"
 
 
 # Check whether --with-krb5 or --without-krb5 was given.
@@ -3619,6 +3970,7 @@ echo "${ECHO_T}$with_krb5" >&6
 # Kerberos configuration parameters
 #
 
+pgac_args="$pgac_args with_krb_srvnam"
 
 
 # Check whether --with-krb-srvnam or --without-krb-srvnam was given.
@@ -3658,6 +4010,7 @@ _ACEOF
 echo "$as_me:$LINENO: checking whether to build with PAM support" >&5
 echo $ECHO_N "checking whether to build with PAM support... $ECHO_C" >&6
 
+pgac_args="$pgac_args with_pam"
 
 
 # Check whether --with-pam or --without-pam was given.
@@ -3692,12 +4045,54 @@ echo "${ECHO_T}$with_pam" >&6
 
 
 
+#
+# LDAP
+#
+echo "$as_me:$LINENO: checking whether to build with LDAP support" >&5
+echo $ECHO_N "checking whether to build with LDAP support... $ECHO_C" >&6
+
+pgac_args="$pgac_args with_ldap"
+
+
+# Check whether --with-ldap or --without-ldap was given.
+if test "${with_ldap+set}" = set; then
+  withval="$with_ldap"
+
+  case $withval in
+    yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_LDAP 1
+_ACEOF
+
+      ;;
+    no)
+      :
+      ;;
+    *)
+      { { echo "$as_me:$LINENO: error: no argument expected for --with-ldap option" >&5
+echo "$as_me: error: no argument expected for --with-ldap option" >&2;}
+   { (exit 1); exit 1; }; }
+      ;;
+  esac
+
+else
+  with_ldap=no
+
+fi;
+
+echo "$as_me:$LINENO: result: $with_ldap" >&5
+echo "${ECHO_T}$with_ldap" >&6
+
+
+
 #
 # Bonjour
 #
 echo "$as_me:$LINENO: checking whether to build with Bonjour support" >&5
 echo $ECHO_N "checking whether to build with Bonjour support... $ECHO_C" >&6
 
+pgac_args="$pgac_args with_bonjour"
 
 
 # Check whether --with-bonjour or --without-bonjour was given.
@@ -3738,6 +4133,7 @@ echo "${ECHO_T}$with_bonjour" >&6
 echo "$as_me:$LINENO: checking whether to build with OpenSSL support" >&5
 echo $ECHO_N "checking whether to build with OpenSSL support... $ECHO_C" >&6
 
+pgac_args="$pgac_args with_openssl"
 
 
 # Check whether --with-openssl or --without-openssl was given.
@@ -3772,10 +4168,53 @@ echo "${ECHO_T}$with_openssl" >&6
 
 
 
+#
+# Readline
+#
+
+pgac_args="$pgac_args with_readline"
+
+
+# Check whether --with-readline or --without-readline was given.
+if test "${with_readline+set}" = set; then
+  withval="$with_readline"
+
+  case $withval in
+    yes)
+      :
+      ;;
+    no)
+      :
+      ;;
+    *)
+      { { echo "$as_me:$LINENO: error: no argument expected for --with-readline option" >&5
+echo "$as_me: error: no argument expected for --with-readline option" >&2;}
+   { (exit 1); exit 1; }; }
+      ;;
+  esac
+
+else
+  with_readline=yes
+
+fi;
+
+# readline on MinGW has problems with backslashes in psql and other bugs.
+# This is particularly a problem with non-US code pages.
+# Therefore disable its use until we understand the cause. 2004-07-20
+if test "$PORTNAME" = "win32"; then
+  if test "$with_readline" = yes; then
+    { echo "$as_me:$LINENO: WARNING: *** Readline does not work on MinGW --- disabling" >&5
+echo "$as_me: WARNING: *** Readline does not work on MinGW --- disabling" >&2;}
+    with_readline=no
+  fi
+fi
+
+
 #
 # Prefer libedit
 #
 
+pgac_args="$pgac_args with_libedit_preferred"
 
 
 # Check whether --with-libedit-preferred or --without-libedit-preferred was given.
@@ -3804,14 +4243,15 @@ fi;
 
 
 #
-# Readline
+# OSSP UUID library
 #
 
+pgac_args="$pgac_args with_ossp_uuid"
 
 
-# Check whether --with-readline or --without-readline was given.
-if test "${with_readline+set}" = set; then
-  withval="$with_readline"
+# Check whether --with-ossp-uuid or --without-ossp-uuid was given.
+if test "${with_ossp_uuid+set}" = set; then
+  withval="$with_ossp_uuid"
 
   case $withval in
     yes)
@@ -3821,33 +4261,155 @@ if test "${with_readline+set}" = set; then
       :
       ;;
     *)
-      { { echo "$as_me:$LINENO: error: no argument expected for --with-readline option" >&5
-echo "$as_me: error: no argument expected for --with-readline option" >&2;}
+      { { echo "$as_me:$LINENO: error: no argument expected for --with-ossp-uuid option" >&5
+echo "$as_me: error: no argument expected for --with-ossp-uuid option" >&2;}
    { (exit 1); exit 1; }; }
       ;;
   esac
 
 else
-  with_readline=yes
+  with_ossp_uuid=no
 
 fi;
 
-# readline on MinGW has problems with backslashes in psql and other bugs.
-# This is particularly a problem with non-US code pages.
-# Therefore disable its use until we understand the cause. 2004-07-20
-if test "$PORTNAME" = "win32"; then
-  if test "$with_readline" = yes; then
-    { echo "$as_me:$LINENO: WARNING: *** Readline does not work on MinGW --- disabling" >&5
-echo "$as_me: WARNING: *** Readline does not work on MinGW --- disabling" >&2;}
-    with_readline=no
+
+
+
+#
+# XML
+#
+
+pgac_args="$pgac_args with_libxml"
+
+
+# Check whether --with-libxml or --without-libxml was given.
+if test "${with_libxml+set}" = set; then
+  withval="$with_libxml"
+
+  case $withval in
+    yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_LIBXML 1
+_ACEOF
+
+      ;;
+    no)
+      :
+      ;;
+    *)
+      { { echo "$as_me:$LINENO: error: no argument expected for --with-libxml option" >&5
+echo "$as_me: error: no argument expected for --with-libxml option" >&2;}
+   { (exit 1); exit 1; }; }
+      ;;
+  esac
+
+else
+  with_libxml=no
+
+fi;
+
+
+if test "$with_libxml" = yes ; then
+  for ac_prog in xml2-config
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_XML2_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$XML2_CONFIG"; then
+  ac_cv_prog_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_XML2_CONFIG="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+XML2_CONFIG=$ac_cv_prog_XML2_CONFIG
+if test -n "$XML2_CONFIG"; then
+  echo "$as_me:$LINENO: result: $XML2_CONFIG" >&5
+echo "${ECHO_T}$XML2_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$XML2_CONFIG" && break
+done
+
+  if test -n "$XML2_CONFIG"; then
+    for pgac_option in `$XML2_CONFIG --cflags`; do
+      case $pgac_option in
+        -I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";;
+      esac
+    done
+    for pgac_option in `$XML2_CONFIG --libs`; do
+      case $pgac_option in
+        -L*) LDFLAGS="$LDFLAGS $pgac_option";;
+      esac
+    done
   fi
 fi
 
 
+
+#
+# XSLT
+#
+
+pgac_args="$pgac_args with_libxslt"
+
+
+# Check whether --with-libxslt or --without-libxslt was given.
+if test "${with_libxslt+set}" = set; then
+  withval="$with_libxslt"
+
+  case $withval in
+    yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_LIBXSLT 1
+_ACEOF
+
+      ;;
+    no)
+      :
+      ;;
+    *)
+      { { echo "$as_me:$LINENO: error: no argument expected for --with-libxslt option" >&5
+echo "$as_me: error: no argument expected for --with-libxslt option" >&2;}
+   { (exit 1); exit 1; }; }
+      ;;
+  esac
+
+else
+  with_libxslt=no
+
+fi;
+
+
+
+
+
 #
 # Zlib
 #
 
+pgac_args="$pgac_args with_zlib"
 
 
 # Check whether --with-zlib or --without-zlib was given.
@@ -4310,46 +4872,6 @@ else
   RANLIB="$ac_cv_prog_RANLIB"
 fi
 
-for ac_prog in lorder
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_LORDER+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$LORDER"; then
-  ac_cv_prog_LORDER="$LORDER" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_LORDER="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-LORDER=$ac_cv_prog_LORDER
-if test -n "$LORDER"; then
-  echo "$as_me:$LINENO: result: $LORDER" >&5
-echo "${ECHO_T}$LORDER" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$LORDER" && break
-done
-
 # Extract the first word of "tar", so it can be a program name with args.
 set dummy tar; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -4488,7 +5010,8 @@ echo "${ECHO_T}no" >&6
 
 
 
-for ac_prog in 'bison -y'
+if test -z "$YACC"; then
+  for ac_prog in 'bison -y'
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
@@ -4529,34 +5052,36 @@ fi
 done
 
 
-if test "$YACC"; then
-  if $YACC --version | sed q | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'; then
-    { echo "$as_me:$LINENO: WARNING:
-*** If you are going to modify the grammar files or build from CVS, the installed
-*** version of Bison is too old.  Bison version 1.875 or later is required." >&5
+  if test "$YACC"; then
+    if $YACC --version | sed q | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'; then
+      { echo "$as_me:$LINENO: WARNING:
+*** The installed version of Bison is too old to use with PostgreSQL.
+*** Bison version 1.875 or later is required." >&5
 echo "$as_me: WARNING:
-*** If you are going to modify the grammar files or build from CVS, the installed
-*** version of Bison is too old.  Bison version 1.875 or later is required." >&2;}
+*** The installed version of Bison is too old to use with PostgreSQL.
+*** Bison version 1.875 or later is required." >&2;}
+      YACC=""
+    fi
   fi
-fi
 
-if test -z "$YACC"; then
-  { echo "$as_me:$LINENO: WARNING:
-*** Without Bison you will not be able to build PostgreSQL from CVS or
+  if test -z "$YACC"; then
+    { echo "$as_me:$LINENO: WARNING:
+*** Without Bison you will not be able to build PostgreSQL from CVS nor
 *** change any of the parser definition files.  You can obtain Bison from
 *** 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
+*** PostgreSQL then you do not need to worry about this, because the Bison
 *** output is pre-generated.)  To use a different yacc program (possible,
 *** but not recommended), set the environment variable YACC before running
 *** 'configure'." >&5
 echo "$as_me: WARNING:
-*** Without Bison you will not be able to build PostgreSQL from CVS or
+*** Without Bison you will not be able to build PostgreSQL from CVS nor
 *** change any of the parser definition files.  You can obtain Bison from
 *** 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
+*** PostgreSQL then you do not need to worry about this, because the Bison
 *** output is pre-generated.)  To use a different yacc program (possible,
 *** but not recommended), set the environment variable YACC before running
 *** 'configure'." >&2;}
+  fi
 fi
 
 
@@ -4730,9 +5255,9 @@ if test "$pythreads" = "1"; then
   echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6
   case $host_os in
-  openbsd*|freebsd4*)
-    { { echo "$as_me:$LINENO: error: *** Threaded Python not supported on this platform ***" >&5
-echo "$as_me: error: *** Threaded Python not supported on this platform ***" >&2;}
+  openbsd*|freebsd*)
+    { { echo "$as_me:$LINENO: error: threaded Python not supported on this platform" >&5
+echo "$as_me: error: threaded Python not supported on this platform" >&2;}
    { (exit 1); exit 1; }; }
     ;;
   esac
@@ -4744,21 +5269,34 @@ fi
 
 fi
 
+# Supply a numeric version string for use by 3rd party add-ons
+# awk -F is a regex on some platforms, and not on others, so make "." a tab
+PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/A-Za-z.*$//' |
+tr '.' '       ' |
+$AWK '{printf \"%d%02d%02d\", $1, $2, (NF >= 3) ? $3 : 0}'`"
+
+cat >>confdefs.h <<_ACEOF
+#define PG_VERSION_NUM $PG_VERSION_NUM
+_ACEOF
+
 
 ##
 ## Libraries
 ##
+## Most libraries are included only if they demonstrably provide a function
+## we need, but libm is an exception: always include it, because there are
+## too many compilers that play cute optimization games that will break
+## probes for standard functions such as pow().
+##
 
-if test "$PORTNAME" != "aix" -a "$PORTNAME" != "alpha"
-then
 
-echo "$as_me:$LINENO: checking for main in -lbsd" >&5
-echo $ECHO_N "checking for main in -lbsd... $ECHO_C" >&6
-if test "${ac_cv_lib_bsd_main+set}" = set; then
+echo "$as_me:$LINENO: checking for main in -lm" >&5
+echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
+if test "${ac_cv_lib_m_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbsd  $LIBS"
+LIBS="-lm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4797,37 +5335,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_bsd_main=yes
+  ac_cv_lib_m_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_bsd_main=no
+ac_cv_lib_m_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_main" >&5
-echo "${ECHO_T}$ac_cv_lib_bsd_main" >&6
-if test $ac_cv_lib_bsd_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBBSD 1
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5
+echo "${ECHO_T}$ac_cv_lib_m_main" >&6
+if test $ac_cv_lib_m_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
 _ACEOF
 
-  LIBS="-lbsd $LIBS"
-
-fi
+  LIBS="-lm $LIBS"
 
 fi
 
-echo "$as_me:$LINENO: checking for setproctitle in -lutil" >&5
-echo $ECHO_N "checking for setproctitle in -lutil... $ECHO_C" >&6
-if test "${ac_cv_lib_util_setproctitle+set}" = set; then
+echo "$as_me:$LINENO: checking for library containing setproctitle" >&5
+echo $ECHO_N "checking for library containing setproctitle... $ECHO_C" >&6
+if test "${ac_cv_search_setproctitle+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lutil  $LIBS"
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_setproctitle=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4872,48 +5408,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_util_setproctitle=yes
+  ac_cv_search_setproctitle="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_util_setproctitle=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_util_setproctitle" >&5
-echo "${ECHO_T}$ac_cv_lib_util_setproctitle" >&6
-if test $ac_cv_lib_util_setproctitle = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBUTIL 1
-_ACEOF
-
-  LIBS="-lutil $LIBS"
-
-fi
-
-
-echo "$as_me:$LINENO: checking for main in -lm" >&5
-echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
-if test "${ac_cv_lib_m_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+if test "$ac_cv_search_setproctitle" = no; then
+  for ac_lib in util; do
+    LIBS="-l$ac_lib  $ac_func_search_save_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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char setproctitle ();
 int
 main ()
 {
-main ();
+setproctitle ();
   ;
   return 0;
 }
@@ -4940,36 +5463,33 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_m_main=yes
+  ac_cv_search_setproctitle="-l$ac_lib"
+break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_m_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+  done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5
-echo "${ECHO_T}$ac_cv_lib_m_main" >&6
-if test $ac_cv_lib_m_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBM 1
-_ACEOF
-
-  LIBS="-lm $LIBS"
-
+LIBS=$ac_func_search_save_LIBS
 fi
+echo "$as_me:$LINENO: result: $ac_cv_search_setproctitle" >&5
+echo "${ECHO_T}$ac_cv_search_setproctitle" >&6
+if test "$ac_cv_search_setproctitle" != no; then
+  test "$ac_cv_search_setproctitle" = "none required" || LIBS="$ac_cv_search_setproctitle $LIBS"
 
+fi
 
-echo "$as_me:$LINENO: checking for main in -ldl" >&5
-echo $ECHO_N "checking for main in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_main+set}" = set; then
+echo "$as_me:$LINENO: checking for library containing dlopen" >&5
+echo $ECHO_N "checking for library containing dlopen... $ECHO_C" >&6
+if test "${ac_cv_search_dlopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_dlopen=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4977,11 +5497,17 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
 int
 main ()
 {
-main ();
+dlopen ();
   ;
   return 0;
 }
@@ -5008,48 +5534,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_dl_main=yes
+  ac_cv_search_dlopen="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dl_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_main" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_main" >&6
-if test $ac_cv_lib_dl_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDL 1
-_ACEOF
-
-  LIBS="-ldl $LIBS"
-
-fi
-
-
-echo "$as_me:$LINENO: checking for main in -lnsl" >&5
-echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6
-if test "${ac_cv_lib_nsl_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+if test "$ac_cv_search_dlopen" = no; then
+  for ac_lib in dl; do
+    LIBS="-l$ac_lib  $ac_func_search_save_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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dlopen ();
 int
 main ()
 {
-main ();
+dlopen ();
   ;
   return 0;
 }
@@ -5076,36 +5589,33 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_nsl_main=yes
+  ac_cv_search_dlopen="-l$ac_lib"
+break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_nsl_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+  done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6
-if test $ac_cv_lib_nsl_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNSL 1
-_ACEOF
-
-  LIBS="-lnsl $LIBS"
-
+LIBS=$ac_func_search_save_LIBS
 fi
+echo "$as_me:$LINENO: result: $ac_cv_search_dlopen" >&5
+echo "${ECHO_T}$ac_cv_search_dlopen" >&6
+if test "$ac_cv_search_dlopen" != no; then
+  test "$ac_cv_search_dlopen" = "none required" || LIBS="$ac_cv_search_dlopen $LIBS"
 
+fi
 
-echo "$as_me:$LINENO: checking for main in -lsocket" >&5
-echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6
-if test "${ac_cv_lib_socket_main+set}" = set; then
+echo "$as_me:$LINENO: checking for library containing socket" >&5
+echo $ECHO_N "checking for library containing socket... $ECHO_C" >&6
+if test "${ac_cv_search_socket+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket  $LIBS"
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_socket=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5113,11 +5623,17 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char socket ();
 int
 main ()
 {
-main ();
+socket ();
   ;
   return 0;
 }
@@ -5144,48 +5660,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_socket_main=yes
+  ac_cv_search_socket="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_socket_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_main" >&6
-if test $ac_cv_lib_socket_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSOCKET 1
-_ACEOF
-
-  LIBS="-lsocket $LIBS"
-
-fi
-
-
-echo "$as_me:$LINENO: checking for main in -lipc" >&5
-echo $ECHO_N "checking for main in -lipc... $ECHO_C" >&6
-if test "${ac_cv_lib_ipc_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lipc  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+if test "$ac_cv_search_socket" = no; then
+  for ac_lib in socket wsock32; do
+    LIBS="-l$ac_lib  $ac_func_search_save_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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char socket ();
 int
 main ()
 {
-main ();
+socket ();
   ;
   return 0;
 }
@@ -5212,36 +5715,33 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_ipc_main=yes
+  ac_cv_search_socket="-l$ac_lib"
+break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_ipc_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+  done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_main" >&5
-echo "${ECHO_T}$ac_cv_lib_ipc_main" >&6
-if test $ac_cv_lib_ipc_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBIPC 1
-_ACEOF
-
-  LIBS="-lipc $LIBS"
-
+LIBS=$ac_func_search_save_LIBS
 fi
+echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5
+echo "${ECHO_T}$ac_cv_search_socket" >&6
+if test "$ac_cv_search_socket" != no; then
+  test "$ac_cv_search_socket" = "none required" || LIBS="$ac_cv_search_socket $LIBS"
 
+fi
 
-echo "$as_me:$LINENO: checking for main in -lIPC" >&5
-echo $ECHO_N "checking for main in -lIPC... $ECHO_C" >&6
-if test "${ac_cv_lib_IPC_main+set}" = set; then
+echo "$as_me:$LINENO: checking for library containing shl_load" >&5
+echo $ECHO_N "checking for library containing shl_load... $ECHO_C" >&6
+if test "${ac_cv_search_shl_load+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lIPC  $LIBS"
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_shl_load=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5249,11 +5749,17 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
 int
 main ()
 {
-main ();
+shl_load ();
   ;
   return 0;
 }
@@ -5280,48 +5786,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_IPC_main=yes
+  ac_cv_search_shl_load="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_IPC_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_IPC_main" >&5
-echo "${ECHO_T}$ac_cv_lib_IPC_main" >&6
-if test $ac_cv_lib_IPC_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBIPC 1
-_ACEOF
-
-  LIBS="-lIPC $LIBS"
-
-fi
-
-
-echo "$as_me:$LINENO: checking for main in -llc" >&5
-echo $ECHO_N "checking for main in -llc... $ECHO_C" >&6
-if test "${ac_cv_lib_lc_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-llc  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+if test "$ac_cv_search_shl_load" = no; then
+  for ac_lib in dld; do
+    LIBS="-l$ac_lib  $ac_func_search_save_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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shl_load ();
 int
 main ()
 {
-main ();
+shl_load ();
   ;
   return 0;
 }
@@ -5348,36 +5841,36 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_lc_main=yes
+  ac_cv_search_shl_load="-l$ac_lib"
+break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_lc_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+  done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_lc_main" >&5
-echo "${ECHO_T}$ac_cv_lib_lc_main" >&6
-if test $ac_cv_lib_lc_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBLC 1
-_ACEOF
-
-  LIBS="-llc $LIBS"
-
+LIBS=$ac_func_search_save_LIBS
 fi
+echo "$as_me:$LINENO: result: $ac_cv_search_shl_load" >&5
+echo "${ECHO_T}$ac_cv_search_shl_load" >&6
+if test "$ac_cv_search_shl_load" != no; then
+  test "$ac_cv_search_shl_load" = "none required" || LIBS="$ac_cv_search_shl_load $LIBS"
 
+fi
 
-echo "$as_me:$LINENO: checking for main in -ldld" >&5
-echo $ECHO_N "checking for main in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_main+set}" = set; then
+# We only use libld in port/dynloader/aix.c
+case $host_os in
+     aix*)
+       echo "$as_me:$LINENO: checking for library containing ldopen" >&5
+echo $ECHO_N "checking for library containing ldopen... $ECHO_C" >&6
+if test "${ac_cv_search_ldopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_ldopen=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5385,11 +5878,17 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char ldopen ();
 int
 main ()
 {
-main ();
+ldopen ();
   ;
   return 0;
 }
@@ -5416,48 +5915,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_dld_main=yes
+  ac_cv_search_ldopen="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dld_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_main" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_main" >&6
-if test $ac_cv_lib_dld_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDLD 1
-_ACEOF
-
-  LIBS="-ldld $LIBS"
-
-fi
-
-
-echo "$as_me:$LINENO: checking for main in -lld" >&5
-echo $ECHO_N "checking for main in -lld... $ECHO_C" >&6
-if test "${ac_cv_lib_ld_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+if test "$ac_cv_search_ldopen" = no; then
+  for ac_lib in ld; do
+    LIBS="-l$ac_lib  $ac_func_search_save_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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char ldopen ();
 int
 main ()
 {
-main ();
+ldopen ();
   ;
   return 0;
 }
@@ -5484,36 +5970,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_ld_main=yes
+  ac_cv_search_ldopen="-l$ac_lib"
+break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_ld_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+  done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_ld_main" >&5
-echo "${ECHO_T}$ac_cv_lib_ld_main" >&6
-if test $ac_cv_lib_ld_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBLD 1
-_ACEOF
-
-  LIBS="-lld $LIBS"
-
+LIBS=$ac_func_search_save_LIBS
 fi
+echo "$as_me:$LINENO: result: $ac_cv_search_ldopen" >&5
+echo "${ECHO_T}$ac_cv_search_ldopen" >&6
+if test "$ac_cv_search_ldopen" != no; then
+  test "$ac_cv_search_ldopen" = "none required" || LIBS="$ac_cv_search_ldopen $LIBS"
 
+fi
 
-echo "$as_me:$LINENO: checking for main in -lcompat" >&5
-echo $ECHO_N "checking for main in -lcompat... $ECHO_C" >&6
-if test "${ac_cv_lib_compat_main+set}" = set; then
+       ;;
+esac
+echo "$as_me:$LINENO: checking for library containing getopt_long" >&5
+echo $ECHO_N "checking for library containing getopt_long... $ECHO_C" >&6
+if test "${ac_cv_search_getopt_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcompat  $LIBS"
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_getopt_long=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5521,11 +6006,17 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char getopt_long ();
 int
 main ()
 {
-main ();
+getopt_long ();
   ;
   return 0;
 }
@@ -5552,48 +6043,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_compat_main=yes
+  ac_cv_search_getopt_long="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_compat_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_compat_main" >&5
-echo "${ECHO_T}$ac_cv_lib_compat_main" >&6
-if test $ac_cv_lib_compat_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCOMPAT 1
+if test "$ac_cv_search_getopt_long" = no; then
+  for ac_lib in getopt gnugetopt; do
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-  LIBS="-lcompat $LIBS"
-
-fi
-
-
-echo "$as_me:$LINENO: checking for main in -lBSD" >&5
-echo $ECHO_N "checking for main in -lBSD... $ECHO_C" >&6
-if test "${ac_cv_lib_BSD_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lBSD  $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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char getopt_long ();
 int
 main ()
 {
-main ();
+getopt_long ();
   ;
   return 0;
 }
@@ -5620,104 +6098,33 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_BSD_main=yes
+  ac_cv_search_getopt_long="-l$ac_lib"
+break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_BSD_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_BSD_main" >&5
-echo "${ECHO_T}$ac_cv_lib_BSD_main" >&6
-if test $ac_cv_lib_BSD_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBBSD 1
-_ACEOF
-
-  LIBS="-lBSD $LIBS"
-
-fi
-
-
-echo "$as_me:$LINENO: checking for main in -lgen" >&5
-echo $ECHO_N "checking for main in -lgen... $ECHO_C" >&6
-if test "${ac_cv_lib_gen_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgen  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-main ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_gen_main=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_gen_main=no
+  done
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+LIBS=$ac_func_search_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_gen_main" >&5
-echo "${ECHO_T}$ac_cv_lib_gen_main" >&6
-if test $ac_cv_lib_gen_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGEN 1
-_ACEOF
-
-  LIBS="-lgen $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_search_getopt_long" >&5
+echo "${ECHO_T}$ac_cv_search_getopt_long" >&6
+if test "$ac_cv_search_getopt_long" != no; then
+  test "$ac_cv_search_getopt_long" = "none required" || LIBS="$ac_cv_search_getopt_long $LIBS"
 
 fi
 
-
-echo "$as_me:$LINENO: checking for main in -lPW" >&5
-echo $ECHO_N "checking for main in -lPW... $ECHO_C" >&6
-if test "${ac_cv_lib_PW_main+set}" = set; then
+echo "$as_me:$LINENO: checking for library containing crypt" >&5
+echo $ECHO_N "checking for library containing crypt... $ECHO_C" >&6
+if test "${ac_cv_search_crypt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lPW  $LIBS"
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_crypt=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5725,11 +6132,17 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char crypt ();
 int
 main ()
 {
-main ();
+crypt ();
   ;
   return 0;
 }
@@ -5756,48 +6169,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_PW_main=yes
+  ac_cv_search_crypt="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_PW_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_PW_main" >&5
-echo "${ECHO_T}$ac_cv_lib_PW_main" >&6
-if test $ac_cv_lib_PW_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBPW 1
-_ACEOF
-
-  LIBS="-lPW $LIBS"
-
-fi
-
-
-echo "$as_me:$LINENO: checking for main in -lresolv" >&5
-echo $ECHO_N "checking for main in -lresolv... $ECHO_C" >&6
-if test "${ac_cv_lib_resolv_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lresolv  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+if test "$ac_cv_search_crypt" = no; then
+  for ac_lib in crypt; do
+    LIBS="-l$ac_lib  $ac_func_search_save_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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char crypt ();
 int
 main ()
 {
-main ();
+crypt ();
   ;
   return 0;
 }
@@ -5824,35 +6224,34 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_resolv_main=yes
+  ac_cv_search_crypt="-l$ac_lib"
+break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_resolv_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+  done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5
-echo "${ECHO_T}$ac_cv_lib_resolv_main" >&6
-if test $ac_cv_lib_resolv_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBRESOLV 1
-_ACEOF
-
-  LIBS="-lresolv $LIBS"
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_crypt" >&5
+echo "${ECHO_T}$ac_cv_search_crypt" >&6
+if test "$ac_cv_search_crypt" != no; then
+  test "$ac_cv_search_crypt" = "none required" || LIBS="$ac_cv_search_crypt $LIBS"
 
 fi
 
-echo "$as_me:$LINENO: checking for library containing getopt_long" >&5
-echo $ECHO_N "checking for library containing getopt_long... $ECHO_C" >&6
-if test "${ac_cv_search_getopt_long+set}" = set; then
+# Solaris:
+echo "$as_me:$LINENO: checking for library containing fdatasync" >&5
+echo $ECHO_N "checking for library containing fdatasync... $ECHO_C" >&6
+if test "${ac_cv_search_fdatasync+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_func_search_save_LIBS=$LIBS
-ac_cv_search_getopt_long=no
+ac_cv_search_fdatasync=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5866,11 +6265,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char getopt_long ();
+char fdatasync ();
 int
 main ()
 {
-getopt_long ();
+fdatasync ();
   ;
   return 0;
 }
@@ -5897,7 +6296,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_getopt_long="none required"
+  ac_cv_search_fdatasync="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -5905,8 +6304,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_getopt_long" = no; then
-  for ac_lib in getopt gnugetopt; do
+if test "$ac_cv_search_fdatasync" = no; then
+  for ac_lib in rt posix4; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -5921,11 +6320,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char getopt_long ();
+char fdatasync ();
 int
 main ()
 {
-getopt_long ();
+fdatasync ();
   ;
   return 0;
 }
@@ -5952,7 +6351,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_getopt_long="-l$ac_lib"
+  ac_cv_search_fdatasync="-l$ac_lib"
 break
 else
   echo "$as_me: failed program was:" >&5
@@ -5965,22 +6364,21 @@ rm -f conftest.err conftest.$ac_objext \
 fi
 LIBS=$ac_func_search_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_getopt_long" >&5
-echo "${ECHO_T}$ac_cv_search_getopt_long" >&6
-if test "$ac_cv_search_getopt_long" != no; then
-  test "$ac_cv_search_getopt_long" = "none required" || LIBS="$ac_cv_search_getopt_long $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_search_fdatasync" >&5
+echo "${ECHO_T}$ac_cv_search_fdatasync" >&6
+if test "$ac_cv_search_fdatasync" != no; then
+  test "$ac_cv_search_fdatasync" = "none required" || LIBS="$ac_cv_search_fdatasync $LIBS"
 
 fi
 
-# QNX:
-
-echo "$as_me:$LINENO: checking for main in -lunix" >&5
-echo $ECHO_N "checking for main in -lunix... $ECHO_C" >&6
-if test "${ac_cv_lib_unix_main+set}" = set; then
+# Cygwin:
+echo "$as_me:$LINENO: checking for library containing shmget" >&5
+echo $ECHO_N "checking for library containing shmget... $ECHO_C" >&6
+if test "${ac_cv_search_shmget+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lunix  $LIBS"
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_shmget=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5988,11 +6386,17 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char shmget ();
 int
 main ()
 {
-main ();
+shmget ();
   ;
   return 0;
 }
@@ -6019,36 +6423,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_unix_main=yes
+  ac_cv_search_shmget="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_unix_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_unix_main" >&5
-echo "${ECHO_T}$ac_cv_lib_unix_main" >&6
-if test $ac_cv_lib_unix_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBUNIX 1
-_ACEOF
-
-  LIBS="-lunix $LIBS"
-
-fi
-
-echo "$as_me:$LINENO: checking for library containing crypt" >&5
-echo $ECHO_N "checking for library containing crypt... $ECHO_C" >&6
-if test "${ac_cv_search_crypt+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_crypt=no
-cat >conftest.$ac_ext <<_ACEOF
+if test "$ac_cv_search_shmget" = no; then
+  for ac_lib in cygipc; do
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6061,11 +6447,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char crypt ();
+char shmget ();
 int
 main ()
 {
-crypt ();
+shmget ();
   ;
   return 0;
 }
@@ -6092,7 +6478,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_crypt="none required"
+  ac_cv_search_shmget="-l$ac_lib"
+break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -6100,9 +6487,35 @@ sed 's/^/| /' conftest.$ac_ext >&5
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_crypt" = no; then
-  for ac_lib in crypt; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_shmget" >&5
+echo "${ECHO_T}$ac_cv_search_shmget" >&6
+if test "$ac_cv_search_shmget" != no; then
+  test "$ac_cv_search_shmget" = "none required" || LIBS="$ac_cv_search_shmget $LIBS"
+
+fi
+
+
+if test "$with_readline" = yes; then
+
+
+if test "${pgac_cv_check_readline+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  pgac_cv_check_readline=no
+pgac_save_LIBS=$LIBS
+if test x"$with_libedit_preferred" != x"yes"
+then   READLINE_ORDER="-lreadline -ledit"
+else   READLINE_ORDER="-ledit -lreadline"
+fi
+for pgac_rllib in $READLINE_ORDER ; do
+  echo "$as_me:$LINENO: checking for ${pgac_rllib}" >&5
+echo $ECHO_N "checking for ${pgac_rllib}... $ECHO_C" >&6
+  for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
+    LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6116,11 +6529,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char crypt ();
+char readline ();
 int
 main ()
 {
-crypt ();
+readline ();
   ;
   return 0;
 }
@@ -6147,37 +6560,73 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_crypt="-l$ac_lib"
-break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+
+      # Older NetBSD, OpenBSD, and Irix have a broken linker that does not
+      # recognize dependent libraries; assume curses is needed if we didn't
+      # find any dependency.
+      case $host_os in
+        netbsd* | openbsd* | irix*)
+          if test x"$pgac_lib" = x"" ; then
+            pgac_lib=" -lcurses"
+          fi ;;
+      esac
+
+      pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
+      break
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
   done
+  if test "$pgac_cv_check_readline" != no ; then
+    echo "$as_me:$LINENO: result: yes ($pgac_cv_check_readline)" >&5
+echo "${ECHO_T}yes ($pgac_cv_check_readline)" >&6
+    break
+  else
+    echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+  fi
+done
+LIBS=$pgac_save_LIBS
+
 fi
-LIBS=$ac_func_search_save_LIBS
+
+if test "$pgac_cv_check_readline" != no ; then
+  LIBS="$pgac_cv_check_readline $LIBS"
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBREADLINE 1
+_ACEOF
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_crypt" >&5
-echo "${ECHO_T}$ac_cv_search_crypt" >&6
-if test "$ac_cv_search_crypt" != no; then
-  test "$ac_cv_search_crypt" = "none required" || LIBS="$ac_cv_search_crypt $LIBS"
 
+
+  if test x"$pgac_cv_check_readline" = x"no"; then
+    { { echo "$as_me:$LINENO: error: readline library not found
+If you have readline already installed, see config.log for details on the
+failure.  It is possible the compiler isn't looking in the proper directory.
+Use --without-readline to disable readline support." >&5
+echo "$as_me: error: readline library not found
+If you have readline already installed, see config.log for details on the
+failure.  It is possible the compiler isn't looking in the proper directory.
+Use --without-readline to disable readline support." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
 fi
 
-# BeOS:
-if test "$PORTNAME" = "beos"
-then
+if test "$with_zlib" = yes; then
 
-echo "$as_me:$LINENO: checking for __inet_ntoa in -lbind" >&5
-echo $ECHO_N "checking for __inet_ntoa in -lbind... $ECHO_C" >&6
-if test "${ac_cv_lib_bind___inet_ntoa+set}" = set; then
+echo "$as_me:$LINENO: checking for inflate in -lz" >&5
+echo $ECHO_N "checking for inflate in -lz... $ECHO_C" >&6
+if test "${ac_cv_lib_z_inflate+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbind  $LIBS"
+LIBS="-lz  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6191,11 +6640,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char __inet_ntoa ();
+char inflate ();
 int
 main ()
 {
-__inet_ntoa ();
+inflate ();
   ;
   return 0;
 }
@@ -6222,37 +6671,62 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_bind___inet_ntoa=yes
+  ac_cv_lib_z_inflate=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_bind___inet_ntoa=no
+ac_cv_lib_z_inflate=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_bind___inet_ntoa" >&5
-echo "${ECHO_T}$ac_cv_lib_bind___inet_ntoa" >&6
-if test $ac_cv_lib_bind___inet_ntoa = yes; then
+echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflate" >&5
+echo "${ECHO_T}$ac_cv_lib_z_inflate" >&6
+if test $ac_cv_lib_z_inflate = yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBBIND 1
+#define HAVE_LIBZ 1
 _ACEOF
 
-  LIBS="-lbind $LIBS"
+  LIBS="-lz $LIBS"
 
+else
+  { { echo "$as_me:$LINENO: error: zlib library not found
+If you have zlib already installed, see config.log for details on the
+failure.  It is possible the compiler isn't looking in the proper directory.
+Use --without-zlib to disable zlib support." >&5
+echo "$as_me: error: zlib library not found
+If you have zlib already installed, see config.log for details on the
+failure.  It is possible the compiler isn't looking in the proper directory.
+Use --without-zlib to disable zlib support." >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 fi
-# Solaris:
-echo "$as_me:$LINENO: checking for library containing fdatasync" >&5
-echo $ECHO_N "checking for library containing fdatasync... $ECHO_C" >&6
-if test "${ac_cv_search_fdatasync+set}" = set; then
+
+if test "$enable_spinlocks" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SPINLOCKS 1
+_ACEOF
+
+else
+  { echo "$as_me:$LINENO: WARNING:
+*** Not using spinlocks will cause poor performance." >&5
+echo "$as_me: WARNING:
+*** Not using spinlocks will cause poor performance." >&2;}
+fi
+
+if test "$with_krb5" = yes ; then
+  if test "$PORTNAME" != "win32"; then
+     echo "$as_me:$LINENO: checking for library containing com_err" >&5
+echo $ECHO_N "checking for library containing com_err... $ECHO_C" >&6
+if test "${ac_cv_search_com_err+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_func_search_save_LIBS=$LIBS
-ac_cv_search_fdatasync=no
+ac_cv_search_com_err=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6266,11 +6740,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char fdatasync ();
+char com_err ();
 int
 main ()
 {
-fdatasync ();
+com_err ();
   ;
   return 0;
 }
@@ -6297,7 +6771,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_fdatasync="none required"
+  ac_cv_search_com_err="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -6305,8 +6779,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_fdatasync" = no; then
-  for ac_lib in rt posix4; do
+if test "$ac_cv_search_com_err" = no; then
+  for ac_lib in krb5 'krb5 -lcrypto -ldes -lasn1 -lroken' com_err; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -6321,11 +6795,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char fdatasync ();
+char com_err ();
 int
 main ()
 {
-fdatasync ();
+com_err ();
   ;
   return 0;
 }
@@ -6352,7 +6826,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_fdatasync="-l$ac_lib"
+  ac_cv_search_com_err="-l$ac_lib"
 break
 else
   echo "$as_me: failed program was:" >&5
@@ -6365,22 +6839,24 @@ rm -f conftest.err conftest.$ac_objext \
 fi
 LIBS=$ac_func_search_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_fdatasync" >&5
-echo "${ECHO_T}$ac_cv_search_fdatasync" >&6
-if test "$ac_cv_search_fdatasync" != no; then
-  test "$ac_cv_search_fdatasync" = "none required" || LIBS="$ac_cv_search_fdatasync $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_search_com_err" >&5
+echo "${ECHO_T}$ac_cv_search_com_err" >&6
+if test "$ac_cv_search_com_err" != no; then
+  test "$ac_cv_search_com_err" = "none required" || LIBS="$ac_cv_search_com_err $LIBS"
 
+else
+  { { echo "$as_me:$LINENO: error: could not find function 'com_err' required for Kerberos 5" >&5
+echo "$as_me: error: could not find function 'com_err' required for Kerberos 5" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
-# Cygwin:
-
-echo "$as_me:$LINENO: checking for shmget in -lcygipc" >&5
-echo $ECHO_N "checking for shmget in -lcygipc... $ECHO_C" >&6
-if test "${ac_cv_lib_cygipc_shmget+set}" = set; then
+     echo "$as_me:$LINENO: checking for library containing krb5_sendauth" >&5
+echo $ECHO_N "checking for library containing krb5_sendauth... $ECHO_C" >&6
+if test "${ac_cv_search_krb5_sendauth+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcygipc  $LIBS"
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_krb5_sendauth=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6394,11 +6870,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char shmget ();
+char krb5_sendauth ();
 int
 main ()
 {
-shmget ();
+krb5_sendauth ();
   ;
   return 0;
 }
@@ -6425,51 +6901,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_cygipc_shmget=yes
+  ac_cv_search_krb5_sendauth="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_cygipc_shmget=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_cygipc_shmget" >&5
-echo "${ECHO_T}$ac_cv_lib_cygipc_shmget" >&6
-if test $ac_cv_lib_cygipc_shmget = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCYGIPC 1
-_ACEOF
-
-  LIBS="-lcygipc $LIBS"
-
-fi
-
-# WIN32:
-if test "$PORTNAME" = "win32"
-then
-
-echo "$as_me:$LINENO: checking for main in -lwsock32" >&5
-echo $ECHO_N "checking for main in -lwsock32... $ECHO_C" >&6
-if test "${ac_cv_lib_wsock32_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lwsock32  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+if test "$ac_cv_search_krb5_sendauth" = no; then
+  for ac_lib in krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'; do
+    LIBS="-l$ac_lib  $ac_func_search_save_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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char krb5_sendauth ();
 int
 main ()
 {
-main ();
+krb5_sendauth ();
   ;
   return 0;
 }
@@ -6496,48 +6956,39 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_wsock32_main=yes
+  ac_cv_search_krb5_sendauth="-l$ac_lib"
+break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_wsock32_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+  done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_wsock32_main" >&5
-echo "${ECHO_T}$ac_cv_lib_wsock32_main" >&6
-if test $ac_cv_lib_wsock32_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBWSOCK32 1
-_ACEOF
-
-  LIBS="-lwsock32 $LIBS"
-
+LIBS=$ac_func_search_save_LIBS
 fi
+echo "$as_me:$LINENO: result: $ac_cv_search_krb5_sendauth" >&5
+echo "${ECHO_T}$ac_cv_search_krb5_sendauth" >&6
+if test "$ac_cv_search_krb5_sendauth" != no; then
+  test "$ac_cv_search_krb5_sendauth" = "none required" || LIBS="$ac_cv_search_krb5_sendauth $LIBS"
 
+else
+  { { echo "$as_me:$LINENO: error: could not find function 'krb5_sendauth' required for Kerberos 5" >&5
+echo "$as_me: error: could not find function 'krb5_sendauth' required for Kerberos 5" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
-if test "$with_readline" = yes; then
-
-
-if test "${pgac_cv_check_readline+set}" = set; then
+  else
+     echo "$as_me:$LINENO: checking for library containing com_err" >&5
+echo $ECHO_N "checking for library containing com_err... $ECHO_C" >&6
+if test "${ac_cv_search_com_err+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  pgac_cv_check_readline=no
-pgac_save_LIBS=$LIBS
-if test x"$with_libedit_preferred" != x"yes"
-then   READLINE_ORDER="-lreadline -ledit"
-else   READLINE_ORDER="-ledit -lreadline"
-fi
-for pgac_rllib in $READLINE_ORDER ; do
-  echo "$as_me:$LINENO: checking for ${pgac_rllib}" >&5
-echo $ECHO_N "checking for ${pgac_rllib}... $ECHO_C" >&6
-  for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
-    LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_com_err=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6550,11 +7001,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char readline ();
+char com_err ();
 int
 main ()
 {
-readline ();
+com_err ();
   ;
   return 0;
 }
@@ -6581,20 +7032,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-
-      # Older NetBSD, OpenBSD, and Irix have a broken linker that does not
-      # recognize dependent libraries; assume curses is needed if we didn't
-      # find any dependency.
-      case $host_os in
-        netbsd* | openbsd* | irix*)
-          if test x"$pgac_lib" = x"" ; then
-            pgac_lib=" -lcurses"
-          fi ;;
-      esac
-
-      pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
-      break
-
+  ac_cv_search_com_err="none required"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -6602,58 +7040,15 @@ sed 's/^/| /' conftest.$ac_ext >&5
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-  done
-  if test "$pgac_cv_check_readline" != no ; then
-    echo "$as_me:$LINENO: result: yes ($pgac_cv_check_readline)" >&5
-echo "${ECHO_T}yes ($pgac_cv_check_readline)" >&6
-    break
-  else
-    echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-  fi
-done
-LIBS=$pgac_save_LIBS
-
-fi
-
-if test "$pgac_cv_check_readline" != no ; then
-  LIBS="$pgac_cv_check_readline $LIBS"
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBREADLINE 1
+if test "$ac_cv_search_com_err" = no; then
+  for ac_lib in 'comerr32 -lkrb5_32'; do
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-
-fi
-
-
-  if test x"$pgac_cv_check_readline" = x"no"; then
-    { { echo "$as_me:$LINENO: error: readline library not found
-If you have readline already installed, see config.log for details on the
-failure.  It is possible the compiler isn't looking in the proper directory.
-Use --without-readline to disable readline support." >&5
-echo "$as_me: error: readline library not found
-If you have readline already installed, see config.log for details on the
-failure.  It is possible the compiler isn't looking in the proper directory.
-Use --without-readline to disable readline support." >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-fi
-
-if test "$with_zlib" = yes; then
-
-echo "$as_me:$LINENO: checking for inflate in -lz" >&5
-echo $ECHO_N "checking for inflate in -lz... $ECHO_C" >&6
-if test "${ac_cv_lib_z_inflate+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -6661,11 +7056,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char inflate ();
+char com_err ();
 int
 main ()
 {
-inflate ();
+com_err ();
   ;
   return 0;
 }
@@ -6692,62 +7087,43 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_z_inflate=yes
+  ac_cv_search_com_err="-l$ac_lib"
+break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_z_inflate=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+  done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflate" >&5
-echo "${ECHO_T}$ac_cv_lib_z_inflate" >&6
-if test $ac_cv_lib_z_inflate = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBZ 1
-_ACEOF
-
-  LIBS="-lz $LIBS"
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_com_err" >&5
+echo "${ECHO_T}$ac_cv_search_com_err" >&6
+if test "$ac_cv_search_com_err" != no; then
+  test "$ac_cv_search_com_err" = "none required" || LIBS="$ac_cv_search_com_err $LIBS"
 
 else
-  { { echo "$as_me:$LINENO: error: zlib library not found
-If you have zlib already installed, see config.log for details on the
-failure.  It is possible the compiler isn't looking in the proper directory.
-Use --without-zlib to disable zlib support." >&5
-echo "$as_me: error: zlib library not found
-If you have zlib already installed, see config.log for details on the
-failure.  It is possible the compiler isn't looking in the proper directory.
-Use --without-zlib to disable zlib support." >&2;}
+  { { echo "$as_me:$LINENO: error: could not find function 'com_err' required for Kerberos 5" >&5
+echo "$as_me: error: could not find function 'com_err' required for Kerberos 5" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
+  fi
 fi
 
-if test "$enable_spinlocks" = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SPINLOCKS 1
-_ACEOF
-
-else
-  { echo "$as_me:$LINENO: WARNING:
-*** Not using spinlocks will cause poor performance." >&5
-echo "$as_me: WARNING:
-*** Not using spinlocks will cause poor performance." >&2;}
-fi
+if test "$with_openssl" = yes ; then
+    if test "$PORTNAME" != "win32"; then
 
-if test "$with_krb5" = yes ; then
-  if test "$PORTNAME" != "win32"; then
-     echo "$as_me:$LINENO: checking for library containing com_err" >&5
-echo $ECHO_N "checking for library containing com_err... $ECHO_C" >&6
-if test "${ac_cv_search_com_err+set}" = set; then
+echo "$as_me:$LINENO: checking for CRYPTO_new_ex_data in -lcrypto" >&5
+echo $ECHO_N "checking for CRYPTO_new_ex_data in -lcrypto... $ECHO_C" >&6
+if test "${ac_cv_lib_crypto_CRYPTO_new_ex_data+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_com_err=no
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6761,11 +7137,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char com_err ();
+char CRYPTO_new_ex_data ();
 int
 main ()
 {
-com_err ();
+CRYPTO_new_ex_data ();
   ;
   return 0;
 }
@@ -6792,18 +7168,41 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_com_err="none required"
+  ac_cv_lib_crypto_CRYPTO_new_ex_data=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_lib_crypto_CRYPTO_new_ex_data=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_com_err" = no; then
-  for ac_lib in krb5 'krb5 -ldes -lasn1 -lroken' com_err; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5
+echo "${ECHO_T}$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6
+if test $ac_cv_lib_crypto_CRYPTO_new_ex_data = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCRYPTO 1
+_ACEOF
+
+  LIBS="-lcrypto $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: library 'crypto' is required for OpenSSL" >&5
+echo "$as_me: error: library 'crypto' is required for OpenSSL" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking for SSL_library_init in -lssl" >&5
+echo $ECHO_N "checking for SSL_library_init in -lssl... $ECHO_C" >&6
+if test "${ac_cv_lib_ssl_SSL_library_init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lssl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6816,11 +7215,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char com_err ();
+char SSL_library_init ();
 int
 main ()
 {
-com_err ();
+SSL_library_init ();
   ;
   return 0;
 }
@@ -6847,37 +7246,41 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_com_err="-l$ac_lib"
-break
+  ac_cv_lib_ssl_SSL_library_init=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_lib_ssl_SSL_library_init=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-  done
-fi
-LIBS=$ac_func_search_save_LIBS
+LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_com_err" >&5
-echo "${ECHO_T}$ac_cv_search_com_err" >&6
-if test "$ac_cv_search_com_err" != no; then
-  test "$ac_cv_search_com_err" = "none required" || LIBS="$ac_cv_search_com_err $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_library_init" >&5
+echo "${ECHO_T}$ac_cv_lib_ssl_SSL_library_init" >&6
+if test $ac_cv_lib_ssl_SSL_library_init = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSSL 1
+_ACEOF
+
+  LIBS="-lssl $LIBS"
 
 else
-  { { echo "$as_me:$LINENO: error: could not find function 'com_err' required for Kerberos 5" >&5
-echo "$as_me: error: could not find function 'com_err' required for Kerberos 5" >&2;}
+  { { echo "$as_me:$LINENO: error: library 'ssl' is required for OpenSSL" >&5
+echo "$as_me: error: library 'ssl' is required for OpenSSL" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-     echo "$as_me:$LINENO: checking for library containing krb5_encrypt" >&5
-echo $ECHO_N "checking for library containing krb5_encrypt... $ECHO_C" >&6
-if test "${ac_cv_search_krb5_encrypt+set}" = set; then
+  else
+
+echo "$as_me:$LINENO: checking for CRYPTO_new_ex_data in -leay32" >&5
+echo $ECHO_N "checking for CRYPTO_new_ex_data in -leay32... $ECHO_C" >&6
+if test "${ac_cv_lib_eay32_CRYPTO_new_ex_data+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_krb5_encrypt=no
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-leay32  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6891,11 +7294,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char krb5_encrypt ();
+char CRYPTO_new_ex_data ();
 int
 main ()
 {
-krb5_encrypt ();
+CRYPTO_new_ex_data ();
   ;
   return 0;
 }
@@ -6922,18 +7325,41 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_krb5_encrypt="none required"
+  ac_cv_lib_eay32_CRYPTO_new_ex_data=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_lib_eay32_CRYPTO_new_ex_data=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_krb5_encrypt" = no; then
-  for ac_lib in krb5 'krb5 -ldes -lasn1 -lroken' crypto k5crypto; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_eay32_CRYPTO_new_ex_data" >&5
+echo "${ECHO_T}$ac_cv_lib_eay32_CRYPTO_new_ex_data" >&6
+if test $ac_cv_lib_eay32_CRYPTO_new_ex_data = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBEAY32 1
+_ACEOF
+
+  LIBS="-leay32 $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: library 'eay32' is required for OpenSSL" >&5
+echo "$as_me: error: library 'eay32' is required for OpenSSL" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking for SSL_library_init in -lssleay32" >&5
+echo $ECHO_N "checking for SSL_library_init in -lssleay32... $ECHO_C" >&6
+if test "${ac_cv_lib_ssleay32_SSL_library_init+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lssleay32  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6946,11 +7372,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char krb5_encrypt ();
+char SSL_library_init ();
 int
 main ()
 {
-krb5_encrypt ();
+SSL_library_init ();
   ;
   return 0;
 }
@@ -6977,37 +7403,44 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_krb5_encrypt="-l$ac_lib"
-break
+  ac_cv_lib_ssleay32_SSL_library_init=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_lib_ssleay32_SSL_library_init=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-  done
-fi
-LIBS=$ac_func_search_save_LIBS
+LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_krb5_encrypt" >&5
-echo "${ECHO_T}$ac_cv_search_krb5_encrypt" >&6
-if test "$ac_cv_search_krb5_encrypt" != no; then
-  test "$ac_cv_search_krb5_encrypt" = "none required" || LIBS="$ac_cv_search_krb5_encrypt $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_lib_ssleay32_SSL_library_init" >&5
+echo "${ECHO_T}$ac_cv_lib_ssleay32_SSL_library_init" >&6
+if test $ac_cv_lib_ssleay32_SSL_library_init = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSSLEAY32 1
+_ACEOF
+
+  LIBS="-lssleay32 $LIBS"
 
 else
-  { { echo "$as_me:$LINENO: error: could not find function 'krb5_encrypt' required for Kerberos 5" >&5
-echo "$as_me: error: could not find function 'krb5_encrypt' required for Kerberos 5" >&2;}
+  { { echo "$as_me:$LINENO: error: library 'ssleay32' is required for OpenSSL" >&5
+echo "$as_me: error: library 'ssleay32' is required for OpenSSL" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-     echo "$as_me:$LINENO: checking for library containing krb5_sendauth" >&5
-echo $ECHO_N "checking for library containing krb5_sendauth... $ECHO_C" >&6
-if test "${ac_cv_search_krb5_sendauth+set}" = set; then
+  fi
+fi
+
+if test "$with_pam" = yes ; then
+
+echo "$as_me:$LINENO: checking for pam_start in -lpam" >&5
+echo $ECHO_N "checking for pam_start in -lpam... $ECHO_C" >&6
+if test "${ac_cv_lib_pam_pam_start+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_krb5_sendauth=no
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpam  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7021,11 +7454,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char krb5_sendauth ();
+char pam_start ();
 int
 main ()
 {
-krb5_sendauth ();
+pam_start ();
   ;
   return 0;
 }
@@ -7052,93 +7485,43 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_krb5_sendauth="none required"
+  ac_cv_lib_pam_pam_start=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_lib_pam_pam_start=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_krb5_sendauth" = no; then
-  for ac_lib in krb5 'krb5 -ldes -lasn1 -lroken'; do
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_pam_pam_start" >&5
+echo "${ECHO_T}$ac_cv_lib_pam_pam_start" >&6
+if test $ac_cv_lib_pam_pam_start = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPAM 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char krb5_sendauth ();
-int
-main ()
-{
-krb5_sendauth ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_krb5_sendauth="-l$ac_lib"
-break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
-fi
-LIBS=$ac_func_search_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_search_krb5_sendauth" >&5
-echo "${ECHO_T}$ac_cv_search_krb5_sendauth" >&6
-if test "$ac_cv_search_krb5_sendauth" != no; then
-  test "$ac_cv_search_krb5_sendauth" = "none required" || LIBS="$ac_cv_search_krb5_sendauth $LIBS"
+  LIBS="-lpam $LIBS"
 
 else
-  { { echo "$as_me:$LINENO: error: could not find function 'krb5_sendauth' required for Kerberos 5" >&5
-echo "$as_me: error: could not find function 'krb5_sendauth' required for Kerberos 5" >&2;}
+  { { echo "$as_me:$LINENO: error: library 'pam' is required for PAM" >&5
+echo "$as_me: error: library 'pam' is required for PAM" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-  else
-     echo "$as_me:$LINENO: checking for library containing com_err" >&5
-echo $ECHO_N "checking for library containing com_err... $ECHO_C" >&6
-if test "${ac_cv_search_com_err+set}" = set; then
+fi
+
+if test "$with_libxml" = yes ; then
+
+echo "$as_me:$LINENO: checking for xmlSaveToBuffer in -lxml2" >&5
+echo $ECHO_N "checking for xmlSaveToBuffer in -lxml2... $ECHO_C" >&6
+if test "${ac_cv_lib_xml2_xmlSaveToBuffer+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_func_search_save_LIBS=$LIBS
-ac_cv_search_com_err=no
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxml2  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7152,11 +7535,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char com_err ();
+char xmlSaveToBuffer ();
 int
 main ()
 {
-com_err ();
+xmlSaveToBuffer ();
   ;
   return 0;
 }
@@ -7183,98 +7566,43 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_search_com_err="none required"
+  ac_cv_lib_xml2_xmlSaveToBuffer=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_lib_xml2_xmlSaveToBuffer=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-if test "$ac_cv_search_com_err" = no; then
-  for ac_lib in 'comerr32 -lkrb5_32'; do
-    LIBS="-l$ac_lib  $ac_func_search_save_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 gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char com_err ();
-int
-main ()
-{
-com_err ();
-  ;
-  return 0;
-}
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_xml2_xmlSaveToBuffer" >&5
+echo "${ECHO_T}$ac_cv_lib_xml2_xmlSaveToBuffer" >&6
+if test $ac_cv_lib_xml2_xmlSaveToBuffer = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBXML2 1
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_search_com_err="-l$ac_lib"
-break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
-fi
-LIBS=$ac_func_search_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_search_com_err" >&5
-echo "${ECHO_T}$ac_cv_search_com_err" >&6
-if test "$ac_cv_search_com_err" != no; then
-  test "$ac_cv_search_com_err" = "none required" || LIBS="$ac_cv_search_com_err $LIBS"
+  LIBS="-lxml2 $LIBS"
 
 else
-  { { echo "$as_me:$LINENO: error: could not find function 'com_err' required for Kerberos 5" >&5
-echo "$as_me: error: could not find function 'com_err' required for Kerberos 5" >&2;}
+  { { echo "$as_me:$LINENO: error: library 'xml2' (version >= 2.6.23) is required for XML support" >&5
+echo "$as_me: error: library 'xml2' (version >= 2.6.23) is required for XML support" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-  fi
 fi
 
-if test "$with_openssl" = yes ; then
-    if test "$PORTNAME" != "win32"; then
+if test "$with_libxslt" = yes ; then
 
-echo "$as_me:$LINENO: checking for CRYPTO_new_ex_data in -lcrypto" >&5
-echo $ECHO_N "checking for CRYPTO_new_ex_data in -lcrypto... $ECHO_C" >&6
-if test "${ac_cv_lib_crypto_CRYPTO_new_ex_data+set}" = set; then
+echo "$as_me:$LINENO: checking for xsltLibxmlVersion in -lxslt" >&5
+echo $ECHO_N "checking for xsltLibxmlVersion in -lxslt... $ECHO_C" >&6
+if test "${ac_cv_lib_xslt_xsltLibxmlVersion+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto  $LIBS"
+LIBS="-lxslt  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -7288,11 +7616,11 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char CRYPTO_new_ex_data ();
+char xsltLibxmlVersion ();
 int
 main ()
 {
-CRYPTO_new_ex_data ();
+xsltLibxmlVersion ();
   ;
   return 0;
 }
@@ -7319,65 +7647,66 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_crypto_CRYPTO_new_ex_data=yes
+  ac_cv_lib_xslt_xsltLibxmlVersion=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_crypto_CRYPTO_new_ex_data=no
+ac_cv_lib_xslt_xsltLibxmlVersion=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5
-echo "${ECHO_T}$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6
-if test $ac_cv_lib_crypto_CRYPTO_new_ex_data = yes; then
+echo "$as_me:$LINENO: result: $ac_cv_lib_xslt_xsltLibxmlVersion" >&5
+echo "${ECHO_T}$ac_cv_lib_xslt_xsltLibxmlVersion" >&6
+if test $ac_cv_lib_xslt_xsltLibxmlVersion = yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCRYPTO 1
+#define HAVE_LIBXSLT 1
 _ACEOF
 
-  LIBS="-lcrypto $LIBS"
+  LIBS="-lxslt $LIBS"
 
 else
-  { { echo "$as_me:$LINENO: error: library 'crypto' is required for OpenSSL" >&5
-echo "$as_me: error: library 'crypto' is required for OpenSSL" >&2;}
+  { { echo "$as_me:$LINENO: error: library 'xslt' is required for XSLT support" >&5
+echo "$as_me: error: library 'xslt' is required for XSLT support" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
+fi
 
-echo "$as_me:$LINENO: checking for SSL_library_init in -lssl" >&5
-echo $ECHO_N "checking for SSL_library_init in -lssl... $ECHO_C" >&6
-if test "${ac_cv_lib_ssl_SSL_library_init+set}" = set; then
+
+##
+## Header files
+##
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lssl  $LIBS"
-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 <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char SSL_library_init ();
 int
 main ()
 {
-SSL_library_init ();
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -7391,232 +7720,164 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_ssl_SSL_library_init=yes
+  ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_ssl_SSL_library_init=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ac_cv_header_stdc=no
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_ssl_SSL_library_init" >&5
-echo "${ECHO_T}$ac_cv_lib_ssl_SSL_library_init" >&6
-if test $ac_cv_lib_ssl_SSL_library_init = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSSL 1
-_ACEOF
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
-  LIBS="-lssl $LIBS"
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
 else
-  { { echo "$as_me:$LINENO: error: library 'ssl' is required for OpenSSL" >&5
-echo "$as_me: error: library 'ssl' is required for OpenSSL" >&2;}
-   { (exit 1); exit 1; }; }
+  ac_cv_header_stdc=no
 fi
+rm -f conftest*
 
-  else
+fi
 
-echo "$as_me:$LINENO: checking for CRYPTO_new_ex_data in -leay32" >&5
-echo $ECHO_N "checking for CRYPTO_new_ex_data in -leay32... $ECHO_C" >&6
-if test "${ac_cv_lib_eay32_CRYPTO_new_ex_data+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-leay32  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <stdlib.h>
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char CRYPTO_new_ex_data ();
-int
-main ()
-{
-CRYPTO_new_ex_data ();
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_eay32_CRYPTO_new_ex_data=yes
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_eay32_CRYPTO_new_ex_data=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+  ac_cv_header_stdc=no
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_eay32_CRYPTO_new_ex_data" >&5
-echo "${ECHO_T}$ac_cv_lib_eay32_CRYPTO_new_ex_data" >&6
-if test $ac_cv_lib_eay32_CRYPTO_new_ex_data = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBEAY32 1
-_ACEOF
-
-  LIBS="-leay32 $LIBS"
+rm -f conftest*
 
-else
-  { { echo "$as_me:$LINENO: error: library 'eay32' is required for OpenSSL" >&5
-echo "$as_me: error: library 'eay32' is required for OpenSSL" >&2;}
-   { (exit 1); exit 1; }; }
 fi
 
-
-echo "$as_me:$LINENO: checking for SSL_library_init in -lssleay32" >&5
-echo $ECHO_N "checking for SSL_library_init in -lssleay32... $ECHO_C" >&6
-if test "${ac_cv_lib_ssleay32_SSL_library_init+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lssleay32  $LIBS"
-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.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char SSL_library_init ();
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
 int
 main ()
 {
-SSL_library_init ();
-  ;
-  return 0;
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+rm -f conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (eval $ac_link) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_ssleay32_SSL_library_init=yes
+  :
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_ssleay32_SSL_library_init=no
+( exit $ac_status )
+ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_ssleay32_SSL_library_init" >&5
-echo "${ECHO_T}$ac_cv_lib_ssleay32_SSL_library_init" >&6
-if test $ac_cv_lib_ssleay32_SSL_library_init = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSSLEAY32 1
-_ACEOF
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
 
-  LIBS="-lssleay32 $LIBS"
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
 
-else
-  { { echo "$as_me:$LINENO: error: library 'ssleay32' is required for OpenSSL" >&5
-echo "$as_me: error: library 'ssleay32' is required for OpenSSL" >&2;}
-   { (exit 1); exit 1; }; }
 fi
 
-  fi
-fi
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
 
-if test "$with_pam" = yes ; then
 
-echo "$as_me:$LINENO: checking for pam_start in -lpam" >&5
-echo $ECHO_N "checking for pam_start in -lpam... $ECHO_C" >&6
-if test "${ac_cv_lib_pam_pam_start+set}" = set; then
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpam  $LIBS"
-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.  */
+$ac_includes_default
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char pam_start ();
-int
-main ()
-{
-pam_start ();
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -7630,68 +7891,82 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_pam_pam_start=yes
+  eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_pam_pam_start=no
+eval "$as_ac_Header=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_pam_pam_start" >&5
-echo "${ECHO_T}$ac_cv_lib_pam_pam_start" >&6
-if test $ac_cv_lib_pam_pam_start = yes; then
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBPAM 1
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-  LIBS="-lpam $LIBS"
-
-else
-  { { echo "$as_me:$LINENO: error: library 'pam' is required for PAM" >&5
-echo "$as_me: error: library 'pam' is required for PAM" >&2;}
-   { (exit 1); exit 1; }; }
 fi
 
-fi
+done
 
 
-##
-## Header files
-##
 
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in crypt.h dld.h fp_class.h getopt.h ieeefp.h langinfo.h poll.h pwd.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/tas.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
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -7715,138 +7990,264 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_header_stdc=yes
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_stdc=no
+ac_header_compiler=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
 
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <string.h>
-
+#include <$ac_header>
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  ac_cv_header_stdc=no
+  ac_cpp_err=yes
 fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  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
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
 
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: 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
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# At least on IRIX, cpp test for netinet/tcp.h will fail unless
+# netinet/in.h is included first.
+
+for ac_header in netinet/in.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stdlib.h>
-
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
 else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_header_compiler=no
 fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
 
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
-  :
-else
-  cat >conftest.$ac_ext <<_ACEOF
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <ctype.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-                  (('a' <= (c) && (c) <= 'i') \
-                    || ('j' <= (c) && (c) <= 'r') \
-                    || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-       || toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+  ac_header_preproc=no
 fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: 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
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
 
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
+done
 
 
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                 inttypes.h stdint.h unistd.h
+for ac_header in netinet/tcp.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_header" >&5
@@ -7861,6 +8262,10 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
 
 #include <$ac_header>
 _ACEOF
@@ -7907,32 +8312,9 @@ fi
 done
 
 
+if expr x"$pgac_cv_check_readline" : 'x-lreadline' >/dev/null ; then
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-for ac_header in crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h langinfo.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
+for ac_header in readline/readline.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -8077,15 +8459,9 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-fi
-
-done
-
-
-# At least on IRIX, cpp test for netinet/tcp.h will fail unless
-# netinet/in.h is included first.
+else
 
-for ac_header in netinet/in.h
+for ac_header in readline.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -8230,31 +8606,47 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
+else
+  { { echo "$as_me:$LINENO: error: readline header not found
+If you have readline already installed, see config.log for details on the
+failure.  It is possible the compiler isn't looking in the proper directory.
+Use --without-readline to disable readline support." >&5
+echo "$as_me: error: readline header not found
+If you have readline already installed, see config.log for details on the
+failure.  It is possible the compiler isn't looking in the proper directory.
+Use --without-readline to disable readline support." >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 done
 
+fi
 
-for ac_header in netinet/tcp.h
+done
+
+
+for ac_header in readline/history.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&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
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
@@ -8278,31 +8670,109 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_Header=no"
+  ac_header_preproc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: 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
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-fi
-
-done
-
-
-if expr x"$pgac_cv_check_readline" : 'x-lreadline' >/dev/null ; then
+else
 
-for ac_header in readline/readline.h
+for ac_header in history.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -8448,8 +8918,32 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
 _ACEOF
 
 else
+  { { echo "$as_me:$LINENO: error: history header not found
+If you have readline already installed, see config.log for details on the
+failure.  It is possible the compiler isn't looking in the proper directory.
+Use --without-readline to disable readline support." >&5
+echo "$as_me: error: history header not found
+If you have readline already installed, see config.log for details on the
+failure.  It is possible the compiler isn't looking in the proper directory.
+Use --without-readline to disable readline support." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
-for ac_header in readline.h
+done
+
+fi
+
+done
+
+fi
+
+if expr x"$pgac_cv_check_readline" : 'x-ledit' >/dev/null ; then
+# Some installations of libedit usurp /usr/include/readline/, which seems
+# bad practice, since in combined installations readline will have its headers
+# there.  We might have to resort to AC_EGREP checks to make sure we found
+# the proper header...
+
+for ac_header in editline/readline.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -8595,25 +9089,8 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
 _ACEOF
 
 else
-  { { echo "$as_me:$LINENO: error: readline header not found
-If you have readline already installed, see config.log for details on the
-failure.  It is possible the compiler isn't looking in the proper directory.
-Use --without-readline to disable readline support." >&5
-echo "$as_me: error: readline header not found
-If you have readline already installed, see config.log for details on the
-failure.  It is possible the compiler isn't looking in the proper directory.
-Use --without-readline to disable readline support." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-done
-
-fi
-
-done
-
 
-for ac_header in readline/history.h
+for ac_header in readline.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -8760,7 +9237,7 @@ _ACEOF
 
 else
 
-for ac_header in history.h
+for ac_header in readline/readline.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -8906,14 +9383,14 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
 _ACEOF
 
 else
-  { { echo "$as_me:$LINENO: error: history header not found
-If you have readline already installed, see config.log for details on the
+  { { echo "$as_me:$LINENO: error: readline header not found
+If you have libedit already installed, see config.log for details on the
 failure.  It is possible the compiler isn't looking in the proper directory.
-Use --without-readline to disable readline support." >&5
-echo "$as_me: error: history header not found
-If you have readline already installed, see config.log for details on the
+Use --without-readline to disable libedit support." >&5
+echo "$as_me: error: readline header not found
+If you have libedit already installed, see config.log for details on the
 failure.  It is possible the compiler isn't looking in the proper directory.
-Use --without-readline to disable readline support." >&2;}
+Use --without-readline to disable libedit support." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -8925,13 +9402,13 @@ done
 
 fi
 
-if expr x"$pgac_cv_check_readline" : 'x-ledit' >/dev/null ; then
-# Some installations of libedit usurp /usr/include/readline/, which seems
-# bad practice, since in combined installations readline will have its headers
-# there.  We might have to resort to AC_EGREP checks to make sure we found
-# the proper header...
+done
 
-for ac_header in editline/readline.h
+# Note: in a libedit installation, history.h is sometimes a dummy, and may
+# not be there at all.  Hence, don't complain if not found.  We must check
+# though, since in yet other versions it is an independent header.
+
+for ac_header in editline/history.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -9078,7 +9555,7 @@ _ACEOF
 
 else
 
-for ac_header in readline.h
+for ac_header in history.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -9225,7 +9702,7 @@ _ACEOF
 
 else
 
-for ac_header in readline/readline.h
+for ac_header in readline/history.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -9370,16 +9847,6 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
-else
-  { { echo "$as_me:$LINENO: error: readline header not found
-If you have libedit already installed, see config.log for details on the
-failure.  It is possible the compiler isn't looking in the proper directory.
-Use --without-readline to disable libedit support." >&5
-echo "$as_me: error: readline header not found
-If you have libedit already installed, see config.log for details on the
-failure.  It is possible the compiler isn't looking in the proper directory.
-Use --without-readline to disable libedit support." >&2;}
-   { (exit 1); exit 1; }; }
 fi
 
 done
@@ -9392,22 +9859,21 @@ fi
 
 done
 
+fi
 
-for ac_header in editline/history.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if test "$with_zlib" = yes; then
+  if test "${ac_cv_header_zlib_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for zlib.h" >&5
+echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6
+if test "${ac_cv_header_zlib_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_zlib_h" >&6
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking zlib.h usability" >&5
+echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -9415,7 +9881,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <$ac_header>
+#include <zlib.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -9451,15 +9917,15 @@ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking zlib.h presence" >&5
+echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+#include <zlib.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -9493,25 +9959,25 @@ echo "${ECHO_T}$ac_header_preproc" >&6
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: zlib.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
 ## ---------------------------------------- ##
@@ -9522,39 +9988,47 @@ _ASBOX
       sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for zlib.h" >&5
+echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6
+if test "${ac_cv_header_zlib_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
+  ac_cv_header_zlib_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_zlib_h" >&6
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
+if test $ac_cv_header_zlib_h = yes; then
+  :
 else
+  { { echo "$as_me:$LINENO: error: zlib header not found
+If you have zlib already installed, see config.log for details on the
+failure.  It is possible the compiler isn't looking in the proper directory.
+Use --without-zlib to disable zlib support." >&5
+echo "$as_me: error: zlib header not found
+If you have zlib already installed, see config.log for details on the
+failure.  It is possible the compiler isn't looking in the proper directory.
+Use --without-zlib to disable zlib support." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
-for ac_header in history.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+
+fi
+
+if test "$with_krb5" = yes ; then
+  if test "${ac_cv_header_krb5_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for krb5.h" >&5
+echo $ECHO_N "checking for krb5.h... $ECHO_C" >&6
+if test "${ac_cv_header_krb5_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_krb5_h" >&5
+echo "${ECHO_T}$ac_cv_header_krb5_h" >&6
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking krb5.h usability" >&5
+echo $ECHO_N "checking krb5.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -9562,7 +10036,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <$ac_header>
+#include <krb5.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -9598,15 +10072,15 @@ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking krb5.h presence" >&5
+echo $ECHO_N "checking krb5.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+#include <krb5.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -9640,25 +10114,25 @@ echo "${ECHO_T}$ac_header_preproc" >&6
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: krb5.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: krb5.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: krb5.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: krb5.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: krb5.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: krb5.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: krb5.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: krb5.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: krb5.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: krb5.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: krb5.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: krb5.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: krb5.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: krb5.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: krb5.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: krb5.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
 ## ---------------------------------------- ##
@@ -9669,39 +10143,41 @@ _ASBOX
       sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for krb5.h" >&5
+echo $ECHO_N "checking for krb5.h... $ECHO_C" >&6
+if test "${ac_cv_header_krb5_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
+  ac_cv_header_krb5_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_krb5_h" >&5
+echo "${ECHO_T}$ac_cv_header_krb5_h" >&6
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
+if test $ac_cv_header_krb5_h = yes; then
+  :
 else
+  { { echo "$as_me:$LINENO: error: header file <krb5.h> is required for Kerberos 5" >&5
+echo "$as_me: error: header file <krb5.h> is required for Kerberos 5" >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
-for ac_header in readline/history.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+
+fi
+
+if test "$with_openssl" = yes ; then
+  if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
+echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6
+if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5
+echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking openssl/ssl.h usability" >&5
+echo $ECHO_N "checking openssl/ssl.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -9709,7 +10185,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <$ac_header>
+#include <openssl/ssl.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -9745,15 +10221,15 @@ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking openssl/ssl.h presence" >&5
+echo $ECHO_N "checking openssl/ssl.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+#include <openssl/ssl.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -9787,25 +10263,25 @@ echo "${ECHO_T}$ac_header_preproc" >&6
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: openssl/ssl.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: openssl/ssl.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: openssl/ssl.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: openssl/ssl.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
 ## ---------------------------------------- ##
@@ -9816,59 +10292,38 @@ _ASBOX
       sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
+echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6
+if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
+  ac_cv_header_openssl_ssl_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5
+echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
+if test $ac_cv_header_openssl_ssl_h = yes; then
+  :
 else
-  { { echo "$as_me:$LINENO: error: history header not found
-If you have libedit already installed, see config.log for details on the
-failure.  It is possible the compiler isn't looking in the proper directory.
-Use --without-readline to disable libedit support." >&5
-echo "$as_me: error: history header not found
-If you have libedit already installed, see config.log for details on the
-failure.  It is possible the compiler isn't looking in the proper directory.
-Use --without-readline to disable libedit support." >&2;}
+  { { echo "$as_me:$LINENO: error: header file <openssl/ssl.h> is required for OpenSSL" >&5
+echo "$as_me: error: header file <openssl/ssl.h> is required for OpenSSL" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-done
-
-fi
-
-done
-
-fi
-
-done
-
-fi
 
-if test "$with_zlib" = yes; then
-  if test "${ac_cv_header_zlib_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for zlib.h" >&5
-echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6
-if test "${ac_cv_header_zlib_h+set}" = set; then
+  if test "${ac_cv_header_openssl_err_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for openssl/err.h" >&5
+echo $ECHO_N "checking for openssl/err.h... $ECHO_C" >&6
+if test "${ac_cv_header_openssl_err_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
-echo "${ECHO_T}$ac_cv_header_zlib_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_openssl_err_h" >&5
+echo "${ECHO_T}$ac_cv_header_openssl_err_h" >&6
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking zlib.h usability" >&5
-echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking openssl/err.h usability" >&5
+echo $ECHO_N "checking openssl/err.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -9876,7 +10331,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <zlib.h>
+#include <openssl/err.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -9912,15 +10367,15 @@ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
 # Is the header present?
-echo "$as_me:$LINENO: checking zlib.h presence" >&5
-echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking openssl/err.h presence" >&5
+echo $ECHO_N "checking openssl/err.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <zlib.h>
+#include <openssl/err.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -9954,25 +10409,25 @@ echo "${ECHO_T}$ac_header_preproc" >&6
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/err.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: openssl/err.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/err.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: openssl/err.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: zlib.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: zlib.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/err.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: openssl/err.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/err.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: openssl/err.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/err.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: openssl/err.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/err.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: openssl/err.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/err.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: openssl/err.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: openssl/err.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: openssl/err.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
 ## ---------------------------------------- ##
@@ -9983,47 +10438,45 @@ _ASBOX
       sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for zlib.h" >&5
-echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6
-if test "${ac_cv_header_zlib_h+set}" = set; then
+echo "$as_me:$LINENO: checking for openssl/err.h" >&5
+echo $ECHO_N "checking for openssl/err.h... $ECHO_C" >&6
+if test "${ac_cv_header_openssl_err_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_zlib_h=$ac_header_preproc
+  ac_cv_header_openssl_err_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
-echo "${ECHO_T}$ac_cv_header_zlib_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_openssl_err_h" >&5
+echo "${ECHO_T}$ac_cv_header_openssl_err_h" >&6
 
 fi
-if test $ac_cv_header_zlib_h = yes; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: zlib header not found
-If you have zlib already installed, see config.log for details on the
-failure.  It is possible the compiler isn't looking in the proper directory.
-Use --without-zlib to disable zlib support." >&5
-echo "$as_me: error: zlib header not found
-If you have zlib already installed, see config.log for details on the
-failure.  It is possible the compiler isn't looking in the proper directory.
-Use --without-zlib to disable zlib support." >&2;}
+if test $ac_cv_header_openssl_err_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: header file <openssl/err.h> is required for OpenSSL" >&5
+echo "$as_me: error: header file <openssl/err.h> is required for OpenSSL" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 
 fi
 
-if test "$with_krb5" = yes ; then
-  if test "${ac_cv_header_krb5_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for krb5.h" >&5
-echo $ECHO_N "checking for krb5.h... $ECHO_C" >&6
-if test "${ac_cv_header_krb5_h+set}" = set; then
+if test "$with_pam" = yes ; then
+
+for ac_header in security/pam_appl.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_krb5_h" >&5
-echo "${ECHO_T}$ac_cv_header_krb5_h" >&6
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking krb5.h usability" >&5
-echo $ECHO_N "checking krb5.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -10031,7 +10484,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <krb5.h>
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -10067,15 +10520,15 @@ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
 # Is the header present?
-echo "$as_me:$LINENO: checking krb5.h presence" >&5
-echo $ECHO_N "checking krb5.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <krb5.h>
+#include <$ac_header>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -10109,25 +10562,25 @@ echo "${ECHO_T}$ac_header_preproc" >&6
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: krb5.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: krb5.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: krb5.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: krb5.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: krb5.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: krb5.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: krb5.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: krb5.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: krb5.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: krb5.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: krb5.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: krb5.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: krb5.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: krb5.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: krb5.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: krb5.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
 ## ---------------------------------------- ##
@@ -10138,41 +10591,39 @@ _ASBOX
       sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for krb5.h" >&5
-echo $ECHO_N "checking for krb5.h... $ECHO_C" >&6
-if test "${ac_cv_header_krb5_h+set}" = set; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_krb5_h=$ac_header_preproc
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_krb5_h" >&5
-echo "${ECHO_T}$ac_cv_header_krb5_h" >&6
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 
 fi
-if test $ac_cv_header_krb5_h = yes; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: header file <krb5.h> is required for Kerberos 5" >&5
-echo "$as_me: error: header file <krb5.h> is required for Kerberos 5" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-fi
+else
 
-if test "$with_openssl" = yes ; then
-  if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
-echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6
-if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
+for ac_header in pam/pam_appl.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5
-echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking openssl/ssl.h usability" >&5
-echo $ECHO_N "checking openssl/ssl.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -10180,7 +10631,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <openssl/ssl.h>
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -10216,15 +10667,15 @@ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
 # Is the header present?
-echo "$as_me:$LINENO: checking openssl/ssl.h presence" >&5
-echo $ECHO_N "checking openssl/ssl.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <openssl/ssl.h>
+#include <$ac_header>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -10258,25 +10709,25 @@ echo "${ECHO_T}$ac_header_preproc" >&6
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: openssl/ssl.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: openssl/ssl.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: openssl/ssl.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: openssl/ssl.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: openssl/ssl.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: openssl/ssl.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
 ## ---------------------------------------- ##
@@ -10287,38 +10738,49 @@ _ASBOX
       sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
-echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6
-if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_openssl_ssl_h=$ac_header_preproc
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5
-echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 
 fi
-if test $ac_cv_header_openssl_ssl_h = yes; then
-  :
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
 else
-  { { echo "$as_me:$LINENO: error: header file <openssl/ssl.h> is required for OpenSSL" >&5
-echo "$as_me: error: header file <openssl/ssl.h> is required for OpenSSL" >&2;}
+  { { echo "$as_me:$LINENO: error: header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM." >&5
+echo "$as_me: error: header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
+done
 
-  if test "${ac_cv_header_openssl_err_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for openssl/err.h" >&5
-echo $ECHO_N "checking for openssl/err.h... $ECHO_C" >&6
-if test "${ac_cv_header_openssl_err_h+set}" = set; then
+fi
+
+done
+
+fi
+
+if test "$with_libxml" = yes ; then
+  if test "${ac_cv_header_libxml_parser_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for libxml/parser.h" >&5
+echo $ECHO_N "checking for libxml/parser.h... $ECHO_C" >&6
+if test "${ac_cv_header_libxml_parser_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_openssl_err_h" >&5
-echo "${ECHO_T}$ac_cv_header_openssl_err_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_libxml_parser_h" >&5
+echo "${ECHO_T}$ac_cv_header_libxml_parser_h" >&6
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking openssl/err.h usability" >&5
-echo $ECHO_N "checking openssl/err.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking libxml/parser.h usability" >&5
+echo $ECHO_N "checking libxml/parser.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -10326,7 +10788,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <openssl/err.h>
+#include <libxml/parser.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -10362,15 +10824,15 @@ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
 # Is the header present?
-echo "$as_me:$LINENO: checking openssl/err.h presence" >&5
-echo $ECHO_N "checking openssl/err.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking libxml/parser.h presence" >&5
+echo $ECHO_N "checking libxml/parser.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <openssl/err.h>
+#include <libxml/parser.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -10404,25 +10866,25 @@ echo "${ECHO_T}$ac_header_preproc" >&6
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: openssl/err.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: openssl/err.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/err.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: openssl/err.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxml/parser.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: libxml/parser.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxml/parser.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: libxml/parser.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: openssl/err.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: openssl/err.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/err.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: openssl/err.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/err.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: openssl/err.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/err.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: openssl/err.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/err.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: openssl/err.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: openssl/err.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: openssl/err.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxml/parser.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: libxml/parser.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxml/parser.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: libxml/parser.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxml/parser.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: libxml/parser.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxml/parser.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: libxml/parser.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxml/parser.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: libxml/parser.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxml/parser.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: libxml/parser.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
 ## ---------------------------------------- ##
@@ -10433,45 +10895,41 @@ _ASBOX
       sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for openssl/err.h" >&5
-echo $ECHO_N "checking for openssl/err.h... $ECHO_C" >&6
-if test "${ac_cv_header_openssl_err_h+set}" = set; then
+echo "$as_me:$LINENO: checking for libxml/parser.h" >&5
+echo $ECHO_N "checking for libxml/parser.h... $ECHO_C" >&6
+if test "${ac_cv_header_libxml_parser_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_header_openssl_err_h=$ac_header_preproc
+  ac_cv_header_libxml_parser_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_openssl_err_h" >&5
-echo "${ECHO_T}$ac_cv_header_openssl_err_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_libxml_parser_h" >&5
+echo "${ECHO_T}$ac_cv_header_libxml_parser_h" >&6
 
 fi
-if test $ac_cv_header_openssl_err_h = yes; then
+if test $ac_cv_header_libxml_parser_h = yes; then
   :
 else
-  { { echo "$as_me:$LINENO: error: header file <openssl/err.h> is required for OpenSSL" >&5
-echo "$as_me: error: header file <openssl/err.h> is required for OpenSSL" >&2;}
+  { { echo "$as_me:$LINENO: error: header file <libxml/parser.h> is required for XML support" >&5
+echo "$as_me: error: header file <libxml/parser.h> is required for XML support" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 
 fi
 
-if test "$with_pam" = yes ; then
-
-for ac_header in security/pam_appl.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if test "$with_libxslt" = yes ; then
+  if test "${ac_cv_header_libxslt_xslt_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for libxslt/xslt.h" >&5
+echo $ECHO_N "checking for libxslt/xslt.h... $ECHO_C" >&6
+if test "${ac_cv_header_libxslt_xslt_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_libxslt_xslt_h" >&5
+echo "${ECHO_T}$ac_cv_header_libxslt_xslt_h" >&6
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking libxslt/xslt.h usability" >&5
+echo $ECHO_N "checking libxslt/xslt.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -10479,7 +10937,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <$ac_header>
+#include <libxslt/xslt.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -10515,15 +10973,15 @@ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 echo "${ECHO_T}$ac_header_compiler" >&6
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking libxslt/xslt.h presence" >&5
+echo $ECHO_N "checking libxslt/xslt.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+#include <libxslt/xslt.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -10557,25 +11015,25 @@ echo "${ECHO_T}$ac_header_preproc" >&6
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxslt/xslt.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: libxslt/xslt.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxslt/xslt.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: libxslt/xslt.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxslt/xslt.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: libxslt/xslt.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxslt/xslt.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: libxslt/xslt.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxslt/xslt.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: libxslt/xslt.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxslt/xslt.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: libxslt/xslt.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxslt/xslt.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: libxslt/xslt.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: libxslt/xslt.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: libxslt/xslt.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
 ## ---------------------------------------- ##
@@ -10586,25 +11044,32 @@ _ASBOX
       sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for libxslt/xslt.h" >&5
+echo $ECHO_N "checking for libxslt/xslt.h... $ECHO_C" >&6
+if test "${ac_cv_header_libxslt_xslt_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
+  ac_cv_header_libxslt_xslt_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_libxslt_xslt_h" >&5
+echo "${ECHO_T}$ac_cv_header_libxslt_xslt_h" >&6
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
+if test $ac_cv_header_libxslt_xslt_h = yes; then
+  :
 else
+  { { echo "$as_me:$LINENO: error: header file <libxslt/xslt.h> is required for XSLT support" >&5
+echo "$as_me: error: header file <libxslt/xslt.h> is required for XSLT support" >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
-for ac_header in pam/pam_appl.h
+
+fi
+
+if test "$with_ldap" = yes ; then
+  if test "$PORTNAME" != "win32"; then
+
+for ac_header in ldap.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -10750,17 +11215,82 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
 _ACEOF
 
 else
-  { { echo "$as_me:$LINENO: error: header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM." >&5
-echo "$as_me: error: header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM." >&2;}
+  { { echo "$as_me:$LINENO: error: header file <ldap.h> is required for LDAP" >&5
+echo "$as_me: error: header file <ldap.h> is required for LDAP" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 done
 
+  else
+
+for ac_header in winldap.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  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 <windows.h>
+
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  { { echo "$as_me:$LINENO: error: header file <winldap.h> is required for LDAP" >&5
+echo "$as_me: error: header file <winldap.h> is required for LDAP" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 done
 
+  fi
 fi
 
 if test "$with_bonjour" = yes ; then
 ## Types, structures, compiler characteristics
 ##
 
- echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
+if test "${ac_cv_c_bigendian+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # See if sys/param.h defines the BYTE_ORDER macro.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
+
+int
+main ()
+{
+#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
+ bogus endian macros
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_bigendian=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_bigendian=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+# It does not; compile a test program.
+if test "$cross_compiling" = yes; then
+  # try to guess the endianness by grepping values into an object file
+  ac_cv_c_bigendian=unknown
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
+short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
+int
+main ()
+{
+ _ascii (); _ebcdic ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
+  ac_cv_c_bigendian=yes
+fi
+if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+  if test "$ac_cv_c_bigendian" = unknown; then
+    ac_cv_c_bigendian=no
+  else
+    # finding both strings is unlikely to happen, but who knows?
+    ac_cv_c_bigendian=unknown
+  fi
+fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+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 ()
+{
+  /* Are we little or big endian?  From Harbison&Steele.  */
+  union
+  {
+    long l;
+    char c[sizeof (long)];
+  } u;
+  u.l = 1;
+  exit (u.c[sizeof (long) - 1] == 1);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_bigendian=no
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_bigendian=yes
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6
+case $ac_cv_c_bigendian in
+  yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define WORDS_BIGENDIAN 1
+_ACEOF
+ ;;
+  no)
+     ;;
+  *)
+    { { echo "$as_me:$LINENO: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+echo "$as_me: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
 if test "${ac_cv_c_const+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -12641,24 +13401,279 @@ echo $ECHO_N "checking for struct sockcred... $ECHO_C" >&6
 if test "${ac_cv_type_struct_sockcred+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  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>
+
+int
+main ()
+{
+if ((struct sockcred *) 0)
+  return 0;
+if (sizeof (struct sockcred))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_struct_sockcred=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_struct_sockcred=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockcred" >&5
+echo "${ECHO_T}$ac_cv_type_struct_sockcred" >&6
+if test $ac_cv_type_struct_sockcred = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKCRED 1
+_ACEOF
+
+
+fi
+
+
+echo "$as_me:$LINENO: checking for struct option" >&5
+echo $ECHO_N "checking for struct option... $ECHO_C" >&6
+if test "${ac_cv_type_struct_option+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#endif
+
+int
+main ()
+{
+if ((struct option *) 0)
+  return 0;
+if (sizeof (struct option))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_struct_option=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_struct_option=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_struct_option" >&5
+echo "${ECHO_T}$ac_cv_type_struct_option" >&6
+if test $ac_cv_type_struct_option = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_OPTION 1
+_ACEOF
+
+
+fi
+
+
+if test "$with_zlib" = yes; then
+  # Check that <zlib.h> defines z_streamp (versions before about 1.0.4
+  # did not).  While we could work around the lack of z_streamp, it
+  # seems unwise to encourage people to use such old zlib versions...
+  echo "$as_me:$LINENO: checking for z_streamp" >&5
+echo $ECHO_N "checking for z_streamp... $ECHO_C" >&6
+if test "${ac_cv_type_z_streamp+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <zlib.h>
+
+int
+main ()
+{
+if ((z_streamp *) 0)
+  return 0;
+if (sizeof (z_streamp))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_z_streamp=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_z_streamp=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_z_streamp" >&5
+echo "${ECHO_T}$ac_cv_type_z_streamp" >&6
+if test $ac_cv_type_z_streamp = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: zlib version is too old
+Use --without-zlib to disable zlib support." >&5
+echo "$as_me: error: zlib version is too old
+Use --without-zlib to disable zlib support." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+
+if test "$with_krb5" = yes; then
+# Check for differences between MIT and Heimdal (KTH) releases
+  echo "$as_me:$LINENO: checking for krb5_ticket.enc_part2" >&5
+echo $ECHO_N "checking for krb5_ticket.enc_part2... $ECHO_C" >&6
+if test "${ac_cv_member_krb5_ticket_enc_part2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <krb5.h>
+
+int
+main ()
+{
+static krb5_ticket ac_aggr;
+if (ac_aggr.enc_part2)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_member_krb5_ticket_enc_part2=yes
+else
+  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 <krb5.h>
 
 int
 main ()
 {
-if ((struct sockcred *) 0)
-  return 0;
-if (sizeof (struct sockcred))
-  return 0;
+static krb5_ticket ac_aggr;
+if (sizeof ac_aggr.enc_part2)
+return 0;
   ;
   return 0;
 }
@@ -12685,30 +13700,30 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_struct_sockcred=yes
+  ac_cv_member_krb5_ticket_enc_part2=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_struct_sockcred=no
+ac_cv_member_krb5_ticket_enc_part2=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockcred" >&5
-echo "${ECHO_T}$ac_cv_type_struct_sockcred" >&6
-if test $ac_cv_type_struct_sockcred = yes; then
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_krb5_ticket_enc_part2" >&5
+echo "${ECHO_T}$ac_cv_member_krb5_ticket_enc_part2" >&6
+if test $ac_cv_member_krb5_ticket_enc_part2 = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_SOCKCRED 1
+#define HAVE_KRB5_TICKET_ENC_PART2 1
 _ACEOF
 
 
-fi
-
-
-echo "$as_me:$LINENO: checking for struct option" >&5
-echo $ECHO_N "checking for struct option... $ECHO_C" >&6
-if test "${ac_cv_type_struct_option+set}" = set; then
+else
+  echo "$as_me:$LINENO: checking for krb5_ticket.client" >&5
+echo $ECHO_N "checking for krb5_ticket.client... $ECHO_C" >&6
+if test "${ac_cv_member_krb5_ticket_client+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -12717,17 +13732,14 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#ifdef HAVE_GETOPT_H
-#include <getopt.h>
-#endif
+#include <krb5.h>
 
 int
 main ()
 {
-if ((struct option *) 0)
-  return 0;
-if (sizeof (struct option))
-  return 0;
+static krb5_ticket ac_aggr;
+if (ac_aggr.client)
+return 0;
   ;
   return 0;
 }
@@ -12754,51 +13766,25 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_struct_option=yes
+  ac_cv_member_krb5_ticket_client=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_struct_option=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_struct_option" >&5
-echo "${ECHO_T}$ac_cv_type_struct_option" >&6
-if test $ac_cv_type_struct_option = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_OPTION 1
-_ACEOF
-
-
-fi
-
-
-if test "$with_zlib" = yes; then
-  # Check that <zlib.h> defines z_streamp (versions before about 1.0.4
-  # did not).  While we could work around the lack of z_streamp, it
-  # seems unwise to encourage people to use such old zlib versions...
-  echo "$as_me:$LINENO: checking for z_streamp" >&5
-echo $ECHO_N "checking for z_streamp... $ECHO_C" >&6
-if test "${ac_cv_type_z_streamp+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  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 <zlib.h>
+#include <krb5.h>
 
 int
 main ()
 {
-if ((z_streamp *) 0)
-  return 0;
-if (sizeof (z_streamp))
-  return 0;
+static krb5_ticket ac_aggr;
+if (sizeof ac_aggr.client)
+return 0;
   ;
   return 0;
 }
@@ -12825,34 +13811,37 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_z_streamp=yes
+  ac_cv_member_krb5_ticket_client=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_z_streamp=no
+ac_cv_member_krb5_ticket_client=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_z_streamp" >&5
-echo "${ECHO_T}$ac_cv_type_z_streamp" >&6
-if test $ac_cv_type_z_streamp = yes; then
-  :
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_krb5_ticket_client" >&5
+echo "${ECHO_T}$ac_cv_member_krb5_ticket_client" >&6
+if test $ac_cv_member_krb5_ticket_client = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_KRB5_TICKET_CLIENT 1
+_ACEOF
+
+
 else
-  { { echo "$as_me:$LINENO: error: zlib version is too old
-Use --without-zlib to disable zlib support." >&5
-echo "$as_me: error: zlib version is too old
-Use --without-zlib to disable zlib support." >&2;}
+  { { echo "$as_me:$LINENO: error: could not determine how to get client name from Kerberos 5 ticket" >&5
+echo "$as_me: error: could not determine how to get client name from Kerberos 5 ticket" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 fi
 
-if test "$with_krb5" = yes; then
-# Check for differences between MIT and Heimdal (KTH) releases
-  echo "$as_me:$LINENO: checking for krb5_ticket.enc_part2" >&5
-echo $ECHO_N "checking for krb5_ticket.enc_part2... $ECHO_C" >&6
-if test "${ac_cv_member_krb5_ticket_enc_part2+set}" = set; then
+  echo "$as_me:$LINENO: checking for krb5_error.text.data" >&5
+echo $ECHO_N "checking for krb5_error.text.data... $ECHO_C" >&6
+if test "${ac_cv_member_krb5_error_text_data+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -12866,8 +13855,8 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-static krb5_ticket ac_aggr;
-if (ac_aggr.enc_part2)
+static krb5_error ac_aggr;
+if (ac_aggr.text.data)
 return 0;
   ;
   return 0;
@@ -12895,7 +13884,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_member_krb5_ticket_enc_part2=yes
+  ac_cv_member_krb5_error_text_data=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -12911,8 +13900,8 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-static krb5_ticket ac_aggr;
-if (sizeof ac_aggr.enc_part2)
+static krb5_error ac_aggr;
+if (sizeof ac_aggr.text.data)
 return 0;
   ;
   return 0;
@@ -12940,30 +13929,30 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_member_krb5_ticket_enc_part2=yes
+  ac_cv_member_krb5_error_text_data=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_krb5_ticket_enc_part2=no
+ac_cv_member_krb5_error_text_data=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_krb5_ticket_enc_part2" >&5
-echo "${ECHO_T}$ac_cv_member_krb5_ticket_enc_part2" >&6
-if test $ac_cv_member_krb5_ticket_enc_part2 = yes; then
+echo "$as_me:$LINENO: result: $ac_cv_member_krb5_error_text_data" >&5
+echo "${ECHO_T}$ac_cv_member_krb5_error_text_data" >&6
+if test $ac_cv_member_krb5_error_text_data = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_TICKET_ENC_PART2 1
+#define HAVE_KRB5_ERROR_TEXT_DATA 1
 _ACEOF
 
 
 else
-  echo "$as_me:$LINENO: checking for krb5_ticket.client" >&5
-echo $ECHO_N "checking for krb5_ticket.client... $ECHO_C" >&6
-if test "${ac_cv_member_krb5_ticket_client+set}" = set; then
+  echo "$as_me:$LINENO: checking for krb5_error.e_data" >&5
+echo $ECHO_N "checking for krb5_error.e_data... $ECHO_C" >&6
+if test "${ac_cv_member_krb5_error_e_data+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -12977,8 +13966,8 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-static krb5_ticket ac_aggr;
-if (ac_aggr.client)
+static krb5_error ac_aggr;
+if (ac_aggr.e_data)
 return 0;
   ;
   return 0;
@@ -13006,7 +13995,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_member_krb5_ticket_client=yes
+  ac_cv_member_krb5_error_e_data=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -13022,8 +14011,8 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-static krb5_ticket ac_aggr;
-if (sizeof ac_aggr.client)
+static krb5_error ac_aggr;
+if (sizeof ac_aggr.e_data)
 return 0;
   ;
   return 0;
@@ -13051,37 +14040,44 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_member_krb5_ticket_client=yes
+  ac_cv_member_krb5_error_e_data=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_krb5_ticket_client=no
+ac_cv_member_krb5_error_e_data=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_krb5_ticket_client" >&5
-echo "${ECHO_T}$ac_cv_member_krb5_ticket_client" >&6
-if test $ac_cv_member_krb5_ticket_client = yes; then
+echo "$as_me:$LINENO: result: $ac_cv_member_krb5_error_e_data" >&5
+echo "${ECHO_T}$ac_cv_member_krb5_error_e_data" >&6
+if test $ac_cv_member_krb5_error_e_data = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_TICKET_CLIENT 1
+#define HAVE_KRB5_ERROR_E_DATA 1
 _ACEOF
 
 
 else
-  { { echo "$as_me:$LINENO: error: could not determine how to get client name from Kerberos 5 ticket" >&5
-echo "$as_me: error: could not determine how to get client name from Kerberos 5 ticket" >&2;}
+  { { echo "$as_me:$LINENO: error: could not determine how to extract Kerberos 5 error messages" >&5
+echo "$as_me: error: could not determine how to extract Kerberos 5 error messages" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 fi
 
-  echo "$as_me:$LINENO: checking for krb5_error.text.data" >&5
-echo $ECHO_N "checking for krb5_error.text.data... $ECHO_C" >&6
-if test "${ac_cv_member_krb5_error_text_data+set}" = set; then
+fi
+
+
+##
+## Functions, global variables
+##
+
+echo "$as_me:$LINENO: checking for int timezone" >&5
+echo $ECHO_N "checking for int timezone... $ECHO_C" >&6
+if test "${pgac_cv_var_int_timezone+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -13090,21 +14086,23 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <krb5.h>
-
+#include <time.h>
+int res;
 int
 main ()
 {
-static krb5_error ac_aggr;
-if (ac_aggr.text.data)
-return 0;
+#ifndef __CYGWIN__
+res = timezone / 60;
+#else
+res = _timezone / 60;
+#endif
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -13118,31 +14116,66 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_member_krb5_error_text_data=yes
+  pgac_cv_var_int_timezone=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+pgac_cv_var_int_timezone=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $pgac_cv_var_int_timezone" >&5
+echo "${ECHO_T}$pgac_cv_var_int_timezone" >&6
+if test x"$pgac_cv_var_int_timezone" = xyes ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INT_TIMEZONE
+_ACEOF
+
+fi
+echo "$as_me:$LINENO: checking types of arguments for accept()" >&5
+echo $ECHO_N "checking types of arguments for accept()... $ECHO_C" >&6
+ if test "${ac_cv_func_accept_return+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+   if test "${ac_cv_func_accept_arg1+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    if test "${ac_cv_func_accept_arg2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+     if test "${ac_cv_func_accept_arg3+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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_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
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <krb5.h>
-
+/* end confdefs.h.  */
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);
 int
 main ()
 {
-static krb5_error ac_aggr;
-if (sizeof ac_aggr.text.data)
-return 0;
+
   ;
   return 0;
 }
@@ -13169,30 +14202,60 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_member_krb5_error_text_data=yes
+  ac_not_found=no; break 4
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_krb5_error_text_data=no
+ac_not_found=yes
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+       done
+      done
+     done
+    done
+    if test "$ac_not_found" = yes; then
+      { { echo "$as_me:$LINENO: error: could not determine argument types" >&5
+echo "$as_me: error: could not determine argument types" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    if test "$ac_cv_func_accept_arg3" = "void"; then
+      ac_cv_func_accept_arg3=int
+    fi
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_krb5_error_text_data" >&5
-echo "${ECHO_T}$ac_cv_member_krb5_error_text_data" >&6
-if test $ac_cv_member_krb5_error_text_data = yes; then
+
+fi
+
+fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&5
+echo "${ECHO_T}$ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&6
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_ERROR_TEXT_DATA 1
+#define ACCEPT_TYPE_RETURN $ac_cv_func_accept_return
 _ACEOF
 
 
-else
-  echo "$as_me:$LINENO: checking for krb5_error.e_data" >&5
-echo $ECHO_N "checking for krb5_error.e_data... $ECHO_C" >&6
-if test "${ac_cv_member_krb5_error_e_data+set}" = set; then
+cat >>confdefs.h <<_ACEOF
+#define ACCEPT_TYPE_ARG1 $ac_cv_func_accept_arg1
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define ACCEPT_TYPE_ARG2 $ac_cv_func_accept_arg2
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define ACCEPT_TYPE_ARG3 $ac_cv_func_accept_arg3
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking whether gettimeofday takes only one argument" >&5
+echo $ECHO_N "checking whether gettimeofday takes only one argument... $ECHO_C" >&6
+if test "${pgac_cv_func_gettimeofday_1arg+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -13201,14 +14264,13 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <krb5.h>
-
+#include <sys/time.h>
 int
 main ()
 {
-static krb5_error ac_aggr;
-if (ac_aggr.e_data)
-return 0;
+struct timeval *tp;
+struct timezone *tzp;
+gettimeofday(tp,tzp);
   ;
   return 0;
 }
@@ -13235,32 +14297,109 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_member_krb5_error_e_data=yes
+  pgac_cv_func_gettimeofday_1arg=no
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+pgac_cv_func_gettimeofday_1arg=yes
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $pgac_cv_func_gettimeofday_1arg" >&5
+echo "${ECHO_T}$pgac_cv_func_gettimeofday_1arg" >&6
+if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define GETTIMEOFDAY_1ARG
+_ACEOF
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in cbrt dlopen fcvt fdatasync getpeereid getrlimit memmove poll pstat readlink setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <krb5.h>
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
 
 int
 main ()
 {
-static krb5_error ac_aggr;
-if (sizeof ac_aggr.e_data)
-return 0;
+return f != $ac_func;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -13274,49 +14413,36 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_member_krb5_error_e_data=yes
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_krb5_error_e_data=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_krb5_error_e_data" >&5
-echo "${ECHO_T}$ac_cv_member_krb5_error_e_data" >&6
-if test $ac_cv_member_krb5_error_e_data = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_KRB5_ERROR_E_DATA 1
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
-
-else
-  { { echo "$as_me:$LINENO: error: could not determine how to extract Kerberos 5 error messages" >&5
-echo "$as_me: error: could not determine how to extract Kerberos 5 error messages" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-fi
-
 fi
+done
 
-##
-## Functions, global variables
-##
 
-echo "$as_me:$LINENO: checking for int timezone" >&5
-echo $ECHO_N "checking for int timezone... $ECHO_C" >&6
-if test "${pgac_cv_var_int_timezone+set}" = set; then
+echo "$as_me:$LINENO: checking whether fdatasync is declared" >&5
+echo $ECHO_N "checking whether fdatasync is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_fdatasync+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -13325,23 +14451,22 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <time.h>
-int res;
+#include <unistd.h>
+
 int
 main ()
 {
-#ifndef __CYGWIN__
-res = timezone / 60;
-#else
-res = _timezone / 60;
+#ifndef fdatasync
+  char *p = (char *) fdatasync;
 #endif
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -13355,65 +14480,58 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  pgac_cv_var_int_timezone=yes
+  ac_cv_have_decl_fdatasync=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-pgac_cv_var_int_timezone=no
+ac_cv_have_decl_fdatasync=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $pgac_cv_var_int_timezone" >&5
-echo "${ECHO_T}$pgac_cv_var_int_timezone" >&6
-if test x"$pgac_cv_var_int_timezone" = xyes ; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_INT_TIMEZONE
-_ACEOF
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_fdatasync" >&5
+echo "${ECHO_T}$ac_cv_have_decl_fdatasync" >&6
+if test $ac_cv_have_decl_fdatasync = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FDATASYNC 1
+_ACEOF
+
 
-fi
-echo "$as_me:$LINENO: checking types of arguments for accept()" >&5
-echo $ECHO_N "checking types of arguments for accept()... $ECHO_C" >&6
- if test "${ac_cv_func_accept_return+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-   if test "${ac_cv_func_accept_arg1+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-    if test "${ac_cv_func_accept_arg2+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-     if test "${ac_cv_func_accept_arg3+set}" = set; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FDATASYNC 0
+_ACEOF
+
+
+fi
+
+
+echo "$as_me:$LINENO: checking whether posix_fadvise is declared" >&5
+echo $ECHO_N "checking whether posix_fadvise is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_posix_fadvise+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&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_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
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-extern $ac_cv_func_accept_return accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);
+#include <fcntl.h>
+
 int
 main ()
 {
+#ifndef posix_fadvise
+  char *p = (char *) posix_fadvise;
+#endif
 
   ;
   return 0;
@@ -13441,60 +14559,36 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_not_found=no; break 4
+  ac_cv_have_decl_posix_fadvise=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_not_found=yes
+ac_cv_have_decl_posix_fadvise=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-       done
-      done
-     done
-    done
-    if test "$ac_not_found" = yes; then
-      { { echo "$as_me:$LINENO: error: could not determine argument types" >&5
-echo "$as_me: error: could not determine argument types" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-    if test "$ac_cv_func_accept_arg3" = "void"; then
-      ac_cv_func_accept_arg3=int
-    fi
-
-fi
-
-fi
-
-fi
-
 fi
- echo "$as_me:$LINENO: result: $ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&5
-echo "${ECHO_T}$ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *" >&6
-
-cat >>confdefs.h <<_ACEOF
-#define ACCEPT_TYPE_RETURN $ac_cv_func_accept_return
-_ACEOF
-
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_posix_fadvise" >&5
+echo "${ECHO_T}$ac_cv_have_decl_posix_fadvise" >&6
+if test $ac_cv_have_decl_posix_fadvise = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define ACCEPT_TYPE_ARG1 $ac_cv_func_accept_arg1
+#define HAVE_DECL_POSIX_FADVISE 1
 _ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define ACCEPT_TYPE_ARG2 $ac_cv_func_accept_arg2
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_POSIX_FADVISE 0
 _ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define ACCEPT_TYPE_ARG3 $ac_cv_func_accept_arg3
-_ACEOF
+fi
 
 
-echo "$as_me:$LINENO: checking whether gettimeofday takes only one argument" >&5
-echo $ECHO_N "checking whether gettimeofday takes only one argument... $ECHO_C" >&6
-if test "${pgac_cv_func_gettimeofday_1arg+set}" = set; then
+echo "$as_me:$LINENO: checking whether strlcat is declared" >&5
+echo $ECHO_N "checking whether strlcat is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_strlcat+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -13503,13 +14597,14 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/time.h>
+$ac_includes_default
 int
 main ()
 {
-struct timeval *tp;
-struct timezone *tzp;
-gettimeofday(tp,tzp);
+#ifndef strlcat
+  char *p = (char *) strlcat;
+#endif
+
   ;
   return 0;
 }
@@ -13536,52 +14631,34 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  pgac_cv_func_gettimeofday_1arg=no
+  ac_cv_have_decl_strlcat=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-pgac_cv_func_gettimeofday_1arg=yes
+ac_cv_have_decl_strlcat=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $pgac_cv_func_gettimeofday_1arg" >&5
-echo "${ECHO_T}$pgac_cv_func_gettimeofday_1arg" >&6
-if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_strlcat" >&5
+echo "${ECHO_T}$ac_cv_have_decl_strlcat" >&6
+if test $ac_cv_have_decl_strlcat = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define GETTIMEOFDAY_1ARG
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRLCAT 1
 _ACEOF
 
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRLCAT 0
+_ACEOF
 
 
-for ac_func in cbrt dlopen fcvt fdatasync getpeereid memmove poll pstat readlink setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+fi
+echo "$as_me:$LINENO: checking whether strlcpy is declared" >&5
+echo $ECHO_N "checking whether strlcpy is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_strlcpy+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -13590,54 +14667,21 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+$ac_includes_default
 int
 main ()
 {
-return f != $ac_func;
+#ifndef strlcpy
+  char *p = (char *) strlcpy;
+#endif
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -13651,36 +14695,43 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  ac_cv_have_decl_strlcpy=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+ac_cv_have_decl_strlcpy=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_strlcpy" >&5
+echo "${ECHO_T}$ac_cv_have_decl_strlcpy" >&6
+if test $ac_cv_have_decl_strlcpy = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRLCPY 1
+_ACEOF
+
+
+else
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_DECL_STRLCPY 0
 _ACEOF
 
+
 fi
-done
 
 
-echo "$as_me:$LINENO: checking whether fdatasync is declared" >&5
-echo $ECHO_N "checking whether fdatasync is declared... $ECHO_C" >&6
-if test "${ac_cv_have_decl_fdatasync+set}" = set; then
+# This is probably only present on Darwin, but may as well check always
+echo "$as_me:$LINENO: checking whether F_FULLFSYNC is declared" >&5
+echo $ECHO_N "checking whether F_FULLFSYNC is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_F_FULLFSYNC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -13689,13 +14740,13 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <unistd.h>
+#include <fcntl.h>
 
 int
 main ()
 {
-#ifndef fdatasync
-  char *p = (char *) fdatasync;
+#ifndef F_FULLFSYNC
+  char *p = (char *) F_FULLFSYNC;
 #endif
 
   ;
@@ -13724,27 +14775,27 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_have_decl_fdatasync=yes
+  ac_cv_have_decl_F_FULLFSYNC=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_fdatasync=no
+ac_cv_have_decl_F_FULLFSYNC=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_fdatasync" >&5
-echo "${ECHO_T}$ac_cv_have_decl_fdatasync" >&6
-if test $ac_cv_have_decl_fdatasync = yes; then
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_F_FULLFSYNC" >&5
+echo "${ECHO_T}$ac_cv_have_decl_F_FULLFSYNC" >&6
+if test $ac_cv_have_decl_F_FULLFSYNC = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FDATASYNC 1
+#define HAVE_DECL_F_FULLFSYNC 1
 _ACEOF
 
 
 else
   cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FDATASYNC 0
+#define HAVE_DECL_F_FULLFSYNC 0
 _ACEOF
 
 
 # also decide to use snprintf.c if snprintf() is present but does not
 # have all the features we need --- see below.
 
-pgac_need_repl_snprintf=no
+if test "$PORTNAME" = "win32"; then
+  # Win32 gets snprintf.c built unconditionally.
+  #
+  # To properly translate all NLS languages strings, we must support the
+  # *printf() %$ format, which allows *printf() arguments to be selected
+  # by position in the translated string.
+  #
+  # libintl versions < 0.13 use the native *printf() functions, and Win32
+  # *printf() doesn't understand %$, so we must use our /port versions,
+  # which do understand %$. libintl versions >= 0.13 include their own
+  # *printf versions on Win32.  The libintl 0.13 release note text is:
+  #
+  #   C format strings with positions, as they arise when a translator
+  #   needs to reorder a sentence, are now supported on all platforms.
+  #   On those few platforms (NetBSD and Woe32) for which the native
+  #   printf()/fprintf()/... functions don't support such format
+  #   strings, replacements are provided through <libintl.h>.
+  #
+  # We could use libintl >= 0.13's *printf() if we were sure that we had
+  # a litint >= 0.13 at runtime, but seeing that there is no clean way
+  # to guarantee that, it is best to just use our own, so we are sure to
+  # get %$ support. In include/port.h we disable the *printf() macros
+  # that might have been defined by libintl.
+  #
+  # We do this unconditionally whether NLS is used or not so we are sure
+  # that all Win32 libraries and binaries behave the same.
+  pgac_need_repl_snprintf=yes
+else
+  pgac_need_repl_snprintf=no
 
 for ac_func in snprintf
 do
@@ -14102,6 +15181,7 @@ else
 fi
 done
 
+fi
 
 
 # Check whether <stdio.h> declares snprintf() and vsnprintf(); if not,
@@ -14253,7 +15333,6 @@ fi
 
 
 
-# do this one the hard way in case isinf() is a macro
 echo "$as_me:$LINENO: checking for isinf" >&5
 echo $ECHO_N "checking for isinf... $ECHO_C" >&6
 if test "${ac_cv_func_isinf+set}" = set; then
@@ -14265,12 +15344,14 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+
 #include <math.h>
+double glob_double;
 
 int
 main ()
 {
-double x = 0.0; int res = isinf(x);
+return isinf(glob_double) ? 0 : 1;
   ;
   return 0;
 }
@@ -14433,6 +15514,10 @@ done
 
 fi
 
+# Some versions of libedit contain strlcpy(); so disregard that library while
+# checking for these standard libc functions.
+pgac_save_LIBS="$LIBS"
+LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
 
 
 
 
 
 
-for ac_func in crypt fseeko getopt getrusage inet_aton random rint srandom strdup strerror strtol strtoul unsetenv
+
+
+
+for ac_func in crypt fseeko getopt getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul unsetenv
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -14558,6 +15646,8 @@ done
 
 
 
+LIBS="$pgac_save_LIBS"
+
 # System's version of getaddrinfo(), if any, may be used only if we found
 # a definition for struct addrinfo; see notes in src/include/getaddrinfo.h.
 # (Note: the AC_REPLACE_FUNCS probe fails on Windows, where the available
@@ -14819,18 +15909,6 @@ case $host_os in bsdi*|netbsd*)
 ac_cv_func_fseeko=yes
 esac
 
-# Solaris has a very slow qsort in certain cases, so we replace it.
-if test "$PORTNAME" = "solaris"; then
-case $LIBOBJS in
-    "qsort.$ac_objext"   | \
-  *" qsort.$ac_objext"   | \
-    "qsort.$ac_objext "* | \
-  *" qsort.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS qsort.$ac_objext" ;;
-esac
-
-fi
-
 # Win32 support
 if test "$PORTNAME" = "win32"; then
 case $LIBOBJS in
@@ -14865,6 +15943,14 @@ case $LIBOBJS in
   *) LIBOBJS="$LIBOBJS rand.$ac_objext" ;;
 esac
 
+case $LIBOBJS in
+    "win32error.$ac_objext"   | \
+  *" win32error.$ac_objext"   | \
+    "win32error.$ac_objext "* | \
+  *" win32error.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS win32error.$ac_objext" ;;
+esac
+
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_SYMLINK 1
@@ -15142,19 +16228,19 @@ done
 fi
 
 
-echo "$as_me:$LINENO: checking for finite" >&5
-echo $ECHO_N "checking for finite... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for sigsetjmp" >&5
+echo $ECHO_N "checking for sigsetjmp... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <math.h>
+#include <setjmp.h>
 int
 main ()
 {
-int dummy=finite(1.0);
+sigjmp_buf x; sigsetjmp(x, 1);
   ;
   return 0;
 }
@@ -15183,7 +16269,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   (exit $ac_status); }; }; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_FINITE 1
+#define HAVE_SIGSETJMP 1
 _ACEOF
 
 echo "$as_me:$LINENO: result: yes" >&5
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 
-echo "$as_me:$LINENO: checking for sigsetjmp" >&5
-echo $ECHO_N "checking for sigsetjmp... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
+echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5
+echo $ECHO_N "checking whether sys_siglist is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_sys_siglist+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <setjmp.h>
+#include <signal.h>
+/* NetBSD declares sys_siglist in unistd.h.  */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+
 int
 main ()
 {
-sigjmp_buf x; sigsetjmp(x, 1);
+#ifndef sys_siglist
+  char *p = (char *) sys_siglist;
+#endif
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -15231,28 +16329,40 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
+  ac_cv_have_decl_sys_siglist=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SIGSETJMP 1
+ac_cv_have_decl_sys_siglist=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5
+echo "${ECHO_T}$ac_cv_have_decl_sys_siglist" >&6
+if test $ac_cv_have_decl_sys_siglist = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SYS_SIGLIST 1
 _ACEOF
 
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SYS_SIGLIST 0
+_ACEOF
+
 
-echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+
+
+
 
 echo "$as_me:$LINENO: checking for syslog" >&5
 echo $ECHO_N "checking for syslog... $ECHO_C" >&6
@@ -16156,8 +17266,8 @@ fi
 # For each platform, we need to know about any special compile and link
 # libraries, and whether the normal C function names are thread-safe.
 # See the comment at the top of src/port/thread.c for more information.
-#
-if test "$enable_thread_safety" = yes; then
+# WIN32 doesn't need the pthread tests;  it always uses threads
+if test "$enable_thread_safety" = yes -a "$PORTNAME" != "win32"; then
 
 
 
@@ -16667,27 +17777,21 @@ PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEM
 # Let's see who fails, perhaps AIX.  2004-04-23
 if test "$PTHREAD_CC" != "$CC"; then
 { { echo "$as_me:$LINENO: error:
-PostgreSQL does not support platforms that require a special
-compiler binary for thread-safety.
-" >&5
+PostgreSQL does not support platforms that require a special compiler
+for thread safety." >&5
 echo "$as_me: error:
-PostgreSQL does not support platforms that require a special
-compiler binary for thread-safety.
-" >&2;}
+PostgreSQL does not support platforms that require a special compiler
+for thread safety." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 if test "$THREAD_SUPPORT" = no; then
-{ { echo "$as_me:$LINENO: error:
-Cannot enable threads on your platform.
-Your platform is known to not support thread-safe programs.
-For details, compile and run src/bin/pg_thread_test.
-" >&5
-echo "$as_me: error:
-Cannot enable threads on your platform.
-Your platform is known to not support thread-safe programs.
-For details, compile and run src/bin/pg_thread_test.
-" >&2;}
+{ { echo "$as_me:$LINENO: error: cannot enable threads on this platform
+This platform is known to not support thread-safe programs.  For details,
+compile and run src/bin/pg_thread_test." >&5
+echo "$as_me: error: cannot enable threads on this platform
+This platform is known to not support thread-safe programs.  For details,
+compile and run src/bin/pg_thread_test." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -16697,6 +17801,7 @@ _LIBS="$LIBS"
 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 LIBS="$LIBS $PTHREAD_LIBS"
 
+if test "$PORTNAME" != "win32"; then
 if test "${ac_cv_header_pthread_h+set}" = set; then
   echo "$as_me:$LINENO: checking for pthread.h" >&5
 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
@@ -16843,6 +17948,7 @@ echo "$as_me: error: pthread.h not found, required for --enable-thread-safety" >
 fi
 
 
+fi
 
 
 
 
 
 
+# We can test for libldap_r only after we know PTHREAD_LIBS
+if test "$with_ldap" = yes ; then
+  _LIBS="$LIBS"
+  if test "$PORTNAME" != "win32"; then
+
+echo "$as_me:$LINENO: checking for ldap_bind in -lldap" >&5
+echo $ECHO_N "checking for ldap_bind in -lldap... $ECHO_C" >&6
+if test "${ac_cv_lib_ldap_ldap_bind+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lldap $EXTRA_LDAP_LIBS $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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char ldap_bind ();
+int
+main ()
+{
+ldap_bind ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ldap_ldap_bind=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ldap_ldap_bind=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_bind" >&5
+echo "${ECHO_T}$ac_cv_lib_ldap_ldap_bind" >&6
+if test $ac_cv_lib_ldap_ldap_bind = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBLDAP 1
+_ACEOF
+
+  LIBS="-lldap $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: library 'ldap' is required for LDAP" >&5
+echo "$as_me: error: library 'ldap' is required for LDAP" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+    LDAP_LIBS_BE="-lldap $EXTRA_LDAP_LIBS"
+    if test "$enable_thread_safety" = yes; then
+      # on some platforms ldap_r fails to link without PTHREAD_LIBS
+
+echo "$as_me:$LINENO: checking for ldap_simple_bind in -lldap_r" >&5
+echo $ECHO_N "checking for ldap_simple_bind in -lldap_r... $ECHO_C" >&6
+if test "${ac_cv_lib_ldap_r_ldap_simple_bind+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lldap_r $PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS $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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char ldap_simple_bind ();
+int
+main ()
+{
+ldap_simple_bind ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ldap_r_ldap_simple_bind=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ldap_r_ldap_simple_bind=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_r_ldap_simple_bind" >&5
+echo "${ECHO_T}$ac_cv_lib_ldap_r_ldap_simple_bind" >&6
+if test $ac_cv_lib_ldap_r_ldap_simple_bind = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBLDAP_R 1
+_ACEOF
+
+  LIBS="-lldap_r $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: library 'ldap_r' is required for LDAP" >&5
+echo "$as_me: error: library 'ldap_r' is required for LDAP" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+      LDAP_LIBS_FE="-lldap_r $EXTRA_LDAP_LIBS"
+    else
+      LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"
+    fi
+  else
+
+echo "$as_me:$LINENO: checking for ldap_bind in -lwldap32" >&5
+echo $ECHO_N "checking for ldap_bind in -lwldap32... $ECHO_C" >&6
+if test "${ac_cv_lib_wldap32_ldap_bind+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lwldap32  $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 gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char ldap_bind ();
+int
+main ()
+{
+ldap_bind ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_wldap32_ldap_bind=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_wldap32_ldap_bind=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_wldap32_ldap_bind" >&5
+echo "${ECHO_T}$ac_cv_lib_wldap32_ldap_bind" >&6
+if test $ac_cv_lib_wldap32_ldap_bind = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBWLDAP32 1
+_ACEOF
+
+  LIBS="-lwldap32 $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: library 'wldap32' is required for LDAP" >&5
+echo "$as_me: error: library 'wldap32' is required for LDAP" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+    LDAP_LIBS_FE="-lwldap32"
+    LDAP_LIBS_BE="-lwldap32"
+  fi
+  LIBS="$_LIBS"
+fi
+
+
+
+
 # This test makes sure that run tests work at all.  Sometimes a shared
 # library is found by the linker, but the runtime linker can't find it.
 # This check should come after all modifications of compiler or linker
@@ -17137,28 +18498,25 @@ sed 's/^/| /' conftest.$ac_ext >&5
 echo "$as_me:$LINENO: result: failed" >&5
 echo "${ECHO_T}failed" >&6
 { { echo "$as_me:$LINENO: error:
-*** Could not execute a simple test program.  This may be a problem
-*** related to locating shared libraries.  Check the file 'config.log'
-*** for the exact reason." >&5
+Could not execute a simple test program.  This may be a problem
+related to locating shared libraries.  Check the file 'config.log'
+for the exact reason." >&5
 echo "$as_me: error:
-*** Could not execute a simple test program.  This may be a problem
-*** related to locating shared libraries.  Check the file 'config.log'
-*** for the exact reason." >&2;}
+Could not execute a simple test program.  This may be a problem
+related to locating shared libraries.  Check the file 'config.log'
+for the exact reason." >&2;}
    { (exit 1); exit 1; }; }
 fi
 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
+# --------------------
+# Run tests below here
+# --------------------
 
 # Force use of our snprintf if system's doesn't do arg control
-# This feature is used by NLS
-if test "$enable_nls" = yes &&
-   test $pgac_need_repl_snprintf = no &&
-# On Win32, libintl replaces snprintf() with its own version that
-# understands arg control, so we don't need our own.  In fact, it
-# also uses macros that conflict with ours, so we _can't_ use
-# our own.
-   test "$PORTNAME" != "win32"; then
+# See comment above at snprintf test for details.
+if test "$enable_nls" = yes -a "$pgac_need_repl_snprintf" = no; then
   echo "$as_me:$LINENO: checking whether printf supports argument control" >&5
 echo $ECHO_N "checking whether printf supports argument control... $ECHO_C" >&6
 if test "${pgac_cv_printf_arg_control+set}" = set; then
@@ -17645,7 +19003,7 @@ _ACEOF
 if test $pgac_need_repl_snprintf = yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define USE_SNPRINTF 1
+#define USE_REPL_SNPRINTF 1
 _ACEOF
 
   case $LIBOBJS in
@@ -20919,7 +22277,7 @@ fi
 
 
 
-if test x"$template" != x"win32"
+if test "$PORTNAME" != "win32"
 then
 echo "$as_me:$LINENO: checking for POSIX signal interface" >&5
 echo $ECHO_N "checking for POSIX signal interface... $ECHO_C" >&6
@@ -20990,13 +22348,11 @@ HAVE_POSIX_SIGNALS=$pgac_cv_func_posix_signals
 
 if test "$pgac_cv_func_posix_signals" != yes -a "$enable_thread_safety" = yes; then
   { { echo "$as_me:$LINENO: error:
-*** Thread-safety requires POSIX signals, which are not supported by your
-*** operating system.
-" >&5
+Thread-safety requires POSIX signals, which are not supported by this
+operating system." >&5
 echo "$as_me: error:
-*** Thread-safety requires POSIX signals, which are not supported by your
-*** operating system.
-" >&2;}
+Thread-safety requires POSIX signals, which are not supported by this
+operating system." >&2;}
    { (exit 1); exit 1; }; }
 fi
 fi
@@ -21453,39 +22809,67 @@ esac
 
 
 # Select semaphore implementation type.
-if test x"$USE_NAMED_POSIX_SEMAPHORES" = x"1" ; then
+if test "$PORTNAME" != "win32"; then
+  if test x"$USE_NAMED_POSIX_SEMAPHORES" = x"1" ; then
 
 cat >>confdefs.h <<\_ACEOF
 #define USE_NAMED_POSIX_SEMAPHORES 1
 _ACEOF
 
-  SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
-else
-  if test x"$USE_UNNAMED_POSIX_SEMAPHORES" = x"1" ; then
+    SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
+  else
+    if test x"$USE_UNNAMED_POSIX_SEMAPHORES" = x"1" ; then
 
 cat >>confdefs.h <<\_ACEOF
 #define USE_UNNAMED_POSIX_SEMAPHORES 1
 _ACEOF
 
-    SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
-  else
+      SEMA_IMPLEMENTATION="src/backend/port/posix_sema.c"
+    else
 
 cat >>confdefs.h <<\_ACEOF
 #define USE_SYSV_SEMAPHORES 1
 _ACEOF
 
-    SEMA_IMPLEMENTATION="src/backend/port/sysv_sema.c"
+      SEMA_IMPLEMENTATION="src/backend/port/sysv_sema.c"
+    fi
   fi
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_WIN32_SEMAPHORES 1
+_ACEOF
+
+  SEMA_IMPLEMENTATION="src/backend/port/win32_sema.c"
 fi
 
 
 # Select shared-memory implementation type.
+if test "$PORTNAME" != "win32"; then
 
 cat >>confdefs.h <<\_ACEOF
 #define USE_SYSV_SHARED_MEMORY 1
 _ACEOF
 
-SHMEM_IMPLEMENTATION="src/backend/port/sysv_shmem.c"
+  SHMEM_IMPLEMENTATION="src/backend/port/sysv_shmem.c"
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_WIN32_SHARED_MEMORY 1
+_ACEOF
+
+  SHMEM_IMPLEMENTATION="src/backend/port/win32_shmem.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
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define MEMSET_LOOP_LIMIT ${MEMSET_LOOP_LIMIT}
+_ACEOF
+
 
 
 if test "$enable_nls" = yes ; then
@@ -21894,17 +23278,6 @@ done
 
   # Note: share/locale is always the default, independent of $datadir
   localedir='${prefix}/share/locale'
-  if test x"$prefix" = x"NONE"; then
-    exp_localedir="$ac_default_prefix/share/locale"
-  else
-    exp_localedir="$prefix/share/locale"
-  fi
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define LOCALEDIR "$exp_localedir"
-_ACEOF
 
 
 fi
@@ -22446,26 +23819,24 @@ done
 # defined.  Cross compiling throws a warning.
 #
 if test "$enable_thread_safety_force" = yes; then
-if test x"$template" != x"win32"
+if test "$PORTNAME" != "win32"
 then
   { echo "$as_me:$LINENO: WARNING:
 *** Skipping thread test program.  --enable-thread-safety-force was used.
-*** Run the program in src/tools/thread on the your machine and add
-proper locking function calls to your applications to guarantee thread
-safety.
+*** Run the program in src/test/thread on the your machine and add proper
+*** locking function calls to your applications to guarantee thread safety.
 " >&5
 echo "$as_me: WARNING:
 *** Skipping thread test program.  --enable-thread-safety-force was used.
-*** Run the program in src/tools/thread on the your machine and add
-proper locking function calls to your applications to guarantee thread
-safety.
+*** Run the program in src/test/thread on the your machine and add proper
+*** locking function calls to your applications to guarantee thread safety.
 " >&2;}
 else
-{ echo "$as_me:$LINENO: WARNING: *** Skipping thread test on Win32" >&5
-echo "$as_me: WARNING: *** Skipping thread test on Win32" >&2;}
+{ echo "$as_me:$LINENO: WARNING: *** skipping thread test on Win32" >&5
+echo "$as_me: WARNING: *** skipping thread test on Win32" >&2;}
 fi
 elif test "$enable_thread_safety" = yes; then
-if test x"$template" != x"win32"
+if test "$PORTNAME" != "win32"
 then
 echo "$as_me:$LINENO: checking thread safety of required library functions" >&5
 echo $ECHO_N "checking thread safety of required library functions... $ECHO_C" >&6
@@ -22479,11 +23850,11 @@ if test "$cross_compiling" = yes; then
 echo "${ECHO_T}maybe" >&6
   { echo "$as_me:$LINENO: WARNING:
 *** Skipping thread test program because of cross-compile build.
-*** Run the program in src/tools/thread on the target machine.
+*** Run the program in src/test/thread on the target machine.
 " >&5
 echo "$as_me: WARNING:
 *** Skipping thread test program because of cross-compile build.
-*** Run the program in src/tools/thread on the target machine.
+*** Run the program in src/test/thread on the target machine.
 " >&2;}
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -22492,7 +23863,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include "$srcdir/src/tools/thread/thread_test.c"
+#include "$srcdir/src/test/thread/thread_test.c"
 _ACEOF
 rm -f conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
@@ -22515,24 +23886,22 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
-  { { echo "$as_me:$LINENO: error:
-*** Thread test program failed.  Your platform is not thread-safe.
-*** Check the file 'config.log'for the exact reason.
-***
-*** You can use the configure option --enable-thread-safety-force
-*** to force threads to be enabled.  However, you must then run
-*** the program in src/tools/thread and add locking function calls
-*** to your applications to guarantee thread safety.
-" >&5
-echo "$as_me: error:
-*** Thread test program failed.  Your platform is not thread-safe.
-*** Check the file 'config.log'for the exact reason.
-***
-*** You can use the configure option --enable-thread-safety-force
-*** to force threads to be enabled.  However, you must then run
-*** the program in src/tools/thread and add locking function calls
-*** to your applications to guarantee thread safety.
-" >&2;}
+  { { echo "$as_me:$LINENO: error: thread test program failed
+This platform is not thread-safe.  Check the file 'config.log'for the
+exact reason.
+
+You can use the configure option --enable-thread-safety-force to force
+threads to be enabled.  But you must then run the program in
+src/test/thread and add locking function calls to your applications to
+guarantee thread safety." >&5
+echo "$as_me: error: thread test program failed
+This platform is not thread-safe.  Check the file 'config.log'for the
+exact reason.
+
+You can use the configure option --enable-thread-safety-force to force
+threads to be enabled.  But you must then run the program in
+src/test/thread and add locking function calls to your applications to
+guarantee thread safety." >&2;}
    { (exit 1); exit 1; }; }
 fi
 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
@@ -22540,8 +23909,8 @@ fi
 CFLAGS="$_CFLAGS"
 LIBS="$_LIBS"
 else
-{ echo "$as_me:$LINENO: WARNING: *** Skipping thread test on Win32" >&5
-echo "$as_me: WARNING: *** Skipping thread test on Win32" >&2;}
+{ echo "$as_me:$LINENO: WARNING: *** skipping thread test on Win32" >&5
+echo "$as_me: WARNING: *** skipping thread test on Win32" >&2;}
 fi
 fi
 
@@ -22581,6 +23950,9 @@ fi
           ac_config_headers="$ac_config_headers src/include/pg_config.h"
 
 
+          ac_config_headers="$ac_config_headers src/interfaces/ecpg/include/ecpg_config.h"
+
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -22943,7 +24315,7 @@ _ASBOX
 } >&5
 cat >&5 <<_CSEOF
 
-This file was extended by PostgreSQL $as_me 8.2devel, which was
+This file was extended by PostgreSQL $as_me 8.3devel, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -23009,7 +24381,7 @@ _ACEOF
 
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-PostgreSQL config.status 8.2devel
+PostgreSQL config.status 8.3devel
 configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -23122,6 +24494,7 @@ do
   "src/Makefile.port" ) CONFIG_LINKS="$CONFIG_LINKS src/Makefile.port:src/makefiles/Makefile.${template}" ;;
   "check_win32_symlinks" ) CONFIG_COMMANDS="$CONFIG_COMMANDS check_win32_symlinks" ;;
   "src/include/pg_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/include/pg_config.h" ;;
+  "src/interfaces/ecpg/include/ecpg_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/interfaces/ecpg/include/ecpg_config.h" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
@@ -23225,6 +24598,10 @@ s,@default_port@,$default_port,;t t
 s,@enable_shared@,$enable_shared,;t t
 s,@enable_rpath@,$enable_rpath,;t t
 s,@enable_debug@,$enable_debug,;t t
+s,@enable_profiling@,$enable_profiling,;t t
+s,@DTRACE@,$DTRACE,;t t
+s,@DTRACEFLAGS@,$DTRACEFLAGS,;t t
+s,@enable_dtrace@,$enable_dtrace,;t t
 s,@CC@,$CC,;t t
 s,@CFLAGS@,$CFLAGS,;t t
 s,@LDFLAGS@,$LDFLAGS,;t t
@@ -23244,8 +24621,13 @@ s,@with_python@,$with_python,;t t
 s,@with_krb5@,$with_krb5,;t t
 s,@krb_srvtab@,$krb_srvtab,;t t
 s,@with_pam@,$with_pam,;t t
+s,@with_ldap@,$with_ldap,;t t
 s,@with_bonjour@,$with_bonjour,;t t
 s,@with_openssl@,$with_openssl,;t t
+s,@with_ossp_uuid@,$with_ossp_uuid,;t t
+s,@XML2_CONFIG@,$XML2_CONFIG,;t t
+s,@with_libxml@,$with_libxml,;t t
+s,@with_libxslt@,$with_libxslt,;t t
 s,@with_zlib@,$with_zlib,;t t
 s,@EGREP@,$EGREP,;t t
 s,@ELF_SYS@,$ELF_SYS,;t t
@@ -23259,7 +24641,6 @@ s,@with_gnu_ld@,$with_gnu_ld,;t t
 s,@ld_R_works@,$ld_R_works,;t t
 s,@RANLIB@,$RANLIB,;t t
 s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s,@LORDER@,$LORDER,;t t
 s,@TAR@,$TAR,;t t
 s,@STRIP@,$STRIP,;t t
 s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
@@ -23285,6 +24666,8 @@ s,@acx_pthread_config@,$acx_pthread_config,;t t
 s,@PTHREAD_CC@,$PTHREAD_CC,;t t
 s,@PTHREAD_LIBS@,$PTHREAD_LIBS,;t t
 s,@PTHREAD_CFLAGS@,$PTHREAD_CFLAGS,;t t
+s,@LDAP_LIBS_FE@,$LDAP_LIBS_FE,;t t
+s,@LDAP_LIBS_BE@,$LDAP_LIBS_BE,;t t
 s,@HAVE_POSIX_SIGNALS@,$HAVE_POSIX_SIGNALS,;t t
 s,@MSGFMT@,$MSGFMT,;t t
 s,@MSGMERGE@,$MSGMERGE,;t t
@@ -24027,8 +25410,8 @@ echo "$as_me: executing $ac_dest commands" >&6;}
 for FILE in $CONFIG_LINKS
  do
        # test -e works for symlinks in the MinGW console
-       test -e `expr "$FILE" : '\([^:]*\)'` || { echo "$as_me:$LINENO: WARNING: *** link for $FILE - please fix by hand" >&5
-echo "$as_me: WARNING: *** link for $FILE - please fix by hand" >&2;}
+       test -e `expr "$FILE" : '\([^:]*\)'` || { echo "$as_me:$LINENO: WARNING: *** link for $FILE -- please fix by hand" >&5
+echo "$as_me: WARNING: *** link for $FILE -- please fix by hand" >&2;}
  done
  ;;
   esac
@@ -24065,3 +25448,14 @@ if test "$no_create" != yes; then
 fi
 
 
+# Warn about unknown options
+for pgac_var in `set | sed 's/=.*//' | $EGREP 'with_|enable_'`; do
+  for pgac_arg in $pgac_args with_gnu_ld; do
+    if test "$pgac_var" = "$pgac_arg"; then
+      continue 2
+    fi
+  done
+  pgac_txt=`echo $pgac_var | sed 's/_/-/g'`
+  { echo "$as_me:$LINENO: WARNING: option ignored: --$pgac_txt" >&5
+echo "$as_me: WARNING: option ignored: --$pgac_txt" >&2;}
+done