[Spread-cvs] commit: r861 - in trunk: . daemon docs examples include libspread libspread-util libspread-util/include libspread-util/src

jschultz at spread.org jschultz at spread.org
Mon Nov 14 12:41:37 EST 2016


Author: jschultz
Date: 2016-11-14 12:40:56 -0500 (Mon, 14 Nov 2016)
New Revision: 861

Added:
   trunk/Readme.IPv6
   trunk/examples/spping.c
   trunk/include/sp_events.h
   trunk/libspread-util/include/spu_addr.h
   trunk/libspread-util/src/spu_addr.c
Removed:
   trunk/include/sp_events.h
   trunk/libspread-util/include/spu_compatibility.h
Modified:
   trunk/Readme.txt
   trunk/configure
   trunk/configure.in
   trunk/daemon/Makefile.in
   trunk/daemon/arch.h
   trunk/daemon/auth-ip.c
   trunk/daemon/auth-pword-client.c
   trunk/daemon/auth-pword.c
   trunk/daemon/conf_body.h
   trunk/daemon/config.h.in
   trunk/daemon/config_gram.l
   trunk/daemon/config_parse.y
   trunk/daemon/configuration.c
   trunk/daemon/configuration.h
   trunk/daemon/flow_control.c
   trunk/daemon/ip_enum.c
   trunk/daemon/ip_enum.h
   trunk/daemon/log.c
   trunk/daemon/log.h
   trunk/daemon/membership.c
   trunk/daemon/monitor.c
   trunk/daemon/net_types.h
   trunk/daemon/network.c
   trunk/daemon/protocol.c
   trunk/daemon/r.c
   trunk/daemon/s.c
   trunk/daemon/sess_body.h
   trunk/daemon/session.c
   trunk/daemon/session.h
   trunk/daemon/spread.c
   trunk/daemon/spread_params.h
   trunk/daemon/status.c
   trunk/daemon/status.h
   trunk/docs/sample.spread.conf
   trunk/examples/Makefile.in
   trunk/include/sp.h
   trunk/include/sp_func.h
   trunk/libspread-util/configure
   trunk/libspread-util/configure.in
   trunk/libspread-util/include/spu_alarm.h
   trunk/libspread-util/include/spu_alarm_types.h
   trunk/libspread-util/include/spu_data_link.h
   trunk/libspread-util/src/Makefile.in
   trunk/libspread-util/src/alarm.c
   trunk/libspread-util/src/arch.c
   trunk/libspread-util/src/arch.h
   trunk/libspread-util/src/config.h.in
   trunk/libspread-util/src/data_link.c
   trunk/libspread-util/src/events.c
   trunk/libspread-util/src/memory.c
   trunk/libspread/sp.c
Log:
Merging work from spread 5 branch back into trunk in preparation for beta release

svn merge -r739:845 svn+ssh://svn.spread.org/spread/branches/spread_5 trunk



Copied: trunk/Readme.IPv6 (from rev 845, branches/spread_5/Readme.IPv6)
===================================================================
--- trunk/Readme.IPv6	                        (rev 0)
+++ trunk/Readme.IPv6	2016-11-14 17:40:56 UTC (rev 861)
@@ -0,0 +1,78 @@
+Spread IPv6 Readme
+------------------
+
+This is a test version of Spread IPv6 support.
+
+System Specification
+--------------------
+
+The IPv6 support is part of Spread version 5.0. The IPv6 supported system includes the Spread daemon, C language client library and included example and support programs (spmonitor, spuser, spsend, sprecv, spread, spflooder). 
+
+IPv6 Spread 5.0 works on IPv4 only networks, IPv6 only networks or networks with dual-stack IPv4 and IPv6 on all nodes. Spread daemons in an active configuration run on either all IPv6 addresses or all IPv4 addresses (a ring can not be made of some IPv4 only and some IPv6 only hosts). Spread client programs can run on IPv4 only or IPv6 only hosts and can connect to a Spread daemon running on a dual-stack host. This version of Spread supports Linux (tested on RHEL5, RHEL6). 
+
+The clients can be provided either DNS/Host names or direct IPv4/v6 addresses to connect to daemons. The daemons can be configured using direct IP addresses or names which will be looked up using standard system services (DNS or /etc/hosts) in order to map them back to IP addresses. This supports configuring the daemon's conf file with names only and dynamically looking up the correct IPs at daemon start time. 
+
+Current Status:
+---------------
+
+Currently, only the configuration file parsing supports new IPv6 addresses and new syntax.  IPv6 addresses do not yet work in this version.
+
+Building Spread:
+----------------
+
+The build process for Spread and supporting libraries has not changed. It is build with the standard process:
+
+./configure
+make 
+make install
+
+Spread Configuration:
+---------------------
+
+To use the new IPv6 enabled version of Spread on an IPv4 network, you can use the same spread.conf file as you used with the previous version including only IPv4 nodes. In this case the syntax of the configuration has not changed.
+
+To use the new IPv6 enabled version of Spread on an IPv6 network you need to make the following changes to your spread.conf:
+
+1) In the Spread_Segment declarations you should use an IPv6 multicast address for the segment address, and if you provide specific IP addresses for each node, then provide the address as a IPv6 address. See the example section below:
+
+Spread_Segment [ff02::5]:3333 {
+     node1	2001:db8:1234::1
+     node2	2001:db8:1234::2
+     node3     2001:db8:1234::3
+}
+
+2) This version also allows you to sepcify multiple segment addresses for a segment, although only the last one will currently be used:
+
+Spread_Segment [ff02::5]:3333 227.1.2.3:9294 {
+     node1	2001:db8:1234::1
+     node2	2001:db8:1234::2
+     node3     2001:db8:1234::3
+}
+
+3) This version also introduces the concept of virtual IDs for daemons, which are an optional way of specifying the IDs that daemons use in their intercommunication.  These IDs are parsed as IPv4 addresses and can be any valid unicast address
+you want, so long as each daemon has a unique ID within a configuration.  Most of the logging and spmonitor reporting will refer to these virtual IDs rather than the network addresses you assign to the daemons.  If you do not specify them, then 
+Spread will choose them for you in the following fashion.  If you use an IPv4 address for your daemon, then that will be its virtual ID too.  If you use an IPv6 address for your daemon, then the virtual ID will be a 32 bit, configuration-unique 
+hash of that address and, therefore, look rather random.
+
+Spread_Segment [ff02::5]:3333 227.1.2.3:9294 {
+     node1	2001:db8:1234::1	VirtualID = 1.2.3.4
+     node2	2001:db8:1234::2	VirtualID = 1.2.3.5
+     node3	2001:db8:1234::3	VirtualID = 1.2.3.6
+}
+
+
+
+Spread API Changes:
+-------------------
+
+The only changes to the Spread API (libspread) are those necessitated by the change in the size of daemon identifiers (from IPv4 32 bit IDs to IPV6 128 bit IDs). This only affects the contents of the body of Membership messages. The existing functions in sp_func.h to parse the contents of Membership messages are updated so if you use those API functions you do not need to make any other changes to your code except recompiling/relinking with the new Spread library. The change to the size of a 'group_id' structure is transparent as long as your application does not examine the contents of the group_id. If you want to format the group_id for printing in output, there is a new API function SP_group_id_to_string(group_id gid, char *str, int strlen) which will correctly format the group_id for both IPv4 and IPv6 compiled versions of Spread and return it in the 'str' parameter. 
+
+To use the Spread API in your application and connect to the daemon over IPv6, just use an IPv6 address or hostname that resolves to a IPv6 address in the normal "spread_name" parameter to SP_connect() instead of using an IPv4 address.
+
+
+Example/Test programs:
+----------------------
+
+In examples/ are the spuser and spflooder programs which have been updated to connect to Spread over IPv4 or IPv6. 
+
+In daemon/ is the spmonitor program for checking the status of daemons and creating partitions. It is updated to work with the IPv6 daemon. 

Modified: trunk/Readme.txt
===================================================================
--- trunk/Readme.txt	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/Readme.txt	2016-11-14 17:40:56 UTC (rev 861)
@@ -3,7 +3,7 @@
 
 /=============================================================================\
 | The Spread Group Communication Toolkit - Accelerated Ring Research Version  |
-| Copyright (c) 1993-2014 Spread Concepts LLC                                 |
+| Copyright (c) 1993-2016 Spread Concepts LLC                                 |
 | All rights reserved.                                                        |
 |                                                                             |
 | The Spread package is licensed under the Spread Open-Source License.        |
@@ -49,9 +49,15 @@
 | WWW    : http://www.spread.org  and  http://www.spreadconcepts.com          |
 | Contact: info at spreadconcepts.com                                            |
 |                                                                             |
-| Version 4.4.0 built 27/May/2014                                             |
+| Version 5.0.0 Alpha built 18/Apr/2016                                       |
 \=============================================================================/
 
+April 18, 2016 Ver 5.0.0 Alpha
+------------------------------
+
+Configuration file parser updated to allow IPv6 addresses, multiple segment addresses and VirtualIDs to be specified.
+See Readme.IPv6 for details.
+
 May 27, 2014 Ver 4.4.0
 ----------------------
 

Modified: trunk/configure
===================================================================
--- trunk/configure	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/configure	2016-11-14 17:40:56 UTC (rev 861)
@@ -1,81 +1,459 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for Spread 4.4.0.
+# Generated by GNU Autoconf 2.69 for Spread 5.0.0.
 #
-# Copyright (C) 2003 Free Software Foundation, Inc.
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
 
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
 fi
-DUALCASE=1; export DUALCASE # for MKS sh
 
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
 else
-  as_unset=false
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
 fi
 
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
 
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
 
 # NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+	   done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
   else
-    $as_unset $as_var
+    $as_echo "$0: Please tell bug-autoconf at gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
   fi
-done
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
 
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
 fi
 
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
 
-# Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
-
-# PATH needs CR, and LINENO needs CR and PATH.
 # Avoid depending upon Character Ranges.
 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -83,146 +461,91 @@
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
 
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
-	 /*)
-	   if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
 else
-  as_expr=false
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
 fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
     as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
   fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -231,90 +554,193 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
 
-# CDPATH.
-$as_unset CDPATH
-
-
 # Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
-exec 6>&1
-
 #
 # Initializations.
 #
 ac_default_prefix=/usr/local
+ac_clean_files=
 ac_config_libobj_dir=.
+LIBOBJS=
 cross_compiling=no
 subdirs=
 MFLAGS=
 MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
 
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete.  It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
 # Identity of this package.
 PACKAGE_NAME='Spread'
 PACKAGE_TARNAME='spread'
-PACKAGE_VERSION='4.4.0'
-PACKAGE_STRING='Spread 4.4.0'
+PACKAGE_VERSION='5.0.0'
+PACKAGE_STRING='Spread 5.0.0'
 PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
 
-ac_subdirs_all="$ac_subdirs_all stdutil libspread-util"
+enable_option_checking=no
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
-#if HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
-#if STDC_HEADERS
+#ifdef STDC_HEADERS
 # include <stdlib.h>
 # include <stddef.h>
 #else
-# if HAVE_STDLIB_H
+# ifdef HAVE_STDLIB_H
 #  include <stdlib.h>
 # endif
 #endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
 #  include <memory.h>
 # endif
 # include <string.h>
 #endif
-#if HAVE_STRINGS_H
+#ifdef HAVE_STRINGS_H
 # include <strings.h>
 #endif
-#if HAVE_INTTYPES_H
+#ifdef HAVE_INTTYPES_H
 # include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-#  include <stdint.h>
-# endif
 #endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
 # 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 subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S YACC LEX AR PERL LD THLDFLAGS THLIBS EGREP SP_MAJOR_VERSION SP_MINOR_VERSION SP_PATCH_VERSION NROFF MANTYPE mansubdir piddir docdir SHCC SHCFLAGS SHCPPFLAGS SHLD SHLDFLAGS SHLIBS LIBSPSO LIBSPCORESO LIBTSPCORESO SHLDOPTION SHLDNAME SHLDCONVERTSTATIC SHLDCONVERTSTATICEND LIBOBJS LTLIBOBJS'
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+SHLDCONVERTSTATICEND
+SHLDCONVERTSTATIC
+SHLDNAME
+SHLDOPTION
+LIBTSPCORESO
+LIBSPCORESO
+LIBSPSO
+SHLIBS
+SHLDFLAGS
+SHLD
+SHCPPFLAGS
+SHCFLAGS
+SHCC
+piddir
+mansubdir
+MANTYPE
+NROFF
+SP_PATCH_VERSION
+SP_MINOR_VERSION
+SP_MAJOR_VERSION
+THLIBS
+THLDFLAGS
+LD
+PERL
+AR
+LEX
+YFLAGS
+YACC
+LN_S
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+RANLIB
+EGREP
+GREP
+CPP
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+subdirs
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
 ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_cflags
+with_cppflags
+with_ldflags
+with_libs
+with_catman
+with_pid_dir
+with_unix_socket_dir
+with_docdir
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+YACC
+YFLAGS'
+ac_subdirs_all='stdutil libspread-util'
 
 # Initialize some variables set by options.
 ac_init_help=
 ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
 # The variables have the same names as the options, with
 # dashes changed to underlines.
 cache_file=/dev/null
@@ -337,34 +763,49 @@
 # and all the variables that are supposed to be based on exec_prefix
 # by default will actually change.
 # Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
 
 ac_prev=
+ac_dashdash=
 for ac_option
 do
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
+    eval $ac_prev=\$ac_option
     ac_prev=
     continue
   fi
 
-  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case $ac_option in
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
@@ -386,33 +827,59 @@
   --config-cache | -C)
     cache_file=config.cache ;;
 
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+  -datadir | --datadir | --datadi | --datad)
     ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
     datadir=$ac_optarg ;;
 
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
   -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    eval "enable_$ac_feature=no" ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
 
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
   -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
     esac
-    eval "enable_$ac_feature='$ac_optarg'" ;;
+    eval enable_$ac_useropt=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -439,6 +906,12 @@
   -host=* | --host=* | --hos=* | --ho=*)
     host_alias=$ac_optarg ;;
 
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
@@ -463,13 +936,16 @@
   | --libexe=* | --libex=* | --libe=*)
     libexecdir=$ac_optarg ;;
 
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
   -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
+  | --localstate | --localstat | --localsta | --localst | --locals)
     ac_prev=localstatedir ;;
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
     localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -534,6 +1010,16 @@
   | --progr-tra=* | --program-tr=* | --program-t=*)
     program_transform_name=$ac_optarg ;;
 
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
@@ -584,26 +1070,36 @@
     ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
     esac
-    eval "with_$ac_package='$ac_optarg'" ;;
+    eval with_$ac_useropt=\$ac_optarg ;;
 
   -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/-/_/g'`
-    eval "with_$ac_package=no" ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -623,27 +1119,26 @@
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; }
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
     ;;
 
   *=*)
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-   { (exit 1); exit 1; }; }
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
     # FIXME: should be removed in autoconf 3.0.
-    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -651,31 +1146,36 @@
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { echo "$as_me: error: missing argument to $ac_option" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "missing argument to $ac_option"
 fi
 
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
-done
+fi
 
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-	      localstatedir libdir includedir oldincludedir infodir mandir
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
 do
-  eval ac_val=$`echo $ac_var`
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
   case $ac_val in
-    [\\/$]* | ?:[\\/]* ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
   esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -689,8 +1189,6 @@
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -702,74 +1200,72 @@
 test "$silent" = yes && exec 6>/dev/null
 
 
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then its parent.
-  ac_confdir=`(dirname "$0") 2>/dev/null ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$0" : 'X\(//\)[^/]' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$0" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
   srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
+  if test ! -r "$srcdir/$ac_unique_file"; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
-if test ! -r $srcdir/$ac_unique_file; then
-  if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
-   { (exit 1); exit 1; }; }
-  else
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-   { (exit 1); exit 1; }; }
-  fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
 fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
-  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
-   { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
 
 #
 # Report the --help message.
@@ -778,7 +1274,7 @@
   # 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 Spread 4.4.0 to adapt to many kinds of systems.
+\`configure' configures Spread 5.0.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -792,20 +1288,17 @@
       --help=short        display options specific to this package
       --help=recursive    display the short help of all the included packages
   -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
+  -q, --quiet, --silent   do not print \`checking ...' messages
       --cache-file=FILE   cache test results in FILE [disabled]
   -C, --config-cache      alias for \`--cache-file=config.cache'
   -n, --no-create         do not create output files
       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
-_ACEOF
-
-  cat <<_ACEOF
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
-			  [$ac_default_prefix]
+                          [$ac_default_prefix]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-			  [PREFIX]
+                          [PREFIX]
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
@@ -815,18 +1308,25 @@
 For better control, use the options below.
 
 Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --libdir=DIR           object code libraries [EPREFIX/lib]
-  --includedir=DIR       C header files [PREFIX/include]
-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --infodir=DIR          info documentation [PREFIX/info]
-  --mandir=DIR           man documentation [PREFIX/man]
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/spread]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
@@ -839,7 +1339,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Spread 4.4.0:";;
+     short | recursive ) echo "Configuration of Spread 5.0.0:";;
    esac
   cat <<\_ACEOF
 
@@ -860,128 +1360,638 @@
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
-  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
-              headers in a nonstandard directory <include dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
+  YACC        The `Yet Another Compiler Compiler' implementation to use.
+              Defaults to the first program found out of: `bison -y', `byacc',
+              `yacc'.
+  YFLAGS      The list of arguments that will be passed by default to $YACC.
+              This script will default YFLAGS to the empty string to avoid a
+              default value of `-d' given by some make applications.
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
+Report bugs to the package provider.
 _ACEOF
+ac_status=$?
 fi
 
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d $ac_dir || continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
     ac_builddir=.
 
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
-
-    cd $ac_dir
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      echo
-      $SHELL $ac_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_srcdir/configure; then
-      echo
-      $SHELL $ac_srcdir/configure  --help=recursive
-    elif test -f $ac_srcdir/configure.ac ||
-	   test -f $ac_srcdir/configure.in; then
-      echo
-      $ac_configure --help
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
     else
-      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi
-    cd $ac_popdir
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
   done
 fi
 
-test -n "$ac_init_help" && exit 0
+test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Spread configure 4.4.0
-generated by GNU Autoconf 2.59
+Spread configure 5.0.0
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
-  exit 0
+  exit
 fi
-exec 5>config.log
-cat >&5 <<_ACEOF
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); 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 $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* 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_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if test "$cross_compiling" = yes; then
+    # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=$ac_mid; break
+else
+  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_lo=$ac_mid; break
+else
+  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=$ac_mid
+else
+  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+  else
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (($2) < 0)
+    {
+      long int i = longval ();
+      if (i != ($2))
+	return 1;
+      fprintf (f, "%ld", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ($2))
+	return 1;
+      fprintf (f, "%lu", i);
+    }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+  ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+  fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
+cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Spread $as_me 4.4.0, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+It was created by Spread $as_me 5.0.0, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
 _ACEOF
+exec 5>>config.log
 {
 cat <<_ASUNAME
 ## --------- ##
@@ -1000,7 +2010,7 @@
 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
@@ -1012,8 +2022,9 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  echo "PATH: $as_dir"
-done
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
 
 } >&5
 
@@ -1035,7 +2046,6 @@
 ac_configure_args=
 ac_configure_args0=
 ac_configure_args1=
-ac_sep=
 ac_must_keep_next=false
 for ac_pass in 1 2
 do
@@ -1046,13 +2056,13 @@
     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
-    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
     2)
-      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      as_fn_append ac_configure_args1 " '$ac_arg'"
       if test $ac_must_keep_next = true; then
 	ac_must_keep_next=false # Got value, back to normal.
       else
@@ -1068,217 +2078,253 @@
 	  -* ) ac_must_keep_next=true ;;
 	esac
       fi
-      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-      # Get rid of the leading space.
-      ac_sep=" "
+      as_fn_append ac_configure_args " '$ac_arg'"
       ;;
     esac
   done
 done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
 
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
 # would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
 trap 'exit_status=$?
   # Save into config.log some information that might help in debugging.
   {
     echo
 
-    cat <<\_ASBOX
-## ---------------- ##
+    $as_echo "## ---------------- ##
 ## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
     echo
     # The following way of writing the cache mishandles newlines in values,
-{
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
   (set) 2>&1 |
-    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
       sed -n \
-	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
-      ;;
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
     *)
-      sed -n \
-	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-}
+    esac |
+    sort
+)
     echo
 
-    cat <<\_ASBOX
-## ----------------- ##
+    $as_echo "## ----------------- ##
 ## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
     echo
     for ac_var in $ac_subst_vars
     do
-      eval ac_val=$`echo $ac_var`
-      echo "$ac_var='"'"'$ac_val'"'"'"
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
     if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
-_ASBOX
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
       echo
       for ac_var in $ac_subst_files
       do
-	eval ac_val=$`echo $ac_var`
-	echo "$ac_var='"'"'$ac_val'"'"'"
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
 
     if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
+      $as_echo "## ----------- ##
 ## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
       echo
-      sed "/^$/d" confdefs.h | sort
+      cat confdefs.h
       echo
     fi
     test "$ac_signal" != 0 &&
-      echo "$as_me: caught signal $ac_signal"
-    echo "$as_me: exit $exit_status"
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
   } >&5
-  rm -f core *.core &&
-  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
-     ' 0
+' 0
 for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
+rm -f -r conftest* confdefs.h
 
+$as_echo "/* confdefs.h */" > confdefs.h
+
 # Predefined preprocessor variables.
 
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_NAME "$PACKAGE_NAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_VERSION "$PACKAGE_VERSION"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_STRING "$PACKAGE_STRING"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
 _ACEOF
 
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
 
+
 # Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
 fi
-for ac_site_file in $CONFIG_SITE; do
-  if test -r "$ac_site_file"; then
-    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
 if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special
-  # files actually), so we avoid doing that.
-  if test -f "$cache_file"; then
-    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
-      [\\/]* | ?:[\\/]* ) . $cache_file;;
-      *)                      . ./$cache_file;;
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
     esac
   fi
 else
-  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
-	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+for ac_var in $ac_precious_vars; do
   eval ac_old_set=\$ac_cv_env_${ac_var}_set
   eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
-  eval ac_new_val="\$ac_env_${ac_var}_value"
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
-echo "$as_me:   former value:  $ac_old_val" >&2;}
-	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
-echo "$as_me:   current value: $ac_new_val" >&2;}
-	ac_cache_corrupted=:
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
       fi;;
   esac
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
     esac
   fi
 done
 if $ac_cache_corrupted; then
-  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-   { (exit 1); exit 1; }; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
 fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -1288,116 +2334,112 @@
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 ac_aux_dir=
-for ac_dir in buildtools $srcdir/buildtools; do
-  if test -f $ac_dir/install-sh; then
+for ac_dir in buildtools "$srcdir"/buildtools; do
+  if test -f "$ac_dir/install-sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
     break
-  elif test -f $ac_dir/install.sh; then
+  elif test -f "$ac_dir/install.sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install.sh -c"
     break
-  elif test -f $ac_dir/shtool; then
+  elif test -f "$ac_dir/shtool"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/shtool install -c"
     break
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in buildtools $srcdir/buildtools" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in buildtools $srcdir/buildtools" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in buildtools \"$srcdir\"/buildtools" "$LINENO" 5
 fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 
-          ac_config_headers="$ac_config_headers daemon/config.h"
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
+ac_config_headers="$ac_config_headers daemon/config.h"
 
 
+
+
 subdirs="$subdirs stdutil libspread-util"
 
 
 # Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
-   { (exit 1); exit 1; }; }
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
 
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
-if test "${ac_cv_build+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
-  ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
-  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
-   { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
 build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
-if test "${ac_cv_host+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
-  ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
 host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 
@@ -1416,10 +2458,10 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; 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_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1429,35 +2471,37 @@
 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
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; 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_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -1467,39 +2511,50 @@
 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
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 else
   CC="$ac_cv_prog_CC"
 fi
 
 if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; 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_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1509,77 +2564,37 @@
 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
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; 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_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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_ac_ct_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
 
+  fi
 fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; 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_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1590,18 +2605,19 @@
 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
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
   # We found a bogon in the path, so make sure we never use it.
@@ -1619,24 +2635,25 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
 fi
 if test -z "$CC"; then
   if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl
+  for ac_prog in cl.exe
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$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_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1646,39 +2663,41 @@
 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
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
     test -n "$CC" && break
   done
 fi
 if test -z "$CC"; then
   ac_ct_CC=$CC
-  for ac_prog in cl
+  for ac_prog in cl.exe
 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_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -1688,66 +2707,78 @@
 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
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
   test -n "$ac_ct_CC" && break
 done
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 fi
 
 fi
 
 
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -1759,112 +2790,108 @@
 }
 _ACEOF
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
-  (eval $ac_link_default) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  # Find the output, starting from the most likely.  This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
 do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
 	;;
-    conftest.$ac_ext )
-	# This is the source file.
-	;;
     [ab].out )
 	# We found the default executable, but exeext='' is most
 	# certainly right.
 	break;;
     *.* )
-	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	# FIXME: I believe we export ac_cv_exeext for Libtool,
-	# but it would be cool to find out if it's true.  Does anybody
-	# maintain Libtool? --akim.
-	export ac_cv_exeext
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
 	break;;
     * )
 	break;;
   esac
 done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
 else
-  echo "$as_me: failed program was:" >&5
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
 ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
 
-# Check the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
-  if { ac_try='./$ac_file'
-  { (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
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-  fi
-fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
 # work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -1872,38 +2899,90 @@
 for ac_file in conftest.exe conftest conftest.*; do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	  export ac_cv_exeext
 	  break;;
     * ) break;;
   esac
 done
 else
-  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
 fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
 
-rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
-
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
-if test "${ac_cv_objext+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -1915,45 +2994,46 @@
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
 done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
 fi
-
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -1967,55 +3047,34 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_compiler_gnu=no
+  ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2026,39 +3085,49 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_g=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-ac_cv_prog_cc_g=no
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
@@ -2074,23 +3143,18 @@
     CFLAGS=
   fi
 fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_prog_cc_stdc=no
+  ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -2113,12 +3177,17 @@
 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
    function prototypes and stuff, but not '\xHH' hex character constants.
    These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std1 is added to get
+   as 'x'.  The following induces an error, until -std is added to get
    proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
    array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std1.  */
+   that's true only with -std.  */
 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
 int test (int i, double x);
 struct s1 {int (*f) (int a);};
 struct s2 {int (*f) (double a);};
@@ -2133,458 +3202,681 @@
   return 0;
 }
 _ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX 10.20 and later	-Ae
-# HP-UX older versions	-Aa -D_HPUX_SOURCE
-# SVR4			-Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
-  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_prog_cc_stdc=$ac_arg
-break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
 fi
-rm -f conftest.err conftest.$ac_objext
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
-rm -f conftest.$ac_ext conftest.$ac_objext
+rm -f conftest.$ac_ext
 CC=$ac_save_CC
 
 fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
   *)
-    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
 esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
 
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
-  choke me
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
 #endif
+		     Syntax error
 _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
-  for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
 do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_declaration
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
 int
 main ()
 {
-exit (42);
+
   ;
   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 ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-continue
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+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 confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_declaration
+#include <ctype.h>
+#include <stdlib.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 ()
 {
-exit (42);
-  ;
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
   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
-  break
+if ac_fn_c_try_run "$LINENO"; then :
+
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
 
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-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
+fi
+
+done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  # See if sys/param.h defines the BYTE_ORDER macro.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+  ac_cv_c_bigendian=unknown
+    # See if we're dealing with a universal compiler.
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+	       not a universal capable compiler
+	     #endif
+	     typedef int dummy;
+
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+	# Check for potential -arch flags.  It is not universal unless
+	# there are at least two -arch flags with different values.
+	ac_arch=
+	ac_prev=
+	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+	 if test -n "$ac_prev"; then
+	   case $ac_word in
+	     i?86 | x86_64 | ppc | ppc64)
+	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+		 ac_arch=$ac_word
+	       else
+		 ac_cv_c_bigendian=universal
+		 break
+	       fi
+	       ;;
+	   esac
+	   ac_prev=
+	 elif test "x$ac_word" = "x-arch"; then
+	   ac_prev=arch
+	 fi
+       done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if sys/param.h defines the BYTE_ORDER macro.
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
-#include <sys/param.h>
+	     #include <sys/param.h>
 
 int
 main ()
 {
-#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
- bogus endian macros
-#endif
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+		     && defined LITTLE_ENDIAN && 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
+if ac_fn_c_try_compile "$LINENO"; 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
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
-#include <sys/param.h>
+		#include <sys/param.h>
 
 int
 main ()
 {
 #if BYTE_ORDER != BIG_ENDIAN
- not big endian
-#endif
+		 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
+if ac_fn_c_try_compile "$LINENO"; 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
+  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
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
 
-# 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.  */
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+	      bogus endian macros
+	     #endif
+
+  ;
+  return 0;
+}
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  # It does; now see whether it defined to _BIG_ENDIAN or not.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* 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; }
+#include <limits.h>
+
 int
 main ()
 {
- _ascii (); _ebcdic ();
+#ifndef _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
-  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_c_bigendian=yes
+else
+  ac_cv_c_bigendian=no
 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
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # Compile a test program.
+      if test "$cross_compiling" = yes; then :
+  # Try to guess by grepping values from an object file.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+short int ascii_mm[] =
+		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+		short int ascii_ii[] =
+		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+		int use_ascii (int i) {
+		  return ascii_mm[i] + ascii_ii[i];
+		}
+		short int ebcdic_ii[] =
+		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+		short int ebcdic_mm[] =
+		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+		int use_ebcdic (int i) {
+		  return ebcdic_mm[i] + ebcdic_ii[i];
+		}
+		extern int foo;
 
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; 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
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core 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
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+$ac_includes_default
 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);
+
+	     /* Are we little or big endian?  From Harbison&Steele.  */
+	     union
+	     {
+	       long int l;
+	       char c[sizeof (long int)];
+	     } u;
+	     u.l = 1;
+	     return u.c[sizeof (long int) - 1] == 1;
+
+  ;
+  return 0;
 }
 _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
+if ac_fn_c_try_run "$LINENO"; 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
+  ac_cv_c_bigendian=yes
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+
+    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)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+   yes)
+     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+   no)
+      ;; #(
+   universal)
 
-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
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
 
+     ;; #(
+   *)
+     as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
 
+
 # Checks for programs.
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -2598,11 +3890,7 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -2611,78 +3899,34 @@
 #endif
 		     Syntax error
 _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
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
 
+else
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _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
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
   break
 fi
 
@@ -2694,8 +3938,8 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -2705,11 +3949,7 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -2718,85 +3958,40 @@
 #endif
 		     Syntax error
 _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
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
 
+else
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _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
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.$ac_ext
+rm -f conftest.err conftest.i conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
 else
-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -2808,10 +4003,10 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; 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_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
@@ -2821,35 +4016,37 @@
 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
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_RANLIB"; then
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; 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_ac_ct_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_RANLIB"; then
   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
@@ -2859,28 +4056,38 @@
 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
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
 fi
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  RANLIB=$ac_ct_RANLIB
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
 else
   RANLIB="$ac_cv_prog_RANLIB"
 fi
@@ -2898,22 +4105,23 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
-  ./ | .// | /cC/* | \
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
   /usr/ucb/* ) ;;
   *)
     # OSF1 and SCO ODT 3.0 have their own names for install.
@@ -2921,7 +4129,7 @@
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -2931,30 +4139,43 @@
 	    # program-specific install script used by HP pwplus--don't use.
 	    :
 	  else
-	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	    break 3
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
 	  fi
 	fi
       done
     done
     ;;
 esac
-done
 
+  done
+IFS=$as_save_IFS
 
+rm -rf conftest.one conftest.two conftest.dir
+
 fi
   if test "${ac_cv_path_install+set}" = set; then
     INSTALL=$ac_cv_path_install
   else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
     # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
+    # removed, or if the value is a relative name.
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -2964,25 +4185,25 @@
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
 LN_S=$as_ln_s
 if test "$LN_S" = "ln -s"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
 fi
 
 for ac_prog in 'bison -y' byacc
 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_YACC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_YACC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
@@ -2992,36 +4213,38 @@
 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
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_YACC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
 fi
 fi
 YACC=$ac_cv_prog_YACC
 if test -n "$YACC"; then
-  echo "$as_me:$LINENO: result: $YACC" >&5
-echo "${ECHO_T}$YACC" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5
+$as_echo "$YACC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
   test -n "$YACC" && break
 done
 test -n "$YACC" || YACC="yacc"
 
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; 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_path_LEX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_LEX+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   case $LEX in
   [\\/]* | ?:[\\/]*)
@@ -3033,35 +4256,36 @@
 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
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_LEX="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 LEX=$ac_cv_path_LEX
-
 if test -n "$LEX"; then
-  echo "$as_me:$LINENO: result: $LEX" >&5
-echo "${ECHO_T}$LEX" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5
+$as_echo "$LEX" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
+
 # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; 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_path_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   case $AR in
   [\\/]* | ?:[\\/]*)
@@ -3073,36 +4297,37 @@
 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
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 AR=$ac_cv_path_AR
-
 if test -n "$AR"; then
-  echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
 for ac_prog in perl5 perl
 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_path_PERL+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PERL+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   case $PERL in
   [\\/]* | ?:[\\/]*)
@@ -3114,37 +4339,36 @@
 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
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 PERL=$ac_cv_path_PERL
-
 if test -n "$PERL"; then
-  echo "$as_me:$LINENO: result: $PERL" >&5
-echo "${ECHO_T}$PERL" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
+$as_echo "$PERL" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
   test -n "$PERL" && break
 done
 
 
 
 if test -z "$AR" ; then
-	{ { echo "$as_me:$LINENO: error: *** 'ar' missing, please install or fix your \$PATH ***" >&5
-echo "$as_me: error: *** 'ar' missing, please install or fix your \$PATH ***" >&2;}
-   { (exit 1); exit 1; }; }
+	as_fn_error $? "*** 'ar' missing, please install or fix your \$PATH ***" "$LINENO" 5
 fi
 
 if test -z "$LD" ; then
@@ -3153,18 +4377,14 @@
 
 
 # C Compiler features
-echo "$as_me:$LINENO: checking for inline" >&5
-echo $ECHO_N "checking for inline... $ECHO_C" >&6
-if test "${ac_cv_c_inline+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if ${ac_cv_c_inline+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifndef __cplusplus
 typedef int foo_t;
@@ -3173,42 +4393,17 @@
 #endif
 
 _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_inline=$ac_kw; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_c_inline=$ac_kw
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  test "$ac_cv_c_inline" != no && break
 done
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
-echo "${ECHO_T}$ac_cv_c_inline" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
 
-
 case $ac_cv_c_inline in
   inline | yes) ;;
   *)
@@ -3230,65 +4425,61 @@
 
 # Allow user to specify flags
 
-# Check whether --with-cflags or --without-cflags was given.
-if test "${with_cflags+set}" = set; then
-  withval="$with_cflags"
-
+# Check whether --with-cflags was given.
+if test "${with_cflags+set}" = set; then :
+  withval=$with_cflags;
 		if test "x$withval" != "xno" ; then
 			CFLAGS="$CFLAGS $withval"
 		fi
 
 
-fi;
+fi
 
-# Check whether --with-cppflags or --without-cppflags was given.
-if test "${with_cppflags+set}" = set; then
-  withval="$with_cppflags"
 
+# Check whether --with-cppflags was given.
+if test "${with_cppflags+set}" = set; then :
+  withval=$with_cppflags;
 		if test "x$withval" != "xno"; then
 			CPPFLAGS="$CPPFLAGS $withval"
 		fi
 
 
-fi;
+fi
 
-# Check whether --with-ldflags or --without-ldflags was given.
-if test "${with_ldflags+set}" = set; then
-  withval="$with_ldflags"
 
+# Check whether --with-ldflags was given.
+if test "${with_ldflags+set}" = set; then :
+  withval=$with_ldflags;
 		if test "x$withval" != "xno" ; then
 			LDFLAGS="$LDFLAGS $withval"
 		fi
 
 
-fi;
+fi
 
-# Check whether --with-libs or --without-libs was given.
-if test "${with_libs+set}" = set; then
-  withval="$with_libs"
 
+# Check whether --with-libs was given.
+if test "${with_libs+set}" = set; then :
+  withval=$with_libs;
 		if test "x$withval" != "xno" ; then
 			LIBS="$LIBS $withval"
 		fi
 
 
-fi;
+fi
 
+
 # Checks for libraries.
  OLDLDFLAGS=$LDFLAGS
  LDFLAGS=
-echo "$as_me:$LINENO: checking if we need -pthread for threads" >&5
-echo $ECHO_N "checking if we need -pthread for threads... $ECHO_C" >&6
-          if test "${ac_cv_ldflag_pthread+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need -pthread for threads" >&5
+$as_echo_n "checking if we need -pthread for threads... " >&6; }
+          if ${ac_cv_ldflag_pthread+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_save_LDFLAGS="$LDFLAGS"
                         LDFLAGS="-pthread $LDFLAGS"
-                        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+                        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 char pthread_create();
 int
@@ -3299,47 +4490,23 @@
   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
+if ac_fn_c_try_link "$LINENO"; then :
   eval "ac_cv_ldflag_pthread=yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "ac_cv_ldflag_pthread=no"
+  eval "ac_cv_ldflag_pthread=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext,
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext,
                                     LDFLAGS="$ac_save_LDFLAGS"
 
 fi
 
           if eval "test \"`echo $ac_cv_ldflag_pthread`\" = yes"; then
-            echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
           else
-            echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
           fi
 
  THLDFLAGS=$LDFLAGS
@@ -3348,72 +4515,43 @@
 
  OLDLIBS=$LIBS
  LIBS=
-
-echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
-echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
-if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
+$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_create+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpthread  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char pthread_create ();
 int
 main ()
 {
-pthread_create ();
+return pthread_create ();
   ;
   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
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_pthread_pthread_create=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_pthread_pthread_create=no
+  ac_cv_lib_pthread_pthread_create=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core 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_pthread_pthread_create" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6
-if test $ac_cv_lib_pthread_pthread_create = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBPTHREAD 1
 _ACEOF
@@ -3422,72 +4560,43 @@
 
 fi
 
-
-echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5
-echo $ECHO_N "checking for thr_create in -lthread... $ECHO_C" >&6
-if test "${ac_cv_lib_thread_thr_create+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for thr_create in -lthread" >&5
+$as_echo_n "checking for thr_create in -lthread... " >&6; }
+if ${ac_cv_lib_thread_thr_create+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lthread  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char thr_create ();
 int
 main ()
 {
-thr_create ();
+return thr_create ();
   ;
   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
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_thread_thr_create=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_thread_thr_create=no
+  ac_cv_lib_thread_thr_create=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core 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_thread_thr_create" >&5
-echo "${ECHO_T}$ac_cv_lib_thread_thr_create" >&6
-if test $ac_cv_lib_thread_thr_create = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create" >&5
+$as_echo "$ac_cv_lib_thread_thr_create" >&6; }
+if test "x$ac_cv_lib_thread_thr_create" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBTHREAD 1
 _ACEOF
@@ -3496,72 +4605,43 @@
 
 fi
 
-
-echo "$as_me:$LINENO: checking for sem_wait in -lposix4" >&5
-echo $ECHO_N "checking for sem_wait in -lposix4... $ECHO_C" >&6
-if test "${ac_cv_lib_posix4_sem_wait+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sem_wait in -lposix4" >&5
+$as_echo_n "checking for sem_wait in -lposix4... " >&6; }
+if ${ac_cv_lib_posix4_sem_wait+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lposix4  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char sem_wait ();
 int
 main ()
 {
-sem_wait ();
+return sem_wait ();
   ;
   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
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_posix4_sem_wait=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_posix4_sem_wait=no
+  ac_cv_lib_posix4_sem_wait=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core 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_posix4_sem_wait" >&5
-echo "${ECHO_T}$ac_cv_lib_posix4_sem_wait" >&6
-if test $ac_cv_lib_posix4_sem_wait = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sem_wait" >&5
+$as_echo "$ac_cv_lib_posix4_sem_wait" >&6; }
+if test "x$ac_cv_lib_posix4_sem_wait" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBPOSIX4 1
 _ACEOF
@@ -3572,103 +4652,12 @@
 
  THLIBS=$LIBS
 
-
 for ac_func in pthread_atfork
-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.  */
-/* 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 ()
-{
-return f != $ac_func;
-  ;
-  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
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext 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
+do :
+  ac_fn_c_check_func "$LINENO" "pthread_atfork" "ac_cv_func_pthread_atfork"
+if test "x$ac_cv_func_pthread_atfork" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_PTHREAD_ATFORK 1
 _ACEOF
 
 fi
@@ -3676,72 +4665,43 @@
 
  LIBS=$OLDLIBS
 
-
-echo "$as_me:$LINENO: checking for gethostbyaddr in -lnsl" >&5
-echo $ECHO_N "checking for gethostbyaddr in -lnsl... $ECHO_C" >&6
-if test "${ac_cv_lib_nsl_gethostbyaddr+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr in -lnsl" >&5
+$as_echo_n "checking for gethostbyaddr in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_gethostbyaddr+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char gethostbyaddr ();
 int
 main ()
 {
-gethostbyaddr ();
+return gethostbyaddr ();
   ;
   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
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_nsl_gethostbyaddr=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_nsl_gethostbyaddr=no
+  ac_cv_lib_nsl_gethostbyaddr=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core 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_nsl_gethostbyaddr" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyaddr" >&6
-if test $ac_cv_lib_nsl_gethostbyaddr = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyaddr" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyaddr" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyaddr" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBNSL 1
 _ACEOF
@@ -3750,72 +4710,43 @@
 
 fi
 
-
-echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
-echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6
-if test "${ac_cv_lib_socket_socket+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
+$as_echo_n "checking for socket in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_socket+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* 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 ()
 {
-socket ();
+return socket ();
   ;
   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
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_socket_socket=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_socket_socket=no
+  ac_cv_lib_socket_socket=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core 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_socket" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6
-if test $ac_cv_lib_socket_socket = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
+$as_echo "$ac_cv_lib_socket_socket" >&6; }
+if test "x$ac_cv_lib_socket_socket" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBSOCKET 1
 _ACEOF
@@ -3824,324 +4755,155 @@
 
 fi
 
-echo "$as_me:$LINENO: checking for library containing shm_open" >&5
-echo $ECHO_N "checking for library containing shm_open... $ECHO_C" >&6
-if test "${ac_cv_search_shm_open+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5
+$as_echo_n "checking for library containing shm_open... " >&6; }
+if ${ac_cv_search_shm_open+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
-ac_cv_search_shm_open=no
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char shm_open ();
 int
 main ()
 {
-shm_open ();
+return shm_open ();
   ;
   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_shm_open="none required"
-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
-if test "$ac_cv_search_shm_open" = no; then
-  for ac_lib in rt posix4; do
+for ac_lib in '' rt posix4; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
     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.  */
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_shm_open=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_shm_open+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_shm_open+:} false; then :
 
-/* 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 shm_open ();
-int
-main ()
-{
-shm_open ();
-  ;
-  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_shm_open="-l$ac_lib"
-break
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+  ac_cv_search_shm_open=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
-fi
+rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_shm_open" >&5
-echo "${ECHO_T}$ac_cv_search_shm_open" >&6
-if test "$ac_cv_search_shm_open" != no; then
-  test "$ac_cv_search_shm_open" = "none required" || LIBS="$ac_cv_search_shm_open $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_open" >&5
+$as_echo "$ac_cv_search_shm_open" >&6; }
+ac_res=$ac_cv_search_shm_open
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
 fi
 
-echo "$as_me:$LINENO: checking for library containing nanosleep" >&5
-echo $ECHO_N "checking for library containing nanosleep... $ECHO_C" >&6
-if test "${ac_cv_search_nanosleep+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5
+$as_echo_n "checking for library containing nanosleep... " >&6; }
+if ${ac_cv_search_nanosleep+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
-ac_cv_search_nanosleep=no
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char nanosleep ();
 int
 main ()
 {
-nanosleep ();
+return nanosleep ();
   ;
   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_nanosleep="none required"
-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
-if test "$ac_cv_search_nanosleep" = no; then
-  for ac_lib in rt posix4; do
+for ac_lib in '' rt posix4; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
     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.  */
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_nanosleep=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_nanosleep+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_nanosleep+:} false; then :
 
-/* 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 nanosleep ();
-int
-main ()
-{
-nanosleep ();
-  ;
-  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_nanosleep="-l$ac_lib"
-break
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+  ac_cv_search_nanosleep=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-  done
-fi
+rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_search_nanosleep" >&5
-echo "${ECHO_T}$ac_cv_search_nanosleep" >&6
-if test "$ac_cv_search_nanosleep" != no; then
-  test "$ac_cv_search_nanosleep" = "none required" || LIBS="$ac_cv_search_nanosleep $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5
+$as_echo "$ac_cv_search_nanosleep" >&6; }
+ac_res=$ac_cv_search_nanosleep
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
 fi
 
-
-echo "$as_me:$LINENO: checking for sqrt in -lm" >&5
-echo $ECHO_N "checking for sqrt in -lm... $ECHO_C" >&6
-if test "${ac_cv_lib_m_sqrt+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
+$as_echo_n "checking for sqrt in -lm... " >&6; }
+if ${ac_cv_lib_m_sqrt+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char sqrt ();
 int
 main ()
 {
-sqrt ();
+return sqrt ();
   ;
   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
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_m_sqrt=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_m_sqrt=no
+  ac_cv_lib_m_sqrt=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core 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_m_sqrt" >&5
-echo "${ECHO_T}$ac_cv_lib_m_sqrt" >&6
-if test $ac_cv_lib_m_sqrt = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5
+$as_echo "$ac_cv_lib_m_sqrt" >&6; }
+if test "x$ac_cv_lib_m_sqrt" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBM 1
 _ACEOF
@@ -4151,175 +4913,54 @@
 fi
 
 
-
 for ac_func in strftime
-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.  */
-/* 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 ()
-{
-return f != $ac_func;
-  ;
-  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
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext 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
+do :
+  ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
+if test "x$ac_cv_func_strftime" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_STRFTIME 1
 _ACEOF
 
 else
   # strftime is in -lintl on SCO UNIX.
-echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
-echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6
-if test "${ac_cv_lib_intl_strftime+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
+$as_echo_n "checking for strftime in -lintl... " >&6; }
+if ${ac_cv_lib_intl_strftime+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lintl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
 #ifdef __cplusplus
 extern "C"
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char strftime ();
 int
 main ()
 {
-strftime ();
+return strftime ();
   ;
   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
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_intl_strftime=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_intl_strftime=no
+  ac_cv_lib_intl_strftime=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core 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_intl_strftime" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6
-if test $ac_cv_lib_intl_strftime = yes; then
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRFTIME 1
-_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
+$as_echo "$ac_cv_lib_intl_strftime" >&6; }
+if test "x$ac_cv_lib_intl_strftime" = xyes; then :
+  $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
 
 LIBS="-lintl $LIBS"
 fi
@@ -4329,253 +4970,13 @@
 
 
 # Checks for header files.
-
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
-
-
-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
-  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;
-}
-_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_header_stdc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_header_stdc=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-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
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-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>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-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
-/* 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);
-}
-_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
-  :
-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_header_stdc=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-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
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-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
-  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 <$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
+for ac_header in arpa/inet.h assert.h errno.h grp.h limits.h netdb.h netinet/in.h netinet/tcp.h process.h pthread.h pwd.h signal.h stdarg.h stdint.h stdio.h stdlib.h string.h sys/inttypes.h sys/ioctl.h sys/param.h sys/socket.h sys/stat.h sys/time.h sys/timeb.h sys/types.h sys/uio.h sys/un.h sys/filio.h time.h unistd.h windows.h winsock2.h ifaddrs.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -4583,396 +4984,25 @@
 done
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-for ac_header in arpa/inet.h assert.h errno.h grp.h limits.h netdb.h netinet/in.h netinet/tcp.h process.h pthread.h pwd.h signal.h stdarg.h stdint.h stdio.h stdlib.h string.h sys/inttypes.h sys/ioctl.h sys/param.h sys/socket.h sys/stat.h sys/time.h sys/timeb.h sys/types.h sys/uio.h sys/un.h sys/filio.h time.h unistd.h windows.h winsock.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.  */
-$ac_includes_default
-#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
-  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
-
-  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 the Spread lists.  ##
-## --------------------------------- ##
-_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
+for ac_func in bcopy inet_aton inet_ntoa inet_ntop memmove setsid snprintf strerror lrand48 getifaddrs
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
-
 done
 
-
-
-
-
-
-
-
-
-
-
-for ac_func in bcopy inet_aton inet_ntoa inet_ntop memmove setsid snprintf strerror lrand48
-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.  */
-/* 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 ()
-{
-return f != $ac_func;
-  ;
-  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
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext 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
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-
 for ac_func in gettimeofday time
-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.  */
-/* 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 ()
-{
-return f != $ac_func;
-  ;
-  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
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext 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
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -4980,119 +5010,79 @@
 
 
 # Check for clock_gettime(CLOCK_MONOTONIC, ...)
-echo "$as_me:$LINENO: checking for clock_gettime(CLOCK_MONOTONIC)" >&5
-echo $ECHO_N "checking for clock_gettime(CLOCK_MONOTONIC)... $ECHO_C" >&6
-if test "${ac_cv_clock_gettime_monotonic+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime(CLOCK_MONOTONIC)" >&5
+$as_echo_n "checking for clock_gettime(CLOCK_MONOTONIC)... " >&6; }
+if ${ac_cv_clock_gettime_monotonic+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+	if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <time.h>
 		  int main() { struct timespec t; return clock_gettime(CLOCK_MONOTONIC, &t); }
 _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
+if ac_fn_c_try_run "$LINENO"; then :
    ac_cv_clock_gettime_monotonic="yes"
 else
-  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_clock_gettime_monotonic="no"
 
-( exit $ac_status )
- ac_cv_clock_gettime_monotonic="no"
-
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_clock_gettime_monotonic" >&5
-echo "${ECHO_T}$ac_cv_clock_gettime_monotonic" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_clock_gettime_monotonic" >&5
+$as_echo "$ac_cv_clock_gettime_monotonic" >&6; }
 if test "x$ac_cv_clock_gettime_monotonic" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CLOCK_GETTIME_CLOCK_MONOTONIC 1
-_ACEOF
+$as_echo "#define HAVE_CLOCK_GETTIME_CLOCK_MONOTONIC 1" >>confdefs.h
 
 fi
 
 # Check for broken snprintf
 if test "x$ac_cv_func_snprintf" = "xyes" ; then
-	echo "$as_me:$LINENO: checking whether snprintf correctly terminates long strings" >&5
-echo $ECHO_N "checking whether snprintf correctly terminates long strings... $ECHO_C" >&6
-	if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf correctly terminates long strings" >&5
+$as_echo_n "checking whether snprintf correctly terminates long strings... " >&6; }
+	if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <stdio.h>
 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
 
 _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
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+if ac_fn_c_try_run "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 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 )
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
-			echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+$as_echo "#define BROKEN_SNPRINTF 1" >>confdefs.h
 
-cat >>confdefs.h <<\_ACEOF
-#define BROKEN_SNPRINTF 1
-_ACEOF
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&5
+$as_echo "$as_me: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&2;}
 
-			{ echo "$as_me:$LINENO: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&5
-echo "$as_me: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&2;}
 
-
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+
 fi
 
 # Cheap hack to ensure NEWS-OS libraries are arranged right.
@@ -5101,2071 +5091,166 @@
 fi
 
 # Checks for data types
-echo "$as_me:$LINENO: checking for char" >&5
-echo $ECHO_N "checking for char... $ECHO_C" >&6
-if test "${ac_cv_type_char+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5
+$as_echo_n "checking size of char... " >&6; }
+if ${ac_cv_sizeof_char+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((char *) 0)
-  return 0;
-if (sizeof (char))
-  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_char=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char"        "$ac_includes_default"; then :
 
-ac_cv_type_char=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5
-echo "${ECHO_T}$ac_cv_type_char" >&6
-
-echo "$as_me:$LINENO: checking size of char" >&5
-echo $ECHO_N "checking size of char... $ECHO_C" >&6
-if test "${ac_cv_sizeof_char+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$ac_cv_type_char" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)];
-test_array [0] = 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_lo=0 ac_mid=0
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
-test_array [0] = 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_hi=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (char)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_char=0
+   fi
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-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.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)];
-test_array [0] = 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_hi=-1 ac_mid=-1
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)];
-test_array [0] = 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_lo=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5
+$as_echo "$ac_cv_sizeof_char" >&6; }
 
-ac_lo= ac_hi=
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)];
-test_array [0] = 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_hi=$ac_mid
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_char=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (char), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-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
-long longval () { return (long) (sizeof (char)); }
-unsigned long ulongval () { return (long) (sizeof (char)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (char))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (char))))
-	exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (char))))
-	exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
-
-  ;
-  return 0;
-}
-_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_sizeof_char=`cat conftest.val`
-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 )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (char), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.val
-else
-  ac_cv_sizeof_char=0
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
-echo "${ECHO_T}$ac_cv_sizeof_char" >&6
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_CHAR $ac_cv_sizeof_char
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for short int" >&5
-echo $ECHO_N "checking for short int... $ECHO_C" >&6
-if test "${ac_cv_type_short_int+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short int" >&5
+$as_echo_n "checking size of short int... " >&6; }
+if ${ac_cv_sizeof_short_int+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((short int *) 0)
-  return 0;
-if (sizeof (short int))
-  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_short_int=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short int))" "ac_cv_sizeof_short_int"        "$ac_includes_default"; then :
 
-ac_cv_type_short_int=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_short_int" >&5
-echo "${ECHO_T}$ac_cv_type_short_int" >&6
-
-echo "$as_me:$LINENO: checking size of short int" >&5
-echo $ECHO_N "checking size of short int... $ECHO_C" >&6
-if test "${ac_cv_sizeof_short_int+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$ac_cv_type_short_int" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (short int))) >= 0)];
-test_array [0] = 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_lo=0 ac_mid=0
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (short int))) <= $ac_mid)];
-test_array [0] = 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_hi=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (short int)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_short_int=0
+   fi
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-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.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (short int))) < 0)];
-test_array [0] = 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_hi=-1 ac_mid=-1
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (short int))) >= $ac_mid)];
-test_array [0] = 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_lo=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short_int" >&5
+$as_echo "$ac_cv_sizeof_short_int" >&6; }
 
-ac_lo= ac_hi=
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (short int))) <= $ac_mid)];
-test_array [0] = 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_hi=$ac_mid
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_short_int=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short int), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (short int), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-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
-long longval () { return (long) (sizeof (short int)); }
-unsigned long ulongval () { return (long) (sizeof (short int)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (short int))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (short int))))
-	exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (short int))))
-	exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
-
-  ;
-  return 0;
-}
-_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_sizeof_short_int=`cat conftest.val`
-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 )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short int), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (short int), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.val
-else
-  ac_cv_sizeof_short_int=0
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_short_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_short_int" >&6
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_SHORT_INT $ac_cv_sizeof_short_int
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for int" >&5
-echo $ECHO_N "checking for int... $ECHO_C" >&6
-if test "${ac_cv_type_int+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if ${ac_cv_sizeof_int+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((int *) 0)
-  return 0;
-if (sizeof (int))
-  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_int=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int"        "$ac_includes_default"; then :
 
-ac_cv_type_int=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
-echo "${ECHO_T}$ac_cv_type_int" >&6
-
-echo "$as_me:$LINENO: checking size of int" >&5
-echo $ECHO_N "checking size of int... $ECHO_C" >&6
-if test "${ac_cv_sizeof_int+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$ac_cv_type_int" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)];
-test_array [0] = 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_lo=0 ac_mid=0
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
-test_array [0] = 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_hi=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (int)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_int=0
+   fi
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-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.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)];
-test_array [0] = 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_hi=-1 ac_mid=-1
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)];
-test_array [0] = 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_lo=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
 
-ac_lo= ac_hi=
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
-test_array [0] = 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_hi=$ac_mid
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_int=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-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
-long longval () { return (long) (sizeof (int)); }
-unsigned long ulongval () { return (long) (sizeof (int)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (int))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (int))))
-	exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (int))))
-	exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
-
-  ;
-  return 0;
-}
-_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_sizeof_int=`cat conftest.val`
-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 )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.val
-else
-  ac_cv_sizeof_int=0
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_int" >&6
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_INT $ac_cv_sizeof_int
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for long int" >&5
-echo $ECHO_N "checking for long int... $ECHO_C" >&6
-if test "${ac_cv_type_long_int+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long int" >&5
+$as_echo_n "checking size of long int... " >&6; }
+if ${ac_cv_sizeof_long_int+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((long int *) 0)
-  return 0;
-if (sizeof (long int))
-  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_long_int=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long int))" "ac_cv_sizeof_long_int"        "$ac_includes_default"; then :
 
-ac_cv_type_long_int=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_long_int" >&5
-echo "${ECHO_T}$ac_cv_type_long_int" >&6
-
-echo "$as_me:$LINENO: checking size of long int" >&5
-echo $ECHO_N "checking size of long int... $ECHO_C" >&6
-if test "${ac_cv_sizeof_long_int+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$ac_cv_type_long_int" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long int))) >= 0)];
-test_array [0] = 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_lo=0 ac_mid=0
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long int))) <= $ac_mid)];
-test_array [0] = 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_hi=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long int)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_long_int=0
+   fi
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-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.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long int))) < 0)];
-test_array [0] = 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_hi=-1 ac_mid=-1
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long int))) >= $ac_mid)];
-test_array [0] = 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_lo=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_int" >&5
+$as_echo "$ac_cv_sizeof_long_int" >&6; }
 
-ac_lo= ac_hi=
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long int))) <= $ac_mid)];
-test_array [0] = 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_hi=$ac_mid
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long_int=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long int), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long int), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-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
-long longval () { return (long) (sizeof (long int)); }
-unsigned long ulongval () { return (long) (sizeof (long int)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (long int))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (long int))))
-	exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (long int))))
-	exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
-
-  ;
-  return 0;
-}
-_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_sizeof_long_int=`cat conftest.val`
-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 )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long int), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long int), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.val
-else
-  ac_cv_sizeof_long_int=0
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long_int" >&6
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_LONG_INT $ac_cv_sizeof_long_int
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for long long int" >&5
-echo $ECHO_N "checking for long long int... $ECHO_C" >&6
-if test "${ac_cv_type_long_long_int+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long int" >&5
+$as_echo_n "checking size of long long int... " >&6; }
+if ${ac_cv_sizeof_long_long_int+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((long long int *) 0)
-  return 0;
-if (sizeof (long long int))
-  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_long_long_int=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int"        "$ac_includes_default"; then :
 
-ac_cv_type_long_long_int=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5
-echo "${ECHO_T}$ac_cv_type_long_long_int" >&6
-
-echo "$as_me:$LINENO: checking size of long long int" >&5
-echo $ECHO_N "checking size of long long int... $ECHO_C" >&6
-if test "${ac_cv_sizeof_long_long_int+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$ac_cv_type_long_long_int" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long long int))) >= 0)];
-test_array [0] = 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_lo=0 ac_mid=0
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long long int))) <= $ac_mid)];
-test_array [0] = 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_hi=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_lo=`expr $ac_mid + 1`
-		    if test $ac_lo -le $ac_mid; then
-		      ac_lo= ac_hi=
-		      break
-		    fi
-		    ac_mid=`expr 2 '*' $ac_mid + 1`
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long long int)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_long_long_int=0
+   fi
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-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.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long long int))) < 0)];
-test_array [0] = 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_hi=-1 ac_mid=-1
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long long int))) >= $ac_mid)];
-test_array [0] = 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_lo=$ac_mid; break
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_hi=`expr '(' $ac_mid ')' - 1`
-		       if test $ac_mid -le $ac_hi; then
-			 ac_lo= ac_hi=
-			 break
-		       fi
-		       ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long_int" >&5
+$as_echo "$ac_cv_sizeof_long_long_int" >&6; }
 
-ac_lo= ac_hi=
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long long int))) <= $ac_mid)];
-test_array [0] = 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_hi=$ac_mid
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long_long_int=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long int), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long int), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-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
-long longval () { return (long) (sizeof (long long int)); }
-unsigned long ulongval () { return (long) (sizeof (long long int)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (long long int))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (long long int))))
-	exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (long long int))))
-	exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
-
-  ;
-  return 0;
-}
-_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_sizeof_long_long_int=`cat conftest.val`
-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 )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long int), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long int), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-rm -f conftest.val
-else
-  ac_cv_sizeof_long_long_int=0
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long_long_int" >&6
 cat >>confdefs.h <<_ACEOF
 #define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int
 _ACEOF
@@ -7173,17 +5258,13 @@
 
 
 # More checks for data types
-echo "$as_me:$LINENO: checking for windows arch" >&5
-echo $ECHO_N "checking for windows arch... $ECHO_C" >&6
-if test "${ac_cv_arch_win+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for windows arch" >&5
+$as_echo_n "checking for windows arch... " >&6; }
+if ${ac_cv_arch_win+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <process.h>
 int
@@ -7194,60 +5275,30 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_arch_win="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_arch_win="no"
 
- ac_cv_arch_win="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_arch_win" >&5
-echo "${ECHO_T}$ac_cv_arch_win" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_arch_win" >&5
+$as_echo "$ac_cv_arch_win" >&6; }
 if test "x$ac_cv_arch_win" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define ARCH_PC_WIN95 1
-_ACEOF
+$as_echo "#define ARCH_PC_WIN95 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for struct timezone type" >&5
-echo $ECHO_N "checking for struct timezone type... $ECHO_C" >&6
-if test "${ac_cv_have_struct_timezone+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timezone type" >&5
+$as_echo_n "checking for struct timezone type... " >&6; }
+if ${ac_cv_have_struct_timezone+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <time.h>
 		  #include <sys/time.h>
@@ -7260,60 +5311,30 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_timezone="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_timezone="no"
 
- ac_cv_have_struct_timezone="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_struct_timezone" >&5
-echo "${ECHO_T}$ac_cv_have_struct_timezone" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_timezone" >&5
+$as_echo "$ac_cv_have_struct_timezone" >&6; }
 if test "x$ac_cv_have_struct_timezone" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_TIMEZONE 1
-_ACEOF
+$as_echo "#define HAVE_STRUCT_TIMEZONE 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for struct sockopt_len_t type" >&5
-echo $ECHO_N "checking for struct sockopt_len_t type... $ECHO_C" >&6
-if test "${ac_cv_have_sockopt_len_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockopt_len_t type" >&5
+$as_echo_n "checking for struct sockopt_len_t type... " >&6; }
+if ${ac_cv_have_sockopt_len_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 		  #include <sys/socket.h>
@@ -7325,60 +5346,30 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_sockopt_len_t="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_sockopt_len_t="no"
 
- ac_cv_have_sockopt_len_t="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_sockopt_len_t" >&5
-echo "${ECHO_T}$ac_cv_have_sockopt_len_t" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_sockopt_len_t" >&5
+$as_echo "$ac_cv_have_sockopt_len_t" >&6; }
 if test "x$ac_cv_have_sockopt_len_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SOCKOPT_LEN_T 1
-_ACEOF
+$as_echo "#define HAVE_SOCKOPT_LEN_T 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for struct msghdr type" >&5
-echo $ECHO_N "checking for struct msghdr type... $ECHO_C" >&6
-if test "${ac_cv_have_struct_msghdr+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct msghdr type" >&5
+$as_echo_n "checking for struct msghdr type... " >&6; }
+if ${ac_cv_have_struct_msghdr+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 		  #include <sys/socket.h>
@@ -7390,60 +5381,30 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_msghdr="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_msghdr="no"
 
- ac_cv_have_struct_msghdr="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_struct_msghdr" >&5
-echo "${ECHO_T}$ac_cv_have_struct_msghdr" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_msghdr" >&5
+$as_echo "$ac_cv_have_struct_msghdr" >&6; }
 if test "x$ac_cv_have_struct_msghdr" = "xno" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define ARCH_SCATTER_NONE 1
-_ACEOF
+$as_echo "#define ARCH_SCATTER_NONE 1" >>confdefs.h
 
 else
   have_scatter="no"
-  echo "$as_me:$LINENO: checking for struct msghdr control" >&5
-echo $ECHO_N "checking for struct msghdr control... $ECHO_C" >&6
-if test "${ac_cv_have_struct_msghdr_ctl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct msghdr control" >&5
+$as_echo_n "checking for struct msghdr control... " >&6; }
+if ${ac_cv_have_struct_msghdr_ctl+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 	#include <sys/socket.h>
@@ -7455,61 +5416,31 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_msghdr_ctl="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_msghdr_ctl="no"
 
- ac_cv_have_struct_msghdr_ctl="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_struct_msghdr_ctl" >&5
-echo "${ECHO_T}$ac_cv_have_struct_msghdr_ctl" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_msghdr_ctl" >&5
+$as_echo "$ac_cv_have_struct_msghdr_ctl" >&6; }
   if test "x$ac_cv_have_struct_msghdr_ctl" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define ARCH_SCATTER_CONTROL 1
-_ACEOF
+$as_echo "#define ARCH_SCATTER_CONTROL 1" >>confdefs.h
 
        have_scatter="yes"
   fi
   if test "x$have_scatter" = "xno" ; then
-     	echo "$as_me:$LINENO: checking for struct msghdr accrights" >&5
-echo $ECHO_N "checking for struct msghdr accrights... $ECHO_C" >&6
-if test "${ac_cv_have_struct_msghdr_acc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct msghdr accrights" >&5
+$as_echo_n "checking for struct msghdr accrights... " >&6; }
+if ${ac_cv_have_struct_msghdr_acc+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-            cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 	      #include <sys/socket.h>
@@ -7521,69 +5452,37 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_msghdr_acc="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_msghdr_acc="no"
 
- ac_cv_have_struct_msghdr_acc="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_struct_msghdr_acc" >&5
-echo "${ECHO_T}$ac_cv_have_struct_msghdr_acc" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_msghdr_acc" >&5
+$as_echo "$ac_cv_have_struct_msghdr_acc" >&6; }
 	if test "x$ac_cv_have_struct_msghdr_acc" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define ARCH_SCATTER_ACCRIGHTS 1
-_ACEOF
+$as_echo "#define ARCH_SCATTER_ACCRIGHTS 1" >>confdefs.h
 
 	   have_scatter="yes"
 	fi
 
   fi
   if test "x$have_scatter" = "xno" ; then
-        { { echo "$as_me:$LINENO: error: *** cannot determine which scatter type to use ***" >&5
-echo "$as_me: error: *** cannot determine which scatter type to use ***" >&2;}
-   { (exit 1); exit 1; }; }
+        as_fn_error $? "*** cannot determine which scatter type to use ***" "$LINENO" 5
   fi
 fi
 
-echo "$as_me:$LINENO: checking for u_int type" >&5
-echo $ECHO_N "checking for u_int type... $ECHO_C" >&6
-if test "${ac_cv_have_u_int+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int type" >&5
+$as_echo_n "checking for u_int type... " >&6; }
+if ${ac_cv_have_u_int+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 int
@@ -7594,61 +5493,31 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_u_int="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_u_int="no"
 
- ac_cv_have_u_int="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_u_int" >&5
-echo "${ECHO_T}$ac_cv_have_u_int" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_u_int" >&5
+$as_echo "$ac_cv_have_u_int" >&6; }
 if test "x$ac_cv_have_u_int" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_U_INT 1
-_ACEOF
+$as_echo "#define HAVE_U_INT 1" >>confdefs.h
 
 	have_u_int=1
 fi
 
-echo "$as_me:$LINENO: checking for intXX_t types" >&5
-echo $ECHO_N "checking for intXX_t types... $ECHO_C" >&6
-if test "${ac_cv_have_intxx_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for intXX_t types" >&5
+$as_echo_n "checking for intXX_t types... " >&6; }
+if ${ac_cv_have_intxx_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 int
@@ -7659,61 +5528,31 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_intxx_t="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_intxx_t="no"
 
- ac_cv_have_intxx_t="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_intxx_t" >&5
-echo "${ECHO_T}$ac_cv_have_intxx_t" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_intxx_t" >&5
+$as_echo "$ac_cv_have_intxx_t" >&6; }
 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_INTXX_T 1
-_ACEOF
+$as_echo "#define HAVE_INTXX_T 1" >>confdefs.h
 
 	have_intxx_t=1
 fi
 
-echo "$as_me:$LINENO: checking for int64_t type" >&5
-echo $ECHO_N "checking for int64_t type... $ECHO_C" >&6
-if test "${ac_cv_have_int64_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for int64_t type" >&5
+$as_echo_n "checking for int64_t type... " >&6; }
+if ${ac_cv_have_int64_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 int
@@ -7724,61 +5563,31 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_int64_t="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_int64_t="no"
 
- ac_cv_have_int64_t="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_int64_t" >&5
-echo "${ECHO_T}$ac_cv_have_int64_t" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_int64_t" >&5
+$as_echo "$ac_cv_have_int64_t" >&6; }
 if test "x$ac_cv_have_int64_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_INT64_T 1
-_ACEOF
+$as_echo "#define HAVE_INT64_T 1" >>confdefs.h
 
 	have_int64_t=1
 fi
 
-echo "$as_me:$LINENO: checking for u_intXX_t types" >&5
-echo $ECHO_N "checking for u_intXX_t types... $ECHO_C" >&6
-if test "${ac_cv_have_u_intxx_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_intXX_t types" >&5
+$as_echo_n "checking for u_intXX_t types... " >&6; }
+if ${ac_cv_have_u_intxx_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 int
@@ -7789,61 +5598,31 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_u_intxx_t="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_u_intxx_t="no"
 
- ac_cv_have_u_intxx_t="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_u_intxx_t" >&5
-echo "${ECHO_T}$ac_cv_have_u_intxx_t" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_u_intxx_t" >&5
+$as_echo "$ac_cv_have_u_intxx_t" >&6; }
 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_U_INTXX_T 1
-_ACEOF
+$as_echo "#define HAVE_U_INTXX_T 1" >>confdefs.h
 
 	have_u_intxx_t=1
 fi
 
-echo "$as_me:$LINENO: checking for u_int64_t types" >&5
-echo $ECHO_N "checking for u_int64_t types... $ECHO_C" >&6
-if test "${ac_cv_have_u_int64_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int64_t types" >&5
+$as_echo_n "checking for u_int64_t types... " >&6; }
+if ${ac_cv_have_u_int64_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 int
@@ -7854,46 +5633,20 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_u_int64_t="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_u_int64_t="no"
 
- ac_cv_have_u_int64_t="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_u_int64_t" >&5
-echo "${ECHO_T}$ac_cv_have_u_int64_t" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_u_int64_t" >&5
+$as_echo "$ac_cv_have_u_int64_t" >&6; }
 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_U_INT64_T 1
-_ACEOF
+$as_echo "#define HAVE_U_INT64_T 1" >>confdefs.h
 
 	have_u_int64_t=1
 fi
@@ -7901,13 +5654,9 @@
 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
            test "x$ac_cv_header_sys_bitypes_h" = "xyes")
 then
-	echo "$as_me:$LINENO: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5
-echo $ECHO_N "checking for intXX_t and u_intXX_t types in sys/bitypes.h... $ECHO_C" >&6
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5
+$as_echo_n "checking for intXX_t and u_intXX_t types in sys/bitypes.h... " >&6; }
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/bitypes.h>
@@ -7924,63 +5673,31 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
 
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_U_INTXX_T 1
-_ACEOF
+			$as_echo "#define HAVE_U_INTXX_T 1" >>confdefs.h
 
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_INTXX_T 1
-_ACEOF
+			$as_echo "#define HAVE_INTXX_T 1" >>confdefs.h
 
-			echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
-echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
 if test -z "$have_u_intxx_t" ; then
-	echo "$as_me:$LINENO: checking for uintXX_t types" >&5
-echo $ECHO_N "checking for uintXX_t types... $ECHO_C" >&6
-if test "${ac_cv_have_uintxx_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uintXX_t types" >&5
+$as_echo_n "checking for uintXX_t types... " >&6; }
+if ${ac_cv_have_uintxx_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-		cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -7993,61 +5710,31 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_uintxx_t="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_uintxx_t="no"
 
- ac_cv_have_uintxx_t="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_uintxx_t" >&5
-echo "${ECHO_T}$ac_cv_have_uintxx_t" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_uintxx_t" >&5
+$as_echo "$ac_cv_have_uintxx_t" >&6; }
 	if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_UINTXX_T 1
-_ACEOF
+$as_echo "#define HAVE_UINTXX_T 1" >>confdefs.h
 
 	fi
 fi
 
-echo "$as_me:$LINENO: checking for socklen_t" >&5
-echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6
-if test "${ac_cv_have_socklen_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5
+$as_echo_n "checking for socklen_t... " >&6; }
+if ${ac_cv_have_socklen_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8061,60 +5748,30 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_socklen_t="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_socklen_t="no"
 
- ac_cv_have_socklen_t="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_socklen_t" >&5
-echo "${ECHO_T}$ac_cv_have_socklen_t" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_socklen_t" >&5
+$as_echo "$ac_cv_have_socklen_t" >&6; }
 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SOCKLEN_T 1
-_ACEOF
+$as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6
-if test "${ac_cv_have_size_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for size_t" >&5
+$as_echo_n "checking for size_t... " >&6; }
+if ${ac_cv_have_size_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8127,60 +5784,30 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_size_t="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_size_t="no"
 
- ac_cv_have_size_t="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_size_t" >&5
-echo "${ECHO_T}$ac_cv_have_size_t" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_size_t" >&5
+$as_echo "$ac_cv_have_size_t" >&6; }
 if test "x$ac_cv_have_size_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SIZE_T 1
-_ACEOF
+$as_echo "#define HAVE_SIZE_T 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for ssize_t" >&5
-echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6
-if test "${ac_cv_have_ssize_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
+$as_echo_n "checking for ssize_t... " >&6; }
+if ${ac_cv_have_ssize_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8193,60 +5820,30 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_ssize_t="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_ssize_t="no"
 
- ac_cv_have_ssize_t="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_ssize_t" >&5
-echo "${ECHO_T}$ac_cv_have_ssize_t" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_ssize_t" >&5
+$as_echo "$ac_cv_have_ssize_t" >&6; }
 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SSIZE_T 1
-_ACEOF
+$as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for clock_t" >&5
-echo $ECHO_N "checking for clock_t... $ECHO_C" >&6
-if test "${ac_cv_have_clock_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_t" >&5
+$as_echo_n "checking for clock_t... " >&6; }
+if ${ac_cv_have_clock_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <time.h>
@@ -8259,60 +5856,30 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_clock_t="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_clock_t="no"
 
- ac_cv_have_clock_t="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_clock_t" >&5
-echo "${ECHO_T}$ac_cv_have_clock_t" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_clock_t" >&5
+$as_echo "$ac_cv_have_clock_t" >&6; }
 if test "x$ac_cv_have_clock_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CLOCK_T 1
-_ACEOF
+$as_echo "#define HAVE_CLOCK_T 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for sa_family_t" >&5
-echo $ECHO_N "checking for sa_family_t... $ECHO_C" >&6
-if test "${ac_cv_have_sa_family_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sa_family_t" >&5
+$as_echo_n "checking for sa_family_t... " >&6; }
+if ${ac_cv_have_sa_family_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8326,38 +5893,10 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_sa_family_t="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
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8372,64 +5911,33 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_sa_family_t="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_sa_family_t="no"
 
- ac_cv_have_sa_family_t="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_sa_family_t" >&5
-echo "${ECHO_T}$ac_cv_have_sa_family_t" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_sa_family_t" >&5
+$as_echo "$ac_cv_have_sa_family_t" >&6; }
 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SA_FAMILY_T 1
-_ACEOF
+$as_echo "#define HAVE_SA_FAMILY_T 1" >>confdefs.h
 
 fi
 
-
-echo "$as_me:$LINENO: checking for struct sockaddr_storage" >&5
-echo $ECHO_N "checking for struct sockaddr_storage... $ECHO_C" >&6
-if test "${ac_cv_have_struct_sockaddr_storage+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5
+$as_echo_n "checking for struct sockaddr_storage... " >&6; }
+if ${ac_cv_have_struct_sockaddr_storage+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8443,60 +5951,30 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_sockaddr_storage="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_sockaddr_storage="no"
 
- ac_cv_have_struct_sockaddr_storage="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_struct_sockaddr_storage" >&5
-echo "${ECHO_T}$ac_cv_have_struct_sockaddr_storage" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_sockaddr_storage" >&5
+$as_echo "$ac_cv_have_struct_sockaddr_storage" >&6; }
 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_SOCKADDR_STORAGE 1
-_ACEOF
+$as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for struct sockaddr_in6" >&5
-echo $ECHO_N "checking for struct sockaddr_in6... $ECHO_C" >&6
-if test "${ac_cv_have_struct_sockaddr_in6+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_in6" >&5
+$as_echo_n "checking for struct sockaddr_in6... " >&6; }
+if ${ac_cv_have_struct_sockaddr_in6+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8510,60 +5988,30 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_sockaddr_in6="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_sockaddr_in6="no"
 
- ac_cv_have_struct_sockaddr_in6="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_struct_sockaddr_in6" >&5
-echo "${ECHO_T}$ac_cv_have_struct_sockaddr_in6" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_sockaddr_in6" >&5
+$as_echo "$ac_cv_have_struct_sockaddr_in6" >&6; }
 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_SOCKADDR_IN6 1
-_ACEOF
+$as_echo "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for struct in6_addr" >&5
-echo $ECHO_N "checking for struct in6_addr... $ECHO_C" >&6
-if test "${ac_cv_have_struct_in6_addr+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct in6_addr" >&5
+$as_echo_n "checking for struct in6_addr... " >&6; }
+if ${ac_cv_have_struct_in6_addr+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8577,60 +6025,30 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_in6_addr="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_in6_addr="no"
 
- ac_cv_have_struct_in6_addr="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_struct_in6_addr" >&5
-echo "${ECHO_T}$ac_cv_have_struct_in6_addr" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_in6_addr" >&5
+$as_echo "$ac_cv_have_struct_in6_addr" >&6; }
 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_IN6_ADDR 1
-_ACEOF
+$as_echo "#define HAVE_STRUCT_IN6_ADDR 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for struct addrinfo" >&5
-echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6
-if test "${ac_cv_have_struct_addrinfo+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct addrinfo" >&5
+$as_echo_n "checking for struct addrinfo... " >&6; }
+if ${ac_cv_have_struct_addrinfo+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8645,60 +6063,30 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_addrinfo="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_addrinfo="no"
 
- ac_cv_have_struct_addrinfo="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_struct_addrinfo" >&5
-echo "${ECHO_T}$ac_cv_have_struct_addrinfo" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_addrinfo" >&5
+$as_echo "$ac_cv_have_struct_addrinfo" >&6; }
 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_ADDRINFO 1
-_ACEOF
+$as_echo "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for struct timeval" >&5
-echo $ECHO_N "checking for struct timeval... $ECHO_C" >&6
-if test "${ac_cv_have_struct_timeval+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
+$as_echo_n "checking for struct timeval... " >&6; }
+if ${ac_cv_have_struct_timeval+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/time.h>
 int
@@ -8709,61 +6097,67 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_timeval="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_timeval="no"
 
- ac_cv_have_struct_timeval="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_struct_timeval" >&5
-echo "${ECHO_T}$ac_cv_have_struct_timeval" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_timeval" >&5
+$as_echo "$ac_cv_have_struct_timeval" >&6; }
 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_TIMEVAL 1
-_ACEOF
+$as_echo "#define HAVE_STRUCT_TIMEVAL 1" >>confdefs.h
 
 	have_struct_timeval=1
 fi
 
-echo "$as_me:$LINENO: checking for sun_len field in struct sockaddr_un" >&5
-echo $ECHO_N "checking for sun_len field in struct sockaddr_un... $ECHO_C" >&6
-if test "${ac_cv_have_sun_len_in_struct_sockaddr_un+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sa_len field in struct sockaddr" >&5
+$as_echo_n "checking for sa_len field in struct sockaddr... " >&6; }
+if ${ac_cv_have_sa_len_in_struct_sockaddr+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+int
+main ()
+{
+ struct sockaddr s; s.sa_len = 1;
+  ;
+  return 0;
+}
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+   ac_cv_have_sa_len_in_struct_sockaddr="yes"
+else
+   ac_cv_have_sa_len_in_struct_sockaddr="no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_sa_len_in_struct_sockaddr" >&5
+$as_echo "$ac_cv_have_sa_len_in_struct_sockaddr" >&6; }
+if test "x$ac_cv_have_sa_len_in_struct_sockaddr" = "xyes" ; then
+
+$as_echo "#define HAVE_SA_LEN_IN_SOCKADDR 1" >>confdefs.h
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sun_len field in struct sockaddr_un" >&5
+$as_echo_n "checking for sun_len field in struct sockaddr_un... " >&6; }
+if ${ac_cv_have_sun_len_in_struct_sockaddr_un+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8777,59 +6171,29 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_sun_len_in_struct_sockaddr_un="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_sun_len_in_struct_sockaddr_un="no"
+   ac_cv_have_sun_len_in_struct_sockaddr_un="no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_sun_len_in_struct_sockaddr_un" >&5
-echo "${ECHO_T}$ac_cv_have_sun_len_in_struct_sockaddr_un" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_sun_len_in_struct_sockaddr_un" >&5
+$as_echo "$ac_cv_have_sun_len_in_struct_sockaddr_un" >&6; }
 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SUN_LEN_IN_SOCKADDR_UN 1
-_ACEOF
+$as_echo "#define HAVE_SUN_LEN_IN_SOCKADDR_UN 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for sin_len field in sockaddr_in" >&5
-echo $ECHO_N "checking for sin_len field in sockaddr_in... $ECHO_C" >&6
-if test "${ac_cv_have_sin_len_in_struct_sockaddr_in+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin_len field in sockaddr_in" >&5
+$as_echo_n "checking for sin_len field in sockaddr_in... " >&6; }
+if ${ac_cv_have_sin_len_in_struct_sockaddr_in+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8844,59 +6208,29 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_sin_len_in_struct_sockaddr_in="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_sin_len_in_struct_sockaddr_in="no"
+   ac_cv_have_sin_len_in_struct_sockaddr_in="no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_sin_len_in_struct_sockaddr_in" >&5
-echo "${ECHO_T}$ac_cv_have_sin_len_in_struct_sockaddr_in" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_sin_len_in_struct_sockaddr_in" >&5
+$as_echo "$ac_cv_have_sin_len_in_struct_sockaddr_in" >&6; }
 if test x"$ac_cv_have_sin_len_in_struct_sockaddr_in" = "xyes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SIN_LEN_IN_SOCKADDR_IN 1
-_ACEOF
+$as_echo "#define HAVE_SIN_LEN_IN_SOCKADDR_IN 1 " >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for ss_family field in struct sockaddr_storage" >&5
-echo $ECHO_N "checking for ss_family field in struct sockaddr_storage... $ECHO_C" >&6
-if test "${ac_cv_have_ss_family_in_struct_ss+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ss_family field in struct sockaddr_storage" >&5
+$as_echo_n "checking for ss_family field in struct sockaddr_storage... " >&6; }
+if ${ac_cv_have_ss_family_in_struct_ss+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8910,59 +6244,29 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_ss_family_in_struct_ss="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_ss_family_in_struct_ss="no"
+   ac_cv_have_ss_family_in_struct_ss="no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_ss_family_in_struct_ss" >&5
-echo "${ECHO_T}$ac_cv_have_ss_family_in_struct_ss" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_ss_family_in_struct_ss" >&5
+$as_echo "$ac_cv_have_ss_family_in_struct_ss" >&6; }
 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SS_FAMILY_IN_SS 1
-_ACEOF
+$as_echo "#define HAVE_SS_FAMILY_IN_SS 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for __ss_family field in struct sockaddr_storage" >&5
-echo $ECHO_N "checking for __ss_family field in struct sockaddr_storage... $ECHO_C" >&6
-if test "${ac_cv_have___ss_family_in_struct_ss+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __ss_family field in struct sockaddr_storage" >&5
+$as_echo_n "checking for __ss_family field in struct sockaddr_storage... " >&6; }
+if ${ac_cv_have___ss_family_in_struct_ss+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8976,60 +6280,30 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have___ss_family_in_struct_ss="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have___ss_family_in_struct_ss="no"
 
- ac_cv_have___ss_family_in_struct_ss="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have___ss_family_in_struct_ss" >&5
-echo "${ECHO_T}$ac_cv_have___ss_family_in_struct_ss" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___ss_family_in_struct_ss" >&5
+$as_echo "$ac_cv_have___ss_family_in_struct_ss" >&6; }
 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___SS_FAMILY_IN_SS 1
-_ACEOF
+$as_echo "#define HAVE___SS_FAMILY_IN_SS 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking for pid_t" >&5
-echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
-if test "${ac_cv_have_pid_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pid_t" >&5
+$as_echo_n "checking for pid_t... " >&6; }
+if ${ac_cv_have_pid_t+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -9042,60 +6316,30 @@
   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 ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_pid_t="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_pid_t="no"
 
- ac_cv_have_pid_t="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_pid_t" >&5
-echo "${ECHO_T}$ac_cv_have_pid_t" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_pid_t" >&5
+$as_echo "$ac_cv_have_pid_t" >&6; }
 if test "x$ac_cv_have_pid_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PID_T 1
-_ACEOF
+$as_echo "#define HAVE_PID_T 1" >>confdefs.h
 
 fi
 
-echo "$as_me:$LINENO: checking if libc defines __progname" >&5
-echo $ECHO_N "checking if libc defines __progname... $ECHO_C" >&6
-if test "${ac_cv_libc_defines___progname+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libc defines __progname" >&5
+$as_echo_n "checking if libc defines __progname... " >&6; }
+if ${ac_cv_libc_defines___progname+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -9106,62 +6350,32 @@
   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
+if ac_fn_c_try_link "$LINENO"; then :
    ac_cv_libc_defines___progname="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_libc_defines___progname="no"
 
- ac_cv_libc_defines___progname="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_libc_defines___progname" >&5
-echo "${ECHO_T}$ac_cv_libc_defines___progname" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libc_defines___progname" >&5
+$as_echo "$ac_cv_libc_defines___progname" >&6; }
 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___PROGNAME 1
-_ACEOF
+$as_echo "#define HAVE___PROGNAME 1" >>confdefs.h
 
 fi
 
 
-echo "$as_me:$LINENO: checking if libc defines sys_errlist" >&5
-echo $ECHO_N "checking if libc defines sys_errlist... $ECHO_C" >&6
-if test "${ac_cv_libc_defines_sys_errlist+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libc defines sys_errlist" >&5
+$as_echo_n "checking if libc defines sys_errlist... " >&6; }
+if ${ac_cv_libc_defines_sys_errlist+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -9172,62 +6386,31 @@
   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
+if ac_fn_c_try_link "$LINENO"; then :
    ac_cv_libc_defines_sys_errlist="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_libc_defines_sys_errlist="no"
 
- ac_cv_libc_defines_sys_errlist="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_libc_defines_sys_errlist" >&5
-echo "${ECHO_T}$ac_cv_libc_defines_sys_errlist" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libc_defines_sys_errlist" >&5
+$as_echo "$ac_cv_libc_defines_sys_errlist" >&6; }
 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_ERRLIST 1
-_ACEOF
+$as_echo "#define HAVE_SYS_ERRLIST 1" >>confdefs.h
 
 fi
 
-
-echo "$as_me:$LINENO: checking if libc defines sys_nerr" >&5
-echo $ECHO_N "checking if libc defines sys_nerr... $ECHO_C" >&6
-if test "${ac_cv_libc_defines_sys_nerr+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libc defines sys_nerr" >&5
+$as_echo_n "checking if libc defines sys_nerr... " >&6; }
+if ${ac_cv_libc_defines_sys_nerr+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -9238,47 +6421,21 @@
   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
+if ac_fn_c_try_link "$LINENO"; then :
    ac_cv_libc_defines_sys_nerr="yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_libc_defines_sys_nerr="no"
 
- ac_cv_libc_defines_sys_nerr="no"
-
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_libc_defines_sys_nerr" >&5
-echo "${ECHO_T}$ac_cv_libc_defines_sys_nerr" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libc_defines_sys_nerr" >&5
+$as_echo "$ac_cv_libc_defines_sys_nerr" >&6; }
 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_NERR 1
-_ACEOF
+$as_echo "#define HAVE_SYS_NERR 1" >>confdefs.h
 
 fi
 
@@ -9286,51 +6443,49 @@
 do
   eval $i
 done
-echo "$as_me:$LINENO: checking Check Spread's major version" >&5
-echo $ECHO_N "checking Check Spread's major version... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $SP_MAJOR_VERSION" >&5
-echo "${ECHO_T}$SP_MAJOR_VERSION" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Check Spread's major version" >&5
+$as_echo_n "checking Check Spread's major version... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SP_MAJOR_VERSION" >&5
+$as_echo "$SP_MAJOR_VERSION" >&6; }
 
-echo "$as_me:$LINENO: checking Check Spread's minor version" >&5
-echo $ECHO_N "checking Check Spread's minor version... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $SP_MINOR_VERSION" >&5
-echo "${ECHO_T}$SP_MINOR_VERSION" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Check Spread's minor version" >&5
+$as_echo_n "checking Check Spread's minor version... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SP_MINOR_VERSION" >&5
+$as_echo "$SP_MINOR_VERSION" >&6; }
 
-echo "$as_me:$LINENO: checking Check Spread's patch version" >&5
-echo $ECHO_N "checking Check Spread's patch version... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $SP_PATCH_VERSION" >&5
-echo "${ECHO_T}$SP_PATCH_VERSION" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Check Spread's patch version" >&5
+$as_echo_n "checking Check Spread's patch version... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SP_PATCH_VERSION" >&5
+$as_echo "$SP_PATCH_VERSION" >&6; }
 
 
 # Options from here on. Some of these are preset by platform above
 
 
-# Check whether --with-catman or --without-catman was given.
-if test "${with_catman+set}" = set; then
-  withval="$with_catman"
-
+# Check whether --with-catman was given.
+if test "${with_catman+set}" = set; then :
+  withval=$with_catman;
 		case "$withval" in
 		man|cat|doc)
 			MANTYPE=$withval
 			;;
 		*)
-			{ { echo "$as_me:$LINENO: error: invalid man type: $withval" >&5
-echo "$as_me: error: invalid man type: $withval" >&2;}
-   { (exit 1); exit 1; }; }
+			as_fn_error $? "invalid man type: $withval" "$LINENO" 5
 			;;
 		esac
 
 
-fi;
+fi
+
 if test -z "$MANTYPE"; then
 	for ac_prog in nroff awf
 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_path_NROFF+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_NROFF+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   case $NROFF in
   [\\/]* | ?:[\\/]*)
@@ -9343,28 +6498,29 @@
 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
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_NROFF="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
+IFS=$as_save_IFS
 
   ;;
 esac
 fi
 NROFF=$ac_cv_path_NROFF
-
 if test -n "$NROFF"; then
-  echo "$as_me:$LINENO: result: $NROFF" >&5
-echo "${ECHO_T}$NROFF" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NROFF" >&5
+$as_echo "$NROFF" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
   test -n "$NROFF" && break
 done
 test -n "$NROFF" || NROFF="/bin/false"
@@ -9388,17 +6544,17 @@
 # Where to place spread.pid
 piddir=/var/run
 
-# Check whether --with-pid-dir or --without-pid-dir was given.
-if test "${with_pid_dir+set}" = set; then
-  withval="$with_pid_dir"
-
+# Check whether --with-pid-dir was given.
+if test "${with_pid_dir+set}" = set; then :
+  withval=$with_pid_dir;
 		if test "x$withval" != "xno" ; then
 			piddir=$withval
 		fi
 
 
-fi;
+fi
 
+
 # make sure the directory exists
 if test ! -d $piddir ; then
 	piddir=`eval echo ${sysconfdir}`
@@ -9417,17 +6573,17 @@
 # Where to place spread.pid
 unixsocketdir=/tmp
 
-# Check whether --with-unix-socket-dir or --without-unix-socket-dir was given.
-if test "${with_unix_socket_dir+set}" = set; then
-  withval="$with_unix_socket_dir"
-
+# Check whether --with-unix-socket-dir was given.
+if test "${with_unix_socket_dir+set}" = set; then :
+  withval=$with_unix_socket_dir;
 		if test "x$withval" != "xno" ; then
 			unixsocketdir=$withval
 		fi
 
 
-fi;
+fi
 
+
 # make sure the directory exists
 if test ! -d $unixsocketdir ; then
 	piddir=`eval echo ${sysconfdir}`
@@ -9456,10 +6612,9 @@
 
 # autoconf does not have docdir option, so add one
 
-# Check whether --with-docdir or --without-docdir was given.
-if test "${with_docdir+set}" = set; then
-  withval="$with_docdir"
-
+# Check whether --with-docdir was given.
+if test "${with_docdir+set}" = set; then :
+  withval=$with_docdir;
 		if test "x$withval" = xyes || test "x$withval" = xno; then
 		   docdir='${datadir}/doc/spread'
 		else
@@ -9471,7 +6626,7 @@
 	  docdir='${datadir}/doc/spread'
 
 
-fi;
+fi
 
 
 
@@ -9481,7 +6636,6 @@
 
 
 
-
 LIBSPSO=none
 LIBSPCORESO=none
 LIBTSPCORESO=none
@@ -9562,11 +6716,12 @@
   set $ac_sources; ac_source=$1; shift; ac_sources=$*
   ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
 done
-          ac_config_links="$ac_config_links $ac_config_links_1"
+ac_config_links="$ac_config_links $ac_config_links_1"
 
 fi
 
-                                                  ac_config_files="$ac_config_files Makefile daemon/Makefile docs/Makefile libspread/Makefile examples/Makefile"
+ac_config_files="$ac_config_files Makefile daemon/Makefile docs/Makefile libspread/Makefile examples/Makefile"
+
 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
@@ -9585,39 +6740,70 @@
 
 # The following way of writing the cache mishandles newlines in values,
 # but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
+# So, we kill variables containing newlines.
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
-{
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
   (set) 2>&1 |
-    case `(ac_space=' '; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
-      # `set' does not quote correctly, so add quotes (double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \).
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
       sed -n \
 	"s/'/'\\\\''/g;
 	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;;
+      ;; #(
     *)
       # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n \
-	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-} |
+    esac |
+    sort
+) |
   sed '
+     /^ac_cv_env_/b end
      t clear
-     : clear
+     :clear
      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
      t end
-     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
-  if test -w $cache_file; then
-    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
-    cat confcache >$cache_file
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
   else
-    echo "not updating unwritable cache $cache_file"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
@@ -9626,32 +6812,19 @@
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[	 ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[	 ]*$//;
-}'
-fi
-
 DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
+U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
-  ac_i=`echo "$ac_i" |
-	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-  # 2. Add them.
-  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
@@ -9659,12 +6832,15 @@
 
 
 
-: ${CONFIG_STATUS=./config.status}
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
 #! $SHELL
 # Generated by $as_me.
 # Run this file to recreate the current configuration.
@@ -9674,81 +6850,253 @@
 debug=false
 ac_cs_recheck=false
 ac_cs_silent=false
+
 SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
 
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
 fi
-DUALCASE=1; export DUALCASE # for MKS sh
 
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
 else
-  as_unset=false
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
 fi
 
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
 
-# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
 
 # NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    $as_unset $as_var
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
   fi
-done
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
 
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
 fi
 
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
 
-# Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)$' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\/\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
-
-# PATH needs CR, and LINENO needs CR and PATH.
 # Avoid depending upon Character Ranges.
 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -9756,149 +7104,112 @@
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-	 case $as_dir in
-	 /*)
-	   if ("$as_dir/$as_base" -c '
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-	     CONFIG_SHELL=$as_dir/$as_base
-	     export CONFIG_SHELL
-	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-	   fi;;
-	 esac
-       done
-done
-;;
-  esac
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
-    sed '
-      N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
-      t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
-    ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
-  # Exit status is that of the last command.
-  exit
-}
-
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
 else
-  as_expr=false
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
 fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
     as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
   fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
 
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
@@ -9906,77 +7217,68 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
 exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
 
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.  Logging --version etc. is OK.
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
+# values after options handling.
+ac_log="
+This file was extended by Spread $as_me 5.0.0, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
-This file was extended by Spread $as_me 4.4.0, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
-
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
   CONFIG_LINKS    = $CONFIG_LINKS
   CONFIG_COMMANDS = $CONFIG_COMMANDS
   $ $0 $@
 
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
 _ACEOF
 
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
-  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
 
-if test -n "$ac_config_headers"; then
-  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
 
-if test -n "$ac_config_links"; then
-  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
 
-if test -n "$ac_config_commands"; then
-  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_links="$ac_config_links"
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+_ACEOF
 
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
 
-Usage: $0 [OPTIONS] [FILE]...
+Usage: $0 [OPTION]... [TAG]...
 
   -h, --help       print this help, then exit
-  -V, --version    print version number, then exit
-  -q, --quiet      do not print progress messages
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
-		   instantiate the configuration file FILE
-  --header=FILE[:TEMPLATE]
-		   instantiate the configuration header FILE
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
 
 Configuration files:
 $config_files
@@ -9987,84 +7289,90 @@
 Configuration links:
 $config_links
 
-Report bugs to <bug-autoconf at gnu.org>."
-_ACEOF
+Report bugs to the package provider."
 
-cat >>$CONFIG_STATUS <<_ACEOF
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-Spread config.status 4.4.0
-configured by $0, generated by GNU Autoconf 2.59,
-  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+Spread config.status 5.0.0
+configured by $0, generated by GNU Autoconf 2.69,
+  with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+test -n "\$AWK" || AWK=awk
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value.  By we need to know if files were specified by the user.
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
 ac_need_defaults=:
 while test $# != 0
 do
   case $1 in
-  --*=*)
-    ac_option=`expr "x$1" : 'x\([^=]*\)='`
-    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
-  -*)
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
     ac_option=$1
     ac_optarg=$2
     ac_shift=shift
     ;;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_option=$1
-     ac_need_defaults=false;;
   esac
 
   case $ac_option in
   # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
-  --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
-  --he | --h)
-    # Conflict between --help and --header
-    { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; };;
-  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
-  --debug | --d* | -d )
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
-    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
     ac_need_defaults=false;;
   --header | --heade | --head | --hea )
     $ac_shift
-    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
     ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; } ;;
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
 
-  *) ac_config_targets="$ac_config_targets $1" ;;
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
 
   esac
   shift
@@ -10078,36 +7386,50 @@
 fi
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
 fi
 
 _ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
 
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
 
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 
-
-
-cat >>$CONFIG_STATUS <<\_ACEOF
+# Handling of arguments.
 for ac_config_target in $ac_config_targets
 do
-  case "$ac_config_target" in
-  # Handling of arguments.
-  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-  "daemon/Makefile" ) CONFIG_FILES="$CONFIG_FILES daemon/Makefile" ;;
-  "docs/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
-  "libspread/Makefile" ) CONFIG_FILES="$CONFIG_FILES libspread/Makefile" ;;
-  "examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
-  "$ac_config_links_1" ) CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_1" ;;
-  "daemon/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS daemon/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; }; };;
+  case $ac_config_target in
+    "daemon/config.h") CONFIG_HEADERS="$CONFIG_HEADERS daemon/config.h" ;;
+    "$ac_config_links_1") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_1" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "daemon/Makefile") CONFIG_FILES="$CONFIG_FILES daemon/Makefile" ;;
+    "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
+    "libspread/Makefile") CONFIG_FILES="$CONFIG_FILES libspread/Makefile" ;;
+    "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
+
 # If the user did not use the arguments to specify the items to instantiate,
 # then the envvar interface is used.  Set only those that are not.
 # We use the long form for the default assignment because of an extremely
@@ -10119,736 +7441,582 @@
 fi
 
 # Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
+# simply because there is no reason against having it here, and in addition,
 # creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
 }
-
 # Create a (secure) tmp directory for tmp files.
 
 {
-  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
 }  ||
 {
-  tmp=./confstat$$-$RANDOM
-  (umask 077 && mkdir $tmp)
-} ||
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
 {
-   echo "$me: cannot create a temporary directory in ." >&2
-   { (exit 1); exit 1; }
-}
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
 
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
 
-cat >>$CONFIG_STATUS <<_ACEOF
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
 
-#
-# CONFIG_FILES section.
-#
+  print line
+}
 
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
-  # Protect against being on the right side of a sed subst in config.status.
-  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
-   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s, at SHELL@,$SHELL,;t t
-s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s, at exec_prefix@,$exec_prefix,;t t
-s, at prefix@,$prefix,;t t
-s, at program_transform_name@,$program_transform_name,;t t
-s, at bindir@,$bindir,;t t
-s, at sbindir@,$sbindir,;t t
-s, at libexecdir@,$libexecdir,;t t
-s, at datadir@,$datadir,;t t
-s, at sysconfdir@,$sysconfdir,;t t
-s, at sharedstatedir@,$sharedstatedir,;t t
-s, at localstatedir@,$localstatedir,;t t
-s, at libdir@,$libdir,;t t
-s, at includedir@,$includedir,;t t
-s, at oldincludedir@,$oldincludedir,;t t
-s, at infodir@,$infodir,;t t
-s, at mandir@,$mandir,;t t
-s, at build_alias@,$build_alias,;t t
-s, at host_alias@,$host_alias,;t t
-s, at target_alias@,$target_alias,;t t
-s, at DEFS@,$DEFS,;t t
-s, at ECHO_C@,$ECHO_C,;t t
-s, at ECHO_N@,$ECHO_N,;t t
-s, at ECHO_T@,$ECHO_T,;t t
-s, at LIBS@,$LIBS,;t t
-s, at subdirs@,$subdirs,;t t
-s, at build@,$build,;t t
-s, at build_cpu@,$build_cpu,;t t
-s, at build_vendor@,$build_vendor,;t t
-s, at build_os@,$build_os,;t t
-s, at host@,$host,;t t
-s, at host_cpu@,$host_cpu,;t t
-s, at host_vendor@,$host_vendor,;t t
-s, at host_os@,$host_os,;t t
-s, at CC@,$CC,;t t
-s, at CFLAGS@,$CFLAGS,;t t
-s, at LDFLAGS@,$LDFLAGS,;t t
-s, at CPPFLAGS@,$CPPFLAGS,;t t
-s, at ac_ct_CC@,$ac_ct_CC,;t t
-s, at EXEEXT@,$EXEEXT,;t t
-s, at OBJEXT@,$OBJEXT,;t t
-s, at CPP@,$CPP,;t t
-s, at RANLIB@,$RANLIB,;t t
-s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s, at INSTALL_DATA@,$INSTALL_DATA,;t t
-s, at LN_S@,$LN_S,;t t
-s, at YACC@,$YACC,;t t
-s, at LEX@,$LEX,;t t
-s, at AR@,$AR,;t t
-s, at PERL@,$PERL,;t t
-s, at LD@,$LD,;t t
-s, at THLDFLAGS@,$THLDFLAGS,;t t
-s, at THLIBS@,$THLIBS,;t t
-s, at EGREP@,$EGREP,;t t
-s, at SP_MAJOR_VERSION@,$SP_MAJOR_VERSION,;t t
-s, at SP_MINOR_VERSION@,$SP_MINOR_VERSION,;t t
-s, at SP_PATCH_VERSION@,$SP_PATCH_VERSION,;t t
-s, at NROFF@,$NROFF,;t t
-s, at MANTYPE@,$MANTYPE,;t t
-s, at mansubdir@,$mansubdir,;t t
-s, at piddir@,$piddir,;t t
-s, at docdir@,$docdir,;t t
-s, at SHCC@,$SHCC,;t t
-s, at SHCFLAGS@,$SHCFLAGS,;t t
-s, at SHCPPFLAGS@,$SHCPPFLAGS,;t t
-s, at SHLD@,$SHLD,;t t
-s, at SHLDFLAGS@,$SHLDFLAGS,;t t
-s, at SHLIBS@,$SHLIBS,;t t
-s, at LIBSPSO@,$LIBSPSO,;t t
-s, at LIBSPCORESO@,$LIBSPCORESO,;t t
-s, at LIBTSPCORESO@,$LIBTSPCORESO,;t t
-s, at SHLDOPTION@,$SHLDOPTION,;t t
-s, at SHLDNAME@,$SHLDNAME,;t t
-s, at SHLDCONVERTSTATIC@,$SHLDCONVERTSTATIC,;t t
-s, at SHLDCONVERTSTATICEND@,$SHLDCONVERTSTATICEND,;t t
-s, at LIBOBJS@,$LIBOBJS,;t t
-s, at LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
 
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
 _ACEOF
 
-  cat >>$CONFIG_STATUS <<\_ACEOF
-  # Split the substitutions into bite-sized pieces for seds with
-  # small command number limits, like on Digital OSF/1 and HP-UX.
-  ac_max_sed_lines=48
-  ac_sed_frag=1 # Number of current file.
-  ac_beg=1 # First line for current file.
-  ac_end=$ac_max_sed_lines # Line after last line for current file.
-  ac_more_lines=:
-  ac_sed_cmds=
-  while $ac_more_lines; do
-    if test $ac_beg -gt 1; then
-      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    else
-      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    fi
-    if test ! -s $tmp/subs.frag; then
-      ac_more_lines=false
-    else
-      # The purpose of the label and of the branching condition is to
-      # speed up the sed processing (if there are no `@' at all, there
-      # is no need to browse any of the substitutions).
-      # These are the two extra sed commands mentioned above.
-      (echo ':t
-  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
-      if test -z "$ac_sed_cmds"; then
-	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-      else
-	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-      fi
-      ac_sed_frag=`expr $ac_sed_frag + 1`
-      ac_beg=$ac_end
-      ac_end=`expr $ac_end + $ac_max_sed_lines`
-    fi
-  done
-  if test -z "$ac_sed_cmds"; then
-    ac_sed_cmds=cat
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
-fi # test -n "$CONFIG_FILES"
+done
 
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS  :L $CONFIG_LINKS  "
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
   esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
 
-  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$ac_file" : 'X\(//\)[^/]' \| \
 	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
   ac_builddir=.
 
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
 
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
 
   case $INSTALL in
   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
   esac
+_ACEOF
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    configure_input=
-  else
-    configure_input="$ac_file.  "
-  fi
-  configure_input=$configure_input"Generated from `echo $ac_file_in |
-				     sed 's,.*/,,'` by configure."
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-  sed "$ac_vpsub
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
 $extrasub
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s, at configure_input@,$configure_input,;t t
-s, at srcdir@,$ac_srcdir,;t t
-s, at abs_srcdir@,$ac_abs_srcdir,;t t
-s, at top_srcdir@,$ac_top_srcdir,;t t
-s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s, at builddir@,$ac_builddir,;t t
-s, at abs_builddir@,$ac_abs_builddir,;t t
-s, at top_builddir@,$ac_top_builddir,;t t
-s, at abs_top_builddir@,$ac_abs_top_builddir,;t t
-s, at INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
-  rm -f $tmp/stdin
-  if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
-  else
-    cat $tmp/out
-    rm -f $tmp/out
-  fi
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
 
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
-ac_dB='[	 ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-	cat >$tmp/stdin
-	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
-  esac
-
-  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-	 # Absolute (can't be DOS-style, as IFS=:)
-	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 # Do quote $f, to prevent DOS paths from being IFS'd.
-	 echo "$f";;
-      *) # Relative
-	 if test -f "$f"; then
-	   # Build tree
-	   echo "$f"
-	 elif test -f "$srcdir/$f"; then
-	   # Source tree
-	   echo "$srcdir/$f"
-	 else
-	   # /dev/null tree
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-	 fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-  # Remove the trailing spaces.
-  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
-
-_ACEOF
-
-# Transform confdefs.h into two sed scripts, `conftest.defines' and
-# `conftest.undefs', that substitutes the proper values into
-# config.h.in to produce config.h.  The first handles `#define'
-# templates, and the second `#undef' templates.
-# And first: Protect against being on the right side of a sed subst in
-# config.status.  Protect against being in an unquoted here document
-# in config.status.
-rm -f conftest.defines conftest.undefs
-# Using a here document instead of a string reduces the quoting nightmare.
-# Putting comments in sed scripts is not portable.
-#
-# `end' is used to avoid that the second main sed command (meant for
-# 0-ary CPP macros) applies to n-ary macro definitions.
-# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
-s/[\\&,]/\\&/g
-s,[\\$`],\\&,g
-t clear
-: clear
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-t end
-s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-: end
-_ACEOF
-# If some macros were called several times there might be several times
-# the same #defines, which is useless.  Nevertheless, we may not want to
-# sort them, since we want the *last* AC-DEFINE to be honored.
-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
-rm -f confdef2sed.sed
-
-# This sed command replaces #undef with comments.  This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\_ACEOF
-s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
-
-# Break up conftest.defines because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
-echo '  :' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.defines >/dev/null
-do
-  # Write a limited-size here document to $tmp/defines.sed.
-  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#define' lines.
-  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
-  echo 'CEOF
-  sed -f $tmp/defines.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
-  rm -f conftest.defines
-  mv conftest.tail conftest.defines
-done
-rm -f conftest.defines
-echo '  fi # grep' >>$CONFIG_STATUS
-echo >>$CONFIG_STATUS
-
-# Break up conftest.undefs because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.undefs >/dev/null
-do
-  # Write a limited-size here document to $tmp/undefs.sed.
-  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#undef'
-  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
-  echo 'CEOF
-  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
-  rm -f conftest.undefs
-  mv conftest.tail conftest.undefs
-done
-rm -f conftest.undefs
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    echo "/* Generated by configure.  */" >$tmp/config.h
-  else
-    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
-  fi
-  cat $tmp/in >>$tmp/config.h
-  rm -f $tmp/in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
   if test x"$ac_file" != x-; then
-    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
-      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
-      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-      { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-      rm -f $ac_file
-      mv $tmp/config.h $ac_file
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
-    cat $tmp/config.h
-    rm -f $tmp/config.h
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
   fi
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+ ;;
+  :L)
+  #
+  # CONFIG_LINK
+  #
 
-#
-# CONFIG_LINKS section.
-#
+  if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
+    :
+  else
+    # Prefer the file from the source tree if names are identical.
+    if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
+      ac_source=$srcdir/$ac_source
+    fi
 
-for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue
-  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
-  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
+$as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
 
-  { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_dest" >&5
-echo "$as_me: linking $srcdir/$ac_source to $ac_dest" >&6;}
+    if test ! -r "$ac_source"; then
+      as_fn_error $? "$ac_source: file not found" "$LINENO" 5
+    fi
+    rm -f "$ac_file"
 
-  if test ! -r $srcdir/$ac_source; then
-    { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5
-echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;}
-   { (exit 1); exit 1; }; }
+    # Try a relative symlink, then a hard link, then a copy.
+    case $ac_source in
+    [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
+	*) ac_rel_source=$ac_top_build_prefix$ac_source ;;
+    esac
+    ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
+      ln "$ac_source" "$ac_file" 2>/dev/null ||
+      cp -p "$ac_source" "$ac_file" ||
+      as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
   fi
-  rm -f $ac_dest
+ ;;
 
-  # Make relative symlinks.
-  ac_dest_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_dest" : 'X\(//\)[^/]' \| \
-	 X"$ac_dest" : 'X\(//\)$' \| \
-	 X"$ac_dest" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dest_dir"
-  else
-    as_dir="$ac_dest_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dest_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dest_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-  ac_builddir=.
-
-if test "$ac_dest_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dest_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dest_dir";;
-*)
-  case "$ac_dest_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dest_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dest_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
-
-
-  case $srcdir in
-  [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;;
-      *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;;
   esac
 
-  # Try a symlink, then a hard link, then a copy.
-  ln -s $ac_rel_source $ac_dest 2>/dev/null ||
-    ln $srcdir/$ac_source $ac_dest 2>/dev/null ||
-    cp -p $srcdir/$ac_source $ac_dest ||
-    { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&5
-echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&2;}
-   { (exit 1); exit 1; }; }
-done
-_ACEOF
+done # for ac_tag
 
-cat >>$CONFIG_STATUS <<\_ACEOF
 
-{ (exit 0); exit 0; }
+as_fn_exit 0
 _ACEOF
-chmod +x $CONFIG_STATUS
 ac_clean_files=$ac_clean_files_save
 
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
 
+
 # configure is writing to config.log, and then calls config.status.
 # config.status does its own redirection, appending to config.log.
 # Unfortunately, on DOS this fails, as config.log is still kept open
@@ -10867,7 +8035,7 @@
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
-  $ac_cs_success || { (exit 1); exit 1; }
+  $ac_cs_success || as_fn_exit 1
 fi
 
 #
@@ -10875,10 +8043,14 @@
 #
 if test "$no_recursion" != yes; then
 
-  # Remove --cache-file and --srcdir arguments so they do not pile up.
+  # Remove --cache-file, --srcdir, and --disable-option-checking arguments
+  # so they do not pile up.
   ac_sub_configure_args=
   ac_prev=
-  for ac_arg in $ac_configure_args; do
+  eval "set x $ac_configure_args"
+  shift
+  for ac_arg
+  do
     if test -n "$ac_prev"; then
       ac_prev=
       continue
@@ -10901,126 +8073,92 @@
       ac_prev=prefix ;;
     -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
       ;;
-    *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
+    --disable-option-checking)
+      ;;
+    *)
+      case $ac_arg in
+      *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      esac
+      as_fn_append ac_sub_configure_args " '$ac_arg'" ;;
     esac
   done
 
   # Always prepend --prefix to ensure using the same prefix
   # in subdir configurations.
-  ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args"
+  ac_arg="--prefix=$prefix"
+  case $ac_arg in
+  *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+  esac
+  ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
 
+  # Pass --silent
+  if test "$silent" = yes; then
+    ac_sub_configure_args="--silent $ac_sub_configure_args"
+  fi
+
+  # Always prepend --disable-option-checking to silence warnings, since
+  # different subdirs can have different --enable and --with options.
+  ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
+
   ac_popdir=`pwd`
   for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
 
     # Do not complain, so a configure script can configure whichever
     # parts of a large source tree are present.
-    test -d $srcdir/$ac_dir || continue
+    test -d "$srcdir/$ac_dir" || continue
 
-    { echo "$as_me:$LINENO: configuring in $ac_dir" >&5
-echo "$as_me: configuring in $ac_dir" >&6;}
-    { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| \
-	 .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
+    ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
+    $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5
+    $as_echo "$ac_msg" >&6
+    as_dir="$ac_dir"; as_fn_mkdir_p
     ac_builddir=.
 
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
 
+    cd "$ac_dir"
 
-    cd $ac_dir
-
     # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'"
-    elif test -f $ac_srcdir/configure; then
-      ac_sub_configure="$SHELL '$ac_srcdir/configure'"
-    elif test -f $ac_srcdir/configure.in; then
-      ac_sub_configure=$ac_configure
+    if test -f "$ac_srcdir/configure.gnu"; then
+      ac_sub_configure=$ac_srcdir/configure.gnu
+    elif test -f "$ac_srcdir/configure"; then
+      ac_sub_configure=$ac_srcdir/configure
+    elif test -f "$ac_srcdir/configure.in"; then
+      # This should be Cygnus configure.
+      ac_sub_configure=$ac_aux_dir/configure
     else
-      { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5
-echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5
+$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
       ac_sub_configure=
     fi
 
@@ -11029,23 +8167,25 @@
       # Make the cache file name correct relative to the subdirectory.
       case $cache_file in
       [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
-      *) # Relative path.
-	ac_sub_cache_file=$ac_top_builddir$cache_file ;;
+      *) # Relative name.
+	ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
       esac
 
-      { echo "$as_me:$LINENO: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
-echo "$as_me: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
+$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
       # The eval makes quoting arguments work.
-      eval $ac_sub_configure $ac_sub_configure_args \
-	   --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir ||
-	{ { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5
-echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;}
-   { (exit 1); exit 1; }; }
+      eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
+	   --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
+	as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5
     fi
 
-    cd $ac_popdir
+    cd "$ac_popdir"
   done
 fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
 
 
 # Print summary of options

Modified: trunk/configure.in
===================================================================
--- trunk/configure.in	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/configure.in	2016-11-14 17:40:56 UTC (rev 861)
@@ -1,4 +1,4 @@
-AC_INIT(Spread, 4.4.0)
+AC_INIT(Spread, 5.0.0)
 
 AC_CONFIG_AUX_DIR(buildtools)
 AC_CONFIG_HEADERS(daemon/config.h)
@@ -106,10 +106,10 @@
 AC_FUNC_STRFTIME
 
 # Checks for header files.
-AC_CHECK_HEADERS(arpa/inet.h assert.h errno.h grp.h limits.h netdb.h netinet/in.h netinet/tcp.h process.h pthread.h pwd.h signal.h stdarg.h stdint.h stdio.h stdlib.h string.h sys/inttypes.h sys/ioctl.h sys/param.h sys/socket.h sys/stat.h sys/time.h sys/timeb.h sys/types.h sys/uio.h sys/un.h sys/filio.h time.h unistd.h windows.h winsock.h)
+AC_CHECK_HEADERS(arpa/inet.h assert.h errno.h grp.h limits.h netdb.h netinet/in.h netinet/tcp.h process.h pthread.h pwd.h signal.h stdarg.h stdint.h stdio.h stdlib.h string.h sys/inttypes.h sys/ioctl.h sys/param.h sys/socket.h sys/stat.h sys/time.h sys/timeb.h sys/types.h sys/uio.h sys/un.h sys/filio.h time.h unistd.h windows.h winsock2.h ifaddrs.h)
 
 dnl    Checks for library functions.
-AC_CHECK_FUNCS(bcopy inet_aton inet_ntoa inet_ntop memmove setsid snprintf strerror lrand48)
+AC_CHECK_FUNCS(bcopy inet_aton inet_ntoa inet_ntop memmove setsid snprintf strerror lrand48 getifaddrs)
 dnl    Checks for time functions
 AC_CHECK_FUNCS(gettimeofday time)
 
@@ -427,7 +427,6 @@
 	AC_DEFINE(HAVE_SA_FAMILY_T, 1, sa_family_t type)
 fi
 
-
 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
 	AC_TRY_COMPILE(
 		[
@@ -502,6 +501,22 @@
 	have_struct_timeval=1
 fi
 
+AC_CACHE_CHECK([for sa_len field in struct sockaddr],
+		ac_cv_have_sa_len_in_struct_sockaddr, [
+	AC_TRY_COMPILE(
+		[
+#include <sys/types.h>
+#include <sys/socket.h>
+		],
+		[ struct sockaddr s; s.sa_len = 1; ],
+		[ ac_cv_have_sa_len_in_struct_sockaddr="yes" ],
+		[ ac_cv_have_sa_len_in_struct_sockaddr="no" ],
+	)
+])
+if test "x$ac_cv_have_sa_len_in_struct_sockaddr" = "xyes" ; then
+	AC_DEFINE(HAVE_SA_LEN_IN_SOCKADDR, 1, sockaddr type has sa_len field)
+fi
+
 AC_CACHE_CHECK([for sun_len field in struct sockaddr_un],
 		ac_cv_have_sun_len_in_struct_sockaddr_un, [
 	AC_TRY_COMPILE(
@@ -604,7 +619,6 @@
 	AC_DEFINE(HAVE_SYS_ERRLIST, 1, sys_errlist structure)
 fi
 
-
 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
 	AC_TRY_LINK([], 
 		[ extern int sys_nerr; printf("%i", sys_nerr);], 

Modified: trunk/daemon/Makefile.in
===================================================================
--- trunk/daemon/Makefile.in	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/Makefile.in	2016-11-14 17:40:56 UTC (rev 861)
@@ -83,11 +83,11 @@
 spread$(EXEEXT): $(SPREADOBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a ../stdutil/lib/libstdutil-threaded-release.a
 	$(LD) -o $@ $(LDFLAGS) $(SPREADOBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a ../stdutil/lib/libstdutil-threaded-release.a $(LIBS)
 
-spmonitor$(EXEEXT): $(MONITOR_OBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
-	$(LD) -o $@ $(LDFLAGS) $(MONITOR_OBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a $(LIBS)
+spmonitor$(EXEEXT): $(MONITOR_OBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a ../stdutil/lib/libstdutil-threaded-release.a
+	$(LD) -o $@ $(LDFLAGS) $(MONITOR_OBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a ../stdutil/lib/libstdutil-threaded-release.a $(LIBS)
 
-sptmonitor$(EXEEXT): $(TMONITOR_OBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a
-	$(LD) $(THLDFLAGS) -o $@ $(TMONITOR_OBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a $(THLIBS)
+sptmonitor$(EXEEXT): $(TMONITOR_OBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a ../stdutil/lib/libstdutil-threaded-release.a
+	$(LD) $(THLDFLAGS) -o $@ $(TMONITOR_OBJS) $(LIBSPREADUTIL_DIR)/lib/libspread-util.a ../stdutil/lib/libstdutil-threaded-release.a $(THLIBS)
 
 testprog: spsend$(EXEEXT) sprecv$(EXEEXT)
 

Modified: trunk/daemon/arch.h
===================================================================
--- trunk/daemon/arch.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/arch.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -63,152 +63,169 @@
 #ifndef ARCH_PC_WIN95
 /* If we aren't using windows... we can use autoconf */
 
-#include "config.h"
+#  include "config.h"
 
-
-#ifdef WORDS_BIGENDIAN
-#define         ARCH_ENDIAN     0x00000000
-#else
-#define		ARCH_ENDIAN	0x80000080
-#endif
+#  ifdef WORDS_BIGENDIAN
+#    define ARCH_ENDIAN 0x00000000
+#  else
+#    define ARCH_ENDIAN 0x80000080
+#  endif
   
-#define         LOC_INLINE      __inline__
+#  define         LOC_INLINE      __inline__
   
-#ifndef __GNUC__
-#define __inline__ inline
-#endif
+#  ifndef __GNUC__
+#    define __inline__ inline
+#  endif
 
 /* Need to add special cases, SUNOS gets 64, IRIX gets 512 */  
-#ifdef MSG_MAXIOVLEN
-#define         ARCH_SCATTER_SIZE       MSG_MAXIOVLEN
-#else
-#define         ARCH_SCATTER_SIZE       1024
-#endif
+#  ifdef MSG_MAXIOVLEN
+#    define         ARCH_SCATTER_SIZE       MSG_MAXIOVLEN
+#  else
+#    define         ARCH_SCATTER_SIZE       1024
+#  endif
 
-#define         HAVE_GOOD_VARGS
+#  define         HAVE_GOOD_VARGS
   
-#ifndef ERR_TIMEDOUT
-#define         ERR_TIMEDOUT    ETIMEDOUT
-#endif
+#  ifndef ERR_TIMEDOUT
+#    define         ERR_TIMEDOUT    ETIMEDOUT
+#  endif
   
-#ifndef RAND_MAX
-#define         RAND_MAX        2147483647
-#endif
+#  ifndef RAND_MAX
+#    define         RAND_MAX        2147483647
+#  endif
   
-#define         sock_errno      errno
-#define         sock_strerror   strerror
-#define         sock_set_errno(a)   (errno = (a)) 
+#  define         sock_errno         errno
+#  define         sock_strerror      strerror
+#  define         sock_set_errno(a)  (errno = (a))
+#  define         GAI_STRERROR(e)    gai_strerror(e)
   
-#ifndef byte
-#define byte u_int8_t
-#endif
+#  ifndef byte
+#    define byte u_int8_t
+#  endif
 
-#ifndef int16
-#define int16 int16_t
-#endif
+#  ifndef int16
+#    define int16 int16_t
+#  endif
 
-#ifndef int16u
-#define int16u u_int16_t
-#endif
+#  ifndef int16u
+#    define int16u u_int16_t
+#  endif
 
-#ifndef int32
-#define int32 int32_t
-#endif
+#  ifndef int32
+#    define int32 int32_t
+#  endif
 
-#ifndef int32u
-#define int32u u_int32_t
-#endif
+#  ifndef int32u
+#    define int32u u_int32_t
+#  endif
+
+#  ifndef INVALID_SOCKET
+#    define INVALID_SOCKET (-1)
+#  elif INVALID_SOCKET != -1
+#    error "INVALID_SOCKET must be -1!"
+#  endif
   
-#else
+#else /* ARCH_PC_WIN95 */
+
 /* We are using windows... */
-#define         INTSIZE32
-#define		ARCH_SCATTER_NONE
-#define		ARCH_ENDIAN	0x80000080
-#define         LOC_INLINE      
-#define         BADCLOCK
-#define         HAVE_GOOD_VARGS
+
+/* Windows defines a default FD_SETSIZE of 64. However, the size of
+ * fd_set array for select can be raised by defining a larger constant
+ * before including windows headers.
+ */
+#  define         FD_SETSIZE      1024
+
+#  include <winsock2.h>
+#  include <ws2tcpip.h>   /* after definition of FD_SETSIZE! */
+
+#  define         INTSIZE32
+#  define         ARCH_SCATTER_NONE
+#  define         ARCH_ENDIAN        0x80000080
+#  define         LOC_INLINE      
+#  define         BADCLOCK
+#  define         HAVE_GOOD_VARGS
 /* Windows now has a strerror function and if we do not use it 
  * compile errors occur with shared DLL libraries. 
  */
-#define         HAVE_STRERROR
+#  define         HAVE_STRERROR
 /* This size is for packing several messages into one packet */
-#define         ARCH_SCATTER_SIZE       64
-#define         ERR_TIMEDOUT    EAGAIN
-#define         sock_errno      WSAGetLastError()
-#define         sock_set_errno  WSASetLastError
-#define         MAXPATHLEN      _MAX_PATH
-#define         snprintf        _snprintf
-#define         alloca          _alloca
-#define         strdup          _strdup
-#define         fileno          _fileno
+#  define         ARCH_SCATTER_SIZE  64
+#  define         ERR_TIMEDOUT       EAGAIN
+#  define         sock_errno         WSAGetLastError()
+#  define         sock_set_errno(a)  WSASetLastError(a)
+#  define         GAI_STRERROR(e)    sock_strerror(e)
+/* NOTE: this whole approach is dangerous as it could rewrite system headers too causing compile conflicts, linking errors, etc. */
+#  define         MAXPATHLEN         _MAX_PATH
+#  define         alloca             _alloca
+#  define         strdup             _strdup
+#  define         fileno             _fileno
 /* Sockets are not file descriptors on windows so they need a special close function. */
-#define         close           closesocket
-/* Windows defines a default size of 64. However, the size of fd_set array for select
- * can be raised by defining a larger constant before including windows.h winsock.h
- */
-#define         FD_SETSIZE      1024
+/* TODO: probably should do it the opposite way; 
+   on *nix define closesocket to be close and then use closesocket on sockets;
+   that way we don't lose access to close() on windows
+*/
+#  define         close              closesocket
 
-#include <ws2tcpip.h>   /* after definition of FD_SETSIZE! */
-
-#define         HAVE_SOCKLEN_T 1
+#  define         HAVE_SOCKLEN_T 1
 typedef         int             sockopt_len_t;
 
 /* System location of spread.conf file */
-#define         SPREAD_ETCDIR   "/etc"
+#  define         SPREAD_ETCDIR   "/etc"
 /* Use winsock constants since we are dealing with sockets
  * Note: If we ever need file IO with errno's we will have conflicts
  * since the WSA version and the basic E versions may not have the same
  * number. Right now we don't need the E versions for windows so we just
  * use the WSA versions.
  */
-#undef EINTR
-#undef EAGAIN
-#undef EWOULDBLOCK
-#undef EINPROGRESS
-#define EWOULDBLOCK WSAEWOULDBLOCK
-#define EINTR       WSAEINTR
-#define EAGAIN      WSAEWOULDBLOCK
-#define EINPROGRESS WSAEINPROGRESS
+#  undef EINTR
+#  undef EAGAIN
+#  undef EWOULDBLOCK
+#  undef EINPROGRESS
+#  define EINTR       WSAEINTR
+#  define EAGAIN      WSAEWOULDBLOCK
+#  define EWOULDBLOCK WSAEWOULDBLOCK
+#  define EINPROGRESS WSAEINPROGRESS
 
 /* Windows does not define MAXHOSTNAMELEN, so we define it here to a reasonable host name limit */
-#define MAXHOSTNAMELEN 128
+#  define MAXHOSTNAMELEN 128
 
 /* byte is already defined as a typedef to unsigned char on Windows XP (and probably earlier) so do not define 
- * #ifndef byte
- * #define byte unsigned char
- * #endif
+ * #  ifndef byte
+ * #    define byte unsigned char
+ * #  endif
  */
 
-#ifndef int16
-#  define int16 short
-#endif
+#  ifndef int16
+#    define int16 short
+#  endif
 
-#ifndef int16u
-#  define int16u unsigned short
-#endif
+#  ifndef int16u
+#    define int16u unsigned short
+#  endif
 
-#ifndef int32
-#  define int32 int
-#endif
+#  ifndef int32
+#    define int32 int
+#  endif
 
-#ifndef int32u
-#  define int32u unsigned int
-#endif
+#  ifndef int32u
+#    define int32u unsigned int
+#  endif
 
-#ifndef UINT32_MAX
-#  define         UINT32_MAX      UINT_MAX
-#endif
+#  ifndef UINT32_MAX
+#    define         UINT32_MAX      UINT_MAX
+#  endif
 
-#ifndef INT32_MAX
-#  define         INT32_MAX       INT_MAX
-#endif
+#  ifndef INT32_MAX
+#    define         INT32_MAX       INT_MAX
+#  endif
 
 /* Declare functions from arch.c */
-char    *sock_strerror(int err);
+char *sock_strerror(int err);
 
 #endif /* ARCH_PC_WIN95 */
 
 /* Pick which rand version to use */
+
 #ifdef HAVE_LRAND48
 #  define get_rand lrand48
 #  define set_rand srand48
@@ -221,37 +238,43 @@
 #define Q(x)    # x
 #define QQ(x)   Q(x)
 
+#define SPLOC   __FILE__ ":" QQ(__LINE__)
 
 #define         ENDIAN_TYPE             0x80000080
 
-#define		Get_endian( type )	( (type) &  ENDIAN_TYPE )
-#define		Set_endian( type )	( ( (type) & ~ENDIAN_TYPE )| ARCH_ENDIAN )
-#define		Same_endian( type )	( ( (type) & ENDIAN_TYPE ) == ARCH_ENDIAN )
-#define		Clear_endian( type )	( (type) & ~ENDIAN_TYPE )
+#define		Get_endian( t )         ( (t) &  ENDIAN_TYPE )
+#define		Set_endian( t )         ( ( (t) & ~ENDIAN_TYPE ) | ARCH_ENDIAN )
+#define		Same_endian( t )        ( ( (t) & ENDIAN_TYPE ) == ARCH_ENDIAN )
+#define		Clear_endian( t )       ( (t) & ~ENDIAN_TYPE )
 
-#define		Flip_int16( type )	( ( ((type) >> 8) & 0x00ff) | ( ((type) << 8) & 0xff00) )
+#define		Flip_int16( t )	        ( ( ( (t) >> 8 ) & 0x00ff ) | ( ( (t) << 8 ) & 0xff00 ) )
+#define		Flip_int32( t )	        ( ( ( (t) >> 24 ) & 0x000000ff ) | ( ( (t) >> 8 ) & 0x0000ff00 ) | ( ( (t) << 8 ) & 0x00ff0000 ) | ( ( (t) << 24 ) & 0xff000000 ) )
 
-#define		Flip_int32( type )	( ( ((type) >>24) & 0x000000ff) | ( ((type) >> 8) & 0x0000ff00) | ( ((type) << 8) & 0x00ff0000) | ( ((type) <<24) & 0xff000000) )
-
 #define		channel			int
 #define		mailbox			int
 
-typedef	struct	dummy_membership_id {
+typedef	struct
+{
 	int32	proc_id;
 	int32	time;
+
 } membership_id;
 
-typedef struct	dummy_group_id {
+typedef struct
+{
 	membership_id	memb_id;
 	int32		index;
+  
 } group_id;
 
 /* 
  * General Useful Types
  */
 
+#include "spu_addr.h"
+
 #ifndef __cplusplus
-typedef         short           bool;
+typedef         int             bool;
 #endif
 #ifndef TRUE
 #define         TRUE            1

Modified: trunk/daemon/auth-ip.c
===================================================================
--- trunk/daemon/auth-ip.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/auth-ip.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -50,6 +50,11 @@
 #include <stdlib.h>
 #include <string.h>
 
+/* NOTE: 
+ *
+ * This module ONLY SUPPORTS IPv4. It has not been updated to do authentication for IPv6 addresses as well.  It will reject non-IPv4 connections it checks.
+ */
+
 /* ACM callbacks */
 void ip_auth_client_connection(struct session_auth_info *sess_auth_p);
 void ip_auth_monitor_connection(mailbox mbox, int32 ip_addr);
@@ -177,40 +182,49 @@
     new_rule->next = Allow_Rules;
     Allow_Rules = new_rule;
 }
+
 void ip_auth_client_connection(struct session_auth_info *sess_auth_p)
 {
     int32u client_ip, client_net;
     struct ip_rule *rule_p;
-    bool allowed;
+    bool allowed = FALSE;
     int ses;
 
     if (! IP_File_Loaded )
     {
-        Alarmp( SPLOG_CRITICAL, ACM,  "ip_open_connection: No spread.access_ip file loaded. NO connections will be allowed!\nYou probably don't want this!!\n");
+        Alarmp( SPLOG_PRINT, ACM,  "ip_open_connection: No spread.access_ip file loaded. NO connections will be allowed!\nYou probably don't want this!!\n");
         Sess_session_report_auth_result( sess_auth_p, FALSE );
         return;
     }
+    
     ses = Sess_get_session_index (sess_auth_p->mbox);
-    client_ip = Sessions[ses].address;
-    rule_p = Allow_Rules;
-    allowed = FALSE;
-    /* Search allowed lists */
-    while(rule_p)
+
+    if (spu_addr_family(&Sessions[ses].addr) == AF_INET)
     {
+      client_ip = ntohl(Sessions[ses].addr.ipv4.sin_addr.s_addr);
+      rule_p = Allow_Rules;
+      /* Search allowed lists */
+      while(rule_p)
+      {
         Alarmp(SPLOG_INFO, ACM, "ip_open_connection: client_ip: %d.%d.%d.%d, prefix: %d premask: 0x%x mask: 0x%x\n",
-              IP1(client_ip), IP2(client_ip), IP3(client_ip), IP4(client_ip), rule_p->prefix_length, ~0x0,
-              ( (~0x0) << (32 - rule_p->prefix_length)) );
+               IP1(client_ip), IP2(client_ip), IP3(client_ip), IP4(client_ip), rule_p->prefix_length, ~0x0,
+               ( (~0x0) << (32 - rule_p->prefix_length)) );
+        
         client_net = (client_ip & ( (~0x0) << (32 - rule_p->prefix_length)));
+        
         Alarmp(SPLOG_INFO, ACM, "ip_open_connection: comparing network %d.%d.%d.%d with client %d.%d.%d.%d\n",
-              IP1(rule_p->network_address), IP2(rule_p->network_address), IP3(rule_p->network_address), 
-              IP4(rule_p->network_address), IP1(client_net),IP2(client_net),IP3(client_net),IP4(client_net) );
+               IP1(rule_p->network_address), IP2(rule_p->network_address), IP3(rule_p->network_address), 
+               IP4(rule_p->network_address), IP1(client_net),IP2(client_net),IP3(client_net),IP4(client_net) );
+        
         if (rule_p->network_address == client_net)
         {
-            allowed = TRUE;
-            break;
+          allowed = TRUE;
+          break;
         }
         rule_p = rule_p->next;
+      }
     }
+    
     if (allowed)
         Sess_session_report_auth_result( sess_auth_p, TRUE );
     else 

Modified: trunk/daemon/auth-pword-client.c
===================================================================
--- trunk/daemon/auth-pword-client.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/auth-pword-client.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -53,7 +53,7 @@
 
 #else   /* ARCH_PC_WIN95 */
 
-#include <winsock.h>
+#include <winsock2.h>
 
 #endif  /* ARCH_PC_WIN95 */
 

Modified: trunk/daemon/auth-pword.c
===================================================================
--- trunk/daemon/auth-pword.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/auth-pword.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -65,7 +65,7 @@
 
 #else   /* ARCH_PC_WIN95 */
 
-#include <winsock.h>
+#include <winsock2.h>
 #define	ioctl 	ioctlsocket
 
 #endif  /* ARCH_PC_WIN95 */

Modified: trunk/daemon/conf_body.h
===================================================================
--- trunk/daemon/conf_body.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/conf_body.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -33,7 +33,6 @@
  *
  */
 
-
 /* 
  *
  * $Id$
@@ -58,41 +57,25 @@
 
 ext     configuration	*Config;
 ext     FILE		*yyin;
-ext     int       LinkWeights[MAX_SEGMENTS][MAX_SEGMENTS];
 
-#define MAX_CONF_STRING 20000
-ext     char            ConfStringRep[MAX_CONF_STRING];
-ext     int             ConfStringLen;
-
-/* For network protocols used in Spread 4 */
-#define HOP_PROT        1
-#define RING_PROT       2
-#define TCP_PROT        3
-#define MAX_PROTOCOLS   3
-
 #define YYSTYPE YYSTYPE
 
-#ifndef	ARCH_PC_WIN95
+typedef struct
+{
+  spu_addr    ipaddr;
+  char       *ipstr;
+  
+} conf_ipaddr;
 
-#include <netinet/in.h>
-
-#else 	/* ARCH_PC_WIN95 */
-
-#include <winsock.h>
-
-#endif	/* ARCH_PC_WIN95 */
-
-typedef union {
-  bool boolean;
-  int32 mask;
-  int number;
-  int cost[MAX_SEGMENTS];
-  struct {
-    struct in_addr addr;
-    unsigned short port;
-  } ip;
-  char *string;
+typedef union
+{
+  bool        boolean;
+  int32       mask;
+  int         number;
+  conf_ipaddr addr;  
+  char       *string;
 } YYSTYPE;
+
 extern YYSTYPE yylval;
 extern int yysemanticerr;
 

Modified: trunk/daemon/config.h.in
===================================================================
--- trunk/daemon/config.h.in	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/config.h.in	2016-11-14 17:40:56 UTC (rev 861)
@@ -37,12 +37,18 @@
 /* Define to 1 if you have the <errno.h> header file. */
 #undef HAVE_ERRNO_H
 
+/* Define to 1 if you have the `getifaddrs' function. */
+#undef HAVE_GETIFADDRS
+
 /* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
 /* Define to 1 if you have the <grp.h> header file. */
 #undef HAVE_GRP_H
 
+/* Define to 1 if you have the <ifaddrs.h> header file. */
+#undef HAVE_IFADDRS_H
+
 /* Define to 1 if you have the `inet_aton' function. */
 #undef HAVE_INET_ATON
 
@@ -118,6 +124,9 @@
 /* sa_family_t type */
 #undef HAVE_SA_FAMILY_T
 
+/* sockaddr type has sa_len field */
+#undef HAVE_SA_LEN_IN_SOCKADDR
+
 /* Define to 1 if you have the `setsid' function. */
 #undef HAVE_SETSID
 
@@ -253,8 +262,8 @@
 /* Define to 1 if you have the <windows.h> header file. */
 #undef HAVE_WINDOWS_H
 
-/* Define to 1 if you have the <winsock.h> header file. */
-#undef HAVE_WINSOCK_H
+/* Define to 1 if you have the <winsock2.h> header file. */
+#undef HAVE_WINSOCK2_H
 
 /* Define if libc defines __progname */
 #undef HAVE___PROGNAME

Modified: trunk/daemon/config_gram.l
===================================================================
--- trunk/daemon/config_gram.l	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/config_gram.l	2016-11-14 17:40:56 UTC (rev 861)
@@ -33,41 +33,150 @@
  *
  */
 
-
-
 #include "arch.h"
 #include <string.h>
+#include <stdlib.h>
+#include <limits.h>
 
-#ifndef  ARCH_PC_WIN95
-#include <sys/types.h>
-#include <netinet/in.h>
+#ifndef ARCH_PC_WIN95
+#  include <sys/types.h>
+#  include <sys/socket.h>
+#  include <netdb.h>
+#  include <netinet/in.h>
+#  include <arpa/inet.h>
+#  include <net/if.h>
+#else
+#  include <winsock2.h>
+#  include <ws2tcpip.h>
+#  define YY_NO_UNISTD_H  /* Do not include unistd.h header in windows compiles */
+#endif
 
-#else /* ARCH_PC_WIN95 */
+#include "conf_body.h"
+#include "y.tab.h"
+#include "spu_alarm.h"
 
-#include <winsock.h>
-#define YY_NO_UNISTD_H  /* Do not include unistd.h header in windows compiles */
+/********************************************************************************
+ ********************************************************************************/
 
-#endif /* ARCH_PC_WIN95 */
+extern int  line_num;
+extern int  semantic_errors;
+extern void yyerror(const char *str);
+extern void yywarn(const char *str);
 
-#include "conf_body.h"
-#include "y.tab.h"
+/********************************************************************************
+ ********************************************************************************/
 
-extern int line_num;
-extern int semantic_errors;
-extern int yyerror(char *str);
-extern void yywarn(char *str);
+static int parse_ip(YYSTYPE *val, const char *ipstr, int family, bool hasport)
+{
+  struct in_addr  ipv4addr;
+  struct in6_addr ipv6addr;
+  char           *cpystr;
+  char           *addrstr;
+  void           *addrptr = NULL;
+  int             hasif   = FALSE;
+  char           *ifstr   = NULL;
+  long            port    = 0;
+  char           *portstr = NULL;
+  char           *endstr;
+  int             tmp;
+
+  if ((cpystr = addrstr = strdup(ipstr)) == NULL)
+    yyerror("parse_ip: strdup failed!");
+
+  switch (family)
+  {
+  case AF_INET:  addrptr = &ipv4addr;                                                    break;
+  case AF_INET6: addrptr = &ipv6addr; hasif = ((ifstr = strchr(addrstr, '%')) != NULL);  break;
+  default:       yyerror("parse_ip: Unexpected address family?!");                       break;
+  }
+  
+  if (hasport)
+  {
+    if ((portstr = strrchr(cpystr, ':')) == NULL)
+      yyerror("parse_ip: Missing ':' char in port spec?!");
+
+    errno = 0;
+    port  = strtol(portstr + 1, &endstr, 10);
+
+    if (port < 0 || port > 65535 || errno == ERANGE)
+      yyerror("parse_ip: Port out of valid range!");
+    
+    if (errno || endstr == portstr + 1 || *endstr != 0)
+      yyerror("parse_ip: Failure parsing port?!");
+    
+    *portstr = 0;           /* cut off port specification */
+
+    if (family == AF_INET6)
+    {
+      *(portstr - 1) = 0;   /* cut off enclosing bracket */
+      ++addrstr;            /* skip over opening bracket */
+    }
+  }
+
+  if (hasif)
+    *ifstr = 0;             /* cut off interface specification */
+  
+  if ((tmp = inet_pton(family, addrstr, addrptr)) == 0)
+  {
+    yywarn("parse_ip: Potentially malformed IP address scanned!");
+    free(cpystr);
+    return -1;
+  }
+  else if (tmp != 1)
+    yyerror("parse_ip: Error parsing IP address!");
+
+  memset(val, 0, sizeof(*val));
+
+  if (family == AF_INET)
+  {
+    val->addr.ipaddr.ipv4.sin_family = AF_INET;
+    val->addr.ipaddr.ipv4.sin_addr   = ipv4addr;
+    val->addr.ipaddr.ipv4.sin_port   = htons((int16u) port);
+  }
+  else
+  {
+    val->addr.ipaddr.ipv6.sin6_family = AF_INET6;
+    val->addr.ipaddr.ipv6.sin6_addr   = ipv6addr;
+    val->addr.ipaddr.ipv6.sin6_port   = htons((int16u) port);
+
+    if (hasif)
+    {
+      val->addr.ipaddr.ipv6.sin6_scope_id = if_nametoindex(ifstr + 1);
+      *ifstr = '%';           /* restore interface specification */
+    }
+    
+    if (hasport)
+      *(portstr - 1) = ']';   /* restore enclosing bracket */
+  }
+
+  if (hasport)
+    *portstr = ':';           /* restore port specification */
+
+  val->addr.ipstr = cpystr;
+
+  return 0;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+/* NOTE: string pattern doesn't allow brackets '[' ']' to prevent an ipv6 interface spec from trying to consume a trailing port specification */
+
 %}
-qstring \"[^\"]*\"|\'[^\']*\'
-string  [^ \t\r\n#{}]+
-true    [Tt][Rr][Uu][Ee]
-yes     [Yy][Ee][Ss]
-on      [Oo][Nn]
-false   [Ff][Aa][Ll][Ss][Ee]
-no      [Nn][Oo]
-off     [Oo][Ff][Ff]
-auto    [Aa][Uu][Tt][Oo]
-ipaddr  [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}
-ipport  [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}:[0-9]{1,5}
+qstring  \"[^\"]*\"|\'[^\']*\'
+string   [^ \t\r\n\v\f#{}\[\]]+
+true     [Tt][Rr][Uu][Ee]
+yes      [Yy][Ee][Ss]
+on       [Oo][Nn]
+false    [Ff][Aa][Ll][Ss][Ee]
+no       [Nn][Oo]
+off      [Oo][Ff][Ff]
+auto     [Aa][Uu][Tt][Oo]
+ipv4addr [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}
+ipv4port {ipv4addr}:[0-9]{1,5}
+quad     [0-9A-Fa-f]{1,4}
+ipv6addr ({quad}(:{quad}){7}|(({quad}:){0,6}{quad})?::({quad}(:{quad}){0,6})?)(%{string})?
+ipv6port "["{ipv6addr}"]":[0-9]{1,5}
 %option noyywrap
 %%
 #.*                             {} /* Comments */
@@ -77,7 +186,8 @@
 "}"                             { return CLOSEBRACE; }
 "="                             { return EQUALS; }
 ":"                             { return COLON; }
-!/.+ 				{ return BANG; }
+";"                             { return SEMICOLON; }
+!/.+                            { return BANG; }
 Spread_Segment                  { return SEGMENT; }
 EventLogFile                    { return EVENTLOGFILE; }
 EventTimeStamp                  { return EVENTTIMESTAMP; }
@@ -86,7 +196,6 @@
 DebugFlags                      { return DEBUGFLAGS; }
 DangerousMonitor                { return DANGEROUSMONITOR; }
 SocketPortReuse                 { return SOCKETPORTREUSE; }
-DebugInitialSequence            { return DEBUGINITIALSEQUENCE; }
 RuntimeDir                      { return RUNTIMEDIR; }
 DaemonUser                      { return SPUSER; }
 DaemonGroup                     { return SPGROUP; }
@@ -94,12 +203,9 @@
 AllowedAuthMethods              { return ALLOWEDAUTHMETHODS; }
 AccessControlPolicy             { return ACCESSCONTROLPOLICY; }
 MaxSessionMessages              { return MAXSESSIONMESSAGES; }
-LinkProtocol                    { return LINKPROTOCOL; }
-Hop                             { return PHOP; }
-TcpHop                          { return PTCPHOP; }
-RouteMatrix                     { return ROUTEMATRIX; }
-Window				{ return WINDOW; }
-PersonalWindow			{ return PERSONALWINDOW; }
+ActiveIPVersion                 { return ACTIVEIPVERSION; }
+Window                          { return WINDOW; }
+PersonalWindow                  { return PERSONALWINDOW; }
 AcceleratedRing                 { return ACCELERATEDRING; }
 AcceleratedWindow               { return ACCELERATEDWINDOW; }
 TokenTimeout                    { return TOKENTIMEOUT; }
@@ -111,118 +217,46 @@
 GatherTimeout                   { return GATHERTIMEOUT; }
 FormTimeout                     { return FORMTIMEOUT; }
 LookupTimeout                   { return LOOKUPTIMEOUT; }
-{true}|{yes}                    { yylval.boolean = TRUE; return SP_BOOL; }
-{false}|{no}                    { yylval.boolean = FALSE; return SP_BOOL; }
-{on}                            { yylval.number = 1; return SP_TRIVAL; }
-{off}                           { yylval.number = 0; return SP_TRIVAL; }
-{auto}                          { yylval.number = 2; return SP_TRIVAL; }
-DEBUG	 			{ yylval.mask = 0x00000001; return DDEBUG; }
-EXIT				{ yylval.mask = 0x00000002; return DEXIT; }
-PRINT				{ yylval.mask = 0x00000004; return DPRINT; }
-DATA_LINK			{ yylval.mask = 0x00000010; return DDATA_LINK; }
-NETWORK				{ yylval.mask = 0x00000020; return DNETWORK; }
-PROTOCOL			{ yylval.mask = 0x00000040; return DPROTOCOL; }
-SESSION				{ yylval.mask = 0x00000080; return DSESSION; }
-CONFIGURATION			{ yylval.mask = 0x00000100; return DCONF; }
-MEMBERSHIP			{ yylval.mask = 0x00000200; return DMEMB; }
-FLOW_CONTROL			{ yylval.mask = 0x00000400; return DFLOW_CONTROL; }
-STATUS				{ yylval.mask = 0x00000800; return DSTATUS; }
-EVENTS				{ yylval.mask = 0x00001000; return DEVENTS; }
-GROUPS				{ yylval.mask = 0x00002000; return DGROUPS; }
-MEMORY				{ yylval.mask = 0x00010000; return DMEMORY; }
-SKIPLIST			{ yylval.mask = 0x00200000; return DSKIPLIST; }
-ACM     			{ yylval.mask = 0x00400000; return DACM; }
-SECURITY     			{ yylval.mask = 0x00800000; return DSECURITY; }
-ALL				{ yylval.mask = 0xffffffff; return DALL; }
-NONE				{ yylval.mask = 0x00000000; return DNONE; }
+VirtualID                       { return VIRTUALID; }
+WideAreaNetwork                 { return WIDEAREANETWORK; }
+{true}|{yes}                    { yylval.boolean = TRUE;        return SP_BOOL; }
+{false}|{no}                    { yylval.boolean = FALSE;       return SP_BOOL; }
+{on}                            { yylval.number = 1;            return SP_TRIVAL; }
+{off}                           { yylval.number = 0;            return SP_TRIVAL; }
+{auto}                          { yylval.number = 2;            return SP_TRIVAL; }
+ALL                             { yylval.mask = ALL;            return DALL; }
+EXIT                            { yylval.mask = EXIT;           return DEXIT; }
+DATA_LINK                       { yylval.mask = DATA_LINK;      return DDATA_LINK; }
+MEMORY                          { yylval.mask = MEMORY;         return DMEMORY; }
+EVENTS                          { yylval.mask = EVENTS;         return DEVENTS; }
+PRINT                           { yylval.mask = PRINT;          return DPRINT; }
+NETWORK                         { yylval.mask = NETWORK;        return DNETWORK; }
+PROTOCOL                        { yylval.mask = PROTOCOL;       return DPROTOCOL; }
+SESSION                         { yylval.mask = SESSION;        return DSESSION; }
+CONFIGURATION                   { yylval.mask = CONF_SYS;       return DCONF; }
+MEMBERSHIP                      { yylval.mask = MEMB;           return DMEMB; }
+FLOW_CONTROL                    { yylval.mask = FLOW_CONTROL;   return DFLOW_CONTROL; }
+STATUS                          { yylval.mask = STATUS;         return DSTATUS; }
+DEBUG                           { yylval.mask = DEBUG;          return DDEBUG; }
+GROUPS                          { yylval.mask = GROUPS;         return DGROUPS; }
+SKIPLIST                        { yylval.mask = SKIPLIST;       return DSKIPLIST; }
+ACM                             { yylval.mask = ACM;            return DACM; }
+SECURITY                        { yylval.mask = SECURITY;       return DSECURITY; }
+NONE                            { yylval.mask = NONE;           return DNONE; }
 M                               { yylval.mask = IFTYPE_MONITOR; return IMONITOR; }
-C                               { yylval.mask = IFTYPE_CLIENT; return ICLIENT; }
-D                               { yylval.mask = IFTYPE_DAEMON; return IDAEMON; }
-pDEBUG                          { yylval.number = 1; return PDEBUG; }
-INFO                            { yylval.number = 2; return PINFO; }
-WARNING                         { yylval.number = 3; return PWARNING; }
-ERROR                           { yylval.number = 4; return PERROR; }
-CRITICAL                        { yylval.number = 5; return PCRITICAL; }
-FATAL                           { yylval.number = 6; return PFATAL; }
-
-{ipport}                        { struct in_addr inaddr;
-                                  int a1,a2,a3,a4,a5;
-                                  char *c1,*c2,*c3,*c4,*c5;
-                                  c1=strdup(yytext);
-                                  c2=strchr(c1, '.'); *(c2++)=0;
-                                  c3=strchr(c2, '.'); *(c3++)=0;
-                                  c4=strchr(c3, '.'); *(c4++)=0;
-                                  c5=strchr(c4, ':'); *(c5++)=0;
-                                  a1=atoi(c1); a2=atoi(c2);
-                                  a3=atoi(c3); a4=atoi(c4);
-                                  a5=atoi(c5);
-                                  free(c1);
-                                  if ((a1 < 0) || (a1 > 255) ||
-				      (a2 < 0) || (a2 > 255) ||
-				      (a3 < 0) || (a3 > 255) ||
-				      (a4 < 0) || (a4 > 255))
-                                    yyerror("Invalid IP");
-                                  inaddr.s_addr =
-                                      ((a1<<24)|(a2<<16)|(a3<<8)|a4);
-                                  yylval.ip.addr = inaddr;
-                                  yylval.ip.port = a5;
-                                  return IPADDR;
-                                }
-{ipaddr}                        { struct in_addr inaddr;
-                                  int a1,a2,a3,a4;
-                                  char *c1,*c2,*c3,*c4;
-                                  c1=strdup(yytext);
-                                  c2=strchr(c1, '.'); *(c2++)=0;
-                                  c3=strchr(c2, '.'); *(c3++)=0;
-                                  c4=strchr(c3, '.'); *(c4++)=0;
-                                  a1=atoi(c1); a2=atoi(c2);
-                                  a3=atoi(c3); a4=atoi(c4);
-                                  free(c1);
-                                  if ((a1 < 0) || (a1 > 255) ||
-				      (a2 < 0) || (a2 > 255) ||
-				      (a3 < 0) || (a3 > 255) ||
-				      (a4 < 0) || (a4 > 255))
-                                    yyerror("Invalid IP");
-                                  inaddr.s_addr =
-                                      ((a1<<24)|(a2<<16)|(a3<<8)|a4);
-                                  yylval.ip.addr = inaddr;
-                                  yylval.ip.port = 0;
-                                  return IPADDR;
-                                }
-[0-9]{1,6}                   {
-                                  yylval.number = atoi(yytext);
-                                  return NUMBER;
-                             }
-([0-9]{1,3}[ \t]*)+[ \t]*    { 
-                                  int fcost, i, done;
-                                  char *c;
-                                  char *ccur;
-                                  i = 0;
-                                  done = 0;
-                                  c = ccur = strdup(yytext);
-                                  while(!done) {
-                                          fcost = atoi(ccur);
-                                          if (fcost < 0) yyerror("Invalid Negative Cost");
-                                          if (fcost > 100) {
-                                                  yywarn("Cost clamped to 100");
-                                                  fcost = 100;
-                                          }
-                                          yylval.cost[i] = fcost;
-                                          i++;
-                                          ccur = strchr(ccur, ' '); 
-                                          if (ccur == NULL) done = 1;
-                                          else ccur++;
-                                  }
-                                  free(c);
-                                  for( ; i < MAX_SEGMENTS; i++) {
-                                          yylval.cost[i] = -1;
-                                  }
-                                  return LINKCOST;
-                                }
-{qstring}                       { int l = strlen(yytext);
-                                  yytext[l-1] = 0;
-                                  yylval.string = strdup(yytext+1);
-                                  return STRING; }
-{string}                        { yylval.string = strdup(yytext);
-                                  return STRING; }
+C                               { yylval.mask = IFTYPE_CLIENT;  return ICLIENT; }
+D                               { yylval.mask = IFTYPE_DAEMON;  return IDAEMON; }
+pDEBUG                          { yylval.number = 1;            return PDEBUG; }
+INFO                            { yylval.number = 2;            return PINFO; }
+WARNING                         { yylval.number = 3;            return PWARNING; }
+ERROR                           { yylval.number = 4;            return PERROR; }
+CRITICAL                        { yylval.number = 5;            return PCRITICAL; }
+FATAL                           { yylval.number = 6;            return PFATAL; }
+{ipv4addr}                      { if (parse_ip(&yylval, yytext, AF_INET,  FALSE)) { REJECT; } return IPADDR; }
+{ipv4port}                      { if (parse_ip(&yylval, yytext, AF_INET,  TRUE))  { REJECT; } return IPPORT; }
+{ipv6addr}                      { if (parse_ip(&yylval, yytext, AF_INET6, FALSE)) { REJECT; } return IPADDR; }
+{ipv6port}                      { if (parse_ip(&yylval, yytext, AF_INET6, TRUE))  { REJECT; } return IPPORT; }
+[0-9]{1,6}                      { yylval.number = atoi(yytext); return NUMBER; }
+{qstring}                       { if ((yylval.string = strdup(yytext + 1)) == NULL) { yyerror("strdup failed!"); } yylval.string[strlen(yylval.string) - 1] = 0; return STRING; }
+{string}                        { if ((yylval.string = strdup(yytext)) == NULL) { yyerror("strdup failed!"); } return STRING; }
 %%

Modified: trunk/daemon/config_parse.y
===================================================================
--- trunk/daemon/config_parse.y	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/config_parse.y	2016-11-14 17:40:56 UTC (rev 861)
@@ -33,13 +33,14 @@
  *
  */
 
-
-
 #include "arch.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <assert.h>
 
+#include <stdutil/stdutil.h>
+
 #ifndef ARCH_PC_WIN95
 #include <sys/types.h>
 #include <netdb.h>
@@ -50,7 +51,7 @@
 #include <sys/param.h>
 
 #else /* ARCH_PC_WIN95 */
-#include <winsock.h>
+#include <winsock2.h>
 #endif /* ARCH_PC_WIN95 */
 
 #include "spu_alarm.h"
@@ -60,291 +61,310 @@
 #include "conf_body.h"
 #include "acm.h"
 
-        int     line_num, semantic_errors;
- extern char    *yytext;
- extern int     yyerror(char *str);
- extern void    yywarn(char *str);
- extern int     yylex();
+#define PARSE_ERROR_STR     "----------- Parse Error -------------------\nError on or before line %d\nOffending token: %s\nError type: "
+#define PARSE_WARNING_STR   "----------- Parse Warning------------------\nWarning on or before line %d\nOffending token: %s\nWarning type: "
+  
+/********************************************************************************
+ ********************************************************************************/
 
- static int     num_procs = 0;
- static int     segment_procs = 0;
- static int     segments = 0;
- static int     rvec_num = 0;
- static int     procs_interfaces = 0;
+       int     line_num, semantic_errors;
+extern char   *yytext;
+extern void    yyerror(const char *str);
+extern void    yywarn(const char *str);
+extern int     yylex();
 
- static int     authentication_configured = 0;
+static int     num_procs = 0;
+static int     segment_procs = 0;
+static int     segment_addrs = 0;
+static int     segments = 0;
+static int     procs_interfaces = 0;
 
+static int     authentication_configured = 0;
+
 #define MAX_ALARM_FORMAT 40
- static char    alarm_format[MAX_ALARM_FORMAT];
- static int     alarm_precise = 0;
- static int     alarm_custom_format = 0;
+static char    alarm_format[MAX_ALARM_FORMAT];
+static int     alarm_precise = 0;
+static int     alarm_custom_format = 0;
+ 
+#define MAX_CONF_STRING 100000
 
-void    parser_init()
+static  char   ConfStringRep[MAX_CONF_STRING + 1];
+static  int    ConfStringLen;
+
+static  int    IPv4_configured;
+static  int    IPv6_configured;
+
+/********************************************************************************
+ ********************************************************************************/
+
+void parser_init()
 {
-    num_procs = 0;
-    segment_procs = 0;
-    segments = 0;
-    rvec_num = 0;
-    procs_interfaces = 0;
+    num_procs        = 0;
+    segment_procs    = 0;
+    segment_addrs    = 0;
+    segments         = 0;
+    procs_interfaces = 0;    
+    ConfStringRep[0] = 0;
+    ConfStringLen    = 0;
+    IPv4_configured  = 0;
+    IPv6_configured  = 0;
 }
 
-static char *segment2str(int seg) {
-  static char ipstr[40];
-  int id = Config->segments[seg].bcast_address;
-  sprintf(ipstr, "%d.%d.%d.%d:%d",
-  	(id & 0xff000000)>>24,
-  	(id & 0xff0000)>>16,
-  	(id & 0xff00)>>8,
-  	(id & 0xff),
-	Config->segments[seg].port);
-  return ipstr;
-}
-static void alarm_print_proc(proc *p, int port) {
-  if(port == p->port)
-    Alarm(CONF_SYS, "\t%20s: %d.%d.%d.%d\n", p->name,
-  	  (p->id & 0xff000000)>>24,
-  	  (p->id & 0xff0000)>>16,
-  	  (p->id & 0xff00)>>8,
-  	  (p->id & 0xff));
-  else
-    Alarm(CONF_SYS, "\t%20s: %d.%d.%d.%d:%d\n", p->name,
-  	  (p->id & 0xff000000)>>24,
-  	  (p->id & 0xff0000)>>16,
-  	  (p->id & 0xff00)>>8,
-  	  (p->id & 0xff),
-	  p->port);
-}
+/********************************************************************************
+ ********************************************************************************/
 
-static int32u name2ip(char *name) {
-  int anip, i1, i2, i3, i4;
-  struct hostent *host_ptr;
-
-  host_ptr = gethostbyname(name);
+static void expand_filename(char *out_string, int str_size, const char *in_string)
+{
+  const char *in_loc;
+  char       *out_loc;
+  char        hostn[MAXHOSTNAMELEN + 1];
   
-  if ( host_ptr == 0)
-    Alarm( EXIT, "Conf_init: no such host %s\n",
-	   name);
+  for (in_loc = in_string, out_loc = out_string; out_loc - out_string < str_size; ++in_loc)
+  {
+    if (*in_loc == '%')
+    {
+      switch (in_loc[1])
+      {
+      case 'h':
+      case 'H':
+        gethostname(hostn, sizeof(hostn));
+        out_loc += snprintf(out_loc, str_size - (out_loc - out_string), "%s", hostn); 
+        in_loc++;
+        continue;
+        
+      default:
+        break;
+      }
+    }
+    
+    *out_loc = *in_loc;
+    out_loc++;
+    
+    if (*in_loc == '\0')
+      break;
+  }
   
-  memcpy(&anip, host_ptr->h_addr_list[0], 
-	 sizeof(int32) );
-  anip = htonl( anip );
-  i1= ( anip & 0xff000000 ) >> 24;
-  i2= ( anip & 0x00ff0000 ) >> 16;
-  i3= ( anip & 0x0000ff00 ) >>  8;
-  i4=   anip & 0x000000ff;
-  return ((i1<<24)|(i2<<16)|(i3<<8)|i4);
+  out_string[str_size - 1] = '\0';
 }
 
-static  void expand_filename(char *out_string, int str_size, const char *in_string)
+/********************************************************************************
+ ********************************************************************************/
+
+static void set_daemon_name_and_addr(const char *name, const conf_ipaddr *conf_addr)
 {
-  const char *in_loc;
-  char *out_loc;
-  char hostn[MAXHOSTNAMELEN+1];
+  const spu_addr *addr   = NULL;
+  int             family = Conf_get_active_ip_version();
+  int             ret;
+  char           *tmp;
+  int             i;
+
+  /* sanity check ActiveIPVersion and the addresses we've already configured */
   
-  for ( in_loc = in_string, out_loc = out_string; out_loc - out_string < str_size; in_loc++ )
+  if (family == AF_INET)
+    IPv4_configured = 1;
+
+  else if (family == AF_INET6)
+    IPv6_configured = 1;
+
+  else
+    Alarmp(SPLOG_FATAL, CONF_SYS, "set_daemon_name_and_addr: BUG! Configured family (%d) is neither AF_INET (%d) nor AF_INET6 (%d)!\n",
+           family, AF_INET, AF_INET6);
+
+  if (IPv4_configured && IPv6_configured)
+    yyerror("ActiveIPVersion changed in middle of configuration file!  Trying to configure both IPv4 and IPv6 daemon addresses in same configuration!");
+
+  /* check for zero length daemon name: can happen with a quoted string */
+  /* warn if name ends with a semicolon: user likely intended it to separate two daemon specs but stuck it on the end of the name without any intervening white space */
+
+  if (name != NULL)
   {
-          if (*in_loc == '%' ) {
-                  switch( in_loc[1] ) {
-                  case 'h':
-                  case 'H':
-                          gethostname(hostn, sizeof(hostn) );
-                          out_loc += snprintf(out_loc, str_size - (out_loc - out_string), "%s", hostn); 
-                          in_loc++;
-                          continue;
-                  default:
-                          break;
-                  }
+    size_t len = strlen(name);
 
-          }
-          *out_loc = *in_loc;
-          out_loc++;
-          if (*in_loc == '\0') break;
+    if (len == 0)
+      yyerror("Zero length daemon name!");
+    
+    if (name[len - 1] == ';')
+      yywarn("Daemon name ended with a semicolon! If you intended for it to demark two different daemon specifications then it needs white space around it!");
   }
-  out_string[str_size-1] = '\0';
+  
+  /* figure out daemon's address (.proc_addr) first */
+  
+  if (conf_addr != NULL)
+  {
+    addr = &conf_addr->ipaddr;
+
+    if (spu_addr_family(addr) != family)
+      yyerror("A daemon's address is incompatible with ActiveIPVersion!");
+
+    if (spu_addr_ip_is_unspecified(addr))
+      yyerror("A daemon's address must not be the unspecified address!");
+    
+    if (spu_addr_ip_get_port(addr) != 0)
+      yyerror("A daemon's address must not specify a port!");
+
+    Config->allprocs[num_procs].proc_addr = *addr;
+  }
+  else if (name != NULL)  /* do a DNS lookup for address */
+  {
+    struct addrinfo hint = { 0 }, *rslt, *curr;
+
+    hint.ai_family   = PF_UNSPEC;  /* NOTE: not family bc family is an address family while this wants protocol family (paranoid, I know) */
+    hint.ai_socktype = SOCK_DGRAM;
+    hint.ai_protocol = IPPROTO_UDP;
+    hint.ai_flags    = 0;
+    
+    if ((ret = getaddrinfo(name, NULL, &hint, &rslt)))
+      yyerror(ret != EAI_SYSTEM ? gai_strerror(ret) : strerror(errno));
+
+    for (curr = rslt; curr != NULL && (curr->ai_addr == NULL || curr->ai_addr->sa_family != family); curr = curr->ai_next);  /* find first address of correct type */
+
+    if (curr == NULL)
+      yyerror("Couldn't find an appropriate address based on daemon name! Check that your ActiveIPVersion and DNS entries match or explicitly configure the address to use!");
+
+    if (spu_addr_from_sockaddr_known(&Config->allprocs[num_procs].proc_addr, curr->ai_addr))
+      yyerror("Bug! Setting proc_addr from getaddrinfo failed?!");
+    
+    freeaddrinfo(rslt);
+  }
+  else
+    yyerror("A daemon must have a name, an address or both!");
+
+  if (spu_addr_family(&Config->allprocs[num_procs].proc_addr) != family)
+    Alarmp(SPLOG_FATAL, CONF_SYS, "set_daemon_name_and_addr: BUG! Somehow addr's family (%d) didn't match (%d)?!\n",
+           spu_addr_family(&Config->allprocs[num_procs].proc_addr), family);
+
+  if (spu_addr_ip_is_multicast(&Config->allprocs[num_procs].proc_addr))
+    yyerror("A daemon's address can't be a multicast address!");
+  
+  /* figure out a daemon's .name */
+
+  if (name == NULL)
+    name = conf_addr->ipstr;
+
+  strncpy(Config->allprocs[num_procs].name, name, MAX_PROC_NAME);
+  Config->allprocs[num_procs].name[MAX_PROC_NAME - 1] = 0;
+
+  /* NOTE: remove any trailing IPv6 interface specification, which are node-local, if we derived the name from the daemon address */
+  
+  if (conf_addr != NULL && name == conf_addr->ipstr && (tmp = strchr(Config->allprocs[num_procs].name, '%')) != NULL)
+    *tmp = 0;
+  
+  if (Config->allprocs[num_procs].name[0] == 0)
+    Alarmp(SPLOG_FATAL, CONF_SYS, "set_daemon_name_and_addr: BUG! Zero length proc name somehow?!\n");
+
+  Alarmp(SPLOG_INFO, CONF_SYS, "Configured daemon '%s' with IP '%s'\n", Config->allprocs[num_procs].name, SPU_ADDR_NTOP(&Config->allprocs[num_procs].proc_addr));
+  
+  /* ensure .name uniqueness */
+
+  for (i = 0; i < num_procs; ++i)
+    if (!strncmp(Config->allprocs[num_procs].name, Config->allprocs[i].name, MAX_PROC_NAME))
+      Alarmp(SPLOG_FATAL, CONF_SYS, PARSE_ERROR_STR "Daemon name (%s) not unique! Already in use by daemon #%d!\n", line_num, yytext, Config->allprocs[num_procs].name, i);
+
+  /* NOTE: we ensure .proc_addr uniqueness when a segment is fully configured so we know the port # too */
 }
 
-static  int 	get_parsed_proc_info( char *name, proc *p )
-{
-	int	i;
+/********************************************************************************
+ ********************************************************************************/
 
-	for ( i=0; i < num_procs; i++ )
-	{
-		if ( strcmp( Config->allprocs[i].name, name ) == 0 )
-		{
-			*p = Config->allprocs[i];
-			return( i );
-		}
-	}
-	return( -1 );
-}
-/* convert_segment_to_string()
- * char * segstr : output string
- * int strsize : length of output string space
- * segment *seg : input segment structure
- * int return : length of string written or -1 if error (like string not have room)
- * 
- *
- * The format of the returned string will be as shown below with each segment appended
- * to the string. Each use of IPB will be replaced with the broadcast IP address, port
- * with the port. The optional section is a list of interfaces tagged with D or C
- * and idnetified by ip address. 
- *
- * "Segment IP:port host1name host1ip (ALL/ANY/C/D/M IP)+ host2name host2ip (ALL/ANY/C/D/M IP )+ ..."
- *
- */
-static  int    convert_segment_to_string(char *segstr, int strsize, segment *seg)
+static size_t convert_segment_to_string(char * const segstr, const int segstr_size, const segment *seg)
 {
-    int         i,j;
-    size_t      curlen = 0;
-    char        temp_str[200];
+  char *c = segstr;
+  char *e = segstr + segstr_size;
+  char  idstr[MAX_ID_SIZE];
+  int   i;
 
-    sprintf(temp_str, "Segment %d.%d.%d.%d:%d ", 
-            (seg->bcast_address & 0xff000000)>>24, 
-            (seg->bcast_address & 0xff0000)>>16, 
-            (seg->bcast_address & 0xff00)>>8, 
-            (seg->bcast_address & 0xff), 
-            seg->port );
+  /* NOTE: we use CANON so that there can be no confusion between implementations about the particular form of the addresses and that any interface specification is always left off */
+  /* NOTE: we still include proc addr's in conf hash string to ensure all daemons are using same addresses in a config */
 
-    strncat( segstr, temp_str, strsize - curlen);
-    curlen += strlen(temp_str);
+  c += snprintf(c, SPCLAMP(c, e), "Segment: port = %u;", (unsigned) spu_addr_ip_get_port(&seg->seg_addrs[0]));
 
-    for (i = 0; i < seg->num_procs; i++) {
-        sprintf(temp_str, "%s %d.%d.%d.%d ", 
-                seg->procs[i]->name, 
-                (seg->procs[i]->id & 0xff000000)>>24, 
-                (seg->procs[i]->id & 0xff0000)>>16, 
-                (seg->procs[i]->id & 0xff00)>>8, 
-                (seg->procs[i]->id & 0xff) );
-        strncat( segstr, temp_str, strsize - curlen);
-        curlen += strlen(temp_str);
+  for (i = 0; i < seg->num_seg_addrs; ++i)  
+    c += snprintf(c, SPCLAMP(c, e), " [%s]", SPU_ADDR_NTOP_CANON(&seg->seg_addrs[i]));
 
-        /* Now add all interfaces */
-        for ( j=0 ; j < seg->procs[i]->num_if; j++) {
-            /* add addional interface specs to string */
-            if ( seg->procs[i]->ifc[j].type & IFTYPE_ANY )
-            {
-                strncat( segstr, "ANY ", strsize - curlen);
-                curlen += 4;
-            }
-            if ( seg->procs[i]->ifc[j].type & IFTYPE_DAEMON )
-            {
-                strncat( segstr, "D ", strsize - curlen);
-                curlen += 2;
-            }
-            if ( seg->procs[i]->ifc[j].type & IFTYPE_CLIENT )
-            {
-                strncat( segstr, "C ", strsize - curlen);
-                curlen += 2;
-            }
-            if ( seg->procs[i]->ifc[j].type & IFTYPE_MONITOR )
-            {
-                strncat( segstr, "M ", strsize - curlen);
-                curlen += 2;
-            }
-            sprintf(temp_str, "%d.%d.%d.%d ", 
-                (seg->procs[i]->ifc[j].ip & 0xff000000)>>24, 
-                (seg->procs[i]->ifc[j].ip & 0xff0000)>>16, 
-                (seg->procs[i]->ifc[j].ip & 0xff00)>>8, 
-                (seg->procs[i]->ifc[j].ip & 0xff) );
-            strncat( segstr, temp_str, strsize - curlen);
-            curlen += strlen(temp_str);
-        }
-    }
+  c += snprintf(c, SPCLAMP(c, e), "\n");
+  
+  for (i = 0; i < seg->num_procs; ++i)
+    c += snprintf(c, SPCLAMP(c, e), "\t'%s' [%s] [%s]\n", seg->procs[i]->name, SPU_ADDR_NTOP_CANON(&seg->procs[i]->proc_addr), Conf_id_to_str(seg->procs[i]->id, idstr));
+  
+  c += snprintf(c, SPCLAMP(c, e), "\n");
 
-    /* terminate each segment by a newline */
-    strncat( segstr, "\n", strsize - curlen);
-    curlen += 1;
+  Alarmp(SPLOG_DEBUG, CONF_SYS, "config_parse.y:convert_segment_to_string: The segment string is %d characters long:\n'%s'\n", (int) (c - segstr), segstr);
+  
+  if (c >= e)
+    yyerror("Configuration string too long! (1)");
+  
+  return (size_t) (c - segstr);
+}
 
-    if ((int) curlen > strsize) {
-        /* ran out of space in string -- should never happen. */
-        Alarmp( SPLOG_ERROR, CONF_SYS, "config_parse.y:convert_segment_to_string: The segment string is too long! %d characters attemped is more then %d characters allowed", curlen, strsize);
-        Alarmp( SPLOG_ERROR, CONF_SYS, "config_parse.y:convert_segment_to_string:The error occured on segment %d.%d.%d.%d. Successful string was: %s\n",
-                (seg->bcast_address & 0xff000000)>>24, 
-                (seg->bcast_address & 0xff0000)>>16, 
-                (seg->bcast_address & 0xff00)>>8, 
-                (seg->bcast_address & 0xff), 
-                segstr);
-        return(-1);
-    }
+/********************************************************************************
+ ********************************************************************************/
 
-    Alarmp( SPLOG_DEBUG, CONF_SYS, "config_parse.y:convert_segment_to_string:The segment string is %d characters long:\n%s", curlen, segstr);
-    return(curlen);
+static size_t convert_version_to_string(char * const segstr, const int segstr_size)
+{
+  char *c = segstr;
+  char *e = segstr + segstr_size;
+
+  c += snprintf(segstr, SPCLAMP(c, e), "Version: %d.%d\nProtocol: %s\n",
+                SP_MAJOR_VERSION, SP_MINOR_VERSION, (Conf_get_accelerated_ring() ? "Accelerated Ring" : "Original Ring"));
+  
+  Alarmp(SPLOG_DEBUG, CONF_SYS, "config_parse.y:convert_version_to_string: The version string is %d characters long:\n'%s'\n", (int) (c - segstr), segstr);
+  
+  if (c >= e)
+    yyerror("Configuration string too long! (2)");
+
+  return (size_t) (c - segstr);
 }
 
-#define PROC_NAME_CHECK( stoken ) { \
-                                            char strbuf[80]; \
-                                            int ret; \
-                                            proc p; \
-                                            if ( strlen((stoken)) >= MAX_PROC_NAME ) { \
-                                                snprintf(strbuf, 80, "Too long name(%d max): %s)\n", MAX_PROC_NAME, (stoken)); \
-                                                return (yyerror(strbuf)); \
-                                            } \
-                                            ret = get_parsed_proc_info( stoken, &p ); \
-                                            if (ret >= 0) { \
-                                                snprintf(strbuf, 80, "Name not unique. name: %s equals (%s, %d.%d.%d.%d)\n", (stoken), p.name, IP1(p.id), IP2(p.id), IP3(p.id), IP4(p.id) ); \
-                                                return (yyerror(strbuf)); \
-                                            } \
-                                         }
-#define PROCS_CHECK( num_procs, stoken ) { \
-                                            char strbuf[80]; \
-                                            if ( (num_procs) >= MAX_PROCS_RING ) { \
-                                                snprintf(strbuf, 80, "%s (Too many daemons configured--%d max)\n", (stoken), MAX_PROCS_RING); \
-                                                return (yyerror(strbuf)); \
-                                            } \
-                                         }
-#define SEGMENT_CHECK( num_segments, stoken )  { \
-                                            char strbuf[80]; \
-                                            if ( (num_segments) >= MAX_SEGMENTS ) { \
-                                                snprintf(strbuf, 80, "%s (Too many segments configured--%d max)\n", (stoken), MAX_SEGMENTS); \
-                                                return( yyerror(strbuf)); \
-                                            } \
-                                         }
-#define SEGMENT_SIZE_CHECK( num_procs, stoken )  { \
-                                            char strbuf[80]; \
-                                            if ( (num_procs) >= MAX_PROCS_SEGMENT ) { \
-                                                snprintf(strbuf, 80, "%s (Too many daemons configured in segment--%d max)\n", (stoken), MAX_PROCS_SEGMENT); \
-                                                return( yyerror(strbuf)); \
-                                            } \
-                                         }
-#define INTERFACE_NUM_CHECK( num_ifs, stoken )  { \
-                                            char strbuf[80]; \
-                                            if ( (num_ifs) >= MAX_INTERFACES_PROC ) { \
-                                                snprintf(strbuf, 80, "%s (Too many interfaces configured in proc--%d max)\n", (stoken), MAX_INTERFACES_PROC); \
-                                                return( yyerror(strbuf)); \
-                                            } \
-                                         }
+/********************************************************************************
+ ********************************************************************************/
 
-
 %}
 %start Config
-%token SEGMENT EVENTLOGFILE EVENTTIMESTAMP EVENTPRECISETIMESTAMP EVENTPRIORITY IPADDR NUMBER COLON
+%token SEGMENT EVENTLOGFILE EVENTTIMESTAMP EVENTPRECISETIMESTAMP EVENTPRIORITY IPADDR IPPORT NUMBER COLON SEMICOLON
 %token PDEBUG PINFO PWARNING PERROR PCRITICAL PFATAL
 %token OPENBRACE CLOSEBRACE EQUALS STRING
 %token DEBUGFLAGS BANG
 %token DDEBUG DEXIT DPRINT DDATA_LINK DNETWORK DPROTOCOL DSESSION
 %token DCONF DMEMB DFLOW_CONTROL DSTATUS DEVENTS DGROUPS DMEMORY
 %token DSKIPLIST DACM DSECURITY DALL DNONE
-%token DEBUGINITIALSEQUENCE
 %token DANGEROUSMONITOR SOCKETPORTREUSE RUNTIMEDIR SPUSER SPGROUP ALLOWEDAUTHMETHODS REQUIREDAUTHMETHODS ACCESSCONTROLPOLICY
-%token MAXSESSIONMESSAGES
+%token MAXSESSIONMESSAGES ACTIVEIPVERSION
 %token WINDOW PERSONALWINDOW ACCELERATEDRING ACCELERATEDWINDOW
 %token TOKENTIMEOUT HURRYTIMEOUT ALIVETIMEOUT JOINTIMEOUT REPTIMEOUT SEGTIMEOUT GATHERTIMEOUT FORMTIMEOUT LOOKUPTIMEOUT
-%token SP_BOOL SP_TRIVAL LINKPROTOCOL PHOP PTCPHOP
+%token SP_BOOL SP_TRIVAL
 %token IMONITOR ICLIENT IDAEMON
-%token ROUTEMATRIX LINKCOST
+%token VIRTUALID
+%token WIDEAREANETWORK
 %%
 Config		:	ConfigStructs
                         {
-			  Config->num_segments = segments;
+                          if (segments == 0)
+                            yyerror("No segments specified!");
+
+                          if (num_procs == 0)
+                            yyerror("No daemons specified!");
+
+                          if (Conf_get_personal_window() > Conf_get_window())
+                            yyerror("PersonalWindow > Window!");
+
+                          if (Conf_get_accelerated_ring() && Conf_get_accelerated_window() > Conf_get_personal_window())
+                            yyerror("AcceleratedWindow > PersonalWindow!");
+
+			  Config->num_segments    = segments;
 			  Config->num_total_procs = num_procs;
-			  Alarm(CONF_SYS, "Finished configuration file.\n");
-                          Alarmp( SPLOG_DEBUG, CONF_SYS, "config_parse.y:The full segment string is %d characters long:\n%s", strlen(ConfStringRep), ConfStringRep);
+
+                          /* add Spread daemon version number and algorithm to hash string and calculate hash */
+                          
+                          ConfStringLen    += convert_version_to_string(&ConfStringRep[ConfStringLen], MAX_CONF_STRING - ConfStringLen);
+                          Config->hash_code = stdhcode_oaat(ConfStringRep, ConfStringLen + 1);
+
+                          Alarmp(SPLOG_DEBUG, CONF_SYS, "Full hash string is %d %d characters long:\n'%s'\n", ConfStringLen, (int) strlen(ConfStringRep), ConfStringRep);
+                          Alarmp(SPLOG_INFO,  CONF_SYS, "Hash value for this configuration is: %u\n", (unsigned) Config->hash_code);
+			  Alarmp(SPLOG_INFO,  CONF_SYS, "Finished configuration file.\n");
 			}
 
-
-ConfigStructs	:	SegmentStruct ConfigStructs
-		|	ParamStruct ConfigStructs
-		|	RouteStruct ConfigStructs
+ConfigStructs	:	ConfigStructs SegmentStruct 
+		|	ConfigStructs ParamStruct 
 		|
 		;
 
@@ -409,11 +429,13 @@
                             expand_filename(file_buf, MAXPATHLEN, $3.string);
                             Alarm_set_output(file_buf);
                           }
+                          free($3.string);
 			}
 		|	EVENTTIMESTAMP EQUALS STRING
 			{
 			  if (! Alarm_get_interactive() ) {
                               strncpy(alarm_format, $3.string, MAX_ALARM_FORMAT);
+                              alarm_format[MAX_ALARM_FORMAT - 1] = 0;
                               alarm_custom_format = 1;
                               if (alarm_precise) {
                                   Alarm_enable_timestamp_high_res(alarm_format);
@@ -421,6 +443,7 @@
                                   Alarm_enable_timestamp(alarm_format);
                               }
                           }
+                          free($3.string);
 			}
 		|	EVENTTIMESTAMP
 			{
@@ -452,36 +475,32 @@
                 |       SOCKETPORTREUSE EQUALS SP_TRIVAL
                         {
                             port_reuse state;
+                            
                             if ($3.number == 1)
-                            {
-                                state = port_reuse_on;
-                            }
+                              state = PORT_REUSE_ON;
+
                             else if ($3.number == 0)
-                            {
-                                state = port_reuse_off;
-                            }
+                              state = PORT_REUSE_OFF;
+
                             else
-                            {
-                                /* Default to AUTO. */
-                                state = port_reuse_auto;
-                            }
+                              state = PORT_REUSE_AUTO;
+
                             Conf_set_port_reuse_type(state);
                         }
                 |       RUNTIMEDIR EQUALS STRING
                         {
                             Conf_set_runtime_dir($3.string);
+                            free($3.string);
                         }
-                |       DEBUGINITIALSEQUENCE
-                        {
-                            Conf_set_debug_initial_sequence();
-                        }
                 |       SPUSER EQUALS STRING
                         {
                             Conf_set_user($3.string);
+                            free($3.string);
                         }
                 |       SPGROUP EQUALS STRING
                         {
                             Conf_set_group($3.string);
+                            free($3.string);
                         }
                 |       ALLOWEDAUTHMETHODS EQUALS STRING
                         {
@@ -494,6 +513,7 @@
                             authentication_configured = 1;
 
                             strncpy(auth_list, $3.string, MAX_AUTH_LIST_LEN);
+                            auth_list[MAX_AUTH_LIST_LEN - 1] = 0;
                             len = strlen(auth_list); 
                             for (i=0; i < len; )
                             {
@@ -506,6 +526,7 @@
                                 i += strlen(&auth_list[i]);
                                 i++; /* for null */
                             }
+                            free($3.string);
                         }
                 |       REQUIREDAUTHMETHODS EQUALS STRING
                         {
@@ -518,6 +539,7 @@
                             authentication_configured = 1;
 
                             strncpy(auth_list, $3.string, MAX_AUTH_LIST_LEN);
+                            auth_list[MAX_AUTH_LIST_LEN - 1] = 0;
                             len = strlen(auth_list); 
                             for (i=0; i < len; )
                             {
@@ -530,6 +552,7 @@
                                 i += strlen(&auth_list[i]);
                                 i++; /* for null */
                             }
+                            free($3.string);
                         }
                 |       ACCESSCONTROLPOLICY EQUALS STRING
                         {
@@ -539,21 +562,32 @@
                             {
                                     yyerror("Invalid Access Control Policy name. Make sure it is spelled right and any needed mocdules are loaded");
                             }
+                            free($3.string);
                         }
 		|	MAXSESSIONMESSAGES EQUALS NUMBER
 			{
                             Conf_set_max_session_messages($3.number);
 			}
-		|	LINKPROTOCOL EQUALS PHOP
+                |       ACTIVEIPVERSION EQUALS STRING
+                        {
+                          int ipver = 0;
+                          
+                          if (!strcmp("IPv4", $3.string))
+                            ipver = AF_INET;
+                          
+                          else if (!strcmp("IPv6", $3.string))
+                            ipver = AF_INET6;
+                          
+                          else
+                            yyerror("Invalid Active IP Version specified. Must be 'IPv4' or 'IPv6'");
+                          
+                          Alarmp(SPLOG_INFO, CONF_SYS, "Setting active IP version to %d\n", ipver);
+                          
+                          Conf_set_active_ip_version(ipver);
+                          free($3.string);
+                        }
+ 		|	WINDOW EQUALS NUMBER
 			{
-                            Conf_set_link_protocol(HOP_PROT);
-			}
-		|	LINKPROTOCOL EQUALS PTCPHOP
-			{
-                            Conf_set_link_protocol(TCP_PROT);
-			}
-		|	WINDOW EQUALS NUMBER
-			{
 			    Conf_set_window($3.number);
 			}
 		|	PERSONALWINDOW EQUALS NUMBER
@@ -605,194 +639,247 @@
 			{
 			    Conf_set_lookup_timeout($3.number);
 			}
+		|	WIDEAREANETWORK EQUALS SP_BOOL
+			{
+                            Conf_set_wide_area_network_flag(TRUE);
+			    Conf_set_wide_area_network($3.boolean);
+			}
+                
 
-SegmentStruct	:    SEGMENT IPADDR OPENBRACE Segmentparams CLOSEBRACE
-                        { int i;
-                          int added_len;
-                          SEGMENT_CHECK( segments, inet_ntoa($2.ip.addr) );
+SegmentStruct	:	SEGMENT SegmentAddress SegmentAddresses_opt OPENBRACE Segmentparams CLOSEBRACE
+			{
+                          int16u port = spu_addr_ip_get_port(&$2.addr.ipaddr);
+                          int    i, j;
+
+                          if (port == 0)
+                            port = DEFAULT_SPREAD_PORT;
+                            
+                          if (segments >= MAX_SEGMENTS)                            
+                            yyerror("Too many segments configured!");
+
+                          /* NOTE: we left seg_addrs[0] open in SegmentAddresses_opt rule below */
+
+                          assert(segment_addrs < MAX_ADDRS_SEGMENT);
+                          Config->segments[segments].seg_addrs[0]  = $2.addr.ipaddr;
+                          Config->segments[segments].num_seg_addrs = ++segment_addrs;
+                          
+                          for (i = 0; i < segment_addrs;++i)
+                          {
+                            if (spu_addr_family(&Config->segments[segments].seg_addrs[i]) != Conf_get_active_ip_version())
+                              Alarmp(SPLOG_FATAL, CONF_SYS, PARSE_ERROR_STR "Segment address %s incompatible with ActiveIPVersion!",
+                                     line_num, yytext, SPU_ADDR_NTOP(&Config->segments[segments].seg_addrs[i]));
+                            
+                            if (spu_addr_ip_is_unspecified(&Config->segments[segments].seg_addrs[i]))
+                              Alarmp(SPLOG_FATAL, CONF_SYS, PARSE_ERROR_STR "Segment configured with an unspecified segment address %s!",
+                                     line_num, yytext, SPU_ADDR_NTOP(&Config->segments[segments].seg_addrs[i]));
+                                     
+                            if (spu_addr_family(&Config->segments[segments].seg_addrs[i]) == AF_INET6 &&
+                                !spu_addr_ip_is_multicast(&Config->segments[segments].seg_addrs[i]))
+                              Alarmp(SPLOG_WARNING, CONF_SYS, PARSE_WARNING_STR "IPv6 segment configured with a non-multicast segment address %s!\n",
+                                     line_num, yytext, SPU_ADDR_NTOP(&Config->segments[segments].seg_addrs[i]));
+                            
+                            if (spu_addr_ip_is_loopback(&Config->segments[segments].seg_addrs[i]))
+                              Alarmp(SPLOG_WARNING, CONF_SYS, PARSE_WARNING_STR "Segment configured with a loopback address %s!",
+                                     line_num, yytext, SPU_ADDR_NTOP(&Config->segments[segments].seg_addrs[i]));
+                            
+                            /* NOTE: we don't try to validate IPv4 broadcast addresses here because we don't know the umask */
+
+                            spu_addr_ip_set_port(&Config->segments[segments].seg_addrs[i], port);  /* NOTE: set all segment addresses to use same port */
+                          }
+
 			  Config->segments[segments].num_procs = segment_procs;
-			  Config->segments[segments].port = $2.ip.port;
-			  Config->segments[segments].bcast_address =
-			    $2.ip.addr.s_addr;
-			  if(Config->segments[segments].port == 0)
-			    Config->segments[segments].port = DEFAULT_SPREAD_PORT;
-			  Alarm(CONF_SYS, "Successfully configured Segment %d [%s] with %d procs:\n",
-				segments,
-				segment2str(segments),
-				segment_procs);
-			  for(i=(num_procs - segment_procs); i<num_procs; i++) {
-                                  /* This '1' is to keep each proc with the same port as the segment.*/
-			    if( 1 || Config->allprocs[i].port==0)  {
-			      Config->allprocs[i].port=
-				Config->segments[segments].port;
-			    }
-			    alarm_print_proc(&(Config->allprocs[i]),
-			    	Config->segments[segments].port);
-			  }
-                          /* generate string representation of segment */
-                          added_len = convert_segment_to_string(&ConfStringRep[ConfStringLen], MAX_CONF_STRING - ConfStringLen, &Config->segments[segments] );
-                          if (added_len == -1 )
-                              yyerror("Failed to update string with segment!\n");
-                          ConfStringLen += added_len;
 
-			  segments++;
+			  Alarmp(SPLOG_INFO, CONF_SYS, "Successfully configured Segment %d [%s]:%u with %d procs:\n",
+                                 segments, SPU_ADDR_NTOP(&$2.addr.ipaddr), (unsigned) port, segment_procs);
+
+                          /* set ports for daemon communications */
+                          
+			  for (i = num_procs - segment_procs; i < num_procs; ++i)
+                          {
+                            spu_addr_ip_set_port(&Config->allprocs[i].proc_addr, port);
+
+                            for (j = 0; j < Config->allprocs[i].num_if; ++j)
+                              spu_addr_ip_set_port(&Config->allprocs[i].ifc[j].ifaddr, port);
+
+                            Alarmp(SPLOG_INFO, CONF_SYS, "\t%" QQ(MAX_PROC_NAME) "s: %s\n", Config->allprocs[i].name, SPU_ADDR_NTOP(&Config->allprocs[i].proc_addr));
+
+                            /* ensure .proc_addr uniqueness */
+                            
+                            for (j = 0; j < i; ++j)
+                              if (!spu_addr_ip_cmp(&Config->allprocs[i].proc_addr, &Config->allprocs[j].proc_addr, TRUE))
+                                Alarmp(SPLOG_FATAL, CONF_SYS, PARSE_ERROR_STR "Daemon's (%s) address (%s) not unique! Already in use by daemon #%d (%s)!\n",
+                                       line_num, yytext, Config->allprocs[i].name, SPU_ADDR_NTOP(&Config->allprocs[i].proc_addr), j, Config->allprocs[j].name);
+                          }
+
+                          ConfStringLen += convert_segment_to_string(&ConfStringRep[ConfStringLen], MAX_CONF_STRING - ConfStringLen, &Config->segments[segments]);
+
+			  ++segments;
 			  segment_procs = 0;
+                          segment_addrs = 0;
+
+                          free($2.addr.ipstr);
 			}
 		;
 
-Segmentparams	:	Segmentparam Segmentparams
+SegmentAddress	:	IPADDR { $$ = $1; }
+		|	IPPORT { $$ = $1; }
+		;
+
+SegmentAddresses_opt	:	SegmentAddresses_opt IPADDR
+				{
+                                  if (++segment_addrs >= MAX_ADDRS_SEGMENT)            /* NOTE: pre-increment here leaves index 0 open for primary segment address above */
+                                    yyerror("Too many segment addresses specified!");
+
+                                  Config->segments[segments].seg_addrs[segment_addrs] = $2.addr.ipaddr;
+                                  free($2.addr.ipstr);
+                                }
+			|
+			;
+
+Segmentparams	:	Segmentparams Daemonparam 
 		|
 		;
 
-Segmentparam	:	STRING IPADDR OPENBRACE Interfaceparams CLOSEBRACE
-                        { 
-                          PROC_NAME_CHECK( $1.string );
-                          PROCS_CHECK( num_procs, $1.string );
-                          SEGMENT_CHECK( segments, $1.string );
-                          SEGMENT_SIZE_CHECK( segment_procs, $1.string );
+Daemonparam	:	Daemonname Daemonvid_opt Daemoninterfaces_opt Semicolon_opt
+			{
+                          char idstr[MAX_ID_SIZE];
+                          int i;
+
+                          if (num_procs >= MAX_PROCS_RING)
+                            yyerror("Too many daemons configured!");
+
+                          if (segment_procs >= MAX_PROCS_SEGMENT)
+                            yyerror("Too many daemons configured in segment!");
+
+                          /* auto-generate a VID if not configured */
+                          
+                          if (Config->allprocs[num_procs].id == 0)
+                          {
+                            Config->allprocs[num_procs].id = Conf_str_to_id(Config->allprocs[num_procs].name);
+                            
+                            Alarmp(SPLOG_INFO, CONF_SYS, "Auto-generated virtual ID = '%s' for daemon '%s'\n",
+                                   Conf_id_to_str(Config->allprocs[num_procs].id, idstr), Config->allprocs[num_procs].name);
+                          }
+
+                          /* ensure VID uniqueness */
+                          
+                          for (i = 0; i < num_procs; ++i)
+                            if (Config->allprocs[i].id == Config->allprocs[num_procs].id)
+                              Alarmp(SPLOG_FATAL, CONF_SYS, "The virtual ID '%s' of '%s' is already in use by '%s'!  "
+                                     "You will probably need to explicitly reconfigure the daemons' virtual IDs so that they don't conflict.\n",
+                                     Conf_id_to_str(Config->allprocs[num_procs].id, idstr), Config->allprocs[num_procs].name, Config->allprocs[i].name);
+                          
                           if (procs_interfaces == 0)
-                                  yyerror("Interfaces section declared but no actual interface addresses defined\n");
-                          strcpy(Config->allprocs[num_procs].name, $1.string);
-                          Config->allprocs[num_procs].id = $2.ip.addr.s_addr;
- 		          Config->allprocs[num_procs].port = $2.ip.port;
-			  Config->allprocs[num_procs].seg_index = segments;
-			  Config->allprocs[num_procs].index_in_seg = segment_procs;
-                          Config->allprocs[num_procs].num_if = procs_interfaces;
-			  Config->segments[segments].procs[segment_procs] = 
-                              &(Config->allprocs[num_procs]);
-			  num_procs++;
-			  segment_procs++;
+                          {
+                            procs_interfaces                          = 1;
+                            Config->allprocs[num_procs].ifc[0].iftype = (IFTYPE_ALL | IFTYPE_ANY);
+                            Config->allprocs[num_procs].ifc[0].ifaddr = Config->allprocs[num_procs].proc_addr;
+                          }
+                          
+                          for (i = 0; i < procs_interfaces; ++i)
+                            if ((!spu_addr_ip_cmp(&Config->allprocs[num_procs].proc_addr, &Config->allprocs[num_procs].ifc[i].ifaddr, FALSE) ||
+                                 (spu_addr_family(&Config->allprocs[num_procs].proc_addr) == spu_addr_family(&Config->allprocs[num_procs].ifc[i].ifaddr) &&
+                                   spu_addr_ip_is_unspecified(&Config->allprocs[num_procs].ifc[i].ifaddr)))
+                                &&
+                                (Is_IfType_Daemon(Config->allprocs[num_procs].ifc[i].iftype) ||
+                                 Is_IfType_Any(Config->allprocs[num_procs].ifc[i].iftype)))
+                              break;
+
+                          if (i == procs_interfaces)
+                            yyerror("Interface spec doesn't include a daemon entry for the daemon's primary address!");
+
+                          Config->allprocs[num_procs].seg_index           = segments;
+			  Config->allprocs[num_procs].index_in_seg        = segment_procs;
+                          Config->allprocs[num_procs].num_if              = procs_interfaces;
+			  Config->segments[segments].procs[segment_procs] = &Config->allprocs[num_procs];
+
+                          ++num_procs;
+                          ++segment_procs;
                           procs_interfaces = 0;
-			}
-		|	STRING OPENBRACE Interfaceparams CLOSEBRACE
-			{ 
-                          PROC_NAME_CHECK( $1.string );
-                          PROCS_CHECK( num_procs, $1.string );
-                          SEGMENT_CHECK( segments, $1.string );
-                          SEGMENT_SIZE_CHECK( segment_procs, $1.string );
-                          if (procs_interfaces == 0)
-                                  yyerror("Interfaces section declared but no actual interface addresses defined\n");
-                          strcpy(Config->allprocs[num_procs].name, $1.string);
-                          Config->allprocs[num_procs].id =
-			    name2ip(Config->allprocs[num_procs].name);
- 		          Config->allprocs[num_procs].port = 0;
-			  Config->allprocs[num_procs].seg_index = segments;
-			  Config->allprocs[num_procs].index_in_seg = segment_procs;
-                          Config->allprocs[num_procs].num_if = procs_interfaces;
-			  Config->segments[segments].procs[segment_procs] = 
-                              &(Config->allprocs[num_procs]);
-			  num_procs++;
-			  segment_procs++;
-                          procs_interfaces = 0;
-			}
-                |       STRING IPADDR
-			{ 
-                          PROC_NAME_CHECK( $1.string );
-                          PROCS_CHECK( num_procs, $1.string );
-                          SEGMENT_CHECK( segments, $1.string );
-                          SEGMENT_SIZE_CHECK( segment_procs, $1.string );
-                          strcpy(Config->allprocs[num_procs].name, $1.string);
-                          Config->allprocs[num_procs].id = $2.ip.addr.s_addr;
- 		          Config->allprocs[num_procs].port = $2.ip.port;
-			  Config->allprocs[num_procs].seg_index = segments;
-			  Config->allprocs[num_procs].index_in_seg = segment_procs;
-                          Config->allprocs[num_procs].num_if = 1;
-                          Config->allprocs[num_procs].ifc[0].ip = Config->allprocs[num_procs].id;
-                          Config->allprocs[num_procs].ifc[0].port = Config->allprocs[num_procs].port;
-                          Config->allprocs[num_procs].ifc[0].type = IFTYPE_ALL | IFTYPE_ANY;
-			  Config->segments[segments].procs[segment_procs] = 
-                              &(Config->allprocs[num_procs]);
-			  num_procs++;
-			  segment_procs++;
-                          procs_interfaces = 0;
-			}
-		|	STRING
-			{ 
-                          PROC_NAME_CHECK( $1.string );
-                          PROCS_CHECK( num_procs, $1.string );
-                          SEGMENT_CHECK( segments, $1.string );
-                          SEGMENT_SIZE_CHECK( segment_procs, $1.string );
-                          strcpy(Config->allprocs[num_procs].name, $1.string);
-                          Config->allprocs[num_procs].id =
-			    name2ip(Config->allprocs[num_procs].name);
- 		          Config->allprocs[num_procs].port = 0;
-			  Config->allprocs[num_procs].seg_index = segments;
-			  Config->allprocs[num_procs].index_in_seg = segment_procs;
-                          Config->allprocs[num_procs].num_if = 1;
-                          Config->allprocs[num_procs].ifc[0].ip = Config->allprocs[num_procs].id;
-                          Config->allprocs[num_procs].ifc[0].port = Config->allprocs[num_procs].port;
-                          Config->allprocs[num_procs].ifc[0].type = IFTYPE_ALL | IFTYPE_ANY;
-			  Config->segments[segments].procs[segment_procs] = 
-                              &(Config->allprocs[num_procs]);
-			  num_procs++;
-			  segment_procs++;
-                          procs_interfaces = 0;
-			}
+                        }
 		;
 
-IfType  	:	IMONITOR { $$ = $1; }
-		|	ICLIENT { $$ = $1; }
-		|	IDAEMON { $$ = $1; }
+/* Daemonname causes Daemonparam to be ambiguous (shift/reduce conflict) because a STRING followed by an IPADDR could either mean one daemon or two. */
+/* This grammaar will interpret it as one daemon spec.  We allow this ambiguity so that a configuration of only IPADDRs can be accepted. */
+/* If someone wants STRING IPADDR to actually mean two daemon specs instead of one, then they can separate them with a semicolon: */
+/* STRING ; IPADDR will be interpeted as two daemon specs.  A vid or interface spec will also ensure two daemon specs are parsed.  */
+
+Daemonname	:	STRING IPADDR { set_daemon_name_and_addr($1.string, &$2.addr); free($1.string);     free($2.addr.ipstr); }
+		|	STRING        { set_daemon_name_and_addr($1.string, NULL);     free($1.string);                          }
+		|	IPADDR        { set_daemon_name_and_addr(NULL,      &$1.addr); free($1.addr.ipstr);                      }
 		;
 
-IfTypeComp	:       IfTypeComp IfType
+
+Daemonvid_opt	:	VIRTUALID EQUALS IPADDR
 			{
-			  $$.mask = ($1.mask | $2.mask);
+			  if (spu_addr_family(&$3.addr.ipaddr) != AF_INET || $3.addr.ipaddr.ipv4.sin_addr.s_addr == htonl(INADDR_ANY) || $3.addr.ipaddr.ipv4.sin_port != 0)
+			    yyerror("Virtual IDs must be specified as a non-zero IPv4 address without a port!");
+
+                          Config->allprocs[num_procs].id = ntohl($3.addr.ipaddr.ipv4.sin_addr.s_addr);
+
+                          if (Config->allprocs[num_procs].id == 0)
+                            yyerror("Explicity configured virtual ID mapped to zero somehow?!");
+
+                          free($3.addr.ipstr);
 			}
-		|	{ $$.mask = 0; }
+		|
 		;
 
-Interfaceparams	:	Interfaceparam Interfaceparams
-		|
+Daemoninterfaces_opt	:	OPENBRACE Interfaceparams CLOSEBRACE
+                                {
+                                  if (procs_interfaces == 0)  /* NOTE: indicate error this way rather than hard parsing error to give better error message */
+                                    yyerror("Interfaces section declared but no actual interfaces specified!");
+                                }
+			|
+			;
+
+Interfaceparams	:	Interfaceparams Interfaceparam
+		|	
 		;
 
 Interfaceparam	:	IfTypeComp IPADDR
-			{ 
-                          PROCS_CHECK( num_procs, $1.string );
-                          SEGMENT_CHECK( segments, $1.string );
-                          SEGMENT_SIZE_CHECK( segment_procs, $1.string );
-                          INTERFACE_NUM_CHECK( procs_interfaces, $1.string );
-                          Config->allprocs[num_procs].ifc[procs_interfaces].ip = $2.ip.addr.s_addr;
-                          Config->allprocs[num_procs].ifc[procs_interfaces].port = $2.ip.port;
+			{
+                          if (procs_interfaces >= MAX_INTERFACES_PROC)
+                            yyerror("Too many interfaces configured on a daemon!");
+
+                          if (spu_addr_ip_get_port(&$2.addr.ipaddr) != 0)
+                            yyerror("Interface IPs can't be specified with a port!");
+                          
+                          Config->allprocs[num_procs].ifc[procs_interfaces].ifaddr = $2.addr.ipaddr;
+                          
                           if ($1.mask == 0)
-                                  Config->allprocs[num_procs].ifc[procs_interfaces].type = IFTYPE_ALL;
+                            Config->allprocs[num_procs].ifc[procs_interfaces].iftype = IFTYPE_ALL;
                           else 
-                                  Config->allprocs[num_procs].ifc[procs_interfaces].type = $1.mask;
-                          procs_interfaces++;
+                            Config->allprocs[num_procs].ifc[procs_interfaces].iftype = $1.mask;
+
+                          ++procs_interfaces;
+                          free($2.addr.ipstr);
 			}
 		;
 
-RouteStruct	:    ROUTEMATRIX OPENBRACE Routevectors CLOSEBRACE
-                        { 
-			  Alarm(CONF_SYS, "Successfully configured Routing Matrix for %d Segments with %d rows in the routing matrix\n",segments, rvec_num);
+IfTypeComp	:       IfTypeComp IfType
+			{
+			  $$.mask = ($1.mask | $2.mask);
 			}
+		|	{ $$.mask = 0; }
 		;
 
-Routevectors	:	Routevectors Routevector
+IfType  	:	IMONITOR { $$ = $1; }
+		|	ICLIENT { $$ = $1; }
+		|	IDAEMON { $$ = $1; }
+		;
+
+Semicolon_opt	:	SEMICOLON
 		|
 		;
+%%
 
-Routevector     :       LINKCOST
-                        { 
-                                int rvec_element;
-                                for (rvec_element = 0; rvec_element < segments; rvec_element++) {
-                                        if ($1.cost[rvec_element] < 0) yyerror("Wrong number of entries for routing matrix");
-                                        LinkWeights[rvec_num][rvec_element] = $1.cost[rvec_element];
-                                }
-                                rvec_num++;
-                        }
-                ;
-%%
-void yywarn(char *str) {
-        fprintf(stderr, "-------Parse Warning-----------\n");
-        fprintf(stderr, "Parser warning on or before line %d\n", line_num);
-        fprintf(stderr, "Error type; %s\n", str);
-        fprintf(stderr, "Offending token: %s\n", yytext);
+void yyerror(const char *str)
+{
+  Alarmp(SPLOG_FATAL, CONF_SYS, PARSE_ERROR_STR "%s\n", line_num, yytext, str);
 }
-int yyerror(char *str) {
-  fprintf(stderr, "-------------------------------------------\n");
-  fprintf(stderr, "Parser error on or before line %d\n", line_num);
-  fprintf(stderr, "Error type; %s\n", str);
-  fprintf(stderr, "Offending token: %s\n", yytext);
-  exit(1);
+
+void yywarn(const char *str)
+{
+  Alarmp(SPLOG_WARNING, CONF_SYS, PARSE_WARNING_STR "%s\n", line_num, yytext, str);
 }

Modified: trunk/daemon/configuration.c
===================================================================
--- trunk/daemon/configuration.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/configuration.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -33,27 +33,6 @@
  *
  */
 
-
-/*
-// example for a file:
-// 4
-// 3 132.27.1.0 [4803]
-//	harpo	[132.28.33.22]
-//	hazard
-//	hal
-// 4 132.28.3.0 3377
-//	bih
-//	binoc
-// 	bbl
-//	bbc
-// 2 125.32.0.0 3355
-// 	rb
-//	rc
-// 2 132.27.1.0 
-//      harry
-//	harmony
-*/
-
 #include "arch.h"
 
 #ifndef	ARCH_PC_WIN95
@@ -66,7 +45,7 @@
 
 #else 	/* ARCH_PC_WIN95 */
 
-#include <winsock.h>
+#include <winsock2.h>
 
 #endif	/* ARCH_PC_WIN95 */
 
@@ -75,6 +54,8 @@
 #include <string.h> 
 #include <assert.h>
 
+#include <stdutil/stdutil.h>
+
 #include "configuration.h"
 #include "ip_enum.h"
 
@@ -86,15 +67,15 @@
 #include "spu_memory.h"
 #include "spread_params.h"
 
-static	proc		My;
+static	proc	My;
 
 /* True means allow dangerous monitor commands like partition and flow control
  * to be handled. 
- * False means to ignore requests for those actions. THIS IS THE SAFE SETTING
+ * False means to ignore requests for those actions. FALSE IS THE SAFE SETTING
  */
 static  bool    EnableDangerousMonitor = FALSE;
 
-static  port_reuse SocketPortReuse = port_reuse_auto;
+static  port_reuse SocketPortReuse = PORT_REUSE_AUTO;
 
 static  char    *RuntimeDir = NULL;
 
@@ -137,63 +118,51 @@
 static  int     FormTimeout;
 static  int     LookupTimeout;
 
-static  int     Link_Protocol;
+static  bool    WideAreaNetworkFlag = FALSE;
+static  bool    WideAreaNetwork     = FALSE;
 
-static  bool    Conf_Debug_Initial_Sequence = FALSE;
-
 static  bool    Conf_Reload_State = FALSE;
 static  bool    Conf_Reload_Singleton_State = FALSE;
 static  configuration *Config_Previous;
-static  char    Conf_FileName[80];
-static  char    Conf_MyName_buf[80];
-static  char    *Conf_MyName;
+static  char    Conf_FileName[256];
+static  char    Conf_MyName_buf[256];
+static  char   *Conf_MyName;
+static  int     Conf_Active_IP_Version = AF_INET;
 
-/* Hash function for string to 32 bit int */
-static LOC_INLINE int32u conf_hash_string(const void * key, int32u key_len)
-{
-    const char * kit  = (const char*) key;
-    const char * kend = (const char*) key + key_len;
-    int32u    ret  = (int32u) key_len ^ ((int32u) key_len << 8) ^
-        ((int32u) key_len << 16) ^ ((int32u) key_len << 24);
+char Conf_id_to_str_buf[MAX_ID_SIZE];
 
-    for (; kit != kend; ++kit) {
-        ret += *kit;
-        ret += (ret << 10);
-        ret ^= (ret >> 6);
-    }
-
-    ret += (ret << 3);
-    ret ^= (ret >> 11);
-    ret += (ret << 15);
-
-    return ret;
-}
-
-
-
 void	Conf_init( char *file_name, char *my_name )
 {
-        proc *config_procs;
-        strncpy(Conf_FileName, file_name, 80);
-        if (my_name != NULL) {
-                strncpy(Conf_MyName_buf, my_name, 80);
-                Conf_MyName = &Conf_MyName_buf[0];
-        } else {
-                Conf_MyName = NULL;
-        }
+  proc *config_procs;
+        
+  strncpy(Conf_FileName, file_name, sizeof(Conf_FileName));
+  Conf_FileName[sizeof(Conf_FileName) - 1] = 0;
 
-        Config = Mem_alloc( sizeof( configuration ) );
-        if (Config == NULL) {
-                Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_init: Failed to allocate memory for configuration structure\n");
-        }
-        config_procs = Mem_alloc( MAX_PROCS_RING * sizeof( proc ) );
-        if (config_procs == NULL) {
-                Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_init: Failed to allocate memory for configuration procs array\n");
-        }
+  if (strcmp(Conf_FileName, file_name))
+    Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_init: configuration filename was too long!\n");
+        
+  if (my_name != NULL)
+  {
+    strncpy(Conf_MyName_buf, my_name, sizeof(Conf_MyName_buf));
+    Conf_MyName_buf[sizeof(Conf_MyName_buf) - 1] = 0;
 
-        Config->allprocs = config_procs;
+    if (strcmp(Conf_MyName_buf, my_name))
+      Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_init: daemon's name was too long!\n");
+            
+    Conf_MyName = &Conf_MyName_buf[0];
+  }
+  else
+    Conf_MyName = NULL;
 
-        Conf_load_conf_file( file_name, my_name);
+  if (NULL == (Config = Mem_alloc(sizeof(configuration))))
+    Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_init: Failed to allocate memory for configuration structure\n");
+        
+  if (NULL == (config_procs = Mem_alloc( MAX_PROCS_RING * sizeof(proc))))
+    Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_init: Failed to allocate memory for configuration procs array\n");
+
+  Config->allprocs = config_procs;
+
+  Conf_load_conf_file( file_name, my_name);
 }
 
 bool    Conf_in_reload_singleton_state(void)
@@ -203,13 +172,11 @@
 
 void    Conf_reload_singleton_state_begin(void)
 {
-
         Conf_Reload_Singleton_State = TRUE;
 }
 
 void    Conf_reload_singleton_state_end(void)
 {
-
         Conf_Reload_Singleton_State = FALSE;
 }
 
@@ -220,298 +187,287 @@
 
 void    Conf_reload_state_begin(void)
 {
-
         Conf_Reload_State = TRUE;
 }
 
 void    Conf_reload_state_end(void)
 {
-
         Conf_Reload_State = FALSE;
 }
 
-void    Conf_set_debug_initial_sequence(void)
+static bool Conf_daemon_changed(const proc *np, const segment *np_seg, const proc *op, const segment *op_seg, bool me)
 {
-        Conf_Debug_Initial_Sequence = TRUE;
-}
-bool    Conf_debug_initial_sequence(void)
-{
-        return( Conf_Debug_Initial_Sequence );
-}
+  char idstr[MAX_ID_SIZE];
+  int  lvl1 = (me ? SPLOG_PRINT : SPLOG_INFO);
+  int  lvl2 = (me ? SPLOG_FATAL : SPLOG_INFO);
+  int  i;
 
-/* Basic algorithm:
- * 1) copy Config to oldConfig
- * 2) load new spread.conf file into Config
- * 3) Check if we shuold exit;
- * 4) Check if this change is only add/sub or not. Return answer
- */
-bool    Conf_reload_initiate(void)
-{
-        bool    need_partition = FALSE;
-        proc    np, op;
-        int     i, pi;
+  if (strncmp(np->name, op->name, MAX_PROC_NAME)            ||
+      spu_addr_ip_cmp(&np->proc_addr, &op->proc_addr, TRUE) ||
+      np->id != op->id                                      ||
+      np->num_if != op->num_if)
+  {
+    /* NOTE: we use several separate alarms bc we use same variables for multiple outputs (e.g. - idstr, global buffer for ntop) */
 
-        Config_Previous = Mem_alloc( sizeof( configuration ) );
-        if (Config_Previous == NULL) {
-                Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: Failed to allocate memory for old configuration structure\n");
-        }
-        Config_Previous->allprocs = Mem_alloc( MAX_PROCS_RING * sizeof( proc ) );
-        if (Config_Previous->allprocs == NULL) {
-                Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: Failed to allocate memory for old configuration procs array\n");
-        }
+    Alarmp(lvl1, CONF_SYS, (me ?
+                            "Conf_reload_initiate: My daemon parameters have changed! Exiting!\n" :
+                            "Conf_reload_initiate: A daemon's parameters have changed! Partitioning down to singleton!\n"));
+          
+    Alarmp(lvl1, CONF_SYS, "\tOld: name '%s', addr [%s]:%u, id '%s', num_ifs %d\n",
+           op->name, SPU_ADDR_NTOP_CANON(&op->proc_addr), (unsigned) spu_addr_ip_get_port(&op->proc_addr), Conf_id_to_str(op->id, idstr), op->num_if);
+          
+    Alarmp(lvl2, CONF_SYS, "\tNew: name '%s', addr [%s]:%u, id '%s', num_ifs %d\n",
+           np->name, SPU_ADDR_NTOP_CANON(&np->proc_addr), (unsigned) spu_addr_ip_get_port(&np->proc_addr), Conf_id_to_str(np->id, idstr), np->num_if);
 
-        Conf_config_copy( Config, Config_Previous);
+    return TRUE;
+  }
 
-        Conf_load_conf_file( Conf_FileName, Conf_MyName );
+  for (i = 0; i < np->num_if; i++)
+  {
+    if (np->ifc[i].iftype != op->ifc[i].iftype ||
+        spu_addr_ip_cmp(&np->ifc[i].ifaddr, &op->ifc[i].ifaddr, TRUE) ||
+        (me && spu_addr_family(&np->ifc[i].ifaddr) == AF_INET6 && np->ifc[i].ifaddr.ipv6.sin6_scope_id != op->ifc[i].ifaddr.ipv6.sin6_scope_id))
+    {
+      /* NOTE: we use several separate alarms bc we use same variables for output (e.g. - idstr, global buffer for ntop) */
+      
+      Alarmp(lvl1, CONF_SYS, (me ?
+                              "Conf_reload_initiate: My daemon interface specs have changed! Exiting!\n" :
+                              "Conf_reload_initiate: A daemon's interface specs have changed! Partitioning down to singleton!\n"));
+                    
+      Alarmp(lvl1, CONF_SYS, "\tOld: name '%s', iftype 0x%x, ifaddr [%s]:%u\n",
+             op->name, op->ifc[i].iftype, SPU_ADDR_NTOP(&op->ifc[i].ifaddr), (unsigned) spu_addr_ip_get_port(&op->ifc[i].ifaddr));
+          
+      Alarmp(lvl2, CONF_SYS, "\tNew: name '%s', iftype 0x%x, ifaddr [%s]:%u\n",
+             np->name, np->ifc[i].iftype, SPU_ADDR_NTOP(&np->ifc[i].ifaddr), (unsigned) spu_addr_ip_get_port(&np->ifc[i].ifaddr));
 
-        /* Exit if:
-         *      1) I am no longer in config
-         *      2) My IP/Name has changed
-         *      3) My broadcast/netmask has changed
-         */
-        if ( Conf_proc_by_id( My.id, &np ) < 0 ) {
-                /* I am no longer in config */
-                Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: I (%d.%d.%d.%d) am no longer in config, so exiting.\n", IP1(My.id), IP2(My.id), IP3(My.id), IP4(My.id));
-        }
-        if ( Conf_proc_by_id_in_conf( Config_Previous, My.id, &op ) < 0 ) {
-                Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: BUG! I (%d.%d.%d.%d) am not in previous config, so exiting.\n", IP1(My.id), IP2(My.id), IP3(My.id), IP4(My.id));
-        } 
+      return TRUE;
+    }
+  }
 
-        if ( strncmp( np.name, op.name, MAX_PROC_NAME ) ||
-             (np.num_if != op.num_if) ||
-             (Config->segments[np.seg_index].bcast_address != Config_Previous->segments[op.seg_index].bcast_address) ) 
-        {
-                /* My identity has changed so exit */
-                Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: My identity has changed: old name (%s), num_if: %d, bcast: %d.%d.%d.%d\t new name (%s), num_if: %d, bcast: %d.%d.%d.%d\n", op.name, op.num_if, IP1(Config_Previous->segments[op.seg_index].bcast_address), IP2(Config_Previous->segments[op.seg_index].bcast_address), IP3(Config_Previous->segments[op.seg_index].bcast_address), IP4(Config_Previous->segments[op.seg_index].bcast_address), np.name, np.num_if, IP1(Config->segments[np.seg_index].bcast_address),  IP2(Config->segments[np.seg_index].bcast_address), IP3(Config->segments[np.seg_index].bcast_address), IP4(Config->segments[np.seg_index].bcast_address) );
-        }
-        /* Check interfaces are identical */
-        for (i = 0 ; i < np.num_if; i++) {
-                if ( (np.ifc[i].ip != op.ifc[i].ip) ||
-                     (np.ifc[i].port != op.ifc[i].port) ||
-                     (np.ifc[i].type != op.ifc[i].type) ) 
-                {
-                        Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: My interface spec has changed so must exit: old (%d.%d.%d.%d:%d - %d) new (%d.%d.%d.%d:%d - %d)\n", IP1(op.ifc[i].ip),  IP1(op.ifc[i].ip),  IP1(op.ifc[i].ip),  IP1(op.ifc[i].ip), op.ifc[i].port, op.ifc[i].type, IP1(np.ifc[i].ip),  IP1(np.ifc[i].ip),  IP1(np.ifc[i].ip),  IP1(np.ifc[i].ip), np.ifc[i].port, np.ifc[i].type );
-                }
-        }
-        /* Check if only new configuration contains only additions and subtractions of daemons and no changes */
-	for ( pi=0; pi < Config->num_total_procs; pi++ )
-	{
-                np = Config->allprocs[pi];
-                if ( Conf_proc_by_id_in_conf( Config_Previous, np.id, &op ) < 0 ) {
-                        Alarmp( SPLOG_INFO, CONF_SYS, "Conf_reload_initiate: Config Added daemon at %d.%d.%d.%d \n", IP1(np.id), IP2(np.id), IP3(np.id), IP4(np.id));
-                } else {
-                        /* compare proc entries to check if identical */
-                        if ( strncmp( np.name, op.name, MAX_PROC_NAME ) ||
-                             (np.num_if != op.num_if) ||
-                             (Config->segments[np.seg_index].bcast_address != Config_Previous->segments[op.seg_index].bcast_address) ) 
-                        {
-                                need_partition = TRUE;
-                                Alarmp( SPLOG_DEBUG, CONF_SYS, "Conf_reload_initiate: identity of daemon %d.%d.%d.%d has changed: old name (%s), num_if: %d, bcast: %d.%d.%d.%d\t new name (%s), num_if: %d, bcast: %d.%d.%d.%d\n", IP1(np.id), IP2(np.id), IP3(np.id), IP4(np.id), op.name, op.num_if, IP1(Config_Previous->segments[op.seg_index].bcast_address), IP2(Config_Previous->segments[op.seg_index].bcast_address), IP3(Config_Previous->segments[op.seg_index].bcast_address), IP4(Config_Previous->segments[op.seg_index].bcast_address), np.name, np.num_if, IP1(Config->segments[np.seg_index].bcast_address),  IP2(Config->segments[np.seg_index].bcast_address), IP3(Config->segments[np.seg_index].bcast_address), IP4(Config->segments[np.seg_index].bcast_address) );
-                        }
-                        /* Check interfaces are identical */
-                        for (i = 0 ; i < np.num_if; i++) {
-                                if ( (np.ifc[i].ip != op.ifc[i].ip) ||
-                                     (np.ifc[i].port != op.ifc[i].port) ||
-                                     (np.ifc[i].type != op.ifc[i].type) ) 
-                                {
-                                        need_partition = TRUE;
-                                        Alarmp( SPLOG_DEBUG, CONF_SYS, "Conf_reload_initiate: daemon interface spec for %d.%d.%d.%d has changed.: old (%d.%d.%d.%d:%d - %d) new (%d.%d.%d.%d:%d - %d)\n", IP1(np.id), IP2(np.id), IP3(np.id), IP4(np.id), IP1(op.ifc[i].ip),  IP1(op.ifc[i].ip),  IP1(op.ifc[i].ip),  IP1(op.ifc[i].ip), op.ifc[i].port, op.ifc[i].type, IP1(np.ifc[i].ip),  IP1(np.ifc[i].ip),  IP1(np.ifc[i].ip),  IP1(np.ifc[i].ip), np.ifc[i].port, np.ifc[i].type );
-                                }
-                        }
-                } /* else */
-	} /* for */
+  if (np_seg->num_seg_addrs != op_seg->num_seg_addrs)
+    i = 0;
 
-        /* free old config structs and arrays since they will never be used again */
-        dispose( Config_Previous->allprocs );
-        dispose( Config_Previous );
+  else
+    for (i = 0; i < np_seg->num_seg_addrs && !spu_addr_ip_cmp(&np_seg->seg_addrs[i], &op_seg->seg_addrs[i], TRUE); ++i)
+      if (me && spu_addr_family(&np_seg->seg_addrs[i]) == AF_INET6 && np_seg->seg_addrs[i].ipv6.sin6_scope_id != op_seg->seg_addrs[i].ipv6.sin6_scope_id)
+        break;
+  
+  if (i != np_seg->num_seg_addrs)
+  {
+    Alarmp(lvl1, CONF_SYS, (me ?
+                            "Conf_reload_initiate: My segment parameters have changed! Exiting!\n" :
+                            "Conf_reload_initiate: A segment's parameters have changed! Partitioning down to singleton!\n"));
+    Alarmp(lvl1, CONF_SYS, "\tOld: name '%s'\n", op->name);
+    Alarmp(lvl2, CONF_SYS, "\tNew: name '%s'\n", np->name);
 
-        Config_Previous = NULL;
-        
-        Alarmp( SPLOG_DEBUG, CONF_SYS, "Conf_reload_initiate: Return need_partition = %d\n", need_partition);
-        return(need_partition);
+    return TRUE;
+  }
+
+  return FALSE;
 }
 
-/* conf_convert_version_to_string()
- * char * segstr : output string
- * int strsize : length of output string space
- * int return : length of string written or -1 if error (like string not have room)
- * 
- *
- * The string will have appended to it the spread version number in the following format.
- *
- * "Version: 3.17.3\n"
- *
+/* Basic algorithm:
+ * 1) copy Config to oldConfig
+ * 2) load new spread.conf file into Config
+ * 3) Check if we should exit;
+ * 4) Check if this change is only add/sub reconfig or not. Return answer
  */
-static  int    conf_convert_version_to_string(char *segstr, int strsize)
+bool    Conf_reload_initiate(void)
 {
-    size_t      curlen = 0;
-    char        temp_str[30];
+  char idstr[MAX_ID_SIZE];
+  bool need_singleton = FALSE;
+  proc *np, *op, *op2;
+  int  i;
 
-    sprintf(temp_str, "Version: %d.%d", 
-            SP_MAJOR_VERSION,
-            SP_MINOR_VERSION );
+  /* make a copy of current configuration then load new configuration */
+  
+  if ((Config_Previous = Mem_alloc(sizeof(configuration))) == NULL)
+    Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: Failed to allocate memory for old configuration structure\n");        
+        
+  if ((Config_Previous->allprocs = Mem_alloc(MAX_PROCS_RING * sizeof(proc))) == NULL)
+    Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: Failed to allocate memory for old configuration procs array\n");
 
-    strncat( segstr, temp_str, strsize - curlen);
-    curlen += strlen(temp_str);
+  Conf_config_copy(Config, Config_Previous);
 
-    /* terminate each segment by a newline */
-    strncat( segstr, "\n", strsize - curlen);
-    curlen += 1;
+  if (Conf_proc_ref_by_id_in_conf(Config_Previous, My.id, &op) < 0)
+    Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: BUG! My.id(%s) is not in previous config!\n", Conf_id_to_str(My.id, idstr));
 
-    if ((int) curlen > strsize) {
-        /* ran out of space in string -- should never happen. */
-        Alarmp( SPLOG_ERROR, CONF_SYS, "The conf hash string is too long! %d characters attemped is more then %d characters allowed", curlen, strsize);
-        Alarmp( SPLOG_ERROR, CONF_SYS, "The error occured when adding the version number. Successful string was: %s\n", segstr);
-        return(-1);
+  Conf_load_conf_file(Conf_FileName, Conf_MyName);  /* NOTE: updates My */
+
+  /* check if this daemon is still in config with same identity + networking; exit if not */
+        
+  if (Conf_proc_ref_by_id(My.id, &np) < 0)
+    Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_reload_initiate: BUG! New My.id(%s) is no longer in config!\n", Conf_id_to_str(My.id, idstr));
+
+  Conf_daemon_changed(np, &Config->segments[np->seg_index], op, &Config_Previous->segments[op->seg_index], TRUE);  /* NOTE: will print + exit if this daemon has changed */
+  
+  /* check that any daemons both in old and new configs still have same identity + networking */
+  /* NOTE: Do we really require that all surviving daemons' networking can't change at all? Probably not, but this is safe. */
+  
+  for (i = 0; i < Config->num_total_procs; ++i)
+  {
+    np = &Config->allprocs[i];
+    Conf_proc_ref_by_name_in_conf(Config_Previous, np->name, (op = NULL, &op));
+    Conf_proc_ref_by_id_in_conf(Config_Previous, np->id, (op2 = NULL, &op2));
+    
+    /* NOTE: we need to be paranoid here bc user could change daemon names and/or vids at same time */
+    
+    if (op == NULL && op2 == NULL)
+    {
+      Alarmp(SPLOG_INFO, CONF_SYS, "Conf_reload_initiate: Added new daemon: name %s, addr [%s]:%u, id '%s'\n",
+             np->name, SPU_ADDR_NTOP_CANON(&np->proc_addr), (unsigned) spu_addr_ip_get_port(&np->proc_addr), Conf_id_to_str(np->id, idstr));
+      continue;
     }
 
-    Alarmp( SPLOG_DEBUG, CONF_SYS, "The version string is %d characters long:\n%s", curlen, segstr);
-    return(curlen);
+    if (op != op2)
+    {
+      Alarmp(SPLOG_INFO, CONF_SYS, "Conf_reload_initiate: daemon identity mapped to two different old daemons: name '%s' -> %p, id '%s' -> %p! Partitioning to singleton!\n",
+             np->name, op, Conf_id_to_str(np->id, idstr), op2);
+            
+      need_singleton = TRUE;
+      break;
+    }
+
+    if ((need_singleton = Conf_daemon_changed(np, &Config->segments[np->seg_index], op, &Config_Previous->segments[op->seg_index], FALSE)))
+      break;
+  }
+
+  /* free old config structs and arrays since they will never be used again */
+  
+  dispose(Config_Previous->allprocs);
+  dispose(Config_Previous);
+  Config_Previous = NULL;
+        
+  Alarmp(SPLOG_INFO, CONF_SYS, "Conf_reload_initiate: Return need_singleton = %d\n", need_singleton);
+        
+  return need_singleton;
 }
 
-void	Conf_load_conf_file( char *file_name, char *my_name )
+void	Conf_load_conf_file(char *file_name, char *my_name)
 {
-        struct hostent  *host_ptr;
-	char	machine_name[256];
-	char	ip[16];
-	int	i,j;
-        int     added_len;
-        unsigned int name_len;
-        char    configfile_location[MAXPATHLEN];
+        size_t    num_ips;
+        spu_addr *ips                             = ip_enum_local(&num_ips);
+        char      configfile_location[MAXPATHLEN] = { 0 };
+        int32u    scope_id                        = 0;
+	char	  idstr[MAX_ID_SIZE];
+        char      name[MAX_PROC_NAME];
+        int       i;
+        size_t    j;
+        
+        if (ips == NULL || num_ips == 0)
+          Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_load_conf_file: Couldn't find any local internet addresses on this machine!\n");
 
-        /* Initialize hash string */
-        ConfStringRep[0] = '\0';
-        ConfStringLen = 0;
-
-	/* init Config from file
-	   init My from host
-	 */
-        configfile_location[0] = '\0';
+        /* open configuration file */
+        
         strcat(configfile_location, SPREAD_ETCDIR);
         strcat(configfile_location, "/spread.conf");
 
-	if (NULL != (yyin = fopen(file_name,"r")) )
-                Alarm( PRINT, "Conf_load_conf_file: using file: %s\n", file_name);
-	if (yyin == NULL) 
-		if (NULL != (yyin = fopen("./spread.conf", "r")) )
-                        Alarm( PRINT, "Conf_load_conf_file: using file: ./spread.conf\n");
-	if (yyin == NULL)
-		if (NULL != (yyin = fopen(configfile_location, "r")) )
-                        Alarm( PRINT, "Conf_load_conf_file: using file: %s\n", configfile_location);
-	if (yyin == NULL)
-		Alarm( EXIT, "Conf_load_conf_file: error opening config file %s\n",
-			file_name);
+	if (NULL != (yyin = fopen(file_name,"r")))
+          Alarmp(SPLOG_INFO, CONF_SYS, "Conf_load_conf_file: using file: %s\n", file_name);
+        
+	else if (NULL != (yyin = fopen("./spread.conf", "r")))
+          Alarmp(SPLOG_INFO, CONF_SYS, "Conf_load_conf_file: using file: ./spread.conf\n");
+        
+	else if (NULL != (yyin = fopen(configfile_location, "r")))
+          Alarmp(SPLOG_INFO, CONF_SYS, "Conf_load_conf_file: using file: %s\n", configfile_location);
+        
+        else
+          Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_load_conf_file: error opening config file %s and alternates!\n", file_name);
 
-        /* reinitialize all the variables in the yacc parser */
-        parser_init();
+        /* reinitialize and run parser */
         
+        parser_init();        
 	yyparse();
-
         fclose(yyin);
 
-        /* Test for localhost segemnt defined with other non-localhost segments.
-         * That is an invalid configuration 
-         */
-        if ( Config->num_segments > 1 ) {
-            int found_localhost = 0;
-            int found_nonlocal = 0;
-            for ( i=0; i < Config->num_segments; i++) {
-                if ( ((Config->segments[i].bcast_address & 0xff000000) >> 24) == 127 ) {
-                    found_localhost = 1;
-                } else {
-                    found_nonlocal = 1;
-                }
-            }
-            if (found_nonlocal && found_localhost) {
-                /* Both localhost and non-localhost segments exist. This is a non-functional config.*/
-                Alarmp( SPLOG_PRINT, PRINT, "Conf_load_conf_file: Invalid configuration:\n");
-                Conf_print( Config );
-                Alarmp( SPLOG_PRINT, PRINT, "\n");
-                Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_load_conf_file: Localhost segments can not be used along with regular network address segments.\nMost likely you need to remove or comment out the \nSpread_Segment 127.0.0.255 {...}\n section of your configuration file.\n");
-            }
-        }
+        /* match my_name to an entry in configuration file */
+        
+	if (my_name == NULL)
+        {
+          for (i = 0; i < Config->num_total_procs; ++i)
+            for (j = 0; j < num_ips; ++j)
+              if (!spu_addr_ip_cmp(&Config->allprocs[i].proc_addr, &ips[j], FALSE))
+              {
+                My = Config->allprocs[i];
+                goto DONE;
+              }
 
-        /* Add Spread daemon version number to hash string */
-        added_len = conf_convert_version_to_string(&ConfStringRep[ConfStringLen], MAX_CONF_STRING - ConfStringLen );
-        if (added_len == -1 )
-            Alarmp( SPLOG_FATAL, CONF_SYS, "Failed to update string with version number!\n");
-        ConfStringLen += added_len;
-
-	/* append whether we are running with accelerated token or not */
-
-	if (ConfStringLen >= MAX_CONF_STRING) {
-	  Alarmp( SPLOG_FATAL, CONF_SYS, "Failed to update string with accelerated ring type!\n");
+        DONE:
+          if (i == Config->num_total_procs)
+            Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_load_conf_file: None of this machine's internet addresses match any daemon's address in configuration!\n");
 	}
+        else
+        {
+          strncpy(name, my_name, MAX_PROC_NAME);
+          name[MAX_PROC_NAME - 1] = 0;
+                
+          if (Conf_proc_by_name(name, &My) < 0)
+            Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_load_conf_file: My proc %s is not in configuration!\n", name);
+	}
 
-	ConfStringRep[ConfStringLen++] = '0' + AcceleratedRing;
-	
-        /* calculate hash value of configuration. 
-         * This daemon will only work with other daemons who have an identical hash value.
-         */
-        Config->hash_code = conf_hash_string(ConfStringRep, ConfStringLen);
-        Alarmp( SPLOG_DEBUG, CONF_SYS, "Full hash string is %d characters long:\n%s", ConfStringLen, ConfStringRep);
-        Alarmp( SPLOG_INFO, CONF_SYS, "Hash value for this configuration is: %u\n", Config->hash_code);
+        /* make sure that the addresses we configured for this daemon are actually on this machine */
+        /* set IPv6 sin6_scope_id's */
 
-        /* Match my IP address to entry in configuration file */
-	if( my_name == NULL ){
-                int32u *ips = Ip_enum_all();
+        for (j = 0; j < num_ips && spu_addr_ip_cmp(&My.proc_addr, &ips[j], FALSE); ++j);
 
-		i = -1;
-                for (j = 0; ips[j] != 0; j++) {
-			My.id = ntohl( ips[j] );
-                        Alarmp( SPLOG_DEBUG, CONF_SYS, "Conf_load_conf_file: trying IP %d.%d.%d.%d\n", IP1(My.id), IP2(My.id), IP3(My.id), IP4(My.id) );
-			i = Conf_proc_by_id( My.id, &My );
-			if( i >= 0 ) break;
-                }
-		if ( i < 0 ) {
-                        Alarm( EXIT, "Conf_load_conf_file: None of local IPs found in configuration\n" );
-                }
+        if (j >= num_ips)
+          Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_load_conf_file: None of this machine's internet addresses match this daemon's address %s!\n", SPU_ADDR_NTOP(&My.proc_addr));
 
-                free(ips);
+        if (spu_addr_family(&My.proc_addr) == AF_INET6)
+        {
+          if (My.proc_addr.ipv6.sin6_scope_id == 0)                       /* NOTE: if address contained an interface spec (e.g. - %eth0), then parser did an if_nametoindex() on it; otherwise zero */
+            My.proc_addr.ipv6.sin6_scope_id = ips[j].ipv6.sin6_scope_id;  /* if no interface was spec'd or the lookup failed; try to use whatever ip_enum_local found instead (e.g. - getifaddrs) */
 
-	}else if( ! strcmp( my_name, "Monitor" ) ){
-		gethostname(machine_name,sizeof(machine_name)); 
-		host_ptr = gethostbyname(machine_name);
+          if ((scope_id = My.proc_addr.ipv6.sin6_scope_id) != 0)
+            Alarmp(SPLOG_INFO, CONF_SYS, "Conf_load_conf_file: my ipv6 address [%s] corresponds with interface index %u; using that (sin6_scope_id) for all unicast sends!\n",
+                   SPU_ADDR_NTOP(&My.proc_addr), (unsigned) scope_id);
 
-		if( host_ptr == 0 )
-			Alarm( EXIT, "Conf_load_conf_file: no such monitor host %s\n",
-				machine_name );
+          else
+            Alarmp(SPLOG_WARNING, CONF_SYS, "Conf_load_conf_file: couldn't find an interface index that corresponds with my address [%s]! Trying to use a scope_id of 0 for all unicast sends!\n",
+                   SPU_ADDR_NTOP(&My.proc_addr));
+          
+          for (i = 0; i < Config->num_total_procs; ++i)
+            Config->allprocs[i].proc_addr.ipv6.sin6_scope_id = scope_id;
 
-        	memcpy(&My.id, host_ptr->h_addr_list[0], 
-			sizeof(int32) );
-		My.id = ntohl( My.id );
+          for (i = 0; i < Config->segments[My.seg_index].num_seg_addrs; ++i)
+          {
+            if (Config->segments[My.seg_index].seg_addrs[i].ipv6.sin6_scope_id == 0)                
+              Config->segments[My.seg_index].seg_addrs[i].ipv6.sin6_scope_id = scope_id;
 
-		name_len = strlen( machine_name );
-		if( name_len > sizeof(My.name) ) name_len = sizeof(My.name);
-		memcpy(My.name, machine_name, name_len );
-		Alarm( CONF_SYS, "Conf_load_conf_file: My name: %s, id: %d\n",
-			My.name, My.id );
-		return;
-	}else{
-		name_len = strlen( my_name );
-		if( name_len > sizeof(My.name) ) name_len = sizeof(My.name);
-		memcpy(My.name, my_name, name_len );
-		i = Conf_proc_by_name( My.name, &My );
-		if( i < 0  ) Alarm( EXIT,
-				"Conf_load_conf_file: My proc %s is not in configuration \n",
-				My.name);
+            if (Config->segments[My.seg_index].seg_addrs[i].ipv6.sin6_scope_id != 0)            
+              Alarmp(SPLOG_INFO, CONF_SYS, "Conf_load_conf_file: my ipv6 segment address [%s] corresponds with interface index %u; using that (sin6_scope_id) for this segment address!\n",
+                     SPU_ADDR_NTOP(&Config->segments[My.seg_index].seg_addrs[i]), (unsigned) Config->segments[My.seg_index].seg_addrs[i].ipv6.sin6_scope_id);
 
-	}
+            else
+              Alarmp(SPLOG_WARNING, CONF_SYS, "Conf_load_conf_file: couldn't find an interface index that corresponds with my segment address [%s]! Trying to use a scope_id of 0 for this segment address!\n",
+                     SPU_ADDR_NTOP(&Config->segments[My.seg_index].seg_addrs[i]));
+          }
+        }
 
-	Conf_id_to_str( My.id, ip );
+        for (i = 0; i < My.num_if; ++i)
+        {
+          if (spu_addr_ip_is_unspecified(&My.ifc[i].ifaddr) || spu_addr_ip_is_multicast(&My.ifc[i].ifaddr))
+            continue;
+         
+          for (j = 0; j < num_ips && spu_addr_ip_cmp(&My.ifc[i].ifaddr, &ips[j], FALSE); ++j);
+          
+          if (j >= num_ips)
+          {
+            Alarmp(SPLOG_WARNING, CONF_SYS, "Conf_load_conf_file: none of this machine's addresses match configured interface %s\n", SPU_ADDR_NTOP(&My.ifc[i].ifaddr));            
+            continue;
+          }
 
-	if (PersonalWindow > Window) {
-	  Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_load_conf_file: PersonalWindow (%d) > Window (%d)!\n", PersonalWindow, Window);
-	}
+          if (spu_addr_family(&My.ifc[i].ifaddr) == AF_INET6 && My.ifc[i].ifaddr.ipv6.sin6_scope_id == 0)
+            if ((My.ifc[i].ifaddr.ipv6.sin6_scope_id = ips[j].ipv6.sin6_scope_id) == 0)
+              My.ifc[i].ifaddr.ipv6.sin6_scope_id = scope_id;
 
-	if (AcceleratedRing && AcceleratedWindow > PersonalWindow) {
-	  Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_load_conf_file: AcceleratedWindow (%d) > PersonalWindow (%d)!\n", AcceleratedWindow, PersonalWindow);
-	}
-
-	Alarm( CONF_SYS, "Conf_load_conf_file: My name: %s, id: %s, port: %hu\n",
-		My.name, ip, My.port );
-
-	return;
+          Alarmp(SPLOG_INFO, CONF_SYS, "Conf_load_conf_file: using sin6_scope_id %u for interface %s\n", (unsigned) My.ifc[i].ifaddr.ipv6.sin6_scope_id, SPU_ADDR_NTOP(&My.ifc[i].ifaddr));
+        }
+        
+	Alarmp(SPLOG_INFO, CONF_SYS, "Conf_load_conf_file: My name: %s, id: %s, addr: %s, port: %u\n",
+               My.name, Conf_id_to_str(My.id, idstr), SPU_ADDR_NTOP(&My.proc_addr), (unsigned) spu_addr_ip_get_port(&My.proc_addr));
+        
+        free(ips);
 }
 
 configuration	Conf()
@@ -529,44 +485,47 @@
 	return	My;
 }
 
-void    Conf_set_link_protocol(int protocol)
+int	Conf_proc_by_id( int32u id, proc *p )
 {
-        if (protocol < 0 || protocol >= MAX_PROTOCOLS) {
-                Alarm(PRINT, "Conf_set_link_protocol: Illegal protocol type %d\n", protocol);
-                return;
-        }
-        Link_Protocol = protocol;
+        return( Conf_proc_by_id_in_conf( Config, id, p ));
 }
 
-int     Conf_get_link_protocol(void)
+int     Conf_proc_ref_by_id( int32u id, proc **p )
 {
-        return(Link_Protocol);
+        return( Conf_proc_ref_by_id_in_conf( Config, id, p ));
 }
 
-
-int	Conf_proc_by_id( int32u id, proc *p )
+int 	Conf_proc_by_name( char *name, proc *p )
 {
-        return( Conf_proc_by_id_in_conf( Config, id, p ));
+        return( Conf_proc_by_name_in_conf( Config, name, p));
 }
 
-int 	Conf_proc_by_name( char *name, proc *p )
+int 	Conf_proc_ref_by_name( char *name, proc **p )
 {
-        return( Conf_proc_by_name_in_conf( Config, name, p));
+        return( Conf_proc_ref_by_name_in_conf( Config, name, p));
 }
 
 int	Conf_proc_by_id_in_conf( configuration *config, int32u id, proc *p )
 {
-	int	i,j;
+        int   ret;
+        proc *p2;
 
+        if ( (ret = Conf_proc_ref_by_id_in_conf( config, id, &p2 )) >= 0 )
+                *p = *p2;
+
+	return( ret );
+}
+
+int     Conf_proc_ref_by_id_in_conf( configuration *config, int32u id, proc **p )
+{
+        int i;
+
 	for ( i=0; i < config->num_total_procs; i++ )
 	{
-                for ( j=0; j < config->allprocs[i].num_if; j++)
+                if ( config->allprocs[i].id == id )
                 {
-                        if ( config->allprocs[i].ifc[j].ip == id )
-                        {
-                                *p =  config->allprocs[i] ;
-                                return( i );
-                        }
+                        *p = &config->allprocs[i];
+                        return( i );
                 }
 	}
 	return( -1 );
@@ -574,95 +533,73 @@
 
 int 	Conf_proc_by_name_in_conf( configuration *config, char *name, proc *p )
 {
+        int   ret;
+        proc *p2;
+
+        if ( (ret = Conf_proc_ref_by_name_in_conf( config, name, &p2 )) >= 0 )
+                *p = *p2;
+
+	return( ret );
+}
+
+int 	Conf_proc_ref_by_name_in_conf( configuration *config, char *name, proc **p )
+{
 	int	i;
 
 	for ( i=0; i < config->num_total_procs; i++ )
 	{
-		if ( strcmp( config->allprocs[i].name, name ) == 0 )
+                if ( !strcmp( config->allprocs[i].name, name ) )
 		{
-			*p = config->allprocs[i];
+			*p = &config->allprocs[i];
 			return( i );
 		}
 	}
 	return( -1 );
 }
 
-
 int	Conf_id_in_seg( segment *seg, int32u id )
 {
-	int 	i,j;
+	int 	j;
 
 	for ( j=0; j < seg->num_procs; j++ )
 	{
-                for ( i=0; i < seg->procs[j]->num_if; i++)
-                {
-                        if ( seg->procs[j]->ifc[i].ip == id )
-                                return( j );
-                }
+                if ( seg->procs[j]->id == id )
+                        return( j );
 	}
 	return( -1 );
 }
 
 void    Conf_config_copy( configuration *src_conf, configuration *dst_conf)
 {
-    int i,j,p_index;
-    proc p;
+    int  i, j, p_index;
+    proc p, *pp;
 
-    dst_conf->hash_code = src_conf->hash_code;
-    dst_conf->num_segments = src_conf->num_segments;
-    dst_conf->num_total_procs = src_conf->num_total_procs;
+    pp                 = dst_conf->allprocs;
+    *dst_conf          = *src_conf;
+    dst_conf->allprocs = pp;
+    
+    for (i = 0; i < src_conf->num_total_procs; ++i)
+      dst_conf->allprocs[i] = src_conf->allprocs[i];
 
-    for (i=0; i < src_conf->num_total_procs; i++ )
-    {
-        memcpy( &dst_conf->allprocs[i], &src_conf->allprocs[i], sizeof( proc ) );
-    }
-
-    for (i=0; i < src_conf->num_segments; i++ )
-    {
-        dst_conf->segments[i].bcast_address = src_conf->segments[i].bcast_address;
-        dst_conf->segments[i].port = src_conf->segments[i].port;
-        dst_conf->segments[i].num_procs = src_conf->segments[i].num_procs;
-        for ( j=0; j < src_conf->segments[i].num_procs; j++ )
+    for (i = 0; i < src_conf->num_segments; ++i)
+        for (j = 0; j < src_conf->segments[i].num_procs; ++j)
         {
             p_index = Conf_proc_by_id_in_conf(dst_conf, src_conf->segments[i].procs[j]->id, &p);
-            assert(p_index != -1);
-            dst_conf->segments[i].procs[j] = &(dst_conf->allprocs[p_index]);
+            assert(p_index >= 0);
+            dst_conf->segments[i].procs[j] = &dst_conf->allprocs[p_index];
         }
-    }        
-
+    
 #ifndef NDEBUG
-    /* Verify correct state after copy */
-    for (i=0; i < dst_conf->num_segments; i++ )
-    {
-        for ( j=0; j < dst_conf->segments[i].num_procs; j++ )
-        {
-            assert( dst_conf->segments[i].procs[j]->id == src_conf->segments[i].procs[j]->id );
-        }
-    }
+    for (i = 0; i < dst_conf->num_segments; ++i)
+        for (j = 0; j < dst_conf->segments[i].num_procs; ++j)
+            assert(dst_conf->segments[i].procs[j]->id == src_conf->segments[i].procs[j]->id);
 #endif
 }
 
-static  int     Conf_proc_ref_by_id( int32u id, proc **p )
-{
-	int	i,j;
-
-	for ( i=0; i < Config->num_total_procs; i++ )
-	{
-                for ( j=0; j < Config->allprocs[i].num_if; j++)
-                {
-                        if ( Config->allprocs[i].ifc[j].ip == id )
-                        {
-                                *p = &Config->allprocs[i];
-                                return( i );
-                        }
-                }
-	}
-	return( -1 );
-}
-
 int     Conf_append_id_to_seg( segment *seg, int32u id)
 {
         proc *p;
+        
         if (Conf_proc_ref_by_id(id, &p) != -1)
         {
                 seg->procs[seg->num_procs] = p;
@@ -671,11 +608,12 @@
         } 
         return( -1 );
 }
+
 int	Conf_id_in_conf( configuration *config, int32u id )
 {
 	int 	i;
 
-	for ( i=0; i < config->num_segments; i++ )
+	for ( i = 0; i < config->num_segments; ++i )
                 if ( Conf_id_in_seg(&(config->segments[i]), id) >= 0 )
                         return( i );
 	return( -1 );
@@ -683,10 +621,9 @@
 
 int	Conf_num_procs( configuration *config )
 {
-	int 	i,ret;
+	int 	i, ret = 0;
 
-	ret = 0;
-	for ( i=0; i < config->num_segments; i++ )
+	for ( i = 0; i < config->num_segments; ++i )
 		ret += config->segments[i].num_procs;
 
 	return( ret );
@@ -701,80 +638,61 @@
 {
         int i;
 
-        for( i=0; i < config->num_segments; i++ )
-        {
+        for( i = 0; i < config->num_segments; ++i )
                 if( config->segments[i].num_procs > 0 )
                         return( config->segments[i].procs[0]->id );
-        }
+        
 	Conf_print( config );
-        Alarm( EXIT, "Conf_leader: Empty configuration\n" );
+        Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_leader: Empty configuration\n" );
+        
 	return( -1 );
 }
 
 int32u	Conf_last( configuration *config )
 {
-        int i,j;
+        int i;
 
-        for( i = config->num_segments-1; i >= 0; i-- )
-        {
+        for( i = config->num_segments - 1; i >= 0; --i )
                 if( config->segments[i].num_procs > 0 )
-		{
-			j = config->segments[i].num_procs-1;
-                        return( config->segments[i].procs[j]->id );
-		}
-        }
+                        return( config->segments[i].procs[config->segments[i].num_procs - 1]->id );
+        
 	Conf_print( config );
-        Alarm( EXIT, "Conf_last: Empty configuration\n" );
+        Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_last: Empty configuration\n" );
+        
 	return( -1 );
 }
 
 int32u Conf_previous( configuration *config )
 {
-        segment *seg_ptr;
         int index_in_seg;
         int i;
 
-        seg_ptr      = &config->segments[My.seg_index];
-        index_in_seg = Conf_id_in_seg( seg_ptr, My.id );
+        index_in_seg = Conf_id_in_seg( &config->segments[My.seg_index], My.id );
 
         if( index_in_seg > 0 )
-        {
-                /* I am not first in my segment; previous is previous proc in segment */
-                return seg_ptr->procs[index_in_seg - 1]->id;
-        }
+          return config->segments[My.seg_index].procs[index_in_seg - 1]->id;           /* I am not first in my segment; previous is previous proc in segment */
 
         for( i = My.seg_index - 1; i >= 0; --i )
-        {
-                if( config->segments[i].num_procs > 0 )
-                {
-                        /* There is a segment before mine; previous is last in that segment */
-                        seg_ptr = &config->segments[i];
-                        return seg_ptr->procs[seg_ptr->num_procs - 1]->id;
-                }
-        }
+                if( config->segments[i].num_procs > 0 )  
+                        return config->segments[i].procs[config->segments[i].num_procs - 1]->id;  /* There is a non-empty segment before mine; previous is last in that segment */
 
-        /* I am first in first non-empty segment; previous is last in last segment */
-
         for( i = config->num_segments - 1; i >= My.seg_index; --i )
-        {
                 if( config->segments[i].num_procs > 0 )
-                {
-                        seg_ptr = &(config->segments[i]);
-                        return seg_ptr->procs[seg_ptr->num_procs - 1]->id;
-                }
-        }
-        Alarm( EXIT, "Conf_previous: No process found\n" );
+                        return config->segments[i].procs[config->segments[i].num_procs - 1]->id;  /* I am first in first non-empty segment; previous is last in last segment */
+        
+        Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_previous: No process found\n" );
+        
         return( -1 );
 }
 
 int32u	Conf_seg_leader( configuration *config, int16 seg_index )
 {
 	if( config->segments[seg_index].num_procs > 0 )
-	{
 		return( config->segments[seg_index].procs[0]->id );
-	}
+
 	Conf_print( config );
-        Alarm( EXIT, "Conf_seg_leader: Empty segment %d in Conf\n", seg_index );
+        Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_seg_leader: Empty segment %d in Conf\n", seg_index );
+        
 	return( -1 );
 }
 
@@ -787,8 +705,10 @@
 		j = config->segments[seg_index].num_procs-1;
 		return( config->segments[seg_index].procs[j]->id );
 	}
+        
 	Conf_print( config );
-        Alarm( EXIT, "Conf_seg_leader: Empty segment %d in Conf\n", seg_index );
+        Alarmp( SPLOG_FATAL, CONF_SYS, "Conf_seg_leader: Empty segment %d in Conf\n", seg_index );
+        
         return(-1);
 }
 
@@ -797,41 +717,64 @@
 	return( config->segments[seg_index].num_procs );
 }
 
-void	Conf_id_to_str( int32u id, char *str )
+char   *Conf_id_to_str( int32u id, char *str )
 {
-	int32u	i1,i2,i3,i4;
+  snprintf(str, MAX_ID_SIZE, "%u.%u.%u.%u",
+           (unsigned) ((id >> 24) & 0xff),
+           (unsigned) ((id >> 16) & 0xff),
+           (unsigned) ((id >> 8)  & 0xff),
+           (unsigned) (id         & 0xff));
 
-	i1 = (id & 0xff000000) >> 24;
-	i2 = (id & 0x00ff0000) >> 16;
-	i3 = (id & 0x0000ff00) >> 8;
-	i4 = (id & 0x000000ff);
-	sprintf( str, "%u.%u.%u.%u", i1, i2, i3, i4 );
+  return str;
 }
 
+int32u Conf_str_to_id(const char *str)
+{
+  size_t tlen = strlen(str) + 1;
+  int32u ret  = (int32u) stdhcode_oaat(str, tlen);
+
+  /* NOTE: auto-generated vids must be a cross platform (in host byte order), deterministic function of proc.name only! */
+                            
+  if (ret == 0)                   /* protect reserved proc id's: 0 ~1 in 2^32 chance */
+  {
+    ret = (int32u) tlen << 16;    /* assume users will typically configure either most or least significant byte of VIDs; avoid them */
+
+    if (ret == 0)                 /* next to impossible: requires a tlen with lower 16 bits == 0 and that hashes to zero */
+      ret = (int32u) 0x1 << 16;   /* assume users will typically configure either most or least significant byte of VIDs; avoid them */
+  }
+
+  return ret;  
+}
+
 int	Conf_print(configuration *config)
 {
-	int 	s,p,ret;
-	char	ip[16];
+	int 	s,p;
+	char	idstr[MAX_ID_SIZE];
 	proc	pr;
 
-	Alarm( PRINT, "--------------------\n" );
-	Alarm( PRINT, "Configuration at %s is:\n", My.name );
-	Alarm( PRINT, "Num Segments %d\n",config->num_segments );
+	Alarmp(SPLOG_PRINT, CONF_SYS, "--------------------\n" );
+	Alarmp(SPLOG_PRINT, CONF_SYS, "Configuration at %s is:\n", My.name );
+	Alarmp(SPLOG_PRINT, CONF_SYS, "Num Segments %d\n", config->num_segments );
+        
 	for ( s=0; s < config->num_segments; s++ )
 	{
-		Conf_id_to_str( config->segments[s].bcast_address, ip );
-		Alarm( PRINT, "\t%d\t%-16s  %hu\n",
-			config->segments[s].num_procs, ip,
-			config->segments[s].port );
+                Alarmp(SPLOG_PRINT, CONF_SYS, "\t%d", config->segments[s].num_procs);
+
+                for (p = 0; p < config->segments[s].num_seg_addrs; ++p)                 
+                  Alarmp(SPLOG_PRINT | SPLOG_NODATE, CONF_SYS, "\t[%s]:%u", SPU_ADDR_NTOP(&config->segments[s].seg_addrs[p]), (unsigned) spu_addr_ip_get_port(&config->segments[s].seg_addrs[p]));
+
+                Alarmp(SPLOG_PRINT | SPLOG_NODATE, CONF_SYS, "\n");
+                
 		for( p=0; p < config->segments[s].num_procs; p++)
 		{
-			ret = Conf_proc_by_id( config->segments[s].procs[p]->id,
-					&pr );	
-			Conf_id_to_str( pr.id, ip );
-			Alarm( PRINT, "\t\t%-20s\t%-16s\n", pr.name, ip );
+			Conf_proc_by_id( config->segments[s].procs[p]->id, &pr );	
+			Alarmp(SPLOG_PRINT, CONF_SYS, "\t\t%-" QQ(MAX_PROC_NAME) "s\t%s\tID: %-" QQ(MAX_ID_SIZE) "s\n",
+                               pr.name, SPU_ADDR_NTOP(&pr.proc_addr), Conf_id_to_str(pr.id, idstr) );
 		}
 	}
-	Alarm( PRINT, "====================\n" );
+        
+	Alarmp(SPLOG_PRINT, CONF_SYS, "====================\n" );
+        
 	return( 0 );
 }
 
@@ -839,19 +782,23 @@
 int	Conf_print_procs(configuration *config)
 {
 	int 	i;
-	char	ip[16];
+	char	idstr[MAX_ID_SIZE];
 
-	Alarm( PRINT, "--------------------\n" );
-	Alarm( PRINT, "Configured Procs\n");
-	Alarm( PRINT, "Total Num %d\n",config->num_total_procs );
+	Alarmp(SPLOG_PRINT, CONF_SYS, "--------------------\n" );
+	Alarmp(SPLOG_PRINT, CONF_SYS, "Configured Procs at %s is:\n", My.name );
+	Alarmp(SPLOG_PRINT, CONF_SYS, "Num Procs %d\n",config->num_total_procs );
+        
 	for ( i=0; i < config->num_total_procs; i++ )
 	{
-                Conf_id_to_str( config->allprocs[i].id, ip );
-                Alarm( PRINT, "\t%s:%d\tID: %-16s NumIF: %d\n",
-                       config->allprocs[i].name, config->allprocs[i].port,
-                       ip, config->allprocs[i].num_if);
+                const proc *pr = &config->allprocs[i];
+          
+                Alarmp(SPLOG_PRINT, CONF_SYS, "\t%-" QQ(MAX_PROC_NAME) "s\tID: %-" QQ(MAX_ID_SIZE) "s\t[%s]:%u\tNumIfs: %d\n",
+                       pr->name, Conf_id_to_str(config->allprocs[i].id, idstr), 
+                       SPU_ADDR_NTOP(&pr->proc_addr), (unsigned) spu_addr_ip_get_port(&pr->proc_addr), config->allprocs[i].num_if);
+                       
         }
-	Alarm( PRINT, "====================\n" );
+	Alarmp(SPLOG_PRINT, CONF_SYS, "====================\n" );
+                
 	return( 0 );
 }
 
@@ -862,14 +809,11 @@
 
 void    Conf_set_dangerous_monitor_state(bool new_state)
 {
-        if (new_state == FALSE) {
-                Alarm(PRINT, "disabling Dangerous Monitor Commands!\n");
-        } else if (new_state == TRUE) {
-                Alarm(PRINT, "ENABLING Dangerous Monitor Commands! Make sure Spread network is secured\n");
-        } else {
-                /* invalid setting */
-                return;
-        }
+        if (new_state)
+          Alarmp(SPLOG_PRINT, CONF_SYS, "ENABLING Dangerous Monitor Commands! Make sure Spread network is secured\n");
+        else
+          Alarmp(SPLOG_PRINT, CONF_SYS, "Disabling Dangerous Monitor Commands!\n");
+
         EnableDangerousMonitor = new_state;
 }
 
@@ -882,56 +826,54 @@
 {
         switch (state)
         {
-        case port_reuse_auto:
-                Alarm(PRINT, "Setting SO_REUSEADDR to auto\n");
+        case PORT_REUSE_AUTO:
+                Alarmp(SPLOG_PRINT, CONF_SYS, "Setting SO_REUSEADDR to auto\n");
                 break;
-        case port_reuse_on:
-                Alarm(PRINT, "Setting SO_REUSEADDR to always on -- make sure Spread daemon host is secured!\n");
+        case PORT_REUSE_ON:
+                Alarmp(SPLOG_PRINT, CONF_SYS, "Setting SO_REUSEADDR to always on -- make sure Spread daemon host is secured!\n");
                 break;
-        case port_reuse_off:
-                Alarm(PRINT, "Setting SO_REUSEADDR to always off\n");
+        case PORT_REUSE_OFF:
+                Alarmp(SPLOG_PRINT, CONF_SYS, "Setting SO_REUSEADDR to always off\n");
                 break;
         default:
-                /* Inavlid type -- ignored */
-                return;
+                Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_set_port_reuse_type: Bug! Unexpected state %d!\n", state);
+                break;
         }
         SocketPortReuse = state;
 }
 
-static void set_param_if_valid(char **param, char *value, char *description, unsigned int max_value_len)
+static void set_param_if_valid(char **param, char *value, char *description, size_t max_value_len)
 {
         if (value != NULL && *value != '\0')
         {
-                unsigned int len = strlen(value);
-                char *old_value = *param;
-                char *buf;
+                size_t len       = strlen(value);
+                char  *old_value = *param;
+                char  *buf;
+                
                 if (len > max_value_len)
-                {
-                    Alarmp(SPLOG_FATAL, CONF_SYS, "set_param_if_valid: value string too long\n");
-                }
-                buf = Mem_alloc(len + 1);
-                if (buf == NULL)
-                {
-                        Alarmp(SPLOG_FATAL, CONF_SYS, "set_param_if_valid: Out of memory\n");
-                }
+                  Alarmp(SPLOG_FATAL, CONF_SYS, "set_param_if_valid: value string too long\n");
+
+                if (NULL == (buf = Mem_alloc(len + 1)))
+                  Alarmp(SPLOG_FATAL, CONF_SYS, "set_param_if_valid: Out of memory\n");
+                
                 strncpy(buf, value, len);
                 buf[len] = '\0';
 
                 *param = buf;
+                
                 if (old_value != NULL)
-                {
                     dispose(old_value);
-                }
-                Alarm(PRINT, "Set %s to '%s'\n", description, value);
+
+                Alarmp(SPLOG_INFO, CONF_SYS, "Set %s to '%s'\n", description, value);
         }
         else
-        {
-                Alarm(DEBUG, "Ignored invalid %s\n", description);
-        }
+          Alarmp(SPLOG_ERROR, CONF_SYS, "set_param_if_valid: Ignored invalid %s\n", description);
 }
+
 void    Conf_set_max_session_messages(int max_messages)
 {
-        if (max_messages < 0) {
+        if (max_messages < 0)
+        {
             Alarmp(SPLOG_ERROR, CONF_SYS, "Conf_set_max_session_messages: Attempt to set max_message to less then zero. Resetting to default value of %d\n", DEFAULT_MAX_SESSION_MESSAGES);
             max_messages = DEFAULT_MAX_SESSION_MESSAGES;
         }
@@ -944,6 +886,24 @@
         return (MaxSessionMessages);
 }
 
+void    Conf_set_active_ip_version(int ipver)
+{
+    switch( ipver )
+    {
+    case AF_INET:
+    case AF_INET6:
+        Conf_Active_IP_Version = ipver;
+        break;
+    default:
+        Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_set_active_ip_version: Invalid IP version specified: %d\n", ipver);
+    }
+}
+
+int     Conf_get_active_ip_version(void)
+{
+        return (Conf_Active_IP_Version);
+}
+
 char    *Conf_get_runtime_dir(void)
 {
         return (RuntimeDir != NULL ? RuntimeDir : SP_RUNTIME_DIR);
@@ -976,9 +936,9 @@
 
 void    Conf_set_window(int window)
 {
-        if (window <= 0) {
+        if (window <= 0)
 	    Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_set_window: Attempt to set window to non-positive (%d)!\n", window);
-        }
+
         Alarmp(SPLOG_DEBUG, CONF_SYS, "Conf_set_window: Set Window to %d\n", window);
         Window = window;
 }
@@ -990,9 +950,9 @@
 
 void    Conf_set_personal_window(int pwindow)
 {
-        if (pwindow <= 0) {
+        if (pwindow <= 0)
 	    Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_set_personal_window: Attempt to set personal window to non-positive (%d)!\n", pwindow);
-        }
+
         Alarmp(SPLOG_DEBUG, CONF_SYS, "Conf_set_personal_window: Set Personal Window to %d\n", pwindow);
         PersonalWindow = pwindow;
 }
@@ -1002,9 +962,9 @@
 	return PersonalWindow;
 }
 
-void Conf_set_accelerated_ring_flag(bool new_state)
+void Conf_set_accelerated_ring_flag(bool flag_is_set)
 {
-  AcceleratedRingFlag = new_state;
+  AcceleratedRingFlag = flag_is_set;
 }
 
 bool Conf_get_accelerated_ring_flag(void)
@@ -1012,9 +972,9 @@
   return AcceleratedRingFlag;
 }
 
-void Conf_set_accelerated_ring(bool new_state)
+void Conf_set_accelerated_ring(bool prot_is_accelerated)
 {
-  AcceleratedRing = new_state;
+  AcceleratedRing = prot_is_accelerated;
 }
 
 bool Conf_get_accelerated_ring(void)
@@ -1024,9 +984,9 @@
 
 void Conf_set_accelerated_window(int pwindow)
 {
-        if (pwindow < 0) {
+        if (pwindow < 0)
 	    Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_set_accelerated_window: Attempt to set window to non-positive (%d)!\n", pwindow);
-        }
+
         Alarmp(SPLOG_DEBUG, CONF_SYS, "Conf_set_accelerated_window: Set Window to %d\n", pwindow);
 	AcceleratedWindow = pwindow;
 }
@@ -1048,12 +1008,10 @@
 
 void Conf_set_token_timeout(int timeout) 
 {
-  if (timeout <= 0) {
+  if (timeout <= 0)
     Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_set_token_timeout: Non-positive timeout (%d) specified!\n", timeout);
-  }
 
   TimeoutMask |= TOKEN_TIMEOUT_CONF;
-
   TokenTimeout = timeout;
 }
 
@@ -1064,12 +1022,10 @@
 
 void Conf_set_hurry_timeout(int timeout) 
 {
-  if (timeout <= 0) {
+  if (timeout <= 0)
     Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_set_hurry_timeout: Non-positive timeout (%d) specified!\n", timeout);
-  }
 
   TimeoutMask |= HURRY_TIMEOUT_CONF;
-
   HurryTimeout = timeout;
 }
 
@@ -1080,12 +1036,10 @@
 
 void Conf_set_alive_timeout(int timeout) 
 {
-  if (timeout <= 0) {
+  if (timeout <= 0)
     Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_set_alive_timeout: Non-positive timeout (%d) specified!\n", timeout);
-  }
 
   TimeoutMask |= ALIVE_TIMEOUT_CONF;
-
   AliveTimeout = timeout;
 }
 
@@ -1096,12 +1050,10 @@
 
 void Conf_set_join_timeout(int timeout) 
 {
-  if (timeout <= 0) {
+  if (timeout <= 0)
     Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_set_join_timeout: Non-positive timeout (%d) specified!\n", timeout);
-  }
 
   TimeoutMask |= JOIN_TIMEOUT_CONF;
-
   JoinTimeout = timeout;
 }
 
@@ -1112,12 +1064,10 @@
 
 void Conf_set_rep_timeout(int timeout) 
 {
-  if (timeout <= 0) {
+  if (timeout <= 0)
     Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_set_rep_timeout: Non-positive timeout (%d) specified!\n", timeout);
-  }
 
   TimeoutMask |= REP_TIMEOUT_CONF;
-
   RepTimeout = timeout;
 }
 
@@ -1128,12 +1078,10 @@
 
 void Conf_set_seg_timeout(int timeout) 
 {
-  if (timeout <= 0) {
+  if (timeout <= 0)
     Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_set_seg_timeout: Non-positive timeout (%d) specified!\n", timeout);
-  }
 
   TimeoutMask |= SEG_TIMEOUT_CONF;
-
   SegTimeout = timeout;
 }
 
@@ -1144,12 +1092,10 @@
 
 void Conf_set_gather_timeout(int timeout) 
 {
-  if (timeout <= 0) {
+  if (timeout <= 0)
     Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_set_gather_timeout: Non-positive timeout (%d) specified!\n", timeout);
-  }
 
   TimeoutMask |= GATHER_TIMEOUT_CONF;
-
   GatherTimeout = timeout;
 }
 
@@ -1160,12 +1106,10 @@
 
 void Conf_set_form_timeout(int timeout) 
 {
-  if (timeout <= 0) {
+  if (timeout <= 0)
     Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_set_form_timeout: Non-positive timeout (%d) specified!\n", timeout);
-  }
 
   TimeoutMask |= FORM_TIMEOUT_CONF;
-
   FormTimeout = timeout;
 }
 
@@ -1176,12 +1120,10 @@
 
 void Conf_set_lookup_timeout(int timeout) 
 {
-  if (timeout <= 0) {
+  if (timeout <= 0)
     Alarmp(SPLOG_FATAL, CONF_SYS, "Conf_set_lookup_timeout: Non-positive timeout (%d) specified!\n", timeout);
-  }
 
   TimeoutMask |= LOOKUP_TIMEOUT_CONF;
-
   LookupTimeout = timeout;
 }
 
@@ -1189,3 +1131,23 @@
 { 
   return LookupTimeout; 
 }
+
+void Conf_set_wide_area_network_flag(bool flag_is_set)
+{
+  WideAreaNetworkFlag = flag_is_set;
+}
+
+bool Conf_get_wide_area_network_flag(void)
+{
+  return WideAreaNetworkFlag;
+}
+
+void Conf_set_wide_area_network(bool isWan)
+{
+  WideAreaNetwork = isWan;
+}
+
+bool Conf_get_wide_area_network(void)
+{
+  return WideAreaNetwork;
+}

Modified: trunk/daemon/configuration.h
===================================================================
--- trunk/daemon/configuration.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/configuration.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -33,75 +33,90 @@
  *
  */
 
-
 #ifndef INC_CONFIGURATION
 #define INC_CONFIGURATION
 
 #include "arch.h"
 #include "spread_params.h"
+#include "spu_addr.h"
 
-/* Part of sequence number debugging */
-#define INITIAL_SEQUENCE_NEAR_WRAP      ( MAX_WRAP_SEQUENCE_VALUE - 5 )
-
-/* For what spread services should listen on what interfaces */
-
 #define IFTYPE_MONITOR  0x1
 #define IFTYPE_CLIENT   0x2
 #define IFTYPE_DAEMON   0x4
 #define IFTYPE_ANY      0x8
 #define IFTYPE_ALL      0x7
 
-#define Is_IfType_Client( type )        ( type & IFTYPE_CLIENT )
-#define Is_IfType_Monitor( type )        ( type & IFTYPE_MONITOR )
-#define Is_IfType_Daemon( type )        ( type & IFTYPE_DAEMON )
-#define Is_IfType_Any( type )        ( type & IFTYPE_ANY )
+#define Is_IfType_Client(t)  ((t) & IFTYPE_CLIENT)
+#define Is_IfType_Monitor(t) ((t) & IFTYPE_MONITOR)
+#define Is_IfType_Daemon(t)  ((t) & IFTYPE_DAEMON)
+#define Is_IfType_Any(t)     ((t) & IFTYPE_ANY)
 
-struct spread_if_info {
-        int32u  ip;
-        int16u  port;
-        int16   type;
-};
-typedef struct dummy_proc{
-	char	name[MAX_PROC_NAME]; 
-	int16u	port;
-	int16	seg_index;
-	int16	index_in_seg;
-	int32u	id;
-        int     num_if;
-        struct spread_if_info ifc[MAX_INTERFACES_PROC];
+#define CONF_ID_TO_STR(id) Conf_id_to_str((id), Conf_id_to_str_buf)
+
+extern char Conf_id_to_str_buf[MAX_ID_SIZE];
+
+typedef struct
+{
+        int16       iftype;
+        spu_addr    ifaddr;
+  
+} spread_if;
+
+typedef struct
+{
+	char	    name[MAX_PROC_NAME]; 
+        spu_addr    proc_addr;
+	int32u	    id;
+  
+        int         num_if;
+        spread_if   ifc[MAX_INTERFACES_PROC];
+
+  	int16	    seg_index;
+	int16	    index_in_seg;
+
 } proc;
 
-typedef struct dummy_segment{
-	int32 	bcast_address;
-	int16u	port;
-	int	num_procs;
-	proc    *procs[MAX_PROCS_SEGMENT];
+typedef struct
+{
+        int         num_seg_addrs;
+        spu_addr    seg_addrs[MAX_ADDRS_SEGMENT];
+	int	    num_procs;
+	proc       *procs[MAX_PROCS_SEGMENT];
+  
 } segment;
 
-typedef struct dummy_configuration{
-        int32u  hash_code;
-	int	num_segments;
-        int     num_total_procs;
-        proc    *allprocs;
-	segment	segments[MAX_SEGMENTS];
+typedef struct
+{
+        int32u      hash_code;
+	int         num_segments;
+        int         num_total_procs;
+        proc       *allprocs;
+	segment     segments[MAX_SEGMENTS];
+  
 } configuration;
 
-typedef enum dummy_port_reuse {
-    port_reuse_auto,
-    port_reuse_on,
-    port_reuse_off
+typedef enum
+{
+    PORT_REUSE_AUTO,
+    PORT_REUSE_ON,
+    PORT_REUSE_OFF
+
 } port_reuse;
 
 void		Conf_init( char *file_name, char *my_name );
 void	        Conf_load_conf_file( char *file_name, char *my_name );
 void            Conf_config_copy( configuration *src_conf, configuration *dst_conf);
 configuration	Conf(void);
-configuration   *Conf_ref(void);
+configuration  *Conf_ref(void);
 proc		Conf_my(void);
 int		Conf_proc_by_id( int32u id, proc *p );
+int             Conf_proc_ref_by_id( int32u id, proc **p );
 int		Conf_proc_by_name( char *name, proc *p );
+int             Conf_proc_ref_by_name( char *name, proc **p );
 int		Conf_proc_by_id_in_conf( configuration *config, int32u id, proc *p );
+int		Conf_proc_ref_by_id_in_conf( configuration *config, int32u id, proc **p );
 int		Conf_proc_by_name_in_conf( configuration *config, char *name, proc *p );
+int		Conf_proc_ref_by_name_in_conf( configuration *config, char *name, proc **p );
 int		Conf_id_in_seg( segment *seg, int32u id );	
 int		Conf_id_in_conf( configuration *config, int32u id );	
 int		Conf_num_procs( configuration *config );
@@ -113,7 +128,8 @@
 int32u		Conf_seg_last( configuration *config, int16 seg_index );
 int             Conf_append_id_to_seg( segment *seg, int32u id);
 int	        Conf_num_procs_in_seg( configuration *config, int16 seg_index );
-void		Conf_id_to_str( int32u id, char *str );
+char           *Conf_id_to_str( int32u id, char *str );
+int32u          Conf_str_to_id(const char *str);
 int 		Conf_print(configuration *config);
 int	        Conf_print_procs(configuration *config);
 
@@ -125,9 +141,6 @@
 void            Conf_reload_singleton_state_end(void);
 bool            Conf_reload_initiate(void);
 
-void            Conf_set_debug_initial_sequence(void);
-bool            Conf_debug_initial_sequence(void);
-
 bool            Conf_get_dangerous_monitor_state(void);
 void            Conf_set_dangerous_monitor_state(bool new_state);
 port_reuse      Conf_get_port_reuse_type(void);
@@ -138,17 +151,17 @@
 void            Conf_set_user(char *dir);
 char            *Conf_get_group(void);
 void            Conf_set_group(char *dir);
-int             Conf_get_link_protocol(void);
-void            Conf_set_link_protocol(int protocol);
 void            Conf_set_max_session_messages(int max_messages);
 int             Conf_get_max_session_messages(void);
+void            Conf_set_active_ip_version(int version);
+int             Conf_get_active_ip_version(void);
 void		Conf_set_window(int window);
 int		Conf_get_window(void);
 void		Conf_set_personal_window(int pwindow);
 int		Conf_get_personal_window(void);
-void		Conf_set_accelerated_ring_flag(bool new_state);
+void		Conf_set_accelerated_ring_flag(bool flag_is_set);
 bool		Conf_get_accelerated_ring_flag(void);
-void		Conf_set_accelerated_ring(bool new_state);
+void		Conf_set_accelerated_ring(bool prot_is_accelerated);
 bool		Conf_get_accelerated_ring(void);
 void		Conf_set_accelerated_window(int pwindow);
 int		Conf_get_accelerated_window(void);
@@ -172,5 +185,9 @@
 int		Conf_get_form_timeout(void);
 void		Conf_set_lookup_timeout(int timeout);
 int		Conf_get_lookup_timeout(void);
+void            Conf_set_wide_area_network_flag(bool flag_is_set);
+bool            Conf_get_wide_area_network_flag(void);
+void            Conf_set_wide_area_network(bool network_is_wan);
+bool            Conf_get_wide_area_network(void);
 
 #endif /* INC_CONFIGURATION */

Modified: trunk/daemon/flow_control.c
===================================================================
--- trunk/daemon/flow_control.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/flow_control.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -102,26 +102,33 @@
         Cn = Conf_ref();
 
 	pack_ptr = (packet_header *)scat->elements[0].buf;
-        if ( ! Conf_get_dangerous_monitor_state() ) {
-                Alarm( FLOW_CONTROL, "FC_handle_message: Request to change flow control from (%d.%d.%d.%d) denied. Monitor in safe mode\n", IP1(pack_ptr->proc_id), IP2(pack_ptr->proc_id), IP3(pack_ptr->proc_id), IP4(pack_ptr->proc_id) );
+        
+        if ( ! Conf_get_dangerous_monitor_state() )
+        {
+                Alarm( FLOW_CONTROL, "FC_handle_message: Request to change flow control from (%d.%d.%d.%d) denied. Monitor in safe mode\n",
+                       IP1(pack_ptr->proc_id), IP2(pack_ptr->proc_id), IP3(pack_ptr->proc_id), IP4(pack_ptr->proc_id) );
                 return;
         }
 
-	if( ! ( pack_ptr->memb_id.proc_id == 15051963 && Conf_id_in_conf( Cn, pack_ptr->proc_id ) != -1 ) )
+	if( Conf_id_in_conf( Cn, pack_ptr->proc_id ) < 0 )
 	{
 		Alarm( FLOW_CONTROL, 
 			"FC_handle_message: Illegal monitor request\n");
 		return;
 	}
+        
 	cur_fc_buf = (int16 (*)[2])scat->elements[1].buf;
 
 	my_index = Conf_proc_by_id( Conf_my().id, &dummy_proc );
 
-	if( Same_endian( pack_ptr->type ) ) {
+	if( Same_endian( pack_ptr->type ) )
+        {
 		temp_window = cur_fc_buf[Conf_num_procs( Cn )][0];
 		temp_personal_window = cur_fc_buf[my_index][0];
 		temp_accelerated_window = cur_fc_buf[my_index][1];
-	}else{
+	}
+        else
+        {
 		temp_window = Flip_int16( cur_fc_buf[Conf_num_procs( Cn )][0] );
 		temp_personal_window = Flip_int16( cur_fc_buf[my_index][0] );
 		temp_accelerated_window = Flip_int16( cur_fc_buf[my_index][1] );
@@ -133,6 +140,7 @@
 	GlobalStatus.window = Window;
 	GlobalStatus.personal_window = Personal_window;
 	GlobalStatus.accelerated_window = Accelerated_window;
+        
 	Alarm( FLOW_CONTROL, 
 		"FC_handle_message: Got monitor mess, Window %d Personal %d Accelerated %d\n", 
 	        Window, Personal_window, Accelerated_window );

Modified: trunk/daemon/ip_enum.c
===================================================================
--- trunk/daemon/ip_enum.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/ip_enum.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -33,26 +33,35 @@
  *
  */
 
+#include "arch.h"
+
 #include <string.h>
 
-#include "ip_enum.h"
-#include "spu_alarm.h"
-
 #ifndef ARCH_PC_WIN95
+#  include <sys/types.h>
+#  include <sys/socket.h>
+#  include <net/if.h>
+#  if defined(HAVE_IFADDRS_H)
+#    include <ifaddrs.h>     /* NOTE: this has to come after <net/if.h> on some systems! */
+#  endif
 #  include <netdb.h>
-#  include <net/if.h>
 #  include <sys/ioctl.h>
 #  include <netinet/in.h>
 #  ifdef sun
 #    include <sys/sockio.h>  /* for SIOCGIFCONF */
 #  endif
 #else
-#  include <WinSock2.h>
+#  include <winsock2.h>
+#  include <iphlpapi.h>
 #endif
 
-#define MAX_IF 8192     /* max interfaces to look up */
-#define MIN_IF 10       /* must be able to look up at least this many */
+#include "spu_alarm.h"
+#include "spu_addr.h"
+#include "ip_enum.h"
 
+#define MAX_IF 1024     /* max interfaces to look up */
+#define MIN_IF 16       /* must be able to look up at least this many */
+
 #ifdef ARCH_PC_WIN95
 typedef INTERFACE_INFO If_info;
 #else
@@ -60,144 +69,267 @@
 #  define closesocket(s) close(s)
 #endif
 
-#if defined(_SIZEOF_ADDR_IFREQ)
-#  define NEXT_IF(ifr)  (struct ifreq*)((char*)(ifr) + _SIZEOF_ADDR_IFREQ(*(ifr)))
-#else
-/* Assume fixed-length IFR's.  WARNING: this may not be true for
-   all systems!  If it has ifr_addr.sa_len, then we need to compute
-   ifr + sizeof(ifr->ifr_name) + ifr->ifr_addr.sa_len
-*/
-#  define NEXT_IF(ifr)  ((ifr) + 1)
+#if !defined(_SIZEOF_ADDR_IFREQ)
+#  if defined(HAVE_SA_LEN_IN_SOCKADDR)
+#    define _SIZEOF_ADDR_IFREQ(ifr) ((ifr).ifr_addr.sa_len > sizeof(struct sockaddr) ? (sizeof(struct ifreq) + (ifr).ifr_addr.sa_len - sizeof(struct sockaddr)) : sizeof(struct ifreq))
+#  else
+#    define _SIZEOF_ADDR_IFREQ(ifr) sizeof(ifr)
+#  endif
 #endif
 
-struct Ip_Array 
-{
-  int32u *ips;
-  int     size;
-  int     next;
-};
+#define NEXT_IF(ifp) ((struct ifreq*) ((char*) (ifp) + _SIZEOF_ADDR_IFREQ(*(ifp))))
 
-static void Add_ip(struct Ip_Array *array, int32u ip)
+typedef struct 
 {
-  void *new_array;
+  spu_addr *ips;
+  size_t    size;
+  size_t    next;
+  
+} ip_array;
 
-  if (array->next >= array->size) {
+/********************************************************************************
+ ********************************************************************************/
 
-    array->size = (array->size == 0 ? 4 : 2 * array->size);
+static void add_ip(ip_array *array, const spu_addr *ip)
+{
+  if (array->next >= array->size)
+  {
+    size_t    new_size = (array->next < MIN_IF ? MIN_IF : 4 * array->next);
+    spu_addr *new_ips  = realloc(array->ips, new_size * sizeof(spu_addr));
 
-    if ((new_array = realloc(array->ips, array->size * sizeof(int32u))) == NULL) {
-      Alarm(EXIT, "Ip_enum_all: Failed to allocate memory\n");
+    if (new_ips == NULL)
+    {
+      Alarmp(SPLOG_ERROR, CONF_SYS, SPLOC ":add_ip: realloc failed!\n");
+      return;
     }
 
-    array->ips = (int32u*) new_array;
+    array->ips  = new_ips;
+    array->size = new_size;
   }
 
-  array->ips[array->next++] = ip;
+  Alarmp(SPLOG_DEBUG, CONF_SYS, SPLOC ":add_ip: adding '%s'\n", SPU_ADDR_NTOP(ip));
+  array->ips[array->next++] = *ip;
 }
 
-int32u *Ip_enum_all()
+/********************************************************************************
+ ********************************************************************************/
+
+static void ip_enum_hostname(ip_array *array)
 {
-  struct Ip_Array array = { 0, 0, 0 };
+  char             name[256] = { 0 };
+  struct addrinfo  hint      = { 0 };
+  struct addrinfo *rslt;
+  struct addrinfo *curr;
+  spu_addr         addr;
+  int              tmp;
+  
+  if (gethostname(name, sizeof(name)) || name[0] == 0)
+  {
+    Alarmp(SPLOG_ERROR, CONF_SYS, SPLOC ":ip_enum_hostname: gethostname() failed?! %d '%s'\n", sock_errno, sock_strerror(sock_errno));
+    return;
+  }
 
-  struct hostent *host_ptr;
-  char            machine_name[256] = { 0 };
-  int32u          addr;
+  if ((tmp = getaddrinfo(name, NULL, &hint, &rslt)))
+  {
+    Alarmp(SPLOG_ERROR, CONF_SYS, SPLOC ":ip_enum_hostname: getaddrinfo(%s) failed! %d '%s'\n", name, tmp, GAI_STRERROR(tmp));
+    return;
+  }
+  
+  for (curr = rslt; curr != NULL; curr = curr->ai_next)
+  {
+    if (curr->ai_addr == NULL || (curr->ai_addr->sa_family != AF_INET && curr->ai_addr->sa_family != AF_INET6))
+      continue;
 
-  int             s;
-  void           *buffer;
-  int             bufferSize;
-  int             n;
+    if (spu_addr_from_sockaddr_known(&addr, curr->ai_addr))
+      Alarmp(SPLOG_FATAL, CONF_SYS, SPLOC ": ip_enum_getifaddrs: BUG! spu_addr_from_sockaddr_known failed?!");
+      
+    add_ip(array, &addr);
+  }
 
-#ifdef  ARCH_PC_WIN95
-  DWORD           bytesReturned;
-  INTERFACE_INFO *ifr;
-#else
-  struct ifconf   ifc;
-  struct ifreq   *end;
-  struct ifreq   *ifr;
-#endif
+  if (rslt != NULL)
+    freeaddrinfo(rslt);
+}
 
-  /* get IPs from hostname */
+/********************************************************************************
+ ********************************************************************************/
 
-  if (gethostname(machine_name, sizeof(machine_name)) == 0) {
-    host_ptr = gethostbyname(machine_name);
+static void ip_enum_socket(ip_array *array, int family)
+{
+  size_t   bufferSize = sizeof(If_info) * MAX_IF;
+  void    *buffer;
+  int      sock;
+  spu_addr addr;
 
-    if (host_ptr != NULL && host_ptr->h_addrtype == AF_INET && host_ptr->h_length == 4) {
-      
-      for (n = 0; host_ptr->h_addr_list[n] != NULL; n++) {
-	
-	memcpy(&addr, host_ptr->h_addr_list[n], sizeof(addr));
-	
-	if (addr != 0) {
-	  Add_ip(&array, addr);
-	}
-      }
-    }
+  if (family != AF_INET && family != AF_INET6)
+    Alarmp(SPLOG_FATAL, CONF_SYS, SPLOC ":ip_enum_socket: BUG! Only AF_INET(%d) and AF_INET(%d) families supported! %d\n", family);
+  
+  if ((buffer = malloc(bufferSize)) == NULL)
+  {
+    Alarmp(SPLOG_ERROR, CONF_SYS, SPLOC ":ip_enum_socket: malloc failed!\n");
+    goto FAIL;
   }
 
-  /* get IPs from interfaces */
+  if ((sock = socket(family, SOCK_DGRAM, IPPROTO_IP)) == INVALID_SOCKET)
+  {
+    Alarmp(SPLOG_ERROR, CONF_SYS, SPLOC ":ip_enum_socket: socket() failed: %d %d '%s'\n", sock, sock_errno, sock_strerror(sock_errno));
+    goto FAIL_BUFFER;
+  }
+  
+#ifdef ARCH_PC_WIN95
+  {
+    INTERFACE_INFO *ifr = (INTERFACE_INFO*) buffer;
+    DWORD           n   = 0;
 
-  if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP)) >= 0) {
-
-    bufferSize = sizeof(If_info) * MAX_IF;
-    if ((buffer = malloc(bufferSize)) == NULL) {
-      Alarm(EXIT, "Ip_enum_all: Failed to allocate memory\n");
+    /* TODO: probably want to use GetAdaptersAddresses instead as a parallel to getifaddrs (i.e. - move to ip_enum_getifaddrs) */
+      
+    if (WSAIoctl(sock, SIO_GET_INTERFACE_LIST, 0, 0, buffer, bufferSize, &n, 0, 0) == SOCKET_ERROR)
+    {
+      Alarmp(SPLOG_ERROR, CONF_SYS, SPLOC ":ip_enum_socket: WSAIoctl(SIO_GET_INTERFACE_LIST) failed: %d %s\n", sock_errno, sock_strerrno(sock_errno));
+      goto FAIL_SOCK;
     }
-
-#ifdef ARCH_PC_WIN95
-    if (WSAIoctl(s, SIO_GET_INTERFACE_LIST, 0, 0, buffer, bufferSize,
-		 &bytesReturned, 0, 0) == SOCKET_ERROR) {
-      Alarm(EXIT, "Ip_enum_all: Error getting interface list: %d\n", sock_errno);
-    }
     
-    ifr = (INTERFACE_INFO*)buffer;
+    for (n /= sizeof(INTERFACE_INFO); n > 0; ++ifr, --n)
+    {
+      if (ifr->iiAddress.Address.sa_family != AF_INET && ifr->iiAddress.Address.sa_family != AF_INET6)
+        continue;
 
-    for (n = bytesReturned / sizeof(INTERFACE_INFO); n; ifr++, n--) {
-      struct sockaddr_in *sa = &ifr->iiAddress.AddressIn;
+      /* NOTE: we do this manually instead because windoze has two
+       * kinds of sockaddr_in6's, sockaddr_in6 and sockaddr_in6_old,
+       * and this might return the old kind
+      
+      if (spu_addr_from_sockaddr_known(&addr, &ifr->iiAddress.Address))
+        Alarmp(SPLOG_FATAL, CONF_SYS, SPLOC ":ip_enum_socket: BUG! spu_addr_from_sockaddr_known failed?!\n");
+      */
+      
+      memset(&addr, 0, sizeof(addr));
 
-      if (sa->sin_family == AF_INET && sa->sin_addr.s_addr != 0) {
-	Add_ip(&array, sa->sin_addr.s_addr);
+      switch (ifr->iiAddress.Address.sa_family)
+      {
+      case AF_INET:
+        memcpy(&addr, &ifr->iiAddress.AddressIn,  sizeof(ifr->iiAddress.AddressIn));
+        break;
+        
+      case AF_INET6:
+        memcpy(&addr, &ifr->iiAddress.AddressIn6, sizeof(ifr->iiAddress.AddressIn6));
+        break;
       }
+
+      add_ip(array, &addr);
     }
+  }
+#else
+  {
+    struct ifconf ifc;
+    struct ifreq *ifp;
 
-#else   /* !ARCH_PC_WIN95 */
-
     ifc.ifc_len = bufferSize;
     ifc.ifc_buf = buffer;
 
-    while (ioctl(s, SIOCGIFCONF, &ifc) < 0) {
-#  ifdef __linux__
-      /* Workaround for a failure to allocate kernel memory
-	 of the same size as our 'buffer'. */
-      if (errno == ENOMEM) {
-	if (bufferSize / 2 >= MIN_IF * (int)sizeof(struct ifreq)) {
-	  bufferSize /= 2;
-
-	  ifc.ifc_len = bufferSize;
-	  ifc.ifc_buf = buffer;
-	  continue;
-	}
+    while (ioctl(sock, SIOCGIFCONF, &ifc) == -1)
+    {      
+      if (errno == ENOMEM && bufferSize / 2 >= MIN_IF * sizeof(struct ifreq))
+      {
+        bufferSize /= 2;
+        
+        ifc.ifc_len = bufferSize;
+        ifc.ifc_buf = buffer;
+        continue;
       }
-#  endif
-      Alarm(EXIT, "Ip_enum_all: Error enumerating IP addresses: %d\n", sock_errno);
+      
+      Alarmp(SPLOG_ERROR, CONF_SYS, SPLOC ":ip_enum_socket: ioctl(SIOCGIFCONF) error: %d = '%s'\n", sock_errno, sock_strerror(sock_errno));
+      goto FAIL_SOCK;
     }
 
-    end = (struct ifreq*)(ifc.ifc_buf + ifc.ifc_len - (sizeof(struct ifreq) - 1));
+    /* NOTE: ensure ifp is always pointing at a full and valid ifr
+     * (i.e. - handles partial address on last entry if buffer wasn't
+     * big enough for all) */
+    
+    if (ifc.ifc_len > (int) sizeof(If_info) * MAX_IF)
+      ifc.ifc_len = sizeof(If_info) * MAX_IF;
+    
+    for (ifp = ifc.ifc_req; (char*) NEXT_IF(ifp) <= ifc.ifc_buf + ifc.ifc_len; ifp = NEXT_IF(ifp))
+    {
+      if (ifp->ifr_addr.sa_family != AF_INET && ifp->ifr_addr.sa_family != AF_INET6)
+        continue;
 
-    for (ifr = ifc.ifc_req;  ifr < end; ifr = NEXT_IF(ifr)) {
-      struct sockaddr_in *sa = (struct sockaddr_in*)&ifr->ifr_addr;
+      if (spu_addr_from_sockaddr_known(&addr, &ifp->ifr_addr))
+        Alarmp(SPLOG_FATAL, CONF_SYS, SPLOC ":ip_enum_socket: BUG! spu_addr_from_sockaddr_known failed?!\n");
 
-      if (sa->sin_family == AF_INET && sa->sin_addr.s_addr != 0) {
-	Add_ip(&array, sa->sin_addr.s_addr);
-      }
+      add_ip(array, &addr);
     }
+  }
 #endif
 
-    closesocket(s);
-    free(buffer);
+FAIL_SOCK:
+  closesocket(sock);
+
+FAIL_BUFFER:
+  free(buffer);
+
+FAIL:
+  return;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+static void ip_enum_getifaddrs(ip_array *array)
+{
+#if defined(HAVE_GETIFADDRS)
+  
+  struct ifaddrs *ifs;
+  struct ifaddrs *curr;
+  spu_addr        addr;
+    
+  if (getifaddrs(&ifs))
+  {
+    Alarmp(SPLOG_ERROR, CONF_SYS, SPLOC ": ip_enum_getifaddrs: getifaddrs failed: %d '%s'\n", errno, strerror(errno));
+    return;
   }
 
-  Add_ip(&array, 0);   /* 0.0.0.0 ends the array */
+  for (curr = ifs; curr != NULL; curr = curr->ifa_next)
+  {
+    if (curr->ifa_addr == NULL || (curr->ifa_addr->sa_family != AF_INET && curr->ifa_addr->sa_family != AF_INET6))
+      continue;
 
+    if (spu_addr_from_sockaddr_known(&addr, curr->ifa_addr))
+      Alarmp(SPLOG_FATAL, CONF_SYS, SPLOC ": ip_enum_getifaddrs: BUG! spu_addr_from_sockaddr_known failed?!");
+
+    if (curr->ifa_addr->sa_family == AF_INET6)
+      addr.ipv6.sin6_scope_id = if_nametoindex(curr->ifa_name);
+    
+    add_ip(array, &addr);        
+  }
+
+  if (ifs)
+    freeifaddrs(ifs);
+
+#endif
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+spu_addr *ip_enum_local(size_t *num_ips)
+{
+  ip_array array = { 0 };
+
+  Alarmp(SPLOG_DEBUG, CONF_SYS, SPLOC ":ip_enum_local: enumerating getifaddrs\n");
+  ip_enum_getifaddrs(&array);
+
+  Alarmp(SPLOG_DEBUG, CONF_SYS, SPLOC ":ip_enum_local: enumerating socket(AF_INET); %lu\n", (unsigned long) array.next);
+  ip_enum_socket(&array, AF_INET);
+
+  Alarmp(SPLOG_DEBUG, CONF_SYS, SPLOC ":ip_enum_local: enumerating socket(AF_INET6); %lu\n", (unsigned long) array.next);
+  ip_enum_socket(&array, AF_INET6);
+  
+  Alarmp(SPLOG_DEBUG, CONF_SYS, SPLOC ":ip_enum_local: enumerating hostname; %lu\n", (unsigned long) array.next);
+  ip_enum_hostname(&array);
+  
+  *num_ips = array.next;
+  
   return array.ips;
 }
+
+/********************************************************************************
+ ********************************************************************************/

Modified: trunk/daemon/ip_enum.h
===================================================================
--- trunk/daemon/ip_enum.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/ip_enum.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -38,6 +38,6 @@
 
 #include "arch.h"
 
-int32u *Ip_enum_all(void);
+spu_addr *ip_enum_local(size_t *num_ips);
 
 #endif

Modified: trunk/daemon/log.c
===================================================================
--- trunk/daemon/log.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/log.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -154,36 +154,30 @@
 	Log_alive(0, NULL);
 }
 
-void	Log_sess_connect( mailbox mbox, int32 address, char *private_group )
+void	Log_sess_connect( mailbox mbox, const spu_addr *addr, char *private_group )
 {
-	char 	ip[16];
-
 	if( !Is_inited ) return;
 
-	Conf_id_to_str( address, ip );
 #if ( SPREAD_PROTOCOL == 3 )
 	fprintf( fd, "C %13ld %11d %3d %-16s %-10s\n", 
-		E_get_time().sec, Highest_seq, mbox, ip, private_group );
+                 E_get_time().sec, Highest_seq, mbox, SPU_ADDR_NTOP(addr), private_group );
 #else
 	fprintf( fd, "C %13ld %3d %-16s %-10s\n", 
-		E_get_time().sec, mbox, ip, private_group );
+                 E_get_time().sec, mbox, SPU_ADDR_NTOP(addr), private_group );
 #endif
 	Log_alive(0, NULL);
 }
 
-void	Log_sess_disconnect( mailbox mbox, int32 address, char *private_group, int num_mess )
+void	Log_sess_disconnect( mailbox mbox, const spu_addr *addr, char *private_group, int num_mess )
 {
-	char 	ip[16];
-
 	if( !Is_inited ) return;
 
-	Conf_id_to_str( address, ip );
 #if ( SPREAD_PROTOCOL == 3 )
-	fprintf( fd, "D %13ld %11d %3d %-16s %-10s %d\n", 
-		E_get_time().sec, Highest_seq, mbox, ip, private_group, num_mess );
+	fprintf( fd, "D %13ld %11d %3d %-" QQ(SPU_ADDR_IP_STRSIZE) "s %-10s %d\n", 
+                 E_get_time().sec, Highest_seq, mbox, SPU_ADDR_NTOP(addr), private_group, num_mess );
 #else
-	fprintf( fd, "D %13ld %3d %-16s %-10s %d\n", 
-		E_get_time().sec, mbox, ip, private_group, num_mess );
+	fprintf( fd, "D %13ld %3d %-" QQ(SPU_ADDR_IP_STRSIZE) "s %-10s %d\n", 
+                 E_get_time().sec, mbox, SPU_ADDR_NTOP(addr), private_group, num_mess );
 #endif
 	Log_alive(0, NULL);
 }

Modified: trunk/daemon/log.h
===================================================================
--- trunk/daemon/log.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/log.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -41,7 +41,7 @@
 
 void	Log_init(void);
 void	Log_membership(void);
-void	Log_sess_connect( mailbox mbox, int32 address, char *private_group );
-void	Log_sess_disconnect( mailbox mbox, int32 address, char *private_group, int num_mess );
+void	Log_sess_connect( mailbox mbox, const spu_addr *addr, char *private_group );
+void	Log_sess_disconnect( mailbox mbox, const spu_addr *addr, char *private_group, int num_mess );
 
 #endif	/* INC_LOG */ 

Modified: trunk/daemon/membership.c
===================================================================
--- trunk/daemon/membership.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/membership.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -144,39 +144,27 @@
 
 void		Memb_init( void )
 {
-	packet_header	*pack_ptr;
-	int32		reference_subnet;
-	int32		current_subnet;
-	int		i, num_seg;
+	packet_header *pack_ptr;
+        int            i;
 
         Shift_to_op();
 	GlobalStatus.membership_changes = 0;
 
 	My = Conf_my();
 	Cn = Conf_ref();
-        num_seg = Conf_num_segments( Cn );
 
-	reference_subnet = Cn->segments[0].procs[0]->id;
-	reference_subnet = reference_subnet & 0xffff0000;
+        if (Conf_get_wide_area_network_flag())
+          Wide_network = Conf_get_wide_area_network();
 
-	Wide_network = 0;
-	for( i=1; i < num_seg; i++ ) {
-	  current_subnet = Cn->segments[i].procs[0]->id;
-	  current_subnet = current_subnet & 0xffff0000;
+        else        
+          Wide_network = (Conf_num_segments( Cn ) > 1);
 
-	  if( current_subnet != reference_subnet ) {
-	    Wide_network = 1;
-	    break;
-	  }
-	}
-
-	if (!Conf_get_accelerated_ring_flag()) {
+	if (!Conf_get_accelerated_ring_flag())
 	    Conf_set_accelerated_ring(!Wide_network);
-	}
 
-	if (!Conf_memb_timeouts_set()) {
-
-		if( Wide_network )
+	if (!Conf_memb_timeouts_set())
+        {
+		if ( Wide_network )
 		{
 			Token_timeout.sec  =   5; Token_timeout.usec  = 0;
 			Hurry_timeout.sec  =   1; Hurry_timeout.usec  = 500000;
@@ -188,7 +176,9 @@
 			Gather_timeout.sec =   2; Gather_timeout.usec = 500000;
 			Form_timeout.sec   =   2; Form_timeout.usec   = 500000;
 			Lookup_timeout.sec =  45; Lookup_timeout.usec = 0;
-		}else{
+		}
+                else
+                {
 			Token_timeout.sec  =   1; Token_timeout.usec  = 250000;
 			Hurry_timeout.sec  =   0; Hurry_timeout.usec  = 500000;
 
@@ -200,13 +190,12 @@
 			Form_timeout.sec   =   1; Form_timeout.usec   = 250000;
 			Lookup_timeout.sec =  30; Lookup_timeout.usec = 0;
 		}
+	}
+        else
+        {
+	  if (!Conf_all_memb_timeouts_set())
+	    Alarmp( SPLOG_FATAL, EXIT, "Memb_init: Only some of the membership timeouts were specified! If you specify any, then you must specify all!\n");
 
-	} else {
-
-	  if (!Conf_all_memb_timeouts_set()) {
-	    Alarm(EXIT, "Memb_init: Only some of the membership timeouts were specified! If you specify any, then you must specify all!\n");
-	  }
-
 	  Token_timeout.sec  =  Conf_get_token_timeout() / 1000;  Token_timeout.usec  = Conf_get_token_timeout() % 1000 * 1000;
 	  Hurry_timeout.sec  =  Conf_get_hurry_timeout() / 1000;  Hurry_timeout.usec  = Conf_get_hurry_timeout() % 1000 * 1000;
 
@@ -219,20 +208,20 @@
 	  Lookup_timeout.sec =  Conf_get_lookup_timeout() / 1000; Lookup_timeout.usec = Conf_get_lookup_timeout() % 1000 * 1000;
 
 	  /*
-	  Alarm(PRINT, "Token_Timeout: %d.%06d\n", Token_timeout.sec, Token_timeout.usec);
-	  Alarm(PRINT, "Hurry_Timeout: %d.%06d\n", Hurry_timeout.sec, Hurry_timeout.usec);
-	  Alarm(PRINT, "Alive_Timeout: %d.%06d\n", Alive_timeout.sec, Alive_timeout.usec);
-	  Alarm(PRINT, "Join_Timeout: %d.%06d\n", Join_timeout.sec, Join_timeout.usec);
-	  Alarm(PRINT, "Rep_Timeout: %d.%06d\n", Rep_timeout.sec, Rep_timeout.usec);
-	  Alarm(PRINT, "Seg_Timeout: %d.%06d\n", Seg_timeout.sec, Seg_timeout.usec);
-	  Alarm(PRINT, "Gather_Timeout: %d.%06d\n", Gather_timeout.sec, Gather_timeout.usec);
-	  Alarm(PRINT, "Form_Timeout: %d.%06d\n", Form_timeout.sec, Form_timeout.usec);
-	  Alarm(PRINT, "Lookup_Timeout: %d.%06d\n", Lookup_timeout.sec, Lookup_timeout.usec);
+	  Alarmp( SPLOG_PRINT, PRINT, "Token_Timeout: %d.%06d\n", Token_timeout.sec, Token_timeout.usec);
+	  Alarmp( SPLOG_PRINT, PRINT, "Hurry_Timeout: %d.%06d\n", Hurry_timeout.sec, Hurry_timeout.usec);
+	  Alarmp( SPLOG_PRINT, PRINT, "Alive_Timeout: %d.%06d\n", Alive_timeout.sec, Alive_timeout.usec);
+	  Alarmp( SPLOG_PRINT, PRINT, "Join_Timeout: %d.%06d\n", Join_timeout.sec, Join_timeout.usec);
+	  Alarmp( SPLOG_PRINT, PRINT, "Rep_Timeout: %d.%06d\n", Rep_timeout.sec, Rep_timeout.usec);
+	  Alarmp( SPLOG_PRINT, PRINT, "Seg_Timeout: %d.%06d\n", Seg_timeout.sec, Seg_timeout.usec);
+	  Alarmp( SPLOG_PRINT, PRINT, "Gather_Timeout: %d.%06d\n", Gather_timeout.sec, Gather_timeout.usec);
+	  Alarmp( SPLOG_PRINT, PRINT, "Form_Timeout: %d.%06d\n", Form_timeout.sec, Form_timeout.usec);
+	  Alarmp( SPLOG_PRINT, PRINT, "Lookup_Timeout: %d.%06d\n", Lookup_timeout.sec, Lookup_timeout.usec);
 	  */
 	}
 
 	Membership = Conf();
-	for( i=0; i < num_seg; i++ )
+	for( i=0; i < Conf_num_segments( Cn ); i++ )
 		Membership.segments[i].num_procs = 0;
         Conf_append_id_to_seg( &Membership.segments[My.seg_index], My.id);
 	Membership_id.proc_id = My.id;
@@ -303,43 +292,28 @@
 
 	pack_ptr = (packet_header *)scat->elements[0].buf;
 
-	if( 	  Is_alive( pack_ptr->type ) )
+	if ( Is_alive( pack_ptr->type ) )
 	{
-		Alarm( MEMB, "Memb_handle_message: handling alive message\n");
+		Alarmp( SPLOG_INFO, MEMB, "Memb_handle_message: handling alive message\n");
 		Memb_handle_alive( scat );
-
-	}else if( Is_join( pack_ptr->type ) ){
-		Alarm( MEMB, "Memb_handle_message: handling join message from %d.%d.%d.%d, State is %d\n", 
-                       IP1(pack_ptr->proc_id),
-                       IP2(pack_ptr->proc_id),
-                       IP3(pack_ptr->proc_id),
-                       IP4(pack_ptr->proc_id),
-                       State);
+	}
+        else if ( Is_join( pack_ptr->type ) )
+        {
+                Alarmp( SPLOG_INFO, MEMB, "Memb_handle_message: handling join message from %d.%d.%d.%d, State is %d\n", IP(pack_ptr->proc_id), State );
 		Memb_handle_join( scat );
-
-	}else if( Is_refer( pack_ptr->type ) ){
-		Alarm( MEMB, "Memb_handle_message: handling refer message from %d.%d.%d.%d, State is %d\n",
-                       IP1(pack_ptr->proc_id),
-                       IP2(pack_ptr->proc_id),
-                       IP3(pack_ptr->proc_id),
-                       IP4(pack_ptr->proc_id),
-                       State);
+	}
+        else if ( Is_refer( pack_ptr->type ) )
+        {
+                Alarmp( SPLOG_INFO, MEMB, "Memb_handle_message: handling refer message from %d.%d.%d.%d, State is %d\n", IP(pack_ptr->proc_id), State );
 		Memb_handle_refer( scat );
-
-	}else if( Is_regular( pack_ptr->type ) ){
-		Alarm( NONE, "Memb_handle_message: handling foreign message from %d.%d.%d.%d, State is %d\n",
-                       IP1(pack_ptr->proc_id),
-                       IP2(pack_ptr->proc_id),
-                       IP3(pack_ptr->proc_id),
-                       IP4(pack_ptr->proc_id),
-                       State);
+	}
+        else if ( Is_regular( pack_ptr->type ) )
+        {
+                /*Alarmp( SPLOG_INFO, NONE, "Memb_handle_message: handling foreign message from %d.%d.%d.%d, State is %d\n", IP(pack_ptr->proc_id), State );*/
 		Memb_handle_foreign( scat );
-
-	}else{
-		Alarm( EXIT, "Memb_handle_message: unknown message type %d\n",
-			pack_ptr->type );
-
 	}
+        else
+                Alarmp( SPLOG_PRINT, PROTOCOL, "Memb_handle_message: unknown message type 0x%x (ignoring)\n", pack_ptr->type );
 } 
 
 void	Memb_handle_token( sys_scatter *scat )
@@ -348,21 +322,19 @@
 
 	token_ptr = (token_header *)scat->elements[0].buf;
 
-	if( 	  Is_form1( token_ptr->type ) )
+	if( Is_form1( token_ptr->type ) )
 	{
-		Alarm( MEMB, "Memb_handle_token: handling form1 token\n");
+		Alarmp( SPLOG_INFO, MEMB, "Memb_handle_token: handling form1 token\n");
 		Memb_handle_form1( scat );
-
-	}else if( Is_form2( token_ptr->type ) ){
-		Alarm( MEMB, "Memb_handle_token: handling form2 token\n");
+	}
+        else if( Is_form2( token_ptr->type ) )
+        {
+		Alarmp( SPLOG_INFO, MEMB, "Memb_handle_token: handling form2 token\n");
 		Memb_handle_form2( scat );
-
-	}else{
-		Alarm( EXIT, "Memb_handle_token: unknown token type %d\n",
-			token_ptr->type );
-
 	}
-} 
+        else
+                Alarmp( SPLOG_PRINT, PROTOCOL, "Memb_handle_token: unknown token type 0x%x (ignoring)\n", token_ptr->type );
+}
 
 static	void	Memb_handle_alive( sys_scatter *scat )
 {
@@ -373,7 +345,7 @@
     switch( State )
     {
 	case OP:
-	    Alarm( MEMB, "Handle_alive in OP\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_alive in OP\n");
 	    if( Conf_id_in_conf( &Membership, pack_ptr->proc_id ) != -1 )
 	    {
 		/* sender belongs to my ring - my token is lost */
@@ -384,20 +356,20 @@
 	    break;
 
 	case SEG:
-	    Alarm( MEMB, "Handle_alive in SEG\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_alive in SEG\n");
 	    /* update my F_members list */
 	    Insert_member( &F_members, pack_ptr->proc_id );
 
 	    break;
 
 	case REPRESENTED:
-	    Alarm( MEMB, "Handle_alive in REPRESENTED\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_alive in REPRESENTED\n");
 	    E_queue( Shift_to_seg_event, 0, NULL, Rep_timeout );
 
 	    break;
 
 	case GATHER:
-	    Alarm( MEMB, "Handle_alive in GATHER\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_alive in GATHER\n");
 	    /*
 	     * If I am a seg representative - take this guy 
 	     * If I am a ring leader: if this guy in my ring - lost token
@@ -464,7 +436,7 @@
 	case OP:
 	    /* if sender belongs to my ring then my token is lost (except for single segment confs)
 	       otherwise if I am a ring leader shift_to_gather */
-	    Alarm( MEMB, "Handle_join in OP\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_join in OP\n");
 	    if( Conf_id_in_conf( &Membership, pack_ptr->proc_id ) == -1 )
 	    {
 		if( Conf_leader( &Membership ) == My.id ) 
@@ -525,7 +497,7 @@
 	    {
 		if( pack_ptr->proc_id != My_seg_rep )
 		{
-		    Alarm( MEMB, 
+		    Alarmp( SPLOG_INFO, MEMB, 
 			"Memb_handle_join: representative shifts: old %d, new %d\n",
 			My_seg_rep, pack_ptr->proc_id );
 		    My_seg_rep = pack_ptr->proc_id;
@@ -598,23 +570,23 @@
     switch( State )
     {
 	case OP:
-	    Alarm( MEMB, "Handle_refer in OP\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_refer in OP\n");
 		break;
 
 	case SEG:
-	    Alarm( MEMB, "Handle_refer in SEG\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_refer in SEG\n");
 		break;
 
 	case REPRESENTED:
-	    Alarm( MEMB, "Handle_refer in REPRESENTED\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_refer in REPRESENTED\n");
 		break;
 
 	case GATHER:
-	    Alarm( MEMB, "Handle_refer in GATHER\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_refer in GATHER\n");
 		ret = Conf_proc_by_id( pack_ptr->memb_id.proc_id, &p );
 		if( ret < 0 )
 		{
-			Alarm( PRINT, "Memb_handle_refer: unknown proc_id %d\n",
+			Alarmp( SPLOG_PRINT,  PRINT, "Memb_handle_refer: unknown proc_id %d\n",
 				pack_ptr->memb_id.proc_id );
 			return;
 		}
@@ -625,11 +597,11 @@
 		break;
 
 	case FORM:
-	    Alarm( MEMB, "Handle_refer in FORM\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_refer in FORM\n");
 		break;
 
 	case EVS:
-	    Alarm( MEMB, "Handle_refer in EVS\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_refer in EVS\n");
 		break;
 
     }
@@ -646,11 +618,11 @@
     switch( State )
     {
 	case OP:
-	    Alarm( NONE, "Handle_foreign in OP\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_foreign in OP\n");
 		ret = Conf_proc_by_id( pack_ptr->proc_id, &p );
 		if( ret < 0 )
 		{
-			Alarm( PRINT, "Memb_handle_foreign: unknown proc_id %d\n",
+			Alarmp( SPLOG_PRINT,  PRINT, "Memb_handle_foreign: unknown proc_id %d\n",
 				pack_ptr->proc_id );
 			return;
 		}
@@ -678,23 +650,23 @@
 		break;
 
 	case SEG:
-	    Alarm( NONE, "Handle_foreign in SEG\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_foreign in SEG\n");
 		break;
 
 	case REPRESENTED:
-	    Alarm( NONE, "Handle_foreign in REPRESENTED\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_foreign in REPRESENTED\n");
 		break;
 
 	case GATHER:
-	    Alarm( NONE, "Handle_foreign in GATHER\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_foreign in GATHER\n");
 		break;
 
 	case FORM:
-	    Alarm( NONE, "Handle_foreign in FORM\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_foreign in FORM\n");
 		break;
 
 	case EVS:
-	    Alarm( NONE, "Handle_foreign in EVS\n");
+	    Alarmp( SPLOG_INFO, MEMB, "Handle_foreign in EVS\n");
 		/* 
 		 * This may happen when multiple old memberships merge 
 		 * and a message is retransmitted using bcast or scast.
@@ -746,32 +718,32 @@
     switch( State )
     {
 	case OP:
-		Alarm( MEMB, "Handle_form2 in OP (swallow)\n");
+		Alarmp( SPLOG_INFO, MEMB, "Handle_form2 in OP (swallow)\n");
 		/* swallow this token */
 		break;
 
 	case SEG:
-		Alarm( MEMB, "Handle_form2 in SEG (swallow)\n");
+		Alarmp( SPLOG_INFO, MEMB, "Handle_form2 in SEG (swallow)\n");
 		/* swallow this token */
 		break;
 
 	case REPRESENTED:
-		Alarm( MEMB, "Handle_form2 in REPRESENTED (swallow)\n");
+		Alarmp( SPLOG_INFO, MEMB, "Handle_form2 in REPRESENTED (swallow)\n");
 		/* swallow this token */
 		break;
 
 	case GATHER:
-		Alarm( MEMB, "Handle_form2 in GATHER (swallow)\n");
+		Alarmp( SPLOG_INFO, MEMB, "Handle_form2 in GATHER (swallow)\n");
 		/* swallow this token */
 		break;
 
 	case FORM:
-		Alarm( MEMB, "Handle_form2 in FORM\n");
+		Alarmp( SPLOG_INFO, MEMB, "Handle_form2 in FORM\n");
 		Read_form2( scat );
 		break;
 
 	case EVS:
-		Alarm( MEMB, "Handle_form2 in EVS (swallow)\n");
+		Alarmp( SPLOG_INFO, MEMB, "Handle_form2 in EVS (swallow)\n");
 		/* swallow this token */
 		break;
     }
@@ -805,14 +777,14 @@
 
 	case SEG:
 	case REPRESENTED:
-	    Alarm( EXIT, "Memb_token_loss: bug !!! state is %d\n",State);
+	    Alarmp( SPLOG_FATAL, EXIT, "Memb_token_loss: bug !!! state is %d\n",State);
 	    break;
 
 	case GATHER:
 	    /* I think I totally solved it */
 	    /* If I am not a ring leader it is a bug */
 	    if( ! Token_alive )
-		Alarm( EXIT, "Memb_token_loss: bug !!! state is %d but !Token_alive\n",State);
+		Alarmp( SPLOG_FATAL, EXIT, "Memb_token_loss: bug !!! state is %d but !Token_alive\n",State);
 
 	    /* I am a ring leader and I lost my ring */
 
@@ -995,12 +967,12 @@
 		if( Token_alive )
 		{
 			/* clear everything and go back to op */
-			Alarm( MEMB, "Form_or_fail:failed, return to OP\n");
+			Alarmp( SPLOG_INFO, MEMB, "Form_or_fail:failed, return to OP\n");
 			E_dequeue( Send_join_event, 0, NULL );
 			E_queue( Memb_lookup_new_members_event, 0, NULL, Lookup_timeout );
                         Shift_to_op();
 		}else{
-			Alarm( MEMB, "Form_or_fail: failed to gather\n");
+			Alarmp( SPLOG_INFO, MEMB, "Form_or_fail: failed to gather\n");
 			/* failed to gather again */
 			F_members.num_members = 1;
 			F_members.members[0] = My.id;
@@ -1029,7 +1001,7 @@
 {
 	packet_header	*pack_ptr;
 
-	Alarm( MEMB, "Scast_alive: State is %d\n", State);
+	Alarmp( SPLOG_INFO, MEMB, "Scast_alive: State is %d\n", State);
 
 	pack_ptr = (packet_header *)Send_pack.elements[0].buf;
 	pack_ptr->type = ALIVE_TYPE;
@@ -1054,7 +1026,7 @@
 	packet_header	*pack_ptr;
 	int		i;
 
-	Alarm( MEMB, "Send_join: State is %d\n", State);
+	Alarmp( SPLOG_INFO, MEMB, "Send_join: State is %d\n", State);
 
 	pack_ptr = (packet_header *)Send_pack.elements[0].buf;
 	pack_ptr->type = JOIN_TYPE;
@@ -1093,7 +1065,7 @@
 
 	if( State != OP )
 	{
-		Alarm( MEMB, "Memb_lookup_new_member: not in OP state, returning\n");
+		Alarmp( SPLOG_INFO, MEMB, "Memb_lookup_new_member: not in OP state, returning\n");
 		return;
 	}
 
@@ -1175,7 +1147,7 @@
 
 	ret = Conf_proc_by_id( rep.proc_id, &p );
 	if( ret < 0 ) 
-		Alarm( EXIT, "Insert_rep: proc %d not exist\n", rep.proc_id );
+		Alarmp( SPLOG_FATAL, EXIT, "Insert_rep: proc %d not exist\n", rep.proc_id );
 
 	if( rep.type == POTENTIAL_REP )
 	{
@@ -1239,7 +1211,7 @@
                     }
 		}
 	    }
-	}else Alarm( EXIT, "Insert_rep: unknown rep.type %d \n", rep.type );
+	}else Alarmp( SPLOG_FATAL, EXIT, "Insert_rep: unknown rep.type %d \n", rep.type );
 
         if (r->num_reps == MAX_REPS) 
         {
@@ -1261,12 +1233,12 @@
 
 	current = 0;
 	ret = Conf_proc_by_id( m->members[current], &curr_proc );
-	if( ret < 0 ) Alarm( EXIT, "Smallest_member: unknown proc_id %d\n",
+	if( ret < 0 ) Alarmp( SPLOG_FATAL, EXIT, "Smallest_member: unknown proc_id %d\n",
 				m->members[current] );
 	for( i=1; i < m->num_members; i++ )
 	{
 		ret = Conf_proc_by_id( m->members[i], &i_proc );
-		if( ret < 0 ) Alarm( EXIT, 
+		if( ret < 0 ) Alarmp( SPLOG_FATAL, EXIT, 
 			"Smallest_member: Bug! i: %d, proc %d\n",
 			i, m->members[i] );
 		if( i_proc.seg_index < curr_proc.seg_index  ||
@@ -1314,7 +1286,7 @@
 			current = i;
 		    }
 
-		}else Alarm( EXIT, 
+		}else Alarmp( SPLOG_FATAL, EXIT, 
 			"Smallest_rep: bug! current index %d is proc %d of type %d\n",
 			current,r->reps[current].proc_id,r->reps[current].type );
 	}
@@ -1713,11 +1685,11 @@
 			m_info->num_pending = i - m_info->num_members -1;
 			m_info->num_members += 1;
 
-		}else Alarm( EXIT, "Fill_form1: invalid rep type: %d\n", r_info->reps[r_info->rep_index].type );
+		}else Alarmp( SPLOG_FATAL, EXIT, "Fill_form1: invalid rep type: %d\n", r_info->reps[r_info->rep_index].type );
 
 		r_info->rep_index++;
 
-	}else Alarm( EXIT, "Fill_form1: invalid State: %d\n",State );
+	}else Alarmp( SPLOG_FATAL, EXIT, "Fill_form1: invalid State: %d\n",State );
 
         Form1_memb_id = form_token->memb_id;
 
@@ -1918,7 +1890,7 @@
   			    Alarmp( SPLOG_FATAL, MEMB, "Fill_form1:%d: token too big; num_bytes (%d)\n", __LINE__, num_bytes );
 			}
 
-			Alarm( MEMB , "INSERT HOLE 4 IS %d\n",index);
+			Alarmp( SPLOG_INFO, MEMB , "INSERT HOLE 4 IS %d\n",index);
 			*new_holes_procs_ptr = index;
 			new_holes_procs_ptr++;
 		    }
@@ -1938,7 +1910,7 @@
 	    /* adding self to trans members */
 	    Insert_member( &temp_set, My.id );
 	    if( temp_set.num_members != (my_rg_info->num_trans + 1) )
-		Alarm( EXIT, "Fill_form1: incorrect trans set\n");
+		Alarmp( SPLOG_FATAL, EXIT, "Fill_form1: incorrect trans set\n");
 	    temp_set.num_pending = my_rg_info->num_trans+1;
 
 	    /* adding rest of original commit set */
@@ -2183,10 +2155,10 @@
 		ret = Conf_proc_by_id( m_info->members[i], &p );
 
 		if( ret < 0 ) 
-                        Alarm( EXIT, "Read_form2: no such id %u\n", m_info->members[i] );
+                        Alarmp( SPLOG_FATAL, EXIT, "Read_form2: no such id %u\n", m_info->members[i] );
 
                 if ( Conf_append_id_to_seg( &Future_membership.segments[p.seg_index], p.id) == -1)
-                        Alarm( EXIT, "Read_form2: BUG2 no such id %u\n", p.id);
+                        Alarmp( SPLOG_FATAL, EXIT, "Read_form2: BUG2 no such id %u\n", p.id);
 	}
 
 	Net_set_membership( Future_membership );
@@ -2208,7 +2180,7 @@
 	{
 	        /* create dummy messages */ 
 		pack_entry = *my_holes_procs_ptr & PACKET_MASK;
-		Alarm( MEMB , "EXTRACT HOLE IS %d\n",*my_holes_procs_ptr);
+		Alarmp( SPLOG_INFO, MEMB , "EXTRACT HOLE IS %d\n",*my_holes_procs_ptr);
 
 		if( Packets[pack_entry].exist != 0 )
                 {
@@ -2371,7 +2343,7 @@
             num_bytes  += sizeof(membership_id);
             is_form1 = 0;
         } else {
-            Alarm( EXIT, "Invalid token type received: 0x%x\n", form_token->type);
+            Alarmp( SPLOG_FATAL, EXIT, "Invalid token type received: 0x%x\n", form_token->type);
             return;
         }
 
@@ -2528,7 +2500,7 @@
         int     num_seg, num_proc;
 	int32u	proc_id;
 
-	Alarm( MEMB, "Memb_transitional\n");
+	Alarmp( SPLOG_INFO, MEMB, "Memb_transitional\n");
 
         num_seg = Conf_num_segments( Cn );
 
@@ -2546,7 +2518,7 @@
 			if( Commit_set.members[k] == proc_id )
 			{
                                 if ( Conf_append_id_to_seg( &Trans_membership.segments[i], proc_id) == -1)
-                                        Alarm(EXIT, "Memb_transitional: Commit_set has member %u for trans who doesn't exist\n", proc_id);
+                                        Alarmp( SPLOG_FATAL, EXIT, "Memb_transitional: Commit_set has member %u for trans who doesn't exist\n", proc_id);
 				break;
 			}
 		    }
@@ -2569,7 +2541,7 @@
 			if( Commit_set.members[k] == proc_id )
 			{
                                 if ( Conf_append_id_to_seg(&Commit_membership.segments[i], proc_id) == -1)
-                                        Alarm(EXIT, "Memb_transitional: Commit_set has member %u who doesn't exist\n", proc_id);
+                                        Alarmp( SPLOG_FATAL, EXIT, "Memb_transitional: Commit_set has member %u who doesn't exist\n", proc_id);
 				break;
 			}
 		    }
@@ -2581,7 +2553,7 @@
 {
 	int	i;
 
-	Alarm( MEMB, "Memb_regular\n");
+	Alarmp( SPLOG_INFO, MEMB, "Memb_regular\n");
 	Transitional = 0;
 	Memb_Just_Installed = TRUE;
 
@@ -2611,9 +2583,9 @@
 	if( Conf_leader( &Membership ) == My.id )
 		E_queue( Memb_lookup_new_members_event, 0, NULL, Lookup_timeout );
 
-	Alarm( PRINT, "Membership id is ( %d, %d)\n", Membership_id.proc_id, Membership_id.time );
+	Alarmp( SPLOG_INFO, PRINT, "Membership id is ( %d, %d)\n", Membership_id.proc_id, Membership_id.time );
 	Conf_print( &Membership );
-	Alarm( PRINT, "\n" );
+	Alarmp( SPLOG_INFO, PRINT, "\n" );
 
         Shift_to_op();
 }

Modified: trunk/daemon/monitor.c
===================================================================
--- trunk/daemon/monitor.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/monitor.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -54,8 +54,8 @@
 
 #else		/* ARCH_PC_WIN95 */
 
-#include	<windows.h>
-#include        <winsock.h>
+#include        <windows.h>
+#include        <winsock2.h>
 #define ioctl   ioctlsocket
 WSADATA		WSAData;
 
@@ -72,7 +72,7 @@
 #include "spu_data_link.h"
 #include "spu_alarm.h"
 
-static	channel		SendChan;
+static	channel		Chan;
 static	sp_time		Send_partition_timeout = { 25, 0 };
 static	sp_time		Send_status_timeout;
 static  int             Status_active = 0;
@@ -89,14 +89,13 @@
 
 static	configuration	Cn;
 static  proc            My;
-static	int		My_port;
+static	int16u		My_port;
 static	char		*My_name;
 static	char		My_name_buf[80];
 static  char		Config_file[80];
 
 static	sys_scatter	Report_scat;
 static	packet_header	Report_pack;
-static  channel         Report_socket;
 
 static  const char            Spread_build_date[] = SPREAD_BUILD_DATE;
 
@@ -149,6 +148,7 @@
 
 int main( int argc, char *argv[] )
 {
+        spu_addr if_addr;
 	int	i;
 #ifdef _REENTRANT
         int     ret;
@@ -159,7 +159,7 @@
 
 	Alarmp( SPLOG_PRINT, SYSTEM, "/===========================================================================\\\n");
 	Alarmp( SPLOG_PRINT, SYSTEM, "| The Spread Toolkit.                                                       |\n");
-	Alarmp( SPLOG_PRINT, SYSTEM, "| Copyright (c) 1993-2014 Spread Concepts LLC                               |\n"); 
+	Alarmp( SPLOG_PRINT, SYSTEM, "| Copyright (c) 1993-2016 Spread Concepts LLC                               |\n"); 
 	Alarmp( SPLOG_PRINT, SYSTEM, "| All rights reserved.                                                      |\n");
 	Alarmp( SPLOG_PRINT, SYSTEM, "|                                                                           |\n");
 	Alarmp( SPLOG_PRINT, SYSTEM, "| The Spread package is licensed under the Spread Open-Source License.      |\n");
@@ -226,26 +226,23 @@
 	Pack_scat.elements[0].len = sizeof( packet_header );
 	Pack_scat.elements[0].buf = (char *)&Pack;
 
-	Pack.proc_id = My.id;
-	Pack.seq = My_port;
-	Pack.memb_id.proc_id = 15051963;
-
 	Report_scat.num_elements = 2;
 	Report_scat.elements[0].buf = (char *)&Report_pack;
 	Report_scat.elements[0].len = sizeof(packet_header);
 	Report_scat.elements[1].buf = (char *)&GlobalStatus;
 	Report_scat.elements[1].len = sizeof(status);
 
-        SendChan = DL_init_channel( SEND_CHANNEL , My_port, 0, 0 );
+	if_addr = My.proc_addr;
+        spu_addr_ip_set_port(&if_addr, My_port);
+        
+        Chan = DL_init_channel_gen(SEND_CHANNEL | RECV_CHANNEL, NULL, &if_addr);
 
-        Report_socket = DL_init_channel( RECV_CHANNEL, My_port, 0, 0 );
-
 	E_init(); /* both reentrent and non-reentrant code uses events */
 
 #ifndef	_REENTRANT
 	E_attach_fd( 0, READ_FD, User_command, 0, NULL, LOW_PRIORITY );
 
-        E_attach_fd( Report_socket, READ_FD, Report_message, 0, NULL, HIGH_PRIORITY );
+        E_attach_fd( Chan, READ_FD, Report_message, 0, NULL, HIGH_PRIORITY );
 #endif	/* _REENTRANT */
 
         
@@ -279,15 +276,19 @@
 
 static  void    read_configuration(void)
 {
-
 	Conf_init( Config_file, My_name );
 	Cn = Conf();
         My = Conf_my();
 
+        Pack.conf_hash       = Cn.hash_code;
+        Pack.transmiter_id   = My.id;
+	Pack.proc_id         = My.id;
+	Pack.seq             = My_port;
+        
         Alarm_clear_types(ALL);
         Alarm_set_types(PRINT | EXIT );
-
 }
+
 static  void    initialize_locks(void)
 {
         Mutex_init( &Status_mutex );
@@ -304,7 +305,7 @@
 {
 	for(;;)
 	{
-            Report_message( Report_socket, 0, NULL);
+            Report_message( Chan, 0, NULL);
 	}
 	return( 0 );
 }
@@ -538,8 +539,7 @@
 
 	Pack.type    = PARTITION_TYPE;
 	Pack.type    = Set_endian( Pack.type );
-        Pack.conf_hash = MONITOR_HASH;
-	Pack.data_len= sizeof( Partition );;
+	Pack.data_len= sizeof( Partition );
 
 	Pack_scat.num_elements    = 2;
 	Pack_scat.elements[1].len = sizeof( Partition );
@@ -552,8 +552,8 @@
 	    {
 		proc_id = Cn.segments[i].procs[j]->id;
 		proc_index = Conf_proc_by_id( proc_id, &p );
-		DL_send( SendChan, p.id, p.port, &Pack_scat );
-		DL_send( SendChan, p.id, p.port, &Pack_scat );
+		DL_sendto_gen( Chan, &Pack_scat, &p.proc_addr );
+		DL_sendto_gen( Chan, &Pack_scat, &p.proc_addr );
 	    }
 	}
 #ifndef _REENTRANT
@@ -716,7 +716,6 @@
 
 	Pack.type    = FC_TYPE;
 	Pack.type    = Set_endian( Pack.type );
-        Pack.conf_hash = MONITOR_HASH;
 	Pack.data_len= sizeof( Fc_buf );;
 
 	Pack_scat.num_elements    = 2;
@@ -730,8 +729,8 @@
 	    {
 		proc_id = Cn.segments[i].procs[j]->id;
 		proc_index = Conf_proc_by_id( proc_id, &p );
-		DL_send( SendChan, p.id, p.port, &Pack_scat );
-		DL_send( SendChan, p.id, p.port, &Pack_scat );
+		DL_sendto_gen( Chan, &Pack_scat, &p.proc_addr );
+		DL_sendto_gen( Chan, &Pack_scat, &p.proc_addr );
 	    }
 	}
 }
@@ -813,7 +812,6 @@
 
 	Pack.type    = STATUS_TYPE;
 	Pack.type    = Set_endian( Pack.type );
-        Pack.conf_hash = MONITOR_HASH;
 	Pack.data_len= 0;
 
 	Pack_scat.num_elements    = 1;
@@ -826,9 +824,7 @@
 		proc_id = Cn.segments[i].procs[j]->id;
 		proc_index = Conf_proc_by_id( proc_id, &p );
 		if( Status_vector[proc_index] )
-		{
-			DL_send( SendChan, p.id, p.port, &Pack_scat );
-		}
+                  DL_sendto_gen( Chan, &Pack_scat, &p.proc_addr );
 	    }
 	}
 #ifndef _REENTRANT
@@ -918,7 +914,6 @@
 	}
 	Pack.type    = PARTITION_TYPE;
 	Pack.type    = Set_endian( Pack.type );
-        Pack.conf_hash = MONITOR_HASH;
 	Pack.data_len= sizeof( Kill_partition );;
 
 	Pack_scat.num_elements    = 2;
@@ -934,8 +929,8 @@
 		if( Kill_partition[proc_index] == -1 )
 		{
 			Alarm( PRINT  , "Monitor: Terminating %s\n", p.name );
-			DL_send( SendChan, p.id, p.port, &Pack_scat );
-			DL_send( SendChan, p.id, p.port, &Pack_scat );
+			DL_sendto_gen( Chan, &Pack_scat, &p.proc_addr );
+			DL_sendto_gen( Chan, &Pack_scat, &p.proc_addr );
 		}
 	    }
 	}
@@ -1041,7 +1036,6 @@
 
 	Pack.type    = RELOAD_TYPE;
 	Pack.type    = Set_endian( Pack.type );
-        Pack.conf_hash = MONITOR_HASH;
 	Pack.data_len = 0;
 
 	Pack_scat.num_elements    = 1;
@@ -1055,7 +1049,8 @@
 	    {
 		proc_id = Cn.segments[i].procs[j]->id;
 		proc_index = Conf_proc_by_id( proc_id, &p );
-		DL_send( SendChan, p.id, p.port, &Pack_scat );
+		DL_sendto_gen( Chan, &Pack_scat, &p.proc_addr );
+		DL_sendto_gen( Chan, &Pack_scat, &p.proc_addr );
 	    }
 	}
         /* Now reload monitor's configuration 
@@ -1134,7 +1129,7 @@
 				Exit_Usage(exe, "Port number must be in range [0, 65536):", argv[1]);
 			}
 
-			My_port = (int) tmp;
+			My_port = (int16u) tmp;
 
        	        } else if ( !strncmp( *argv, "-n", 3 ) ) {
 

Modified: trunk/daemon/net_types.h
===================================================================
--- trunk/daemon/net_types.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/net_types.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -37,11 +37,10 @@
 #ifndef	INC_NET_TYPES
 #define	INC_NET_TYPES
 
-#include "arch.h"       /* For int32, etc */
-#include "spu_data_link.h"  /* For MAX_PACKET_SIZE */
+#include "arch.h"
+#include "spu_data_link.h"
 
-/*	Dont forget that 0x80000080 is kept for endians */
-
+/* Dont forget that 0x80000080 is kept for endians */
 /* NOTE: protocol.c depends on UNRELIABLE_TYPE < ... < SAFE_TYPE < BLOCK_REGULAR_DELIVERY */
 
 #define		UNRELIABLE_TYPE		0x00000001
@@ -75,48 +74,48 @@
 #define		CONTROL_TYPE		0x0f000000
 
 
-#define		Is_unreliable( type )	( type &  UNRELIABLE_TYPE )
-#define		Is_reliable( type )	( type &  RELIABLE_TYPE   )
-#define		Is_fifo( type )		( type &  FIFO_TYPE       )
-#define		Is_agreed( type )	( type &  AGREED_TYPE     )
-#define		Is_safe( type )		( type &  SAFE_TYPE       )
-#define		Is_regular( type )	( type &  REGULAR_TYPE    )
+#define         Is_unreliable( t )      ( (t) &  UNRELIABLE_TYPE )
+#define         Is_reliable( t )        ( (t) &  RELIABLE_TYPE   )
+#define         Is_fifo( t )            ( (t) &  FIFO_TYPE       )
+#define         Is_agreed( t )          ( (t) &  AGREED_TYPE     )
+#define         Is_safe( t )            ( (t) &  SAFE_TYPE       )
+#define         Is_regular( t )         ( (t) &  REGULAR_TYPE    )
 
-#define		Is_routed( type )	( type &  ROUTED_TYPE     )
-#define		Set_routed( type )	( type |  ROUTED_TYPE     )
-#define		Clear_routed( type )	( type & ~ROUTED_TYPE     )
+#define         Is_routed( t )          ( (t) &  ROUTED_TYPE     )
+#define         Set_routed( t )         ( (t) |  ROUTED_TYPE     )
+#define         Clear_routed( t )       ( (t) & ~ROUTED_TYPE     )
 
-#define		Is_hurry( type )	( type &  HURRY_TYPE      )
+#define         Is_hurry( t )           ( (t) &  HURRY_TYPE      )
 
-#define		Is_alive( type )	( type &  ALIVE_TYPE      )
-#define		Is_join( type )		( type &  JOIN_TYPE       )
-#define		Is_refer( type )	( type &  REFER_TYPE      )
-#define		Is_membership( type )	( type &  MEMBERSHIP_TYPE )
+#define         Is_alive( t )           ( (t) &  ALIVE_TYPE      )
+#define         Is_join( t )            ( (t) &  JOIN_TYPE       )
+#define         Is_refer( t )           ( (t) &  REFER_TYPE      )
+#define         Is_membership( t )      ( (t) &  MEMBERSHIP_TYPE )
 
-#define		Is_form( type )		( type &  FORM_TYPE	  )
-#define		Is_form1( type )	( type &  FORM1_TYPE	  )
-#define		Is_form2( type )	( type &  FORM2_TYPE	  )
+#define         Is_form( t )            ( (t) &  FORM_TYPE       )
+#define         Is_form1( t )           ( (t) &  FORM1_TYPE      )
+#define         Is_form2( t )           ( (t) &  FORM2_TYPE      )
 
-#define		Get_arq( type )		( (type &  ARQ_TYPE) >> 16)
-#define		Set_arq( type, val )	( (type & ~ARQ_TYPE) | ((val << 16)&ARQ_TYPE) )
-#define		Get_retrans( type )	( (type &  RETRANS_TYPE) >> 20)
-#define		Set_retrans( type, val) ( (type & ~RETRANS_TYPE) | ((val << 20)&RETRANS_TYPE) )
+#define         Get_arq( t )            ( ( (t) &  ARQ_TYPE       ) >> 16 )
+#define         Set_arq( t, val )       ( ( (t) & ~ARQ_TYPE       ) | ( ( (val) << 16) & ARQ_TYPE ) )
+#define         Get_retrans( t )        ( ( (t) &  RETRANS_TYPE   ) >> 20 )
+#define         Set_retrans( t, val)    ( ( (t) & ~RETRANS_TYPE   ) | ( ( (val) << 20) & RETRANS_TYPE ) )
 
-#define		Is_status( type )	( type &  STATUS_TYPE     )
-#define		Is_partition( type )	( type &  PARTITION_TYPE  )
-#define		Is_fc( type )		( type &  FC_TYPE         )
-#define		Is_conf_reload( type )	( type &  RELOAD_TYPE     )
-#define		Is_control( type )	( type &  CONTROL_TYPE    )
+#define         Is_status( t )          ( (t) &  STATUS_TYPE     )
+#define         Is_partition( t )       ( (t) &  PARTITION_TYPE  )
+#define         Is_fc( t )              ( (t) &  FC_TYPE         )
+#define         Is_conf_reload( t )     ( (t) &  RELOAD_TYPE     )
+#define         Is_control( t )         ( (t) &  CONTROL_TYPE    )
 
-
-#define MONITOR_HASH    1100    /* Conf_hash code for packets from spmonitor program */
-
-typedef	struct	dummy_fragment_header {
+typedef	struct
+{
 	int16		fragment_index;
 	int16		fragment_len;
+  
 } fragment_header;
 
-typedef	struct	dummy_packet_header {
+typedef	struct
+{
 	int32		type;
 	int32		transmiter_id;
 	int32		proc_id;
@@ -124,14 +123,16 @@
 	int32		seq;
 	int32		token_round; /* ### changed from fifo_seq */
         int32           conf_hash;
-	int16		data_len;
+	int16u		data_len;
 	int16           padding;
         fragment_header first_frag_header;
+  
 } packet_header;
 
-typedef	char       packet_body[MAX_PACKET_SIZE-sizeof(packet_header)];
+typedef	char packet_body[MAX_PACKET_SIZE - sizeof(packet_header)];
 
-typedef	struct	dummy_token_header {
+typedef	struct
+{
 	int32		type;
 	int32		transmiter_id;
         int32		proc_id;
@@ -140,17 +141,20 @@
 	int32		aru;
         int32           aru_last_id;
 	int16		flow_control;
-	int16		rtr_len;
+	int16u		rtr_len;
         int32           conf_hash;
+
 } token_header;
 
-typedef	char       token_body[((0x1 << 16) - 1) /* max IP packet size */ - 20 /* IP */ - 8 /* UDP */ - sizeof(token_header)];
+typedef	char token_body[((0x1 << 16) - 1) /* max IP packet size */ - 20 /* IP */ - 8 /* UDP */ - sizeof(token_header)];
 
-typedef	struct	dummy_ring_rtr {
+typedef	struct
+{
 	membership_id	memb_id;
 	int32		proc_id;
 	int16		seg_index;
 	int16		num_seq;
+
 } ring_rtr;
 
 #endif	/* INC_NET_TYPES */

Modified: trunk/daemon/network.c
===================================================================
--- trunk/daemon/network.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/network.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -33,8 +33,10 @@
  *
  */
 
+#include <string.h>
+#include <assert.h>
+#include <errno.h>
 
-#include <assert.h>
 #include "arch.h"
 #include "spread_params.h"
 #include "network.h"
@@ -44,33 +46,31 @@
 #include "status.h"
 #include "spu_alarm.h"
 #include "configuration.h"
-
-/* for Memb_print_form_token() */
 #include "membership.h"
 
-static	channel		Bcast_channel[MAX_INTERFACES_PROC];
+/********************************************************************************
+ ********************************************************************************/
+
+static	channel		Bcast_channel[MAX_INTERFACES_PROC + MAX_ADDRS_SEGMENT];
 static  channel		Token_channel[MAX_INTERFACES_PROC];
 static	channel		Send_channel;
 
 static  int             Num_bcast_channels;
 static  int             Num_token_channels;
 
-static	int		Bcast_needed;
-static	int32		Bcast_address;
-static	int16		Bcast_port;
+static	bool		Bcast_needed;
+static  int             Bcast_addrs_num;
+static	spu_addr	Bcast_addrs[MAX_ADDRS_SEGMENT];
 
 static	int		Num_send_needed;
-static  int32		Send_address[MAX_SEGMENTS];
-static	int16		Send_ports[MAX_SEGMENTS];
+static  spu_addr        Send_addrs[MAX_SEGMENTS];
 
-/* address for token sending - which is always needed */
-static	int32		Token_address;
-static	int16		Token_port;
+static	spu_addr	Token_addr;
 
 static	configuration	Net_membership;
-static	int		Segment_leader;
+static	bool		Segment_leader;
 
-static 	configuration	*Cn;
+static 	configuration  *Cn;
 static	proc		My;
 
 static	int16		Partition[MAX_PROCS_RING];
@@ -82,81 +82,247 @@
 static	void		Flip_pack( packet_header *pack_ptr );
 static	void		Flip_token( token_header *token_ptr );
 
+/********************************************************************************
+ * Send scat to all Bcast_addrs through Send_channel.
+ *
+ * Returns minimum return value from each call to DL_sendto_gen.
+ ********************************************************************************/
 
-void	Net_init()
+static int send_bcast( const sys_scatter *scat )
 {
-	proc		dummy_proc;
-        int32u          interface_addr;
-        int             i;
-        bool            bcast_bound = FALSE;
+  int ret;
+  int tmp;
+  int i;
 
-	Cn = Conf_ref();
-	My = Conf_my();
+  if (Bcast_addrs_num < 1 || Bcast_addrs_num > MAX_ADDRS_SEGMENT)
+    Alarmp(SPLOG_FATAL, NETWORK, "send_bcast: illegal Bcast_addrs_num (%d)!\n", Bcast_addrs_num);
 
-	Partition_my_index = Conf_proc_by_id( My.id, &dummy_proc );
-	Net_clear_partition();
+  if ((ret = DL_sendto_gen(Send_channel, scat, &Bcast_addrs[0])) < 0)
+    Alarmp(SPLOG_ERROR, NETWORK, "send_bcast: DL_sendto_gen(%s) #0 on channel %d failed with %d %d %s\n",
+           SPU_ADDR_NTOP(&Bcast_addrs[0]), (int) Send_channel, ret, sock_errno, sock_strerror(sock_errno));
+    
+  for (i = 1; i < Bcast_addrs_num; ++i)
+  {
+    if ((tmp = DL_sendto_gen(Send_channel, scat, &Bcast_addrs[i])) < 0)
+      Alarmp(SPLOG_ERROR, NETWORK, "send_bcast: DL_sendto_gen(%s) #%d on channel %d failed with %d %d %s\n",
+             SPU_ADDR_NTOP(&Bcast_addrs[0]), i, (int) Send_channel, ret, sock_errno, sock_strerror(sock_errno));
+        
+    if (tmp != ret)
+    {
+      Alarmp(SPLOG_WARNING, NETWORK, "send_bcast: multiple DL_sendto_gen's had different return codes! %d != %d\n", tmp, ret);
+      
+      if (tmp < ret)
+        ret = tmp;
+    }
+  }
 
-	if( Cn->segments[My.seg_index].num_procs > 1 )
-	{
-		/* I am not allone in segment */
-		Bcast_needed  = 1;
-		Bcast_address = Cn->segments[My.seg_index].bcast_address;
-		Bcast_port    = My.port;
+  if (ALARMP_NEEDED(SPLOG_DEBUG, NETWORK))
+    Alarmp(SPLOG_DEBUG, NETWORK, "send_bcast: ret = %d on channel %d\n", ret, (int) Send_channel);
 
-		Alarm( NETWORK, "Net_init: Bcast needed to address (%d, %d)\n",
-			Bcast_address, Bcast_port );
-	}else{
-		Bcast_needed  = 0;
-		Bcast_address = 0;
-		Alarm( NETWORK, "Net_init: Bcast is not needed\n" );
-	}
+  return ret;  /* return minimum value (e.g.: -1) from DL_sendto_gen's */
+}
 
-        /* To receive broadcast (and possibly multicast) packets on a socket
-         * bound to a specific interface, we also have to bind to the broadcast
-         * address on the interface as well as the unicast interface. That is 
-         * what the double bind of the bcast_address does.
-         * 
-         * The above statement is not true for Windows -- there binding to 
-         * the broadcast address is forbidden. So we do not compile in the
-         * bind call on windows.
-         */
-        for ( i=0; i < My.num_if; i++)
-        {
-                if (Is_IfType_Daemon( My.ifc[i].type ) || Is_IfType_Any( My.ifc[i].type ) )
-                {
-                        if (Is_IfType_Any( My.ifc[i].type ) )
-                                interface_addr = 0;
-                        else {
-                                interface_addr = My.ifc[i].ip;
-                                if (Bcast_needed && !bcast_bound) {
-#ifndef ARCH_PC_WIN95
-                                    Bcast_channel[Num_bcast_channels++] = DL_init_channel( RECV_CHANNEL | NO_LOOP, My.port, Bcast_address, Bcast_address );
-#endif
-                                    bcast_bound = TRUE;
-                                }
-                        }
-                        Bcast_channel[Num_bcast_channels++] = DL_init_channel( RECV_CHANNEL | DL_BIND_ALL | NO_LOOP, My.port, Bcast_address, interface_addr );
-                        Token_channel[Num_token_channels++] = DL_init_channel( RECV_CHANNEL, My.port+1, 0, interface_addr );
-                }
-        }
+/********************************************************************************
+ * Called from above when configuration file is reloaded.  Needs to
+ * update any static variables that depend on current configuration.
+ ********************************************************************************/
 
-	Send_channel  = DL_init_channel( SEND_CHANNEL, My.port+2, 0, My.id );
+void Net_signal_conf_reload(void)
+{
+  proc dummy_proc;
+  int  i;
 
-	Num_send_needed = 0;
+  Cn = Conf_ref();
+  My = Conf_my();
+  
+  Partition_my_index = Conf_proc_by_id( My.id, &dummy_proc );
+  Net_clear_partition();
+
+  if (My.num_if > MAX_INTERFACES_PROC)
+    Alarmp(SPLOG_FATAL, NETWORK, "BUG! Too many interfaces on my daemon!\n");
+  
+  if ((Bcast_addrs_num = Cn->segments[My.seg_index].num_seg_addrs) > MAX_ADDRS_SEGMENT)
+    Alarmp(SPLOG_FATAL, NETWORK, "BUG! Too many segment addresses in my segment!\n");
+
+  for (i = 0; i < Bcast_addrs_num; ++i)
+    Bcast_addrs[i] = Cn->segments[My.seg_index].seg_addrs[i];
+  
+  if ((Bcast_needed = (Cn->segments[My.seg_index].num_procs > 1)))
+    Alarmp(SPLOG_INFO, NETWORK, "Net_signal_conf_reload: Bcast needed\n");
+  
+  else
+    Alarmp(SPLOG_INFO, NETWORK, "Net_signal_conf_reload: Bcast is not needed\n");
 }
-/* Called from above when configuration file is reloaded (potentially with changes to spread configuration
- * Needs to update any static-scope variables that depend on current configuration
- */
-void    Net_signal_conf_reload(void)
+
+/********************************************************************************
+ ********************************************************************************/
+
+void    Net_init()
 {
-	proc		dummy_proc;
+  spu_addr  if_addr = { 0 };
+  int16u    if_port;
+  int       ret;
+  int       i, j;
 
-        Partition_my_index = Conf_proc_by_id( My.id, &dummy_proc );
+  Net_signal_conf_reload();
 
-        Cn = Conf_ref();
-        My = Conf_my();
+  if_port = spu_addr_ip_get_port(&My.proc_addr);
+        
+  if (My.num_if < 1)
+    Alarmp(SPLOG_FATAL, NETWORK, "Net_init: BUG! No interfaces?! %d\n", My.num_if);
+
+  for (i = 0; i < Bcast_addrs_num; ++i)
+    if (if_port != spu_addr_ip_get_port(&Bcast_addrs[i]))
+      Alarmp(SPLOG_FATAL, NETWORK, "Net_init: BUG! Proc and segment port mismatch?!\n");
+
+  /* NOTE: we broke out the special case of no interface spec given to make the logic easier to follow between the two cases */
+  
+  if (Is_IfType_Any(My.ifc[0].iftype))
+  {
+    /* no interface spec was given: bind to base port (and +1) on all interfaces (e.g. - INADDRY_ANY) */
+    
+    if (My.num_if != 1)
+      Alarmp(SPLOG_FATAL, NETWORK, "Net_init: BUG! No interfaces were specified but we have more than the implicit one?!\n");
+
+    if_addr = My.ifc[0].ifaddr;
+    
+    if (spu_addr_ip_cmp(&if_addr, &My.proc_addr, TRUE))
+      Alarmp(SPLOG_FATAL, NETWORK, "Net_init: BUG! Implicit interface didn't match proc?!\n");
+
+    spu_addr_ip_set_unspecified(&if_addr);
+
+    if (spu_addr_family(&if_addr) == AF_INET6)
+      if_addr.ipv6.sin6_scope_id = 0;
+    
+    Alarmp(SPLOG_INFO, NETWORK, "Net_init: implicit: binding bcast recv channel to [%s]:%u\n", SPU_ADDR_NTOP(&if_addr), (unsigned) spu_addr_ip_get_port(&if_addr));
+    Bcast_channel[Num_bcast_channels] = DL_init_channel_gen(RECV_CHANNEL, NULL, &if_addr);
+
+    for (i = 0; i < Bcast_addrs_num; ++i)
+      if (spu_addr_ip_is_multicast(&Bcast_addrs[i]))
+      {
+        if ((ret = DL_join_multicast_gen(Bcast_channel[Num_bcast_channels], &Bcast_addrs[i], &My.proc_addr)))
+          Alarmp(SPLOG_FATAL, NETWORK, "Net_init: implicit: error joining multicast group %s on channel %d: %d %s\n",
+                 SPU_ADDR_NTOP(&Bcast_addrs[i]), (int) Bcast_channel[Num_bcast_channels], sock_errno, sock_strerror(sock_errno));
+
+        Alarmp(SPLOG_INFO, NETWORK, "Net_init: implicit: joined multicast group %s on channel %d\n", SPU_ADDR_NTOP(&Bcast_addrs[i]), (int) Bcast_channel[Num_bcast_channels]);
+      }
+
+    ++Num_bcast_channels;
+    spu_addr_ip_set_port(&if_addr, if_port + 1);
+
+    Alarmp(SPLOG_INFO, NETWORK, "Net_init: implicit: binding token recv channel to [%s]:%u\n", SPU_ADDR_NTOP(&if_addr), (unsigned) spu_addr_ip_get_port(&if_addr));
+    Token_channel[Num_token_channels] = DL_init_channel_gen(RECV_CHANNEL, NULL, &if_addr);
+    ++Num_token_channels;
+  }
+  else
+  {
+    /* an interface specification was given */
+
+    bool bcast_bound[MAX_ADDRS_SEGMENT] = { 0 };  /* have we already explicitly or implicitly bound to Bcast_addrs yet? */
+    
+    for (i = 0; i < My.num_if; ++i)
+    {
+      int reuse_addr_opt = 0;      /* if the user explicitly binds to one of Bcast_addrs or a multicast address, then do the bind with REUSE_ADDR */
+      
+      if (Is_IfType_Any(My.ifc[i].iftype))
+        Alarmp(SPLOG_FATAL, NETWORK, "Net_init: BUG! An ANY interface type within an interface specification?!\n");
+
+      if (!Is_IfType_Daemon(My.ifc[i].iftype))
+        continue;
+
+      if_addr = My.ifc[i].ifaddr;
+
+      if (if_port != spu_addr_ip_get_port(&if_addr))
+        Alarmp(SPLOG_FATAL, NETWORK, "Net_init: BUG! Interface port didn't match daemon port?!\n");
+
+      /* if the user explicitly binds to the unspecified address (e.g. - INADDR_ANY) or to a Bcast_addr, then skip the extra bind(s) to the related Bcast_addrs below */
+      
+      if (spu_addr_ip_is_unspecified(&if_addr) && spu_addr_family(&if_addr) == spu_addr_family(&My.proc_addr))
+        for (j = 0; j < Bcast_addrs_num; ++j)
+          bcast_bound[j] = TRUE;
+
+      else
+        for (j = 0; j < Bcast_addrs_num; ++j)
+          if (!spu_addr_ip_cmp(&if_addr, &Bcast_addrs[j], TRUE))
+          {
+            bcast_bound[j] = TRUE;
+            reuse_addr_opt = REUSE_ADDR;
+            break;
+          }
+      
+      if (spu_addr_ip_is_multicast(&if_addr))
+        reuse_addr_opt = REUSE_ADDR;
+
+      Alarmp(SPLOG_INFO, NETWORK, "Net_init: explicit: binding a recv bcast channel to [%s]:%u\n", SPU_ADDR_NTOP(&if_addr), (unsigned) spu_addr_ip_get_port(&if_addr));
+      Bcast_channel[Num_bcast_channels] = DL_init_channel_gen(RECV_CHANNEL | reuse_addr_opt, NULL, &if_addr);
+
+      for (j = 0; j < Bcast_addrs_num; ++j)
+        if (spu_addr_ip_is_multicast(&Bcast_addrs[j]))
+        {
+          if ((ret = DL_join_multicast_gen(Bcast_channel[Num_bcast_channels], &Bcast_addrs[j], &My.proc_addr)))
+            Alarmp(SPLOG_FATAL, NETWORK, "Net_init: explicit: error joining multicast group %s on channel %d: %d %s\n",
+                   SPU_ADDR_NTOP(&Bcast_addrs[j]), (int) Bcast_channel[Num_bcast_channels], sock_errno, sock_strerror(sock_errno));
+          
+          Alarmp(SPLOG_INFO, NETWORK, "Net_init: explicit: joined multicast group %s on channel %d\n", SPU_ADDR_NTOP(&Bcast_addrs[j]), (int) Bcast_channel[Num_bcast_channels]);
+        }
+
+      ++Num_bcast_channels;
+      spu_addr_ip_set_port(&if_addr, if_port + 1);
+
+      Alarmp(SPLOG_INFO, NETWORK, "Net_init: explicit: binding a recv token channel to [%s]:%u\n", SPU_ADDR_NTOP(&if_addr), (unsigned) spu_addr_ip_get_port(&if_addr));
+      Token_channel[Num_token_channels] = DL_init_channel_gen(RECV_CHANNEL, NULL, &if_addr);
+      ++Num_token_channels;
+    }
+    
+    /* On *nix, when binding to specific interfaces, we also need to
+     * bind to the segment addresses to receive multicast or broadcast
+     * packets bc of bind's destination address matching + delivery.
+     *
+     * The above statement is not true for Windows.  Also, binding to
+     * a broadcast address is forbidden there. So, we do not compile
+     * in these extra binds on windows.
+     *
+     * TODO: Check that multicast and broadcast actually work as
+     * desired on Windows when done this way.
+     */
+
+#ifndef ARCH_PC_WIN95
+    for (i = 0; i < Bcast_addrs_num; ++i)
+      if (!bcast_bound[i])                 /* didn't already explicity or implicitly bind to Bcast_addrs[i] above */
+      {
+        if_addr = Bcast_addrs[i];
+        
+        Alarmp(SPLOG_INFO, NETWORK, "Net_init: explicit: binding an extra recv bcast channel to [%s]:%u\n", SPU_ADDR_NTOP(&if_addr), (unsigned) spu_addr_ip_get_port(&if_addr));
+        Bcast_channel[Num_bcast_channels] = DL_init_channel_gen(RECV_CHANNEL | REUSE_ADDR, NULL, &if_addr);
+
+        for (j = 0; j < Bcast_addrs_num; ++j)
+          if (spu_addr_ip_is_multicast(&Bcast_addrs[j]))
+          {
+            if ((ret = DL_join_multicast_gen(Bcast_channel[Num_bcast_channels], &Bcast_addrs[j], &My.proc_addr)))
+              Alarmp(SPLOG_FATAL, NETWORK, "Net_init: explicit: error joining multicast group %s on channel %d: %d %s\n",
+                     SPU_ADDR_NTOP(&Bcast_addrs[j]), (int) Bcast_channel[Num_bcast_channels], sock_errno, sock_strerror(sock_errno));
+            
+            Alarmp(SPLOG_INFO, NETWORK, "Net_init: explicit: joined multicast group %s on channel %d\n", SPU_ADDR_NTOP(&Bcast_addrs[j]), (int) Bcast_channel[Num_bcast_channels]);
+          }
+      
+        ++Num_bcast_channels;
+      }
+#endif    
+  }
+
+  /* NOTE: currently we don't use NO_LOOP bc another daemon in our segment might be on the same machine but bound to a different interface */
+  /* NOTE: we also use RECV_CHANNEL bc we want to bind to My.proc_addr so that our source address is My.proc_addr when our messages are received */
+
+  if_addr = My.proc_addr;
+  spu_addr_ip_set_port(&if_addr, 0);
+  
+  Alarmp(SPLOG_INFO, NETWORK, "Net_init: creating send channel bound to %s\n", SPU_ADDR_NTOP(&if_addr));
+  Send_channel = DL_init_channel_gen(SEND_CHANNEL | RECV_CHANNEL, NULL, &if_addr);
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 void	Net_set_membership( configuration memb )
 {
 	int	i;
@@ -167,17 +333,24 @@
 	Net_membership = memb;
 	my_seg = Net_membership.segments[My.seg_index];
 	my_index_in_seg = Conf_id_in_seg( &my_seg, My.id );
-	if( my_index_in_seg < 0 ) {
+
+	if ( my_index_in_seg < 0 )
+        {
 		Conf_print( &Net_membership );
 		Alarm( EXIT, "Net_set_membership: I am not in membership\n" );
 	}
-	else if( my_index_in_seg == 0) {
+        
+	if ( my_index_in_seg == 0)
+        {
 		Segment_leader = 1;
 		Alarm( NETWORK,"Net_set_membership: I am a Segment leader\n");
-	} else  Segment_leader = 0;
+	}
+        else
+                Segment_leader = 0;
 
 	Num_send_needed = 0;
 	my_next_index = -1;
+        
 	for( i=0; i < Conf_num_segments( Cn ); i++ )
 	{
 	    if( i == My.seg_index )
@@ -189,117 +362,102 @@
 		 * the token send address.
 		 */
 		my_next_index = Num_send_needed;
-
-	    } else if( Net_membership.segments[i].num_procs > 0 ) {
-
-		Send_address[Num_send_needed] = Net_membership.segments[i].procs[0]->id;
-		Send_ports  [Num_send_needed] = Net_membership.segments[i].port;
-
+	    }
+            else if( Net_membership.segments[i].num_procs > 0 )
+            {
+		Send_addrs[Num_send_needed] = Net_membership.segments[i].procs[0]->proc_addr;
 		Num_send_needed++;
 	    }
 	}
+        
 	assert(my_next_index != -1);
+        
 	for( i=0; i < Num_send_needed; i++ )
-		Alarm( NETWORK, 
-			"Net_set_membership: Send_addr[%d] is (%u.%u.%u.%u:%d)\n",
-                       i, IP1(Send_address[i]), IP2(Send_address[i]), IP3(Send_address[i]), IP4(Send_address[i]), Send_ports[i] );
+          Alarm( NETWORK, "Net_set_membership: Send_addrs[%d] = [%s]:%u\n", i, SPU_ADDR_NTOP(&Send_addrs[i]), (unsigned) spu_addr_ip_get_port(&Send_addrs[i]));
 
 	/* Calculate where to send the token */
-	Token_address = 0;
-	if( my_index_in_seg < my_seg.num_procs-1 )
-	{
-		Token_address = my_seg.procs[my_index_in_seg+1]->id;
-		Token_port    = my_seg.port+1;
-	}else{
-		/* I am last in my segment */
-		if( Num_send_needed == 0 )
-		{
-			/* 
-			 * My segment is the only segment
-			 * sending token to the first in my segment 
-			 */
-			Token_address = my_seg.procs[0]->id;
-			Token_port    = my_seg.port+1;
-		} else if( Num_send_needed == my_next_index ) {
-			/* 
-			 * My segment is the last segment
-			 * sending token to the first in first valid segment
-			 */	
-			Token_address = Send_address[0];
-			Token_port    = Send_ports[0]+1;
-		} else {
-			/*
-			 * There is a valid segment after mine
-			 * sending token to the first in next valid segment
-			 */
-			Token_address = Send_address[my_next_index];
-			Token_port    = Send_ports[my_next_index]+1;
-		}
 
-	}
-	Alarm( NETWORK, "Net_set_membership: Token_address : (%u.%u.%u.%u:%d)\n",
-               IP1(Token_address), IP2(Token_address), IP3(Token_address), IP4(Token_address), Token_port );
+	if ( my_index_in_seg < my_seg.num_procs - 1 )                 /* I am not last in my segment */
+          Token_addr = my_seg.procs[my_index_in_seg + 1]->proc_addr;  /* send to next member in my segment */
+
+	else if ( Num_send_needed == 0 )                              /* My segment is the only segment */
+          Token_addr = my_seg.procs[0]->proc_addr;                    /* send to first member in my segment */
+        
+        else if ( Num_send_needed == my_next_index )                  /* My segment is the last segment */
+          Token_addr = Send_addrs[0];                                 /* send to first in first valid segment */
+
+        else                                                          /* There is a valid segment after mine */
+          Token_addr = Send_addrs[my_next_index];                     /* send to first in next valid segment */
+
+        spu_addr_ip_set_port(&Token_addr, spu_addr_ip_get_port(&Token_addr) + 1);
+        
+	Alarm(NETWORK, "Net_set_membership: Token_addr = [%s]:%u\n", SPU_ADDR_NTOP(&Token_addr), (unsigned) spu_addr_ip_get_port(&Token_addr));
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 int	Net_bcast( sys_scatter *scat )
 {
 	packet_header	*pack_ptr;
 	int 		i;
-	int		ret;
+	int		ret = 0;
 
-	ret = 0;
 	/* routing on channels if needed according to membership */
-	pack_ptr = (packet_header *)scat->elements[0].buf;
-	pack_ptr->type  = Set_routed( pack_ptr->type );
-	pack_ptr->type  = Set_endian( pack_ptr->type );
-        pack_ptr->conf_hash = Cn->hash_code;
+        
+	pack_ptr                = (packet_header*) scat->elements[0].buf;
+	pack_ptr->type          = Set_routed( pack_ptr->type );
+	pack_ptr->type          = Set_endian( pack_ptr->type );
+        pack_ptr->conf_hash     = Cn->hash_code;
 	pack_ptr->transmiter_id = My.id;
-	for ( i=0; i< Num_send_needed; i++ )
-	{
-	    ret = DL_send( Send_channel, Send_address[i], Send_ports[i], scat );
-	}
+        
+	for ( i = 0; i < Num_send_needed; ++i )
+          ret = DL_sendto_gen( Send_channel, scat, &Send_addrs[i] );
+
 	pack_ptr->type = Clear_routed( pack_ptr->type );
 
 	/* broadcasting if needed according to configuration */
+        
 	if( Bcast_needed )
-	{	
-	    ret = DL_send( Send_channel, Bcast_address, Bcast_port, scat );
-	}
+          ret = send_bcast( scat );
 
-        if( !Bcast_needed && (Num_send_needed == 0) )
-            ret = 1; /* No actual send is needed, but 'packet' can be considered 'sent' */
+        else if ( Num_send_needed == 0 )
+          ret = 1; /* No actual send is needed, but 'packet' can be considered 'sent' */
 
 	return( ret );
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 int	Net_scast( int16 seg_index, sys_scatter *scat )
 {
 	packet_header	*pack_ptr;
-	int		ret;
+	int		ret               = 0;
         bool            send_not_needed_p = FALSE;
 
-	ret = 0;
-	pack_ptr = (packet_header *)scat->elements[0].buf;
-	pack_ptr->type = Set_endian( pack_ptr->type );
-        pack_ptr->conf_hash = Cn->hash_code;
+	pack_ptr                = (packet_header*) scat->elements[0].buf;
+	pack_ptr->type          = Set_endian( pack_ptr->type );
+        pack_ptr->conf_hash     = Cn->hash_code;
 	pack_ptr->transmiter_id = My.id;
-	if( seg_index == My.seg_index )
+        
+	if ( seg_index == My.seg_index )
 	{
 	    if( Bcast_needed )
-	    {
-	    	ret = DL_send( Send_channel, Bcast_address, Bcast_port, scat );
-	    } else 
+                ret = send_bcast( scat );
+            
+	    else 
                 send_not_needed_p = TRUE;
-	}else{
-	    if( Net_membership.segments[seg_index].num_procs > 0 )
+	}
+        else
+        {
+	    if ( Net_membership.segments[seg_index].num_procs > 0 )
 	    {
 		pack_ptr->type = Set_routed( pack_ptr->type );
-	    	ret = DL_send( Send_channel, 
-			Net_membership.segments[seg_index].procs[0]->id,
-			Net_membership.segments[seg_index].port,
-			scat );
+	    	ret            = DL_sendto_gen( Send_channel, scat, &Net_membership.segments[seg_index].procs[0]->proc_addr );
 		pack_ptr->type = Clear_routed( pack_ptr->type );
-	    } else
+	    }
+            else
                 send_not_needed_p = TRUE;
 	}
 
@@ -309,327 +467,445 @@
 	return( ret );
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 int	Net_ucast( int32 proc_id, sys_scatter *scat )
 {
 	packet_header	*pack_ptr;
 	proc		p;
-	int		ret;
 
-	pack_ptr = (packet_header *)scat->elements[0].buf;
-	pack_ptr->type = Set_endian( pack_ptr->type );
-        pack_ptr->conf_hash = Cn->hash_code;
+	pack_ptr                = (packet_header*) scat->elements[0].buf;
+	pack_ptr->type          = Set_endian( pack_ptr->type );
+        pack_ptr->conf_hash     = Cn->hash_code;
 	pack_ptr->transmiter_id = My.id;
-	ret = Conf_proc_by_id( proc_id, &p );
-	if( ret < 0 )
+        
+	if( Conf_proc_by_id( proc_id, &p ) < 0 )
 	{
 		Alarm( PRINT, "Net_ucast: non existing proc_id %d\n",proc_id );
-		return( ret );
+		return( -1 );
 	}
-	ret = DL_send( Send_channel, proc_id, p.port, scat );
-	return( ret );
+        
+	return DL_sendto_gen( Send_channel, scat, &p.proc_addr );
 }
 
-int	Net_recv ( channel fd, sys_scatter *scat )
+/********************************************************************************
+ ********************************************************************************/
+
+static int Net_handle_monitor(sys_scatter *scat, spu_addr src_addr)
 {
-static	scatter		save;
-	packet_header	*pack_ptr;
-	int		bytes_left;
-	int		received_bytes;
-	int		i;
-        bool            ch_found;
+  packet_header *pack_ptr    = (packet_header*) scat->elements[0].buf;
+  size_t         recvd_bytes = sizeof(packet_header) + pack_ptr->data_len;
+  int16         *cur_partition;
+  int            i;
 
-	pack_ptr = (packet_header *)scat->elements[0].buf;
+  if (!Is_partition(pack_ptr->type))  /* hand other control types back up to protocol layer */
+    return (int) recvd_bytes;  
+  
+  if (!Conf_get_dangerous_monitor_state())
+  {
+    Alarmp(SPLOG_PRINT, NETWORK, "Net_handle_monitor: Request to set partition or kill daemons from [%s]:%u denied. Daemon in safe mode!\n",
+           SPU_ADDR_NTOP(&src_addr), (unsigned) spu_addr_ip_get_port(&src_addr));
+    return 0;
+  }
 
-        ch_found = FALSE;
-        for (i = 0 ; i < Num_bcast_channels; i++) {
-            if ( fd == Bcast_channel[i]) {
-                ch_found = TRUE; 
-                break;
-            }
-        }
-        if (ch_found == FALSE) {
-            Alarm(EXIT, "Net_recv: Listening and received packet on un-used interface %d\n", fd);
-        }
+  if (scat->num_elements <= 1 ||
+      recvd_bytes < sizeof(packet_header) + Conf_num_procs(Cn) * sizeof(int16) ||
+      scat->elements[1].len < Conf_num_procs(Cn) * sizeof(int16))
+  {
+    Alarmp(SPLOG_WARNING, NETWORK, "Net_handle_monitor: received monitor partition packet from [%s]:%u; proc_id = %s; msg too small! Ignoring!\n",
+           SPU_ADDR_NTOP(&src_addr), (unsigned) spu_addr_ip_get_port(&src_addr), CONF_ID_TO_STR(pack_ptr->proc_id));
+    return 0;
+  }
 
-	received_bytes = DL_recv( fd, scat ); 
+  cur_partition = (int16*) scat->elements[1].buf;
+                
+  for (i = 0; i < Conf_num_procs(Cn); ++i)
+    if (!Same_endian(pack_ptr->type))
+      cur_partition[i] = Flip_int16(cur_partition[i]);
 
-	if( received_bytes <= 0 ) return( received_bytes );
+  Net_set_partition(cur_partition);
 
-	if( received_bytes < sizeof( packet_header ) ) 
-	{
-		Alarm(PRINT, "Net_recv: ignoring packet of size %d, smaller than packet header size %d\n", 
-			received_bytes, sizeof(packet_header) );
-		return( -1 );
-	}
+  E_queue(Clear_partition_cb, 0, NULL, Partition_timeout);
+                
+  if (Partition[Partition_my_index] == -1)
+    Alarmp( SPLOG_FATAL, NETWORK, "Net_handle_monitor: Instructed to exit by monitor!\n");
+                
+  Alarmp(SPLOG_PRINT, NETWORK, "Net_handle_monitor: Got monitor partition message; I'm in component %d\n", (int) Partition[Partition_my_index]);
 
-	/* Flipping packet header to my form if needed */
-	if( !Same_endian( pack_ptr->type ) ) Flip_pack( pack_ptr );
+  return 0;
+}
 
-        /* First reject any message whose daemon has a different configuration */
-        if ( (pack_ptr->conf_hash != Cn->hash_code) && (pack_ptr->conf_hash != MONITOR_HASH) ){
-            Alarmp( SPLOG_WARNING, NETWORK, "Net_recv: Received message (pkthdr_len = %u) from host %d.%d.%d.%d with different spread configuration file (hash %u != local hash %u)\n", 
-                    scat->elements[0].len,
-                    IP1(pack_ptr->proc_id),
-                    IP2(pack_ptr->proc_id),
-                    IP3(pack_ptr->proc_id),
-                    IP4(pack_ptr->proc_id),
-                    pack_ptr->conf_hash, 
-                    Cn->hash_code);
-            return( 0 );
-        }
+/********************************************************************************
+ ********************************************************************************/
 
-	if( Is_partition( pack_ptr->type ) )
-	{
-		/* Monitor : updating partition */
-		int16	*cur_partition;
+int	Net_recv ( channel fd, sys_scatter *scat )
+{
+	packet_header  *pack_ptr = (packet_header*) scat->elements[0].buf;
+        spu_addr        src_addr = { 0 };
+	int		received_bytes;
+        proc           *pp;
+        size_t          i;
 
-                if ( ! Conf_get_dangerous_monitor_state() ) {
-                        Alarm( PRINT, "Net_recv: Request to set partition or kill daemons from (%d.%d.%d.%d) denied. Monitor in safe mode\n", IP1(pack_ptr->proc_id), IP2(pack_ptr->proc_id), IP3(pack_ptr->proc_id), IP4(pack_ptr->proc_id) );
-                        return( 0 );
-                }
+        if (scat->num_elements == 0 || scat->elements[0].len < sizeof(packet_header))
+          Alarmp(SPLOG_FATAL, NETWORK, "Net_recv: BUG! Scatter is too small for packet header!\n");
+        
+        for (i = 0; (int) i < Num_bcast_channels && fd != Bcast_channel[i]; ++i);
 
-		if( ! ( pack_ptr->memb_id.proc_id == 15051963 && Conf_id_in_conf( Cn, pack_ptr->proc_id ) != -1  ) ) return( 0 );
+        if ((int) i == Num_bcast_channels)
+          Alarmp(SPLOG_FATAL, NETWORK, "Net_recv: Listening and received packet on non-bcast channel %d\n", fd);
 
-		cur_partition = (int16 *)scat->elements[1].buf;
+	received_bytes = DL_recvfrom_gen( fd, scat, &src_addr ); 
 
-		for( i=0; i < Conf_num_procs( Cn ); i++ )
-		    if( ! Same_endian( pack_ptr->type ) ) 
-                            cur_partition[i] = Flip_int16( cur_partition[i] );
+	if ( received_bytes < 0 )
+        {
+          Alarmp( SPLOG_ERROR, NETWORK, "Net_recv: error: %d %d '%s' receiving on channel %d\n", received_bytes, sock_errno, sock_strerror(sock_errno), fd);
+          return( received_bytes );
+        }
 
-                Net_set_partition(cur_partition);
+	if ( (size_t) received_bytes < sizeof( packet_header ) ) 
+	{
+          Alarmp( SPLOG_WARNING, NETWORK, "Net_recv: ignoring msg of size %d, smaller than packet header size %lu from [%s]:%u on channel %d\n", 
+                  received_bytes, (unsigned long) sizeof(packet_header), SPU_ADDR_NTOP(&src_addr), (unsigned) spu_addr_ip_get_port(&src_addr), fd );
+          return( 0 );
+	}
 
-		E_queue( Clear_partition_cb, 0, NULL, Partition_timeout );
-		if( Partition[Partition_my_index] == -1 )
-		    Alarm( EXIT, "Net_recv: Instructed to exit by monitor\n");
-		Alarm( PRINT  , "Net_recv: Got monitor message, component %d\n", 
-			Partition[Partition_my_index] );
+	if ( !Same_endian( pack_ptr->type ) )
+          Flip_pack( pack_ptr );
 
-		return( 0 );
-	} 
+	if ( (size_t) received_bytes != sizeof( packet_header ) + pack_ptr->data_len)
+        {
+          Alarmp( SPLOG_WARNING, NETWORK, "Net_recv: Received invalid msg: received bytes (%d) != expected length (%lu)\n", 
+                  received_bytes, (unsigned long) (sizeof( packet_header ) + pack_ptr->data_len) );
+          return( 0 );
+        }
 
-	/* Monitor : drop packet from daemon in different monitor-caused partition */
-	if( ! ( pack_ptr->memb_id.proc_id == 15051963 || In_my_component( pack_ptr->transmiter_id ) ) )
-		return( 0 );
+        if ( pack_ptr->conf_hash != Cn->hash_code )
+        {
+          Alarmp( SPLOG_WARNING, NETWORK, "Net_recv: ignoring msg from different spread configuration; hash (%u) != local hash (%u); from [%s]:%u on channel %d\n",
+                  (unsigned) pack_ptr->conf_hash, (unsigned) Cn->hash_code, SPU_ADDR_NTOP(&src_addr), (unsigned) spu_addr_ip_get_port(&src_addr), fd);
+          return( 0 );
+        }
 
-	/* no need to return my own packets */
-	if( pack_ptr->transmiter_id == My.id )
-		return( 0 );
+        if ( Conf_proc_ref_by_id_in_conf( Cn, pack_ptr->transmiter_id, &pp ) < 0 )
+        {
+          Alarmp( SPLOG_INFO, NETWORK, "Net_recv: ignoring msg from transmitter (0x%08X) bc not in my configuration; from [%s]:%u on channel %d\n",
+                  (unsigned) pack_ptr->transmiter_id, SPU_ADDR_NTOP(&src_addr), (unsigned) spu_addr_ip_get_port(&src_addr), fd);
+          return( 0 );
+        }
 
-        /* packet validity check */
-	if( received_bytes != sizeof( packet_header ) + pack_ptr->data_len) {
-                Alarm( PRINT, "Net_recv: Received invalid packet - received bytes (%d) != expected length (%d)\n", 
-                       received_bytes, sizeof( packet_header ) + pack_ptr->data_len );
-                return( -1 );
+        if ( spu_addr_ip_cmp(&src_addr, &pp->proc_addr, FALSE) )
+        {
+          Alarmp( SPLOG_WARNING, NETWORK, "Net_recv: ignoring msg from transmitter (0x%08X) bc src_addr doesn't match my configuration; from [%s]:%u on channel %d\n",
+                  (unsigned) pack_ptr->transmiter_id, SPU_ADDR_NTOP(&src_addr), (unsigned) spu_addr_ip_get_port(&src_addr), fd );
+          return( 0 );
         }
+        
+        if ( Is_control( pack_ptr->type ) )                 /* handle monitor messages (which can have (transmiter_id, proc_id) == My.id) */
+        {
+          Alarmp( SPLOG_INFO, NETWORK, "Net_recv: got monitor control msg of type 0x%08X from [%s]:%u on channel %d\n",
+                  (unsigned) pack_ptr->type, SPU_ADDR_NTOP(&src_addr), (unsigned) spu_addr_ip_get_port(&src_addr), fd);
+          return Net_handle_monitor(scat, src_addr);
+        }
+          
+	if ( pack_ptr->transmiter_id == My.id )             /* no need to return my own msgs */
+        {
+          if ( ALARMP_NEEDED( SPLOG_DEBUG, NETWORK ) ) Alarmp( SPLOG_DEBUG, NETWORK, "Net_recv: ignoring msg from myself.\n" );
+          return( 0 );
+        }
+        
+	if ( !In_my_component( pack_ptr->transmiter_id ) )  /* drop msgs from daemons in different monitor-caused partition */
+        {
+          Alarmp( SPLOG_INFO, NETWORK, "Net_recv: ignoring msg from transmitter (0x%08X) not in my component!\n", (unsigned) pack_ptr->transmiter_id );
+          return( 0 );
+        }
 
-	if( Bcast_needed && Is_routed( pack_ptr->type ) )
+	if ( Is_routed( pack_ptr->type ) && Bcast_needed )           /* if requested to send to our segment and we need to do so */
 	{
-		if( !Segment_leader ) Alarm( NETWORK, 
-		"Net_recv: recv routed message from %d but not seg leader\n",
-			pack_ptr->proc_id);
+                size_t old_num_elements = scat->num_elements;        /* save so we can restore */
+                size_t old_len;
+                size_t num_bytes;
+          
+		if ( !Segment_leader )
+                  Alarmp( SPLOG_WARNING, NETWORK, "Net_recv: routed msg from 0x%08X but I'm not seg leader?! Sending to segment anyway.\n", (unsigned) pack_ptr->proc_id );
 
-		/* saving scat lens for another DL_recv */
-		save.num_elements = scat->num_elements;
-		for( i=0; i < (int) save.num_elements; i++ )
-			save.elements[i].len = scat->elements[i].len;
+		/* truncate scat for sending: find the truncation point based on received_bytes; NOTE: search overshoots by one element */
+                
+                for (i = 0, num_bytes = 0; i < scat->num_elements && num_bytes < (size_t) received_bytes; num_bytes += scat->elements[i++].len);
 
-		/* computing true scat lens for sending */
-		bytes_left = received_bytes;
-		i = 0;
-		while ( bytes_left > 0 )
-		{
-			if( bytes_left < (int) scat->elements[i].len )
-				scat->elements[i].len = bytes_left;
-			bytes_left -=  scat->elements[i].len;			
-			i ++;
-		}
-		scat->num_elements = i;
-
-		pack_ptr->type = Clear_routed ( pack_ptr->type );
+                scat->num_elements = i;
+                assert(scat->num_elements >= 1 && scat->num_elements <= old_num_elements);
+                
+                num_bytes -= scat->elements[--i].len;                /* undo last loop iteration */
+                assert(num_bytes < (size_t) received_bytes);
+                
+                old_len               = scat->elements[i].len;       /* save so we can restore */
+                scat->elements[i].len = (size_t) received_bytes - num_bytes;
+                assert(scat->elements[i].len <= old_len);
+                
+		pack_ptr->type = Clear_routed( pack_ptr->type );
 		pack_ptr->transmiter_id = My.id;
 
-		/* fliping to original form */
-		if( !Same_endian( pack_ptr->type ) ) Flip_pack( pack_ptr );
-		DL_send( Send_channel, Bcast_address, Bcast_port, scat );
+		/* flip header to original form; NOTE: we do this rather than set our own endianness because body contents have original sender's endianness */
+                
+		if ( !Same_endian( pack_ptr->type ) )
+                  Flip_pack( pack_ptr );
+                
+                send_bcast( scat );
+                
 		/* re-fliping to my form */
-		if( !Same_endian( pack_ptr->type ) ) Flip_pack( pack_ptr );
+                
+		if ( !Same_endian( pack_ptr->type ) )
+                  Flip_pack( pack_ptr );
 
-		/* restoring scat lens for another DL_recv */
-		scat->num_elements = save.num_elements;
-		for( i=0; i < (int) save.num_elements; i++ )
-			scat->elements[i].len = save.elements[i].len;
+		/* restore scat */
 
+                scat->num_elements    = old_num_elements;
+                scat->elements[i].len = old_len;
 	}
-	/*
-	 * we clear routed anyway in order not to ask if Bcast_needed again.
-	 * This way, if bcast is not needed we give it to the upper layer
-	 * right away. It will always get to the upper layer with this
-	 * bit cleared.
-	 */
-	pack_ptr->type = Clear_routed ( pack_ptr->type );
 
+	pack_ptr->type = Clear_routed( pack_ptr->type );  /* any necessary routing already handled */
+
+        if ( ALARMP_NEEDED( SPLOG_DEBUG, NETWORK ) )
+          Alarmp( SPLOG_DEBUG, NETWORK, 
+                  "Net_recv: type = 0x%08X; transmiter_id = 0x%08X; proc_id = 0x%08X; "
+                  "memb_id = { proc_id = 0x%08X, time = %ld }; "
+                  "seq = %ld; token_round = %ld; conf_hash = %u; data_len = %u; padding = %d; "
+                  "first_frag_header = { fragment_index = %d, fragment_len = %d }; "
+                  "src_addr = [%s]:%u; received_bytes = %d\n", 
+                  (unsigned) pack_ptr->type, (unsigned) pack_ptr->transmiter_id, (unsigned) pack_ptr->proc_id,
+                  (unsigned) pack_ptr->memb_id.proc_id, (long) pack_ptr->memb_id.time, 
+                  (long) pack_ptr->seq, (long) pack_ptr->token_round, (unsigned) pack_ptr->conf_hash, (unsigned) pack_ptr->data_len, (int) pack_ptr->padding,
+                  (int) pack_ptr->first_frag_header.fragment_index, (int) pack_ptr->first_frag_header.fragment_len,
+                  SPU_ADDR_NTOP(&src_addr), (unsigned) spu_addr_ip_get_port(&src_addr), received_bytes );
+        
 	return( received_bytes );
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 int	Net_send_token( sys_scatter *scat )
 {
 	token_header *token_ptr = (token_header *)scat->elements[0].buf;
-        int           send_len  = 0;
-	int	      ret;
-        int           i;
+        size_t        send_len  = 0;
+        size_t        i;
 
-        for ( i = 0; i < ( int ) scat->num_elements; ++i )
+        for ( i = 0; i < scat->num_elements; ++i )
                 send_len += scat->elements[i].len;
 
-        if ( send_len != (int) sizeof( token_header ) + token_ptr->rtr_len )
+        if ( send_len != sizeof( token_header ) + token_ptr->rtr_len )
         {
-                Alarmp( SPLOG_FATAL, NETWORK, "Net_send_token: Wrong size token %d (send_len) != %d (expected)!\n",                        
-                        send_len, (int) sizeof( token_header) + token_ptr->rtr_len );
+                Alarmp( SPLOG_FATAL, NETWORK, "Net_send_token: Wrong size token %lu (send_len) != %lu (expected)!\n",
+                        (unsigned long) send_len, (unsigned long) (sizeof( token_header) + token_ptr->rtr_len) );
         }
-        else if ( send_len > (int) ( sizeof( token_header) + sizeof( token_body ) ) )
+        else if ( send_len > sizeof( token_header) + sizeof( token_body ) )
         {
-                Alarmp( SPLOG_FATAL, NETWORK, "Net_send_token: Token too long (%d > %d bytes)!\n",
-                        send_len, (int) ( sizeof( token_header) + sizeof( token_body ) ) );
+                Alarmp( SPLOG_FATAL, NETWORK, "Net_send_token: Token too long (%lu > %lu bytes)!\n",
+                        (unsigned long) send_len, (unsigned long) ( sizeof( token_header) + sizeof( token_body ) ) );
         }
         else if ( send_len > MAX_PACKET_SIZE )
         {
-                Alarmp( SPLOG_WARNING, PRINT, "Net_send_token: WARNING!!! Token is longer (%d bytes) than a single MTU (%d bytes)! "
-                        "IP fragmentation will occur and greatly increase the chance the token is lost!\n",
-                        send_len, MAX_PACKET_SIZE );
+                Alarmp( SPLOG_WARNING, PRINT, "Net_send_token: WARNING!!! Token is longer (%lu bytes) than a single fast ethernet MTU (%lu bytes)! "
+                        "IP fragmentation likely to occur and can greatly increase the chance the token is lost!\n",
+                        (unsigned long) send_len, (unsigned long) MAX_PACKET_SIZE );
         }
 
 	token_ptr->type          = Set_endian( token_ptr->type );
         token_ptr->conf_hash     = Cn->hash_code;
 	token_ptr->transmiter_id = My.id;
 
-	Alarmp( SPLOG_INFO, NETWORK, 
-		"Net_send_token: type = 0x%08X; transmitter_id = 0x%08X; seq = %d; proc_id = 0x%08X; "
-                "aru = %d; aru_last_id = 0x%08X; Token_address = 0x%08X; send_len = %d\n", 
-		token_ptr->type, token_ptr->transmiter_id, token_ptr->seq, token_ptr->proc_id, 
-                token_ptr->aru, token_ptr->aru_last_id, Token_address, send_len );
+        if (ALARMP_NEEDED(SPLOG_DEBUG, NETWORK))
+          Alarmp( SPLOG_DEBUG, NETWORK, 
+                  "Net_send_token: type = 0x%08X; transmitter_id = 0x%08X; seq = %d; proc_id = 0x%08X; "
+                  "aru = %d; aru_last_id = 0x%08X; Token_addr = [%s]:%u; send_len = %lu\n", 
+                  (unsigned) token_ptr->type, (unsigned) token_ptr->transmiter_id, (unsigned) token_ptr->seq, (unsigned) token_ptr->proc_id,
+                  (int) token_ptr->aru, (unsigned) token_ptr->aru_last_id,
+                  SPU_ADDR_NTOP(&Token_addr), (unsigned) spu_addr_ip_get_port(&Token_addr), (unsigned long) send_len );
 
-	ret = DL_send( Send_channel, Token_address, Token_port, scat );
-	return ( ret );
+        return ( DL_sendto_gen( Send_channel, scat, &Token_addr ) );
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 int	Net_recv_token( channel fd, sys_scatter *scat )
 {
-	token_header	*token_ptr;
-	int		ret, i;
-        bool            ch_found;
+	token_header   *token_ptr = (token_header*) scat->elements[0].buf;
+        spu_addr        src_addr  = { 0 };
+        proc           *pp;
+	int		received_bytes;
+        size_t          i;
 
-	token_ptr = (token_header *)scat->elements[0].buf;
+        if (scat->num_elements <= 0 || scat->elements[0].len < sizeof(token_header))
+          Alarmp(SPLOG_FATAL, NETWORK, "Net_recv_token: BUG! Scatter is too small for token header!\n");
+        
+        for (i = 0; i < Num_token_channels && fd != Token_channel[i]; ++i);
 
-        ch_found = FALSE;
-        for (i = 0 ; i < Num_token_channels; i++) {
-            if ( fd == Token_channel[i]) {
-                ch_found = TRUE; 
-                break;
-            }
+        if (i == Num_token_channels)
+          Alarm(EXIT, "Net_recv_token: Listening and received packet on non-token channel %d\n", fd);
+
+	received_bytes = DL_recvfrom_gen( fd, scat, &src_addr );
+
+	if( received_bytes < 0 )
+        {
+          Alarmp( SPLOG_ERROR, NETWORK, "Net_recv_token: error: %d %d '%s' receiving on channel %d\n", received_bytes, sock_errno, sock_strerror(sock_errno), fd);
+          return( received_bytes );
         }
-        if (ch_found == FALSE) {
-            Alarm(EXIT, "Net_recv: Listening and received packet on un-used interface %d\n", fd);
+
+        if ( (size_t) received_bytes < sizeof( token_header ) )
+        {
+          Alarmp( SPLOG_INFO, NETWORK, "Net_recv_token: ignoring token of size %d, smaller than token header size %lu from [%s]:%u on channel %d\n", 
+                  received_bytes, (unsigned long) sizeof(token_header), SPU_ADDR_NTOP(&src_addr), (unsigned) spu_addr_ip_get_port(&src_addr), fd);
+          return( 0 );
         }
 
-	ret = DL_recv( fd, scat );
+	if( !Same_endian( token_ptr->type ) )
+          Flip_token( token_ptr );
 
-	if( ret <= 0 ) return( ret );
+        /* TODO: recv size integrity check?
 
-	/* Fliping token header to my form if needed */
-	if( !Same_endian( token_ptr->type ) ) Flip_token( token_ptr );
+	if ( (size_t) received_bytes != sizeof( token_header ) + token_ptr->rtr_len)
+        {
+          Alarmp( SPLOG_INFO, NETWORK, "Net_recv_token: Received invalid token: received bytes (%d) != expected length (%lu)\n", 
+                  received_bytes, (unsigned long) (sizeof( token_header ) + token_ptr->rtr_len) );
+          return( 0 );
+        }
+        */
+        
+        if (token_ptr->conf_hash != Cn->hash_code)
+        {
+          Alarmp( SPLOG_INFO, NETWORK, "Net_recv_token: ignoring token from different spread configuration; hash (%u) != local hash (%u); from [%s]:%u on channel %d\n",
+                  (unsigned) token_ptr->conf_hash, (unsigned) Cn->hash_code, SPU_ADDR_NTOP(&src_addr), (unsigned) spu_addr_ip_get_port(&src_addr), fd);
+          return( 0 );
+        }
 
-        /* First reject any token whose daemon has a different configuration */
-        if (token_ptr->conf_hash != Cn->hash_code) {
-            Alarmp( SPLOG_WARNING, NETWORK, "Net_recv_token: Received token from host %d.%d.%d.%d with different spread configuration file (hash %u != local hash %u)\n", 
-                    IP1(token_ptr->proc_id),
-                    IP2(token_ptr->proc_id),
-                    IP3(token_ptr->proc_id),
-                    IP4(token_ptr->proc_id),
-                    token_ptr->conf_hash, 
-                    Cn->hash_code);
-            return( 0 );
+        if ( Conf_proc_ref_by_id_in_conf( Cn, token_ptr->transmiter_id, &pp ) < 0 )
+        {
+          Alarmp( SPLOG_WARNING, NETWORK, "Net_recv_token: ignoring token from transmitter (0x%08X) bc not in my configuration; from [%s]:%u on channel %d\n",
+                  (unsigned) token_ptr->transmiter_id, SPU_ADDR_NTOP(&src_addr), (unsigned) spu_addr_ip_get_port(&src_addr), fd);
+          return( 0 );
         }
 
+        if ( spu_addr_ip_cmp(&src_addr, &pp->proc_addr, FALSE) )
+        {
+          Alarmp( SPLOG_WARNING, NETWORK, "Net_recv_token: ignoring token from transmitter (0x%08X) bc src_addr doesn't match my configuration; from [%s]:%u on channel %d\n",
+                  (unsigned) token_ptr->transmiter_id, SPU_ADDR_NTOP(&src_addr), (unsigned) spu_addr_ip_get_port(&src_addr), fd );
+          return( 0 );
+        }
+
 	/* Monitor : drop token from daemon in different monitor-caused partition */
-	if( !In_my_component( token_ptr->transmiter_id ) )
-		return( 0 );
+        
+	if ( !In_my_component( token_ptr->transmiter_id ) )
+        {
+          Alarmp( SPLOG_INFO, NETWORK, "Net_recv_token: ignoring token from transmitter (0x%08X) not in my component!\n", (unsigned) token_ptr->transmiter_id );
+          return( 0 );
+        }
 
-	return ( ret );
+        if ( ALARMP_NEEDED( SPLOG_DEBUG, NETWORK ) )
+            Alarmp( SPLOG_DEBUG, NETWORK, 
+                    "Net_recv_token: type = 0x%08X; transmiter_id = 0x%08X; proc_id = 0x%08X; "
+                    "memb_id = { proc_id = 0x%08X, time = %ld }; "
+                    "seq = %ld; aru = %ld; aru_last_id = 0x%08X; "
+                    "flow_control = %d; rtr_len = %u; conf_hash = %u; "
+                    "src_addr = [%s]:%u; received_bytes = %d\n", 
+                    (unsigned) token_ptr->type, (unsigned) token_ptr->transmiter_id, (unsigned) token_ptr->proc_id,
+                    (unsigned) token_ptr->memb_id.proc_id, (long) token_ptr->memb_id.time,                    
+                    (long) token_ptr->seq, (long) token_ptr->aru, (unsigned) token_ptr->aru_last_id,
+                    (int) token_ptr->flow_control, (unsigned) token_ptr->rtr_len, (unsigned) token_ptr->conf_hash,
+                    SPU_ADDR_NTOP(&src_addr), (unsigned) spu_addr_ip_get_port(&src_addr), received_bytes );
+
+	return ( received_bytes );
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 int	Net_ucast_token( int32 proc_id, sys_scatter *scat )
 {
-	token_header *token_ptr = ( token_header * ) scat->elements[0].buf;
-        int           send_len  = 0;
+	token_header *token_ptr = (token_header*) scat->elements[0].buf;
+        size_t        send_len  = 0;
 	proc	      p;
-	int	      ret;
-        int           i;
+        size_t        i;
 
-        for ( i = 0; i < ( int ) scat->num_elements; ++i )
+        for ( i = 0; i < scat->num_elements; ++i )
                 send_len += scat->elements[i].len;
 
-        if ( send_len != (int) sizeof( token_header ) + token_ptr->rtr_len )
+        if ( send_len != sizeof( token_header ) + token_ptr->rtr_len )
         {
-                Alarmp( SPLOG_FATAL, NETWORK, "Net_ucast_token: Wrong size token %d (send_len) != %d (expected)!\n",                        
-                        send_len, (int) sizeof( token_header) + token_ptr->rtr_len );
+                Alarmp( SPLOG_FATAL, NETWORK, "Net_ucast_token: Wrong size token %lu (send_len) != %lu (expected)!\n",
+                        (unsigned long) send_len, (unsigned long) ( sizeof( token_header ) + token_ptr->rtr_len ) );
         }
-        else if ( send_len > (int) ( sizeof( token_header) + sizeof( token_body ) ) )
+        else if ( send_len > sizeof( token_header ) + sizeof( token_body ) )
         {
-                Alarmp( SPLOG_FATAL, NETWORK, "Net_ucast_token: Token too long (%d > %d bytes)!\n",
-                        send_len, (int) ( sizeof( token_header) + sizeof( token_body ) ) );
+                Alarmp( SPLOG_FATAL, NETWORK, "Net_ucast_token: Token too long (%lu > %lu bytes)!\n",
+                        (unsigned long) send_len, (unsigned long) ( sizeof( token_header ) + sizeof( token_body ) ) );
         }
         else if ( send_len > MAX_PACKET_SIZE )
         {
-                Alarmp( SPLOG_WARNING, PRINT, "Net_ucast_token: WARNING!!! Token is longer (%d bytes) than a single MTU (%d bytes)! "
-                        "IP fragmentation will occur and greatly increase the chance the token is lost!\n",
-                        send_len, MAX_PACKET_SIZE );
+                Alarmp( SPLOG_WARNING, PRINT, "Net_ucast_token: WARNING!!! Token is longer (%lu bytes) than a single fast ethernet MTU (%lu bytes)! "
+                        "IP fragmentation will likely occur and greatly increase the chance the token is lost!\n",
+                        (unsigned long) send_len, (unsigned long) MAX_PACKET_SIZE );
         }
 
-	token_ptr->type = Set_endian( token_ptr->type );
-        token_ptr->conf_hash = Cn->hash_code;
+	token_ptr->type          = Set_endian( token_ptr->type );
+        token_ptr->conf_hash     = Cn->hash_code;
 	token_ptr->transmiter_id = My.id;
 
-	ret = Conf_proc_by_id( proc_id, &p );
-
-	if( ret < 0 )
+	if ( Conf_proc_by_id( proc_id, &p ) < 0 )
 	{
-		Alarm( PRINT, "Net_ucast_token: non existing proc_id %d\n",
-			proc_id );
-		return( ret );
+		Alarm( PRINT, "Net_ucast_token: non existing proc_id %d\n", proc_id );
+		return( -1 );
 	}
 
-	Alarmp( SPLOG_INFO, NETWORK, 
-		"Net_ucast_token(" IPF "): type = 0x%08X; transmitter_id = 0x%08X; seq = %d; proc_id = 0x%08X; "
-                "aru = %d; aru_last_id = 0x%08X; Token_address = 0x%08X; send_len = %d\n", 
-		IP( proc_id ), token_ptr->type, token_ptr->transmiter_id, token_ptr->seq, token_ptr->proc_id, 
-                token_ptr->aru, token_ptr->aru_last_id, Token_address, send_len );
+        spu_addr_ip_set_port(&p.proc_addr, spu_addr_ip_get_port(&p.proc_addr) + 1);
+        
+        if (ALARMP_NEEDED(SPLOG_DEBUG, NETWORK))
+            Alarmp( SPLOG_DEBUG, NETWORK, 
+                    "Net_ucast_token: type = 0x%08X; transmitter_id = 0x%08X; seq = %d; proc_id = 0x%08X; "
+                    "aru = %d; aru_last_id = 0x%08X; dst_addr = [%s]:%u; send_len = %lu\n", 
+                    (unsigned) token_ptr->type, (unsigned) token_ptr->transmiter_id, (int) token_ptr->seq, (unsigned) token_ptr->proc_id, 
+                    (int) token_ptr->aru, (unsigned) token_ptr->aru_last_id,
+                    SPU_ADDR_NTOP(&p.proc_addr), (unsigned) spu_addr_ip_get_port(&p.proc_addr), (unsigned long) send_len );
 
-	ret = DL_send( Send_channel, proc_id, p.port+1, scat );
-	return( ret );
+        return( DL_sendto_gen( Send_channel, scat, &p.proc_addr ) );
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 void     Net_num_channels(int *num_bcast, int *num_token)
 {
     *num_bcast = Num_bcast_channels;
     *num_token = Num_token_channels;
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 channel *Net_bcast_channel()
 {
 	return( &(Bcast_channel[0]) );
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 channel *Net_token_channel()
 {
 	return( &(Token_channel[0]) );
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 void    Net_set_partition(int16 *new_partition)
 {
         int     i;
 
-        if ( Conf_in_reload_singleton_state() ) {
-                Alarmp(SPLOG_DEBUG, NETWORK, "Net_set_partition: Can not change partition since daemon configuration change in progress\n");
+        if ( Conf_in_reload_singleton_state() )
+        {
+                Alarmp(SPLOG_WARNING, NETWORK, "Net_set_partition: Can not change partition since daemon configuration change in progress\n");
                 return;
         }
 
@@ -637,6 +913,9 @@
                 Partition[i] = new_partition[i];
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 void    Net_clear_partition(void)
 {
 	int	i;
@@ -645,31 +924,40 @@
 		Partition[i] = 0;
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 static	void	Clear_partition_cb(int dummy, void *dummy_p)
 {
         Net_clear_partition();
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 static	int	In_my_component( int32	proc_id )
 {
 	int	proc_index;
 	proc	dummy_proc;
-	char	ip[16];
+	char	ip[MAX_ID_SIZE];
 
 	proc_index = Conf_proc_by_id( proc_id, &dummy_proc );
-	if( proc_index < 0 )
+        
+	if ( proc_index < 0 )
 	{
-		Conf_id_to_str( proc_id, ip );
-		Alarm( PRINT, "In_my_component: unknown proc %s\n", ip );
+		Alarmp( SPLOG_PRINT, NETWORK, "In_my_component: unknown proc %s\n", Conf_id_to_str( proc_id, ip ) );
 		return( 0 );
 	}
 
 	return( Partition[Partition_my_index] == Partition[proc_index] );
 }
 
-/* The first fragment header is not flipped here, even though it is
-   part of the packet header. It will be flipped with the other
-   fragment headers in Prot_handle_bcast */
+/********************************************************************************
+ * The first fragment header is not flipped here, even though it is
+ * part of the packet header. It will be flipped with the other
+ * fragment headers in Prot_handle_bcast.
+ ********************************************************************************/
+
 void	Flip_pack( packet_header *pack_ptr )
 {
 	pack_ptr->type		  = Flip_int32( pack_ptr->type );
@@ -678,11 +966,14 @@
 	pack_ptr->memb_id.proc_id = Flip_int32( pack_ptr->memb_id.proc_id );
 	pack_ptr->memb_id.time	  = Flip_int32( pack_ptr->memb_id.time );
 	pack_ptr->seq		  = Flip_int32( pack_ptr->seq );
-	pack_ptr->token_round	  = Flip_int32( pack_ptr->token_round ); /* fifo_seq changed to token_round */
+	pack_ptr->token_round	  = Flip_int32( pack_ptr->token_round );
 	pack_ptr->conf_hash	  = Flip_int32( pack_ptr->conf_hash );
 	pack_ptr->data_len	  = Flip_int16( pack_ptr->data_len );
 }
 
+/********************************************************************************
+ ********************************************************************************/
+
 void	Flip_token( token_header *token_ptr )
 {
 	token_ptr->type		   = Flip_int32( token_ptr->type );
@@ -697,3 +988,6 @@
 	token_ptr->rtr_len	   = Flip_int16( token_ptr->rtr_len );
         token_ptr->conf_hash       = Flip_int32( token_ptr->conf_hash );
 }
+
+/********************************************************************************
+ ********************************************************************************/

Modified: trunk/daemon/protocol.c
===================================================================
--- trunk/daemon/protocol.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/protocol.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -93,7 +93,7 @@
 
 static  packet_header  *Hurry_head;
 static  sys_scatter     Hurry_pack;
-static  sp_time         Zero_timeout    = {  0, 0};
+static  sp_time         Zero_timeout    = {  0, 0 };
 
 /* Used to indicate a need to reload configuration at end of current membership */
 static  bool            Prot_Need_Conf_Reload  = FALSE;
@@ -149,21 +149,12 @@
         for( i=0; i < MAX_PACKETS_IN_STRUCT; i++ )
                 Packets[i].exist = 0;
 
-        if ( Conf_debug_initial_sequence() ) {
-                Highest_seq      = INITIAL_SEQUENCE_NEAR_WRAP;
-                Highest_fifo_seq = INITIAL_SEQUENCE_NEAR_WRAP;
-                My_aru           = INITIAL_SEQUENCE_NEAR_WRAP;
-                Aru              = INITIAL_SEQUENCE_NEAR_WRAP;
-                Last_discarded   = INITIAL_SEQUENCE_NEAR_WRAP;
-                Last_delivered   = INITIAL_SEQUENCE_NEAR_WRAP;
-        } else {
-                Highest_seq      = 0;
-                Highest_fifo_seq = 0;
-                My_aru           = 0;
-                Aru              = 0;
-                Last_discarded   = 0;
-                Last_delivered   = 0;
-        }
+        Highest_seq      = 0;
+        Highest_fifo_seq = 0;
+        My_aru           = 0;
+        Aru              = 0;
+        Last_discarded   = 0;
+        Last_delivered   = 0;
 
         Send_pack_queue.num_packets = 0;
         Send_pack_queue.first = NULL;
@@ -264,14 +255,14 @@
 
         if ( ( down_ptr = new( DOWN_LINK ) ) == NULL )
         {
-                Alarm(EXIT, "Prot_Create_Down_Link: Failure to allocate a Down_link\n");
+                Alarmp( SPLOG_FATAL, EXIT, "Prot_Create_Down_Link: Failure to allocate a Down_link\n");
         }
 
         if ( -1 == (down_ptr->type = type) )
         {
                 head_ptr = (message_header *)msg->elements[0].buf;
                 dispose( down_ptr );
-                Alarm( PROTOCOL, "Prot_Create_Down_Link: Illegal message type %d\n", head_ptr->type );
+                Alarmp( SPLOG_INFO, PROTOCOL, "Prot_Create_Down_Link: Illegal message type %d\n", head_ptr->type );
                 return(NULL);
         }
 
@@ -296,29 +287,39 @@
 
         received_bytes = Net_recv( fd, &New_pack );
 
-        /* problem in receiving */
-        if ( received_bytes <= 0 ) return;
-
-        pack_ptr = (packet_header *) New_pack.elements[0].buf;
-
-        if ( Is_status( pack_ptr->type ) )
+        if ( received_bytes < 0 )
         {
-                Stat_handle_message( &New_pack );
-                return;
+          Alarmp( SPLOG_ERROR, PROTOCOL, "Prot_handle_bcast: Net_recv reported an error: %d %d '%s'\n", received_bytes, sock_errno, sock_strerror( sock_errno ) );
+          return;
         }
-
-        if ( Is_fc( pack_ptr->type ) )
+        
+        if ( received_bytes == 0 )
         {
-                FC_handle_message( &New_pack );
-                return;
+          if (ALARMP_NEEDED( SPLOG_DEBUG, PROTOCOL ) ) Alarmp( SPLOG_DEBUG, PROTOCOL, "Prot_handle_bcast: ignoring msg dropped by Net_recv.\n" );
+          return;
         }
 
-        if ( Is_conf_reload( pack_ptr->type ) )
+        pack_ptr = (packet_header*) New_pack.elements[0].buf;
+
+        /* handle monitor messages */
+        
+        if ( Is_control( pack_ptr->type ) )
         {
-                Prot_handle_conf_reload( &New_pack );
-                return;
+          if ( Is_status( pack_ptr->type ) )
+            Stat_handle_message( &New_pack );
+
+          else if ( Is_fc( pack_ptr->type ) )
+            FC_handle_message( &New_pack );
+
+          else if ( Is_conf_reload( pack_ptr->type ) )
+            Prot_handle_conf_reload( &New_pack );
+
+          else
+            Alarmp( SPLOG_PRINT, PROTOCOL, "Prot_handle_bcast: ignoring unexpected control msg of type 0x%08lX\n", (unsigned long) pack_ptr->type );
+
+          return;
         }
-
+        
         /* delete random  
            r1 = ((-My.id)%17)+3;
            r2 = get_rand() % (r1+3 );
@@ -338,8 +339,7 @@
 
         if ( !Is_regular( pack_ptr->type ) )
         {
-                Alarm( PROTOCOL, "Prot_handle_bcast: Unknown packet type %d\n",
-                       pack_ptr->type );
+                Alarmp( SPLOG_INFO, PROTOCOL, "Prot_handle_bcast: Unknown packet type 0x%08lX\n", (unsigned long) pack_ptr->type );
                 return;
         }
 
@@ -350,32 +350,32 @@
                 return;
         }
 
-        if (Memb_token_alive() ) {
+        if (Memb_token_alive() )
+        {
                 E_queue( Memb_token_loss_event, 0, NULL, Token_timeout );
+                
                 if ( Conf_leader( Memb_active_ptr() ) == My.id ) 
-                {
                         E_queue( Prot_token_hurry_event, 0, NULL, Hurry_timeout );
-                }
         }
 
         /* do we have this packet */
         if ( pack_ptr->seq <= Last_discarded )
         {
-                Alarm( PROTOCOL, "Prot_handle_bcast: delayed packet %d already delivered (Last_discarded %d)\n", pack_ptr->seq, Last_discarded );
+                Alarmp( SPLOG_INFO, PROTOCOL, "Prot_handle_bcast: delayed packet %d already delivered (Last_discarded %d)\n", pack_ptr->seq, Last_discarded );
                 return;
         }
 
         pack_entry = pack_ptr->seq & PACKET_MASK;
         if ( Packets[pack_entry].exist ) 
         {
-                Alarm( PROTOCOL, "Prot_handle_bcast: packet %d already exist\n", pack_ptr->seq );
+                Alarmp( SPLOG_DEBUG, PROTOCOL, "Prot_handle_bcast: packet %d already exist\n", pack_ptr->seq );
                 return;
         }
 
         Packets[pack_entry].proc_index = Conf_proc_by_id( pack_ptr->proc_id, &p );
         if ( Packets[pack_entry].proc_index < 0 )
         {
-                Alarm( PROTOCOL, "Prot_handle_bcast: unknown proc %d\n", pack_ptr->proc_id );
+                Alarmp( SPLOG_INFO, PROTOCOL, "Prot_handle_bcast: unknown proc %d\n", pack_ptr->proc_id );
                 return;
         }
 
@@ -405,7 +405,7 @@
                         /* Sanity check for packet validity */
                         if ( processed_bytes + (int) sizeof(fragment_header) > pack_ptr->data_len )
                         {
-                                Alarm( PRINT, "Prot_handle_bcast: invalid packet with seq %d from %d, fragments exceed data_len %d %d\n", 
+                                Alarmp( SPLOG_WARNING, PROTOCOL, "Prot_handle_bcast: invalid packet with seq %d from %d, fragments exceed data_len %d %d\n", 
                                        pack_ptr->transmiter_id, pack_ptr->seq, processed_bytes, pack_ptr->data_len );
                                 break;
                         }
@@ -415,7 +415,7 @@
                 }
                 if ( processed_bytes != pack_ptr->data_len )
                 {
-                        Alarm( PRINT, "Prot_handle_bcast: invalid packet with seq %d from %d, processed bytes not equal data_len %d %d\n", 
+                        Alarmp( SPLOG_WARNING, PROTOCOL, "Prot_handle_bcast: invalid packet with seq %d from %d, processed bytes not equal data_len %d %d\n", 
                                pack_ptr->transmiter_id, pack_ptr->seq, processed_bytes, pack_ptr->data_len );
                         /*  
                          * This is a malformed packet, but we decide to keep it instead of throwing it away. 
@@ -453,22 +453,22 @@
                 for ( i = 0; i < num_bcast; i++ ) {
                         ret = E_detach_fd_priority( *bcast_channels, READ_FD, HIGH_PRIORITY );
                         if ( ret < 0 ) {
-                                Alarm( EXIT, "Prot_handle_bcast: bcast_channel being detached was not found\n");
+                                Alarmp( SPLOG_FATAL, EXIT, "Prot_handle_bcast: bcast_channel being detached was not found\n");
                         }
                         ret = E_attach_fd( *bcast_channels, READ_FD, Prot_handle_bcast, 0, NULL, MEDIUM_PRIORITY );
                         if ( ret < 0 ) {
-                                Alarm( EXIT, "Prot_handle_bcast: bcast_channel could not be attached\n");
+                                Alarmp( SPLOG_FATAL, EXIT, "Prot_handle_bcast: bcast_channel could not be attached\n");
                         }
                         bcast_channels++;
                 }
                 for ( i = 0; i < num_token; i++ ) {
                         ret = E_detach_fd_priority( *token_channels, READ_FD, MEDIUM_PRIORITY );
                         if ( ret < 0 ) {
-                                Alarm( EXIT, "Prot_handle_bcast: token_channel being detached was not found\n");
+                                Alarmp( SPLOG_FATAL, EXIT, "Prot_handle_bcast: token_channel being detached was not found\n");
                         }
                         E_attach_fd( *token_channels, READ_FD, Prot_handle_token, 0, NULL, HIGH_PRIORITY );
                         if ( ret < 0 ) {
-                                Alarm( EXIT, "Prot_handle_bcast: token_channel could not be attached\n");
+                                Alarmp( SPLOG_FATAL, EXIT, "Prot_handle_bcast: token_channel could not be attached\n");
                         }
                         token_channels++;
                 }
@@ -522,7 +522,17 @@
 
         ret = Net_recv_token( fd, &New_token );
 
-        if ( ret <= 0 ) return;
+        if ( ret < 0 )
+        {
+          Alarmp( SPLOG_ERROR, PROTOCOL, "Prot_handle_token: Net_recv_token reported an error: %d %d '%s'\n", ret, sock_errno, sock_strerror( sock_errno ) );
+          return;
+        }
+        
+        if ( ret == 0 )
+        {
+          if ( ALARMP_NEEDED( SPLOG_DEBUG, PROTOCOL) ) Alarmp( SPLOG_DEBUG, PROTOCOL, "Prot_handle_token: ignoring token dropped by Net_recv_token.\n" );
+          return;
+        }
 
         /* delete random
            r1 = ((-My.id)%17)+3;
@@ -656,22 +666,22 @@
                 for ( i = 0; i < num_bcast; i++ ) {
                         ret = E_detach_fd_priority( *bcast_channels, READ_FD, MEDIUM_PRIORITY );
                         if ( ret < 0 ) {
-                                Alarm( EXIT, "Prot_handle_token: bcast_channel being detached was not found\n");
+                                Alarmp( SPLOG_FATAL, EXIT, "Prot_handle_token: bcast_channel being detached was not found\n");
                         }
                         E_attach_fd( *bcast_channels, READ_FD, Prot_handle_bcast, 0, NULL, HIGH_PRIORITY );
                         if ( ret < 0 ) {
-                                Alarm( EXIT, "Prot_handle_token: bcast_channel could not be attached\n");
+                                Alarmp( SPLOG_FATAL, EXIT, "Prot_handle_token: bcast_channel could not be attached\n");
                         }
                         bcast_channels++;
                 }
                 for ( i = 0; i < num_token; i++ ) {
                         ret = E_detach_fd_priority( *token_channels, READ_FD, HIGH_PRIORITY );
                         if ( ret < 0 ) {
-                                Alarm( EXIT, "Prot_handle_token: token_channel being detached was not found\n");
+                                Alarmp( SPLOG_FATAL, EXIT, "Prot_handle_token: token_channel being detached was not found\n");
                         }
                         E_attach_fd( *token_channels, READ_FD, Prot_handle_token, 0, NULL, MEDIUM_PRIORITY );
                         if ( ret < 0 ) {
-                                Alarm( EXIT, "Prot_handle_token: token_channel could not be attached\n");
+                                Alarmp( SPLOG_FATAL, EXIT, "Prot_handle_token: token_channel could not be attached\n");
                         }
                         token_channels++;
                 }
@@ -969,7 +979,7 @@
                 Down_queue_ptr->first = down_ptr;
                 Down_queue_ptr->last  = down_ptr;
         }else{
-                Alarm( EXIT,"fast_spread_new_message: Down_queue_ptr->num_mess is %d\n",
+                Alarmp( SPLOG_FATAL, EXIT,"fast_spread_new_message: Down_queue_ptr->num_mess is %d\n",
                        Down_queue_ptr->num_mess );
         }
         Down_queue_ptr->num_mess++;
@@ -1023,7 +1033,7 @@
                                         old_ptr += sizeof(int32);
                                         pack_entry = *req_seq & PACKET_MASK;
                                         if ( *req_seq < Aru ) 
-                                                Alarm( EXIT, "Answer_retrans: retrans of %d requested while Aru is %d\n", *req_seq, Aru );
+                                                Alarmp( SPLOG_FATAL, EXIT, "Answer_retrans: retrans of %d requested while Aru is %d\n", *req_seq, Aru );
 
                                         if ( Packets[pack_entry].exist )
                                         {
@@ -1172,7 +1182,7 @@
                                 if ( Down_queue_ptr->num_mess < WATER_MARK ) 
                                         Sess_unblock_users_level();
                         }else{
-                                Alarm( EXIT, 
+                                Alarmp( SPLOG_FATAL, EXIT, 
                                        "Send_new_packets: error in packet index: %d %d\n",
                                        Down_queue_ptr->cur_element,scat_ptr->num_elements );
                         }
@@ -1243,7 +1253,7 @@
  
                 pack_entry = pack_ptr->seq & PACKET_MASK;
                 if ( Packets[pack_entry].exist ) 
-                        Alarm( EXIT, 
+                        Alarmp( SPLOG_FATAL, EXIT, 
                                "Send_new_packets: created packet %d already exist %d\n",
                                pack_ptr->seq, Packets[pack_entry].exist );
 
@@ -1252,7 +1262,7 @@
                 Packets[pack_entry].body       = (packet_body *) body_ptr;
                 Packets[pack_entry].exist      = 1;
                 Packets[pack_entry].proc_index = My_index;
-                Alarm( PROTOCOL, 
+                Alarmp( SPLOG_INFO, PROTOCOL, 
                        "Send_new_packets: packet %d sent and inserted \n",
                        pack_ptr->seq );
         }
@@ -1406,7 +1416,7 @@
                 processed_bytes += sizeof(fragment_header);
                 if ( processed_bytes + frag_ptr->fragment_len > pack_ptr->data_len )
                 {
-                        Alarm( PRINT, "Deliver_packet: invalid packet with seq %d from %d, fragments exceed data_len %d %d %d\n", 
+                        Alarmp( SPLOG_WARNING, PROTOCOL, "Deliver_packet: invalid packet with seq %d from %d, fragments exceed data_len %d %d %d\n", 
                                pack_ptr->seq, pack_ptr->transmiter_id, processed_bytes, frag_ptr->fragment_len, pack_ptr->data_len );
                         break;
                 }
@@ -1459,7 +1469,7 @@
         if ( index < 0 ) index = -index;
         if ( up_ptr->mess->num_elements+1 != index )
         {
-                Alarm( EXIT, "Deliver_packet: sequence error: sec is %d, should be %d\n",
+                Alarmp( SPLOG_FATAL, EXIT, "Deliver_packet: sequence error: sec is %d, should be %d\n",
                        pack_ptr->first_frag_header.fragment_index,
                        up_ptr->mess->num_elements+1 );
         }
@@ -1533,7 +1543,7 @@
                         if ( Is_reliable( Packets[pack_entry].head->type ) &&
                             Packets[pack_entry].head->first_frag_header.fragment_index == -1 )
                         {
-                                Alarm( PROTOCOL, "Deliver_reliable_packets: delivering packet %d\n", i );
+                                Alarmp( SPLOG_INFO, PROTOCOL, "Deliver_reliable_packets: delivering packet %d\n", i );
                                 Deliver_packet( pack_entry, 1 );
                         }
                 }
@@ -1564,7 +1574,7 @@
                 {
                         if ( !Is_safe( Packets[pack_entry].head->type ) )
                         {
-                                Alarm( PROTOCOL, "Deliver_agreed_packets: delivering packet %d\n", i );
+                                Alarmp( SPLOG_INFO, PROTOCOL, "Deliver_agreed_packets: delivering packet %d\n", i );
                                 Deliver_packet( pack_entry, 1 );
                                 Last_delivered++;
                         }else return;
@@ -1580,7 +1590,7 @@
                         Alarmp( SPLOG_INFO, PROTOCOL, "Deliver_agreed_packets: packet %d was already delivered\n", i );
                         Last_delivered++;
 
-                }else Alarm( EXIT, "Deliver_agreed_packets: Error, packet %d; exist is %d\n", i, Packets[pack_entry].exist );
+                }else Alarmp( SPLOG_FATAL, EXIT, "Deliver_agreed_packets: Error, packet %d; exist is %d\n", i, Packets[pack_entry].exist );
         }
 }
 
@@ -1645,7 +1655,7 @@
                 {
                         pack_entry = i & PACKET_MASK;
                         if ( ! Packets[pack_entry].exist )
-                                Alarm( EXIT, "Discard_packets: (EVS after transitional) packet %d not exist\n", i);
+                                Alarmp( SPLOG_FATAL, EXIT, "Discard_packets: (EVS after transitional) packet %d not exist\n", i);
                         if ( Packets[pack_entry].exist == 3 )
                         {
                                 /* 
@@ -1654,7 +1664,7 @@
                                  * is in commited membership. 
                                  */
                                 found_hole = 1;
-                                Alarm( PROTOCOL, "Discard_packets: Found a Hole in %d \n",i);
+                                Alarmp( SPLOG_INFO, PROTOCOL, "Discard_packets: Found a Hole in %d \n",i);
 
                         }else if ( !found_hole || Conf_id_in_conf( &Commit_membership, Packets[pack_entry].head->proc_id ) != -1 ){
                                 /* should deliver packet or dispose the body if it was delivered already */
@@ -1665,12 +1675,12 @@
                                 }
                                 /* dispose packet header in any case */
                                 dispose( Packets[pack_entry].head );
-                                Alarm( PROTOCOL, "Discard_packets: delivering %d in EVS\n",i);
+                                Alarmp( SPLOG_INFO, PROTOCOL, "Discard_packets: delivering %d in EVS\n",i);
                         }else{
                                 /* should not deliver packet */
                                 dispose( Packets[pack_entry].head );
                                 dispose(   Packets[pack_entry].body );
-                                Alarm( PROTOCOL, "Discard_packets: Due to hole, not delivering %d \n",i);
+                                Alarmp( SPLOG_INFO, PROTOCOL, "Discard_packets: Due to hole, not delivering %d \n",i);
                         }
                         Packets[pack_entry].exist = 0;
                 }
@@ -1732,21 +1742,12 @@
                 }
 
                 /* set variables for next membership */
-                if ( Conf_debug_initial_sequence() ) {  /* TODO: get rid of this debug stuff */
-                        Highest_seq      = INITIAL_SEQUENCE_NEAR_WRAP;
-                        Highest_fifo_seq     = INITIAL_SEQUENCE_NEAR_WRAP;
-                        My_aru           = INITIAL_SEQUENCE_NEAR_WRAP;
-                        Aru                      = INITIAL_SEQUENCE_NEAR_WRAP;
-                        Last_discarded   = INITIAL_SEQUENCE_NEAR_WRAP;
-                        Last_delivered   = INITIAL_SEQUENCE_NEAR_WRAP;
-                } else {
-                        Highest_seq      = 0;
-                        Highest_fifo_seq     = 0;
-                        My_aru           = 0;
-                        Aru                      = 0;
-                        Last_discarded   = 0;
-                        Last_delivered   = 0;
-                }
+                Highest_seq      = 0;
+                Highest_fifo_seq = 0;
+                My_aru           = 0;
+                Aru              = 0;
+                Last_discarded   = 0;
+                Last_delivered   = 0;
 
                 Alarmp( SPLOG_INFO, PROTOCOL, "Discard_packets: Updated Aru to %d for next membership\n", Aru );
 
@@ -1759,7 +1760,7 @@
                 {
                         pack_entry = i & PACKET_MASK;
                         if ( ! Packets[pack_entry].exist )
-                                Alarm( EXIT, "Discard_packets: (NOT EVS) packet %d not exist\n",i);
+                                Alarmp( SPLOG_FATAL, EXIT, "Discard_packets: (NOT EVS) packet %d not exist\n",i);
 
                         /* should deliver packet or dispose the body if it was delivered already */
                         if ( Packets[pack_entry].exist == 1 ) Deliver_packet( pack_entry, 0 );
@@ -1768,7 +1769,7 @@
                         dispose( Packets[pack_entry].head );
                         Packets[pack_entry].exist = 0;
                 }
-                Alarm( PROTOCOL, "Discard_packets: packets %d-%d were discarded\n",
+                Alarmp( SPLOG_INFO, PROTOCOL, "Discard_packets: packets %d-%d were discarded\n",
                        Last_discarded+1, Aru );
 
                 Last_discarded = Aru;
@@ -1821,7 +1822,7 @@
         {
                 if ( Conf_id_in_conf( Memb_active_ptr(), pack_ptr->proc_id ) != -1 )
                 {
-                        Alarm( PROTOCOL, "Handle_hurry: sending token now\n");
+                        Alarmp( SPLOG_INFO, PROTOCOL, "Handle_hurry: sending token now\n");
                         /* Reset token_counter so token protocol knows someone wants to send 
                          * and token should not go into hold state until everyone gets a chance
                          * to send.
@@ -1850,6 +1851,11 @@
                 Last_token->type = Set_retrans( Last_token->type, val );
                 E_queue( Prot_token_hurry_event, 0, NULL, Hurry_timeout );
                 GlobalStatus.token_hurry++;
+
+#if 0
+		if (Token_counter > 1)
+			Token_counter = 1;  /* makes Is_hold_token false which prevents Handle_hurry from having effect */
+#endif
         }
         /* sending token */
         Net_send_token( &retrans_token );
@@ -1866,7 +1872,7 @@
                 Net_send_token( &retrans_token );
         }
 
-        Alarm( PROTOCOL, "Prot_token_hurry: retransmiting token %d %d\n",
+        Alarmp( SPLOG_INFO, PROTOCOL, "Prot_token_hurry: retransmiting token %d %d\n",
                Get_arq(Last_token->type), Get_retrans(Last_token->type) );
 }
 
@@ -1878,7 +1884,7 @@
 void    Prot_set_prev_proc(configuration *memb)
 {
         Prev_proc_id = Conf_previous(memb);
-        Alarm( PROTOCOL, "Prev_proc_id: %d, My.id: %d\n", Prev_proc_id, My.id );
+        Alarmp( SPLOG_INFO, PROTOCOL, "Prev_proc_id: %d, My.id: %d\n", Prev_proc_id, My.id );
 }
 
 void    Flip_token_body( char *buf, token_header *token_ptr )

Modified: trunk/daemon/r.c
===================================================================
--- trunk/daemon/r.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/r.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -43,7 +43,7 @@
 
 #ifdef	ARCH_PC_WIN95
 
-#include	<winsock.h>
+#include	<winsock2.h>
 
 WSADATA		WSAData;
 
@@ -76,7 +76,7 @@
 
 #ifdef	ARCH_PC_WIN95
 
-	ret = WSAStartup( MAKEWORD(1,1), &WSAData );
+	ret = WSAStartup( MAKEWORD(2,0), &WSAData );
 	if( ret != 0 )
 		Alarm( EXIT, "r: winsock initialization error %d\n", ret );
 

Modified: trunk/daemon/s.c
===================================================================
--- trunk/daemon/s.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/s.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -44,7 +44,7 @@
 
 #ifdef	ARCH_PC_WIN95
 
-#include	<winsock.h>
+#include	<winsock2.h>
 
 WSADATA		WSAData;
 
@@ -79,7 +79,7 @@
 
 #ifdef	ARCH_PC_WIN95
 
-	ret = WSAStartup( MAKEWORD(1,1), &WSAData );
+	ret = WSAStartup( MAKEWORD(2,0), &WSAData );
 	if( ret != 0 )
 		Alarm( EXIT, "s: winsock initialization error %d\n", ret );
 

Modified: trunk/daemon/sess_body.h
===================================================================
--- trunk/daemon/sess_body.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/sess_body.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -44,7 +44,7 @@
 
 #else	/* ARCH_PC_WIN95 */
 
-#include <winsock.h>
+#include <winsock2.h>
 
 #endif	/* ARCH_PC_WIN95 */
 
@@ -59,17 +59,17 @@
 #define		OP_SESSION		0x00000010
 #define         PRE_AUTH_SESSION        0x00000100
 
-#define		Is_memb_session( status )	( status &  MEMB_SESSION )
-#define		Set_memb_session( status )	( status |  MEMB_SESSION )
-#define		Clear_memb_session( status )	( status & ~MEMB_SESSION )
+#define		Is_memb_session( status )	( (status) &  MEMB_SESSION )
+#define		Set_memb_session( status )	( (status) |  MEMB_SESSION )
+#define		Clear_memb_session( status )	( (status) & ~MEMB_SESSION )
 
-#define		Is_op_session( status )		( status &  OP_SESSION )
-#define		Set_op_session( status )	( status |  OP_SESSION )
-#define		Clear_op_session( status )	( status & ~OP_SESSION ) 
+#define		Is_op_session( status )		( (status) &  OP_SESSION )
+#define		Set_op_session( status )	( (status) |  OP_SESSION )
+#define		Clear_op_session( status )	( (status) & ~OP_SESSION ) 
 
-#define		Is_preauth_session( status )	( status &  PRE_AUTH_SESSION )
-#define		Set_preauth_session( status )	( status |  PRE_AUTH_SESSION )
-#define		Clear_preauth_session( status )	( status & ~PRE_AUTH_SESSION ) 
+#define		Is_preauth_session( status )	( (status) &  PRE_AUTH_SESSION )
+#define		Set_preauth_session( status )	( (status) |  PRE_AUTH_SESSION )
+#define		Clear_preauth_session( status )	( (status) & ~PRE_AUTH_SESSION ) 
 
 /* All the information we need to maintain per group member is its private
  * group name. */

Modified: trunk/daemon/session.c
===================================================================
--- trunk/daemon/session.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/session.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -61,7 +61,7 @@
 
 #else   /* ARCH_PC_WIN95 */
 
-#include <winsock.h>
+#include <winsock2.h>
 #define	ioctl 	ioctlsocket
 
 #endif  /* ARCH_PC_WIN95 */
@@ -98,6 +98,11 @@
 
 static	int		Protocol_threshold;
 
+static  int16u          Sess_port;
+
+/* NOTE: In order to handle high (i.e. >255) fd nums, we hash them into Sessions_hash_head */
+/* this also lets us handle SOCKETs on windows which probably are pointers/handles stuffed into an unsigned int */
+
 #define SESSION_FD_HASH_SIZE    256
 static	session		*Sessions_hash_head[SESSION_FD_HASH_SIZE];
 static	session		*Sessions_head;
@@ -121,207 +126,184 @@
 static  void    Sess_create_reject_message ( message_obj *msg );
 static  int     Sess_get_p2p_dests( int num_groups, char groups[][MAX_GROUP_NAME], char dests[][MAX_GROUP_NAME] );
 
-static  void    Sess_activate_port_reuse(mailbox mbox)
+static void Sess_free_session(session *ses)
 {
-    int on = 1; 
-    if (setsockopt(mbox, SOL_SOCKET, SO_REUSEADDR, (void *) &on, sizeof(on)) < 0) 
-        Alarm( EXIT, "Sess_activate_port_reuse: From Sess_init: Error setting SO_REUSEADDR socket option\n" ); 
+    ses->sort_next = Sessions_free;
+    Sessions_free  = ses;
 }
 
-int	Sess_get_session_index (int mbox)
+static void Sess_init_sessions(void)
 {
-    session *tmp;
-    unsigned char *c = (unsigned char *) &mbox;
-    unsigned int i;
+    int i;
 
-    i = c[0] ^ c[1] ^ c[2] ^ c[3];
+    for (i = 0; i < SESSION_FD_HASH_SIZE; ++i)
+        Sessions_hash_head[i] = NULL;
 
-    Alarm( NONE, "Sess_get_session_index: mbox %d hashed to %u\n", mbox, i);
-    for (tmp = Sessions_hash_head[i]; tmp; tmp = tmp->hash_next)
-        if (tmp->mbox == mbox)
-            return (tmp - Sessions);
+    Sessions_free = Sessions_head = Sessions_tail = NULL;
 
-    return -1;
+    for (i = 0; i < MAX_SESSIONS; ++i)
+        Sess_free_session( &Sessions[i] );
 }
 
-static  void    Sess_hash_session (session *ses)
+static void Sess_hash_session(session *ses)
 {
-    unsigned int i;
-    unsigned char *c;
+    int32u         m = (int32u) ses->mbox;
+    unsigned char *c = (unsigned char *) &m;
+    unsigned int   i = c[0] ^ c[1] ^ c[2] ^ c[3];
     
-    c = (unsigned char *) &ses->mbox;
-    i = c[0] ^ c[1] ^ c[2] ^ c[3];
-    ses->hash_next = Sessions_hash_head[i];
+    ses->hash_next        = Sessions_hash_head[i];
     Sessions_hash_head[i] = ses;
 }
 
-static  void    Sess_unhash_session (session *ses)
+static void Sess_unhash_session(session *ses)
 {
-    unsigned int i;
-    unsigned char *c;
-    session *tmp;
-    
-    c = (unsigned char *) &ses->mbox;
-    i = c[0] ^ c[1] ^ c[2] ^ c[3];
-    tmp = Sessions_hash_head[i];
+    int32u         m   = (int32u) ses->mbox;
+    unsigned char *c   = (unsigned char *) &m;
+    unsigned int   i   = c[0] ^ c[1] ^ c[2] ^ c[3];
+    session       *tmp = Sessions_hash_head[i];
+
     if (tmp == ses)
     {
         Sessions_hash_head[i] = ses->hash_next;
         ses->hash_next = NULL;
-        return;
     }
-
-    for ( ; tmp->hash_next != ses; tmp = tmp->hash_next);
-    tmp->hash_next = ses->hash_next;
-    ses->hash_next = NULL;
+    else
+    {
+      for (; tmp->hash_next != ses; tmp = tmp->hash_next);
+      
+      tmp->hash_next = ses->hash_next;
+      ses->hash_next = NULL;
+    }
 }
 
-static	session	*Sess_get_free_session (void)
+static session *Sess_get_free_session(void)
 {
     session *ses;
 
     if ((ses = Sessions_free) == NULL)
-    {
-        Alarm (EXIT, "Sess_get_free_session: BUG ! No free sessions !\n");
-    }
+      Alarmp(SPLOG_ERROR, SESSION, "Sess_get_free_session: BUG! No free sessions left?!\n");
 
     Sessions_free = Sessions_free->sort_next;
 
     return ses;
 }
 
-static	void	Sess_free_session (session *ses)
+static int Sess_insert_new_session(session *where, session *template)
 {
-    ses->sort_next = Sessions_free;
-    Sessions_free = ses;
-}
+    session *new_ses = Sess_get_free_session();
 
-static	int	Sess_insert_new_session (session *where, session *template)
-{
-    session *new_ses;
-
-    new_ses = Sess_get_free_session();
     memmove(new_ses, template, sizeof (*template));
   
-    if (!where)
+    if (where == NULL)  /* insert session at the end of the list */
     {
-        /* Ok, we insert a session at the end of the list... */
         new_ses->sort_next = NULL;
     
-        if (!Sessions_tail)
+        if (Sessions_tail == NULL)  /* list is empty */
         {
-            /* List is empty */
             new_ses->sort_prev = NULL;
             Sessions_head = Sessions_tail = new_ses;
         }
         else
         {
-            new_ses->sort_prev = Sessions_tail;
+            new_ses->sort_prev       = Sessions_tail;
             Sessions_tail->sort_next = new_ses;
-            Sessions_tail = new_ses;
+            Sessions_tail            = new_ses;
         }
     }
-    else
+    else  /* insert session in the list, just before where */
     {
-        /* Ok, we insert a session in the middle of the list, just
-         * before where... */
         new_ses->sort_next = where;
         new_ses->sort_prev = where->sort_prev;
-        where->sort_prev = new_ses;
+        where->sort_prev   = new_ses;
     
-        if (!new_ses->sort_prev)
-        {
-            /* new_ses is new head */
-            Sessions_head = new_ses;
-        }
+        if (new_ses->sort_prev == NULL)
+            Sessions_head = new_ses;  /* new_ses is new head */
+
         else
-        {
             new_ses->sort_prev->sort_next = new_ses;
-        }
     }
 
-    return(new_ses - Sessions);
+    return new_ses - Sessions;
 }
 
-static	void	Sess_remove_session (session *ses)
+static void Sess_remove_session(session *ses)
 {
-    if (!ses->sort_prev && !ses->sort_next)
+    if (ses->sort_prev == NULL && ses->sort_next == NULL)  /* last session */
+      Sessions_head = Sessions_tail = NULL;
+
+    else if (ses->sort_prev == NULL)                       /* head */
     {
-        /* Last session */
-        Sessions_head = Sessions_tail = NULL;
-        Sess_free_session(ses);
-    
-        return;
+      Sessions_head            = ses->sort_next;          
+      Sessions_head->sort_prev = NULL;
     }
-
-    if (!ses->sort_prev)
+    else if (ses->sort_next == NULL)                       /* tail */
     {
-        /* Head */
-        Sessions_head = ses->sort_next;
-        ses->sort_next->sort_prev = NULL;
-        Sess_free_session(ses);
-    
-        return;
+      Sessions_tail            = ses->sort_prev;
+      Sessions_tail->sort_next = NULL;
     }
-
-    if (!ses->sort_next)
+    else                                                   /* middle */
     {
-        /* Tail */
-        Sessions_tail = ses->sort_prev;
-        ses->sort_prev->sort_next = NULL;
-        Sess_free_session(ses);
-    
-        return;
+      ses->sort_next->sort_prev = ses->sort_prev;
+      ses->sort_prev->sort_next = ses->sort_next;
     }
 
-    /* All troubled cases are above ;-) */
-    ses->sort_next->sort_prev = ses->sort_prev;
-    ses->sort_prev->sort_next = ses->sort_next;
+    ses->sort_prev = NULL;
+    ses->sort_next = NULL;
     Sess_free_session(ses);
 }
 
-static	void	Sess_init_sessions (void)
+int Sess_get_session_index(int mbox)
 {
-    int i;
+    int32u         m = (int32u) mbox;
+    unsigned char *c = (unsigned char *) &m;
+    unsigned int   i = c[0] ^ c[1] ^ c[2] ^ c[3];
+    session       *tmp;
 
-    for (i = 0; i < SESSION_FD_HASH_SIZE; i++)
-        Sessions_hash_head[i] = NULL;
+    /* Alarm( NONE, "Sess_get_session_index: mbox %d hashed to %u\n", mbox, i); */
+    
+    for (tmp = Sessions_hash_head[i]; tmp != NULL; tmp = tmp->hash_next)
+        if (tmp->mbox == mbox)
+            return (tmp - Sessions);
 
-    Sessions_free = Sessions_head = Sessions_tail = NULL;
+    return -1;
+}
 
-    for (i = 0; i < MAX_SESSIONS; i++)
-        Sess_free_session( &Sessions[i] );
+static void Sess_activate_port_reuse(mailbox mbox)
+{
+    int on = 1;
+
+    if ((on = setsockopt(mbox, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on))))
+      Alarmp( SPLOG_FATAL, SESSION, "Sess_activate_port_reuse: error setting SO_REUSEADDR socket option: %d %d '%s'\n", on, sock_errno, sock_strerror( sock_errno ) ); 
 }
 
 int     count_bits_set( int32u field, int first_index, int last_index)
 {       
+        int count       = 0;
+        int32u bitfield = (0x1 << first_index);
         int i;
-        int count = 0;
-        int32u bitfield;
+        
         assert(first_index >= 0 && first_index < 32);
-        assert(last_index >= 0 && last_index <=32);
+        assert(last_index >= 0 && last_index <= 32);
         assert(last_index >= first_index);
 
-        bitfield = 0x1 << first_index;
-        for ( i=0; i < (last_index - first_index); i++, bitfield <<=1)
-        {
-                if (field & bitfield )
-                        count++;
-        }
-        return(count);
+        for ( i = 0; i < last_index - first_index; ++i, bitfield <<= 1)
+                if (field & bitfield)
+                        ++count;
+
+        return count;
 }
 
 void	Sess_init()
 {
-	struct	sockaddr_in	inet_addr;
-	int16			port;
+        spu_addr                if_addr;
 	int			ret, i;
 	mailbox			mbox;
+        port_reuse              reuse = Conf_get_port_reuse_type();
 
 #ifndef ARCH_PC_WIN95
 
 	struct	sockaddr_un	unix_addr;
-	char			name[80];
+	char		       *name = unix_addr.sun_path;
 
 	signal( SIGPIPE, SIG_IGN );
 
@@ -329,23 +311,19 @@
 
         ret = Mem_init_object( MESSAGE_LINK, "message_link", sizeof(message_link), 1000, 0);
         if (ret < 0)
-        {
                 Alarm(EXIT, "Sess_init: Failure to Initialize MESSAGE_LINK memory objects\n");
-        }
 
         ret = Mem_init_object( DOWN_LINK, "down_link", sizeof(down_link), 200, 0);
         if (ret < 0)
-        {
                 Alarm(EXIT, "Sess_Init: Failure to Initialize DOWN_LINK memory objects\n");
-        }
 
-	Sess_init_sessions ();
+	Sess_init_sessions();
 	
 	Num_sessions = 0;
 	GlobalStatus.num_sessions = Num_sessions;
 	GlobalStatus.message_delivered = 0;
-	My 	 = Conf_my();
-	port 	 = My.port;
+	My 	  = Conf_my();
+	Sess_port = spu_addr_ip_get_port(&My.proc_addr);
 	Session_threshold = LOW_PRIORITY;
 
 	/* Initializing the protocol */
@@ -355,49 +333,44 @@
         Prot_set_down_queue( NORMAL_DOWNQUEUE );
         Prot_init();
 
-	/* Initiation of the INET socket */
-        memset(&inet_addr.sin_zero, 0, sizeof(inet_addr.sin_zero));
-
-	inet_addr.sin_family	= AF_INET;
-	inet_addr.sin_port	= htons(port);
         Accept_inet_mbox_num = 0;
 
         /* Bind to all interfaces specified in config file */
+        
         for ( i=0; i < My.num_if; i++)
         {
-                if (Is_IfType_Client(My.ifc[i].type) || Is_IfType_Any(My.ifc[i].type) )
+                if_addr = My.ifc[i].ifaddr;
+          
+                if (Is_IfType_Client(My.ifc[i].iftype) || Is_IfType_Any(My.ifc[i].iftype) )
                 {
-                        port_reuse type;
-                        if( (mbox = socket( AF_INET, SOCK_STREAM, 0 ) ) == -1)
-                                Alarm( EXIT, "Sess_init: INET sock error\n" );
-                        type = Conf_get_port_reuse_type();
-                        if (type == port_reuse_on)
-                                Sess_activate_port_reuse(mbox);
+                        int family = spu_addr_family(&if_addr);
 
-                        if (Is_IfType_Any(My.ifc[i].type) )
-                                inet_addr.sin_addr.s_addr = INADDR_ANY;
-                        else
-                        {
-                                if (type == port_reuse_auto)
-                                        Sess_activate_port_reuse(mbox);
-                                inet_addr.sin_addr.s_addr = htonl(My.ifc[i].ip);
-                        }
-                        if( bind( mbox,  (struct sockaddr *)&inet_addr, sizeof(inet_addr) ) == -1) 
-                        {
-                                Alarm( PRINT, "Sess_init: INET unable to bind to port %d, already running \n" ,port );
-                                exit(0);
-                        }
-                        inet_addr.sin_addr.s_addr = ntohl(inet_addr.sin_addr.s_addr);
-                        Alarm( SESSION, "Sess_init: INET bind for port %d interface %d.%d.%d.%d ok\n", port, 
-                               IP1(inet_addr.sin_addr.s_addr), IP2(inet_addr.sin_addr.s_addr),
-                               IP3(inet_addr.sin_addr.s_addr), IP4(inet_addr.sin_addr.s_addr) );
+                        if (Sess_port != spu_addr_ip_get_port(&if_addr))
+                          Alarmp( SPLOG_FATAL, SESSION, "Sess_init: interface port didn't match proc's?!\n" );
+                        
+                        if ((mbox = socket(family, SOCK_STREAM, 0)) == INVALID_SOCKET)
+                          Alarmp( SPLOG_FATAL, SESSION, "Sess_init: INET sock error: %d %d '%s'\n", mbox, sock_errno, sock_strerror( sock_errno ) );
+                        
+                        if (reuse == PORT_REUSE_ON)
+                          Sess_activate_port_reuse(mbox);
 
-                        if( listen( mbox, 25 ) < 0 ) 
-                                Alarm( EXIT, "Sess_init: INET unable to listen\n" );
+                        if (Is_IfType_Any(My.ifc[i].iftype) )
+                          spu_addr_ip_set_unspecified(&if_addr);
 
-                        Accept_inet_mbox[Accept_inet_mbox_num] = mbox;
-                        Accept_inet_mbox_num++;
-                        Alarm( SESSION, "Sess_init: INET went ok on mailbox %d\n", mbox );
+                        else if (reuse == PORT_REUSE_AUTO)
+                          Sess_activate_port_reuse(mbox);
+                        
+                        if ((ret = bind(mbox, (struct sockaddr*) &if_addr, spu_addr_len(&if_addr))))
+                          Alarmp(SPLOG_FATAL, SESSION, "Sess_init: unable to bind to port [%s]:%u; likely already bound by another process: %d %d '%s'\n",
+                                 SPU_ADDR_NTOP(&if_addr), (unsigned) spu_addr_ip_get_port(&if_addr), ret, sock_errno, sock_strerror(sock_errno));
+
+                        if ((ret = listen(mbox, 25))) 
+                          Alarmp(SPLOG_FATAL, SESSION, "Sess_init: listen failed: %d %d '%s'\n", ret, sock_errno, sock_strerror(sock_errno));                        
+
+                        Accept_inet_mbox[Accept_inet_mbox_num++] = mbox;
+
+                        Alarmp(SPLOG_INFO, SESSION, "Sess_init: TCP bind on [%s]:%u went ok for mailbox %d\n",
+                               SPU_ADDR_NTOP(&if_addr), (unsigned) spu_addr_ip_get_port(&if_addr), mbox);
                 }
         }
 
@@ -408,16 +381,14 @@
 	if( (mbox = socket( AF_UNIX, SOCK_STREAM, 0 ) ) == -1)
 	    Alarm( EXIT, "Sess_init: UNIX sock error\n" );
 
-	unix_addr.sun_family	= AF_UNIX;
-	snprintf( name, sizeof(name), "%s/%hu", SP_UNIX_SOCKET, My.port );
-	strcpy( unix_addr.sun_path, name ); 
+        memset(&unix_addr, 0, sizeof(unix_addr));
+	unix_addr.sun_family = AF_UNIX;
+	snprintf( name, sizeof(unix_addr.sun_path), "%s/%u", SP_UNIX_SOCKET, (unsigned) Sess_port );
 	unlink( name );
 
-	if( bind( mbox, (struct sockaddr *)&unix_addr, sizeof(unix_addr) ) == -1) 
-	{
-		Alarm( PRINT, "Sess_init: UNIX unable to bind to name %s, already running \n" , name );
-		exit(0);
-	}
+	if( bind( mbox, (struct sockaddr *) &unix_addr, sizeof(unix_addr) ) ) 
+          Alarmp(SPLOG_FATAL, SESSION, "Sess_init: AF_UNIX unable to bind to name '%s': %d '%s'\n" , name, errno, strerror(errno) );
+        
 	Alarm( SESSION, "Sess_init: UNIX bind for name %s ok\n", name );
 
 	chmod( name, 0666 );
@@ -442,10 +413,10 @@
 void    Sess_fini(void)
 {
 #ifndef ARCH_PC_WIN95
-        char name[80];
+        char name[256];
 
         close( Accept_unix_mbox );
-        snprintf( name, sizeof(name), "%s/%hu", SP_UNIX_SOCKET, My.port );
+        snprintf( name, sizeof(name), "%s/%u", SP_UNIX_SOCKET, (unsigned) Sess_port );
         unlink( name );
 #endif
 }
@@ -453,7 +424,6 @@
 void    Sess_signal_conf_reload(void)
 {
         My = Conf_my();
-
         G_signal_conf_reload();
 }
 
@@ -463,20 +433,20 @@
 	
 	if( Protocol_threshold > Session_threshold ) 
 		E_set_active_threshold( Protocol_threshold );
-	else 	E_set_active_threshold( Session_threshold );
+	else
+                E_set_active_threshold( Session_threshold );
 }
 
 void    Sess_block_user(int xxx)
 {
-
-        Alarm(EXIT,"Sess_block_user: NOT IMPLEMENTED!\n");
+        Alarm(EXIT, "Sess_block_user: NOT IMPLEMENTED!\n");
 }
 
 void    Sess_unblock_user(int xxx)
 {
-
-        Alarm(EXIT,"Sess_unblock_user: NOT IMPLEMENTED!\n");
+        Alarm(EXIT, "Sess_unblock_user: NOT IMPLEMENTED!\n");
 }
+
 void	Sess_block_users_level()
 {
 	/* This function is used only by lower layers (protocol) */
@@ -500,22 +470,23 @@
 static	void	Sess_attach_accept()
 {
         int i;
+        
         for ( i=0; i < Accept_inet_mbox_num; i++)
         {
-                E_attach_fd( Accept_inet_mbox[i], READ_FD, Sess_accept, AF_INET, NULL, LOW_PRIORITY );
-                E_attach_fd( Accept_inet_mbox[i], EXCEPT_FD, Sess_accept, AF_INET, NULL, LOW_PRIORITY );
+                E_attach_fd( Accept_inet_mbox[i], READ_FD,   Sess_accept, 0, NULL, LOW_PRIORITY );
+                E_attach_fd( Accept_inet_mbox[i], EXCEPT_FD, Sess_accept, 0, NULL, LOW_PRIORITY );
         }
 #ifndef ARCH_PC_WIN95
 
-	E_attach_fd( Accept_unix_mbox, READ_FD, Sess_accept, AF_UNIX, NULL, LOW_PRIORITY );
+	E_attach_fd( Accept_unix_mbox, READ_FD, Sess_accept, 1, NULL, LOW_PRIORITY );
 
 #endif	/* ARCH_PC_WIN95 */
-
 }
 
 static	void	Sess_detach_accept()
 {
         int i;
+        
         for (i=0; i < Accept_inet_mbox_num; i++)
         {
                 E_detach_fd( Accept_inet_mbox[i], READ_FD );
@@ -533,12 +504,10 @@
 {
 	Sess_accept_continue(0,0,NULL);
 } 
-    
 
-static	void	Sess_accept( mailbox mbox, int domain, void *dummy )
+static	void	Sess_accept( mailbox mbox, int is_unix, void *dummy )
 {
-	struct	sockaddr_in	inet_addr;
-	socklen_t		inet_len;
+        socklen_t		addr_len = sizeof(Sessions[MAX_SESSIONS].addr);
         sockopt_len_t           onlen;
 	sp_time			accept_delay;
 	char			response;
@@ -547,31 +516,21 @@
 
 	int32			on;
 
-	if( domain == AF_INET ) 
-	{
-		inet_len = sizeof(inet_addr);
-		Sessions[MAX_SESSIONS].mbox = accept( mbox, (struct sockaddr *)&inet_addr, &inet_len );
+        memset(&Sessions[MAX_SESSIONS].addr, 0, sizeof(Sessions[MAX_SESSIONS].addr));
+        
+        if ( is_unix )
+		Sessions[MAX_SESSIONS].mbox = accept( mbox, NULL, NULL );
+        
+	else
+                Sessions[MAX_SESSIONS].mbox = accept( mbox, &Sessions[MAX_SESSIONS].addr.addr, &addr_len );
 
-		Sessions[MAX_SESSIONS].type = AF_INET;
-		/* 
-		 * sender's machine ip address is: htonl(inet_addr.sin_addr.s_addr) 
-		 * sender's assigned port is     : htons(inet_addr.sin_port)
-		 */
-		Sessions[MAX_SESSIONS].address = htonl(inet_addr.sin_addr.s_addr);
-	}else if( domain == AF_UNIX ){
-		/* no need for return values for AF_UNIX on the accept */
-		Sessions[MAX_SESSIONS].mbox = accept( mbox, 0, 0 );
-
-		Sessions[MAX_SESSIONS].type = AF_UNIX;
-		Sessions[MAX_SESSIONS].address = 0;
-	}else Alarm( EXIT, "Sess_accept: Unknown domain %d on mailbox %d\n", domain, mbox );
-
-	if( Sessions[MAX_SESSIONS].mbox < 0 ) 
+	if ( Sessions[MAX_SESSIONS].mbox == INVALID_SOCKET ) 
 	{
-		Alarm( SESSION, "Sess_accept: accept failed for domain %d\n", domain );
+                Alarm( SESSION, "Sess_accept: accept failed: %d '%s'\n", sock_errno, sock_strerror(sock_errno) );
 		return;
 	}
-	if( Num_sessions == MAX_SESSIONS )
+        
+	if( Num_sessions >= MAX_SESSIONS )
 	{
 		response = REJECT_QUOTA;
 		send( Sessions[MAX_SESSIONS].mbox, &response, sizeof(response), 0 );
@@ -583,10 +542,9 @@
         if ( ( (i = Sess_get_session_index(Sessions[MAX_SESSIONS].mbox)) != -1)
              && (Sessions[i].mbox == Sessions[MAX_SESSIONS].mbox) 
              && (Is_op_session( Sessions[i].status )) )
-        {
             /* This is impossible as the mbox must have been closed to be returned by accept */
-            Alarm(EXIT, "Sess_accept: BUG! Accepted new FD %d that is currently in use(ses %d).\n", Sessions[i].mbox, i);
-        }
+            Alarm(EXIT, "Sess_accept: BUG! Accepted new FD %d that is currently in use (ses %d).\n", Sessions[i].mbox, i);
+
 	for( i=10; i <= 200; i+=5 )
 	{
 	    on = 1024*i;
@@ -600,16 +558,18 @@
 
 	    ret= getsockopt( Sessions[MAX_SESSIONS].mbox, SOL_SOCKET, SO_SNDBUF, (void *)&on, &onlen );
 	    if( on < i*1024 ) break;
-	    Alarm( NONE, "Sess_accept: set sndbuf %d, ret is %d\n", on, ret );
+	    /* Alarm( NONE, "Sess_accept: set sndbuf %d, ret is %d\n", on, ret ); */
 
 	    onlen = sizeof(on);
 	    ret= getsockopt( Sessions[MAX_SESSIONS].mbox, SOL_SOCKET, SO_RCVBUF, (void *)&on, &onlen );
 	    if( on < i*1024 ) break;
-	    Alarm( NONE, "Sess_accept: set rcvbuf %d, ret is %d\n", on, ret );
+	    /* Alarm( NONE, "Sess_accept: set rcvbuf %d, ret is %d\n", on, ret ); */
 	}
+        
 	Alarm( SESSION, "Sess_accept: set sndbuf/rcvbuf to %d\n", 1024*(i-5) );
 
-        if ( domain == AF_INET ) {
+        if ( !is_unix )
+        {
                 on = 1;
                 ret = setsockopt( Sessions[MAX_SESSIONS].mbox, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(on) );
                 if (ret < 0) 
@@ -624,6 +584,7 @@
                 else
                         Alarm( SESSION, "Setting SO_KEEPALIVE on socket %d\n", Sessions[MAX_SESSIONS].mbox );
         }
+        
 	/* delaying for the private name to be written */
 	Sess_detach_accept();
 	E_attach_fd( Sessions[MAX_SESSIONS].mbox, READ_FD, Sess_accept_continue, 0, NULL, LOW_PRIORITY );	
@@ -1006,7 +967,8 @@
          * that should authorize connections 
          */
         Sess_session_authorized( ses );
-} 
+}
+
 void    Sess_session_denied(int ses)
 {
         char response;
@@ -1033,7 +995,6 @@
 
 void    Sess_session_authorized(int ses)
 {
-        char        ip[16];
         char        response;
         unsigned int    name_len;
         char	private_group_name[MAX_GROUP_NAME];
@@ -1077,10 +1038,8 @@
         /* sending the private group name */
         send( Sessions[ses].mbox, private_group_name, name_len, 0 );
 
-        E_attach_fd( Sessions[ses].mbox, READ_FD, Sess_read, Sessions[ses].type, NULL, 
-                     LOW_PRIORITY );
-        E_attach_fd( Sessions[ses].mbox, EXCEPT_FD, Sess_read, Sessions[ses].type, NULL, 
-                     LOW_PRIORITY );
+        E_attach_fd( Sessions[ses].mbox, READ_FD, Sess_read, 0, NULL, LOW_PRIORITY );
+        E_attach_fd( Sessions[ses].mbox, EXCEPT_FD, Sess_read, 0, NULL, LOW_PRIORITY );
 
         Sessions[ses].status = Set_op_session( Sessions[ses].status );
         Sessions[ses].status = Clear_preauth_session( Sessions[ses].status );
@@ -1091,15 +1050,14 @@
         Message_reset_current_location(&(Sessions[ses].write) );
         Sessions[ses].read.in_mess_head = 1;
 
-        Log_sess_connect( Sessions[ses].mbox, Sessions[ses].address, 
+        Log_sess_connect( Sessions[ses].mbox, &Sessions[ses].addr, 
                           Sessions[ses].name );
-
-        Conf_id_to_str( Sessions[ses].address, ip );
-        Alarm( SESSION, "Sess_session_authorized: Accepting from %s with private name %s on mailbox %d\n",
-               ip,
+        
+        Alarm( SESSION, "Sess_session_authorized: Accepting with private name %s on mailbox %d\n",
                Sessions[ses].name,
                Sessions[ses].mbox );
 }
+
 static  int     Sess_validate_read_header( mailbox mbox, int ses, int head_size, message_header *head_ptr)
 {
 	char		private_name[MAX_PRIVATE_NAME+1];
@@ -1176,27 +1134,28 @@
         int             ses, ioctl_cmd;
         char            *head_cbuf;
 #if 0
-#ifndef ARCH_SCATTER_NONE
+#  ifndef ARCH_SCATTER_NONE
 static  struct  msghdr  msgh;
-#endif  /* ARCH_SCATTER_NONE */
+#  endif  /* ARCH_SCATTER_NONE */
 #endif  /* 0 */
+
 #if 0
         /* we currently don't use recvmsg */
-#ifndef ARCH_SCATTER_NONE
+#  ifndef ARCH_SCATTER_NONE
 	msgh.msg_name    = (caddr_t) 0;
 	msgh.msg_namelen = 0;
 	msgh.msg_iov     = (struct iovec *)scat->elements;
 	msgh.msg_iovlen  = scat->num_elements;
-#endif  /* ARCH_SCATTER_NONE */
+#  endif  /* ARCH_SCATTER_NONE */
 
-#ifdef ARCH_SCATTER_CONTROL
+#  ifdef ARCH_SCATTER_CONTROL
 	msgh.msg_control = (caddr_t) 0;
 	msgh.msg_controllen = 0;
-#endif /* ARCH_SCATTER_CONTROL */
-#ifdef ARCH_SCATTER_ACCRIGHTS
+#  endif /* ARCH_SCATTER_CONTROL */
+#  ifdef ARCH_SCATTER_ACCRIGHTS
 	msgh.msg_accrights = (caddr_t) 0;
 	msgh.msg_accrightslen = 0;
-#endif /* ARCH_SCATTER_ACCRIGHTS */
+#  endif /* ARCH_SCATTER_ACCRIGHTS */
 #endif /* 0 */
 
         ses = Sess_get_session_index(mbox);
@@ -1459,8 +1418,9 @@
                  * closed socket ourselves and calling Sess_kill(), then the session
                  * is in the wrong state and we will crash when we try to finish delivery.
                  */
-                Log_sess_disconnect( Sessions[ses].mbox, Sessions[ses].address, Sessions[ses].name,
+                Log_sess_disconnect( Sessions[ses].mbox, &Sessions[ses].addr, Sessions[ses].name,
                                      Sessions[ses].num_mess );
+                
                 /* clear his structure */
                 while( Sessions[ses].num_mess > 0 )
                 {
@@ -1499,7 +1459,8 @@
 		}
         }
         return( num_p2p_targets );
-} 
+}
+
 /* Take a message received from a client and change it into the form of
  * a reject message. Destination groups, user data, mess_type and type field
  * are all preserved to give the sender information about what message was 
@@ -1827,8 +1788,9 @@
 	Prot_new_message( down_ptr, Sessions[ses].down_queue );
         Message_Dec_Refcount(kill_mess);
 
-	Log_sess_disconnect( Sessions[ses].mbox, Sessions[ses].address, Sessions[ses].name,
+	Log_sess_disconnect( Sessions[ses].mbox, &Sessions[ses].addr, Sessions[ses].name,
 			     Sessions[ses].num_mess );
+        
 	/* clear his structure */
 	while( Sessions[ses].num_mess > 0 )
 	{
@@ -2043,4 +2005,3 @@
 	head_ptr->num_groups	= Flip_int32( head_ptr->num_groups );
 	head_ptr->data_len	= Flip_int32( head_ptr->data_len );
 }
-

Modified: trunk/daemon/session.h
===================================================================
--- trunk/daemon/session.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/session.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -44,37 +44,42 @@
 #include "sess_types.h"
 #include "acm.h"
 
-typedef	struct	dummy_message_link {
-	message_obj			*mess;
-	struct	dummy_message_link	*next;
+typedef	struct	message_link
+{
+	message_obj		*mess;
+	struct	message_link	*next;
+  
 } message_link;
 
-struct partial_message_info {
+struct partial_message_info
+{
         int     in_mess_head;
         int     cur_element;
         int     cur_byte;
         int     total_bytes;
 };
 
-typedef	struct	dummy_session {
+typedef	struct session
+{
 	char		name[MAX_PRIVATE_NAME+1]; /* +1 for the null */
         char            lib_version[3];
-	int32		address;
+        spu_addr        addr;
 	int		status; /* OP_SESSION or KILLED SESSION and with or without membership */
         int             priority;
 	mailbox		mbox;
-	int		type; /* inet or unix */ 
+  /*int		type;*/                   /* sockaddr family */
         struct acp_ops  acp_ops;
         int             down_queue;             /* Down queue to protocol */
         struct partial_message_info     read;   /* Read Msg from Client */
-        message_obj     *read_mess;             /* Read Msg from Client */
+        message_obj    *read_mess;              /* Read Msg from Client */
 	int		num_mess;               /* Write Queue to Client */
         struct partial_message_info     write;  /* Write Queue to Client */
-	message_link	*first;                 /* Write Queue to Client */
-	message_link	*last;                  /* Write Queue to Client */
-	struct dummy_session *sort_prev;
-	struct dummy_session *sort_next;
-	struct dummy_session *hash_next;
+	message_link   *first;                  /* Write Queue to Client */
+	message_link   *last;                   /* Write Queue to Client */
+	struct session *sort_prev;
+	struct session *sort_next;
+	struct session *hash_next;
+  
 } session;
 
 void	Sess_init(void);

Modified: trunk/daemon/spread.c
===================================================================
--- trunk/daemon/spread.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/spread.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -58,7 +58,7 @@
 #endif
 
 #ifdef	ARCH_PC_WIN95
-#  include	<winsock.h>
+#  include	<winsock2.h>
 WSADATA		WSAData;
 #endif	/* ARCH_PC_WIN95 */
 
@@ -113,7 +113,7 @@
 
 	Alarmp( SPLOG_PRINT, SYSTEM, "/===========================================================================\\\n");
 	Alarmp( SPLOG_PRINT, SYSTEM, "| The Spread Toolkit                                                        |\n");
-	Alarmp( SPLOG_PRINT, SYSTEM, "| Copyright (c) 1993-2014 Spread Concepts LLC                               |\n"); 
+	Alarmp( SPLOG_PRINT, SYSTEM, "| Copyright (c) 1993-2016 Spread Concepts LLC                               |\n"); 
 	Alarmp( SPLOG_PRINT, SYSTEM, "| All rights reserved.                                                      |\n");
 	Alarmp( SPLOG_PRINT, SYSTEM, "|                                                                           |\n");
 	Alarmp( SPLOG_PRINT, SYSTEM, "| The Spread toolkit is licensed under the Spread Open-Source License.      |\n");
@@ -162,7 +162,7 @@
 
 #ifdef	ARCH_PC_WIN95
 
-	ret = WSAStartup( MAKEWORD(1,1), &WSAData );
+	ret = WSAStartup( MAKEWORD(2,0), &WSAData );
 	if( ret != 0 )
             Alarmp( SPLOG_FATAL, NETWORK, "Spread: winsock initialization error %d\n", ret );
 

Modified: trunk/daemon/spread_params.h
===================================================================
--- trunk/daemon/spread_params.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/spread_params.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -37,13 +37,13 @@
 #ifndef	INC_SPREAD_PARAMS
 #define INC_SPREAD_PARAMS
 
-#define		SP_MAJOR_VERSION	4
-#define         SP_MINOR_VERSION        4
+#define		SP_MAJOR_VERSION	5
+#define         SP_MINOR_VERSION        0
 #define         SP_PATCH_VERSION        0
 
 #define         SPREAD_PROTOCOL         3
 
-#define         SPREAD_BUILD_DATE       "27/May/2014"
+#define         SPREAD_BUILD_DATE       "18/Apr/2016"
 
 #define		DEFAULT_SPREAD_PORT	4803
 
@@ -60,11 +60,14 @@
 #define         SP_UNIX_SOCKET          "/tmp"
 #endif
 
-#define		MAX_PROC_NAME		 20     /* including the null, so actually max 19, look for it if changed */
+#define		MAX_PROC_NAME		 20     /* including the nul terminator, so actually usable is one less, look for it if changed */
 
+#define         MAX_ID_SIZE              16     /* ids are 32b values presented in IPv4 address format */
+
 #define		MAX_PROCS_SEGMENT	128
 #define		MAX_SEGMENTS		 20
 #define		MAX_PROCS_RING		128
+#define		MAX_ADDRS_SEGMENT         5
 #define         MAX_INTERFACES_PROC      10
 
 #define         MAX_REPS                 25
@@ -89,7 +92,7 @@
 #define		DEFAULT_MAX_SESSION_MESSAGES	1000
 #define         MAX_GROUPS_PER_MESSAGE  100     /* Each multicast can't send to more groups then this */
 
-#define         MAX_WRAP_SEQUENCE_VALUE (1<<30) /* Maximum value for token->seq before reseting to zero with membership */
+#define         MAX_WRAP_SEQUENCE_VALUE (1<<30) /* Maximum value for token->seq before resetting to zero with membership */
 
 #define		DEFAULT_WINDOW 		   160
 #define		DEFAULT_PERSONAL_WINDOW	    20

Modified: trunk/daemon/status.c
===================================================================
--- trunk/daemon/status.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/status.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -52,61 +52,56 @@
 static	sys_scatter	Report_scat;
 static	packet_header	Pack;
 
-
-void	Stat_init()
+void	Stat_init( void )
 {
-	int16	dummy_port = 0;
-
+        proc my          = Conf_my();
+        spu_addr if_addr = my.proc_addr;
+        
 	Start_time = E_get_time();
 
-	Report_channel = DL_init_channel( SEND_CHANNEL, dummy_port, 0, Conf_my().id );
+        spu_addr_ip_set_port(&if_addr, 0);
+	Report_channel = DL_init_channel_gen( SEND_CHANNEL | RECV_CHANNEL, NULL, &if_addr );  /* maybe just use Send_channel instead? */
 
-	Report_scat.num_elements = 2;
+	Report_scat.num_elements    = 2;
 	Report_scat.elements[0].len = sizeof( packet_header );
-	Report_scat.elements[0].buf = (char *)&Pack;
+	Report_scat.elements[0].buf = (char*) &Pack;
 	Report_scat.elements[1].len = sizeof( status );
-	Report_scat.elements[1].buf = (char *)&GlobalStatus;
+	Report_scat.elements[1].buf = (char*) &GlobalStatus;
 
-	Pack.type = STATUS_TYPE;
-	Pack.type = Set_endian( Pack.type );
+	Pack.type     = Set_endian( STATUS_TYPE );
+	Pack.proc_id  = my.id;
 	Pack.data_len = sizeof( status );
-	Pack.proc_id = Conf_my().id;
 
 	GlobalStatus.major_version = SP_MAJOR_VERSION;
 	GlobalStatus.minor_version = SP_MINOR_VERSION;
 	GlobalStatus.patch_version = SP_PATCH_VERSION;
 
 	Alarm( STATUS, "Stat_init: went ok\n" );
-
 }
 
 void	Stat_handle_message( sys_scatter *scat )
 {
+        spu_addr        dst_addr = { 0 };
 	sp_time		now;
 	sp_time		delta;
 	packet_header	*pack_ptr;
 	proc		p;
-	int		ret;
 
-	pack_ptr = (packet_header *)scat->elements[0].buf;
-	if( ! ( pack_ptr->memb_id.proc_id == 15051963 && Conf_id_in_conf( Conf_ref(), pack_ptr->proc_id ) != -1 ) )
+	pack_ptr = (packet_header*) scat->elements[0].buf;
+        
+	if ( Conf_proc_by_id( pack_ptr->proc_id, &p ) < 0 )
 	{
 		Alarm( STATUS, "Stat_handle_message: Illegal monitor request\n");
 		return;
 	}
 
+        dst_addr = p.proc_addr;
+        spu_addr_ip_set_port(&dst_addr, (int16u) pack_ptr->seq);  /* NOTE: monitor return port stuffed into seq */
+
 	now   = E_get_time();
 	delta = E_sub_time( now, Start_time );
 	GlobalStatus.sec = delta.sec;
 
-	DL_send( Report_channel, pack_ptr->proc_id, pack_ptr->seq, &Report_scat );
-	ret = Conf_proc_by_id( pack_ptr->proc_id, &p );
-	if( ret < 0 )
-		Alarm( STATUS, 
-			"Stat_handle_message: sent status to Monitor at %d\n",
-			pack_ptr->proc_id );
-	else 	Alarm( STATUS, 
-			"Stat_handle_message: sent status to Monitor at %s\n",
-			p.name );
+	DL_sendto_gen( Report_channel, &Report_scat, &dst_addr );
 }
 

Modified: trunk/daemon/status.h
===================================================================
--- trunk/daemon/status.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/daemon/status.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -82,7 +82,7 @@
 
 ext 	status	GlobalStatus; 
 
-void	Stat_init();
+void	Stat_init( void );
 void	Stat_handle_message( sys_scatter *scat );
 
 #endif	/* INC_STATUS */ 

Modified: trunk/docs/sample.spread.conf
===================================================================
--- trunk/docs/sample.spread.conf	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/docs/sample.spread.conf	2016-11-14 17:40:56 UTC (rev 861)
@@ -103,7 +103,7 @@
 #If option is set to true then all monitor commands are enabled. 
 #   THIS IS A SECURTIY RISK IF YOUR NETWORK IS NOT PROTECTED!
 
-DangerousMonitor = true
+#DangerousMonitor = true
 
 #Set handling of SO_REUSEADDR socket option for the daemon's TCP
 # listener.  This is useful for facilitating quick daemon restarts (OSes
@@ -274,3 +274,15 @@
 #GatherTimeout = 1250
 #FormTimeout = 1250
 #LookupTimeout = 30000
+
+# If you don't specify membership timeouts, then Spread will use one
+# of two sets of default membership timeouts based on whether or not
+# your configuration is for a LAN or a WAN.  The WideAreaNetwork
+# parameter forces the daemon to either use the WAN timeouts (true) or
+# the LAN timeouts (false).  If this parameter is also not specified,
+# then LAN timeouts will only be used if your configuration has a
+# single segment.  All other configurations will use the longer WAN
+# timeouts instead.
+#
+# WideAreaNetwork = false
+

Modified: trunk/examples/Makefile.in
===================================================================
--- trunk/examples/Makefile.in	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/examples/Makefile.in	2016-11-14 17:40:56 UTC (rev 861)
@@ -50,7 +50,7 @@
 EXEEXT=@EXEEXT@
 SP_LIBRARY_DIR=../libspread
 
-TARGETS=spuser$(EXEEXT) spflooder$(EXEEXT) sptuser${EXEEXT} flush_user$(EXEEXT)
+TARGETS=spuser$(EXEEXT) spflooder$(EXEEXT) sptuser${EXEEXT} flush_user$(EXEEXT) spping$(EXEEXT)
 
 all: $(TARGETS) 
 
@@ -87,6 +87,9 @@
 fl_time_memb$(EXEEXT): $(SP_LIBRARY_DIR)/libspread.a fl_time_memb.o stats.o
 	$(LD) $(LDFLAGS) -o fl_time_memb fl_time_memb.o stats.o $(LIBS)
 
+spping$(EXEEXT): $(SP_LIBRARY_DIR)/libspread.a spping.o
+	$(LD) -o $@ spping.o $(LDFLAGS) $(SP_LIBRARY_DIR)/libspread-core.a $(LIBS)
+
 clean:
 	rm -f *.lo *.tlo *.to *.o *.a *.dylib $(TARGETS) spsimple_user
 	rm -f core

Copied: trunk/examples/spping.c (from rev 845, branches/spread_5/examples/spping.c)
===================================================================
--- trunk/examples/spping.c	                        (rev 0)
+++ trunk/examples/spping.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -0,0 +1,380 @@
+/*
+ * The Spread Toolkit.
+ *     
+ * The contents of this file are subject to the Spread Open-Source
+ * License, Version 1.0 (the ``License''); you may not use
+ * this file except in compliance with the License.  You may obtain a
+ * copy of the License at:
+ *
+ * http://www.spread.org/license/
+ *
+ * or in the file ``license.txt'' found in this distribution.
+ *
+ * Software distributed under the License is distributed on an AS IS basis, 
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
+ * for the specific language governing rights and limitations under the 
+ * License.
+ *
+ * The Creators of Spread are:
+ *  Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz.
+ *
+ *  Copyright (C) 1993-2014 Spread Concepts LLC <info at spreadconcepts.com>
+ *
+ *  All Rights Reserved.
+ *
+ * Major Contributor(s):
+ * ---------------
+ *    Amy Babay            babay at cs.jhu.edu - accelerated ring protocol.
+ *    Ryan Caudy           rcaudy at gmail.com - contributions to process groups.
+ *    Claudiu Danilov      claudiu at acm.org - scalable wide area support.
+ *    Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
+ *    Theo Schlossnagle    jesus at omniti.com - Perl, autoconf, old skiplist.
+ *    Dan Schoenblum       dansch at cnds.jhu.edu - Java interface.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <limits.h>
+#include <math.h>
+#include <signal.h>
+
+#include "sp.h"
+
+typedef struct
+{
+  uint32_t      seq;
+  uint32_t      secs;
+  uint32_t      usecs;
+  unsigned char is_ping;
+  char          origin[MAX_GROUP_NAME];
+
+} ping_pkt;
+
+#define MAX_MESSLEN 100000
+
+typedef union
+{
+  ping_pkt ping;
+  char     mess[MAX_MESSLEN];
+  
+} msg_union;
+
+static char      Spread_name[300]      = "4803";
+static char     *User                  = NULL;
+static char      Group[MAX_GROUP_NAME] = "spping";
+static int       Period                = 1000;
+static int       Num_bytes             = (int) sizeof(ping_pkt);
+static int       Num_messages          = -1;
+static int       Read_only             = 0;
+static int       Send_service_type     = (RELIABLE_MESS | SELF_DISCARD);
+
+static char      Private_group[MAX_GROUP_NAME];
+static mailbox   Mbox;
+
+static sp_time   SP_period;
+
+#define SPPING_MAX_GROUPS 100
+
+static int       Ret;
+static int       Service_type;
+static int       Num_groups;
+static char      Sender[MAX_GROUP_NAME];
+static char      Ret_groups[SPPING_MAX_GROUPS][MAX_GROUP_NAME];
+static int16     Mess_type;
+static int       Endian_mismatch;
+static msg_union Recv_mess;
+
+static uint32_t  Send_counter;
+static msg_union Send_mess;
+
+static long     *Samples;
+static int       Samples_num;
+static int       Samples_size;
+
+static void print_help(const char *msg)
+{
+  if (msg != NULL)
+    fprintf(stderr, "Error: %s\n\n", msg);
+  
+  fprintf(stderr, "Usage: spping\n"
+          "\t[-s <spread name>]   : either port or port at hostname (default: 4803)\n"
+          "\t[-u <user name>]     : unique (on daemon) user name (default: <random>)\n"
+          "\t[-g <group name>]    : group to which to send/recv (default: spping)\n"
+          "\t[-p <period>]        : time in ms between sending pings (default: 1000)\n"
+          "\t[-b <num bytes>]     : number of bytes per message (default: 48)\n"
+          "\t[-m <num messages>]  : number of messages (default: infinite)\n"
+          "\t[-ro]                : reflect only\n");
+  
+  exit(1);
+}
+
+static void Usage(int argc, char *argv[])
+{
+  char junk;
+  
+  for (--argc, ++argv; argc > 0; --argc, ++argv)
+  {
+    if (!strncmp(*argv, "-s", 2))
+    {
+      if (argc < 2 || strlen(argv[1]) >= sizeof(Spread_name))
+        print_help("Invalid -s parameter");
+      
+      strncpy(Spread_name, argv[1], sizeof(Spread_name));
+      --argc, ++argv;
+    }
+    else if (!strncmp(*argv, "-u", 2))
+    {
+      if (argc < 2)
+        print_help("Invalid -u parameter");
+
+      User = argv[1];
+      --argc, ++argv;
+    }
+    else if (!strncmp(*argv, "-g", 2))
+    {
+      if (argc < 2 || strlen(argv[1]) >= sizeof(Group))
+        print_help("Invalid -g parameter");
+      
+      strncpy(Group, argv[1], sizeof(Group));
+      --argc, ++argv;
+    }
+    else if (!strncmp(*argv, "-p", 2))
+    {
+      if (argc < 2 || sscanf(argv[1], "%d%c", &Period, &junk) != 1 || Period < 0)
+        print_help("Invalid -p parameter");
+      
+      --argc, ++argv;
+    }
+    else if (!strncmp(*argv, "-b", 2))
+    {
+      if (argc < 2 || sscanf(argv[1], "%d%c", &Num_bytes, &junk) != 1 || Num_bytes < (int) sizeof(ping_pkt) || Num_bytes > MAX_MESSLEN)
+        print_help("Invalid -b parameter");
+      
+      --argc, ++argv;
+    }
+    else if (!strncmp(*argv, "-m", 2))
+    {
+      if (argc < 2 || sscanf(argv[1], "%d%c", &Num_messages, &junk) != 1)
+        print_help("Invalid -m parameter");
+      
+      --argc, ++argv;
+    }
+    else if (!strncmp(*argv, "-ro", 3))
+      Read_only  = 1;
+    
+    else
+      print_help("Unrecognized parameter");
+  }
+
+  SP_period.sec  = Period / 1000;
+  SP_period.usec = (Period % 1000) * 1000;
+}
+
+int long_cmp(const void *l, const void *r)
+{
+  return (*(const long*) l < *(const long*) r ? -1 : (*(const long*) l != *(const long*) r ? 1 : 0));
+}
+
+static void compute_print_stats(void)
+{
+  printf("\n"
+    "--- %s ping statistics ---\n"
+    "%d packets transmitted, %d packets received, %f%% packet loss\n",
+    Group, Send_counter, Samples_num, (Send_counter ? (Send_counter - Samples_num) * 100.0 / Send_counter : 0.0));
+  
+  if (Samples)
+  {
+    long   p0, p01, p05, p1, p5, p10, p25, p50, p75, p90, p95, p99, p995, p999, p100;
+    double mean = 0.0, kvar = 0.0, stddev;
+    int    i;
+
+    qsort(Samples, Samples_num, sizeof(long), long_cmp);
+
+    p0   = Samples[0];
+    p01  = Samples[Samples_num / 1000];
+    p05  = Samples[Samples_num / 200];
+    p1   = Samples[Samples_num / 100];
+    p5   = Samples[Samples_num / 20];
+    p10  = Samples[Samples_num / 10];
+    p25  = Samples[Samples_num / 4];
+    p50  = Samples[Samples_num / 2];
+    p75  = Samples[Samples_num - Samples_num / 4];
+    p90  = Samples[Samples_num - Samples_num / 10];
+    p95  = Samples[Samples_num - Samples_num / 20];
+    p99  = Samples[Samples_num - Samples_num / 100];
+    p995 = Samples[Samples_num - Samples_num / 200];
+    p999 = Samples[Samples_num - Samples_num / 1000];
+    p100 = Samples[Samples_num - 1];
+    
+    printf("round-trip percentiles (ms) (slightly biased outwards):\n"
+           "   0: %9.3f\n"
+           " 0.1: %9.3f\n"
+           " 0.5: %9.3f\n"
+           "   1: %9.3f\n"
+           "   5: %9.3f\n"
+           "  10: %9.3f\n"
+           "  25: %9.3f\n"
+           "  50: %9.3f\n"
+           "  75: %9.3f\n"
+           "  90: %9.3f\n"
+           "  95: %9.3f\n"
+           "  99: %9.3f\n"
+           "99.5: %9.3f\n"
+           "99.9: %9.3f\n"
+           " 100: %9.3f\n",
+           p0 / 1000.0, p01 / 1000.0, p05 / 1000.0, p1 / 1000.0, p5 / 1000.0, p10 / 1000.0, p25 / 1000.0, p50 / 1000.0,
+           p75 / 1000.0, p90 / 1000.0, p95 / 1000.0, p99 / 1000.0, p995 / 1000.0, p999 / 1000.0, p100 / 1000.0);
+    
+    for (i = 0; i < Samples_num; ++i)
+    {
+      double prev_mean = mean;
+      
+      mean += (Samples[i] - mean) / (i + 1);
+      kvar += (Samples[i] - prev_mean) * (Samples[i] - mean);
+    }
+
+    stddev = (Samples_num > 1 ? sqrt(kvar / (Samples_num - 1)) : 0.0);
+
+    printf("round-trip mean/stddev = %.3f/%.3f ms\n", mean / 1000.0, stddev / 1000.0);
+  }
+}
+
+static void catch_signal(int signum)
+{
+  E_exit_events_async_safe();
+}
+
+static void send_ping(int dmy_code, void *dmy_data)
+{
+  sp_time   now = E_get_time();
+  ping_pkt *pkt = &Send_mess.ping;
+
+  if (Num_messages >= 0 && Send_counter >= Num_messages)
+  {
+    E_exit_events();
+    return;
+  }
+
+  pkt->seq     = Send_counter++;
+  pkt->secs    = (uint32_t) now.sec;
+  pkt->usecs   = (uint32_t) now.usec;
+  pkt->is_ping = 1;
+  strncpy(pkt->origin, Private_group, MAX_GROUP_NAME);
+
+  Ret = SP_multicast(Mbox, Send_service_type, Group, 0, Num_bytes, Send_mess.mess);
+
+  if (Ret != Num_bytes)
+  {
+    if (Ret < 0)
+      SP_error(Ret);
+    
+    else
+      fprintf(stderr, "Bytes sent (%d) != Num_bytes (%d)?!\n", Ret, Num_bytes);
+    
+    exit(1);
+  }
+
+  E_queue(send_ping, 0, NULL, SP_period);
+}
+
+static void recv_from_spread(int dmy_fd, int dmy_code, void *dmy_data)
+{
+  ping_pkt *pkt = &Recv_mess.ping;
+  
+  Ret = SP_receive(Mbox, (Service_type = 0, &Service_type), Sender, SPPING_MAX_GROUPS, &Num_groups, Ret_groups, 
+                   &Mess_type, &Endian_mismatch, sizeof(Recv_mess), Recv_mess.mess);
+            
+  if (Ret < 0)
+    SP_error(Ret), exit(1);
+
+  if (!Is_regular_mess(Service_type))
+    return;
+  
+  if (pkt->is_ping)
+  {
+    int ret;
+    
+    /* recvd a ping: turn is_ping off and reflect it back to sender with same contents, size, service_type, etc. */
+    
+    pkt->is_ping = 0;
+    
+    ret = SP_multicast(Mbox, Service_type, Sender, 0, Ret, Recv_mess.mess);
+    
+    if (ret != Ret)
+    {
+      if (ret < 0)
+        SP_error(ret);
+      
+      else
+        fprintf(stderr, "Bytes sent (%d) != Ret (%d)?!\n", ret, Ret);
+      
+      exit(1);
+    }
+  }
+  else if (!strncmp(pkt->origin, Private_group, MAX_GROUP_NAME))
+  {
+    sp_time now = E_get_time();
+    long    us  = ((long) now.sec - (long) pkt->secs) * 1000000L + ((long) now.usec - (long) pkt->usecs);
+    
+    /* got a pong back from one of our pings */
+
+    printf("%d bytes from %s: seq = %d time = %.3f ms\n", Ret, Sender, pkt->seq, us / 1000.0);
+
+    if (Samples_num >= Samples_size)
+    {
+      long *new_samps;
+      
+      Samples_size = (Samples_size != 0 ? Samples_size * 2 : 256);
+      
+      if ((new_samps = realloc(Samples, sizeof(long) * Samples_size)) == NULL)
+      {
+        fprintf(stderr, "\nrealloc(%lu) failed!\n", (unsigned long) sizeof(long) * Samples_size);
+        E_exit_events();
+        return;
+      }
+
+      Samples = new_samps;
+    }
+
+    Samples[Samples_num++] = us;
+  }
+}
+
+int main(int argc, char *argv[])
+{
+  signal(SIGINT, catch_signal);
+  signal(SIGTERM, catch_signal);
+  
+  E_init();
+
+  Usage(argc, argv);
+
+  printf("spping: connecting to '%s'\n", Spread_name);
+  
+  if ((Ret = SP_connect(Spread_name, User, 0, 1, &Mbox, Private_group)) < 0) 
+    SP_error(Ret), exit(1);
+
+  printf("spping: connected as '%s'\n", Private_group);
+  E_attach_fd(Mbox, READ_FD, recv_from_spread, 0, 0, HIGH_PRIORITY);
+  
+  if ((Ret = SP_join(Mbox, Group)) < 0)
+    SP_error(Ret), exit(1);
+
+  if (Read_only)
+    printf("spping: only reflecting pings!\n");
+  
+  else
+  {
+    printf("PING %s: %d data bytes\n", Group, Num_bytes);
+    send_ping(0, NULL);
+  }
+  
+  E_handle_events();
+
+  compute_print_stats();
+
+  return 0;
+}

Modified: trunk/include/sp.h
===================================================================
--- trunk/include/sp.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/include/sp.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -38,7 +38,6 @@
 #ifndef INC_SP
 #define INC_SP
 
-/* for size_t */
 #include <stddef.h>
 
 #ifdef __cplusplus
@@ -48,9 +47,9 @@
 #define 	int16	short
 #define		int32	int
 
-#define		Flip_int16( type )	( ( (type >> 8) & 0x00ff) | ( (type << 8) & 0xff00) )
+#define		Flip_int16( t )	( ( ( (t) >> 8 ) & 0x00ff ) | ( ( (t) << 8 ) & 0xff00 ) )
 
-#define		Flip_int32( type )	( ( (type >>24) & 0x000000ff) | ( (type >> 8) & 0x0000ff00) | ( (type << 8) & 0x00ff0000) | ( (type <<24) & 0xff000000) )
+#define		Flip_int32( t )	( ( ( (t) >> 24 ) & 0x000000ff ) | ( ( (t) >> 8 ) & 0x0000ff00 ) | ( ( (t) << 8 ) & 0x00ff0000 ) | ( ( (t) << 24 ) & 0xff000000 ) )
 
 /* Events priorities */
 
@@ -62,11 +61,11 @@
 
 #define		DEFAULT_SPREAD_PORT	4803
 
-#define         SPREAD_VERSION          ( (4 << 24) | ( 4 << 16) | 0 )
+#define         SPREAD_VERSION          ( (5 << 24) | (0 << 16) | 0 )
 
 #define		MAX_GROUP_NAME		32
 #define         MAX_PRIVATE_NAME        10 /* largest possible size of private_name field of SP_connect() */
-#define         MAX_PROC_NAME           20 /* largest possible size of process name of daemon */
+#define         MAX_PROC_NAME           20 /* largest possible size of process name of daemon (includes nul terminator) */
 
 #define         UNRELIABLE_MESS         0x00000001
 #define         RELIABLE_MESS           0x00000002
@@ -91,48 +90,48 @@
 #define         RESERVED                0x003fc000
 #define         REJECT_MESS             0x00400000
 
-#define         Is_unreliable_mess( type )     		( type &  UNRELIABLE_MESS      )
-#define         Is_reliable_mess( type )       		( type &  RELIABLE_MESS        )
-#define         Is_fifo_mess( type )         		( type &  FIFO_MESS            )
-#define         Is_causal_mess( type )          	( type &  CAUSAL_MESS          )
-#define         Is_agreed_mess( type )          	( type &  AGREED_MESS          )
-#define         Is_safe_mess( type )            	( type &  SAFE_MESS            )
-#define         Is_regular_mess( type )         	( (type &  REGULAR_MESS) && !(type & REJECT_MESS)  )
+#define         Is_unreliable_mess( t )         ( (t) &  UNRELIABLE_MESS      )
+#define         Is_reliable_mess( t )           ( (t) &  RELIABLE_MESS        )
+#define         Is_fifo_mess( t )               ( (t) &  FIFO_MESS            )
+#define         Is_causal_mess( t )             ( (t) &  CAUSAL_MESS          )
+#define         Is_agreed_mess( t )             ( (t) &  AGREED_MESS          )
+#define         Is_safe_mess( t )               ( (t) &  SAFE_MESS            )
+#define         Is_regular_mess( t )            ( ( (t) &  REGULAR_MESS ) && !( (t) & REJECT_MESS ) )
 
-#define         Is_self_discard( type )         	( type &  SELF_DISCARD         )
+#define         Is_self_discard( t )            ( (t) &  SELF_DISCARD         )
 
-#define         Is_reg_memb_mess( type )        	( type &  REG_MEMB_MESS        )
-#define         Is_transition_mess( type )      	( type &  TRANSITION_MESS      )
-#define         Is_caused_join_mess( type )     	( type &  CAUSED_BY_JOIN       )
-#define         Is_caused_leave_mess( type )    	( type &  CAUSED_BY_LEAVE      )
-#define         Is_caused_disconnect_mess( type )	( type &  CAUSED_BY_DISCONNECT )
-#define         Is_caused_network_mess( type )		( type &  CAUSED_BY_NETWORK )
-#define         Is_membership_mess( type )      	( (type &  MEMBERSHIP_MESS) && !(type & REJECT_MESS) )
+#define         Is_reg_memb_mess( t )           ( (t) &  REG_MEMB_MESS        )
+#define         Is_transition_mess( t )         ( (t) &  TRANSITION_MESS      )
+#define         Is_caused_join_mess( t )        ( (t) &  CAUSED_BY_JOIN       )
+#define         Is_caused_leave_mess( t )       ( (t) &  CAUSED_BY_LEAVE      )
+#define         Is_caused_disconnect_mess( t )  ( (t) &  CAUSED_BY_DISCONNECT )
+#define         Is_caused_network_mess( t )     ( (t) &  CAUSED_BY_NETWORK    )
+#define         Is_membership_mess( t )         ( ( (t) &  MEMBERSHIP_MESS ) && !( (t) & REJECT_MESS ) )
 
-#define         Is_reject_mess( type )          	( type &  REJECT_MESS          )
+#define         Is_reject_mess( t )             ( (t) &  REJECT_MESS          )
 
-#define         Is_self_leave( type )   (( (type) & CAUSED_BY_LEAVE) && !( (type) & (REG_MEMB_MESS | TRANSITION_MESS)))
+#define         Is_self_leave( t )              ( ( (t) & CAUSED_BY_LEAVE ) && !( (t) & ( REG_MEMB_MESS | TRANSITION_MESS ) ) )
 
-#define         ACCEPT_SESSION           1
-#define		ILLEGAL_SPREAD		-1
-#define		COULD_NOT_CONNECT	-2
-#define         REJECT_QUOTA            -3
-#define         REJECT_NO_NAME          -4
-#define         REJECT_ILLEGAL_NAME     -5
-#define         REJECT_NOT_UNIQUE       -6
-#define         REJECT_VERSION		-7
-#define         CONNECTION_CLOSED	-8
-#define         REJECT_AUTH             -9
+#define         ACCEPT_SESSION          (1)
+#define		ILLEGAL_SPREAD		(-1)
+#define		COULD_NOT_CONNECT	(-2)
+#define         REJECT_QUOTA            (-3)
+#define         REJECT_NO_NAME          (-4)
+#define         REJECT_ILLEGAL_NAME     (-5)
+#define         REJECT_NOT_UNIQUE       (-6)
+#define         REJECT_VERSION		(-7)
+#define         CONNECTION_CLOSED	(-8)
+#define         REJECT_AUTH             (-9)
 
-#define		ILLEGAL_SESSION		-11
-#define		ILLEGAL_SERVICE		-12
-#define		ILLEGAL_MESSAGE		-13
-#define		ILLEGAL_GROUP		-14
-#define		BUFFER_TOO_SHORT	-15
-#define         GROUPS_TOO_SHORT        -16
-#define         MESSAGE_TOO_LONG        -17
-#define         NET_ERROR_ON_SESSION    -18
-#define         SP_BUG                  -19
+#define		ILLEGAL_SESSION		(-11)
+#define		ILLEGAL_SERVICE		(-12)
+#define		ILLEGAL_MESSAGE		(-13)
+#define		ILLEGAL_GROUP		(-14)
+#define		BUFFER_TOO_SHORT	(-15)
+#define         GROUPS_TOO_SHORT        (-16)
+#define         MESSAGE_TOO_LONG        (-17)
+#define         NET_ERROR_ON_SESSION    (-18)
+#define         SP_BUG                  (-19)
 
 #define		MAX_CLIENT_SCATTER_ELEMENTS	100
 

Deleted: trunk/include/sp_events.h
===================================================================
--- trunk/include/sp_events.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/include/sp_events.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -1,106 +0,0 @@
-/*
- * The Spread Toolkit.
- *     
- * The contents of this file are subject to the Spread Open-Source
- * License, Version 1.0 (the ``License''); you may not use
- * this file except in compliance with the License.  You may obtain a
- * copy of the License at:
- *
- * http://www.spread.org/license/
- *
- * or in the file ``license.txt'' found in this distribution.
- *
- * Software distributed under the License is distributed on an AS IS basis, 
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
- * for the specific language governing rights and limitations under the 
- * License.
- *
- * The Creators of Spread are:
- *  Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz.
- *
- *  Copyright (C) 1993-2014 Spread Concepts LLC <info at spreadconcepts.com>
- *
- *  All Rights Reserved.
- *
- * Major Contributor(s):
- * ---------------
- *    Amy Babay            babay at cs.jhu.edu - accelerated ring protocol.
- *    Ryan Caudy           rcaudy at gmail.com - contributions to process groups.
- *    Claudiu Danilov      claudiu at acm.org - scalable wide area support.
- *    Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
- *    Theo Schlossnagle    jesus at omniti.com - Perl, autoconf, old skiplist.
- *    Dan Schoenblum       dansch at cnds.jhu.edu - Java interface.
- *
- */
-
-
-
-#ifndef	INC_SP_EVENTS
-#define	INC_SP_EVENTS
-
-/*
-  User level code should NOT include this file directly. 
-  Include sp.h instead.
-  Spread daemon level code should include this file directly and NOT include sp.h
-*/ 
-
-
-/* Raise this number AND RECOMPILE events.c to handle more active FD's. 
- * This number limits the number of connections that 
- * can be handled.
- */
-#define		MAX_FD_EVENTS		 2000
-
-#define		NUM_PRIORITY	3
-
-#define		LOW_PRIORITY	0
-#define		MEDIUM_PRIORITY	1
-#define		HIGH_PRIORITY	2
-
-#define		NUM_FDTYPES	3
-
-#define		READ_FD		0
-#define		WRITE_FD	1
-#define		EXCEPT_FD	2
-
-
-typedef struct dummy_time {
-	long	sec;
-	long	usec;
-} sp_time;
-
-#ifndef NULL
-#define NULL    (void *)0
-#endif
-
-/* Event routines */
-
-int 	E_init(void);
-sp_time	E_get_time(void);
-sp_time	E_sub_time( sp_time t, sp_time delta_t );
-sp_time	E_add_time( sp_time t, sp_time delta_t );
-/* if t1 > t2 then returns 1;
-   if t1 < t2 then returns -1;
-   if t1 == t2 then returns 0; */
-int	E_compare_time( sp_time t1, sp_time t2 );
-int 	E_queue( void (* func)( int code, void *data ), int code, void *data,
-		 sp_time delta_time );
-/* Note: This does not dispose/free the data pointed at by the void
-   *data pointer */
-int 	E_dequeue( void (* func)( int code, void *data ), int code,
-		   void *data );
-void	E_delay( sp_time t );
-
-int	E_attach_fd( int fd, int fd_type,
-		     void (* func)( int fd, int code, void *data), int code,
-		     void *data, int priority );
-int 	E_detach_fd( int fd, int fd_type );
-int 	E_set_active_threshold( int priority );
-int     E_activate_fd( int fd, int fd_type );
-int     E_deactivate_fd( int fd, int fd_type );
-int	E_num_active( int priority );
-
-void 	E_handle_events(void);
-void 	E_exit_events(void);
-
-#endif	/* INC_SP_EVENTS */

Copied: trunk/include/sp_events.h (from rev 845, branches/spread_5/include/sp_events.h)
===================================================================
--- trunk/include/sp_events.h	                        (rev 0)
+++ trunk/include/sp_events.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -0,0 +1 @@
+link ../libspread-util/include/spu_events.h
\ No newline at end of file

Modified: trunk/include/sp_func.h
===================================================================
--- trunk/include/sp_func.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/include/sp_func.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -123,4 +123,6 @@
 
 int	SP_equal_group_ids( group_id g1, group_id g2 );
 
+const char *SP_strerror( int error );
+  
 void	SP_error( int error );

Modified: trunk/libspread/sp.c
===================================================================
--- trunk/libspread/sp.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread/sp.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -33,9 +33,8 @@
  *
  */
 
+#include "arch.h"
 
-
-#include "arch.h"
 #include <string.h>
 #include <stdio.h>
 
@@ -56,7 +55,7 @@
 
 #else	/* ARCH_PC_WIN95 */
 
-#include <winsock.h>
+#include <winsock2.h>
 #define ioctl   ioctlsocket
 
 	WSADATA		WSAData;
@@ -69,6 +68,7 @@
 #include "sess_types.h"
 #include "spu_scatter.h"
 #include "spu_alarm.h"
+#include "spu_addr.h"
 #include "acm.h"
 
 /* SP functions need these types, but internal headers do not */
@@ -86,6 +86,16 @@
 
 #include "sp_func.h"
 
+#ifndef ARCH_PC_WIN95
+#  define GAI_STRERROR(e) gai_strerror(e)
+#  ifndef INVALID_SOCKET
+#    define INVALID_SOCKET (-1)
+#  elif INVALID_SOCKET != -1
+#  endif
+#else
+#  define GAI_STRERROR(e) sock_strerror(e)  /* NOTE: gai_strerror is not thread safe on win32 */
+#endif
+
 enum sp_sess_state {
     SESS_UNUSED,
     SESS_ACTIVE,
@@ -109,13 +119,13 @@
 };
 
 /* length of spread_name connect field is limited to 5 digit port # + '@' + hostname */
-#define SPREAD_MAXCONNECT_NAMELEN       MAXHOSTNAMELEN + 6
+#define SPREAD_MAXCONNECT_NAMELEN       (MAXHOSTNAMELEN + 6)
 
 /* default spread connection method depends on whether unix sockets are available */
 #ifndef ARCH_PC_WIN95
-# define DEFAULT_SPREAD_CONNECTION      QQ(DEFAULT_SPREAD_PORT)
+#  define DEFAULT_SPREAD_CONNECTION      QQ(DEFAULT_SPREAD_PORT)
 #else
-# define DEFAULT_SPREAD_CONNECTION      QQ(DEFAULT_SPREAD_PORT) "@localhost"
+#  define DEFAULT_SPREAD_CONNECTION      QQ(DEFAULT_SPREAD_PORT) "@localhost"
 #endif	/* ARCH_PC_WIN95 */
 
 static  int     sp_null_authenticate(int, void *);
@@ -558,7 +568,6 @@
 		    int priority, int group_membership, mailbox *mbox,
 		    char *private_group, sp_time time_out )
 {
-	struct	hostent	       *host_ptr;
 	int16u			port;
 	char			host_name[SPREAD_MAXCONNECT_NAMELEN + 1];
 	char			conn[MAX_PRIVATE_NAME+5];
@@ -577,10 +586,14 @@
 	char		        cval;
 	int32			on;
 
-	struct sockaddr_in	inet_addr;
-	struct sockaddr        *sock_addr = NULL;
-	int                     sock_len;
-	
+        spu_addr                addr      = { 0 };
+	struct sockaddr        *sock_addr;
+	socklen_t               sock_len;
+
+        struct addrinfo         hint = { 0 };
+        struct addrinfo        *rslt = NULL;
+        struct addrinfo        *curr;
+
 #ifndef	ARCH_PC_WIN95
 	struct	sockaddr_un	unix_addr;
 #endif	/* ARCH_PC_WIN95 */
@@ -596,10 +609,12 @@
 	 */
 
 	/* options NULL and "" */
-	if( spread_name == NULL || !strcmp( spread_name, "" ) ) spread_name = DEFAULT_SPREAD_CONNECTION;
+	if( spread_name == NULL || !strcmp( spread_name, "" ) )
+          spread_name = DEFAULT_SPREAD_CONNECTION;
 
 	/* ensure sscanf is safe */
-	if( strlen( spread_name ) >= sizeof( host_name ) ) return( ILLEGAL_SPREAD );
+	if( strlen( spread_name ) >= sizeof( host_name ) )
+          return( ILLEGAL_SPREAD );
 
 	switch ( sscanf( spread_name, "%hu%s", &port, host_name ) )
 	{
@@ -613,7 +628,7 @@
 		sock_len  = sizeof( unix_addr );
 
 		s = socket( AF_UNIX, SOCK_STREAM, 0 );
-		if( s < 0 )
+		if( s == INVALID_SOCKET )
 		{
 			Alarm( DEBUG, "SP_connect: unable to create mailbox %d\n", s );
 			return( COULD_NOT_CONNECT );
@@ -630,20 +645,62 @@
 
 		if( host_name[0] != '@' ) return( ILLEGAL_SPREAD );
 
-		host_ptr = gethostbyname( host_name + 1 );
-		if( host_ptr == NULL ) return( ILLEGAL_SPREAD );
+                hint.ai_family   = PF_UNSPEC;
+                hint.ai_socktype = SOCK_STREAM;
+                hint.ai_protocol = IPPROTO_TCP;
+                hint.ai_flags    = 0;
 
-		memset( &inet_addr, 0, sizeof( inet_addr ) );
-		inet_addr.sin_family = AF_INET;
-		inet_addr.sin_port   = htons( port );
-		memcpy( &inet_addr.sin_addr, host_ptr->h_addr, sizeof( int32 ) );
-		sock_addr = (struct sockaddr *) &inet_addr;
-		sock_len  = sizeof(inet_addr);
+                if ((ret = getaddrinfo(host_name + 1, NULL, &hint, &rslt)) || rslt == NULL)
+                {
+                  Alarm(DEBUG, "SP_connect: getaddrinfo(%s) failed with %d '%s'\n", host_name + 1, ret, GAI_STRERROR(ret));
+                 
+                  if (ret == EAI_NONAME)
+                    return ILLEGAL_SPREAD;
 
-		s = socket( AF_INET, SOCK_STREAM, 0 );
-		if( s < 0 )
+                  return COULD_NOT_CONNECT;
+                }
+
+                for (curr = rslt; curr != NULL; curr = curr->ai_next)
+                {
+                  if (curr->ai_addr == NULL)
+                    continue;
+                  
+                  switch (curr->ai_addr->sa_family)
+                  {
+                  case AF_INET:
+                    addr.ipv4           = *(struct sockaddr_in*) curr->ai_addr;
+                    addr.ipv4.sin_port  = htons(port);
+                    sock_len            = sizeof(struct sockaddr_in);
+                    break;
+                    
+                  case AF_INET6:
+                    addr.ipv6           = *(struct sockaddr_in6*) curr->ai_addr;
+                    addr.ipv6.sin6_port = htons(port);
+                    sock_len            = sizeof(struct sockaddr_in6);
+                    break;
+
+                  default:
+                    continue;
+                  }
+                    
+                  break;
+                }
+                
+                freeaddrinfo(rslt);
+                
+                if (curr == NULL)
+                {
+                  Alarm(DEBUG, "SP_connect: getaddrinfo(%s) didn't return any usable internet addresses!\n");
+                  return COULD_NOT_CONNECT;
+                }
+
+                sock_addr = &addr.addr;
+                
+		s = socket( sock_addr->sa_family, SOCK_STREAM, 0 );
+                
+		if( s == INVALID_SOCKET )
 		{
-			Alarm( DEBUG, "SP_connect: unable to create mailbox %d\n", s );
+                        Alarm( DEBUG, "SP_connect: unable to create mailbox %d %d '%s'\n", s, sock_errno, sock_strerror(sock_errno) );
 			return( COULD_NOT_CONNECT );
 		}
 
@@ -2047,7 +2104,8 @@
 
 	ses = SP_get_session( mbox );
 
-	if( ses < 0 ){ 
+	if( ses < 0 )
+        { 
 		Alarm( SESSION, "SP_kill: killing a non existent session for mailbox %d (likely race condition)!!!\n", mbox );
 		Mutex_unlock( &Struct_mutex );
 		return;
@@ -2067,8 +2125,8 @@
         int ses      = MBOX_TO_BASE_SES(mbox);
         int base_ses = ses;
 
-	while( Sessions[ses].mbox != mbox ) {
-
+	while( Sessions[ses].mbox != mbox )
+        {
 	        if( ++ses == MAX_LIB_SESSIONS ) {
 		        ses = 0;         /* wrap around to beginning of array */
 		}
@@ -2082,69 +2140,40 @@
 	return ses;
 }
 
-void	SP_error( int error )
+const char *SP_strerror( int error )
 {
+        const char *ret = "Unrecognized error.";
+        
 	switch( error )
 	{
-		case ILLEGAL_SPREAD:
-			Alarm( PRINT, "SP_error: (%d) Illegal spread was provided\n", error );
-			break;
-		case COULD_NOT_CONNECT:
-			Alarm( PRINT, "SP_error: (%d) Could not connect. Is Spread running?\n", error );
-			break;
-		case REJECT_QUOTA:
-			Alarm( PRINT, "SP_error: (%d) Connection rejected, too many users\n", error );
-			break;
-		case REJECT_NO_NAME:
-			Alarm( PRINT, "SP_error: (%d) Connection rejected, no name was supplied\n", error );
-			break;
-		case REJECT_ILLEGAL_NAME:
-			Alarm( PRINT, "SP_error: (%d) Connection rejected, illegal name\n", error );
-			break;
-		case REJECT_NOT_UNIQUE:
-			Alarm( PRINT, "SP_error: (%d) Connection rejected, name not unique\n", error );
-			break;
-		case REJECT_VERSION:
-			Alarm( PRINT, "SP_error: (%d) Connection rejected, library does not fit daemon\n", error );
-			break;
-		case CONNECTION_CLOSED:
-			Alarm( PRINT, "SP_error: (%d) Connection closed by spread\n", error );
-			break;
-		case REJECT_AUTH:
-			Alarm( PRINT, "SP_error: (%d) Connection rejected, authentication failed\n", error );
-			break;
-		case ILLEGAL_SESSION:
-			Alarm( PRINT, "SP_error: (%d) Illegal session was supplied\n", error );
-			break;
-		case ILLEGAL_SERVICE:
-			Alarm( PRINT, "SP_error: (%d) Illegal service request\n", error );
-			break;
-		case ILLEGAL_MESSAGE:
-			Alarm( PRINT, "SP_error: (%d) Illegal message\n", error );
-			break;
-		case ILLEGAL_GROUP:
-			Alarm( PRINT, "SP_error: (%d) Illegal group\n", error );
-			break;
-		case BUFFER_TOO_SHORT:
-			Alarm( PRINT, "SP_error: (%d) The supplied buffer was too short\n", error );
-			break;
-		case GROUPS_TOO_SHORT:
-			Alarm( PRINT, "SP_error: (%d) The supplied groups list was too short\n", error );
-			break;
-		case MESSAGE_TOO_LONG:
-			Alarm( PRINT, "SP_error: (%d) The message body + group names was too large to fit in a message\n", error );
-			break;
-		case NET_ERROR_ON_SESSION:
-			Alarm( PRINT, "SP_error: (%d) The network socket experienced an error. This Spread mailbox will no longer work until the connection is disconnected and then reconnected\n", error );
-			break;
-	        case SP_BUG:
-		        Alarm(PRINT, "SP_error: (%d) Internal spread bug detected!\n", error);
-			break;
-		default:
-			Alarm( PRINT, "SP_error: (%d) unrecognized error\n", error );
+        case ILLEGAL_SPREAD:       ret = "Illegal spread name provided.";                                 break;
+        case COULD_NOT_CONNECT:    ret = "Could not connect.";                                            break;
+        case REJECT_QUOTA:         ret = "Connection rejected, too many users.";                          break;
+        case REJECT_NO_NAME:       ret = "Connection rejected, no name was supplied.";                    break;
+        case REJECT_ILLEGAL_NAME:  ret = "Connection rejected, illegal name.";                            break;
+        case REJECT_NOT_UNIQUE:    ret = "Connection rejected, name not unique.";                         break;
+        case REJECT_VERSION:       ret = "Connection rejected, client library incompatible with daemon."; break;
+        case CONNECTION_CLOSED:    ret = "Connection closed by Spread.";                                  break;
+        case REJECT_AUTH:          ret = "Connection rejected, authentication failed.";                   break;
+        case ILLEGAL_SESSION:      ret = "Illegal session was supplied.";                                 break;
+        case ILLEGAL_SERVICE:      ret = "Illegal service request.";                                      break;
+        case ILLEGAL_MESSAGE:      ret = "Illegal message.";                                              break;
+        case ILLEGAL_GROUP:        ret = "Illegal group.";                                                break;
+        case BUFFER_TOO_SHORT:     ret = "Buffer too short.";                                             break;
+        case GROUPS_TOO_SHORT:     ret = "Groups list too short.";                                        break;
+        case MESSAGE_TOO_LONG:     ret = "Message (body + group names) too large.";                       break;
+        case NET_ERROR_ON_SESSION: ret = "Network socket error. SP_kill() the mailbox.";                  break;
+        case SP_BUG:               ret = "Internal Spread bug detected.";                                 break;
 	}
+
+        return ret;
 }
 
+void	SP_error( int error )
+{
+        Alarm(PRINT, "SP_error: (%d) %s\n", error, SP_strerror(error));
+}
+
 static	void    Flip_mess( message_header *head_ptr )
 {
 	head_ptr->type     	= Flip_int32( head_ptr->type );

Modified: trunk/libspread-util/configure
===================================================================
--- trunk/libspread-util/configure	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread-util/configure	2016-11-14 17:40:56 UTC (rev 861)
@@ -1,18 +1,20 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.62 for Spread_Util 4.3.0.
+# Generated by GNU Autoconf 2.69 for Spread_Util 4.3.0.
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
 
 # Be more Bourne compatible
 DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
@@ -20,23 +22,15 @@
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
 esac
-
 fi
 
 
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
 as_nl='
 '
 export as_nl
@@ -44,7 +38,13 @@
 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
   as_echo='printf %s\n'
   as_echo_n='printf %s'
 else
@@ -55,7 +55,7 @@
     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
     as_echo_n_body='eval
       arg=$1;
-      case $arg in
+      case $arg in #(
       *"$as_nl"*)
 	expr "X$arg" : "X\\(.*\\)$as_nl";
 	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
@@ -78,14 +78,7 @@
   }
 fi
 
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
 
-
 # IFS
 # We need space, tab and new line, in precisely that order.  Quoting is
 # there to prevent editors from complaining about space-tab.
@@ -94,15 +87,16 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-case $0 in
+as_myself=
+case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
 IFS=$as_save_IFS
 
      ;;
@@ -114,12 +108,16 @@
 fi
 if test ! -f "$as_myself"; then
   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  { (exit 1); exit 1; }
+  exit 1
 fi
 
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
 done
 PS1='$ '
 PS2='> '
@@ -131,330 +129,344 @@
 LANGUAGE=C
 export LANGUAGE
 
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-
 # CDPATH.
-$as_unset CDPATH
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
-  if (eval ":") 2>/dev/null; then
-  as_have_required=yes
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
 else
-  as_have_required=no
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
 fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
 
-  if test $as_have_required = yes &&	 (eval ":
-(as_func_return () {
-  (exit \$1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
-
 exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
-fi
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
-  :
 else
-  exitcode=1
-  echo as_func_ret_success failed.
+  exitcode=1; echo positional parameters were not saved.
 fi
-
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
-  :
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
 else
-  exitcode=1
-  echo positional parameters were not saved.
+  as_have_required=no
 fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
 
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
-  as_lineno_1=\$LINENO
-  as_lineno_2=\$LINENO
-  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
-  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
-  :
 else
-  as_candidate_shells=
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  case $as_dir in
+  as_found=:
+  case $as_dir in #(
 	 /*)
 	   for as_base in sh bash ksh sh5; do
-	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
 	   done;;
        esac
+  as_found=false
 done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
 IFS=$as_save_IFS
 
 
-      for as_shell in $as_candidate_shells $SHELL; do
-	 # Try only shells that exist, to save several forks.
-	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
-		{ ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
+      if test "x$CONFIG_SHELL" != x; then :
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
 esac
-
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
-
-:
-_ASEOF
-}; then
-  CONFIG_SHELL=$as_shell
-	       as_have_required=yes
-	       if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
-esac
-
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf at gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
 fi
-
-
-:
-(as_func_return () {
-  (exit $1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
-
-exitcode=0
-if as_func_success; then
-  :
-else
-  exitcode=1
-  echo as_func_success failed.
 fi
-
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
 fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
 
-if as_func_ret_success; then
-  :
-else
-  exitcode=1
-  echo as_func_ret_success failed.
-fi
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
 
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
 
-if ( set x; as_func_ret_success y && test x = "$1" ); then
-  :
-else
-  exitcode=1
-  echo positional parameters were not saved.
-fi
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
 
-test $exitcode = 0) || { (exit 1); exit 1; }
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
 
-(
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
 
-_ASEOF
-}; then
-  break
-fi
 
-fi
+} # as_fn_mkdir_p
 
-      done
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
 
-      if test "x$CONFIG_SHELL" != x; then
-  for as_var in BASH_ENV ENV
-	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-	done
-	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
 
 
-    if test $as_have_required = no; then
-  echo This script requires a shell more modern than all the
-      echo shells that I found on your system.  Please install a
-      echo modern shell, or manually run the script under such a
-      echo shell if you do have one.
-      { (exit 1); exit 1; }
-fi
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
 
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
-  (exit \$1)
-}
-as_func_success () {
-  as_func_return 0
-}
-as_func_failure () {
-  as_func_return 1
-}
-as_func_ret_success () {
-  return 0
-}
-as_func_ret_failure () {
-  return 1
-}
-
-exitcode=0
-if as_func_success; then
-  :
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
 else
-  exitcode=1
-  echo as_func_success failed.
+  as_expr=false
 fi
 
-if as_func_failure; then
-  exitcode=1
-  echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
-  :
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
 else
-  exitcode=1
-  echo as_func_ret_success failed.
+  as_basename=false
 fi
 
-if as_func_ret_failure; then
-  exitcode=1
-  echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
-  :
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
 else
-  exitcode=1
-  echo positional parameters were not saved.
+  as_dirname=false
 fi
 
-test \$exitcode = 0") || {
-  echo No shell found that supports shell functions.
-  echo Please tell bug-autoconf at gnu.org about your system,
-  echo including any error possibly output before this message.
-  echo This can help us improve future autoconf versions.
-  echo Configuration will now proceed without shell functions.
-}
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
 
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
 
 
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line after each line using $LINENO; the second 'sed'
-  # does the real work.  The second script uses 'N' to pair each
-  # line-number line with the line containing $LINENO, and appends
-  # trailing '-' during substitution so that $LINENO is not a special
-  # case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # scripts with optimization help from Paolo Bonzini.  Blame Lee
-  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
   sed -n '
     p
     /[$]LINENO/=
@@ -471,9 +483,12 @@
       s/-\n.*//
     ' >$as_me.lineno &&
   chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -482,29 +497,18 @@
   exit
 }
 
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
 ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
+case `echo -n x` in #(((((
 -n*)
-  case `echo 'x\c'` in
+  case `echo 'xy\c'` in
   *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  *)   ECHO_C='\c';;
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
   esac;;
 *)
   ECHO_N='-n';;
 esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
 
 rm -f conf$$ conf$$.exe conf$$.file
 if test -d conf$$.dir; then
@@ -519,49 +523,29 @@
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -570,11 +554,11 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
 
-exec 7<&0 </dev/null 6>&1
-
 # Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
@@ -589,7 +573,6 @@
 subdirs=
 MFLAGS=
 MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
 
 # Identity of this package.
 PACKAGE_NAME='Spread_Util'
@@ -597,6 +580,7 @@
 PACKAGE_VERSION='4.3.0'
 PACKAGE_STRING='Spread_Util 4.3.0'
 PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
 
 # Factoring default headers for most tests.
 ac_includes_default="\
@@ -634,87 +618,88 @@
 # 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
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
-host_os
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-CPP
-GREP
-EGREP
-RANLIB
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-LN_S
-AR
-PERL
-LD
-THLDFLAGS
-THLIBS
-NROFF
-MANTYPE
-mansubdir
-SHCC
-SHCFLAGS
-SHCPPFLAGS
-SHLD
-SHLDFLAGS
-SHLIBS
-LIBSPSO
-SHLDOPTION
-SHLDNAME
-SHLDCONVERTSTATIC
-SHLDCONVERTSTATICEND
+ac_subst_vars='LTLIBOBJS
 LIBOBJS
-LTLIBOBJS'
+SHLDCONVERTSTATICEND
+SHLDCONVERTSTATIC
+SHLDNAME
+SHLDOPTION
+LIBSPSO
+SHLIBS
+SHLDFLAGS
+SHLD
+SHCPPFLAGS
+SHCFLAGS
+SHCC
+mansubdir
+MANTYPE
+NROFF
+THLIBS
+THLDFLAGS
+LD
+PERL
+AR
+LN_S
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+RANLIB
+EGREP
+GREP
+CPP
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
@@ -798,8 +783,9 @@
   fi
 
   case $ac_option in
-  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *)	ac_optarg=yes ;;
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
   esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
@@ -844,8 +830,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
-   { (exit 1); exit 1; }; }
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -871,8 +856,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
-   { (exit 1); exit 1; }; }
+      as_fn_error $? "invalid feature name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1076,8 +1060,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
-   { (exit 1); exit 1; }; }
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1093,8 +1076,7 @@
     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
-   { (exit 1); exit 1; }; }
+      as_fn_error $? "invalid package name: $ac_useropt"
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1124,17 +1106,17 @@
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; }
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
     ;;
 
   *=*)
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-   { (exit 1); exit 1; }; }
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
@@ -1143,7 +1125,7 @@
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -1151,16 +1133,14 @@
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "missing argument to $ac_option"
 fi
 
 if test -n "$ac_unrecognized_opts"; then
   case $enable_option_checking in
     no) ;;
-    fatal) { $as_echo "$as_me: error: Unrecognized options: $ac_unrecognized_opts" >&2
-   { (exit 1); exit 1; }; } ;;
-    *)     $as_echo "$as_me: WARNING: Unrecognized options: $ac_unrecognized_opts" >&2 ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
 fi
 
@@ -1182,8 +1162,7 @@
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -1197,8 +1176,6 @@
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1213,11 +1190,9 @@
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  { $as_echo "$as_me: error: Working directory cannot be determined" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "working directory cannot be determined"
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "pwd does not report name of working directory"
 
 
 # Find the source files, if location was not specified.
@@ -1256,13 +1231,11 @@
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
-   { (exit 1); exit 1; }; }
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
 	pwd)`
 # When building in place, set srcdir=.
 if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1302,7 +1275,7 @@
       --help=short        display options specific to this package
       --help=recursive    display the short help of all the included packages
   -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking...' messages
+  -q, --quiet, --silent   do not print \`checking ...' messages
       --cache-file=FILE   cache test results in FILE [disabled]
   -C, --config-cache      alias for \`--cache-file=config.cache'
   -n, --no-create         do not create output files
@@ -1382,13 +1355,14 @@
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
   LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
+Report bugs to the package provider.
 _ACEOF
 ac_status=$?
 fi
@@ -1452,21 +1426,555 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 Spread_Util configure 4.3.0
-generated by GNU Autoconf 2.62
+generated by GNU Autoconf 2.69
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
   exit
 fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); 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 $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* 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_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if test "$cross_compiling" = yes; then
+    # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=$ac_mid; break
+else
+  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_lo=$ac_mid; break
+else
+  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0;
+return test_array [0];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_hi=$ac_mid
+else
+  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+  else
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (($2) < 0)
+    {
+      long int i = longval ();
+      if (i != ($2))
+	return 1;
+      fprintf (f, "%ld", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ($2))
+	return 1;
+      fprintf (f, "%lu", i);
+    }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+  ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+  fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by Spread_Util $as_me 4.3.0, which was
-generated by GNU Autoconf 2.62.  Invocation command line was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -1502,8 +2010,8 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  $as_echo "PATH: $as_dir"
-done
+    $as_echo "PATH: $as_dir"
+  done
 IFS=$as_save_IFS
 
 } >&5
@@ -1540,9 +2048,9 @@
       ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
-    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
     2)
-      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      as_fn_append ac_configure_args1 " '$ac_arg'"
       if test $ac_must_keep_next = true; then
 	ac_must_keep_next=false # Got value, back to normal.
       else
@@ -1558,13 +2066,13 @@
 	  -* ) ac_must_keep_next=true ;;
 	esac
       fi
-      ac_configure_args="$ac_configure_args '$ac_arg'"
+      as_fn_append ac_configure_args " '$ac_arg'"
       ;;
     esac
   done
 done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
 
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
@@ -1576,11 +2084,9 @@
   {
     echo
 
-    cat <<\_ASBOX
-## ---------------- ##
+    $as_echo "## ---------------- ##
 ## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
     echo
     # The following way of writing the cache mishandles newlines in values,
 (
@@ -1589,13 +2095,13 @@
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-$as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) $as_unset $ac_var ;;
+      *) { eval $ac_var=; unset $ac_var;} ;;
       esac ;;
     esac
   done
@@ -1614,11 +2120,9 @@
 )
     echo
 
-    cat <<\_ASBOX
-## ----------------- ##
+    $as_echo "## ----------------- ##
 ## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
     echo
     for ac_var in $ac_subst_vars
     do
@@ -1631,11 +2135,9 @@
     echo
 
     if test -n "$ac_subst_files"; then
-      cat <<\_ASBOX
-## ------------------- ##
+      $as_echo "## ------------------- ##
 ## File substitutions. ##
-## ------------------- ##
-_ASBOX
+## ------------------- ##"
       echo
       for ac_var in $ac_subst_files
       do
@@ -1649,11 +2151,9 @@
     fi
 
     if test -s confdefs.h; then
-      cat <<\_ASBOX
-## ----------- ##
+      $as_echo "## ----------- ##
 ## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
       echo
       cat confdefs.h
       echo
@@ -1667,46 +2167,53 @@
     exit $exit_status
 ' 0
 for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
 rm -f -r conftest* confdefs.h
 
+$as_echo "/* confdefs.h */" > confdefs.h
+
 # Predefined preprocessor variables.
 
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_NAME "$PACKAGE_NAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_VERSION "$PACKAGE_VERSION"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_STRING "$PACKAGE_STRING"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
 _ACEOF
 
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
 
+
 # Let the site file select an alternate cache file if it wants to.
 # Prefer an explicitly selected file to automatically selected ones.
 ac_site_file1=NONE
 ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  ac_site_file1=$CONFIG_SITE
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
 elif test "x$prefix" != xNONE; then
   ac_site_file1=$prefix/share/config.site
   ac_site_file2=$prefix/etc/config.site
@@ -1717,19 +2224,23 @@
 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
 do
   test "x$ac_site_file" = xNONE && continue
-  if test -r "$ac_site_file"; then
-    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file"
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
 if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special
-  # files actually), so we avoid doing that.
-  if test -f "$cache_file"; then
-    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
 $as_echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . "$cache_file";;
@@ -1737,7 +2248,7 @@
     esac
   fi
 else
-  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
 $as_echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
@@ -1752,11 +2263,11 @@
   eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
-      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
@@ -1766,17 +2277,17 @@
 	ac_old_val_w=`echo x $ac_old_val`
 	ac_new_val_w=`echo x $ac_new_val`
 	if test "$ac_old_val_w" != "$ac_new_val_w"; then
-	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
 	  ac_cache_corrupted=:
 	else
-	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
 	  eval $ac_var=\$ac_old_val
 	fi
-	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
 $as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
-	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
 $as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
       fi;;
   esac
@@ -1788,42 +2299,21 @@
     esac
     case " $ac_configure_args " in
       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
     esac
   fi
 done
 if $ac_cache_corrupted; then
-  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
 fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -1849,9 +2339,7 @@
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in buildtools \"$srcdir\"/buildtools" >&5
-$as_echo "$as_me: error: cannot find install-sh or install.sh in buildtools \"$srcdir\"/buildtools" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in buildtools \"$srcdir\"/buildtools" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
@@ -1868,35 +2356,27 @@
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
 
-{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then
+if ${ac_cv_build+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
 test "x$ac_build_alias" = x &&
   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
 test "x$ac_build_alias" = x &&
-  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-$as_echo "$as_me: error: invalid value of canonical build" >&2;}
-   { (exit 1); exit 1; }; };;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -1912,28 +2392,24 @@
 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
-{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then
+if ${ac_cv_host+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
   ac_cv_host=$ac_cv_build
 else
   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
 fi
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-$as_echo "$as_me: error: invalid value of canonical host" >&2;}
-   { (exit 1); exit 1; }; };;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -1965,9 +2441,9 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -1978,24 +2454,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
 $as_echo "$CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -2005,9 +2481,9 @@
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2018,24 +2494,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
 $as_echo "$ac_ct_CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -2044,12 +2520,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -2062,9 +2534,9 @@
           if test -n "$ac_tool_prefix"; then
     # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2075,24 +2547,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
 $as_echo "$CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -2102,9 +2574,9 @@
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2116,18 +2588,18 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_CC="cc"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
@@ -2146,10 +2618,10 @@
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
 $as_echo "$CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -2161,9 +2633,9 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2174,24 +2646,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
 $as_echo "$CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -2205,9 +2677,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2218,24 +2690,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
 $as_echo "$ac_ct_CC" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -2248,12 +2720,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -2263,55 +2731,37 @@
 fi
 
 
-test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
-$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
 set X $ac_compile
 ac_compiler=$2
-{ (ac_try="$ac_compiler --version >&5"
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler --version >&5") 2>&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler -v >&5") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compiler -V >&5") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
 
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2327,8 +2777,8 @@
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 
 # The possible output files:
@@ -2344,17 +2794,17 @@
 done
 rm -f $ac_rmfiles
 
-if { (ac_try="$ac_link_default"
+if { { ac_try="$ac_link_default"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_link_default") 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
 # in a Makefile.  We should not override ac_cv_exeext if it was cached,
@@ -2371,7 +2821,7 @@
 	# certainly right.
 	break;;
     *.* )
-        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
 	then :; else
 	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 	fi
@@ -2390,80 +2840,41 @@
 else
   ac_file=''
 fi
-
-{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-if test -z "$ac_file"; then
-  $as_echo "$as_me: failed program was:" >&5
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
 ac_exeext=$ac_cv_exeext
 
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
-  if { ac_try='./$ac_file'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-  fi
-fi
-{ $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-
 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
 $as_echo_n "checking for suffix of executables... " >&6; }
-if { (ac_try="$ac_link"
+if { { ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
 # work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -2478,30 +2889,83 @@
   esac
 done
 else
-  { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
 fi
-
-rm -f conftest$ac_cv_exeext
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
 $as_echo "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then
+if ${ac_cv_objext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2513,17 +2977,17 @@
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
+if { { ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_compile") 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   for ac_file in conftest.o conftest.obj conftest.*; do
   test -f "$ac_file" || continue;
   case $ac_file in
@@ -2536,29 +3000,23 @@
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
 fi
-
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
 $as_echo "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2572,37 +3030,16 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_compiler_gnu=no
+  ac_compiler_gnu=no
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
 if test $ac_compiler_gnu = yes; then
   GCC=yes
@@ -2611,20 +3048,16 @@
 fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
    ac_c_werror_flag=yes
    ac_cv_prog_cc_g=no
    CFLAGS="-g"
-   cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2635,35 +3068,11 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_g=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	CFLAGS=""
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2674,36 +3083,12 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_compile "$LINENO"; then :
 
-	ac_c_werror_flag=$ac_save_c_werror_flag
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
 	 CFLAGS="-g"
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2714,42 +3099,17 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_g=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
 $as_echo "$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
@@ -2766,23 +3126,18 @@
     CFLAGS=
   fi
 fi
-{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -2834,32 +3189,9 @@
 	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+  if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_c89=$ac_arg
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext
   test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
@@ -2870,17 +3202,19 @@
 # AC_CACHE_VAL
 case "x$ac_cv_prog_cc_c89" in
   x)
-    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
 $as_echo "none needed" >&6; } ;;
   xno)
-    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
 $as_echo "unsupported" >&6; } ;;
   *)
     CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
 esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
 
+fi
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -2894,14 +3228,14 @@
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
 $as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -2916,11 +3250,7 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -2929,78 +3259,34 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
 
+else
   # Broken: fails on valid input.
 continue
 fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-rm -f conftest.err conftest.$ac_ext
-
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-rm -f conftest.err conftest.$ac_ext
-
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
   break
 fi
 
@@ -3012,7 +3298,7 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
 $as_echo "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
@@ -3023,11 +3309,7 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -3036,85 +3318,40 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
 
+else
   # Broken: fails on valid input.
 continue
 fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-rm -f conftest.err conftest.$ac_ext
-
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-rm -f conftest.err conftest.$ac_ext
-
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
 else
-  { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -3124,9 +3361,9 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
+if ${ac_cv_path_GREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -3137,10 +3374,10 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_prog in grep ggrep; do
+    for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -3157,7 +3394,7 @@
     $as_echo 'GREP' >> "conftest.nl"
     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    ac_count=`expr $ac_count + 1`
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
     if test $ac_count -gt ${ac_path_GREP_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_GREP="$ac_path_GREP"
@@ -3172,26 +3409,24 @@
       $ac_path_GREP_found && break 3
     done
   done
-done
+  done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_GREP"; then
-    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_GREP=$GREP
 fi
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
 $as_echo "$ac_cv_path_GREP" >&6; }
  GREP="$ac_cv_path_GREP"
 
 
-{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
+if ${ac_cv_path_EGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -3205,10 +3440,10 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_prog in egrep; do
+    for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -3225,7 +3460,7 @@
     $as_echo 'EGREP' >> "conftest.nl"
     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    ac_count=`expr $ac_count + 1`
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_EGREP="$ac_path_EGREP"
@@ -3240,12 +3475,10 @@
       $ac_path_EGREP_found && break 3
     done
   done
-done
+  done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_EGREP"; then
-    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
 else
   ac_cv_path_EGREP=$EGREP
@@ -3253,21 +3486,17 @@
 
    fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
 $as_echo "$ac_cv_path_EGREP" >&6; }
  EGREP="$ac_cv_path_EGREP"
 
 
-{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 #include <stdarg.h>
@@ -3282,48 +3511,23 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_header_stdc=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_header_stdc=no
+  ac_cv_header_stdc=no
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 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
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <string.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
 else
   ac_cv_header_stdc=no
 fi
@@ -3333,18 +3537,14 @@
 
 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
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
+  $EGREP "free" >/dev/null 2>&1; then :
+
 else
   ac_cv_header_stdc=no
 fi
@@ -3354,14 +3554,10 @@
 
 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
+  if test "$cross_compiling" = yes; then :
   :
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ctype.h>
 #include <stdlib.h>
@@ -3388,117 +3584,33 @@
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_run "$LINENO"; then :
 
-( exit $ac_status )
-ac_cv_header_stdc=no
+else
+  ac_cv_header_stdc=no
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-
 fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
 $as_echo "$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
 fi
 
 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
 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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  eval "$as_ac_Header=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -3508,60 +3620,49 @@
 done
 
 
-
- { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then
+if ${ac_cv_c_bigendian+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_bigendian=unknown
-    # See if __BIG_ENDIAN__ or __LITTLE_ENDIAN__ is defined.
-       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+    # See if we're dealing with a universal compiler.
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#if ! (defined __BIG_ENDIAN__ || defined __LITTLE_ENDIAN__)
-	       neither is defined;
+#ifndef __APPLE_CC__
+	       not a universal capable compiler
 	     #endif
 	     typedef int dummy;
 
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_c_bigendian=universal
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_compile "$LINENO"; then :
 
-
+	# Check for potential -arch flags.  It is not universal unless
+	# there are at least two -arch flags with different values.
+	ac_arch=
+	ac_prev=
+	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+	 if test -n "$ac_prev"; then
+	   case $ac_word in
+	     i?86 | x86_64 | ppc | ppc64)
+	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+		 ac_arch=$ac_word
+	       else
+		 ac_cv_c_bigendian=universal
+		 break
+	       fi
+	       ;;
+	   esac
+	   ac_prev=
+	 elif test "x$ac_word" = "x-arch"; then
+	   ac_prev=arch
+	 fi
+       done
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     if test $ac_cv_c_bigendian = unknown; then
       # 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
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
 	     #include <sys/param.h>
@@ -3579,30 +3680,9 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; 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
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
 		#include <sys/param.h>
@@ -3618,49 +3698,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_c_bigendian=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_c_bigendian=no
+  ac_cv_c_bigendian=no
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     fi
     if test $ac_cv_c_bigendian = unknown; then
       # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <limits.h>
 
@@ -3675,30 +3724,9 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; 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
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <limits.h>
 
@@ -3713,51 +3741,20 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_c_bigendian=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_c_bigendian=no
+  ac_cv_c_bigendian=no
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     fi
     if test $ac_cv_c_bigendian = unknown; then
       # Compile a test program.
-      if test "$cross_compiling" = yes; then
+      if test "$cross_compiling" = yes; then :
   # Try to guess by grepping values from an object file.
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 short int ascii_mm[] =
 		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
@@ -3783,24 +3780,7 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
 	      ac_cv_c_bigendian=yes
 	    fi
@@ -3812,20 +3792,10 @@
 		ac_cv_c_bigendian=unknown
 	      fi
 	    fi
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
 int
@@ -3845,62 +3815,33 @@
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
   ac_cv_c_bigendian=no
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_c_bigendian=yes
+  ac_cv_c_bigendian=yes
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-
     fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
 $as_echo "$ac_cv_c_bigendian" >&6; }
  case $ac_cv_c_bigendian in #(
    yes)
-     cat >>confdefs.h <<\_ACEOF
-#define WORDS_BIGENDIAN 1
-_ACEOF
+     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
 ;; #(
    no)
       ;; #(
    universal)
-      ;; #(
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+     ;; #(
    *)
-     { { $as_echo "$as_me:$LINENO: error: unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-$as_echo "$as_me: error: unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
-   { (exit 1); exit 1; }; } ;;
+     as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
  esac
 
 
@@ -3910,14 +3851,14 @@
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
 $as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -3932,11 +3873,7 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -3945,78 +3882,34 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
 
+else
   # Broken: fails on valid input.
 continue
 fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-rm -f conftest.err conftest.$ac_ext
-
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-rm -f conftest.err conftest.$ac_ext
-
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
   break
 fi
 
@@ -4028,7 +3921,7 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
 $as_echo "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
@@ -4039,11 +3932,7 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -4052,85 +3941,40 @@
 #endif
 		     Syntax error
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if ac_fn_c_try_cpp "$LINENO"; then :
 
+else
   # Broken: fails on valid input.
 continue
 fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-rm -f conftest.err conftest.$ac_ext
-
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-rm -f conftest.err conftest.$ac_ext
-
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
 else
-  { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -4142,9 +3986,9 @@
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
+if ${ac_cv_prog_RANLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$RANLIB"; then
@@ -4155,24 +3999,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
 $as_echo "$RANLIB" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4182,9 +4026,9 @@
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_RANLIB"; then
@@ -4195,24 +4039,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
 $as_echo "$ac_ct_RANLIB" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4221,12 +4065,8 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     RANLIB=$ac_ct_RANLIB
@@ -4249,10 +4089,10 @@
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
 # Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -4260,11 +4100,11 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
-  ./ | .// | /cC/* | \
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
   /usr/ucb/* ) ;;
   *)
     # OSF1 and SCO ODT 3.0 have their own names for install.
@@ -4272,7 +4112,7 @@
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -4301,7 +4141,7 @@
     ;;
 esac
 
-done
+  done
 IFS=$as_save_IFS
 
 rm -rf conftest.one conftest.two conftest.dir
@@ -4317,7 +4157,7 @@
     INSTALL=$ac_install_sh
   fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
 $as_echo "$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
@@ -4328,22 +4168,22 @@
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
 $as_echo_n "checking whether ln -s works... " >&6; }
 LN_S=$as_ln_s
 if test "$LN_S" = "ln -s"; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
 $as_echo "no, using $LN_S" >&6; }
 fi
 
 # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_AR+set}" = set; then
+if ${ac_cv_path_AR+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $AR in
@@ -4356,14 +4196,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   ;;
@@ -4371,10 +4211,10 @@
 fi
 AR=$ac_cv_path_AR
 if test -n "$AR"; then
-  { $as_echo "$as_me:$LINENO: result: $AR" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
 $as_echo "$AR" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4383,9 +4223,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PERL+set}" = set; then
+if ${ac_cv_path_PERL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PERL in
@@ -4398,14 +4238,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   ;;
@@ -4413,10 +4253,10 @@
 fi
 PERL=$ac_cv_path_PERL
 if test -n "$PERL"; then
-  { $as_echo "$as_me:$LINENO: result: $PERL" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
 $as_echo "$PERL" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4427,9 +4267,7 @@
 
 
 if test -z "$AR" ; then
-	{ { $as_echo "$as_me:$LINENO: error: *** 'ar' missing, please install or fix your \$PATH ***" >&5
-$as_echo "$as_me: error: *** 'ar' missing, please install or fix your \$PATH ***" >&2;}
-   { (exit 1); exit 1; }; }
+	as_fn_error $? "*** 'ar' missing, please install or fix your \$PATH ***" "$LINENO" 5
 fi
 
 if test -z "$LD" ; then
@@ -4438,18 +4276,14 @@
 
 
 # C Compiler features
-{ $as_echo "$as_me:$LINENO: checking for inline" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
 $as_echo_n "checking for inline... " >&6; }
-if test "${ac_cv_c_inline+set}" = set; then
+if ${ac_cv_c_inline+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifndef __cplusplus
 typedef int foo_t;
@@ -4458,41 +4292,17 @@
 #endif
 
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_c_inline=$ac_kw
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   test "$ac_cv_c_inline" != no && break
 done
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
 $as_echo "$ac_cv_c_inline" >&6; }
 
-
 case $ac_cv_c_inline in
   inline | yes) ;;
   *)
@@ -4515,7 +4325,7 @@
 # Allow user to specify flags
 
 # Check whether --with-cflags was given.
-if test "${with_cflags+set}" = set; then
+if test "${with_cflags+set}" = set; then :
   withval=$with_cflags;
 		if test "x$withval" != "xno" ; then
 			CFLAGS="$CFLAGS $withval"
@@ -4526,7 +4336,7 @@
 
 
 # Check whether --with-cppflags was given.
-if test "${with_cppflags+set}" = set; then
+if test "${with_cppflags+set}" = set; then :
   withval=$with_cppflags;
 		if test "x$withval" != "xno"; then
 			CPPFLAGS="$CPPFLAGS $withval"
@@ -4537,7 +4347,7 @@
 
 
 # Check whether --with-ldflags was given.
-if test "${with_ldflags+set}" = set; then
+if test "${with_ldflags+set}" = set; then :
   withval=$with_ldflags;
 		if test "x$withval" != "xno" ; then
 			LDFLAGS="$LDFLAGS $withval"
@@ -4548,7 +4358,7 @@
 
 
 # Check whether --with-libs was given.
-if test "${with_libs+set}" = set; then
+if test "${with_libs+set}" = set; then :
   withval=$with_libs;
 		if test "x$withval" != "xno" ; then
 			LIBS="$LIBS $withval"
@@ -4561,18 +4371,14 @@
 # Checks for libraries.
  OLDLDFLAGS=$LDFLAGS
  LDFLAGS=
-{ $as_echo "$as_me:$LINENO: checking if we need -pthread for threads" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need -pthread for threads" >&5
 $as_echo_n "checking if we need -pthread for threads... " >&6; }
-          if test "${ac_cv_ldflag_pthread+set}" = set; then
+          if ${ac_cv_ldflag_pthread+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_LDFLAGS="$LDFLAGS"
                         LDFLAGS="-pthread $LDFLAGS"
-                        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+                        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 char pthread_create();
 int
@@ -4583,47 +4389,22 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   eval "ac_cv_ldflag_pthread=yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "ac_cv_ldflag_pthread=no"
+  eval "ac_cv_ldflag_pthread=no"
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext,
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext,
                                     LDFLAGS="$ac_save_LDFLAGS"
 
 fi
 
           if eval "test \"`echo $ac_cv_ldflag_pthread`\" = yes"; then
-            { $as_echo "$as_me:$LINENO: result: yes" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
           else
-            { $as_echo "$as_me:$LINENO: result: no" >&5
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
           fi
 
@@ -4633,19 +4414,14 @@
 
  OLDLIBS=$LIBS
  LIBS=
-
-{ $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
 $as_echo_n "checking for pthread_create in -lpthread... " >&6; }
-if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
+if ${ac_cv_lib_pthread_pthread_create+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpthread  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -4663,43 +4439,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_pthread_pthread_create=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_pthread_pthread_create=no
+  ac_cv_lib_pthread_pthread_create=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
-if test $ac_cv_lib_pthread_pthread_create = yes; then
+if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBPTHREAD 1
 _ACEOF
@@ -4708,19 +4459,14 @@
 
 fi
 
-
-{ $as_echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for thr_create in -lthread" >&5
 $as_echo_n "checking for thr_create in -lthread... " >&6; }
-if test "${ac_cv_lib_thread_thr_create+set}" = set; then
+if ${ac_cv_lib_thread_thr_create+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lthread  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -4738,43 +4484,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_thread_thr_create=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_thread_thr_create=no
+  ac_cv_lib_thread_thr_create=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_thread_thr_create" >&5
 $as_echo "$ac_cv_lib_thread_thr_create" >&6; }
-if test $ac_cv_lib_thread_thr_create = yes; then
+if test "x$ac_cv_lib_thread_thr_create" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBTHREAD 1
 _ACEOF
@@ -4783,19 +4504,14 @@
 
 fi
 
-
-{ $as_echo "$as_me:$LINENO: checking for sem_wait in -lposix4" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sem_wait in -lposix4" >&5
 $as_echo_n "checking for sem_wait in -lposix4... " >&6; }
-if test "${ac_cv_lib_posix4_sem_wait+set}" = set; then
+if ${ac_cv_lib_posix4_sem_wait+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lposix4  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -4813,43 +4529,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_posix4_sem_wait=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_posix4_sem_wait=no
+  ac_cv_lib_posix4_sem_wait=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_posix4_sem_wait" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sem_wait" >&5
 $as_echo "$ac_cv_lib_posix4_sem_wait" >&6; }
-if test $ac_cv_lib_posix4_sem_wait = yes; then
+if test "x$ac_cv_lib_posix4_sem_wait" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBPOSIX4 1
 _ACEOF
@@ -4860,101 +4551,12 @@
 
  THLIBS=$LIBS
 
-
 for ac_func in pthread_atfork
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* 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 GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $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
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_func "$LINENO" "pthread_atfork" "ac_cv_func_pthread_atfork"
+if test "x$ac_cv_func_pthread_atfork" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_PTHREAD_ATFORK 1
 _ACEOF
 
 fi
@@ -4962,19 +4564,14 @@
 
  LIBS=$OLDLIBS
 
-
-{ $as_echo "$as_me:$LINENO: checking for gethostbyaddr in -lnsl" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr in -lnsl" >&5
 $as_echo_n "checking for gethostbyaddr in -lnsl... " >&6; }
-if test "${ac_cv_lib_nsl_gethostbyaddr+set}" = set; then
+if ${ac_cv_lib_nsl_gethostbyaddr+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -4992,43 +4589,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_nsl_gethostbyaddr=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_nsl_gethostbyaddr=no
+  ac_cv_lib_nsl_gethostbyaddr=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyaddr" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyaddr" >&5
 $as_echo "$ac_cv_lib_nsl_gethostbyaddr" >&6; }
-if test $ac_cv_lib_nsl_gethostbyaddr = yes; then
+if test "x$ac_cv_lib_nsl_gethostbyaddr" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBNSL 1
 _ACEOF
@@ -5037,19 +4609,14 @@
 
 fi
 
-
-{ $as_echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
 $as_echo_n "checking for socket in -lsocket... " >&6; }
-if test "${ac_cv_lib_socket_socket+set}" = set; then
+if ${ac_cv_lib_socket_socket+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -5067,43 +4634,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_socket_socket=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_socket_socket=no
+  ac_cv_lib_socket_socket=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
 $as_echo "$ac_cv_lib_socket_socket" >&6; }
-if test $ac_cv_lib_socket_socket = yes; then
+if test "x$ac_cv_lib_socket_socket" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBSOCKET 1
 _ACEOF
@@ -5112,17 +4654,13 @@
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for library containing shm_open" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5
 $as_echo_n "checking for library containing shm_open... " >&6; }
-if test "${ac_cv_search_shm_open+set}" = set; then
+if ${ac_cv_search_shm_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -5147,69 +4685,38 @@
     ac_res=-l$ac_lib
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
   fi
-  rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+  if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_search_shm_open=$ac_res
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext
-  if test "${ac_cv_search_shm_open+set}" = set; then
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_shm_open+:} false; then :
   break
 fi
 done
-if test "${ac_cv_search_shm_open+set}" = set; then
-  :
+if ${ac_cv_search_shm_open+:} false; then :
+
 else
   ac_cv_search_shm_open=no
 fi
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_shm_open" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_open" >&5
 $as_echo "$ac_cv_search_shm_open" >&6; }
 ac_res=$ac_cv_search_shm_open
-if test "$ac_res" != no; then
+if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for library containing nanosleep" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5
 $as_echo_n "checking for library containing nanosleep... " >&6; }
-if test "${ac_cv_search_nanosleep+set}" = set; then
+if ${ac_cv_search_nanosleep+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -5234,71 +4741,39 @@
     ac_res=-l$ac_lib
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
   fi
-  rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+  if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_search_nanosleep=$ac_res
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext
-  if test "${ac_cv_search_nanosleep+set}" = set; then
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_nanosleep+:} false; then :
   break
 fi
 done
-if test "${ac_cv_search_nanosleep+set}" = set; then
-  :
+if ${ac_cv_search_nanosleep+:} false; then :
+
 else
   ac_cv_search_nanosleep=no
 fi
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_nanosleep" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5
 $as_echo "$ac_cv_search_nanosleep" >&6; }
 ac_res=$ac_cv_search_nanosleep
-if test "$ac_res" != no; then
+if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
 fi
 
-
-{ $as_echo "$as_me:$LINENO: checking for sqrt in -lm" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
 $as_echo_n "checking for sqrt in -lm... " >&6; }
-if test "${ac_cv_lib_m_sqrt+set}" = set; then
+if ${ac_cv_lib_m_sqrt+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -5316,43 +4791,18 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_m_sqrt=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_m_sqrt=no
+  ac_cv_lib_m_sqrt=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_sqrt" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5
 $as_echo "$ac_cv_lib_m_sqrt" >&6; }
-if test $ac_cv_lib_m_sqrt = yes; then
+if test "x$ac_cv_lib_m_sqrt" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBM 1
 _ACEOF
@@ -5362,117 +4812,24 @@
 fi
 
 
-
 for ac_func in strftime
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* 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 GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $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
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
+if test "x$ac_cv_func_strftime" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_STRFTIME 1
 _ACEOF
 
 else
   # strftime is in -lintl on SCO UNIX.
-{ $as_echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
 $as_echo_n "checking for strftime in -lintl... " >&6; }
-if test "${ac_cv_lib_intl_strftime+set}" = set; then
+if ${ac_cv_lib_intl_strftime+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lintl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -5490,46 +4847,19 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_intl_strftime=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_lib_intl_strftime=no
+  ac_cv_lib_intl_strftime=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
 $as_echo "$ac_cv_lib_intl_strftime" >&6; }
-if test $ac_cv_lib_intl_strftime = yes; then
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRFTIME 1
-_ACEOF
+if test "x$ac_cv_lib_intl_strftime" = xyes; then :
+  $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
 
 LIBS="-lintl $LIBS"
 fi
@@ -5539,174 +4869,11 @@
 
 
 # Checks for header files.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-for ac_header in arpa/inet.h assert.h errno.h grp.h limits.h netdb.h netinet/in.h netinet/tcp.h process.h pthread.h pwd.h signal.h stdarg.h stdint.h stdio.h stdlib.h string.h sys/inttypes.h sys/ioctl.h sys/param.h sys/socket.h sys/stat.h sys/time.h sys/timeb.h sys/types.h sys/uio.h sys/un.h sys/filio.h time.h unistd.h windows.h winsock.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-if test `eval 'as_val=${'$as_ac_Header'}
-		 $as_echo "$as_val"'` = yes; then
+for ac_header in arpa/inet.h assert.h errno.h grp.h limits.h netdb.h netinet/in.h netinet/tcp.h process.h pthread.h pwd.h signal.h stdarg.h stdint.h stdio.h stdlib.h string.h sys/inttypes.h sys/ioctl.h sys/param.h sys/socket.h sys/stat.h sys/time.h sys/timeb.h sys/types.h sys/uio.h sys/un.h sys/filio.h time.h unistd.h winsock2.h ws2tcpip.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -5716,107 +4883,11 @@
 done
 
 
-
-
-
-
-
-
-
-
-
 for ac_func in bcopy inet_aton inet_ntoa inet_ntop memmove setsid snprintf strerror lrand48
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* 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 GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $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
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -5824,100 +4895,11 @@
 fi
 done
 
-
-
 for ac_func in gettimeofday time
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* 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 GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $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
-#endif
-
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'`
-	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
-		 $as_echo "$as_val"'` = yes; then
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -5927,89 +4909,51 @@
 
 
 # Check for clock_gettime(CLOCK_MONOTONIC, ...)
-{ $as_echo "$as_me:$LINENO: checking for clock_gettime(CLOCK_MONOTONIC)" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime(CLOCK_MONOTONIC)" >&5
 $as_echo_n "checking for clock_gettime(CLOCK_MONOTONIC)... " >&6; }
-if test "${ac_cv_clock_gettime_monotonic+set}" = set; then
+if ${ac_cv_clock_gettime_monotonic+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+	if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <time.h>
 		  int main() { struct timespec t; return clock_gettime(CLOCK_MONOTONIC, &t); }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
    ac_cv_clock_gettime_monotonic="yes"
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_clock_gettime_monotonic="no"
 
-( exit $ac_status )
- ac_cv_clock_gettime_monotonic="no"
-
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
 
-
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_clock_gettime_monotonic" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_clock_gettime_monotonic" >&5
 $as_echo "$ac_cv_clock_gettime_monotonic" >&6; }
 if test "x$ac_cv_clock_gettime_monotonic" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CLOCK_GETTIME_CLOCK_MONOTONIC 1
-_ACEOF
+$as_echo "#define HAVE_CLOCK_GETTIME_CLOCK_MONOTONIC 1" >>confdefs.h
 
 fi
 
 
-{ $as_echo "$as_me:$LINENO: checking for library containing dladdr" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dladdr" >&5
 $as_echo_n "checking for library containing dladdr... " >&6; }
-if test "${ac_cv_search_dladdr+set}" = set; then
+if ${ac_cv_search_dladdr+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -6034,76 +4978,43 @@
     ac_res=-l$ac_lib
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
   fi
-  rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+  if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_search_dladdr=$ac_res
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext
-  if test "${ac_cv_search_dladdr+set}" = set; then
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_dladdr+:} false; then :
   break
 fi
 done
-if test "${ac_cv_search_dladdr+set}" = set; then
-  :
+if ${ac_cv_search_dladdr+:} false; then :
+
 else
   ac_cv_search_dladdr=no
 fi
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_dladdr" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dladdr" >&5
 $as_echo "$ac_cv_search_dladdr" >&6; }
 ac_res=$ac_cv_search_dladdr
-if test "$ac_res" != no; then
+if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
 else
 
-  { { $as_echo "$as_me:$LINENO: error: unable to find the dladdr() function" >&5
-$as_echo "$as_me: error: unable to find the dladdr() function" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "unable to find the dladdr() function" "$LINENO" 5
 
 fi
 
 
-{ $as_echo "$as_me:$LINENO: checking for dladdr" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dladdr" >&5
 $as_echo_n "checking for dladdr... " >&6; }
-if test "${ac_cv_have_dladdr+set}" = set; then
+if ${ac_cv_have_dladdr+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #ifndef _GNU_SOURCE
 	  #define _GNU_SOURCE 1
@@ -6118,117 +5029,60 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_dladdr="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_dladdr="no"
 
-	 ac_cv_have_dladdr="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_dladdr" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_dladdr" >&5
 $as_echo "$ac_cv_have_dladdr" >&6; }
 
 if test "x$ac_cv_have_dladdr" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DLADDR 1
-_ACEOF
+$as_echo "#define HAVE_DLADDR 1" >>confdefs.h
 
 fi
 
 # Check for broken snprintf
 if test "x$ac_cv_func_snprintf" = "xyes" ; then
-	{ $as_echo "$as_me:$LINENO: checking whether snprintf correctly terminates long strings" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf correctly terminates long strings" >&5
 $as_echo_n "checking whether snprintf correctly terminates long strings... " >&6; }
-	if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+	if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <stdio.h>
 int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');}
 
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
+if ac_fn_c_try_run "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-
-			{ $as_echo "$as_me:$LINENO: result: no" >&5
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define BROKEN_SNPRINTF 1
-_ACEOF
+$as_echo "#define BROKEN_SNPRINTF 1" >>confdefs.h
 
-			{ $as_echo "$as_me:$LINENO: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&5
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&5
 $as_echo "$as_me: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&2;}
 
 
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-
 fi
 
 # Cheap hack to ensure NEWS-OS libraries are arranged right.
@@ -6241,348 +5095,26 @@
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:$LINENO: checking size of char" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5
 $as_echo_n "checking size of char... " >&6; }
-if test "${ac_cv_sizeof_char+set}" = set; then
+if ${ac_cv_sizeof_char+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (char))) >= 0)];
-test_array [0] = 0
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char"        "$ac_includes_default"; then :
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (char))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid; break
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo=`expr $ac_mid + 1`
-			if test $ac_lo -le $ac_mid; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (char))) < 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (char))) >= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=$ac_mid; break
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_hi=`expr '(' $ac_mid ')' - 1`
-			if test $ac_mid -le $ac_hi; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (char))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_char=$ac_lo;;
-'') if test "$ac_cv_type_char" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (char)
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute sizeof (char)
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+  if test "$ac_cv_type_char" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (char)
+See \`config.log' for more details" "$LINENO" 5; }
    else
      ac_cv_sizeof_char=0
-   fi ;;
-esac
-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
-static long int longval () { return (long int) (sizeof (char)); }
-static unsigned long int ulongval () { return (long int) (sizeof (char)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (((long int) (sizeof (char))) < 0)
-    {
-      long int i = longval ();
-      if (i != ((long int) (sizeof (char))))
-	return 1;
-      fprintf (f, "%ld", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (char))))
-	return 1;
-      fprintf (f, "%lu", i);
-    }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_char=`cat conftest.val`
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_char" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (char)
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute sizeof (char)
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
-   else
-     ac_cv_sizeof_char=0
    fi
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+
 fi
-rm -f conftest.val
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5
 $as_echo "$ac_cv_sizeof_char" >&6; }
 
 
@@ -6596,348 +5128,26 @@
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:$LINENO: checking size of short int" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short int" >&5
 $as_echo_n "checking size of short int... " >&6; }
-if test "${ac_cv_sizeof_short_int+set}" = set; then
+if ${ac_cv_sizeof_short_int+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (short int))) >= 0)];
-test_array [0] = 0
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short int))" "ac_cv_sizeof_short_int"        "$ac_includes_default"; then :
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (short int))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid; break
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo=`expr $ac_mid + 1`
-			if test $ac_lo -le $ac_mid; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (short int))) < 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (short int))) >= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=$ac_mid; break
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_hi=`expr '(' $ac_mid ')' - 1`
-			if test $ac_mid -le $ac_hi; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (short int))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_short_int=$ac_lo;;
-'') if test "$ac_cv_type_short_int" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short int)
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute sizeof (short int)
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+  if test "$ac_cv_type_short_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (short int)
+See \`config.log' for more details" "$LINENO" 5; }
    else
      ac_cv_sizeof_short_int=0
-   fi ;;
-esac
-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
-static long int longval () { return (long int) (sizeof (short int)); }
-static unsigned long int ulongval () { return (long int) (sizeof (short int)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (((long int) (sizeof (short int))) < 0)
-    {
-      long int i = longval ();
-      if (i != ((long int) (sizeof (short int))))
-	return 1;
-      fprintf (f, "%ld", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (short int))))
-	return 1;
-      fprintf (f, "%lu", i);
-    }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_short_int=`cat conftest.val`
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_short_int" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short int)
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute sizeof (short int)
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
-   else
-     ac_cv_sizeof_short_int=0
    fi
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+
 fi
-rm -f conftest.val
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_short_int" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short_int" >&5
 $as_echo "$ac_cv_sizeof_short_int" >&6; }
 
 
@@ -6951,348 +5161,26 @@
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:$LINENO: checking size of int" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
 $as_echo_n "checking size of int... " >&6; }
-if test "${ac_cv_sizeof_int+set}" = set; then
+if ${ac_cv_sizeof_int+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)];
-test_array [0] = 0
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int"        "$ac_includes_default"; then :
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid; break
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo=`expr $ac_mid + 1`
-			if test $ac_lo -le $ac_mid; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=$ac_mid; break
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_hi=`expr '(' $ac_mid ')' - 1`
-			if test $ac_mid -le $ac_hi; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_int=$ac_lo;;
-'') if test "$ac_cv_type_int" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+  if test "$ac_cv_type_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (int)
+See \`config.log' for more details" "$LINENO" 5; }
    else
      ac_cv_sizeof_int=0
-   fi ;;
-esac
-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
-static long int longval () { return (long int) (sizeof (int)); }
-static unsigned long int ulongval () { return (long int) (sizeof (int)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (((long int) (sizeof (int))) < 0)
-    {
-      long int i = longval ();
-      if (i != ((long int) (sizeof (int))))
-	return 1;
-      fprintf (f, "%ld", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (int))))
-	return 1;
-      fprintf (f, "%lu", i);
-    }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_int=`cat conftest.val`
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_int" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
-   else
-     ac_cv_sizeof_int=0
    fi
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+
 fi
-rm -f conftest.val
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
 $as_echo "$ac_cv_sizeof_int" >&6; }
 
 
@@ -7306,348 +5194,26 @@
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:$LINENO: checking size of long int" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long int" >&5
 $as_echo_n "checking size of long int... " >&6; }
-if test "${ac_cv_sizeof_long_int+set}" = set; then
+if ${ac_cv_sizeof_long_int+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (long int))) >= 0)];
-test_array [0] = 0
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long int))" "ac_cv_sizeof_long_int"        "$ac_includes_default"; then :
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (long int))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid; break
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo=`expr $ac_mid + 1`
-			if test $ac_lo -le $ac_mid; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (long int))) < 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (long int))) >= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=$ac_mid; break
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_hi=`expr '(' $ac_mid ')' - 1`
-			if test $ac_mid -le $ac_hi; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (long int))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long_int=$ac_lo;;
-'') if test "$ac_cv_type_long_int" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long int)
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute sizeof (long int)
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+  if test "$ac_cv_type_long_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long int)
+See \`config.log' for more details" "$LINENO" 5; }
    else
      ac_cv_sizeof_long_int=0
-   fi ;;
-esac
-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
-static long int longval () { return (long int) (sizeof (long int)); }
-static unsigned long int ulongval () { return (long int) (sizeof (long int)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (((long int) (sizeof (long int))) < 0)
-    {
-      long int i = longval ();
-      if (i != ((long int) (sizeof (long int))))
-	return 1;
-      fprintf (f, "%ld", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (long int))))
-	return 1;
-      fprintf (f, "%lu", i);
-    }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_long_int=`cat conftest.val`
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_long_int" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long int)
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute sizeof (long int)
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
-   else
-     ac_cv_sizeof_long_int=0
    fi
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+
 fi
-rm -f conftest.val
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_int" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_int" >&5
 $as_echo "$ac_cv_sizeof_long_int" >&6; }
 
 
@@ -7661,348 +5227,26 @@
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:$LINENO: checking size of long long int" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long int" >&5
 $as_echo_n "checking size of long long int... " >&6; }
-if test "${ac_cv_sizeof_long_long_int+set}" = set; then
+if ${ac_cv_sizeof_long_long_int+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (long long int))) >= 0)];
-test_array [0] = 0
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int"        "$ac_includes_default"; then :
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (long long int))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid; break
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo=`expr $ac_mid + 1`
-			if test $ac_lo -le $ac_mid; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (long long int))) < 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (long long int))) >= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=$ac_mid; break
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_hi=`expr '(' $ac_mid ')' - 1`
-			if test $ac_mid -le $ac_hi; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (long long int))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long_long_int=$ac_lo;;
-'') if test "$ac_cv_type_long_long_int" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long int)
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute sizeof (long long int)
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+  if test "$ac_cv_type_long_long_int" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long long int)
+See \`config.log' for more details" "$LINENO" 5; }
    else
      ac_cv_sizeof_long_long_int=0
-   fi ;;
-esac
-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
-static long int longval () { return (long int) (sizeof (long long int)); }
-static unsigned long int ulongval () { return (long int) (sizeof (long long int)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (((long int) (sizeof (long long int))) < 0)
-    {
-      long int i = longval ();
-      if (i != ((long int) (sizeof (long long int))))
-	return 1;
-      fprintf (f, "%ld", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (long long int))))
-	return 1;
-      fprintf (f, "%lu", i);
-    }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_long_long_int=`cat conftest.val`
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_long_long_int" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long int)
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute sizeof (long long int)
-See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
-   else
-     ac_cv_sizeof_long_long_int=0
    fi
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+
 fi
-rm -f conftest.val
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long_int" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long_int" >&5
 $as_echo "$ac_cv_sizeof_long_long_int" >&6; }
 
 
@@ -8014,17 +5258,13 @@
 
 
 # More checks for data types
-{ $as_echo "$as_me:$LINENO: checking for windows arch" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for windows arch" >&5
 $as_echo_n "checking for windows arch... " >&6; }
-if test "${ac_cv_arch_win+set}" = set; then
+if ${ac_cv_arch_win+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <process.h>
 int
@@ -8035,57 +5275,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_arch_win="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_arch_win="no"
 
-	 ac_cv_arch_win="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_arch_win" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_arch_win" >&5
 $as_echo "$ac_cv_arch_win" >&6; }
 if test "x$ac_cv_arch_win" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define ARCH_PC_WIN95 1
-_ACEOF
+$as_echo "#define ARCH_PC_WIN95 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for struct timezone type" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timezone type" >&5
 $as_echo_n "checking for struct timezone type... " >&6; }
-if test "${ac_cv_have_struct_timezone+set}" = set; then
+if ${ac_cv_have_struct_timezone+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <time.h>
 		  #include <sys/time.h>
@@ -8098,57 +5311,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_timezone="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_timezone="no"
 
-	 ac_cv_have_struct_timezone="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_struct_timezone" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_timezone" >&5
 $as_echo "$ac_cv_have_struct_timezone" >&6; }
 if test "x$ac_cv_have_struct_timezone" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_TIMEZONE 1
-_ACEOF
+$as_echo "#define HAVE_STRUCT_TIMEZONE 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for struct sockopt_len_t type" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockopt_len_t type" >&5
 $as_echo_n "checking for struct sockopt_len_t type... " >&6; }
-if test "${ac_cv_have_sockopt_len_t+set}" = set; then
+if ${ac_cv_have_sockopt_len_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 		  #include <sys/socket.h>
@@ -8160,119 +5346,65 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_sockopt_len_t="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_sockopt_len_t="no"
 
-	 ac_cv_have_sockopt_len_t="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_sockopt_len_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_sockopt_len_t" >&5
 $as_echo "$ac_cv_have_sockopt_len_t" >&6; }
 if test "x$ac_cv_have_sockopt_len_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SOCKOPT_LEN_T 1
-_ACEOF
+$as_echo "#define HAVE_SOCKOPT_LEN_T 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for struct msghdr type" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct msghdr type" >&5
 $as_echo_n "checking for struct msghdr type... " >&6; }
-if test "${ac_cv_have_struct_msghdr+set}" = set; then
+if ${ac_cv_have_struct_msghdr+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 		  #include <sys/socket.h>
 int
 main ()
 {
- static  struct  msghdr msg; msg.msg_namelen = 1;
+ static  struct  msghdr msg; msg.msg_name = 0; msg.msg_namelen = 1; msg.msg_iov = 0; msg.msg_iovlen = 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_msghdr="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_msghdr="no"
 
-	 ac_cv_have_struct_msghdr="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_struct_msghdr" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_msghdr" >&5
 $as_echo "$ac_cv_have_struct_msghdr" >&6; }
 if test "x$ac_cv_have_struct_msghdr" = "xno" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define ARCH_SCATTER_NONE 1
-_ACEOF
+$as_echo "#define ARCH_SCATTER_NONE 1" >>confdefs.h
 
 else
   have_scatter="no"
-  { $as_echo "$as_me:$LINENO: checking for struct msghdr accrights" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct msghdr accrights" >&5
 $as_echo_n "checking for struct msghdr accrights... " >&6; }
-if test "${ac_cv_have_struct_msghdr_acc+set}" = set; then
+if ${ac_cv_have_struct_msghdr_acc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 		  #include <sys/socket.h>
@@ -8284,58 +5416,31 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_msghdr_acc="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_msghdr_acc="no"
 
-	 ac_cv_have_struct_msghdr_acc="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_struct_msghdr_acc" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_msghdr_acc" >&5
 $as_echo "$ac_cv_have_struct_msghdr_acc" >&6; }
   if test "x$ac_cv_have_struct_msghdr_acc" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define ARCH_SCATTER_ACCRIGHTS 1
-_ACEOF
+$as_echo "#define ARCH_SCATTER_ACCRIGHTS 1" >>confdefs.h
 
 	have_scatter="yes"
   fi
   if test "x$have_scatter" = "xno" ; then
-	{ $as_echo "$as_me:$LINENO: checking for struct msghdr control" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct msghdr control" >&5
 $as_echo_n "checking for struct msghdr control... " >&6; }
-if test "${ac_cv_have_struct_msghdr_ctl+set}" = set; then
+if ${ac_cv_have_struct_msghdr_ctl+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 	      #include <sys/socket.h>
@@ -8347,65 +5452,36 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_msghdr_ctl="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_msghdr_ctl="no"
 
-	 ac_cv_have_struct_msghdr_ctl="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_struct_msghdr_ctl" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_msghdr_ctl" >&5
 $as_echo "$ac_cv_have_struct_msghdr_ctl" >&6; }
 	if test "x$ac_cv_have_struct_msghdr_ctl" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define ARCH_SCATTER_CONTROL 1
-_ACEOF
+$as_echo "#define ARCH_SCATTER_CONTROL 1" >>confdefs.h
 
             have_scatter="yes"
 	fi
   fi
   if test "x$have_scatter" = "xno" ; then
-        { { $as_echo "$as_me:$LINENO: error: *** cannot determine which scatter type to use ***" >&5
-$as_echo "$as_me: error: *** cannot determine which scatter type to use ***" >&2;}
-   { (exit 1); exit 1; }; }
+        as_fn_error $? "*** cannot determine which scatter type to use ***" "$LINENO" 5
   fi
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for u_int type" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int type" >&5
 $as_echo_n "checking for u_int type... " >&6; }
-if test "${ac_cv_have_u_int+set}" = set; then
+if ${ac_cv_have_u_int+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 int
@@ -8416,58 +5492,31 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_u_int="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_u_int="no"
 
-	 ac_cv_have_u_int="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_u_int" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_u_int" >&5
 $as_echo "$ac_cv_have_u_int" >&6; }
 if test "x$ac_cv_have_u_int" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_U_INT 1
-_ACEOF
+$as_echo "#define HAVE_U_INT 1" >>confdefs.h
 
 	have_u_int=1
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for intXX_t types" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for intXX_t types" >&5
 $as_echo_n "checking for intXX_t types... " >&6; }
-if test "${ac_cv_have_intxx_t+set}" = set; then
+if ${ac_cv_have_intxx_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 int
@@ -8478,58 +5527,31 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_intxx_t="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_intxx_t="no"
 
-	 ac_cv_have_intxx_t="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_intxx_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_intxx_t" >&5
 $as_echo "$ac_cv_have_intxx_t" >&6; }
 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_INTXX_T 1
-_ACEOF
+$as_echo "#define HAVE_INTXX_T 1" >>confdefs.h
 
 	have_intxx_t=1
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for int64_t type" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for int64_t type" >&5
 $as_echo_n "checking for int64_t type... " >&6; }
-if test "${ac_cv_have_int64_t+set}" = set; then
+if ${ac_cv_have_int64_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 int
@@ -8540,58 +5562,31 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_int64_t="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_int64_t="no"
 
-	 ac_cv_have_int64_t="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_int64_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_int64_t" >&5
 $as_echo "$ac_cv_have_int64_t" >&6; }
 if test "x$ac_cv_have_int64_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_INT64_T 1
-_ACEOF
+$as_echo "#define HAVE_INT64_T 1" >>confdefs.h
 
 	have_int64_t=1
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for u_intXX_t types" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_intXX_t types" >&5
 $as_echo_n "checking for u_intXX_t types... " >&6; }
-if test "${ac_cv_have_u_intxx_t+set}" = set; then
+if ${ac_cv_have_u_intxx_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 int
@@ -8602,58 +5597,31 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_u_intxx_t="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_u_intxx_t="no"
 
-	 ac_cv_have_u_intxx_t="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_u_intxx_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_u_intxx_t" >&5
 $as_echo "$ac_cv_have_u_intxx_t" >&6; }
 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_U_INTXX_T 1
-_ACEOF
+$as_echo "#define HAVE_U_INTXX_T 1" >>confdefs.h
 
 	have_u_intxx_t=1
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for u_int64_t types" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for u_int64_t types" >&5
 $as_echo_n "checking for u_int64_t types... " >&6; }
-if test "${ac_cv_have_u_int64_t+set}" = set; then
+if ${ac_cv_have_u_int64_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/types.h>
 int
@@ -8664,43 +5632,20 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_u_int64_t="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_u_int64_t="no"
 
-	 ac_cv_have_u_int64_t="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_u_int64_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_u_int64_t" >&5
 $as_echo "$ac_cv_have_u_int64_t" >&6; }
 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_U_INT64_T 1
-_ACEOF
+$as_echo "#define HAVE_U_INT64_T 1" >>confdefs.h
 
 	have_u_int64_t=1
 fi
@@ -8708,13 +5653,9 @@
 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
            test "x$ac_cv_header_sys_bitypes_h" = "xyes")
 then
-	{ $as_echo "$as_me:$LINENO: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5
 $as_echo_n "checking for intXX_t and u_intXX_t types in sys/bitypes.h... " >&6; }
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/bitypes.h>
@@ -8731,60 +5672,31 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
 
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_U_INTXX_T 1
-_ACEOF
+			$as_echo "#define HAVE_U_INTXX_T 1" >>confdefs.h
 
-			cat >>confdefs.h <<\_ACEOF
-#define HAVE_INTXX_T 1
-_ACEOF
+			$as_echo "#define HAVE_INTXX_T 1" >>confdefs.h
 
-			{ $as_echo "$as_me:$LINENO: result: yes" >&5
+			{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	{ $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
 if test -z "$have_u_intxx_t" ; then
-	{ $as_echo "$as_me:$LINENO: checking for uintXX_t types" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uintXX_t types" >&5
 $as_echo_n "checking for uintXX_t types... " >&6; }
-if test "${ac_cv_have_uintxx_t+set}" = set; then
+if ${ac_cv_have_uintxx_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-		cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8797,58 +5709,31 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_uintxx_t="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_uintxx_t="no"
 
-	 ac_cv_have_uintxx_t="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_uintxx_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_uintxx_t" >&5
 $as_echo "$ac_cv_have_uintxx_t" >&6; }
 	if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_UINTXX_T 1
-_ACEOF
+$as_echo "#define HAVE_UINTXX_T 1" >>confdefs.h
 
 	fi
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for socklen_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5
 $as_echo_n "checking for socklen_t... " >&6; }
-if test "${ac_cv_have_socklen_t+set}" = set; then
+if ${ac_cv_have_socklen_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8862,57 +5747,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_socklen_t="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_socklen_t="no"
 
-	 ac_cv_have_socklen_t="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_socklen_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_socklen_t" >&5
 $as_echo "$ac_cv_have_socklen_t" >&6; }
 if test "x$ac_cv_have_socklen_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SOCKLEN_T 1
-_ACEOF
+$as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for size_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for size_t" >&5
 $as_echo_n "checking for size_t... " >&6; }
-if test "${ac_cv_have_size_t+set}" = set; then
+if ${ac_cv_have_size_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8925,57 +5783,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_size_t="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_size_t="no"
 
-	 ac_cv_have_size_t="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_size_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_size_t" >&5
 $as_echo "$ac_cv_have_size_t" >&6; }
 if test "x$ac_cv_have_size_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SIZE_T 1
-_ACEOF
+$as_echo "#define HAVE_SIZE_T 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for ssize_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
 $as_echo_n "checking for ssize_t... " >&6; }
-if test "${ac_cv_have_ssize_t+set}" = set; then
+if ${ac_cv_have_ssize_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -8988,57 +5819,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_ssize_t="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_ssize_t="no"
 
-	 ac_cv_have_ssize_t="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_ssize_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_ssize_t" >&5
 $as_echo "$ac_cv_have_ssize_t" >&6; }
 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SSIZE_T 1
-_ACEOF
+$as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for clock_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_t" >&5
 $as_echo_n "checking for clock_t... " >&6; }
-if test "${ac_cv_have_clock_t+set}" = set; then
+if ${ac_cv_have_clock_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <time.h>
@@ -9051,57 +5855,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_clock_t="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_clock_t="no"
 
-	 ac_cv_have_clock_t="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_clock_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_clock_t" >&5
 $as_echo "$ac_cv_have_clock_t" >&6; }
 if test "x$ac_cv_have_clock_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CLOCK_T 1
-_ACEOF
+$as_echo "#define HAVE_CLOCK_T 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for sa_family_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sa_family_t" >&5
 $as_echo_n "checking for sa_family_t... " >&6; }
-if test "${ac_cv_have_sa_family_t+set}" = set; then
+if ${ac_cv_have_sa_family_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -9115,34 +5892,10 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_sa_family_t="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -9157,62 +5910,34 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_sa_family_t="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_sa_family_t="no"
 
-	 ac_cv_have_sa_family_t="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_sa_family_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_sa_family_t" >&5
 $as_echo "$ac_cv_have_sa_family_t" >&6; }
 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SA_FAMILY_T 1
-_ACEOF
+$as_echo "#define HAVE_SA_FAMILY_T 1" >>confdefs.h
 
 fi
 
 
-{ $as_echo "$as_me:$LINENO: checking for struct sockaddr_storage" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_storage" >&5
 $as_echo_n "checking for struct sockaddr_storage... " >&6; }
-if test "${ac_cv_have_struct_sockaddr_storage+set}" = set; then
+if ${ac_cv_have_struct_sockaddr_storage+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -9226,57 +5951,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_sockaddr_storage="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_sockaddr_storage="no"
 
-	 ac_cv_have_struct_sockaddr_storage="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_struct_sockaddr_storage" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_sockaddr_storage" >&5
 $as_echo "$ac_cv_have_struct_sockaddr_storage" >&6; }
 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_SOCKADDR_STORAGE 1
-_ACEOF
+$as_echo "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for struct sockaddr_in6" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct sockaddr_in6" >&5
 $as_echo_n "checking for struct sockaddr_in6... " >&6; }
-if test "${ac_cv_have_struct_sockaddr_in6+set}" = set; then
+if ${ac_cv_have_struct_sockaddr_in6+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -9290,57 +5988,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_sockaddr_in6="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_sockaddr_in6="no"
 
-	 ac_cv_have_struct_sockaddr_in6="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_struct_sockaddr_in6" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_sockaddr_in6" >&5
 $as_echo "$ac_cv_have_struct_sockaddr_in6" >&6; }
 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_SOCKADDR_IN6 1
-_ACEOF
+$as_echo "#define HAVE_STRUCT_SOCKADDR_IN6 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for struct in6_addr" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct in6_addr" >&5
 $as_echo_n "checking for struct in6_addr... " >&6; }
-if test "${ac_cv_have_struct_in6_addr+set}" = set; then
+if ${ac_cv_have_struct_in6_addr+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -9354,57 +6025,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_in6_addr="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_in6_addr="no"
 
-	 ac_cv_have_struct_in6_addr="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_struct_in6_addr" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_in6_addr" >&5
 $as_echo "$ac_cv_have_struct_in6_addr" >&6; }
 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_IN6_ADDR 1
-_ACEOF
+$as_echo "#define HAVE_STRUCT_IN6_ADDR 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for struct addrinfo" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct addrinfo" >&5
 $as_echo_n "checking for struct addrinfo... " >&6; }
-if test "${ac_cv_have_struct_addrinfo+set}" = set; then
+if ${ac_cv_have_struct_addrinfo+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -9419,57 +6063,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_addrinfo="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_addrinfo="no"
 
-	 ac_cv_have_struct_addrinfo="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_struct_addrinfo" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_addrinfo" >&5
 $as_echo "$ac_cv_have_struct_addrinfo" >&6; }
 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_ADDRINFO 1
-_ACEOF
+$as_echo "#define HAVE_STRUCT_ADDRINFO 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for struct timeval" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
 $as_echo_n "checking for struct timeval... " >&6; }
-if test "${ac_cv_have_struct_timeval+set}" = set; then
+if ${ac_cv_have_struct_timeval+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  #include <sys/time.h>
 int
@@ -9480,58 +6097,31 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_struct_timeval="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_struct_timeval="no"
 
-	 ac_cv_have_struct_timeval="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_struct_timeval" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_struct_timeval" >&5
 $as_echo "$ac_cv_have_struct_timeval" >&6; }
 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRUCT_TIMEVAL 1
-_ACEOF
+$as_echo "#define HAVE_STRUCT_TIMEVAL 1" >>confdefs.h
 
 	have_struct_timeval=1
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for sun_len field in struct sockaddr_un" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sun_len field in struct sockaddr_un" >&5
 $as_echo_n "checking for sun_len field in struct sockaddr_un... " >&6; }
-if test "${ac_cv_have_sun_len_in_struct_sockaddr_un+set}" = set; then
+if ${ac_cv_have_sun_len_in_struct_sockaddr_un+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -9545,56 +6135,29 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_sun_len_in_struct_sockaddr_un="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	 ac_cv_have_sun_len_in_struct_sockaddr_un="no"
+   ac_cv_have_sun_len_in_struct_sockaddr_un="no"
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_sun_len_in_struct_sockaddr_un" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_sun_len_in_struct_sockaddr_un" >&5
 $as_echo "$ac_cv_have_sun_len_in_struct_sockaddr_un" >&6; }
 if test "x$ac_cv_have_sun_len_in_struct_sockaddr_un" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SUN_LEN_IN_SOCKADDR_UN 1
-_ACEOF
+$as_echo "#define HAVE_SUN_LEN_IN_SOCKADDR_UN 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for sin_len field in sockaddr_in" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin_len field in sockaddr_in" >&5
 $as_echo_n "checking for sin_len field in sockaddr_in... " >&6; }
-if test "${ac_cv_have_sin_len_in_struct_sockaddr_in+set}" = set; then
+if ${ac_cv_have_sin_len_in_struct_sockaddr_in+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -9609,56 +6172,29 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_sin_len_in_struct_sockaddr_in="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	 ac_cv_have_sin_len_in_struct_sockaddr_in="no"
+   ac_cv_have_sin_len_in_struct_sockaddr_in="no"
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_sin_len_in_struct_sockaddr_in" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_sin_len_in_struct_sockaddr_in" >&5
 $as_echo "$ac_cv_have_sin_len_in_struct_sockaddr_in" >&6; }
 if test x"$ac_cv_have_sin_len_in_struct_sockaddr_in" = "xyes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SIN_LEN_IN_SOCKADDR_IN 1
-_ACEOF
+$as_echo "#define HAVE_SIN_LEN_IN_SOCKADDR_IN 1 " >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for ss_family field in struct sockaddr_storage" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ss_family field in struct sockaddr_storage" >&5
 $as_echo_n "checking for ss_family field in struct sockaddr_storage... " >&6; }
-if test "${ac_cv_have_ss_family_in_struct_ss+set}" = set; then
+if ${ac_cv_have_ss_family_in_struct_ss+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -9672,56 +6208,29 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_ss_family_in_struct_ss="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	 ac_cv_have_ss_family_in_struct_ss="no"
+   ac_cv_have_ss_family_in_struct_ss="no"
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_ss_family_in_struct_ss" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_ss_family_in_struct_ss" >&5
 $as_echo "$ac_cv_have_ss_family_in_struct_ss" >&6; }
 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SS_FAMILY_IN_SS 1
-_ACEOF
+$as_echo "#define HAVE_SS_FAMILY_IN_SS 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for __ss_family field in struct sockaddr_storage" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __ss_family field in struct sockaddr_storage" >&5
 $as_echo_n "checking for __ss_family field in struct sockaddr_storage... " >&6; }
-if test "${ac_cv_have___ss_family_in_struct_ss+set}" = set; then
+if ${ac_cv_have___ss_family_in_struct_ss+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -9735,57 +6244,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have___ss_family_in_struct_ss="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have___ss_family_in_struct_ss="no"
 
-	 ac_cv_have___ss_family_in_struct_ss="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have___ss_family_in_struct_ss" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have___ss_family_in_struct_ss" >&5
 $as_echo "$ac_cv_have___ss_family_in_struct_ss" >&6; }
 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___SS_FAMILY_IN_SS 1
-_ACEOF
+$as_echo "#define HAVE___SS_FAMILY_IN_SS 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pid_t" >&5
 $as_echo_n "checking for pid_t... " >&6; }
-if test "${ac_cv_have_pid_t+set}" = set; then
+if ${ac_cv_have_pid_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <sys/types.h>
@@ -9798,57 +6280,30 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
    ac_cv_have_pid_t="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_have_pid_t="no"
 
-	 ac_cv_have_pid_t="no"
-
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_pid_t" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_pid_t" >&5
 $as_echo "$ac_cv_have_pid_t" >&6; }
 if test "x$ac_cv_have_pid_t" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PID_T 1
-_ACEOF
+$as_echo "#define HAVE_PID_T 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking if libc defines __progname" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libc defines __progname" >&5
 $as_echo_n "checking if libc defines __progname... " >&6; }
-if test "${ac_cv_libc_defines___progname+set}" = set; then
+if ${ac_cv_libc_defines___progname+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -9859,63 +6314,32 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
    ac_cv_libc_defines___progname="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_libc_defines___progname="no"
 
-	 ac_cv_libc_defines___progname="no"
-
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_libc_defines___progname" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libc_defines___progname" >&5
 $as_echo "$ac_cv_libc_defines___progname" >&6; }
 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___PROGNAME 1
-_ACEOF
+$as_echo "#define HAVE___PROGNAME 1" >>confdefs.h
 
 fi
 
 
-{ $as_echo "$as_me:$LINENO: checking if libc defines sys_errlist" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libc defines sys_errlist" >&5
 $as_echo_n "checking if libc defines sys_errlist... " >&6; }
-if test "${ac_cv_libc_defines_sys_errlist+set}" = set; then
+if ${ac_cv_libc_defines_sys_errlist+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -9926,63 +6350,32 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
    ac_cv_libc_defines_sys_errlist="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_libc_defines_sys_errlist="no"
 
-	 ac_cv_libc_defines_sys_errlist="no"
-
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_libc_defines_sys_errlist" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libc_defines_sys_errlist" >&5
 $as_echo "$ac_cv_libc_defines_sys_errlist" >&6; }
 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_ERRLIST 1
-_ACEOF
+$as_echo "#define HAVE_SYS_ERRLIST 1" >>confdefs.h
 
 fi
 
 
-{ $as_echo "$as_me:$LINENO: checking if libc defines sys_nerr" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libc defines sys_nerr" >&5
 $as_echo_n "checking if libc defines sys_nerr... " >&6; }
-if test "${ac_cv_libc_defines_sys_nerr+set}" = set; then
+if ${ac_cv_libc_defines_sys_nerr+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -9993,48 +6386,21 @@
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then
+if ac_fn_c_try_link "$LINENO"; then :
    ac_cv_libc_defines_sys_nerr="yes"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+   ac_cv_libc_defines_sys_nerr="no"
 
-	 ac_cv_libc_defines_sys_nerr="no"
-
 fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_libc_defines_sys_nerr" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libc_defines_sys_nerr" >&5
 $as_echo "$ac_cv_libc_defines_sys_nerr" >&6; }
 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_NERR 1
-_ACEOF
+$as_echo "#define HAVE_SYS_NERR 1" >>confdefs.h
 
 fi
 
@@ -10042,16 +6408,14 @@
 
 
 # Check whether --with-catman was given.
-if test "${with_catman+set}" = set; then
+if test "${with_catman+set}" = set; then :
   withval=$with_catman;
 		case "$withval" in
 		man|cat|doc)
 			MANTYPE=$withval
 			;;
 		*)
-			{ { $as_echo "$as_me:$LINENO: error: invalid man type: $withval" >&5
-$as_echo "$as_me: error: invalid man type: $withval" >&2;}
-   { (exit 1); exit 1; }; }
+			as_fn_error $? "invalid man type: $withval" "$LINENO" 5
 			;;
 		esac
 
@@ -10063,9 +6427,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_NROFF+set}" = set; then
+if ${ac_cv_path_NROFF+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $NROFF in
@@ -10079,14 +6443,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_NROFF="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   ;;
@@ -10094,10 +6458,10 @@
 fi
 NROFF=$ac_cv_path_NROFF
 if test -n "$NROFF"; then
-  { $as_echo "$as_me:$LINENO: result: $NROFF" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NROFF" >&5
 $as_echo "$NROFF" >&6; }
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -10125,7 +6489,7 @@
 # autoconf does not have docdir option, so add one
 
 # Check whether --with-docdir was given.
-if test "${with_docdir+set}" = set; then
+if test "${with_docdir+set}" = set; then :
   withval=$with_docdir;
 		if test "x$withval" = xyes || test "x$withval" = xno; then
 		   docdir='${datadir}/doc/libspread-util'
@@ -10144,31 +6508,27 @@
 
 # feature enable to turn on threaded alarm processing
 # Check whether --enable-threaded-alarm was given.
-if test "${enable_threaded_alarm+set}" = set; then
+if test "${enable_threaded_alarm+set}" = set; then :
   enableval=$enable_threaded_alarm;
 fi
 
 
 if test "x$enable_threaded_alarm" = "xyes" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define USE_THREADED_ALARM 1
-_ACEOF
+$as_echo "#define USE_THREADED_ALARM 1" >>confdefs.h
 
 fi
 
 # control whether dladdr is used to lookup function names. Default is to use it.
 # Check whether --enable-function-name-lookup was given.
-if test "${enable_function_name_lookup+set}" = set; then
+if test "${enable_function_name_lookup+set}" = set; then :
   enableval=$enable_function_name_lookup;
 fi
 
 
 if test "x$enable_function_name_lookup" = "xno" ; then
 
-cat >>confdefs.h <<\_ACEOF
-#define DISABLE_FUNCTION_NAME_LOOKUP 1
-_ACEOF
+$as_echo "#define DISABLE_FUNCTION_NAME_LOOKUP 1" >>confdefs.h
 
 fi
 
@@ -10179,8 +6539,6 @@
 
 
 
-
-
 LIBSPSO=none
 case "$host" in
 *-*-darwin*)
@@ -10268,13 +6626,13 @@
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-$as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) $as_unset $ac_var ;;
+      *) { eval $ac_var=; unset $ac_var;} ;;
       esac ;;
     esac
   done
@@ -10282,8 +6640,8 @@
   (set) 2>&1 |
     case $as_nl`(ac_space=' '; set) 2>&1` in #(
     *${as_nl}ac_space=\ *)
-      # `set' does not quote correctly, so add quotes (double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
       sed -n \
 	"s/'/'\\\\''/g;
 	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
@@ -10305,12 +6663,23 @@
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
-      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
   else
-    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
@@ -10324,14 +6693,15 @@
 
 ac_libobjs=
 ac_ltlibobjs=
+U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
   ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
   #    will be set to the directory where LIBOBJS objects are built.
-  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
@@ -10339,13 +6709,15 @@
 
 
 
-: ${CONFIG_STATUS=./config.status}
+
+: "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
 #! $SHELL
 # Generated by $as_me.
 # Run this file to recreate the current configuration.
@@ -10355,17 +6727,18 @@
 debug=false
 ac_cs_recheck=false
 ac_cs_silent=false
+
 SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
 
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
-
 # Be more Bourne compatible
 DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
@@ -10373,23 +6746,15 @@
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in
-  *posix*) set -o posix ;;
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
 esac
-
 fi
 
 
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
 as_nl='
 '
 export as_nl
@@ -10397,7 +6762,13 @@
 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
   as_echo='printf %s\n'
   as_echo_n='printf %s'
 else
@@ -10408,7 +6779,7 @@
     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
     as_echo_n_body='eval
       arg=$1;
-      case $arg in
+      case $arg in #(
       *"$as_nl"*)
 	expr "X$arg" : "X\\(.*\\)$as_nl";
 	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
@@ -10431,14 +6802,7 @@
   }
 fi
 
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
 
-
 # IFS
 # We need space, tab and new line, in precisely that order.  Quoting is
 # there to prevent editors from complaining about space-tab.
@@ -10447,15 +6811,16 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-case $0 in
+as_myself=
+case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
 IFS=$as_save_IFS
 
      ;;
@@ -10467,12 +6832,16 @@
 fi
 if test ! -f "$as_myself"; then
   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  { (exit 1); exit 1; }
+  exit 1
 fi
 
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
 done
 PS1='$ '
 PS2='> '
@@ -10484,7 +6853,89 @@
 LANGUAGE=C
 export LANGUAGE
 
-# Required to use basename.
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -10498,8 +6949,12 @@
   as_basename=false
 fi
 
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
 
-# Name of the executable.
 as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
@@ -10519,76 +6974,25 @@
 	  }
 	  s/.*/./; q'`
 
-# CDPATH.
-$as_unset CDPATH
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-
-
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
-  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
-  # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line after each line using $LINENO; the second 'sed'
-  # does the real work.  The second script uses 'N' to pair each
-  # line-number line with the line containing $LINENO, and appends
-  # trailing '-' during substitution so that $LINENO is not a special
-  # case at line end.
-  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # scripts with optimization help from Paolo Bonzini.  Blame Lee
-  # E. McMahon (1931-1989) for sed's syntax.  :-)
-  sed -n '
-    p
-    /[$]LINENO/=
-  ' <$as_myself |
-    sed '
-      s/[$]LINENO.*/&-/
-      t lineno
-      b
-      :lineno
-      N
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
-      t loop
-      s/-\n.*//
-    ' >$as_me.lineno &&
-  chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
-   { (exit 1); exit 1; }; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensitive to this).
-  . "./$as_me.lineno"
-  # Exit status is that of the last command.
-  exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
 ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
+case `echo -n x` in #(((((
 -n*)
-  case `echo 'x\c'` in
+  case `echo 'xy\c'` in
   *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  *)   ECHO_C='\c';;
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
   esac;;
 *)
   ECHO_N='-n';;
 esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
 
 rm -f conf$$ conf$$.exe conf$$.file
 if test -d conf$$.dir; then
@@ -10603,50 +7007,86 @@
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
 
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
 
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
@@ -10655,13 +7095,19 @@
 
 
 exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
 
-# Save the log message, to keep $[0] and so on meaningful, and to
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
 This file was extended by Spread_Util $as_me 4.3.0, which was
-generated by GNU Autoconf 2.62.  Invocation command line was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -10674,6 +7120,15 @@
 
 _ACEOF
 
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # Files that config.status was made for.
 config_files="$ac_config_files"
@@ -10683,19 +7138,22 @@
 
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
 
-Usage: $0 [OPTIONS] [FILE]...
+Usage: $0 [OPTION]... [TAG]...
 
   -h, --help       print this help, then exit
   -V, --version    print version number and configuration settings, then exit
-  -q, --quiet      do not print progress messages
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
+      --file=FILE[:TEMPLATE]
                    instantiate the configuration file FILE
-  --header=FILE[:TEMPLATE]
+      --header=FILE[:TEMPLATE]
                    instantiate the configuration header FILE
 
 Configuration files:
@@ -10704,16 +7162,17 @@
 Configuration headers:
 $config_headers
 
-Report bugs to <bug-autoconf at gnu.org>."
+Report bugs to the package provider."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 Spread_Util config.status 4.3.0
-configured by $0, generated by GNU Autoconf 2.62,
-  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.69,
+  with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2008 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -10729,11 +7188,16 @@
 while test $# != 0
 do
   case $1 in
-  --*=*)
+  --*=?*)
     ac_option=`expr "X$1" : 'X\([^=]*\)='`
     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
   *)
     ac_option=$1
     ac_optarg=$2
@@ -10747,27 +7211,29 @@
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
     $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
     case $ac_optarg in
     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
     esac
-    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
     ac_need_defaults=false;;
   --header | --heade | --head | --hea )
     $ac_shift
     case $ac_optarg in
     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
-    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
-    { $as_echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; };;
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
   --help | --hel | -h )
     $as_echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
@@ -10775,11 +7241,10 @@
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { $as_echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; } ;;
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
 
-  *) ac_config_targets="$ac_config_targets $1"
+  *) as_fn_append ac_config_targets " $1"
      ac_need_defaults=false ;;
 
   esac
@@ -10796,7 +7261,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -10831,9 +7296,7 @@
     "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
     "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
 
-  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-   { (exit 1); exit 1; }; };;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -10855,26 +7318,24 @@
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp=
+  tmp= ac_tmp=
   trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
 ' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
+  trap 'as_fn_exit 1' 1 2 13 15
 }
 # Create a (secure) tmp directory for tmp files.
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
-} ||
-{
-   $as_echo "$as_me: cannot create a temporary directory in ." >&2
-   { (exit 1); exit 1; }
-}
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -10882,8 +7343,13 @@
 if test -n "$CONFIG_FILES"; then
 
 
-ac_cr='
-'
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
   ac_cs_awk_cr='\\r'
@@ -10891,7 +7357,7 @@
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -10900,23 +7366,18 @@
   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
   echo "_ACEOF"
 } >conf$$subs.sh ||
-  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   . ./conf$$subs.sh ||
-    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` = $ac_delim_num; then
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
-    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -10924,7 +7385,7 @@
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -10938,7 +7399,7 @@
 t delim
 :nl
 h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
 t more1
 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
 p
@@ -10952,7 +7413,7 @@
 t nl
 :delim
 h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
 t more2
 s/["\\]/\\&/g; s/^/"/; s/$/"/
 p
@@ -10972,7 +7433,7 @@
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
@@ -11004,23 +7465,29 @@
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
-$as_echo "$as_me: error: could not setup config files machinery" >&2;}
-   { (exit 1); exit 1; }; }
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
 # trailing colons and then remove the whole line if VPATH becomes empty
 # (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[	 ]*\):*/\1/
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
 s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
 s/^[^=]*=[	 ]*$//
 }'
 fi
@@ -11032,7 +7499,7 @@
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -11044,13 +7511,11 @@
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
     break
   elif $ac_last_try; then
-    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
-$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
-   { (exit 1); exit 1; }; }
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -11116,9 +7581,9 @@
   }
   split(mac1, mac2, "(") #)
   macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
   if (D_is_set[macro]) {
     # Preserve the white space surrounding the "#".
-    prefix = substr(line, 1, index(line, defundef) - 1)
     print prefix "define", macro P[macro] D[macro]
     next
   } else {
@@ -11126,7 +7591,7 @@
     # in the case of _POSIX_SOURCE, which is predefined and required
     # on some systems where configure will not decide to define it.
     if (defundef == "undef") {
-      print "/*", line, "*/"
+      print "/*", prefix defundef, macro, "*/"
       next
     }
   }
@@ -11135,9 +7600,7 @@
 _ACAWK
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
-$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
 fi # test -n "$CONFIG_HEADERS"
 
 
@@ -11150,9 +7613,7 @@
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-$as_echo "$as_me: error: Invalid tag $ac_tag." >&2;}
-   { (exit 1); exit 1; }; };;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -11171,7 +7632,7 @@
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$tmp/stdin";;
+      -) ac_f="$ac_tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
@@ -11180,12 +7641,10 @@
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
-   { (exit 1); exit 1; }; };;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
-      ac_file_inputs="$ac_file_inputs '$ac_f'"
+      as_fn_append ac_file_inputs " '$ac_f'"
     done
 
     # Let's still pretend it is `configure' which instantiates (i.e., don't
@@ -11196,7 +7655,7 @@
 	`' by configure.'
     if test x"$ac_file" != x-; then
       configure_input="$ac_file.  $configure_input"
-      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
 $as_echo "$as_me: creating $ac_file" >&6;}
     fi
     # Neutralize special characters interpreted by sed in replacement strings.
@@ -11208,10 +7667,8 @@
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; } ;;
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -11239,47 +7696,7 @@
 	    q
 	  }
 	  s/.*/./; q'`
-  { as_dir="$ac_dir"
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
-   { (exit 1); exit 1; }; }; }
+  as_dir="$ac_dir"; as_fn_mkdir_p
   ac_builddir=.
 
 case "$ac_dir" in
@@ -11331,7 +7748,6 @@
 # If the template does not know about datarootdir, expand it.
 # FIXME: This hack should be removed a few years after 2.60.
 ac_datarootdir_hack=; ac_datarootdir_seen=
-
 ac_sed_dataroot='
 /datarootdir/ {
   p
@@ -11341,12 +7757,11 @@
 /@docdir@/p
 /@infodir@/p
 /@localedir@/p
-/@mandir@/p
-'
+/@mandir@/p'
 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
 *datarootdir*) ac_datarootdir_seen=yes;;
 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
@@ -11356,7 +7771,7 @@
   s&@infodir@&$infodir&g
   s&@localedir@&$localedir&g
   s&@mandir@&$mandir&g
-    s&\\\${datarootdir}&$datarootdir&g' ;;
+  s&\\\${datarootdir}&$datarootdir&g' ;;
 esac
 _ACEOF
 
@@ -11383,27 +7798,24 @@
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
-  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&5
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined." >&2;}
+which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$tmp/stdin"
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
   esac \
-  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
   :H)
   #
@@ -11412,27 +7824,21 @@
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
-      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
-      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
-	|| { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
-$as_echo "$as_me: error: could not create $ac_file" >&2;}
-   { (exit 1); exit 1; }; }
+      mv "$ac_tmp/config.h" "$ac_file" \
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
-      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
-$as_echo "$as_me: error: could not create -" >&2;}
-   { (exit 1); exit 1; }; }
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
   fi
  ;;
 
@@ -11442,15 +7848,12 @@
 done # for ac_tag
 
 
-{ (exit 0); exit 0; }
+as_fn_exit 0
 _ACEOF
-chmod +x $CONFIG_STATUS
 ac_clean_files=$ac_clean_files_save
 
 test $ac_write_fail = 0 ||
-  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
 
 
 # configure is writing to config.log, and then calls config.status.
@@ -11471,11 +7874,11 @@
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
-  $ac_cs_success || { (exit 1); exit 1; }
+  $ac_cs_success || as_fn_exit 1
 fi
 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-  { $as_echo "$as_me:$LINENO: WARNING: Unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: Unrecognized options: $ac_unrecognized_opts" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
 

Modified: trunk/libspread-util/configure.in
===================================================================
--- trunk/libspread-util/configure.in	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread-util/configure.in	2016-11-14 17:40:56 UTC (rev 861)
@@ -101,7 +101,7 @@
 AC_FUNC_STRFTIME
 
 # Checks for header files.
-AC_CHECK_HEADERS(arpa/inet.h assert.h errno.h grp.h limits.h netdb.h netinet/in.h netinet/tcp.h process.h pthread.h pwd.h signal.h stdarg.h stdint.h stdio.h stdlib.h string.h sys/inttypes.h sys/ioctl.h sys/param.h sys/socket.h sys/stat.h sys/time.h sys/timeb.h sys/types.h sys/uio.h sys/un.h sys/filio.h time.h unistd.h windows.h winsock.h)
+AC_CHECK_HEADERS(arpa/inet.h assert.h errno.h grp.h limits.h netdb.h netinet/in.h netinet/tcp.h process.h pthread.h pwd.h signal.h stdarg.h stdint.h stdio.h stdlib.h string.h sys/inttypes.h sys/ioctl.h sys/param.h sys/socket.h sys/stat.h sys/time.h sys/timeb.h sys/types.h sys/uio.h sys/un.h sys/filio.h time.h unistd.h winsock2.h ws2tcpip.h)
 
 dnl    Checks for library functions.
 AC_CHECK_FUNCS(bcopy inet_aton inet_ntoa inet_ntop memmove setsid snprintf strerror lrand48)
@@ -218,7 +218,7 @@
 	AC_TRY_COMPILE(
 		[ #include <sys/types.h>
 		  #include <sys/socket.h> ], 
-		[ static  struct  msghdr msg; msg.msg_namelen = 1; ], 
+		[ static  struct  msghdr msg; msg.msg_name = 0; msg.msg_namelen = 1; msg.msg_iov = 0; msg.msg_iovlen = 0; ], 
 		[ ac_cv_have_struct_msghdr="yes" ],
 		[ ac_cv_have_struct_msghdr="no" ]
 	)

Copied: trunk/libspread-util/include/spu_addr.h (from rev 845, branches/spread_5/libspread-util/include/spu_addr.h)
===================================================================
--- trunk/libspread-util/include/spu_addr.h	                        (rev 0)
+++ trunk/libspread-util/include/spu_addr.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -0,0 +1,106 @@
+/*
+ * The Spread Toolkit.
+ *     
+ * The contents of this file are subject to the Spread Open-Source
+ * License, Version 1.0 (the ``License''); you may not use
+ * this file except in compliance with the License.  You may obtain a
+ * copy of the License at:
+ *
+ * http://www.spread.org/license/
+ *
+ * or in the file ``license.txt'' found in this distribution.
+ *
+ * Software distributed under the License is distributed on an AS IS basis, 
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
+ * for the specific language governing rights and limitations under the 
+ * License.
+ *
+ * The Creators of Spread are:
+ *  Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz.
+ *
+ *  Copyright (C) 1993-2013 Spread Concepts LLC <info at spreadconcepts.com>
+ *
+ *  All Rights Reserved.
+ *
+ * Major Contributor(s):
+ * ---------------
+ *    Ryan Caudy           rcaudy at gmail.com - contributions to process groups.
+ *    Claudiu Danilov      claudiu at acm.org - scalable wide area support.
+ *    Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
+ *    Theo Schlossnagle    jesus at omniti.com - Perl, autoconf, old skiplist.
+ *    Dan Schoenblum       dansch at cnds.jhu.edu - Java interface.
+ *
+ */
+
+#ifndef INC_SPU_ADDR_H
+#define INC_SPU_ADDR_H
+
+#include "spu_system.h"
+
+#include <stddef.h>
+
+#ifdef SPU_ARCH_PC_WIN95
+#  include <winsock2.h>
+#  include <ws2tcpip.h>
+#else
+#  include <sys/types.h>
+#  include <sys/socket.h>
+#  include <sys/un.h>
+#  include <netinet/in.h>
+#endif
+
+#define SPU_ADDR_STRSIZE    256
+#define SPU_ADDR_IP_STRSIZE 46
+
+/* NOTE: these macros return the same global buffer, so you typically can't call this fcn multiple times in a single statement (e.g. - in a fcn parameter list) */
+
+#define SPU_ADDR_NTOP(a)       (spu_addr_ntop_r((a),       Spu_addr_ntop_buf, SPU_ADDR_STRSIZE) ? "address conversion failed" : Spu_addr_ntop_buf)
+#define SPU_ADDR_NTOP_CANON(a) (spu_addr_ntop_canon_r((a), Spu_addr_ntop_buf, SPU_ADDR_STRSIZE) ? "address conversion failed" : Spu_addr_ntop_buf)
+
+extern char Spu_addr_ntop_buf[SPU_ADDR_STRSIZE];
+
+typedef union
+{
+  int                     dmy_init;  /* NOTE: Only use this for static initialization! It *DOES NOT* map to sa_family, sin_family, etc.! */
+  struct sockaddr         addr;
+  struct sockaddr_in      ipv4;
+  struct sockaddr_in6     ipv6;
+  struct sockaddr_storage storage;
+
+#ifndef SPU_ARCH_PC_WIN95
+  struct sockaddr_un      un;
+#endif
+
+} spu_addr;
+
+int       spu_addr_from_sockaddr(spu_addr *a, const struct sockaddr *sa, socklen_t sa_len);
+int       spu_addr_from_str(spu_addr *a, const char *str, int pfamily, int is_numeric);
+
+int       spu_addr_family(const spu_addr *a);
+
+int       spu_addr_ntop_r(const spu_addr *a, char *str, size_t n);
+int       spu_addr_ntop_canon_r(const spu_addr *a, char *str, size_t n);
+
+/* NOTE: the following functions are only valid for families: AF_UNSPEC (0), AF_INET, AF_INET6 and AF_UNIX; will exit on other types */
+
+int         spu_addr_from_sockaddr_known(spu_addr *a, const struct sockaddr *sa);
+socklen_t   spu_addr_len(const spu_addr *a);
+const char *spu_addr_family_str(const spu_addr *a);
+
+const char *spu_af_str(int afamily);
+
+/* NOTE: the following functions are only valid for AF_INET and AF_INET6; will exit on other types */
+
+int       spu_addr_ip_cmp(const spu_addr *l, const spu_addr *r, int include_port);   /* NOTE: only compares address + optionally port */
+int       spu_addr_ip_is_unspecified(const spu_addr *a);
+int       spu_addr_ip_is_loopback(const spu_addr *a);
+int       spu_addr_ip_is_multicast(const spu_addr *a);
+int       spu_addr_ip_is_linklocal(const spu_addr *a);
+int       spu_addr_ip_is_sitelocal(const spu_addr *a);
+
+void      spu_addr_ip_set_unspecified(spu_addr *a);        /* sets address to be unspecified (e.g. - INADDR_ANY); no other fields (e.g. - port) are affected */
+
+int16u    spu_addr_ip_get_port(const spu_addr *a);         /* NOTE: host byte order */
+void      spu_addr_ip_set_port(spu_addr *a, int16u port);  /* NOTE: host byte order */
+
+#endif

Modified: trunk/libspread-util/include/spu_alarm.h
===================================================================
--- trunk/libspread-util/include/spu_alarm.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread-util/include/spu_alarm.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -32,24 +32,51 @@
  *
  */
 
-
 #ifndef INC_ALARM
 #define INC_ALARM
 
 #include <stdio.h>
 #include "spu_system.h"
 
+/* SPCLAMP can be useful with snprintfs:
+   {
+     char msg[10], *c = msg, *e = msg + sizeof(msg);
+
+     c += snprintf(c, SPCLAMP(c, e), "hello world!\n");
+     c += snprintf(c, SPCLAMP(c, e), "neato!\n");
+     c += snprintf(c, SPCLAMP(c, e), "how many we doing?!\n");
+     and so on ...
+
+     when done, if you care, check if you overfilled (but not
+     overran!) your nul terminated buffer (termination guaranteed so
+     long as c < e initially):
+
+     if (c > e)
+       do stuff;
+
+     (c - msg) is how many characters you tried to write
+   }
+
+   Note, this isn't 100% standards compliant bc pointer arithmetic and
+   comparison beyond the end of an array isn't guaranteed to be
+   meaningful and valid, but it will work on most sane architectures.
+ */
+#define SPCLAMP(x, y) ((x) < (y) ? (y) - (x) : 0)
+
 /* Type for Alarm realtime handler functions */
 typedef int (alarm_realtime_handler)( int16, int32, char *, size_t, char *, size_t);
 
+/* These are always defined for any project using this library */
+#define		ALL		0xffffffff
+#define 	EXIT  		0x00000001   /* Program will print then exit() or abort() */
+#define		DATA_LINK	0x00000002
+#define         MEMORY          0x00000004
+#define		EVENTS		0x00000008
+#define		NONE		0x00000000
 
 /* This includes the custom types for each project */
 #include "spu_alarm_types.h"
 
-/* These are always defined for any project using Alarm */
-#define		ALL		0xffffffff
-#define		NONE		0x00000000
-
 /* Priority levels */
 #define         SPLOG_DEBUG     0x0001       /* Program information that is only useful for debugging. 
                                                 Will normally be turned off in operation. */
@@ -60,9 +87,9 @@
 #define         SPLOG_ERROR     0x0004       /* Program encountered an error that can be recovered from. */
 #define         SPLOG_CRITICAL  0x0005       /* Program will not exit, but has only temporarily recovered 
                                                 and without help may soon fail. */
-#define         SPLOG_FATAL     0x0006       /* Program will exit() or abort(). */
+#define         SPLOG_PRINT     0x0006       /* Program will always print, regardless of mask */
+#define         SPLOG_FATAL     0x0007       /* Program will always print, regardless of mask, then exit() or abort(). */
 
-#define         SPLOG_PRINT     0x0007       /* Program should always print this information */
 
 #define         SPLOG_PRIORITY_FIELDS 0x000f
 
@@ -72,31 +99,36 @@
                                                 This is used for alerts you want sent now and not just logged (they are also logged). */
 #define         SPLOG_PRIORITY_FLAGS 0x00f0
 
-#ifdef  HAVE_GOOD_VARGS
-void Alarmp( int16 priority, int32 type, char *message, ...);
-void Alarm( int32 type, char *message, ...);
+/* Can be used to conditionally skip calls to Alarmp (e.g. - expensive parameter evaluation, repeatedly called, etc.) */
 
-#else
-void Alarm();
-#endif
+#define ALARMP_NEEDED(p, m) (                                           \
+    ( (m) & EXIT ) ||                                                   \
+    ( ( (p) & SPLOG_PRIORITY_FIELDS ) >= SPLOG_PRINT ) ||               \
+    ( ( (p) & SPLOG_PRIORITY_FIELDS ) >= Alarm_cur_priority && ( (m) & Alarm_type_mask ) ) )
 
-void Alarm_set_output(char *filename);
+extern int32u Alarm_type_mask;
+extern int16u Alarm_cur_priority;
 
-void Alarm_enable_timestamp(const char *format);
-void Alarm_enable_timestamp_high_res(const char *format);
-void Alarm_disable_timestamp(void);
+void  Alarmp(int16 priority, int32 type, char *message, ...);
+void  Alarm(int32 type, char *message, ...);
 
-void Alarm_set_types(int32 mask);
-void Alarm_clear_types(int32 mask);
+void  Alarm_set_output(char *filename);
+
+void  Alarm_enable_timestamp(const char *format);
+void  Alarm_enable_timestamp_high_res(const char *format);
+void  Alarm_disable_timestamp(void);
+
+void  Alarm_set_types(int32 mask);
+void  Alarm_clear_types(int32 mask);
 int32 Alarm_get_types(void);
 
-void Alarm_set_priority(int16 priority);
+void  Alarm_set_priority(int16 priority);
 int16 Alarm_get_priority(void);
 
-void Alarm_set_realtime_print_handler( alarm_realtime_handler *output_message_function );
+void  Alarm_set_realtime_print_handler( alarm_realtime_handler *output_message_function );
 
-void Alarm_set_interactive(void);
-int  Alarm_get_interactive(void);
+void  Alarm_set_interactive(void);
+int   Alarm_get_interactive(void);
 
 #define IPF "%d.%d.%d.%d"
 

Modified: trunk/libspread-util/include/spu_alarm_types.h
===================================================================
--- trunk/libspread-util/include/spu_alarm_types.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread-util/include/spu_alarm_types.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -49,13 +49,9 @@
  * The defines must be consistent amoung all code that will be compiled together, 
  * but can be different for different executables 
  */
-#define		DEBUG		0x00000001
-#define 	EXIT  		0x00000002
-#define		PRINT		0x00000004
-/* new type to replace general prints */
-#define     SYSTEM      0x00000004
+#define		PRINT		0x00000010
+#define         SYSTEM          0x00000010  /* NOTE: same as PRINT */
 
-#define		DATA_LINK	0x00000010
 #define		NETWORK		0x00000020
 #define		PROTOCOL	0x00000040
 #define		SESSION		0x00000080
@@ -63,12 +59,11 @@
 #define		MEMB		0x00000200
 #define		FLOW_CONTROL	0x00000400
 #define		STATUS		0x00000800
-#define		EVENTS		0x00001000
+#define		DEBUG		0x00001000
 #define		GROUPS		0x00002000
 
 #define         HOP             0x00004000
 #define         OBJ_HANDLER     0x00008000
-#define         MEMORY          0x00010000
 #define         ROUTE           0x00020000
 #define         QOS             0x00040000
 #define         RING            0x00080000

Deleted: trunk/libspread-util/include/spu_compatibility.h
===================================================================
--- trunk/libspread-util/include/spu_compatibility.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread-util/include/spu_compatibility.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -1,58 +0,0 @@
-/*
- * The Spread Toolkit.
- *     
- * The contents of this file are subject to the Spread Open-Source
- * License, Version 1.0 (the ``License''); you may not use
- * this file except in compliance with the License.  You may obtain a
- * copy of the License at:
- *
- * http://www.spread.org/license/
- *
- * or in the file ``license.txt'' found in this distribution.
- *
- * Software distributed under the License is distributed on an AS IS basis, 
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
- * for the specific language governing rights and limitations under the 
- * License.
- *
- * The Creators of Spread are:
- *  Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz.
- *
- *  Copyright (C) 1993-2013 Spread Concepts LLC <info at spreadconcepts.com>
- *
- *  All Rights Reserved.
- *
- * Major Contributor(s):
- * ---------------
- *    Ryan Caudy           rcaudy at gmail.com - contributions to process groups.
- *    Claudiu Danilov      claudiu at acm.org - scalable wide area support.
- *    Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
- *    Theo Schlossnagle    jesus at omniti.com - Perl, autoconf, old skiplist.
- *    Dan Schoenblum       dansch at cnds.jhu.edu - Java interface.
- *
- */
-
-
-/* spu_compatibility.h 
- *  backwards compatible declarations of API functions
- * Copyright 2012 Jonathan Stanton <jonathan at spread.org> 
- *
- */
-
-#ifndef SPU_COMPATIBILITY_H
-#define SPU_COMPATIBILITY_H
-
-
-/* If we need the old API for these sets of functions
- * enable this and the old API names will work and map to the new functions
- */
-#ifdef SPU_ENABLE_OLD_API
-
-#define Alarm   SPU_Alarm
-#define Alarmp  SPU_Alarmp
-
-#endif
-
-#endif /* SPU_COMPATIBILITY_H */
-
-

Modified: trunk/libspread-util/include/spu_data_link.h
===================================================================
--- trunk/libspread-util/include/spu_data_link.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread-util/include/spu_data_link.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -38,8 +38,9 @@
 
 #include "spu_system.h"
 #include "spu_scatter.h"
+#include "spu_addr.h"
 
-#define		MAX_PACKET_SIZE		1472    /*1472 = 1536-64 (of udp)*/
+#define		MAX_PACKET_SIZE		1472    /* 1472 = 1536 - 64 (of typical udp/ip/eth headers) */
 
 #define		SEND_CHANNEL	0x00000001
 #define		RECV_CHANNEL    0x00000002
@@ -47,13 +48,21 @@
 #define         REUSE_ADDR      0x00000008
 #define         DL_BIND_ALL     0x00000010
 
-#define         IS_MCAST_ADDR(addr)     ( ( (addr) & 0xF0000000 ) == 0xE0000000 )
-#define         IS_MCAST_ADDR_NET(addr) ( ( (unsigned char*) &(addr) )[0] == 0xE0 )
+#define         IS_MCAST_ADDR(addr32)     ( ( (addr32) & 0xF0000000 ) == 0xE0000000 )    /* host byte order */
+#define         IS_MCAST_ADDR_NET(addr32) ( ( (unsigned char*) &(addr32) )[0] == 0xE0 )  /* network byte order */
 
+void    DL_close_channel(channel chan);
+
 channel	DL_init_channel( int32 channel_type, int16 port, int32 mcast_address, int32 interface_address );
-void    DL_close_channel(channel chan);
-int	DL_send( channel chan, int32 address, int16 port, sys_scatter *scat );
+int	DL_send( channel chan, int32 address, int16 port, const sys_scatter *scat );
 int	DL_recv( channel chan, sys_scatter *scat );
 int	DL_recvfrom( channel chan, sys_scatter *scat, int *src_address, unsigned short *src_port );
 
-#endif  /* INC_DATA_LINK */
+channel DL_init_channel_gen(int32 channel_type, const spu_addr *mcast_address, const spu_addr *interface_address);
+int     DL_join_multicast_gen(channel chan, const spu_addr *mcast_addr, const spu_addr *if_addr);
+int     DL_send_gen(channel chan, const sys_scatter *scat);
+int     DL_recv_gen(channel chan, sys_scatter *scat);
+int     DL_sendto_gen(channel chan, const sys_scatter *scat, const spu_addr *dst);
+int     DL_recvfrom_gen(channel chan, sys_scatter *scat, spu_addr *src);
+
+#endif

Modified: trunk/libspread-util/src/Makefile.in
===================================================================
--- trunk/libspread-util/src/Makefile.in	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread-util/src/Makefile.in	2016-11-14 17:40:56 UTC (rev 861)
@@ -62,7 +62,7 @@
 
 TARGETS=libspread-util.a libspread-util.sa @LIBSPSO@
 
-LIB_OBJS=alarm.o events.o memory.o data_link.o
+LIB_OBJS=alarm.o events.o memory.o data_link.o spu_addr.o
 
 LIB_SHOBJS=$(LIB_OBJS:.o=.lo)
 

Modified: trunk/libspread-util/src/alarm.c
===================================================================
--- trunk/libspread-util/src/alarm.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread-util/src/alarm.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -33,33 +33,34 @@
  */
 
 #include "arch.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <assert.h>
 
-/* undef redefined variables under windows */
+/* NOTE: undef redefined errno values under windows in arch.h */
 #ifdef ARCH_PC_WIN95
+#  undef EINVAL
 #  undef EINTR
 #  undef EAGAIN
 #  undef EWOULDBLOCK
 #  undef EINPROGRESS
 #  undef EALREADY
+#  undef EIO
+#  undef ENOMEM
 #  ifndef va_copy
 #    define va_copy(d,s) ((d) = (s))
 #  endif
 #endif
 #include <errno.h>
 
-#ifdef HAVE_GOOD_VARGS
-#  include <stdarg.h>
-#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <time.h>
+#include <assert.h>
 
 #include "spu_alarm.h"
 #include "spu_events.h"
 
-#define MAX_ALARM_MESSAGE_BUF 256
+#define MAX_ALARM_MESSAGE_BUF 512
 
 static const char Alarm_Warning_High_Res[]  = "*** WARNING *** Alarmp: High precision timestamp output failed!\n";
 static const char Alarm_Warning_Timestamp[] = "*** WARNING *** Alarmp: Timestamp didn't fit in default size buffer!\n";
@@ -72,8 +73,8 @@
 static void Threaded_Alarm_Exit(void);
 #endif
 
-static int32    Alarm_type_mask = PRINT | EXIT  ;
-static int16    Alarm_cur_priority = SPLOG_DEBUG ;
+int32u Alarm_type_mask    = (PRINT | EXIT);
+int16u Alarm_cur_priority = SPLOG_DEBUG;
 
 static alarm_realtime_handler *Alarm_realtime_print_handler = NULL;
 
@@ -85,23 +86,6 @@
 
 static int      AlarmInteractiveProgram = FALSE;
 
-/* priority_level_active returns true if the priority level is active (i.e. should be printed)
- * given the currently allowed priority levels.
- */
-static bool priority_level_active( int16 priority )
-{
-    return( Alarm_cur_priority <= ( priority & SPLOG_PRIORITY_FIELDS ) );
-}
-
-/* is_priority_set() checks whether the specific priority_to_check value is set
- * in the 'priority' variable passed in.
- * If value is set, then it returns true, otherwise it returns false. 
- */
-static bool is_priority_set( int16 priority, int16 priority_to_check )
-{
-    return( (priority & SPLOG_PRIORITY_FIELDS) == priority_to_check );
-}
-
 /* is_priority_flag_active() checks whether the specific priority_flag is set
  * in the 'priority' variable passed in.
  * If flag is set, then it returns true, otherwise it returns false. 
@@ -120,14 +104,12 @@
 #endif
 }
 
-#ifdef HAVE_GOOD_VARGS
-
 static void Internal_Alarmp(int16 priority, int32 mask, char *message, va_list ap)
 {
-    /* log event if in mask and of higher priority, or if FATAL event, always log */
-
-    if (((Alarm_type_mask & mask) != 0 && priority_level_active(priority)) || is_priority_set(priority, SPLOG_FATAL)) {
-
+    if ( ALARMP_NEEDED( priority, mask ) )
+    {
+        int       will_exit = ( ( mask & EXIT ) || ( priority & SPLOG_PRIORITY_FIELDS ) == SPLOG_FATAL );
+      
         char      buf[MAX_ALARM_MESSAGE_BUF];
         char     *alloc_buf = NULL;
         char     *tot_ptr   = buf;
@@ -138,73 +120,81 @@
         int       msg_len   = 0;
         int       tmp;
         time_t    time_now;
-        struct tm tm_now;
+        struct tm tm_now, *tm_ptr;
         va_list   ap_copy;
 	sp_time   t;
 
-        if (Alarm_timestamp_format != NULL && !is_priority_flag_active(priority, SPLOG_NODATE)) {
-
+        if (Alarm_timestamp_format != NULL && !is_priority_flag_active(priority, SPLOG_NODATE))
+        {
 	    t        = E_get_time();
 	    time_now = t.sec;
 	    
-#ifdef HAVE_LOCALTIME_R
-            localtime_r(&tm_now, &time_now);
+#ifndef HAVE_LOCALTIME_R
+            tm_ptr = localtime(&time_now);  /* NOTE: not thread safe; but hopefully worst case is we get an incorrect timestamp */
 #else
-            tm_now = *localtime(&time_now);  /* NOTE: not thread safe; but worst case is we get an incorrect timestamp */
+            tm_ptr = localtime_r(&tm_now, &time_now);
 #endif
 
-            ts_len = (int) strftime(ts_ptr, MAX_ALARM_MESSAGE_BUF - 1, Alarm_timestamp_format, &tm_now);  /* reserve 1 char for space appended below */
+            if (tm_ptr != NULL)
+            {
+#ifndef HAVE_LOCALTIME_R
+              tm_now = *tm_ptr;
+#endif
+              ts_len = (int) strftime(ts_ptr, MAX_ALARM_MESSAGE_BUF - 1, Alarm_timestamp_format, &tm_now);  /* reserve 1 char for space appended below */
+            }
+            else                                                                                            /* on localtime failure just print secs since epoch */
+              ts_len = (int) snprintf(ts_ptr, MAX_ALARM_MESSAGE_BUF - 1, "%ld", (long) t.sec);              /* reserve 1 char for space appended below */
 
 	    /* ensure ts_len in half open range [0, MAX_ALARM_MESSAGE_BUF - 1) */
 
-	    if (ts_len >= MAX_ALARM_MESSAGE_BUF - 1) {
+	    if (ts_len >= MAX_ALARM_MESSAGE_BUF - 1)
 	        ts_len = MAX_ALARM_MESSAGE_BUF - 2;
-	    }
 
-	    if (ts_len < 0) {
+	    if (ts_len < 0)
 	        ts_len = 0;
-	    }
 
 	    ts_ptr[ts_len] = '\0';
 
-            if (ts_len != 0) {  /* strftime output successfully fit into ts_ptr; optionally append sub-second precision */
+            if (ts_len != 0)  /* strftime output (possibly truncated) successfully fit into ts_ptr; optionally append sub-second precision */
+            {
+	        if ( Alarm_timestamp_high_res )
+                {
+		    tmp = snprintf(ts_ptr + ts_len, MAX_ALARM_MESSAGE_BUF - 1 - ts_len, ".%06lu", t.usec);  /* always nul terminates bc size param >= 1 */
 
-	        if ( Alarm_timestamp_high_res ) {
-
-		    tmp = snprintf(ts_ptr + ts_len, MAX_ALARM_MESSAGE_BUF - 1 - ts_len, ".%06lu", t.usec);  /* always nul terminates */
-
-		    if (tmp != 7) {
+		    if (tmp != 7)
+                    {
 		        Output_Msg(Alarm_Warning_High_Res, sizeof(Alarm_Warning_High_Res) - 1);
 			tmp = 0;
 		    }
 
-		    if ((ts_len += tmp) >= MAX_ALARM_MESSAGE_BUF - 1) {
+		    if ((ts_len += tmp) >= MAX_ALARM_MESSAGE_BUF - 1)
+                    {
 		        Output_Msg(Alarm_Warning_Timestamp, sizeof(Alarm_Warning_Timestamp) - 1);
 		        ts_len = MAX_ALARM_MESSAGE_BUF - 2;  /* adjust ts_len to reflect snprintf truncation */
 		    }
 		}
 
-                ts_ptr[ts_len]   = ' ';        /* append space for single alarm string */
+                ts_ptr[ts_len]   = ' ';        /* append space for single alarm string; NOTE: above always ensures space for these writes */
 		ts_ptr[++ts_len] = '\0';
 
                 msg_ptr = ts_ptr + ts_len;
 		tot_len = ts_len;
-
-	    } else {
-	        Output_Msg(Alarm_Warning_Timestamp, sizeof(Alarm_Warning_Timestamp) - 1);
 	    }
+            else
+	        Output_Msg(Alarm_Warning_Timestamp, sizeof(Alarm_Warning_Timestamp) - 1);
         }
 
-        va_copy(ap_copy, ap);                               /* make a copy of param list in case of vsnprintf truncation */
-		if ((msg_len = vsnprintf(msg_ptr, MAX_ALARM_MESSAGE_BUF - tot_len, message, ap)) < 0) { /* failure; on Windows can be buffer too small */
-			msg_len = 4 * MAX_ALARM_MESSAGE_BUF;
-		}
-		tot_len += msg_len;
+        va_copy(ap_copy, ap);                              /* make a copy of param list in case of vsnprintf truncation */
+        
+        if ((msg_len = vsnprintf(msg_ptr, MAX_ALARM_MESSAGE_BUF - tot_len, message, ap)) < 0)  /* failure; on Windows can be buffer too small */
+          msg_len = 4 * MAX_ALARM_MESSAGE_BUF;
+        
+        tot_len += msg_len;
 
-        if (tot_len >= MAX_ALARM_MESSAGE_BUF) {             /* failure; try dynamically allocating a bigger buffer */
-
-            if ((alloc_buf = (char*) malloc(sizeof(Alarm_Warning_Alloc) - 1 + tot_len + 1)) != NULL) {
-
+        if (tot_len >= MAX_ALARM_MESSAGE_BUF)              /* failure; try dynamically allocating a bigger buffer */
+        {
+            if ((alloc_buf = (char*) malloc(sizeof(Alarm_Warning_Alloc) - 1 + tot_len + 1)) != NULL)
+            {
                 tot_ptr  = alloc_buf;
                 tot_len  = sizeof(Alarm_Warning_Alloc) - 1;
 		memcpy(tot_ptr, Alarm_Warning_Alloc, tot_len);                            /* prepend dynamic allocation warning string */
@@ -214,14 +204,15 @@
 		tot_len += ts_len;
 
                 msg_ptr  = ts_ptr + ts_len;
-				if ((tmp = vsnprintf(msg_ptr, msg_len + 1, message, ap_copy)) < 0) {             /* write msg after timestamp */
-					tmp = msg_len;
-				}
+                
+                if ((tmp = vsnprintf(msg_ptr, msg_len + 1, message, ap_copy)) < 0)        /* write msg after timestamp */
+                  tmp = msg_len;
+
                 msg_len  = tmp;
 		tot_len += msg_len;
-
-            } else {                                                                      /* dynamic alloc failed; overwrite warning + truncate msg in buf */
-
+            }
+            else                                                                          /* dynamic alloc failed; overwrite warning + truncate msg in buf */
+            {
 	        memcpy(tot_ptr + MAX_ALARM_MESSAGE_BUF - sizeof(Alarm_Warning_Truncate), Alarm_Warning_Truncate, sizeof(Alarm_Warning_Truncate));
                 msg_len          = MAX_ALARM_MESSAGE_BUF - ts_len - 1;
 		tot_len          = MAX_ALARM_MESSAGE_BUF - 1;
@@ -233,38 +224,33 @@
 
 	Output_Msg(tot_ptr, tot_len);
 
-        if (ts_len != 0) {
+        if (ts_len != 0)
             ts_ptr[--ts_len] = '\0';                        /* overwrite appended space between timestamp and msg with nul terminator */
-        }
 
-        if (Alarm_realtime_print_handler != NULL && 
-            (is_priority_flag_active(priority, SPLOG_REALTIME) || is_priority_set(priority, SPLOG_FATAL))) {
-
+        if (Alarm_realtime_print_handler != NULL && (will_exit || is_priority_flag_active(priority, SPLOG_REALTIME)))
+        {
             tmp = Alarm_realtime_print_handler(priority, mask, ts_ptr, ts_len, msg_ptr, msg_len);
 
-            if (tmp) {
+            if (tmp)
 	        Output_Msg(Alarm_Warning_Realtime, sizeof(Alarm_Warning_Realtime) - 1);
-            }
         }
 
-        if (alloc_buf != NULL) {                            /* clean up any dynamically allocated buffer */
+        if (alloc_buf != NULL)                              /* clean up any dynamically allocated buffer */
             free(alloc_buf);
-        }
-    }
-
-    if ((EXIT & mask) != 0 || is_priority_set(priority, SPLOG_FATAL)) {
-
+   
+        if (will_exit)
+        {
 #ifndef USE_THREADED_ALARM
-        fprintf(stdout, "Exit caused by Alarm(EXIT)\n");
+          fprintf(stdout, "Exit caused by Alarm!\n");
 #  ifndef ARCH_PC_WIN95
-        abort();
+          abort();
 #  else
-        exit(1);
+          exit(1);
 #  endif
 #else
-        Threaded_Alarm_Exit();
+          Threaded_Alarm_Exit();
 #endif
-
+        }
     }
 }
 
@@ -290,62 +276,6 @@
         va_end(ap);
 }
 
-#else
-
-void Alarm( int32 mask, char *message, 
-            void *ptr1, void *ptr2, void *ptr3, void *ptr4, 
-            void *ptr5, void *ptr6, void *ptr7, void *ptr8,
-            void *ptr9, void *ptr10, void*ptr11, void *ptr12,
-            void *ptr13, void *ptr14, void *ptr15, void *ptr16,
-            void *ptr17, void *ptr18, void *ptr19, void *ptr20)
-{
-        if ( ( Alarm_type_mask & mask ) && priority_level_active(SPLOG_WARNING) )
-        {
-            if ( Alarm_timestamp_format != NULL )
-            {
-		char timestamp[42];
-		struct tm *tm_now;
-		time_t time_now;
-		size_t length;
-		size_t length2;
-		sp_time t = E_get_time();
-
-		time_now = t.sec;
-		tm_now   = localtime(&time_now);
-		length   = strftime(timestamp, sizeof(timestamp) - 1, Alarm_timestamp_format, tm_now);  /* -1 reserves a char for appended ' ' below */
-
-		if (length != 0) {
-
-			if ( Alarm_timestamp_high_res && length <= sizeof(timestamp) - 1 ) {
-
-				if ((length2 = snprintf(timestamp + length, sizeof(timestamp) - 1 - length, ".%06lu", t.usec)) < sizeof(timestamp) - 1 - length) {
-					length += length2;
-				}
-				/* else attempted print will be overwritten immediately below by appending ' ' */
-			}
-
-			timestamp[length]   = ' ';
-			timestamp[++length] = '\0';
-			fwrite(timestamp, sizeof(char), length, stdout);
-			timestamp[--length] = '\0';
-		}
-            }
-            printf(message, ptr1, ptr2, ptr3, ptr4, ptr5, ptr6, ptr7, ptr8, ptr9, ptr10, ptr11, ptr12, ptr13, ptr14, ptr15, ptr16, ptr17, ptr18, ptr19, ptr20 );
-
-        }
-        if ( EXIT & mask )
-        {
-            printf("Exit caused by Alarm(EXIT)\n");
-#ifndef ARCH_PC_WIN95
-            abort();
-#else
-            exit( 1 );
-#endif
-        }
-}
-
-#endif /* HAVE_GOOD_VARGS */
-
 void Alarm_set_interactive(void) 
 {
         AlarmInteractiveProgram = TRUE;
@@ -710,7 +640,7 @@
       }
     }
 
-    fprintf(stdout, "Exit caused by Alarm(EXIT)\n");
+    fprintf(stdout, "Exit caused by Alarm!\n");
 #ifndef ARCH_PC_WIN95
     abort();
 #else

Modified: trunk/libspread-util/src/arch.c
===================================================================
--- trunk/libspread-util/src/arch.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread-util/src/arch.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -32,13 +32,13 @@
  *
  */
 
-
 #include "arch.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 
 #ifdef ARCH_PC_WIN95
-#  include <winsock.h>
+#  include <winsock2.h>
 #endif
 
 #ifndef HAVE_STRERROR
@@ -58,52 +58,38 @@
 #endif
 
 #ifdef ARCH_PC_WIN95
-/* return value only valid until next call to sock_strerror */
 
-char *sock_strerror( int err )
+char *sock_strerror(int err)
 {
-        switch( err ) {
-        case WSANOTINITIALISED:
-            return "WSANOTINITIALISED: A successful WSAStartup() must occur before using this function.";
-        case WSAENETDOWN:
-            return "WSAENETDOWN: The network subsystem has failed.";
-        case WSAEACCES:
-            return "WSAEACCES: The requested address is a broadcast address. Call setsockopt with the SO_BROADCAST parameter to allow the use of the broadcast address.";
-        case WSAEINTR:
-            return "WSAEINTR: A blocking Windows Sockets call was canceled through WSACancelBlockingCall.";
-        case WSAEINPROGRESS:
-            return "WSAEINPROGRESS: A blocking Windows Sockets call is in progress, or the service provider is still processing a callback function.";
-        case WSAEFAULT:
-            return "WSAEFAULT: The buf parameter is not completely contained in a valid part of the user address space." ;
-        case WSAENETRESET:
-            return "WSAENETRESET: The connection has been broken due to the keep-alive activity detecting a failure while the operation was in progress.";
-        case WSAENOBUFS:
-            return "WSAENOBUFS: No buffer space is available.";
-        case WSAENOTCONN:
-            return "WSAENOTCONN: The socket is not connected.";
-        case WSAENOTSOCK:
-            return "WSAENOTSOCK: The descriptor is not a socket.";
-        case WSAEOPNOTSUPP:
-            return "WSAEOPNOTSUPP: Operation not supported.";
-        case WSAESHUTDOWN:
-            return "WSAESHUTDOWN The socket has been shut down; it is not possible to send on a socket after shutdown has been invoked with how set to SD_SEND or SD_BOTH.";
-        case WSAEWOULDBLOCK:
-            return "WSAEWOULDBLOCK: The socket is marked as nonblocking and the requested operation would block.";
-        case WSAEMSGSIZE:
-            return "WSAEMSGSIZE: The socket is message oriented, and the message is larger than the maximum supported by the underlying transport.";
-        case WSAEHOSTUNREACH:
-            return "WSAEHOSTUNREACH: The remote host cannot be reached from this host at this time.";
-        case WSAEINVAL:
-            return "WSAEINVAL: The socket has not been bound with bind, or an unknown flag was specified, or MSG_OOB was specified for a socket with SO_OOBINLINE enabled.";
-        case WSAECONNABORTED:
-            return "WSAECONNABORTED: The virtual circuit was terminated due to a time-out or other failure. The application should close the socket as it is no longer usable.";
-        case WSAECONNRESET:
-            return "WSAECONNRESET: The connection was reset by the remote side executing a hard or abortive close. For a UDP socket, the remote host responded with a Port Unreachable ICMP packet.";
-        case WSAETIMEDOUT:
-            return "WSAETIMEDOUT: The connection has been dropped, because of a network failure or because the system on the other end went down without notice.";
-        default:
-            return "Unknown WSA error!";
-	}
+  const char *ret = "Unknown WSA error!";
+  
+  switch (err)
+  {
+  case WSANOTINITIALISED:     ret = "WSANOTINITIALISED: A successful WSAStartup() must occur before using this function.";
+  case WSAENETDOWN:           ret = "WSAENETDOWN: The network subsystem has failed.";
+  case WSAEACCES:             ret = "WSAEACCES: The requested address is a broadcast address. Call setsockopt with the SO_BROADCAST parameter to allow the use of the broadcast address.";
+  case WSAEINTR:              ret = "WSAEINTR: A blocking Windows Sockets call was canceled through WSACancelBlockingCall.";
+  case WSAEINPROGRESS:        ret = "WSAEINPROGRESS: A blocking Windows Sockets call is in progress, or the service provider is still processing a callback function.";
+  case WSAEFAULT:             ret = "WSAEFAULT: The buf parameter is not completely contained in a valid part of the user address space." ;
+  case WSAENETRESET:          ret = "WSAENETRESET: The connection has been broken due to the keep-alive activity detecting a failure while the operation was in progress.";
+  case WSAENOBUFS:            ret = "WSAENOBUFS: No buffer space is available.";
+  case WSAENOTCONN:           ret = "WSAENOTCONN: The socket is not connected.";
+  case WSAENOTSOCK:           ret = "WSAENOTSOCK: The descriptor is not a socket.";
+  case WSAEOPNOTSUPP:         ret = "WSAEOPNOTSUPP: Operation not supported.";
+  case WSAESHUTDOWN:          ret = "WSAESHUTDOWN The socket has been shut down; it is not possible to send on a socket after shutdown has been invoked with how set to SD_SEND or SD_BOTH.";
+  case WSAEWOULDBLOCK:        ret = "WSAEWOULDBLOCK: The socket is marked as nonblocking and the requested operation would block.";
+  case WSAEMSGSIZE:           ret = "WSAEMSGSIZE: The socket is message oriented, and the message is larger than the maximum supported by the underlying transport.";
+  case WSAEHOSTUNREACH:       ret = "WSAEHOSTUNREACH: The remote host cannot be reached from this host at this time.";
+  case WSAEINVAL:             ret = "WSAEINVAL: The socket has not been bound with bind, or an unknown flag was specified, or MSG_OOB was specified for a socket with SO_OOBINLINE enabled.";
+  case WSAECONNABORTED:       ret = "WSAECONNABORTED: The virtual circuit was terminated due to a time-out or other failure. The application should close the socket as it is no longer usable.";
+  case WSAETIMEDOUT:          ret = "WSAETIMEDOUT: The connection has been dropped, because of a network failure or because the system on the other end went down without notice.";	
+  case WSASYSCALLFAILURE:     ret = "WSASYSCALLFAILURE: A system call unexpectedly failed.";
+  case WSA_NOT_ENOUGH_MEMORY: ret = "WSA_NOT_ENOUGH_MEMORY: Out of memory.";
+  case WSAECONNRESET:         ret = ("WSAECONNRESET: The connection was reset by the remote side executing a hard or abortive close. "
+                                      "For a UDP socket, the remote host responded with a Port Unreachable ICMP packet.");
+  }
+
+  return (char*) ret;
 }
 
 #endif

Modified: trunk/libspread-util/src/arch.h
===================================================================
--- trunk/libspread-util/src/arch.h	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread-util/src/arch.h	2016-11-14 17:40:56 UTC (rev 861)
@@ -115,9 +115,25 @@
 #  ifndef int32u
 #    define int32u u_int32_t
 #  endif
+
+#  ifndef INVALID_SOCKET
+#    define INVALID_SOCKET (-1)
+#  elif INVALID_SOCKET != -1
+#    error "INVALID_SOCKET must be -1!"
+#  endif
   
 #else
 /* We are using windows... */
+
+/* Windows defines a default FD_SETSIZE of 64. However, the size of
+ * fd_set array for select can be raised by defining a larger constant
+ * before including windows headers
+ */
+#  define FD_SETSIZE 1024
+
+#  include <winsock2.h>
+#  include <ws2tcpip.h>   /* NOTE: after definition of FD_SETSIZE! */
+
 #  define INTSIZE32
 #  define ARCH_SCATTER_NONE
 #  define ARCH_ENDIAN 0x80000080
@@ -132,21 +148,13 @@
 #  define ARCH_SCATTER_SIZE 64
 #  define ERR_TIMEDOUT      EAGAIN
 #  define sock_errno        WSAGetLastError()
-#  define sock_set_errno    WSASetLastError
+#  define sock_set_errno(e) WSASetLastError(e)
 #  define MAXPATHLEN        _MAX_PATH
-#  define snprintf          _snprintf
 #  define alloca            _alloca
 
 /* Sockets are not file descriptors on windows so they need a special close function. */
 #  define close closesocket
 
-/* Windows defines a default size of 64. However, the size of fd_set array for select
- * can be raised by defining a larger constant before including windows.h winsock.h
- */
-#  define FD_SETSIZE 1024
-
-#  include <ws2tcpip.h>   /* after definition of FD_SETSIZE! */
-
 #  define HAVE_SOCKLEN_T 1
 typedef int sockopt_len_t;
 
@@ -159,6 +167,10 @@
  * number. Right now we don't need the E versions for windows so we just
  * use the WSA versions.
  */
+
+#  undef EINVAL
+#  define EINVAL WSAEINVAL
+
 #  undef EINTR
 #  define EINTR WSAEINTR
 
@@ -174,6 +186,12 @@
 #  undef EALREADY
 #  define EALREADY WSAEALREADY
 
+#  undef EIO
+#  define EIO WSASYSCALLFAILURE
+
+#  undef ENOMEM
+#  define ENOMEM WSA_NOT_ENOUGH_MEMORY
+
 /* Windows does not define MAXHOSTNAMELEN, so we define it here to a reasonable host name limit */
 #define MAXHOSTNAMELEN 256
 
@@ -276,7 +294,7 @@
  * work around bad/different bool definitions in system headers
  * #undef bool     
  */
-typedef         short           bool;
+typedef         int           bool;
 #endif
 
 #ifndef TRUE

Modified: trunk/libspread-util/src/config.h.in
===================================================================
--- trunk/libspread-util/src/config.h.in	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread-util/src/config.h.in	2016-11-14 17:40:56 UTC (rev 861)
@@ -256,11 +256,11 @@
 /* various unsigned intxx_t types */
 #undef HAVE_U_INTXX_T
 
-/* Define to 1 if you have the <windows.h> header file. */
-#undef HAVE_WINDOWS_H
+/* Define to 1 if you have the <winsock2.h> header file. */
+#undef HAVE_WINSOCK2_H
 
-/* Define to 1 if you have the <winsock.h> header file. */
-#undef HAVE_WINSOCK_H
+/* Define to 1 if you have the <ws2tcpip.h> header file. */
+#undef HAVE_WS2TCPIP_H
 
 /* Define if libc defines __progname */
 #undef HAVE___PROGNAME

Modified: trunk/libspread-util/src/data_link.c
===================================================================
--- trunk/libspread-util/src/data_link.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread-util/src/data_link.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -32,13 +32,12 @@
  *
  */
 
-
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
 #include <errno.h>
 
-#include "arch.h"
+#include "arch.h"  /* NOTE: must come after #include <errno.h> on Windows bc we redef error defines */
 
 #ifndef ARCH_PC_WIN95
 #  include <sys/types.h>
@@ -49,369 +48,585 @@
 #  include <sys/time.h>
 #  include <unistd.h>
 #else
-#  include <winsock.h>
+#  include <winsock2.h>
 #endif
 
 #include "spu_data_link.h"
 #include "spu_alarm.h"
-#include "spu_events.h" /* for sp_time */
+#include "spu_events.h"
 
-#define DL_MAX_NUM_SEND_RETRIES 1
+/********************************************************************************
+ ********************************************************************************/
 
-channel DL_init_channel( int32 channel_type, int16 port, int32 mcast_address, int32 interface_address )
+void DL_close_channel(channel chan)
 {
-        channel                 chan;
-        struct  sockaddr_in     soc_addr;
-        int                     on=1, off=0;
-#ifdef  IP_MULTICAST_TTL
-        unsigned char           ttl_val;
-#endif
+  int ret = close(chan);  /* NOTE: on windows, arch.h defines close to be closesocket (ick!) /*/
+  
+  if (ret)
+    Alarmp(SPLOG_FATAL, DATA_LINK, "DL_close_channel: error closing channel %d: %d %d %s\n", (int) chan, ret, sock_errno, sock_strerror(sock_errno));
+}
 
-        if((chan = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
-                Alarm( EXIT, "DL_init_channel: socket error for port %d\n", port );
+/********************************************************************************
+ ********************************************************************************/
 
-        if ( channel_type & SEND_CHANNEL )
-        {
-                if (setsockopt(chan, SOL_SOCKET, SO_BROADCAST, (char *)&on, 
-                               sizeof(on)) < 0) 
-                        Alarm( EXIT, "DL_init_channel: setsockopt error for port %d\n",port);
-                Alarm( DATA_LINK, "DL_init_channel: setsockopt for send and broadcast went ok\n");
+channel DL_init_channel(int32 channel_type, int16 port, int32 mcast_address, int32 interface_address)
+{
+  spu_addr mcast = { 0 };
+  spu_addr inter = { 0 };
 
-#ifdef  IP_MULTICAST_TTL
-                /* ### Isn't this for sending??? */
-                ttl_val = 1;
-                if (setsockopt(chan, IPPROTO_IP, IP_MULTICAST_TTL, (void *)&ttl_val, 
-                        sizeof(ttl_val)) < 0) 
-                {
-                        Alarm( DATA_LINK, "DL_init_channel: problem in setsockopt of multicast ttl %d - ignore in WinNT or Win95\n", ttl_val );
-                }
-                Alarm( DATA_LINK, "DL_init_channel: setting Mcast TTL to %d\n",ttl_val);
-#endif
-        }
+  mcast.ipv4.sin_family      = AF_INET;
+  mcast.ipv4.sin_port        = htons(port);
+  mcast.ipv4.sin_addr.s_addr = htonl(mcast_address);
+  
+  inter.ipv4.sin_family      = AF_INET;
+  inter.ipv4.sin_port        = htons(port);
+  inter.ipv4.sin_addr.s_addr = htonl(interface_address);
+  
+  return DL_init_channel_gen(channel_type, &mcast, &inter);
+}
 
-        if ( channel_type & RECV_CHANNEL )
-        {
-                memset(&soc_addr, 0, sizeof(soc_addr));
-                soc_addr.sin_family     = AF_INET;
-                soc_addr.sin_port       = htons(port);
-                memset(&soc_addr.sin_zero, 0, sizeof(soc_addr.sin_zero));
-#ifdef HAVE_SIN_LEN_IN_STRUCT_SOCKADDR_IN
-                soc_addr.sin_len        = sizeof(soc_addr);
-#endif
+/********************************************************************************
+ ********************************************************************************/
 
-                /* If mcast channel, the interface means the interface to
-                   receive mcast packets on, and not interface to bind.
-                   Must bind multicast address instead */
-                if (mcast_address != 0 && IS_MCAST_ADDR(mcast_address) && !(channel_type & DL_BIND_ALL) )
-                        soc_addr.sin_addr.s_addr= htonl(mcast_address);
-                else if (interface_address != 0)
-                        soc_addr.sin_addr.s_addr= htonl(interface_address);
-                else
-                        soc_addr.sin_addr.s_addr= INADDR_ANY;
+int DL_send(channel chan, int32 address, int16 port, const sys_scatter *scat)
+{
+  spu_addr dst = { 0 };
 
-                /* Older Version
-                 if (interface_address == 0)
-                         soc_addr.sin_addr.s_addr= INADDR_ANY;
-                 else 
-                         soc_addr.sin_addr.s_addr= htonl(interface_address);
-                 */
- 
-                if ( channel_type & REUSE_ADDR ) 
-                {
-                        if(setsockopt(chan, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on))) 
-                        {
-                            Alarm( EXIT, "DL_init_channel: Failed to set socket option REUSEADDR, errno: %d\n", errno);
-                        }
-                }
+  dst.ipv4.sin_family      = AF_INET;
+  dst.ipv4.sin_port        = htons(port);
+  dst.ipv4.sin_addr.s_addr = htonl(address);
 
+  return DL_sendto_gen(chan, scat, &dst);
+}
 
-                if(bind( chan, (struct sockaddr *) &soc_addr, 
-                                sizeof(soc_addr)) == -1) 
-                {
-                        Alarm( EXIT, "DL_init_channel: bind error (%d): %s for port %d, with sockaddr (" IPF ": %d) probably already running\n", sock_errno, sock_strerror(sock_errno), port, IP_NET(soc_addr.sin_addr.s_addr), ntohs(soc_addr.sin_port));
-                }
-                Alarm( DATA_LINK, "DL_init_channel: bind for recv_channel for " IPF " port %d with chan %d ok\n",
-                        IP_NET(soc_addr.sin_addr.s_addr), port, chan);
+/********************************************************************************
+ ********************************************************************************/
 
-                if( IS_MCAST_ADDR(mcast_address) )
-                {
-#ifdef IP_MULTICAST_TTL
-                        struct ip_mreq  mreq;
+int DL_recv(channel chan, sys_scatter *scat)
+{
+  return DL_recvfrom_gen(chan, scat, NULL);
+}
 
-                        mreq.imr_multiaddr.s_addr = htonl( mcast_address );
+/********************************************************************************
+ ********************************************************************************/
 
-                        /* the interface could be changed to a specific interface if needed */
-                        /* WAS: mreq.imr_interface.s_addr = INADDR_ANY;
-                         * If specified, then want to route through it instead of
-                         * based on routing decisions at the kernel */
-                        /* IP_ADD_MEMBERSHIP requires that the imr_interface be an actual physical interface
-                         * or INADDR_ANY. So if this is the special case of binding to multicast or broadcast,
-                         * switch the join to use INADDR_ANY. In the case when the passed in interface
-                         * is a regular physical interface, then join only on that one.
-                         */
-                        if ( IS_MCAST_ADDR(interface_address) )
-                          mreq.imr_interface.s_addr = htonl( INADDR_ANY );
-                        else
-                          mreq.imr_interface.s_addr = htonl( interface_address );
+int DL_recvfrom(channel chan, sys_scatter *scat, int *src_address, unsigned short *src_port)
+{
+  spu_addr src = { 0 };
+  int      ret = DL_recvfrom_gen(chan, scat, &src);
 
+  if (ret >= 0)
+  {
+    if (src_address)
+    {
+      if (src.addr.sa_family == AF_INET)
+        *src_address = (int) ntohl(src.ipv4.sin_addr.s_addr);
+    
+      else
+        *src_address = 0;
+    }
+    
+    if (src_port)
+    {
+      if (src.addr.sa_family == AF_INET || src.addr.sa_family == AF_INET6)
+        *src_port = (unsigned short) spu_addr_ip_get_port(&src);
+      
+      else
+        *src_port = 0;
+    }    
+  }
+  
+  return ret;
+}
 
-                        if (setsockopt(chan, IPPROTO_IP, IP_ADD_MEMBERSHIP, (void *)&mreq, 
-                                sizeof(mreq)) < 0) 
-                        {
-                          Alarm( EXIT, "DL_init_channel: problem (errno %d:%s) in setsockopt to multicast address " IPF "\n", sock_errno, sock_strerror(sock_errno), IP(mcast_address) );
-                        }
+/********************************************************************************
+ * Creates a broad/multicast IP datagram socket with options.  Exits on failures.
+ *
+ *     create a SOCK_DGRAM socket in protocol family of if_addr
+ *
+ *     if SEND_CHANNEL is set:
+ *         if if_addr is IPv4: enable SO_BROADCAST
+ *         set multicast hops = 1
+ *         if NO_LOOP is set: disable multicast loopback
+ *
+ *     if RECV_CHANNEL is set:
+ *         if if_addr is IPv4: enable SO_BROADCAST
+ *         if REUSE_ADDR is set: enable SO_REUSEADDR
+ *
+ *         if mcast_addr is a multicast address and DL_BIND_ALL not set:
+ *             bind to mcast_addr
+ *         else:
+ *             bind to if_addr
+ *
+ *         if mcast_addr is a multicast address:
+ *             call DL_join_multicast(socket, mcast_addr, if_addr)
+ *
+ *    return socket
+ *
+ * TODO: check on sizeof setsockopt types across platforms (i.e. - Sun: char vs. int)
+ ********************************************************************************/
 
-                        if ( channel_type & NO_LOOP ) 
-                        { 
-                            if (setsockopt(chan, IPPROTO_IP, IP_MULTICAST_LOOP, 
-                                        (void *)&off, 1) < 0) 
-                            { 
-                              Alarm( EXIT, "DL_init_channel: problem (errno %d:%s) in setsockopt loop setting " IPF "\n", sock_errno, sock_strerror(sock_errno), IP(mcast_address)); 
-                            } 
-                        }
+channel DL_init_channel_gen(int32 channel_type, const spu_addr *mcast_addr, const spu_addr *if_addr)
+{
+  int     family = spu_addr_family(if_addr);
+  channel chan;
+  int     tmp;
 
-                        Alarm( DATA_LINK, "DL_init_channel: Joining multicast address " IPF " went ok\n", IP(mcast_address) );
-#else   /* no multicast support */
-                        Alarm( EXIT, "DL_init_channel: Old SunOS architecture does not support IP multicast: " IPF "\n", IP(mcast_address));
-#endif
-                } else {
-                    if (setsockopt(chan, SOL_SOCKET, SO_BROADCAST, (char *)&on, 
-                                   sizeof(on)) < 0) 
-                        Alarm( EXIT, "DL_init_channel: setsockopt SO_BROADCAST error for port %d, socket %d\n",port,chan);
-                    Alarm( DATA_LINK, "DL_init_channel: setsockopt for recv and broadcast went ok\n");
-                }
-        }
+  Alarmp(SPLOG_INFO, DATA_LINK, "DL_init_channel_gen: creating a SOCK_DGRAM socket of family %d\n", family);
 
-        Alarm( DATA_LINK, "DL_init_channel: went ok on channel %d\n",chan);
-        return ( chan );
+  if (family != AF_INET && family != AF_INET6)
+    Alarmp(SPLOG_FATAL, DATA_LINK, "DL_init_channel_gen: bad family(%d); only AF_INET (%d) and AF_INET6 (%d) are currently supported!\n", family, AF_INET, AF_INET6);
+
+  if (mcast_addr != NULL)
+  {
+    if (family != spu_addr_family(mcast_addr))
+      Alarmp(SPLOG_FATAL, DATA_LINK, "DL_init_channel_gen: mcast family (%d) didn't match interface family (%d)!\n", spu_addr_family(mcast_addr), family);
+          
+    if (spu_addr_ip_get_port(if_addr) != spu_addr_ip_get_port(mcast_addr))
+      Alarmp(SPLOG_FATAL, DATA_LINK, "DL_init_channel_gen: mcast port (%u) didn't match interface port (%u)!\n",
+             (unsigned) spu_addr_ip_get_port(mcast_addr), (unsigned) spu_addr_ip_get_port(if_addr));
+  }
+
+  if ((chan = socket((family == AF_INET ? PF_INET : PF_INET6), SOCK_DGRAM, 0)) == INVALID_SOCKET)
+    Alarmp(SPLOG_FATAL, DATA_LINK, "DL_init_channel_gen: socket error (%d: %s)!\n", sock_errno, sock_strerror(sock_errno));
+
+  if (channel_type & SEND_CHANNEL)
+  {
+    if (family == AF_INET)
+    {
+      Alarmp(SPLOG_INFO, DATA_LINK, "DL_init_channel_gen: turning SO_BROADCAST on for send IPv4 channel\n");
+      
+      if (setsockopt(chan, SOL_SOCKET, SO_BROADCAST, (tmp = 1, &tmp), sizeof(tmp)))
+        Alarmp(SPLOG_FATAL, DATA_LINK, "DL_init_channel_gen: setsockopt(SOL_SOCKET, SO_BROADCAST, 1) error (%d: %s)!\n", sock_errno, sock_strerror(sock_errno));
+      
+      Alarmp(SPLOG_INFO, DATA_LINK, "DL_init_channel_gen: setting IPv4 multicast TTL to 1 for send channel\n");
+                  
+      if (setsockopt(chan, IPPROTO_IP, IP_MULTICAST_TTL, (tmp = 1, &tmp), sizeof(tmp))) 
+        Alarmp(SPLOG_FATAL, DATA_LINK, "DL_init_channel_gen: problem (%d: %s) in setsockopt of multicast ttl = 1; ignore on Windows\n", 
+               sock_errno, sock_strerror(sock_errno));
+
+      if (channel_type & NO_LOOP)
+      {
+        Alarmp(SPLOG_INFO, DATA_LINK, "DL_init_channel_gen: Disabling IPv4 multicast loopback\n");
+                    
+        if (setsockopt(chan, IPPROTO_IP, IP_MULTICAST_LOOP, (tmp = 0, &tmp), sizeof(tmp)))
+          Alarmp(SPLOG_FATAL, DATA_LINK, "DL_init_channel_gen: error (%d: %s) in disabling ipv4 loopback!\n", sock_errno, sock_strerror(sock_errno));
+      }                  
+    }
+    else
+    {
+      Alarmp(SPLOG_INFO, DATA_LINK, "DL_init_channel_gen: setting IPv6 mulitcast hops to 1 for send channel\n");
+                  
+      if (setsockopt(chan, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, (tmp = 1, &tmp), sizeof(tmp))) 
+        Alarmp(SPLOG_FATAL, DATA_LINK, "DL_init_channel_gen: problem (%d: %s) in setsockopt of multicast hops = 1; ignore on Windows\n", 
+               sock_errno, sock_strerror(sock_errno));
+
+      if (channel_type & NO_LOOP)
+      {
+        Alarmp(SPLOG_INFO, DATA_LINK, "DL_init_channel_gen: Disabling IPv6 multicast loopback\n");
+                    
+        if (setsockopt(chan, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, (tmp = 0, &tmp), sizeof(tmp)))
+          Alarmp(SPLOG_FATAL, DATA_LINK, "DL_init_channel_gen: error (%d: %s) in disabling ipv6 loopback!\n", sock_errno, sock_strerror(sock_errno));
+      }
+    }
+  }
+
+  if (channel_type & RECV_CHANNEL)
+  {
+    spu_addr bind_addr = *if_addr;
+
+    if (family == AF_INET)
+    {
+      Alarmp(SPLOG_INFO, DATA_LINK, "DL_init_channel_gen: turning SO_BROADCAST on for recv IPv4 channel\n");
+      
+      if (setsockopt(chan, SOL_SOCKET, SO_BROADCAST, (tmp = 1, &tmp), sizeof(tmp)))
+        Alarmp(SPLOG_FATAL, DATA_LINK, "DL_init_channel_gen: setsockopt(SOL_SOCKET, SO_BROADCAST, 1) error (%d: %s)!\n", sock_errno, sock_strerror(sock_errno));
+    }
+      
+    if (!(channel_type & DL_BIND_ALL) && mcast_addr != NULL && spu_addr_ip_is_multicast(mcast_addr))
+      bind_addr = *mcast_addr;
+
+    if (channel_type & REUSE_ADDR)
+    {
+      Alarmp(SPLOG_INFO, DATA_LINK, "DL_init_channel_gen: turning SO_REUSEADDR on for recv channel\n");
+                
+      if (setsockopt(chan, SOL_SOCKET, SO_REUSEADDR, (tmp = 1, &tmp), sizeof(tmp)))
+        Alarmp(SPLOG_FATAL, DATA_LINK, "DL_init_channel_gen: Failed to set socket option REUSEADDR, errno: (%d: %s)!\n", sock_errno, sock_strerror(sock_errno));
+    }
+
+    Alarmp(SPLOG_INFO, DATA_LINK, "DL_init_channel_gen: binding recv channel to [%s]:%u\n", SPU_ADDR_NTOP(&bind_addr), (unsigned) spu_addr_ip_get_port(&bind_addr));
+
+    if (bind(chan, (struct sockaddr *) &bind_addr, spu_addr_len(&bind_addr))) 
+      Alarmp(SPLOG_FATAL, DATA_LINK, "DL_init_channel_gen: bind error (%d: %s) for [%s]:%u; probably already running!\n",
+             sock_errno, sock_strerror(sock_errno), SPU_ADDR_NTOP(&bind_addr), (unsigned) spu_addr_ip_get_port(&bind_addr));
+
+    if (mcast_addr != NULL && spu_addr_ip_is_multicast(mcast_addr) && (tmp = DL_join_multicast_gen(chan, mcast_addr, if_addr)))
+      Alarmp(SPLOG_FATAL, DATA_LINK, "DL_init_channel_gen: DL_join_multicast failed! %d %d %s\n", tmp, sock_errno, sock_strerror(sock_errno));
+  }
+
+  Alarmp(SPLOG_INFO, DATA_LINK, "DL_init_channel_gen: success; chan = %d\n", (int) chan);
+        
+  return chan;
 }
 
-void    DL_close_channel(channel chan)
+/********************************************************************************
+ * Joins the group mcast_addr on a socket.  Returns zero on success, non-zero on failure.
+ *
+ *     if mcast_addr is IPv4:
+ *         if if_addr != NULL: join mcast_addr on interface if_addr 
+ *         else: join mcast_addr on interface INADDR_ANY
+ *
+ *     else:
+ *         if mcast_addr's scope_id is non-zero: join mcast_addr on mcast_addr's scope_id
+ *         elif if_addr != NULL: join mcast_addr on if_addr's scope_id
+ *         else: join mcast_addr on scope_id 0 (most likely fails)
+ *   
+ ********************************************************************************/
+
+int DL_join_multicast_gen(channel chan, const spu_addr *mcast_addr, const spu_addr *if_addr)
 {
+  int ret = -1;
+  int family;
+  int tmp;
 
-        if( -1 ==  close(chan))
-        {
-                Alarm(EXIT, "DL_close_channel: error closing channel %d\n", chan);
-        }
+  if (mcast_addr == NULL)
+  {
+    Alarmp(SPLOG_ERROR, DATA_LINK, "DL_join_multicast_gen: called with NULL mcast_addr?!\n");
+    sock_set_errno(EINVAL);
+    goto END;
+  }
+  
+  family = spu_addr_family(mcast_addr);
 
+  if (family != AF_INET && family != AF_INET6)
+  {
+    Alarmp(SPLOG_ERROR, DATA_LINK, "DL_join_multicast_gen: called with non-IP mcast_addr?!\n");
+    sock_set_errno(EINVAL);
+    goto END;
+  }
+  
+  if (family == AF_INET)
+  {
+    struct ip_mreq mreq;
+
+    memset(&mreq, 0, sizeof(mreq));                        
+    mreq.imr_multiaddr = mcast_addr->ipv4.sin_addr;
+
+    if (if_addr != NULL && !spu_addr_ip_is_multicast(if_addr))
+      mreq.imr_interface = if_addr->ipv4.sin_addr;
+                        
+    Alarmp(SPLOG_INFO, DATA_LINK, "DL_join_multicast_gen: Joining ipv4 multicast address " IPF " on interface " IPF "\n",
+           IP_NET(mreq.imr_multiaddr.s_addr), IP_NET(mreq.imr_interface.s_addr));
+                        
+    if (setsockopt(chan, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)))
+    {
+      Alarmp(SPLOG_ERROR, DATA_LINK, "DL_join_multicast_gen: error (%d: %s) on ipv4 join!\n", sock_errno, sock_strerror(sock_errno));
+      goto END;
+    }
+  }
+  else
+  {
+    struct ipv6_mreq mreq;
+
+    memset(&mreq, 0, sizeof(mreq));
+    mreq.ipv6mr_multiaddr = mcast_addr->ipv6.sin6_addr;
+    mreq.ipv6mr_interface = mcast_addr->ipv6.sin6_scope_id;
+
+    if (mreq.ipv6mr_interface == 0 && if_addr != NULL)
+      mreq.ipv6mr_interface = if_addr->ipv6.sin6_scope_id;
+                        
+    Alarmp(SPLOG_INFO, DATA_LINK, "DL_join_multicast_gen: Joining ipv6 multicast address %s on interface %u\n", SPU_ADDR_NTOP(mcast_addr), (unsigned) mreq.ipv6mr_interface);
+                  
+    if (setsockopt(chan, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)))
+    {
+      Alarmp(SPLOG_ERROR, DATA_LINK, "DL_join_multicast_gen: error (%d: %s) on ipv6 join!\n", sock_errno, sock_strerror(sock_errno));
+      goto END;
+    }
+  }
+
+  ret = 0;
+
+END:
+  Alarmp(SPLOG_INFO, DATA_LINK, "DL_join_multicast_gen: ret = %d\n", ret);
+  
+  return ret;
 }
 
-int     DL_send( channel chan, int32 address, int16 port, sys_scatter *scat )
+/********************************************************************************
+ ********************************************************************************/
+
+int DL_send_gen(channel chan, const sys_scatter *scat)
 {
-#ifndef ARCH_SCATTER_NONE
-        struct  msghdr      msg;
-#else
-        char                pseudo_scat[MAX_PACKET_SIZE];
-#endif
-        
-        struct  sockaddr_in soc_addr;
-        struct timeval      select_delay;
-        int                 ret;
-        int                 total_len;
-        int                 i;
-        int                 num_try;
+  return DL_sendto_gen(chan, scat, NULL);
+}
 
-        /* Check that the scatter passed is small enough to be a valid system scatter */
+/********************************************************************************
+ ********************************************************************************/
 
-        if( scat->num_elements > ARCH_SCATTER_SIZE ) {
-          Alarmp( SPLOG_FATAL, DATA_LINK, "DL_send: illegal scat->num_elements (%d) > ARCH_SCATTER_SIZE (%d)\n", 
-                  (int) scat->num_elements, (int) ARCH_SCATTER_SIZE );
-        }
+int DL_recv_gen(channel chan, sys_scatter *scat)
+{
+  return DL_recvfrom_gen(chan, scat, NULL);
+}
 
-        memset( &soc_addr, 0, sizeof( soc_addr ) );
-        soc_addr.sin_family      = AF_INET;
-        soc_addr.sin_addr.s_addr = htonl( address );
-        soc_addr.sin_port        = htons( port );
+/********************************************************************************
+ ********************************************************************************/
 
-#ifdef HAVE_SIN_LEN_IN_STRUCT_SOCKADDR_IN
-        soc_addr.sin_len = sizeof( soc_addr );
-#endif
+int DL_sendto_gen(channel chan, const sys_scatter *scat, const spu_addr *dst)
+{
+        int                 ret     = -1;
+        socklen_t           dst_len = (dst != NULL ? spu_addr_len(dst) : 0);
+        size_t              tot_len = 0;
+        size_t              new_len;
+        size_t              i;
+#ifdef ARCH_SCATTER_NONE
+        char                sendto_buf[1500];         /* big enough for any fast ethernet packet */
+        char               *sendto_ptr = sendto_buf;
+#else
+        struct  msghdr      msg = { 0 };
 
-#ifdef ARCH_PC_HOME
-        soc_addr.sin_addr.s_addr = htonl( -1073741814 );  /* WTF? */
+        msg.msg_name    = (caddr_t) dst;
+        msg.msg_namelen = dst_len;
+        msg.msg_iov     = (struct iovec*) scat->elements;
+        msg.msg_iovlen  = (int) scat->num_elements;
 #endif
-
-#ifndef ARCH_SCATTER_NONE
-        memset( &msg, 0, sizeof( msg ) );
-        msg.msg_name    = (caddr_t) &soc_addr;
-        msg.msg_namelen = sizeof( soc_addr );
-        msg.msg_iov     = (struct iovec *) scat->elements;
-        msg.msg_iovlen  = scat->num_elements;
+        if (scat->num_elements > ARCH_SCATTER_SIZE)
+        {          
+          Alarmp(SPLOG_ERROR, DATA_LINK, "DL_sendto_gen: illegal scat->num_elements (%lu) > ARCH_SCATTER_SIZE (%lu)\n", 
+                 (unsigned long) scat->num_elements, (unsigned long) ARCH_SCATTER_SIZE);
+          sock_set_errno(EINVAL);
+          goto END;
+        }
+#ifdef ARCH_SCATTER_NONE        
+        else if (scat->num_elements == 1)
+        {
+          sendto_ptr = scat->elements[0].buf;    /* NOTE: avoid unnecessary memcpy */
+          tot_len    = scat->elements[0].len;
+        }
 #endif
+        else
+        {
+          for (i = 0, tot_len = 0; i < scat->num_elements; ++i, tot_len = new_len)
+          {
+            new_len = tot_len + scat->elements[i].len;
 
-        for( i = 0, total_len = 0; i < (int) scat->num_elements; ++i ) {
+            if (new_len < tot_len)  /* rollover */
+            {
+              Alarmp(SPLOG_ERROR, DATA_LINK, "DL_sendto_gen: scat so big it caused rollover (%lu + %lu -> %lu) > max allowed (%lu)\n", 
+                     (unsigned long) tot_len, (unsigned long) scat->elements[i].len, (unsigned long) new_len, (unsigned long) (size_t) -1);
+              sock_set_errno(EINVAL);
+              goto END;
+            }
+          }
+          
+#ifdef ARCH_SCATTER_NONE
+            
+          if (tot_len > sizeof(sendto_buf) && NULL == (sendto_ptr = (char*) malloc(tot_len)))
+          {
+            Alarmp(SPLOG_ERROR, DATA_LINK, "DL_sendto_gen: malloc(%lu) failed\n", (unsigned long) tot_len);
+            sock_set_errno(ENOMEM);
+            goto END;
+          }
 
-#ifdef ARCH_SCATTER_NONE
-                memcpy( &pseudo_scat[total_len], scat->elements[i].buf, scat->elements[i].len );
+          for (i = 0, new_len = 0; i < scat->num_elements && new_len < tot_len; new_len += scat->elements[i++].len)
+            memcpy(&sendto_ptr[new_len], scat->elements[i].buf, scat->elements[i].len);
 #endif
-                total_len += scat->elements[i].len;
         }
 
-        for( num_try = 1;; ++num_try ) {
-
-#ifndef ARCH_SCATTER_NONE
-                ret = sendmsg( chan, &msg, 0 ); 
+#ifdef ARCH_SCATTER_NONE
+        ret = sendto(chan, sendto_ptr, tot_len, 0, (struct sockaddr *) dst, dst_len);
 #else
-                ret = sendto( chan, pseudo_scat, total_len, 0, (struct sockaddr *) &soc_addr, sizeof( soc_addr ) );
+        ret = sendmsg(chan, &msg, 0); 
 #endif
 
-                if( ret >= 0 || num_try > DL_MAX_NUM_SEND_RETRIES ) { break; }  /* success or give up */
+        if (ret < 0)                       /* rare */
+        {
+          Alarmp(SPLOG_ERROR, DATA_LINK, "DL_sendto_gen: error: %d %d '%s' sending on channel %d\n", ret, sock_errno, sock_strerror(sock_errno), (int) chan);
+          goto END;
+        }
+        else if ((size_t) ret < tot_len)   /* can commonly occur on TCP channels; shouldn't happen on UDP */
+        {
+          if (ALARMP_NEEDED(SPLOG_INFO, DATA_LINK))
+            Alarmp(SPLOG_INFO, DATA_LINK, "DL_sendto_gen: partial send: %d out of %lu bytes sent on channel %d\n", ret, (unsigned long) tot_len, (int) chan);  
+        }
+        else if ((size_t) ret != tot_len)  /* shouldn't happen */
+        {
+          Alarmp(SPLOG_ERROR, DATA_LINK, "DL_sendto_gen: sent more bytes (%d) than requested (%lu) on channel %d?!\n", ret, (unsigned long) tot_len, (int) chan);  
+          sock_set_errno(EIO);
+          ret = -1;
+          goto END;
+        }
+        /* else: ret == tot_len: success! */
 
-                /* delay for a short while */
+END:
+        
+#ifdef ARCH_SCATTER_NONE
+        if (sendto_ptr != sendto_buf && sendto_ptr != NULL && scat->num_elements != 1)
+          free(sendto_ptr);
+#endif
 
-                select_delay.tv_sec  = 0;
-                select_delay.tv_usec = 100;
+        /* NOTE: it is uncommon for (SPLOG_DEBUG, DATA_LINK) to be active; so conditionally skip needless calls to Alarmp */
+        
+        if (ALARMP_NEEDED(SPLOG_DEBUG, DATA_LINK))
+        {
+          char alarm_msg[256], *c = alarm_msg, *e = alarm_msg + sizeof(alarm_msg);
 
-                Alarmp( SPLOG_WARNING, DATA_LINK, "DL_send: delaying for %ld.%06lds after failed send to (" IPF ":%d): %d %d '%s'\n", 
-                        select_delay.tv_sec, select_delay.tv_usec, IP(address), port, ret, sock_errno, sock_strerror(sock_errno) );
+          c += snprintf(c, SPCLAMP(c, e), "DL_sendto_gen: ret = %d, tried to send a message of %lu bytes on channel %d", ret, (unsigned long) tot_len, (int) chan);
 
-                select( 0, NULL, NULL, NULL, &select_delay );
+          if (dst != NULL)
+          {
+            c += snprintf(c, SPCLAMP(c, e), "; dst family: %d; dst addr: '%s'", dst->addr.sa_family, SPU_ADDR_NTOP(dst));
 
-                Alarmp( SPLOG_WARNING, DATA_LINK, "DL_send: woke up; about to attempt send retry #%d\n", num_try );
-        }
+            if (dst->addr.sa_family == AF_INET || dst->addr.sa_family == AF_INET6)
+              c += snprintf(c, SPCLAMP(c, e), "; dst port: %u", (unsigned) spu_addr_ip_get_port(dst));
+          }
 
-        if( ret < 0 ) {
+          if (c < e)
+            *(c++) = '\n';
 
-                Alarmp( SPLOG_WARNING, DATA_LINK, "DL_send: error: %d %d '%s'\n", ret, sock_errno, sock_strerror(sock_errno) );
+          if (c < e)
+            *(c++) = '\0';
 
-                for( i = 0; i < (int) scat->num_elements; ++i ) {
-                        Alarmp( SPLOG_WARNING, DATA_LINK, "DL_send: element[%d]: %d bytes\n", i, (int) scat->elements[i].len );
-                }
+          alarm_msg[sizeof(alarm_msg) - 1] = '\0';
+          
+          Alarmp(SPLOG_DEBUG, DATA_LINK, "%s", alarm_msg);
+        }
+                 
+        return ret;
+}
 
-        } else if( ret < total_len ) {
+/********************************************************************************
+ ********************************************************************************/
 
-                Alarmp( SPLOG_WARNING, DATA_LINK, "DL_send: partial sending %d out of %d\n", ret, total_len );
+int DL_recvfrom_gen(channel chan, sys_scatter *scat, spu_addr *src)
+{
+        int             ret     = -1;
+        socklen_t       src_len = (src != NULL ? sizeof(*src) : 0);
+        size_t          tot_len = 0;
+        size_t          new_len;
+        size_t          i;
+#ifdef ARCH_SCATTER_NONE
+        char            recvfrom_buf[1500];           /* big enough for any fast ethernet packet */
+        char           *recvfrom_ptr = recvfrom_buf;
+        size_t          start;
+#else
+        struct  msghdr  msg = { 0 };
 
-        } else if( ret != total_len ) {
+        msg.msg_name    = (caddr_t) src;
+        msg.msg_namelen = src_len;
+        msg.msg_iov     = (struct iovec *) scat->elements;
+        msg.msg_iovlen  = (int) scat->num_elements;
+#endif
+        if (scat->num_elements > ARCH_SCATTER_SIZE)
+        {
+          Alarmp(SPLOG_ERROR, DATA_LINK, "DL_recvfrom_gen: illegal scat->num_elements (%lu) > ARCH_SCATTER_SIZE (%lu)\n", 
+                 (unsigned long) scat->num_elements, (unsigned long) ARCH_SCATTER_SIZE);
+          
+          sock_set_errno(EINVAL);
+          goto END;
+        }
+#ifdef ARCH_SCATTER_NONE
+        else if (scat->num_elements == 1)
+        {
+          recvfrom_ptr = scat->elements[0].buf;   /* NOTE: avoid unnecessary memcpy */
+          tot_len      = scat->elements[0].len;
+        }
+#endif        
+        else
+        {
+          for (i = 0, tot_len = 0; i < scat->num_elements; ++i, tot_len = new_len)
+          {
+            new_len = tot_len + scat->elements[i].len;
 
-                Alarmp( SPLOG_WARNING, DATA_LINK, "DL_send: unexpected return (%d) > total_len (%d)?!\n", ret, total_len );
+            if (new_len < tot_len)  /* rollover */
+            {
+              Alarmp(SPLOG_ERROR, DATA_LINK, "DL_recvfrom_gen: scat so big it caused rollover (%lu + %lu -> %lu) > max allowed (%lu)\n", 
+                     (unsigned long) tot_len, (unsigned long) scat->elements[i].len, (unsigned long) new_len, (unsigned long) -1);
+              sock_set_errno(EINVAL);
+              goto END;
+            }
+          }
+          
+#ifdef ARCH_SCATTER_NONE
+            
+          if (tot_len > sizeof(recvfrom_buf) && NULL == (recvfrom_ptr = (char*) malloc(tot_len)))
+          {
+            Alarmp(SPLOG_ERROR, DATA_LINK, "DL_recvfrom_gen: malloc(%lu) failed\n", (unsigned long) tot_len);
+            sock_set_errno(ENOMEM);
+            goto END;
+          }          
+#endif            
         }
 
-        Alarmp( SPLOG_INFO, DATA_LINK, "DL_send: ret = %d, sending a message of %d bytes to (" IPF ":%d) on channel %d\n", 
-                ret, total_len, IP(address), port, chan );
+#ifdef ARCH_SCATTER_NONE        
+        ret     = recvfrom(chan, recvfrom_ptr, tot_len, 0, (struct sockaddr *) src, &src_len);
+#else
+        ret     = recvmsg(chan, &msg, 0); 
+        src_len = msg.msg_namelen;
+#endif
 
-        return( ret );
-}
+        if (ret < 0)                      /* rare */
+        {
+          Alarmp(SPLOG_ERROR, DATA_LINK, "DL_recvfrom_gen: error: %d %d '%s' receiving on channel %d\n", ret, sock_errno, sock_strerror(sock_errno), (int) chan);
+          goto END;
+        } 
+        else if ((size_t) ret > tot_len)  /* shouldn't happen */
+        {
+          Alarmp(SPLOG_ERROR, DATA_LINK, "DL_recvfrom_gen: received more bytes (%d) than requested (%lu) on channel %d?!\n", ret, (unsigned long) tot_len, (int) chan);
+          sock_set_errno(EIO);
+          ret = -1;
+          goto END;
+        }
 
-int DL_recv( channel chan, sys_scatter *scat )
-{
-    return( DL_recvfrom( chan, scat, NULL, NULL ) );
-}
+#ifdef ARCH_SCATTER_NONE
 
-int     DL_recvfrom( channel chan, sys_scatter *scat, int *src_address, unsigned short *src_port )
-{
-#ifndef ARCH_SCATTER_NONE
-static  struct  msghdr  msg;
-#else
-static  char            pseudo_scat[MAX_PACKET_SIZE];
-        int             bytes_to_copy;
-        int             total_len;
-        int             start;
-        int             i;
-#endif
+        if (scat->num_elements != 1)
+        {
+          size_t next_start;
 
-        struct  sockaddr_in     source_address;
-        int             sip;
-        unsigned short  sport;
-        socklen_t       sa_len;
-        int             ret;
+          for (i = 0, start = 0, new_len = (size_t) ret; i < scat->num_elements && (next_start = start + scat->elements[i].len) < new_len; ++i, start = next_start)
+            memcpy(scat->elements[i].buf, &recvfrom_ptr[start], scat->elements[i].len);
 
-        /* check the scat is small enough to be a sys_scatter */
-
-        if( scat->num_elements > ARCH_SCATTER_SIZE ) {
-          Alarmp( SPLOG_FATAL, DATA_LINK, "DL_recvfrom: illegal scat->num_elements (%d) > ARCH_SCATTER_SIZE (%d)\n", 
-                  (int) scat->num_elements, (int) ARCH_SCATTER_SIZE );
+          if (i < scat->num_elements)
+            memcpy(scat->elements[i].buf, &recvfrom_ptr[start], new_len - start);
         }
-
-#ifndef ARCH_SCATTER_NONE
-        memset( &msg, 0, sizeof( msg ) );
-        msg.msg_name    = (caddr_t) &source_address;
-        msg.msg_namelen = sizeof( source_address );
-        msg.msg_iov     = (struct iovec *) scat->elements;
-        msg.msg_iovlen  = scat->num_elements;
 #endif
 
-#ifndef ARCH_SCATTER_NONE
-        ret = recvmsg( chan, &msg, 0 ); 
-        sa_len = msg.msg_namelen;
-#else
+END:
         
-        total_len = 0;                             
-        for( i=0; i < (int) scat->num_elements; ++i )
-           total_len += scat->elements[i].len;
+#ifdef ARCH_SCATTER_NONE
+        if (recvfrom_ptr != recvfrom_buf && recvfrom_ptr != NULL && scat->num_elements != 1)
+          free(recvfrom_ptr);
+#endif
         
-        if( total_len > MAX_PACKET_SIZE )  /* this is for TCP, to not receive more than one packet */
-           total_len = MAX_PACKET_SIZE;
-
-        sa_len = sizeof(source_address);
-        ret = recvfrom( chan, pseudo_scat, total_len, 0, (struct sockaddr *) &source_address, &sa_len);
+        /* NOTE: it is uncommon for (SPLOG_DEBUG, DATA_LINK) to be active; conditionally skip needless calls to Alarmp */
         
-        for( i=0, total_len = ret, start =0; total_len > 0; i++)
+        if (ALARMP_NEEDED(SPLOG_DEBUG, DATA_LINK))
         {
-                bytes_to_copy = scat->elements[i].len;
-                if( bytes_to_copy > total_len ) bytes_to_copy = total_len;
-                memcpy( scat->elements[i].buf, &pseudo_scat[start], 
-                        bytes_to_copy );
-                total_len-= scat->elements[i].len;
-                start    += scat->elements[i].len;
+          char alarm_msg[256], *c = alarm_msg, *e = alarm_msg + sizeof(alarm_msg);
+
+          c += snprintf(c, SPCLAMP(c, e), "DL_recvfrom_gen: ret = %d; tried to recv up to %lu bytes on channel %d", ret, (unsigned long) tot_len, (int) chan);
+          
+          if (ret >= 0 && src != NULL && src_len > 0)
+          {
+            c += snprintf(c, SPCLAMP(c, e), "; src family: %d; src addr: '%s'", src->addr.sa_family, SPU_ADDR_NTOP(src));
+
+            if (src->addr.sa_family == AF_INET || src->addr.sa_family == AF_INET6)
+              c += snprintf(c, SPCLAMP(c, e), "; src port: %u", (unsigned) spu_addr_ip_get_port(src));
+          }
+
+          if (c < e)
+            *(c++) = '\n';
+
+          if (c < e)
+            *(c++) = '\0';
+
+          alarm_msg[sizeof(alarm_msg) - 1] = '\0';
+          
+          Alarmp(SPLOG_DEBUG, DATA_LINK, "%s", alarm_msg);
         }
-#endif  /* ARCH_SCATTER_NONE */
-        if (ret < 0)
-        {
-                Alarm( DATA_LINK, "DL_recv: error %d receiving on channel %d\n", ret, chan );
-                return( -1 );
-        } 
-#ifdef ARCH_SCATTER_CONTROL
-        else if (ret == 0)
-        {
-                char    *sptr;
-                unsigned short port;
-                Alarm( DATA_LINK, "DL_recv: received zero length packet on channel %d flags 0x%x msg_len %d\n", chan, msg.msg_flags, msg.msg_namelen);
-                if (msg.msg_namelen >= sizeof(struct sockaddr_in) ) {
-                    sptr = (char *) inet_ntoa(source_address.sin_addr);
-                    port = Flip_int16(source_address.sin_port);
-                    Alarm( DATA_LINK, "\tfrom %s with family %d port %d\n", sptr, source_address.sin_family, port );
-                }
-#ifdef  MSG_BCAST
-                if ( msg.msg_flags & MSG_BCAST )
-                {
-                        Alarm( DATA_LINK, "\t(BROADCAST)");
-                }
-#endif
-#ifdef  MSG_MCAST
-                if ( msg.msg_flags & MSG_MCAST )
-                {
-                        Alarm( DATA_LINK, "\t(MULTICAST)");
-                }
-#endif
-#ifdef  MSG_TRUNC
-                if ( msg.msg_flags & MSG_TRUNC )
-                {
-                        Alarm( DATA_LINK, "\t(Data TRUNCATED)");
-                }
-#endif
-#ifdef  MSG_CTRUNC
-                if ( msg.msg_flags & MSG_CTRUNC )
-                {
-                        Alarm( DATA_LINK, "\t(Control TRUNCATED)");
-                }
-#endif
-                Alarm( DATA_LINK, "\n");
-        }
-#endif
-        /* Report the source address and port if requested by caller */
-        if (sa_len >= sizeof(struct sockaddr_in) ) {
-            memcpy(&sip, &source_address.sin_addr, sizeof(int32) );
-            sip =  Flip_int32(sip);
-            if (src_address != NULL)
-                *src_address = sip;
-            sport = Flip_int16(source_address.sin_port);
-            if (src_port != NULL)
-                *src_port = sport;
-            Alarm( DATA_LINK, "\tfrom (" IPF ") with family %d port %d\n", IP(sip), source_address.sin_family, sport );
-        }
-        Alarm( DATA_LINK, "DL_recv: received %d bytes on channel %d\n",
-                        ret, chan );
 
-        return(ret);
+        return ret;
 }
+
+/********************************************************************************
+ ********************************************************************************/

Modified: trunk/libspread-util/src/events.c
===================================================================
--- trunk/libspread-util/src/events.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread-util/src/events.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -38,15 +38,17 @@
 
 #include "arch.h"
 
-/* undef redefined variables under windows */
+/* NOTE: undef redefined errno values under windows in arch.h */
 #ifdef ARCH_PC_WIN95
-#undef EINTR
-#undef EAGAIN
-#undef EWOULDBLOCK
-#undef EINPROGRESS
-#undef EALREADY
+#  undef EINVAL
+#  undef EINTR
+#  undef EAGAIN
+#  undef EWOULDBLOCK
+#  undef EINPROGRESS
+#  undef EALREADY
+#  undef EIO
+#  undef ENOMEM
 #endif
-
 #include <errno.h>
 
 #ifndef	ARCH_PC_WIN95
@@ -58,7 +60,7 @@
 #include <dlfcn.h>
 #else 	/* ARCH_PC_WIN95 */
 
-#include <winsock.h>
+#include <winsock2.h>
 #include <sys/timeb.h>
 
 #endif	/* ARCH_PC_WIN95 */
@@ -134,7 +136,7 @@
         ret = Mem_init_object(TIME_EVENT, "time_event", sizeof(time_event), 100,0);
         if (ret < 0)
         {
-                Alarm(EXIT, "E_Init: Failure to Initialize TIME_EVENT memory objects\n");
+          Alarmp(SPLOG_FATAL, EVENTS, "E_Init: Failure to Initialize TIME_EVENT memory objects\n");
         }
 
 	for ( i=0; i < NUM_PRIORITY; i++ )
@@ -150,7 +152,7 @@
 
 	E_get_time_monotonic();
 
-	Alarm( EVENTS, "E_init: went ok\n");
+	Alarmp( SPLOG_INFO, EVENTS, "E_init: went ok\n");
 
 	return( 0 );
 }
@@ -170,7 +172,7 @@
 	int		ret;
 
 	ret = gettimeofday( &read_time, &dummy_tz );
-	if ( ret < 0 ) Alarm( EXIT, "E_get_time: gettimeofday problems.\n" );
+	if ( ret < 0 ) Alarmp( SPLOG_FATAL, EVENTS, "E_get_time: gettimeofday problems.\n" );
         t.sec  = read_time.tv_sec;
         t.usec = read_time.tv_usec;
 
@@ -186,7 +188,7 @@
 
 #endif	/* ARCH_PC_WIN95 */
 #if 0
-	Alarm( EVENTS, "E_get_time: time is (%d, %d)\n", t.sec, t.usec);
+	Alarmp( SPLOG_INFO, EVENTS, "E_get_time: time is (%d, %d)\n", t.sec, t.usec);
 #endif
 	return ( t );
 }
@@ -197,7 +199,7 @@
   struct timespec t;
 
   if (clock_gettime(CLOCK_MONOTONIC, &t) != 0) {
-    Alarm( EXIT, "E_get_time_monotonic: clock_gettime problems: %d '%s'\n", errno, strerror(errno) );
+    Alarmp( SPLOG_FATAL, EVENTS, "E_get_time_monotonic: clock_gettime problems: %d '%s'\n", errno, strerror(errno) );
   }
 
   Now.sec  = t.tv_sec;
@@ -224,7 +226,7 @@
 		res.usec = res.usec + 1000000;
 		res.sec--;
 	} 
-	if ( res.sec < 0 ) Alarm( EVENTS, "E_sub_time: negative time result.\n");
+	if ( res.sec < 0 ) Alarmp( SPLOG_INFO, EVENTS, "E_sub_time: negative time result.\n");
 	return ( res );
 }
 
@@ -280,14 +282,14 @@
 			Time_queue = Time_queue->next;
 			dispose( t_pre );
 			deleted = 1;
-			Alarm( EVENTS, "E_queue: dequeued a (first) simillar event\n" );
+			Alarmp( SPLOG_INFO, EVENTS, "E_queue: dequeued a (first) simillar event\n" );
 		}
 	}
 	if( Time_queue == NULL )
 	{
 		t_e->next  = NULL;
 		Time_queue = t_e;
-		Alarm( EVENTS, "E_queue: (only) event queued func 0x%x code %d data 0x%x in future (%u:%u)\n",t_e->func,t_e->code, t_e->data, delta_time.sec, delta_time.usec );
+		Alarmp( SPLOG_INFO, EVENTS, "E_queue: (only) event queued func 0x%x code %d data 0x%x in future (%u:%u)\n",t_e->func,t_e->code, t_e->data, delta_time.sec, delta_time.usec );
 		return( 0 );
 	}else{
 		compare = E_compare_time ( t_e->t, Time_queue->t );
@@ -296,7 +298,7 @@
 			t_e->next   = Time_queue;
 			Time_queue  = t_e;
 			inserted    = 1;
-			Alarm( EVENTS, "E_queue: (first) event queued func 0x%x code %d data 0x%x in future (%u:%u)\n",t_e->func,t_e->code, t_e->data, delta_time.sec,delta_time.usec );
+			Alarmp( SPLOG_INFO, EVENTS, "E_queue: (first) event queued func 0x%x code %d data 0x%x in future (%u:%u)\n",t_e->func,t_e->code, t_e->data, delta_time.sec,delta_time.usec );
 		}
 	}
 	t_pre    = Time_queue ; 
@@ -311,7 +313,7 @@
 			dispose( t_post );
 			t_post = t_pre->next;
 			deleted = 1;
-			Alarm( EVENTS, "E_queue: dequeued a simillar event\n" );
+			Alarmp( SPLOG_INFO, EVENTS, "E_queue: dequeued a simillar event\n" );
 			continue;
 		}
 
@@ -323,7 +325,7 @@
 				t_pre->next = t_e;
 				t_e->next   = t_post;
 				inserted    = 1;
-				Alarm( EVENTS, "E_queue: event queued for func 0x%x code %d data 0x%x in future (%u:%u)\n",t_e->func,t_e->code, t_e->data, delta_time.sec, delta_time.usec );
+				Alarmp( SPLOG_INFO, EVENTS, "E_queue: event queued for func 0x%x code %d data 0x%x in future (%u:%u)\n",t_e->func,t_e->code, t_e->data, delta_time.sec, delta_time.usec );
 			}
 		}
 
@@ -335,7 +337,7 @@
 	{
 		t_pre->next = t_e;
 		t_e->next   = NULL;
-		Alarm( EVENTS, "E_queue: (last) event queued func 0x%x code %d data 0x%x in future (%u:%u)\n",t_e->func,t_e->code, t_e->data, delta_time.sec,delta_time.usec );
+		Alarmp( SPLOG_INFO, EVENTS, "E_queue: (last) event queued func 0x%x code %d data 0x%x in future (%u:%u)\n",t_e->func,t_e->code, t_e->data, delta_time.sec,delta_time.usec );
 	}
 
 	return( 0 );
@@ -349,7 +351,7 @@
 
 	if( Time_queue == NULL )
 	{
-		Alarm( EVENTS, "E_dequeue: no such event\n" );
+		Alarmp( SPLOG_INFO, EVENTS, "E_dequeue: no such event\n" );
 		return( -1 );
 	}
 
@@ -360,7 +362,7 @@
 		t_ptr = Time_queue;
 		Time_queue = Time_queue->next;
 		dispose( t_ptr );
-		Alarm( EVENTS, "E_dequeue: first event dequeued func 0x%x code %d data 0x%x\n",func,code, data);
+		Alarmp( SPLOG_INFO, EVENTS, "E_dequeue: first event dequeued func 0x%x code %d data 0x%x\n",func,code, data);
 		return( 0 );
 	}
 
@@ -374,13 +376,13 @@
 		{
 			t_pre->next = t_ptr->next;
 			dispose( t_ptr );
-			Alarm( EVENTS, "E_dequeue: event dequeued func 0x%x code %d data 0x%x\n",func,code, data);
+			Alarmp( SPLOG_INFO, EVENTS, "E_dequeue: event dequeued func 0x%x code %d data 0x%x\n",func,code, data);
 			return( 0 );
 		}
 		t_pre = t_ptr;
 	}
 
-	Alarm( EVENTS, "E_dequeue: no such event\n" );
+	Alarmp( SPLOG_INFO, EVENTS, "E_dequeue: no such event\n" );
 	return( -1 );
 }
 
@@ -392,7 +394,7 @@
 
 	if( Time_queue == NULL )
 	{
-	    Alarm( EVENTS, "E_in_queue: no such event\n" );
+	    Alarmp( SPLOG_INFO, EVENTS, "E_in_queue: no such event\n" );
 		return( 0 );
 	}
 
@@ -400,7 +402,7 @@
             Time_queue->data == data &&
             Time_queue->code == code )
 	{
-		Alarm( EVENTS, "E_in_queue: found event in queue func 0x%x code %d data 0x%x\n",func,code, data);
+		Alarmp( SPLOG_INFO, EVENTS, "E_in_queue: found event in queue func 0x%x code %d data 0x%x\n",func,code, data);
 		return( 1 );
 	}
 
@@ -412,13 +414,13 @@
                     t_ptr->data == data &&
                     t_ptr->code == code )   
 		{
-		    Alarm( EVENTS, "E_in_queue: found event in queue func 0x%x code %d data 0x%x\n",func,code, data);
+		    Alarmp( SPLOG_INFO, EVENTS, "E_in_queue: found event in queue func 0x%x code %d data 0x%x\n",func,code, data);
 			return(1);
 		}
 		t_pre = t_ptr;
 	}
 
-	Alarm( EVENTS, "E_in_queue: no such event\n" );
+	Alarmp( SPLOG_INFO, EVENTS, "E_in_queue: no such event\n" );
 	return( 0 );
 }
 
@@ -433,7 +435,7 @@
 #ifndef ARCH_PC_WIN95
         if (select(0, NULL, NULL, NULL, &tmp_t ) < 0)
         {
-                Alarm( EVENTS, "E_delay: select delay returned error: %s\n", strerror(errno));
+                Alarmp( SPLOG_INFO, EVENTS, "E_delay: select delay returned error: %s\n", strerror(errno));
         }
 #else  /* ARCH_PC_WIN95 */
         SleepEx( tmp_t.tv_sec*1000+tmp_t.tv_usec/1000, 0 );
@@ -509,7 +511,7 @@
 
 
     if ( (fev != NULL && tev != NULL) || (fev == NULL && tev == NULL) ) {
-        Alarm( EXIT, "E_time_events: Bug! called with invalid fev (0x%x)  and tev (0x%x) pointers. Exactly one must be non NULL\n", fev, tev);
+        Alarmp( SPLOG_FATAL, EVENTS, "E_time_events: Bug! called with invalid fev (0x%x)  and tev (0x%x) pointers. Exactly one must be non NULL\n", fev, tev);
     }
 
     ev_dur = E_sub_time( stop, start );
@@ -563,12 +565,12 @@
 
 	if( priority < 0 || priority > NUM_PRIORITY )
 	{
-		Alarm( PRINT, "E_attach_fd: invalid priority %d for fd %d with fd_type %d\n", priority, fd, fd_type );
+		Alarmp( SPLOG_PRINT, EVENTS, "E_attach_fd: invalid priority %d for fd %d with fd_type %d\n", priority, fd, fd_type );
 		return( -1 );
 	}
 	if( fd_type < 0 || fd_type > NUM_FDTYPES )
 	{
-		Alarm( PRINT, "E_attach_fd: invalid fd_type %d for fd %d with priority %d\n", fd_type, fd, priority );
+		Alarmp( SPLOG_PRINT, EVENTS, "E_attach_fd: invalid fd_type %d for fd %d with priority %d\n", fd_type, fd, priority );
 		return( -1 );
 	}
 #ifndef	ARCH_PC_WIN95
@@ -577,7 +579,7 @@
 	 */
         if( fd < 0 || fd > FD_SETSIZE )
         {
-                Alarm( PRINT, "E_attach_fd: invalid fd %d (max %d) with fd_type %d with priority %d\n", fd, FD_SETSIZE, fd_type, priority );
+                Alarmp( SPLOG_PRINT, EVENTS, "E_attach_fd: invalid fd %d (max %d) with fd_type %d with priority %d\n", fd, FD_SETSIZE, fd_type, priority );
                 return( -1 );
         }
 #endif
@@ -591,7 +593,7 @@
                         if ( !(Fd_queue[priority].events[j].active) )
                                 Fd_queue[priority].num_active_fds++;
                         Fd_queue[priority].events[j].active = TRUE;
-			Alarm( EVENTS, 
+			Alarmp( SPLOG_INFO, EVENTS, 
 				"E_attach_fd: fd %d with type %d exists & replaced & activated\n", fd, fd_type );
 			return( 1 );
 		}
@@ -599,7 +601,7 @@
 	num_fds = Fd_queue[priority].num_fds;
 
         if ( num_fds == MAX_FD_EVENTS ) {
-                Alarm( PRINT, "E_attach_fd: Reached Maximum number of events. Recompile with larger MAX_FD_EVENTS\n");
+                Alarmp( SPLOG_PRINT, EVENTS, "E_attach_fd: Reached Maximum number of events. Recompile with larger MAX_FD_EVENTS\n");
                 return( -1 );
         }
 	Fd_queue[priority].events[num_fds].fd	   = fd;
@@ -612,7 +614,7 @@
         Fd_queue[priority].num_active_fds++;
 	if( Active_priority <= priority ) FD_SET( fd, &Fd_mask[fd_type] );
 
-	Alarm( EVENTS, "E_attach_fd: fd %d, fd_type %d, code %d, data 0x%x, priority %d Active_priority %d\n",
+	Alarmp( SPLOG_INFO, EVENTS, "E_attach_fd: fd %d, fd_type %d, code %d, data 0x%x, priority %d Active_priority %d\n",
 		fd, fd_type, code, data, priority, Active_priority );
 
 	return( 0 );
@@ -625,7 +627,7 @@
 
 	if( fd_type < 0 || fd_type > NUM_FDTYPES )
 	{
-		Alarm( PRINT, "E_detach_fd: invalid fd_type %d for fd %d\n", fd_type, fd );
+		Alarmp( SPLOG_PRINT, EVENTS, "E_detach_fd: invalid fd_type %d for fd %d\n", fd_type, fd );
 		return( -1 );
 	}
 
@@ -650,7 +652,7 @@
 
 	if( fd_type < 0 || fd_type > NUM_FDTYPES )
 	{
-		Alarm( PRINT, "E_detach_fd: invalid fd_type %d for fd %d\n", fd_type, fd );
+		Alarmp( SPLOG_PRINT, EVENTS, "E_detach_fd: invalid fd_type %d for fd %d\n", fd_type, fd );
 		return( -1 );
 	}
 
@@ -683,7 +685,7 @@
 
 	if( fd_type < 0 || fd_type > NUM_FDTYPES )
 	{
-		Alarm( PRINT, "E_deactivate_fd: invalid fd_type %d for fd %d\n", fd_type, fd );
+		Alarmp( SPLOG_PRINT, EVENTS, "E_deactivate_fd: invalid fd_type %d for fd %d\n", fd_type, fd );
 		return( -1 );
 	}
 
@@ -715,7 +717,7 @@
 
 	if( fd_type < 0 || fd_type > NUM_FDTYPES )
 	{
-		Alarm( PRINT, "E_activate_fd: invalid fd_type %d for fd %d\n", fd_type, fd );
+		Alarmp( SPLOG_PRINT, EVENTS, "E_activate_fd: invalid fd_type %d for fd %d\n", fd_type, fd );
 		return( -1 );
 	}
 
@@ -747,7 +749,7 @@
 
 	if( priority < 0 || priority > NUM_PRIORITY )
 	{
-		Alarm( PRINT, "E_set_active_threshold: invalid priority %d\n", priority );
+		Alarmp( SPLOG_PRINT, EVENTS, "E_set_active_threshold: invalid priority %d\n", priority );
 		return( -1 );
 	}
 
@@ -767,7 +769,7 @@
                 	FD_SET( Fd_queue[i].events[j].fd, &Fd_mask[fd_type] );
 	    }
 
-	Alarm( EVENTS, "E_set_active_threshold: changed to %d\n",Active_priority);
+	Alarmp( SPLOG_INFO, EVENTS, "E_set_active_threshold: changed to %d\n",Active_priority);
 
 	return( priority );
 }
@@ -776,7 +778,7 @@
 {
 	if( priority < 0 || priority > NUM_PRIORITY )
 	{
-		Alarm( PRINT, "E_num_active: invalid priority %d\n", priority );
+		Alarmp( SPLOG_PRINT, EVENTS, "E_num_active: invalid priority %d\n", priority );
 		return( -1 );
 	}
 	return( Fd_queue[priority].num_active_fds );
@@ -810,7 +812,7 @@
 #endif
     for( Exit_events = 0 ; !Exit_events ; )
     {
-	Alarm( EVENTS, "E_handle_events: next event \n");
+	Alarmp( SPLOG_INFO, EVENTS, "E_handle_events: next event \n");
 
 	/* Handle time events */
 	timeout = long_timeout;
@@ -835,9 +837,9 @@
 #endif
 			temp_ptr = Time_queue;
 			Time_queue = Time_queue->next;
-			Alarm( EVENTS, "E_handle_events: exec time event \n");
+			Alarmp( SPLOG_INFO, EVENTS, "E_handle_events: exec time event \n");
 #ifdef TESTTIME 
-                        Alarm( DEBUG, "Events: TimeEv is %d %d late\n",tmp_late.sec, tmp_late.usec); 
+                        Alarmp( SPLOG_DEBUG, EVENTS, "Events: TimeEv is %d %d late\n",tmp_late.sec, tmp_late.usec); 
 #endif
                         ev_start = Now;
 			temp_ptr->func( temp_ptr->code, temp_ptr->data );
@@ -861,14 +863,14 @@
 #ifdef TESTTIME
         stop = E_get_time_monotonic();
         tmp_late = E_sub_time(stop, start);
-        Alarm(DEBUG, "Events: TimeEv's took %d %d to handle\n", tmp_late.sec, tmp_late.usec); 
+        Alarmp( SPLOG_DEBUG, EVENTS, "Events: TimeEv's took %d %d to handle\n", tmp_late.sec, tmp_late.usec); 
 #endif
 	/* Handle fd events   */
 	for( i=0; i < NUM_FDTYPES; i++ )
 	{
 		current_mask[i] = Fd_mask[i];
 	}
-	Alarm( EVENTS, "E_handle_events: poll select\n");
+	Alarmp( SPLOG_INFO, EVENTS, "E_handle_events: poll select\n");
 #ifdef TESTTIME
         req_time = zero_sec;
 #endif
@@ -885,7 +887,7 @@
 		{
 			current_mask[i] = Fd_mask[i];
 		}
-		Alarm( EVENTS, "E_handle_events: select with timeout (%d, %d)\n",
+		Alarmp( SPLOG_INFO, EVENTS, "E_handle_events: select with timeout (%d, %d)\n",
 			timeout.sec,timeout.usec );
 #ifdef TESTTIME
                 req_time = E_add_time(req_time, timeout);
@@ -898,7 +900,7 @@
 #ifdef TESTTIME
         start = E_get_time_monotonic();
         tmp_late = E_sub_time(start, stop);
-        Alarm( DEBUG, "Events: Waiting for fd or timout took %d %d asked for %d %d\n", tmp_late.sec, tmp_late.usec, req_time.sec, req_time.usec);
+        Alarmp( SPLOG_DEBUG, EVENTS, "Events: Waiting for fd or timout took %d %d asked for %d %d\n", tmp_late.sec, tmp_late.usec, req_time.sec, req_time.usec);
 #endif
 	/* Handle all high and medium priority fd events */
 	for( i=NUM_PRIORITY-1,treated=0; 
@@ -911,7 +913,7 @@
 		fd_type = Fd_queue[i].events[j].fd_type;
 		if( FD_ISSET( fd, &current_mask[fd_type] ) )
 		{
-		    Alarm( EVENTS, "E_handle_events: exec handler for fd %d, fd_type %d, priority %d\n", 
+		    Alarmp( SPLOG_INFO, EVENTS, "E_handle_events: exec handler for fd %d, fd_type %d, priority %d\n", 
 					fd, fd_type, i );
 #ifdef BADCLOCK
 		    Now = E_add_time( Now, mili_sec );
@@ -950,7 +952,7 @@
 #ifdef TESTTIME
         stop = E_get_time_monotonic();
         tmp_late = E_sub_time(stop, start);
-        Alarm(DEBUG, "Events: High & Med took %d %d time to handle\n", tmp_late.sec, tmp_late.usec);
+        Alarmp(SPLOG_DEBUG, EVENTS, "Events: High & Med took %d %d time to handle\n", tmp_late.sec, tmp_late.usec);
 #endif
 	/* Handle one low priority fd event. 
            However, verify that Active_priority still allows LOW_PRIORITY events. 
@@ -968,7 +970,7 @@
 	    {
 		Round_robin = ( j + 1 ) % Fd_queue[LOW_PRIORITY].num_fds;
 
-		Alarm( EVENTS , "E_handle_events: exec ext fd event \n");
+		Alarmp( SPLOG_INFO, EVENTS , "E_handle_events: exec ext fd event \n");
 #ifdef BADCLOCK
                 Now = E_add_time( Now, mili_sec );
                 clock_sync++;
@@ -997,7 +999,7 @@
 #ifdef TESTTIME
         start = E_get_time_monotonic();
         tmp_late = E_sub_time(start, stop);
-        Alarm(DEBUG, "Events: Low priority took %d %d to handle\n", tmp_late.sec, tmp_late.usec);
+        Alarmp(SPLOG_DEBUG, EVENTS, "Events: Low priority took %d %d to handle\n", tmp_late.sec, tmp_late.usec);
 #endif
     }
  end_handler:
@@ -1009,14 +1011,14 @@
      */
 
     if (Exit_events == SPU_EVENTS_EXIT_ASYNC_SAFE) 
-        Alarm(EVENTS, "E_handle_events: exiting due to call to E_exit_events_async_safe() (e.g. - signal handler)\n");
+      Alarmp(SPLOG_INFO, EVENTS, "E_handle_events: exiting due to call to E_exit_events_async_safe() (e.g. - signal handler)\n");
 
     return;
 }
 
 void 	E_exit_events(void)
 {
-	Alarm( EVENTS, "E_exit_events:\n");
+	Alarmp( SPLOG_INFO, EVENTS, "E_exit_events:\n");
 	Exit_events = SPU_EVENTS_EXIT_NORMAL;
 }
 

Modified: trunk/libspread-util/src/memory.c
===================================================================
--- trunk/libspread-util/src/memory.c	2016-11-14 17:19:30 UTC (rev 860)
+++ trunk/libspread-util/src/memory.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -202,7 +202,7 @@
 
         ret = Mem_init_object( obj_type, obj_name, size, threshold, initial );
         if (ret < 0 ) {
-                Alarm( EXIT, "Mem_init_object_abort: Failed to initialize a/an %s object\n", obj_name);
+          Alarmp( SPLOG_FATAL, MEMORY, "Mem_init_object_abort: Failed to initialize a/an %s object\n", obj_name);
         }
 }
 /* Input: valid object type, name of object, threshold/watermark value for this object, initial objects to create
@@ -276,7 +276,7 @@
                         head_ptr = (mem_header *) calloc(1, sizeof(mem_header) + sizeobj(obj_type) );
                         if (head_ptr == NULL) 
                         {
-                                Alarm(MEMORY, "mem_init_object: Failure to calloc an initial object. Returning with existant buffers\n");
+                                Alarmp(SPLOG_INFO, MEMORY, "mem_init_object: Failure to calloc an initial object. Returning with existant buffers\n");
                                 mem_error = 1;
                                 break;
                         }
@@ -352,7 +352,7 @@
                 head_ptr = (mem_header *) calloc(1, sizeof(mem_header) + sizeobj(obj_type) );
                 if (head_ptr == NULL) 
                 {
-                        Alarm(MEMORY, "mem_alloc_object: Failure to calloc an object. Returning NULL object\n");
+                        Alarmp(SPLOG_INFO, MEMORY, "mem_alloc_object: Failure to calloc an object. Returning NULL object\n");
                         return(NULL);
                 }
                 head_ptr->obj_type = obj_type;
@@ -411,7 +411,7 @@
         printf("alloc:objtype = %u:\n", head_ptr->obj_type);
         printf("alloc:blocklen = %u:\n", head_ptr->block_len);
 #endif
-        Alarm(MEMORY, "new: creating pointer 0x%x to object type %d named %s\n", head_ptr + 1, obj_type, Objnum_to_String(obj_type));
+        Alarmp(SPLOG_INFO, MEMORY, "new: creating pointer 0x%x to object type %d named %s\n", head_ptr + 1, obj_type, Objnum_to_String(obj_type));
 
                 return((void *) (head_ptr + 1));
         } else
@@ -448,7 +448,7 @@
         printf("pool:objtype = %u:\n", mem_header_ptr((void *) body_ptr)->obj_type);
         printf("pool:blocklen = %u:\n", mem_header_ptr((void *) body_ptr)->block_len);
 #endif
-                Alarm(MEMORY, "new: reusing pointer 0x%x to object type %d named %s\n", body_ptr, obj_type, Objnum_to_String(obj_type));
+                Alarmp(SPLOG_INFO, MEMORY, "new: reusing pointer 0x%x to object type %d named %s\n", body_ptr, obj_type, Objnum_to_String(obj_type));
 
                 return((void *) (body_ptr));
         }
@@ -475,7 +475,7 @@
         head_ptr = (mem_header *) calloc(1, sizeof(mem_header) + length);
         if (head_ptr == NULL) 
         {
-                Alarm(MEMORY, "mem_alloc: Failure to calloc a block. Returning NULL block\n");
+                Alarmp(SPLOG_INFO, MEMORY, "mem_alloc: Failure to calloc a block. Returning NULL block\n");
                 return(NULL);
         }
         head_ptr->obj_type = BLOCK_OBJECT;
@@ -565,7 +565,7 @@
 	assert(Mem_Obj_Allocated > 0);
 	assert(Mem_Bytes_Allocated >= (mem_header_ptr(object)->block_len + sizeof(mem_header)));
 
-        Alarm(MEMORY, "dispose: disposing pointer 0x%x to object type %d named %s\n", object, obj_type, Objnum_to_String(obj_type));
+        Alarmp(SPLOG_INFO, MEMORY, "dispose: disposing pointer 0x%x to object type %d named %s\n", object, obj_type, Objnum_to_String(obj_type));
 
         Mem[obj_type].num_obj_inuse--;
         Mem_Obj_Inuse--;

Copied: trunk/libspread-util/src/spu_addr.c (from rev 845, branches/spread_5/libspread-util/src/spu_addr.c)
===================================================================
--- trunk/libspread-util/src/spu_addr.c	                        (rev 0)
+++ trunk/libspread-util/src/spu_addr.c	2016-11-14 17:40:56 UTC (rev 861)
@@ -0,0 +1,568 @@
+/*
+ * The Spread Toolkit.
+ *     
+ * The contents of this file are subject to the Spread Open-Source
+ * License, Version 1.0 (the ``License''); you may not use
+ * this file except in compliance with the License.  You may obtain a
+ * copy of the License at:
+ *
+ * http://www.spread.org/license/
+ *
+ * or in the file ``license.txt'' found in this distribution.
+ *
+ * Software distributed under the License is distributed on an AS IS basis, 
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
+ * for the specific language governing rights and limitations under the 
+ * License.
+ *
+ * The Creators of Spread are:
+ *  Yair Amir, Michal Miskin-Amir, Jonathan Stanton, John Schultz.
+ *
+ *  Copyright (C) 1993-2013 Spread Concepts LLC <info at spreadconcepts.com>
+ *
+ *  All Rights Reserved.
+ *
+ * Major Contributor(s):
+ * ---------------
+ *    Ryan Caudy           rcaudy at gmail.com - contributions to process groups.
+ *    Claudiu Danilov      claudiu at acm.org - scalable wide area support.
+ *    Cristina Nita-Rotaru crisn at cs.purdue.edu - group communication security.
+ *    Theo Schlossnagle    jesus at omniti.com - Perl, autoconf, old skiplist.
+ *    Dan Schoenblum       dansch at cnds.jhu.edu - Java interface.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#ifndef SPU_ARCH_PC_WIN95
+#  include <netdb.h>
+#endif
+
+#include "arch.h"
+#include "spu_alarm.h"
+#include "spu_addr.h"
+
+#ifndef GAI_STRERROR
+#  ifndef SPU_ARCH_PC_WIN95
+#    define GAI_STRERROR(e) gai_strerror(e)
+#  else
+#    define GAI_STRERROR(e) sock_strerror(e)
+#  endif
+#endif
+
+#ifndef EOVERFLOW
+#  ifndef SPU_ARCH_PC_WIN95
+#    define EOVERFLOW EINVAL
+#  else
+#    define EOVERFLOW WSA_INVALID_PARAMETER
+#  endif
+#endif
+
+/********************************************************************************
+ ********************************************************************************/
+
+char Spu_addr_ntop_buf[SPU_ADDR_STRSIZE];
+
+/********************************************************************************
+ ********************************************************************************/
+
+#if !defined(AF_UNSPEC) || AF_UNSPEC != 0
+#  error AF_UNSPEC is not defined or is non-zero?!
+#endif
+
+static socklen_t spu_addr_len_low(const spu_addr *a)
+{
+  socklen_t ret = 0;  /* return a length of 0 on unrecognized family to indicate error */
+  
+  switch (a->addr.sa_family)
+  {
+  case AF_UNSPEC:
+    ret = sizeof(*a);
+    break;
+    
+  case AF_INET:
+    ret = sizeof(a->ipv4);
+    break;
+
+  case AF_INET6:
+    ret = sizeof(a->ipv6);
+    break;
+
+#ifndef ARCH_PC_WIN95
+  case AF_UNIX:
+    ret = sizeof(a->un);
+    break;
+#endif
+  }
+
+  return ret;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+int spu_addr_from_sockaddr(spu_addr *a, const struct sockaddr *sa, socklen_t sa_len)
+{
+  if (sa_len > sizeof(*a))
+  {
+    errno = EINVAL; 
+    return -1;
+  }
+  
+  memmove(a, sa, sa_len);
+  memset((char*) a + sa_len, 0, sizeof(*a) - sa_len);
+
+  return 0;
+}
+
+/********************************************************************************
+ * Simple wrapper around getaddrinfo that uses first returned address.
+ ********************************************************************************/
+
+int spu_addr_from_str(spu_addr *a, const char *str, int pfamily, int is_numeric)
+{
+  struct addrinfo  hint = { 0 };
+  struct addrinfo *rslt = NULL;
+  int              ret;
+
+  hint.ai_family = pfamily;
+  hint.ai_flags  = (is_numeric ? AI_NUMERICHOST : 0);
+
+  if ((ret = getaddrinfo(str, NULL, &hint, &rslt)))
+  {
+    Alarmp(SPLOG_ERROR, DATA_LINK, "spu_addr_from_str: lookup on ('%s', %d, %d) failed: %d '%s'!\n", str, pfamily, is_numeric, ret, GAI_STRERROR(ret));
+    goto FAIL;
+  }
+
+  if (rslt == NULL)
+  {
+    Alarmp(SPLOG_ERROR, DATA_LINK, "spu_addr_from_str: BUG?  Successful lookup on ('%s', %d, %d) returned no address!\n", str, pfamily, is_numeric);
+    ret = EAI_FAIL;
+    goto FAIL;
+  }
+
+  if (rslt->ai_addr == NULL)
+  {
+    Alarmp(SPLOG_ERROR, DATA_LINK, "spu_addr_from_str: BUG?  Successful lookup on ('%s', %d, %d) returned no address 2!\n", str, pfamily, is_numeric);
+    ret = EAI_FAIL;
+    goto FAIL_RSLT;
+  }
+
+  if (spu_addr_from_sockaddr(a, rslt->ai_addr, rslt->ai_addrlen))
+  {
+    Alarmp(SPLOG_ERROR, DATA_LINK, "spu_addr_from_str: BUG? spu_addr_from_sockaddr failed?!\n", str);
+    ret = EAI_FAIL;
+    goto FAIL_RSLT;
+  }
+  
+FAIL_RSLT:
+  freeaddrinfo(rslt);
+
+FAIL:
+  return ret;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+int spu_addr_family(const spu_addr *a)
+{
+  return a->addr.sa_family;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+int spu_addr_ntop_r(const spu_addr *a, char *str, size_t n)
+{
+  socklen_t len = spu_addr_len_low(a);
+  int       ret = getnameinfo(&a->addr, (len ? len : sizeof(*a)), str, n, NULL, 0, NI_NUMERICHOST);
+
+  if (ret)
+    Alarmp(SPLOG_ERROR, DATA_LINK, "spu_addr_ntop_r: getnameinfo failed %d '%s'\n", ret, GAI_STRERROR(ret));
+  
+  return ret;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+int spu_addr_ntop_canon_r(const spu_addr *a, char *str, size_t n)
+{
+  int ret;
+
+  if (a->addr.sa_family == AF_INET)
+  {
+    ret = snprintf(str, n, "%u.%u.%u.%u",
+                   ((unsigned char*) &a->ipv4.sin_addr.s_addr)[0],
+                   ((unsigned char*) &a->ipv4.sin_addr.s_addr)[1],
+                   ((unsigned char*) &a->ipv4.sin_addr.s_addr)[2],
+                   ((unsigned char*) &a->ipv4.sin_addr.s_addr)[3]);
+
+    if (ret >= 0)
+      ret = ((size_t) ret < n ? 0 : EOVERFLOW);
+  }
+  else if (a->addr.sa_family == AF_INET6)
+  {
+    ret = snprintf(str, n, "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
+                   a->ipv6.sin6_addr.s6_addr[0],  a->ipv6.sin6_addr.s6_addr[1],  a->ipv6.sin6_addr.s6_addr[2],  a->ipv6.sin6_addr.s6_addr[3],
+                   a->ipv6.sin6_addr.s6_addr[4],  a->ipv6.sin6_addr.s6_addr[5],  a->ipv6.sin6_addr.s6_addr[6],  a->ipv6.sin6_addr.s6_addr[7],
+                   a->ipv6.sin6_addr.s6_addr[8],  a->ipv6.sin6_addr.s6_addr[9],  a->ipv6.sin6_addr.s6_addr[10], a->ipv6.sin6_addr.s6_addr[11],
+                   a->ipv6.sin6_addr.s6_addr[12], a->ipv6.sin6_addr.s6_addr[13], a->ipv6.sin6_addr.s6_addr[14], a->ipv6.sin6_addr.s6_addr[15]);
+
+    if (ret >= 0) 
+      ret = ((size_t) ret < n ? 0 : EOVERFLOW);
+  }
+  else
+    ret = spu_addr_ntop_r(a, str, n);
+  
+  return ret;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+int spu_addr_from_sockaddr_known(spu_addr *a, const struct sockaddr *sa)
+{
+  int    ret  = 0;
+  size_t zero = 0;
+  
+  switch (sa->sa_family)
+  {
+  case AF_UNSPEC:
+    zero = sizeof(*a);
+    break;
+    
+  case AF_INET:
+    a->ipv4 = *(struct sockaddr_in*) sa;
+    zero    = sizeof(*a) - sizeof(a->ipv4);
+    break;
+
+  case AF_INET6:
+    a->ipv6 = *(struct sockaddr_in6*) sa;
+    zero    = sizeof(*a) - sizeof(a->ipv6);
+    break;
+
+#ifndef ARCH_PC_WIN95
+  case AF_UNIX:
+    a->un = *(struct sockaddr_un*) sa;
+    zero  = sizeof(*a) - sizeof(a->un);
+    break;
+#endif
+    
+  default:
+    Alarmp(SPLOG_FATAL, NONE, "spu_addr_from_sockaddr_known: unexpected address family: %d\n", sa->sa_family);
+    break;
+  }
+
+  memset((char*) (a + 1) - zero, 0, zero);
+
+  return ret;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+socklen_t spu_addr_len(const spu_addr *a)
+{
+  socklen_t ret = spu_addr_len_low(a);
+
+  if (!ret)
+    Alarmp(SPLOG_FATAL, NONE, "spu_addr_len: unrecognized address family: %d\n", a->addr.sa_family);
+
+  return ret;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+const char *spu_addr_family_str(const spu_addr *a)
+{
+  return spu_af_str(a->addr.sa_family);
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+const char *spu_af_str(int family)
+{
+  const char *ret = NULL;
+  
+  switch (family)
+  {
+  case AF_UNSPEC:
+    ret = "AF_UNSPEC";
+    break;
+    
+  case AF_INET:
+    ret = "AF_INET";
+    break;
+
+  case AF_INET6:
+    ret = "AF_INET6";
+    break;
+
+#ifndef ARCH_PC_WIN95
+  case AF_UNIX:
+    ret = "AF_UNIX";
+    break;
+#endif
+    
+  default:
+    Alarmp(SPLOG_FATAL, NONE, "spu_af_str: unexpected address family: %d\n", family);
+    break;
+  }
+
+  return ret;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+int spu_addr_ip_cmp(const spu_addr *l, const spu_addr *r, int include_port)
+{
+  int ret;
+
+  if ((l->addr.sa_family != AF_INET && l->addr.sa_family != AF_INET6) ||
+      (r->addr.sa_family != AF_INET && r->addr.sa_family != AF_INET6))
+    Alarmp(SPLOG_FATAL, NONE, "spu_addr_ip_cmp: unrecognized address families %d %d; AF_INET = %d, AF_INET6 = %d\n",
+           l->addr.sa_family, r->addr.sa_family, AF_INET, AF_INET6);
+
+  if (l->addr.sa_family == r->addr.sa_family)
+  {
+    switch(l->addr.sa_family)
+    {
+    case AF_INET:
+      if ((ret = memcmp(&l->ipv4.sin_addr.s_addr, &r->ipv4.sin_addr.s_addr, 4)) == 0 && include_port)
+      {
+        if (ntohs(l->ipv4.sin_port) < ntohs(r->ipv4.sin_port))
+          ret = -1;
+
+        else if (l->ipv4.sin_port != r->ipv4.sin_port)
+          ret = 1;
+      }      
+      break;
+
+    case AF_INET6:
+      if ((ret = memcmp(l->ipv6.sin6_addr.s6_addr, r->ipv6.sin6_addr.s6_addr, 16)) == 0 && include_port)
+      {
+        if (ntohs(l->ipv6.sin6_port) < ntohs(r->ipv6.sin6_port))
+          ret = -1;
+
+        else if (l->ipv6.sin6_port != r->ipv6.sin6_port)
+          ret = 1;
+      }
+      break;
+    }
+  }
+  else if (l->addr.sa_family == AF_INET)
+    ret = -1;
+
+  else
+    ret = 1;
+
+  return ret;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+int spu_addr_ip_is_unspecified(const spu_addr *a)
+{
+  int ret = 0;
+  
+  switch (a->addr.sa_family)
+  {
+  case AF_INET:
+    ret = (a->ipv4.sin_addr.s_addr == INADDR_ANY);
+    break;
+
+  case AF_INET6:
+    ret = IN6_IS_ADDR_UNSPECIFIED(&a->ipv6.sin6_addr);
+    break;
+
+  default:
+    Alarmp(SPLOG_FATAL, NONE, "spu_addr_ip_is_unspecified: unexpected address family: %d\n", a->addr.sa_family);    
+    break;
+  }
+
+  return ret;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+int spu_addr_ip_is_loopback(const spu_addr *a)
+{
+  int ret = 0;
+  
+  switch (a->addr.sa_family)
+  {
+  case AF_INET:
+    ret = (((char*) &a->ipv4.sin_addr.s_addr)[0] == 127);
+    break;
+
+  case AF_INET6:
+    ret = IN6_IS_ADDR_LOOPBACK(&a->ipv6.sin6_addr);
+    break;
+
+  default:
+    Alarmp(SPLOG_FATAL, NONE, "spu_addr_ip_is_loopback: unexpected address family: %d\n", a->addr.sa_family);    
+    break;
+  }
+
+  return ret;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+int spu_addr_ip_is_multicast(const spu_addr *a)
+{
+  int            ret  = 0;
+  unsigned char *ipv4 = (unsigned char*) &a->ipv4.sin_addr.s_addr;
+  
+  switch (a->addr.sa_family)
+  {
+  case AF_INET:
+    ret = ((ipv4[0] & 0xF0) == 224);  /* 224.0.0.0/4 */
+    break;
+
+  case AF_INET6:
+    ret = IN6_IS_ADDR_MULTICAST(&a->ipv6.sin6_addr);
+    break;
+
+  default:
+    Alarmp(SPLOG_FATAL, NONE, "spu_addr_ip_is_multicast: unexpected address family: %d\n", a->addr.sa_family);    
+    break;
+  }
+
+  return ret;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+int spu_addr_ip_is_linklocal(const spu_addr *a)
+{
+  int            ret  = 0;
+  unsigned char *ipv4 = (unsigned char*) &a->ipv4.sin_addr.s_addr;
+  
+  switch (a->addr.sa_family)
+  {
+  case AF_INET:
+    ret = (ipv4[0] == 169 && ipv4[1] == 254);  /* 169.254.0.0/16 */
+    break;
+
+  case AF_INET6:
+    ret = IN6_IS_ADDR_LINKLOCAL(&a->ipv6.sin6_addr);
+    break;
+
+  default:
+    Alarmp(SPLOG_FATAL, NONE, "spu_addr_ip_is_linklocal: unexpected address family: %d\n", a->addr.sa_family);    
+    break;
+  }
+
+  return ret;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+int spu_addr_ip_is_sitelocal(const spu_addr *a)
+{
+  int            ret  = 0;
+  unsigned char *ipv4 = (unsigned char*) &a->ipv4.sin_addr.s_addr;
+  
+  switch (a->addr.sa_family)
+  {
+  case AF_INET:
+    ret = (ipv4[0] == 10 ||                                 /* 10.0.0.0/24 */
+           (ipv4[0] == 172 && ((ipv4[1] & 0xF0) == 16)) ||  /* 172.16.0.0/20 */
+           (ipv4[0] == 192 && ipv4[1] == 168));             /* 192.168.0.0/16 */
+    break;
+
+  case AF_INET6:
+    ret = IN6_IS_ADDR_SITELOCAL(&a->ipv6.sin6_addr);
+    break;
+
+  default:
+    Alarmp(SPLOG_FATAL, NONE, "spu_addr_ip_is_sitelocal: unexpected address family: %d\n", a->addr.sa_family);    
+    break;
+  }
+
+  return ret;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+void spu_addr_ip_set_unspecified(spu_addr *a)
+{
+  switch (a->addr.sa_family)
+  {
+  case AF_INET:
+    a->ipv4.sin_addr.s_addr = htonl(INADDR_ANY);
+    break;
+    
+  case AF_INET6:
+    a->ipv6.sin6_addr = in6addr_any;
+    break;
+
+  default:
+    Alarmp(SPLOG_FATAL, NONE, "spu_addr_ip_inaddrany: unexpected address family: %d\n", a->addr.sa_family);
+    break;
+  }
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+int16u spu_addr_ip_get_port(const spu_addr *a)
+{
+  int16u ret = 0;
+  
+  switch (a->addr.sa_family)
+  {
+  case AF_INET:
+    ret = ntohs(a->ipv4.sin_port);
+    break;
+
+  case AF_INET6:
+    ret = ntohs(a->ipv6.sin6_port);
+    break;
+
+  default:
+    Alarmp(SPLOG_FATAL, NONE, "spu_addr_ip_get_port: unexpected address family: %d\n", a->addr.sa_family);
+    break;
+  }
+
+  return ret;
+}
+
+/********************************************************************************
+ ********************************************************************************/
+
+void spu_addr_ip_set_port(spu_addr *a, int16u port)
+{
+  switch (a->addr.sa_family)
+  {
+  case AF_INET:
+    a->ipv4.sin_port = htons(port);
+    break;
+
+  case AF_INET6:
+    a->ipv6.sin6_port = htons(port);
+    break;
+
+  default:
+    Alarmp(SPLOG_FATAL, NONE, "spu_addr_ip_set_port: unexpected address family: %d\n", a->addr.sa_family);
+    break;
+  }
+}
+
+/********************************************************************************
+ ********************************************************************************/




More information about the Spread-cvs mailing list