diff -Pur xntp3-5.93/acconfig.h xntp3-5.93-garmin/acconfig.h
--- xntp3-5.93/acconfig.h	Mon Mar  2 21:55:26 1998
+++ xntp3-5.93-garmin/acconfig.h	Fri Jan 19 22:49:48 2001
@@ -94,6 +94,9 @@
 /* NMEA GPS receiver */
 #undef NMEA
 
+/* Garmin GPS Handheld Receivers */
+#undef CLOCK_GARMIN
+
 /* PARSE driver interface */
 #undef PARSE
 
diff -Pur xntp3-5.93/aclocal.m4 xntp3-5.93-garmin/aclocal.m4
--- xntp3-5.93/aclocal.m4	Sat Apr 25 15:02:29 1998
+++ xntp3-5.93-garmin/aclocal.m4	Wed Jan 24 13:57:30 2001
@@ -1,7 +1,7 @@
-dnl aclocal.m4 generated automatically by aclocal 1.2h
+dnl aclocal.m4 generated automatically by aclocal 1.4
 
-dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
-dnl This Makefile.in is free software; the Free Software Foundation
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
@@ -20,7 +20,7 @@
 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
 
 AC_DEFUN(AM_INIT_AUTOMAKE,
-[AC_REQUIRE([AM_PROG_INSTALL])
+[AC_REQUIRE([AC_PROG_INSTALL])
 PACKAGE=[$1]
 AC_SUBST(PACKAGE)
 VERSION=[$2]
@@ -30,8 +30,8 @@
   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
 fi
 ifelse([$3],,
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
 AC_REQUIRE([AM_SANITY_CHECK])
 AC_REQUIRE([AC_ARG_PROGRAM])
 dnl FIXME This is truly gross.
@@ -42,15 +42,6 @@
 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
 AC_REQUIRE([AC_PROG_MAKE_SET])])
-
-
-# serial 1
-
-AC_DEFUN(AM_PROG_INSTALL,
-[AC_REQUIRE([AC_PROG_INSTALL])
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-AC_SUBST(INSTALL_SCRIPT)dnl
-])
 
 #
 # Check to make sure that the build environment is sane.
diff -Pur xntp3-5.93/config.h.in xntp3-5.93-garmin/config.h.in
--- xntp3-5.93/config.h.in	Fri Apr 24 17:12:51 1998
+++ xntp3-5.93-garmin/config.h.in	Fri Jan 19 22:30:48 2001
@@ -182,6 +182,9 @@
 /* Spectracom 8170/Netclock/2 WWVB receiver */
 #undef WWVB
 
+/* Garmin GPS Handheld Receivers */
+#undef CLOCK_GARMIN
+
 /* define if it's OK to declare char *sys_errlist[]; */
 #undef CHAR_SYS_ERRLIST
 
diff -Pur xntp3-5.93/configure xntp3-5.93-garmin/configure
--- xntp3-5.93/configure	Sat Apr 25 15:02:36 1998
+++ xntp3-5.93-garmin/configure	Wed Jan 24 13:57:52 2001
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12 
+# Generated automatically using autoconf version 2.13 
 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
 #
 # This configure script is free software; the Free Software Foundation
@@ -60,6 +60,8 @@
 ac_help="$ac_help
   --enable-NMEA             + NMEA GPS receiver"
 ac_help="$ac_help
+  --enable-GARMIN             + Garmin GPS Handheld Receivers"
+ac_help="$ac_help
   --enable-PST              + PST/Traconex 1020 WWV/WWVH receiver"
 ac_help="$ac_help
   --enable-PTBACTS          s PTB modem service"
@@ -149,6 +151,7 @@
 # Initialize some other variables.
 subdirs=
 MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
 # Maximum number of lines to put in a shell here document.
 ac_max_here_lines=12
 
@@ -281,7 +284,7 @@
   --x-libraries=DIR       X library files are in DIR
 EOF
     if test -n "$ac_help"; then
-      echo "--enable and --with options known (Default: + yes, - no, s system-specific):$ac_help"
+      echo "--enable and --with options recognized:$ac_help"
     fi
     exit 0 ;;
 
@@ -432,7 +435,7 @@
     verbose=yes ;;
 
   -version | --version | --versio | --versi | --vers)
-    echo "configure generated by autoconf version 2.12"
+    echo "configure generated by autoconf version 2.13"
     exit 0 ;;
 
   -with-* | --with-*)
@@ -602,9 +605,11 @@
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
+ac_exeext=
+ac_objext=o
 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@@ -644,28 +649,30 @@
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:652: checking for a BSD compatible install" >&5
+echo "configure:658: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
-      for ac_prog in ginstall installbsd scoinst install; do
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
         if test -f $ac_dir/$ac_prog; then
 	  if test $ac_prog = install &&
             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
-	    # OSF/1 installbsd also uses dspmsg, but is usable.
 	    :
 	  else
 	    ac_cv_path_install="$ac_dir/$ac_prog -c"
@@ -695,13 +702,12 @@
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-
 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:705: checking whether build environment is sane" >&5
+echo "configure:711: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -758,7 +764,7 @@
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:762: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:768: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -804,7 +810,7 @@
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:808: checking for working aclocal" >&5
+echo "configure:814: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -817,7 +823,7 @@
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:821: checking for working autoconf" >&5
+echo "configure:827: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -830,7 +836,7 @@
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:834: checking for working automake" >&5
+echo "configure:840: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -843,7 +849,7 @@
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:847: checking for working autoheader" >&5
+echo "configure:853: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -856,7 +862,7 @@
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:860: checking for working makeinfo" >&5
+echo "configure:866: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -892,33 +898,33 @@
 
 
 # Make sure we can run config.sub.
-if $ac_config_sub sun4 >/dev/null 2>&1; then :
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:901: checking host system type" >&5
+echo "configure:907: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
 NONE)
   case $nonopt in
   NONE)
-    if host_alias=`$ac_config_guess`; then :
+    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
     fi ;;
   *) host_alias=$nonopt ;;
   esac ;;
 esac
 
-host=`$ac_config_sub $host_alias`
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:922: checking target system type" >&5
+echo "configure:928: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -929,14 +935,14 @@
   esac ;;
 esac
 
-target=`$ac_config_sub $target_alias`
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
 target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:940: checking build system type" >&5
+echo "configure:946: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -947,7 +953,7 @@
   esac ;;
 esac
 
-build=`$ac_config_sub $build_alias`
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
@@ -968,12 +974,12 @@
 for ac_func in strerror
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:972: checking for $ac_func" >&5
+echo "configure:978: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 977 "configure"
+#line 983 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -996,7 +1002,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1017,7 +1023,7 @@
  
 else
   echo "$ac_t""no" 1>&6
-LIBOBJS="$LIBOBJS ${ac_func}.o"
+LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
 fi
 done
 
@@ -1045,15 +1051,16 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1049: checking for $ac_word" >&5
+echo "configure:1055: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_CC="gcc"
@@ -1074,16 +1081,17 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1078: checking for $ac_word" >&5
+echo "configure:1085: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_prog_rejected=no
-  for ac_dir in $PATH; do
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
@@ -1118,25 +1126,61 @@
   echo "$ac_t""no" 1>&6
 fi
 
+  if test -z "$CC"; then
+    case "`uname -s`" in
+    *win32* | *WIN32*)
+      # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1136: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="cl"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ ;;
+    esac
+  fi
   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1126: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1168: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
 cross_compiling=$ac_cv_prog_cc_cross
 
-cat > conftest.$ac_ext <<EOF
-#line 1136 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 1179 "configure"
 #include "confdefs.h"
+
 main(){return(0);}
 EOF
-if { (eval echo configure:1140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1150,18 +1194,24 @@
   ac_cv_prog_cc_works=no
 fi
 rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
 
 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
 if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1160: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1210: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1165: checking whether we are using GNU C" >&5
+echo "configure:1215: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1170,7 +1220,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1181,11 +1231,15 @@
 
 if test $ac_cv_prog_gcc = yes; then
   GCC=yes
-  ac_test_CFLAGS="${CFLAGS+set}"
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS=
-  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1189: checking whether ${CC-cc} accepts -g" >&5
+else
+  GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1243: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1200,20 +1254,24 @@
 fi
 
 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-  if test "$ac_test_CFLAGS" = set; then
-    CFLAGS="$ac_save_CFLAGS"
-  elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
     CFLAGS="-g -O2"
   else
-    CFLAGS="-O2"
+    CFLAGS="-g"
   fi
 else
-  GCC=
-  test "${CFLAGS+set}" = set || CFLAGS="-g"
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1217: checking how to run the C preprocessor" >&5
+echo "configure:1275: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1228,14 +1286,14 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1232 "configure"
+#line 1290 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1245,14 +1303,31 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1249 "configure"
+#line 1307 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1313: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -nologo -E"
+  cat > conftest.$ac_ext <<EOF
+#line 1324 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1330: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
 else
@@ -1265,6 +1340,8 @@
 rm -f conftest*
 fi
 rm -f conftest*
+fi
+rm -f conftest*
   ac_cv_prog_CPP="$CPP"
 fi
   CPP="$ac_cv_prog_CPP"
@@ -1290,20 +1367,21 @@
     ;;
 esac
 
-for ac_prog in mawk gawk nawk awk
+for ac_prog in gawk mawk nawk awk
 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1299: checking for $ac_word" >&5
+echo "configure:1376: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$AWK"; then
   ac_cv_prog_AWK="$AWK" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_AWK="$ac_prog"
@@ -1324,7 +1402,7 @@
 done
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1328: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1406: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1366,7 +1444,7 @@
     # CFLAGS="$CFLAGS -Wstrict-prototypes"
 
     echo $ac_n "checking whether ${CC-cc} accepts -pipe""... $ac_c" 1>&6
-echo "configure:1370: checking whether ${CC-cc} accepts -pipe" >&5
+echo "configure:1448: checking whether ${CC-cc} accepts -pipe" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_pipe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1424,7 +1502,7 @@
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1428: checking whether ln -s works" >&5
+echo "configure:1506: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1446,13 +1524,13 @@
 
 if test $ac_cv_prog_gcc = yes; then
     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1450: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:1528: checking whether ${CC-cc} needs -traditional" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
     ac_pattern="Autoconf.*'x'"
   cat > conftest.$ac_ext <<EOF
-#line 1456 "configure"
+#line 1534 "configure"
 #include "confdefs.h"
 #include <sgtty.h>
 Autoconf TIOCGETP
@@ -1470,7 +1548,7 @@
 
   if test $ac_cv_prog_gcc_traditional = no; then
     cat > conftest.$ac_ext <<EOF
-#line 1474 "configure"
+#line 1552 "configure"
 #include "confdefs.h"
 #include <termio.h>
 Autoconf TCGETA
@@ -1492,9 +1570,9 @@
 fi
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:1496: checking for AIX" >&5
+echo "configure:1574: checking for AIX" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1498 "configure"
+#line 1576 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -1517,18 +1595,18 @@
 
 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:1521: checking for minix/config.h" >&5
+echo "configure:1599: checking for minix/config.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1526 "configure"
+#line 1604 "configure"
 #include "confdefs.h"
 #include <minix/config.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1531: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -1565,7 +1643,7 @@
 fi
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1569: checking for POSIXized ISC" >&5
+echo "configure:1647: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -1588,15 +1666,16 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1592: checking for $ac_word" >&5
+echo "configure:1670: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
-  for ac_dir in $PATH; do
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
       ac_cv_prog_RANLIB="ranlib"
@@ -1628,28 +1707,30 @@
 # SunOS /usr/etc/install
 # IRIX /sbin/install
 # AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1636: checking for a BSD compatible install" >&5
+echo "configure:1716: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
   for ac_dir in $PATH; do
     # Account for people who put trailing slashes in PATH elements.
     case "$ac_dir/" in
     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
     *)
       # OSF1 and SCO ODT 3.0 have their own names for install.
-      for ac_prog in ginstall installbsd scoinst install; do
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
         if test -f $ac_dir/$ac_prog; then
 	  if test $ac_prog = install &&
             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
-	    # OSF/1 installbsd also uses dspmsg, but is usable.
 	    :
 	  else
 	    ac_cv_path_install="$ac_dir/$ac_prog -c"
@@ -1679,6 +1760,8 @@
 # It thinks the first close brace ends the variable substitution.
 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
@@ -1699,7 +1782,7 @@
 esac
 
 echo $ac_n "checking for nlist in -lelf""... $ac_c" 1>&6
-echo "configure:1703: checking for nlist in -lelf" >&5
+echo "configure:1786: checking for nlist in -lelf" >&5
 ac_lib_var=`echo elf'_'nlist | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1707,7 +1790,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lelf  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1711 "configure"
+#line 1794 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1718,7 +1801,7 @@
 nlist()
 ; return 0; }
 EOF
-if { (eval echo configure:1722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1748,7 +1831,7 @@
 case "$check_libgen" in
  yes)
     echo $ac_n "checking for openlog in -lgen""... $ac_c" 1>&6
-echo "configure:1752: checking for openlog in -lgen" >&5
+echo "configure:1835: checking for openlog in -lgen" >&5
 ac_lib_var=`echo gen'_'openlog | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1756,7 +1839,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1760 "configure"
+#line 1843 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1767,7 +1850,7 @@
 openlog()
 ; return 0; }
 EOF
-if { (eval echo configure:1771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1797,7 +1880,7 @@
     ;;
 esac
 echo $ac_n "checking for main in -lkvm""... $ac_c" 1>&6
-echo "configure:1801: checking for main in -lkvm" >&5
+echo "configure:1884: checking for main in -lkvm" >&5
 ac_lib_var=`echo kvm'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1805,14 +1888,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lkvm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1809 "configure"
+#line 1892 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1839,7 +1922,7 @@
   echo "$ac_t""no" 1>&6
 fi
 		echo $ac_n "checking for nlist in -lld""... $ac_c" 1>&6
-echo "configure:1843: checking for nlist in -lld" >&5
+echo "configure:1926: checking for nlist in -lld" >&5
 ac_lib_var=`echo ld'_'nlist | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1847,7 +1930,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1851 "configure"
+#line 1934 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1858,7 +1941,7 @@
 nlist()
 ; return 0; }
 EOF
-if { (eval echo configure:1862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1886,7 +1969,7 @@
 fi
 
 echo $ac_n "checking for nlist in -lmld""... $ac_c" 1>&6
-echo "configure:1890: checking for nlist in -lmld" >&5
+echo "configure:1973: checking for nlist in -lmld" >&5
 ac_lib_var=`echo mld'_'nlist | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1894,7 +1977,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lmld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1898 "configure"
+#line 1981 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1905,7 +1988,7 @@
 nlist()
 ; return 0; }
 EOF
-if { (eval echo configure:1909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1935,7 +2018,7 @@
 case "$check_libnsl" in
  yes)
     echo $ac_n "checking for gethostbyaddr in -lnsl""... $ac_c" 1>&6
-echo "configure:1939: checking for gethostbyaddr in -lnsl" >&5
+echo "configure:2022: checking for gethostbyaddr in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyaddr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1943,7 +2026,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl -lsocket $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1947 "configure"
+#line 2030 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1954,7 +2037,7 @@
 gethostbyaddr()
 ; return 0; }
 EOF
-if { (eval echo configure:1958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1984,7 +2067,7 @@
     ;;
 esac
 echo $ac_n "checking for main in -lposix4""... $ac_c" 1>&6
-echo "configure:1988: checking for main in -lposix4" >&5
+echo "configure:2071: checking for main in -lposix4" >&5
 ac_lib_var=`echo posix4'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1992,14 +2075,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lposix4  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1996 "configure"
+#line 2079 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:2003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2028,7 +2111,7 @@
 	case "$check_libsocket" in
  yes)
     echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:2032: checking for socket in -lsocket" >&5
+echo "configure:2115: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2036,7 +2119,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2040 "configure"
+#line 2123 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2047,7 +2130,7 @@
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:2051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2078,12 +2161,12 @@
 esac
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2082: checking for ANSI C header files" >&5
+echo "configure:2165: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2087 "configure"
+#line 2170 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2091,8 +2174,8 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   ac_cv_header_stdc=yes
@@ -2108,7 +2191,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2112 "configure"
+#line 2195 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2126,7 +2209,7 @@
 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 <<EOF
-#line 2130 "configure"
+#line 2213 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2147,7 +2230,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2151 "configure"
+#line 2234 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2158,7 +2241,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2185,18 +2268,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2189: checking for $ac_hdr" >&5
+echo "configure:2272: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2194 "configure"
+#line 2277 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2225,18 +2308,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2229: checking for $ac_hdr" >&5
+echo "configure:2312: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2234 "configure"
+#line 2317 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2322: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2265,18 +2348,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2269: checking for $ac_hdr" >&5
+echo "configure:2352: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2274 "configure"
+#line 2357 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2305,18 +2388,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2309: checking for $ac_hdr" >&5
+echo "configure:2392: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2314 "configure"
+#line 2397 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2319: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2345,18 +2428,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2349: checking for $ac_hdr" >&5
+echo "configure:2432: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2354 "configure"
+#line 2437 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2387,18 +2470,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2391: checking for $ac_hdr" >&5
+echo "configure:2474: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2396 "configure"
+#line 2479 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2401: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2484: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2429,18 +2512,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2433: checking for $ac_hdr" >&5
+echo "configure:2516: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2438 "configure"
+#line 2521 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2469,18 +2552,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2473: checking for $ac_hdr" >&5
+echo "configure:2556: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2478 "configure"
+#line 2561 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2483: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2513,18 +2596,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2517: checking for $ac_hdr" >&5
+echo "configure:2600: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2522 "configure"
+#line 2605 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2527: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2555,18 +2638,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2559: checking for $ac_hdr" >&5
+echo "configure:2642: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2564 "configure"
+#line 2647 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2595,18 +2678,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2599: checking for $ac_hdr" >&5
+echo "configure:2682: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2604 "configure"
+#line 2687 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2635,18 +2718,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2639: checking for $ac_hdr" >&5
+echo "configure:2722: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2644 "configure"
+#line 2727 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2672,12 +2755,12 @@
 done
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2676: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2759: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2681 "configure"
+#line 2764 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -2686,7 +2769,7 @@
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:2690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -2712,18 +2795,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2716: checking for $ac_hdr" >&5
+echo "configure:2799: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2721 "configure"
+#line 2804 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2754,18 +2837,18 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2758: checking for $ac_hdr" >&5
+echo "configure:2841: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2763 "configure"
+#line 2846 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2768: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2851: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2795,18 +2878,18 @@
 
 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
-echo "configure:2799: checking for nlist.h" >&5
+echo "configure:2882: checking for nlist.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2804 "configure"
+#line 2887 "configure"
 #include "confdefs.h"
 #include <nlist.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:2892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
@@ -2826,19 +2909,19 @@
 EOF
 
 echo $ac_n "checking for n_un in struct nlist""... $ac_c" 1>&6
-echo "configure:2830: checking for n_un in struct nlist" >&5
+echo "configure:2913: checking for n_un in struct nlist" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_nlist_n_un'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2835 "configure"
+#line 2918 "configure"
 #include "confdefs.h"
 #include <nlist.h>
 int main() {
 struct nlist n; n.n_un.n_name = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:2842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_nlist_n_un=yes
 else
@@ -2863,12 +2946,12 @@
 fi
 
 echo $ac_n "checking for basic volatile support""... $ac_c" 1>&6
-echo "configure:2867: checking for basic volatile support" >&5
+echo "configure:2950: checking for basic volatile support" >&5
 if eval "test \"`echo '$''{'ac_cv_c_volatile'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2872 "configure"
+#line 2955 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2876,7 +2959,7 @@
 volatile int x;
 ; return 0; }
 EOF
-if { (eval echo configure:2880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_volatile=yes
 else
@@ -2901,12 +2984,12 @@
 esac
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2905: checking for working const" >&5
+echo "configure:2988: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2910 "configure"
+#line 2993 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2955,7 +3038,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3042: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2978,14 +3061,14 @@
 case "$host" in
  $target)
     echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:2982: checking whether byte ordering is bigendian" >&5
+echo "configure:3065: checking whether byte ordering is bigendian" >&5
 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 2989 "configure"
+#line 3072 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -2996,11 +3079,11 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 3004 "configure"
+#line 3087 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3011,7 +3094,7 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -3031,7 +3114,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3035 "configure"
+#line 3118 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -3044,7 +3127,7 @@
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:3048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
@@ -3084,12 +3167,12 @@
     ;;
 esac
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3088: checking return type of signal handlers" >&5
+echo "configure:3171: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3093 "configure"
+#line 3176 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3106,7 +3189,7 @@
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:3110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -3125,12 +3208,12 @@
 
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3129: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:3212: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3134 "configure"
+#line 3217 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -3138,7 +3221,7 @@
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:3142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3225: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -3160,7 +3243,7 @@
 
 
 echo $ac_n "checking for a fallback value for HZ""... $ac_c" 1>&6
-echo "configure:3164: checking for a fallback value for HZ" >&5
+echo "configure:3247: checking for a fallback value for HZ" >&5
 if eval "test \"`echo '$''{'ac_cv_var_default_hz'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3182,7 +3265,7 @@
 
 
 echo $ac_n "checking if we need to override the system's value for HZ""... $ac_c" 1>&6
-echo "configure:3186: checking if we need to override the system's value for HZ" >&5
+echo "configure:3269: checking if we need to override the system's value for HZ" >&5
 if eval "test \"`echo '$''{'ac_cv_var_override_hz'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3216,12 +3299,12 @@
 
 
 echo $ac_n "checking struct sockaddr for sa_len""... $ac_c" 1>&6
-echo "configure:3220: checking struct sockaddr for sa_len" >&5
+echo "configure:3303: checking struct sockaddr for sa_len" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_sockaddr_has_sa_len'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3225 "configure"
+#line 3308 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -3232,7 +3315,7 @@
 return ps->sa_len;
 ; return 0; }
 EOF
-if { (eval echo configure:3236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3319: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_sockaddr_has_sa_len=yes
 else
@@ -3254,12 +3337,12 @@
 fi
 
 echo $ac_n "checking struct clockinfo for hz""... $ac_c" 1>&6
-echo "configure:3258: checking struct clockinfo for hz" >&5
+echo "configure:3341: checking struct clockinfo for hz" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_clockinfo_has_hz'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3263 "configure"
+#line 3346 "configure"
 #include "confdefs.h"
 
 #include <sys/time.h>
@@ -3269,7 +3352,7 @@
 return pc->hz;
 ; return 0; }
 EOF
-if { (eval echo configure:3273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_clockinfo_has_hz=yes
 else
@@ -3291,12 +3374,12 @@
 fi
 
 echo $ac_n "checking struct clockinfo for tickadj""... $ac_c" 1>&6
-echo "configure:3295: checking struct clockinfo for tickadj" >&5
+echo "configure:3378: checking struct clockinfo for tickadj" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_clockinfo_has_tickadj'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3300 "configure"
+#line 3383 "configure"
 #include "confdefs.h"
 
 #include <sys/time.h>
@@ -3306,7 +3389,7 @@
 return pc->tickadj;
 ; return 0; }
 EOF
-if { (eval echo configure:3310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_clockinfo_has_tickadj=yes
 else
@@ -3328,12 +3411,12 @@
 fi
 
 echo $ac_n "checking if C compiler permits function prototypes""... $ac_c" 1>&6
-echo "configure:3332: checking if C compiler permits function prototypes" >&5
+echo "configure:3415: checking if C compiler permits function prototypes" >&5
 if eval "test \"`echo '$''{'ac_cv_have_prototypes'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3337 "configure"
+#line 3420 "configure"
 #include "confdefs.h"
 
 extern int foo (short);
@@ -3343,7 +3426,7 @@
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:3347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_have_prototypes=yes
 else
@@ -3365,14 +3448,14 @@
 fi
 
 echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:3369: checking whether char is unsigned" >&5
+echo "configure:3452: checking whether char is unsigned" >&5
 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test "$GCC" = yes; then
   # GCC predefines this symbol on systems where it applies.
 cat > conftest.$ac_ext <<EOF
-#line 3376 "configure"
+#line 3459 "configure"
 #include "confdefs.h"
 #ifdef __CHAR_UNSIGNED__
   yes
@@ -3394,7 +3477,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3398 "configure"
+#line 3481 "configure"
 #include "confdefs.h"
 /* volatile prevents gcc2 from optimizing the test away on sparcs.  */
 #if !defined(__STDC__) || __STDC__ != 1
@@ -3404,7 +3487,7 @@
   volatile char c = 255; exit(c < 0);
 }
 EOF
-if { (eval echo configure:3408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_char_unsigned=yes
 else
@@ -3429,7 +3512,7 @@
 		case "$host" in
  $target)
     echo $ac_n "checking size of signed char""... $ac_c" 1>&6
-echo "configure:3433: checking size of signed char" >&5
+echo "configure:3516: checking size of signed char" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_signed_char'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3437,7 +3520,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3441 "configure"
+#line 3524 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3448,7 +3531,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_signed_char=`cat conftestval`
 else
@@ -3471,7 +3554,7 @@
  *) case "$target" in
      *-*-vxworks*)
 	echo $ac_n "checking size of signed char""... $ac_c" 1>&6
-echo "configure:3475: checking size of signed char" >&5
+echo "configure:3558: checking size of signed char" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_signed_char'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3479,7 +3562,7 @@
   ac_cv_sizeof_signed_char=1
 else
   cat > conftest.$ac_ext <<EOF
-#line 3483 "configure"
+#line 3566 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3490,7 +3573,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_signed_char=`cat conftestval`
 else
@@ -3519,7 +3602,7 @@
 case "$host" in
  $target)
     echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:3523: checking size of int" >&5
+echo "configure:3606: checking size of int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3527,7 +3610,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3531 "configure"
+#line 3614 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3538,7 +3621,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -3561,7 +3644,7 @@
  *) case "$target" in
      *-*-vxworks*)
 	echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:3565: checking size of int" >&5
+echo "configure:3648: checking size of int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3569,7 +3652,7 @@
   ac_cv_sizeof_int=4
 else
   cat > conftest.$ac_ext <<EOF
-#line 3573 "configure"
+#line 3656 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3580,7 +3663,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -3609,7 +3692,7 @@
 case "$host" in
  $target)
     echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:3613: checking size of long" >&5
+echo "configure:3696: checking size of long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3617,7 +3700,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3621 "configure"
+#line 3704 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3628,7 +3711,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -3651,7 +3734,7 @@
  *) case "$target" in
      *-*-vxworks*)
 	echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:3655: checking size of long" >&5
+echo "configure:3738: checking size of long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3659,7 +3742,7 @@
   ac_cv_sizeof_long=4
 else
   cat > conftest.$ac_ext <<EOF
-#line 3663 "configure"
+#line 3746 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -3670,7 +3753,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:3674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -3697,12 +3780,12 @@
 esac
 
 echo $ac_n "checking for s_char""... $ac_c" 1>&6
-echo "configure:3701: checking for s_char" >&5
+echo "configure:3784: checking for s_char" >&5
 if eval "test \"`echo '$''{'ac_cv_type_s_char'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3706 "configure"
+#line 3789 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3711,7 +3794,7 @@
 #endif
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "s_char[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  egrep "(^|[^a-zA-Z_0-9])s_char[^a-zA-Z_0-9]" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_type_s_char=yes
 else
@@ -3760,12 +3843,12 @@
     ;;
 esac
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3764: checking for uid_t in sys/types.h" >&5
+echo "configure:3847: checking for uid_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3769 "configure"
+#line 3852 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3799,12 +3882,12 @@
     for ac_func in __adjtimex __ntp_gettime
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3803: checking for $ac_func" >&5
+echo "configure:3886: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3808 "configure"
+#line 3891 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3827,7 +3910,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3856,12 +3939,12 @@
 for ac_func in clock_settime daemon getbootfile getdtablesize getrusage
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3860: checking for $ac_func" >&5
+echo "configure:3943: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3865 "configure"
+#line 3948 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3884,7 +3967,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3911,12 +3994,12 @@
 for ac_func in gettimeofday getuid K_open kvm_open memcpy memmove memset
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3915: checking for $ac_func" >&5
+echo "configure:3998: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3920 "configure"
+#line 4003 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3939,7 +4022,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3970,12 +4053,12 @@
  *) for ac_func in mkstemp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3974: checking for $ac_func" >&5
+echo "configure:4057: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3979 "configure"
+#line 4062 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3998,7 +4081,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4034,12 +4117,12 @@
  *) for ac_func in mlockall
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4038: checking for $ac_func" >&5
+echo "configure:4121: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4043 "configure"
+#line 4126 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4062,7 +4145,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4091,12 +4174,12 @@
 for ac_func in nice nlist ntp_adjtime ntp_gettime plock
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4095: checking for $ac_func" >&5
+echo "configure:4178: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4100 "configure"
+#line 4183 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4119,7 +4202,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4146,12 +4229,12 @@
 for ac_func in pututline pututxline rtprio
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4150: checking for $ac_func" >&5
+echo "configure:4233: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4155 "configure"
+#line 4238 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4174,7 +4257,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4205,12 +4288,12 @@
  *) for ac_func in sched_setscheduler
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4209: checking for $ac_func" >&5
+echo "configure:4292: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4214 "configure"
+#line 4297 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4233,7 +4316,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4262,12 +4345,12 @@
 for ac_func in setlinebuf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4266: checking for $ac_func" >&5
+echo "configure:4349: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4271 "configure"
+#line 4354 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4290,7 +4373,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4317,12 +4400,12 @@
 for ac_func in setpgid setpriority setsid settimeofday setvbuf sigaction
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4321: checking for $ac_func" >&5
+echo "configure:4404: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4326 "configure"
+#line 4409 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4345,7 +4428,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4372,12 +4455,12 @@
 for ac_func in sigvec sigset sigsuspend stime strchr sysconf sysctl
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4376: checking for $ac_func" >&5
+echo "configure:4459: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4381 "configure"
+#line 4464 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4400,7 +4483,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4427,12 +4510,12 @@
 for ac_func in timer_create timer_settime umask uname updwtmp updwtmpx
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4431: checking for $ac_func" >&5
+echo "configure:4514: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4436 "configure"
+#line 4519 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4455,7 +4538,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4482,12 +4565,12 @@
 for ac_func in vsprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4486: checking for $ac_func" >&5
+echo "configure:4569: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4491 "configure"
+#line 4574 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4510,7 +4593,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4536,12 +4619,12 @@
 
 
 echo $ac_n "checking number of arguments to gettimeofday()""... $ac_c" 1>&6
-echo "configure:4540: checking number of arguments to gettimeofday()" >&5
+echo "configure:4623: checking number of arguments to gettimeofday()" >&5
 if eval "test \"`echo '$''{'ac_cv_func_Xettimeofday_nargs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4545 "configure"
+#line 4628 "configure"
 #include "confdefs.h"
 #include <sys/time.h>
 int main() {
@@ -4551,7 +4634,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4555: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_func_Xettimeofday_nargs=2
 else
@@ -4573,12 +4656,12 @@
 fi
 
 echo $ac_n "checking number of arguments taken by setpgrp()""... $ac_c" 1>&6
-echo "configure:4577: checking number of arguments taken by setpgrp()" >&5
+echo "configure:4660: checking number of arguments taken by setpgrp()" >&5
 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_nargs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4582 "configure"
+#line 4665 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -4592,7 +4675,7 @@
 setpgrp(0,0);
 ; return 0; }
 EOF
-if { (eval echo configure:4596: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_func_setpgrp_nargs=2
 else
@@ -4617,12 +4700,12 @@
 CFLAGS="$CFLAGS -I$srcdir/include"
 
 echo $ac_n "checking argument pointer type of qsort()'s compare function and base""... $ac_c" 1>&6
-echo "configure:4621: checking argument pointer type of qsort()'s compare function and base" >&5
+echo "configure:4704: checking argument pointer type of qsort()'s compare function and base" >&5
 if eval "test \"`echo '$''{'ac_cv_func_qsort_argtype'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4626 "configure"
+#line 4709 "configure"
 #include "confdefs.h"
 
 #include "l_stdlib.h"
@@ -4645,7 +4728,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_func_qsort_argtype=void
 else
@@ -4671,12 +4754,12 @@
 CFLAGS=$save_CFLAGS
 
 echo $ac_n "checking if declaring 'char *sys_errlist' is ok""... $ac_c" 1>&6
-echo "configure:4675: checking if declaring 'char *sys_errlist' is ok" >&5
+echo "configure:4758: checking if declaring 'char *sys_errlist' is ok" >&5
 if eval "test \"`echo '$''{'ac_cv_decl_sys_errlist'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4680 "configure"
+#line 4763 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #ifdef HAVE_ERRNO_H
@@ -4687,7 +4770,7 @@
   
 ; return 0; }
 EOF
-if { (eval echo configure:4691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_decl_sys_errlist=yes
 else
@@ -4708,12 +4791,12 @@
 esac
 
 echo $ac_n "checking if declaring 'syscall()' is ok""... $ac_c" 1>&6
-echo "configure:4712: checking if declaring 'syscall()' is ok" >&5
+echo "configure:4795: checking if declaring 'syscall()' is ok" >&5
 if eval "test \"`echo '$''{'ac_cv_decl_syscall'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4717 "configure"
+#line 4800 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_TYPES_H
@@ -4732,7 +4815,7 @@
 extern int syscall P((int, struct timeval *, struct timeval *));
 ; return 0; }
 EOF
-if { (eval echo configure:4736: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_decl_syscall=yes
 else
@@ -4916,7 +4999,7 @@
 esac
 
 echo $ac_n "checking if we should use a streams device for ifconfig""... $ac_c" 1>&6
-echo "configure:4920: checking if we should use a streams device for ifconfig" >&5
+echo "configure:5003: checking if we should use a streams device for ifconfig" >&5
 if eval "test \"`echo '$''{'ac_cv_var_use_streams_device_for_ifconfig'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4926,7 +5009,7 @@
 echo "$ac_t""$ac_cv_var_use_streams_device_for_ifconfig" 1>&6
 
 echo $ac_n "checking if we need extra room for SO_RCVBUF""... $ac_c" 1>&6
-echo "configure:4930: checking if we need extra room for SO_RCVBUF" >&5
+echo "configure:5013: checking if we need extra room for SO_RCVBUF" >&5
 if eval "test \"`echo '$''{'ac_cv_var_rcvbuf_slop'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4948,7 +5031,7 @@
 esac
 
 echo $ac_n "checking if we will open the broadcast socket""... $ac_c" 1>&6
-echo "configure:4952: checking if we will open the broadcast socket" >&5
+echo "configure:5035: checking if we will open the broadcast socket" >&5
 if eval "test \"`echo '$''{'ac_cv_var_open_bcast_socket'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4973,7 +5056,7 @@
 esac
 
 echo $ac_n "checking if we want the HPUX version of FindConfig()""... $ac_c" 1>&6
-echo "configure:4977: checking if we want the HPUX version of FindConfig()" >&5
+echo "configure:5060: checking if we want the HPUX version of FindConfig()" >&5
 if eval "test \"`echo '$''{'ac_cv_var_hpux_findconfig'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4995,7 +5078,7 @@
 esac
 
 echo $ac_n "checking if process groups are set with -pid""... $ac_c" 1>&6
-echo "configure:4999: checking if process groups are set with -pid" >&5
+echo "configure:5082: checking if process groups are set with -pid" >&5
 if eval "test \"`echo '$''{'ac_cv_arg_setpgrp_negpid'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5031,7 +5114,7 @@
 esac
 
 echo $ac_n "checking if we need a ctty for F_SETOWN""... $ac_c" 1>&6
-echo "configure:5035: checking if we need a ctty for F_SETOWN" >&5
+echo "configure:5118: checking if we need a ctty for F_SETOWN" >&5
 if eval "test \"`echo '$''{'ac_cv_func_ctty_for_f_setown'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5061,7 +5144,7 @@
 
 ntp_warning='GRONK'
 echo $ac_n "checking if we'll use clock_settime or settimeofday or stime""... $ac_c" 1>&6
-echo "configure:5065: checking if we'll use clock_settime or settimeofday or stime" >&5
+echo "configure:5148: checking if we'll use clock_settime or settimeofday or stime" >&5
 case "$ac_cv_func_clock_settime$ac_cv_func_settimeofday$ac_cv_func_stime" in
  yes*)
     ntp_warning=''
@@ -5090,7 +5173,7 @@
 esac
 
 echo $ac_n "checking if we have a losing syscall()""... $ac_c" 1>&6
-echo "configure:5094: checking if we have a losing syscall()" >&5
+echo "configure:5177: checking if we have a losing syscall()" >&5
 if eval "test \"`echo '$''{'ac_cv_var_syscall_bug'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5113,7 +5196,7 @@
 esac
 
 echo $ac_n "checking for Streams/TLI""... $ac_c" 1>&6
-echo "configure:5117: checking for Streams/TLI" >&5
+echo "configure:5200: checking for Streams/TLI" >&5
 if eval "test \"`echo '$''{'ac_cv_var_streams_tli'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5145,12 +5228,12 @@
 esac
 
 echo $ac_n "checking for SIGIO""... $ac_c" 1>&6
-echo "configure:5149: checking for SIGIO" >&5
+echo "configure:5232: checking for SIGIO" >&5
 if eval "test \"`echo '$''{'ac_cv_hdr_def_sigio'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5154 "configure"
+#line 5237 "configure"
 #include "confdefs.h"
 #include <signal.h>
 #ifdef SIGIO
@@ -5173,7 +5256,7 @@
 echo "$ac_t""$ac_cv_hdr_def_sigio" 1>&6
 
 echo $ac_n "checking if we want to use signalled IO""... $ac_c" 1>&6
-echo "configure:5177: checking if we want to use signalled IO" >&5
+echo "configure:5260: checking if we want to use signalled IO" >&5
 if eval "test \"`echo '$''{'ac_cv_var_signalled_io'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5218,12 +5301,12 @@
 esac
 
 echo $ac_n "checking for SIGPOLL""... $ac_c" 1>&6
-echo "configure:5222: checking for SIGPOLL" >&5
+echo "configure:5305: checking for SIGPOLL" >&5
 if eval "test \"`echo '$''{'ac_cv_hdr_def_sigpoll'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5227 "configure"
+#line 5310 "configure"
 #include "confdefs.h"
 #include <signal.h>
 #ifdef SIGPOLL
@@ -5246,12 +5329,12 @@
 echo "$ac_t""$ac_cv_hdr_def_sigpoll" 1>&6
 
 echo $ac_n "checking for SIGSYS""... $ac_c" 1>&6
-echo "configure:5250: checking for SIGSYS" >&5
+echo "configure:5333: checking for SIGSYS" >&5
 if eval "test \"`echo '$''{'ac_cv_hdr_def_sigsys'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5255 "configure"
+#line 5338 "configure"
 #include "confdefs.h"
 #include <signal.h>
 #ifdef SIGSYS
@@ -5274,7 +5357,7 @@
 echo "$ac_t""$ac_cv_hdr_def_sigsys" 1>&6
 
 echo $ac_n "checking if we can use SIGPOLL for UDP I/O""... $ac_c" 1>&6
-echo "configure:5278: checking if we can use SIGPOLL for UDP I/O" >&5
+echo "configure:5361: checking if we can use SIGPOLL for UDP I/O" >&5
 if eval "test \"`echo '$''{'ac_cv_var_use_udp_sigpoll'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5326,7 +5409,7 @@
 esac
 
 echo $ac_n "checking if we can use SIGPOLL for TTY I/O""... $ac_c" 1>&6
-echo "configure:5330: checking if we can use SIGPOLL for TTY I/O" >&5
+echo "configure:5413: checking if we can use SIGPOLL for TTY I/O" >&5
 if eval "test \"`echo '$''{'ac_cv_var_use_tty_sigpoll'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5378,7 +5461,7 @@
 esac
 
 echo $ac_n "checking if nlist() values might require extra indirection""... $ac_c" 1>&6
-echo "configure:5382: checking if nlist() values might require extra indirection" >&5
+echo "configure:5465: checking if nlist() values might require extra indirection" >&5
 if eval "test \"`echo '$''{'ac_cv_var_nlist_extra_indirection'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5400,7 +5483,7 @@
 esac
 
 echo $ac_n "checking for a minimum recommended value of tickadj""... $ac_c" 1>&6
-echo "configure:5404: checking for a minimum recommended value of tickadj" >&5
+echo "configure:5487: checking for a minimum recommended value of tickadj" >&5
 if eval "test \"`echo '$''{'ac_cv_var_min_rec_tickadj'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5423,7 +5506,7 @@
 esac
 
 echo $ac_n "checking if the TTY code permits PARENB and IGNPAR""... $ac_c" 1>&6
-echo "configure:5427: checking if the TTY code permits PARENB and IGNPAR" >&5
+echo "configure:5510: checking if the TTY code permits PARENB and IGNPAR" >&5
 if eval "test \"`echo '$''{'ac_cv_var_no_parenb_ignpar'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5445,7 +5528,7 @@
 esac
 
 echo $ac_n "checking if we're including debugging code""... $ac_c" 1>&6
-echo "configure:5449: checking if we're including debugging code" >&5
+echo "configure:5532: checking if we're including debugging code" >&5
 # Check whether --enable-debugging or --disable-debugging was given.
 if test "${enable_debugging+set}" = set; then
   enableval="$enable_debugging"
@@ -5463,7 +5546,7 @@
 echo "$ac_t""$ntp_ok" 1>&6
 
 echo $ac_n "checking if we have the tty_clk line discipline/streams module""... $ac_c" 1>&6
-echo "configure:5467: checking if we have the tty_clk line discipline/streams module" >&5
+echo "configure:5550: checking if we have the tty_clk line discipline/streams module" >&5
 if eval "test \"`echo '$''{'ac_cv_var_tty_clk'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5479,7 +5562,7 @@
 esac
 
 echo $ac_n "checking for the ppsclock streams module""... $ac_c" 1>&6
-echo "configure:5483: checking for the ppsclock streams module" >&5
+echo "configure:5566: checking for the ppsclock streams module" >&5
 if eval "test \"`echo '$''{'ac_cv_var_ppsclock'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5495,12 +5578,12 @@
 esac
 
 echo $ac_n "checking for kernel multicast support""... $ac_c" 1>&6
-echo "configure:5499: checking for kernel multicast support" >&5
+echo "configure:5582: checking for kernel multicast support" >&5
 if eval "test \"`echo '$''{'ac_cv_var_mcast'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5504 "configure"
+#line 5587 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 #ifdef IP_ADD_MEMBERSHIP
@@ -5529,7 +5612,7 @@
 esac
 
 echo $ac_n "checking availability of ntp_{adj,get}time()""... $ac_c" 1>&6
-echo "configure:5533: checking availability of ntp_{adj,get}time()" >&5
+echo "configure:5616: checking availability of ntp_{adj,get}time()" >&5
 if eval "test \"`echo '$''{'ac_cv_var_ntp_syscalls'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5543,7 +5626,7 @@
         ac_cv_var_ntp_syscalls=libc
         ;;
       *) cat > conftest.$ac_ext <<EOF
-#line 5547 "configure"
+#line 5630 "configure"
 #include "confdefs.h"
 #include <sys/syscall.h>
 #if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
@@ -5583,12 +5666,12 @@
 esac
 
 echo $ac_n "checking if sys/timex.h has STA_FLL""... $ac_c" 1>&6
-echo "configure:5587: checking if sys/timex.h has STA_FLL" >&5
+echo "configure:5670: checking if sys/timex.h has STA_FLL" >&5
 if eval "test \"`echo '$''{'ac_cv_var_sta_fll'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5592 "configure"
+#line 5675 "configure"
 #include "confdefs.h"
 #include <sys/timex.h>
 #ifdef STA_FLL
@@ -5611,7 +5694,7 @@
 echo "$ac_t""$ac_cv_var_sta_fll" 1>&6
 
 echo $ac_n "checking if we have kernel PLL support""... $ac_c" 1>&6
-echo "configure:5615: checking if we have kernel PLL support" >&5
+echo "configure:5698: checking if we have kernel PLL support" >&5
 if eval "test \"`echo '$''{'ac_cv_var_kernel_pll'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5642,7 +5725,7 @@
 esac
 
 echo $ac_n "checking if SIOCGIFCONF returns buffer size in the buffer""... $ac_c" 1>&6
-echo "configure:5646: checking if SIOCGIFCONF returns buffer size in the buffer" >&5
+echo "configure:5729: checking if SIOCGIFCONF returns buffer size in the buffer" >&5
 if eval "test \"`echo '$''{'ac_cv_var_size_returned_in_buffer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5670,7 +5753,7 @@
 esac
 
 echo $ac_n "checking if we want GDT surveying code""... $ac_c" 1>&6
-echo "configure:5674: checking if we want GDT surveying code" >&5
+echo "configure:5757: checking if we want GDT surveying code" >&5
 if eval "test \"`echo '$''{'ac_cv_var_gdt_surveying'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5694,7 +5777,7 @@
 esac
 
 echo $ac_n "checking if we want to use MD5 authentication""... $ac_c" 1>&6
-echo "configure:5698: checking if we want to use MD5 authentication" >&5
+echo "configure:5781: checking if we want to use MD5 authentication" >&5
 if eval "test \"`echo '$''{'ac_cv_var_use_md5'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5718,7 +5801,7 @@
 esac
 
 echo $ac_n "checking if we want to use DES authentication""... $ac_c" 1>&6
-echo "configure:5722: checking if we want to use DES authentication" >&5
+echo "configure:5805: checking if we want to use DES authentication" >&5
 if eval "test \"`echo '$''{'ac_cv_var_use_des'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5757,7 +5840,7 @@
 
 # HPUX only, and by explicit request
 echo $ac_n "checking Datum/Bancomm bc635/VME interface""... $ac_c" 1>&6
-echo "configure:5761: checking Datum/Bancomm bc635/VME interface" >&5
+echo "configure:5844: checking Datum/Bancomm bc635/VME interface" >&5
 # Check whether --enable-BANCOMM or --disable-BANCOMM was given.
 if test "${enable_BANCOMM+set}" = set; then
   enableval="$enable_BANCOMM"
@@ -5781,7 +5864,7 @@
 
 #HPUX only, and only by explicit request
 echo $ac_n "checking TrueTime GPS receiver/VME interface""... $ac_c" 1>&6
-echo "configure:5785: checking TrueTime GPS receiver/VME interface" >&5
+echo "configure:5868: checking TrueTime GPS receiver/VME interface" >&5
 # Check whether --enable-GPSVME or --disable-GPSVME was given.
 if test "${enable_GPSVME+set}" = set; then
   enableval="$enable_GPSVME"
@@ -5804,7 +5887,7 @@
 esac
 
 echo $ac_n "checking for PCL720 clock support""... $ac_c" 1>&6
-echo "configure:5808: checking for PCL720 clock support" >&5
+echo "configure:5891: checking for PCL720 clock support" >&5
 case "$ac_cv_header_machine_inline_h$ac_cv_header_sys_pcl720_h$ac_cv_header_sys_i8253_h" in
  yesyesyes)
     cat >> confdefs.h <<\EOF
@@ -5820,7 +5903,7 @@
 echo "$ac_t""$ans" 1>&6
 
 echo $ac_n "checking for SHM clock attached thru shared memory""... $ac_c" 1>&6
-echo "configure:5824: checking for SHM clock attached thru shared memory" >&5
+echo "configure:5907: checking for SHM clock attached thru shared memory" >&5
 # Check whether --enable-SHM or --disable-SHM was given.
 if test "${enable_SHM+set}" = set; then
   enableval="$enable_SHM"
@@ -5839,7 +5922,7 @@
 echo "$ac_t""$ntp_ok" 1>&6
 
 echo $ac_n "checking for default inclusion of all suitable non-PARSE clocks""... $ac_c" 1>&6
-echo "configure:5843: checking for default inclusion of all suitable non-PARSE clocks" >&5
+echo "configure:5926: checking for default inclusion of all suitable non-PARSE clocks" >&5
 # Check whether --enable-all-clocks or --disable-all-clocks was given.
 if test "${enable_all_clocks+set}" = set; then
   enableval="$enable_all_clocks"
@@ -5851,7 +5934,7 @@
 echo "$ac_t""$ntp_eac" 1>&6
 
 echo $ac_n "checking if we have support for PARSE clocks""... $ac_c" 1>&6
-echo "configure:5855: checking if we have support for PARSE clocks" >&5
+echo "configure:5938: checking if we have support for PARSE clocks" >&5
 case "$ac_cv_header_termio_h$ac_cv_header_termios_h" in
  *yes*)
     ntp_canparse=yes
@@ -5863,14 +5946,14 @@
 
 # Requires modem control
 echo $ac_n "checking ACTS modem service""... $ac_c" 1>&6
-echo "configure:5867: checking ACTS modem service" >&5
+echo "configure:5950: checking ACTS modem service" >&5
 # Check whether --enable-ACTS or --disable-ACTS was given.
 if test "${enable_ACTS+set}" = set; then
   enableval="$enable_ACTS"
   ntp_ok=$enableval
 else
   cat > conftest.$ac_ext <<EOF
-#line 5874 "configure"
+#line 5957 "configure"
 #include "confdefs.h"
 #include <termios.h>
 #ifdef TIOCMBIS
@@ -5900,7 +5983,7 @@
 echo "$ac_t""$ntp_ok" 1>&6
 
 echo $ac_n "checking Arbiter 1088A/B GPS receiver""... $ac_c" 1>&6
-echo "configure:5904: checking Arbiter 1088A/B GPS receiver" >&5
+echo "configure:5987: checking Arbiter 1088A/B GPS receiver" >&5
 # Check whether --enable-ARBITER or --disable-ARBITER was given.
 if test "${enable_ARBITER+set}" = set; then
   enableval="$enable_ARBITER"
@@ -5919,7 +6002,7 @@
 echo "$ac_t""$ntp_ok" 1>&6
 
 echo $ac_n "checking Arcron MSF receiver""... $ac_c" 1>&6
-echo "configure:5923: checking Arcron MSF receiver" >&5
+echo "configure:6006: checking Arcron MSF receiver" >&5
 # Check whether --enable-ARCRON_MSF or --disable-ARCRON_MSF was given.
 if test "${enable_ARCRON_MSF+set}" = set; then
   enableval="$enable_ARCRON_MSF"
@@ -5938,7 +6021,7 @@
 echo "$ac_t""$ntp_ok" 1>&6
 
 echo $ac_n "checking Austron 2200A/2201A GPS receiver""... $ac_c" 1>&6
-echo "configure:5942: checking Austron 2200A/2201A GPS receiver" >&5
+echo "configure:6025: checking Austron 2200A/2201A GPS receiver" >&5
 # Check whether --enable-AS2201 or --disable-AS2201 was given.
 if test "${enable_AS2201+set}" = set; then
   enableval="$enable_AS2201"
@@ -5957,7 +6040,7 @@
 echo "$ac_t""$ntp_ok" 1>&6
 
 echo $ac_n "checking PPS interface""... $ac_c" 1>&6
-echo "configure:5961: checking PPS interface" >&5
+echo "configure:6044: checking PPS interface" >&5
 # Check whether --enable-ATOM or --disable-ATOM was given.
 if test "${enable_ATOM+set}" = set; then
   enableval="$enable_ATOM"
@@ -5976,7 +6059,7 @@
 echo "$ac_t""$ntp_ok" 1>&6
 
 echo $ac_n "checking CHU modem/decoder""... $ac_c" 1>&6
-echo "configure:5980: checking CHU modem/decoder" >&5
+echo "configure:6063: checking CHU modem/decoder" >&5
 # Check whether --enable-CHU or --disable-CHU was given.
 if test "${enable_CHU+set}" = set; then
   enableval="$enable_CHU"
@@ -6005,7 +6088,7 @@
 
 # Not under HP-UX
 echo $ac_n "checking Datum Programmable Time System""... $ac_c" 1>&6
-echo "configure:6009: checking Datum Programmable Time System" >&5
+echo "configure:6092: checking Datum Programmable Time System" >&5
 # Check whether --enable-DATUM or --disable-DATUM was given.
 if test "${enable_DATUM+set}" = set; then
   enableval="$enable_DATUM"
@@ -6031,14 +6114,14 @@
 
 # Requires modem control
 echo $ac_n "checking Heath GC-1000 WWV/WWVH receiver""... $ac_c" 1>&6
-echo "configure:6035: checking Heath GC-1000 WWV/WWVH receiver" >&5
+echo "configure:6118: checking Heath GC-1000 WWV/WWVH receiver" >&5
 # Check whether --enable-HEATH or --disable-HEATH was given.
 if test "${enable_HEATH+set}" = set; then
   enableval="$enable_HEATH"
   ntp_ok=$enableval
 else
   cat > conftest.$ac_ext <<EOF
-#line 6042 "configure"
+#line 6125 "configure"
 #include "confdefs.h"
 #include <termios.h>
 #ifdef TIOCMBIS
@@ -6068,7 +6151,7 @@
 echo "$ac_t""$ntp_ok" 1>&6
 
 echo $ac_n "checking HP 58503A GPS receiver""... $ac_c" 1>&6
-echo "configure:6072: checking HP 58503A GPS receiver" >&5
+echo "configure:6155: checking HP 58503A GPS receiver" >&5
 # Check whether --enable-HPGPS or --disable-HPGPS was given.
 if test "${enable_HPGPS+set}" = set; then
   enableval="$enable_HPGPS"
@@ -6087,7 +6170,7 @@
 echo "$ac_t""$ntp_ok" 1>&6
 
 echo $ac_n "checking Sun IRIG audio decoder""... $ac_c" 1>&6
-echo "configure:6091: checking Sun IRIG audio decoder" >&5
+echo "configure:6174: checking Sun IRIG audio decoder" >&5
 # Check whether --enable-IRIG or --disable-IRIG was given.
 if test "${enable_IRIG+set}" = set; then
   enableval="$enable_IRIG"
@@ -6115,7 +6198,7 @@
 esac
 
 echo $ac_n "checking Leitch CSD 5300 Master Clock System Driver""... $ac_c" 1>&6
-echo "configure:6119: checking Leitch CSD 5300 Master Clock System Driver" >&5
+echo "configure:6202: checking Leitch CSD 5300 Master Clock System Driver" >&5
 # Check whether --enable-LEITCH or --disable-LEITCH was given.
 if test "${enable_LEITCH+set}" = set; then
   enableval="$enable_LEITCH"
@@ -6134,7 +6217,7 @@
 echo "$ac_t""$ntp_ok" 1>&6
 
 echo $ac_n "checking local clock reference""... $ac_c" 1>&6
-echo "configure:6138: checking local clock reference" >&5
+echo "configure:6221: checking local clock reference" >&5
 # Check whether --enable-LOCAL-CLOCK or --disable-LOCAL-CLOCK was given.
 if test "${enable_LOCAL_CLOCK+set}" = set; then
   enableval="$enable_LOCAL_CLOCK"
@@ -6153,7 +6236,7 @@
 echo "$ac_t""$ntp_ok" 1>&6
 
 echo $ac_n "checking EES M201 MSF receiver""... $ac_c" 1>&6
-echo "configure:6157: checking EES M201 MSF receiver" >&5
+echo "configure:6240: checking EES M201 MSF receiver" >&5
 # Check whether --enable-MSFEES or --disable-MSFEES was given.
 if test "${enable_MSFEES+set}" = set; then
   enableval="$enable_MSFEES"
@@ -6176,7 +6259,7 @@
 
 # Not Ultrix
 echo $ac_n "checking Magnavox MX4200 GPS receiver""... $ac_c" 1>&6
-echo "configure:6180: checking Magnavox MX4200 GPS receiver" >&5
+echo "configure:6263: checking Magnavox MX4200 GPS receiver" >&5
 # Check whether --enable-MX4200 or --disable-MX4200 was given.
 if test "${enable_MX4200+set}" = set; then
   enableval="$enable_MX4200"
@@ -6204,7 +6287,7 @@
 
 # Not Ultrix
 echo $ac_n "checking Rockwell Jupiter GPS receiver""... $ac_c" 1>&6
-echo "configure:6208: checking Rockwell Jupiter GPS receiver" >&5
+echo "configure:6291: checking Rockwell Jupiter GPS receiver" >&5
 # Check whether --enable-JUPITER or --disable-JUPITER was given.
 if test "${enable_JUPITER+set}" = set; then
   enableval="$enable_JUPITER"
@@ -6231,7 +6314,7 @@
 esac
 
 echo $ac_n "checking NMEA GPS receiver""... $ac_c" 1>&6
-echo "configure:6235: checking NMEA GPS receiver" >&5
+echo "configure:6318: checking NMEA GPS receiver" >&5
 # Check whether --enable-NMEA or --disable-NMEA was given.
 if test "${enable_NMEA+set}" = set; then
   enableval="$enable_NMEA"
@@ -6249,8 +6332,27 @@
 fi
 echo "$ac_t""$ntp_ok" 1>&6
 
+echo $ac_n "checking Garmin GPS Handheld Receivers""... $ac_c" 1>&6
+echo "configure:6337: checking Garmin GPS Handheld Receivers" >&5
+# Check whether --enable-GARMIN or --disable-GARMIN was given.
+if test "${enable_GARMIN+set}" = set; then
+  enableval="$enable_GARMIN"
+  ntp_ok=$enableval
+else
+  ntp_ok=$ntp_eac
+fi
+
+if test "$ntp_ok" = "yes"; then
+    ntp_refclock=yes
+    cat >> confdefs.h <<\EOF
+#define CLOCK_GARMIN 1
+EOF
+
+fi
+echo "$ac_t""$ntp_ok" 1>&6
+
 echo $ac_n "checking PST/Traconex 1020 WWV/WWVH receiver""... $ac_c" 1>&6
-echo "configure:6254: checking PST/Traconex 1020 WWV/WWVH receiver" >&5
+echo "configure:6356: checking PST/Traconex 1020 WWV/WWVH receiver" >&5
 # Check whether --enable-PST or --disable-PST was given.
 if test "${enable_PST+set}" = set; then
   enableval="$enable_PST"
@@ -6270,14 +6372,14 @@
 
 # Requires modem control
 echo $ac_n "checking PTB modem service""... $ac_c" 1>&6
-echo "configure:6274: checking PTB modem service" >&5
+echo "configure:6376: checking PTB modem service" >&5
 # Check whether --enable-PTBACTS or --disable-PTBACTS was given.
 if test "${enable_PTBACTS+set}" = set; then
   enableval="$enable_PTBACTS"
   ntp_ok=$enableval
 else
   cat > conftest.$ac_ext <<EOF
-#line 6281 "configure"
+#line 6383 "configure"
 #include "confdefs.h"
 #include <termios.h>
 #ifdef TIOCMBIS
@@ -6307,7 +6409,7 @@
 echo "$ac_t""$ntp_ok" 1>&6
 
 echo $ac_n "checking KSI/Odetics TPRO/S GPS receiver/IRIG interface""... $ac_c" 1>&6
-echo "configure:6311: checking KSI/Odetics TPRO/S GPS receiver/IRIG interface" >&5
+echo "configure:6413: checking KSI/Odetics TPRO/S GPS receiver/IRIG interface" >&5
 # Check whether --enable-TPRO or --disable-TPRO was given.
 if test "${enable_TPRO+set}" = set; then
   enableval="$enable_TPRO"
@@ -6335,7 +6437,7 @@
 esac
 
 echo $ac_n "checking TRAK 8810 GPS receiver""... $ac_c" 1>&6
-echo "configure:6339: checking TRAK 8810 GPS receiver" >&5
+echo "configure:6441: checking TRAK 8810 GPS receiver" >&5
 # Check whether --enable-TRAK or --disable-TRAK was given.
 if test "${enable_TRAK+set}" = set; then
   enableval="$enable_TRAK"
@@ -6355,7 +6457,7 @@
 
 # Not on a vax-dec-bsd
 echo $ac_n "checking Kinemetrics/TrueTime receivers""... $ac_c" 1>&6
-echo "configure:6359: checking Kinemetrics/TrueTime receivers" >&5
+echo "configure:6461: checking Kinemetrics/TrueTime receivers" >&5
 # Check whether --enable-TRUETIME or --disable-TRUETIME was given.
 if test "${enable_TRUETIME+set}" = set; then
   enableval="$enable_TRUETIME"
@@ -6384,7 +6486,7 @@
 esac
 
 echo $ac_n "checking Spectracom 8170/Netclock/2 WWVB receiver""... $ac_c" 1>&6
-echo "configure:6388: checking Spectracom 8170/Netclock/2 WWVB receiver" >&5
+echo "configure:6490: checking Spectracom 8170/Netclock/2 WWVB receiver" >&5
 # Check whether --enable-WWVB or --disable-WWVB was given.
 if test "${enable_WWVB+set}" = set; then
   enableval="$enable_WWVB"
@@ -6404,14 +6506,14 @@
 
 # Requires modem control
 echo $ac_n "checking USNO modem service""... $ac_c" 1>&6
-echo "configure:6408: checking USNO modem service" >&5
+echo "configure:6510: checking USNO modem service" >&5
 # Check whether --enable-USNO or --disable-USNO was given.
 if test "${enable_USNO+set}" = set; then
   enableval="$enable_USNO"
   ntp_ok=$enableval
 else
   cat > conftest.$ac_ext <<EOF
-#line 6415 "configure"
+#line 6517 "configure"
 #include "confdefs.h"
 #include <termios.h>
 #ifdef TIOCMBIS
@@ -6441,7 +6543,7 @@
 echo "$ac_t""$ntp_ok" 1>&6
 
 echo $ac_n "checking for default inclusion of all suitable PARSE clocks""... $ac_c" 1>&6
-echo "configure:6445: checking for default inclusion of all suitable PARSE clocks" >&5
+echo "configure:6547: checking for default inclusion of all suitable PARSE clocks" >&5
 # Check whether --enable-parse-clocks or --disable-parse-clocks was given.
 if test "${enable_parse_clocks+set}" = set; then
   enableval="$enable_parse_clocks"
@@ -6467,7 +6569,7 @@
 ntp_rawdcf=no
 
 echo $ac_n "checking Diem Computime Radio Clock""... $ac_c" 1>&6
-echo "configure:6471: checking Diem Computime Radio Clock" >&5
+echo "configure:6573: checking Diem Computime Radio Clock" >&5
 # Check whether --enable-COMPUTIME or --disable-COMPUTIME was given.
 if test "${enable_COMPUTIME+set}" = set; then
   enableval="$enable_COMPUTIME"
@@ -6492,7 +6594,7 @@
 esac
 
 echo $ac_n "checking ELV/DCF7000 clock""... $ac_c" 1>&6
-echo "configure:6496: checking ELV/DCF7000 clock" >&5
+echo "configure:6598: checking ELV/DCF7000 clock" >&5
 # Check whether --enable-DCF7000 or --disable-DCF7000 was given.
 if test "${enable_DCF7000+set}" = set; then
   enableval="$enable_DCF7000"
@@ -6517,7 +6619,7 @@
 esac
 
 echo $ac_n "checking HOPF 6021 clock""... $ac_c" 1>&6
-echo "configure:6521: checking HOPF 6021 clock" >&5
+echo "configure:6623: checking HOPF 6021 clock" >&5
 # Check whether --enable-HOPF6021 or --disable-HOPF6021 was given.
 if test "${enable_HOPF6021+set}" = set; then
   enableval="$enable_HOPF6021"
@@ -6542,7 +6644,7 @@
 esac
 
 echo $ac_n "checking Meinberg clocks""... $ac_c" 1>&6
-echo "configure:6546: checking Meinberg clocks" >&5
+echo "configure:6648: checking Meinberg clocks" >&5
 # Check whether --enable-MEINBERG or --disable-MEINBERG was given.
 if test "${enable_MEINBERG+set}" = set; then
   enableval="$enable_MEINBERG"
@@ -6567,7 +6669,7 @@
 esac
 
 echo $ac_n "checking DCF77 raw time code""... $ac_c" 1>&6
-echo "configure:6571: checking DCF77 raw time code" >&5
+echo "configure:6673: checking DCF77 raw time code" >&5
 # Check whether --enable-RAWDCF or --disable-RAWDCF was given.
 if test "${enable_RAWDCF+set}" = set; then
   enableval="$enable_RAWDCF"
@@ -6596,7 +6698,7 @@
 case "$ntp_rawdcf" in
  yes)
     echo $ac_n "checking if we must enable parity for RAWDCF""... $ac_c" 1>&6
-echo "configure:6600: checking if we must enable parity for RAWDCF" >&5
+echo "configure:6702: checking if we must enable parity for RAWDCF" >&5
 if eval "test \"`echo '$''{'ac_cv_var_rawdcf_parity'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6618,7 +6720,7 @@
     esac
 
     echo $ac_n "checking if we are powering the DCF77 from DTR""... $ac_c" 1>&6
-echo "configure:6622: checking if we are powering the DCF77 from DTR" >&5
+echo "configure:6724: checking if we are powering the DCF77 from DTR" >&5
 if eval "test \"`echo '$''{'ac_cv_var_dtr_powers_dcf77'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6646,7 +6748,7 @@
 esac
 
 echo $ac_n "checking RCC 8000 clock""... $ac_c" 1>&6
-echo "configure:6650: checking RCC 8000 clock" >&5
+echo "configure:6752: checking RCC 8000 clock" >&5
 # Check whether --enable-RCC8000 or --disable-RCC8000 was given.
 if test "${enable_RCC8000+set}" = set; then
   enableval="$enable_RCC8000"
@@ -6671,7 +6773,7 @@
 esac
 
 echo $ac_n "checking Schmid DCF77 clock""... $ac_c" 1>&6
-echo "configure:6675: checking Schmid DCF77 clock" >&5
+echo "configure:6777: checking Schmid DCF77 clock" >&5
 # Check whether --enable-SCHMID or --disable-SCHMID was given.
 if test "${enable_SCHMID+set}" = set; then
   enableval="$enable_SCHMID"
@@ -6696,7 +6798,7 @@
 esac
 
 echo $ac_n "checking Trimble GPS receiver/TAIP protocol""... $ac_c" 1>&6
-echo "configure:6700: checking Trimble GPS receiver/TAIP protocol" >&5
+echo "configure:6802: checking Trimble GPS receiver/TAIP protocol" >&5
 # Check whether --enable-TRIMTAIP or --disable-TRIMTAIP was given.
 if test "${enable_TRIMTAIP+set}" = set; then
   enableval="$enable_TRIMTAIP"
@@ -6721,7 +6823,7 @@
 esac
 
 echo $ac_n "checking Trimble GPS receiver/TSIP protocol""... $ac_c" 1>&6
-echo "configure:6725: checking Trimble GPS receiver/TSIP protocol" >&5
+echo "configure:6827: checking Trimble GPS receiver/TSIP protocol" >&5
 # Check whether --enable-TRIMTSIP or --disable-TRIMTSIP was given.
 if test "${enable_TRIMTSIP+set}" = set; then
   enableval="$enable_TRIMTSIP"
@@ -6748,7 +6850,7 @@
 
 
 echo $ac_n "checking if we need to make and use the parse libraries""... $ac_c" 1>&6
-echo "configure:6752: checking if we need to make and use the parse libraries" >&5
+echo "configure:6854: checking if we need to make and use the parse libraries" >&5
 ans=no
 case "$ntp_libparse" in
  yes)
@@ -6766,7 +6868,7 @@
 
 
 echo $ac_n "checking if we need dcf parse utilities""... $ac_c" 1>&6
-echo "configure:6770: checking if we need dcf parse utilities" >&5
+echo "configure:6872: checking if we need dcf parse utilities" >&5
 ans=no
 if test "$ntp_parseutil" = "yes"; then
     case "$target" in
@@ -6781,7 +6883,7 @@
 
 
 echo $ac_n "checking if we can build kernel streams modules for parse""... $ac_c" 1>&6
-echo "configure:6785: checking if we can build kernel streams modules for parse" >&5
+echo "configure:6887: checking if we can build kernel streams modules for parse" >&5
 ans=no
 if test "$ntp_parseutil$ac_cv_header_sys_stropts_h" = "yesyes"; then
     case "$target" in
@@ -6806,7 +6908,7 @@
 echo "$ac_t""$ans" 1>&6
 
 echo $ac_n "checking if we need basic refclock support""... $ac_c" 1>&6
-echo "configure:6810: checking if we need basic refclock support" >&5
+echo "configure:6912: checking if we need basic refclock support" >&5
 if test "$ntp_refclock" = "yes"; then
     cat >> confdefs.h <<\EOF
 #define REFCLOCK 1
@@ -6818,7 +6920,7 @@
 			
 
 echo $ac_n "checking if we want HP-UX adjtimed support""... $ac_c" 1>&6
-echo "configure:6822: checking if we want HP-UX adjtimed support" >&5
+echo "configure:6924: checking if we want HP-UX adjtimed support" >&5
 case "$target" in
  *-*-hpux[56789]*)
     ans=yes
@@ -6836,7 +6938,7 @@
 echo "$ac_t""$ans" 1>&6
 
 echo $ac_n "checking if we can read kmem""... $ac_c" 1>&6
-echo "configure:6840: checking if we can read kmem" >&5
+echo "configure:6942: checking if we can read kmem" >&5
 if eval "test \"`echo '$''{'ac_cv_var_can_kmem'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6889,7 +6991,7 @@
 esac
 
 echo $ac_n "checking if adjtime is accurate""... $ac_c" 1>&6
-echo "configure:6893: checking if adjtime is accurate" >&5
+echo "configure:6995: checking if adjtime is accurate" >&5
 if eval "test \"`echo '$''{'ac_cv_var_adjtime_is_accurate'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6941,7 +7043,7 @@
 esac
 
 echo $ac_n "checking the name of 'tick' in the kernel""... $ac_c" 1>&6
-echo "configure:6945: checking the name of 'tick' in the kernel" >&5
+echo "configure:7047: checking the name of 'tick' in the kernel" >&5
 if eval "test \"`echo '$''{'ac_cv_var_nlist_tick'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6985,7 +7087,7 @@
 esac
 #
 echo $ac_n "checking for the units of 'tick'""... $ac_c" 1>&6
-echo "configure:6989: checking for the units of 'tick'" >&5
+echo "configure:7091: checking for the units of 'tick'" >&5
 if eval "test \"`echo '$''{'ac_cv_var_tick_nano'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7009,7 +7111,7 @@
 esac
 #
 echo $ac_n "checking the name of 'tickadj' in the kernel""... $ac_c" 1>&6
-echo "configure:7013: checking the name of 'tickadj' in the kernel" >&5
+echo "configure:7115: checking the name of 'tickadj' in the kernel" >&5
 if eval "test \"`echo '$''{'ac_cv_var_nlist_tickadj'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7062,7 +7164,7 @@
 esac
 #
 echo $ac_n "checking for the units of 'tickadj'""... $ac_c" 1>&6
-echo "configure:7066: checking for the units of 'tickadj'" >&5
+echo "configure:7168: checking for the units of 'tickadj'" >&5
 if eval "test \"`echo '$''{'ac_cv_var_tickadj_nano'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7086,7 +7188,7 @@
 esac
 #
 echo $ac_n "checking half-heartedly for 'dosynctodr' in the kernel""... $ac_c" 1>&6
-echo "configure:7090: checking half-heartedly for 'dosynctodr' in the kernel" >&5
+echo "configure:7192: checking half-heartedly for 'dosynctodr' in the kernel" >&5
 if eval "test \"`echo '$''{'ac_cv_var_nlist_dosynctodr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7139,7 +7241,7 @@
 esac
 #
 echo $ac_n "checking half-heartedly for 'noprintf' in the kernel""... $ac_c" 1>&6
-echo "configure:7143: checking half-heartedly for 'noprintf' in the kernel" >&5
+echo "configure:7245: checking half-heartedly for 'noprintf' in the kernel" >&5
 if eval "test \"`echo '$''{'ac_cv_var_nlist_noprintf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7189,7 +7291,7 @@
 
 
 echo $ac_n "checking for a default value for 'tick'""... $ac_c" 1>&6
-echo "configure:7193: checking for a default value for 'tick'" >&5
+echo "configure:7295: checking for a default value for 'tick'" >&5
 if eval "test \"`echo '$''{'ac_cv_var_tick'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7231,7 +7333,7 @@
 esac
 
 echo $ac_n "checking for a default value for 'tickadj'""... $ac_c" 1>&6
-echo "configure:7235: checking for a default value for 'tickadj'" >&5
+echo "configure:7337: checking for a default value for 'tickadj'" >&5
 if eval "test \"`echo '$''{'ac_cv_var_tickadj'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7342,7 +7444,7 @@
 
 
 echo $ac_n "checking if we want and can make the ntptime utility""... $ac_c" 1>&6
-echo "configure:7346: checking if we want and can make the ntptime utility" >&5
+echo "configure:7448: checking if we want and can make the ntptime utility" >&5
 if eval "test \"`echo '$''{'ac_cv_make_ntptime'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7365,7 +7467,7 @@
 esac
 
 echo $ac_n "checking if we want UDP wildcard delivery""... $ac_c" 1>&6
-echo "configure:7369: checking if we want UDP wildcard delivery" >&5
+echo "configure:7471: checking if we want UDP wildcard delivery" >&5
 if eval "test \"`echo '$''{'ac_cv_var_udp_wildcard_delivery'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7433,7 +7535,7 @@
 esac
 
 echo $ac_n "checking if we should always slew the time""... $ac_c" 1>&6
-echo "configure:7437: checking if we should always slew the time" >&5
+echo "configure:7539: checking if we should always slew the time" >&5
 if eval "test \"`echo '$''{'ac_cv_var_slew_always'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7473,7 +7575,7 @@
 esac
 
 echo $ac_n "checking if we should step and slew the time""... $ac_c" 1>&6
-echo "configure:7477: checking if we should step and slew the time" >&5
+echo "configure:7579: checking if we should step and slew the time" >&5
 if eval "test \"`echo '$''{'ac_cv_var_step_slew'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7516,7 +7618,7 @@
 esac
 
 echo $ac_n "checking if ntpdate should step the time""... $ac_c" 1>&6
-echo "configure:7520: checking if ntpdate should step the time" >&5
+echo "configure:7622: checking if ntpdate should step the time" >&5
 if eval "test \"`echo '$''{'ac_cv_var_ntpdate_step'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7547,7 +7649,7 @@
 esac
 
 echo $ac_n "checking if we should sync TODR clock every hour""... $ac_c" 1>&6
-echo "configure:7551: checking if we should sync TODR clock every hour" >&5
+echo "configure:7653: checking if we should sync TODR clock every hour" >&5
 if eval "test \"`echo '$''{'ac_cv_var_sync_todr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7613,7 +7715,7 @@
 # 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.
 (set) 2>&1 |
-  case `(ac_space=' '; set) 2>&1` in
+  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 \).
@@ -7680,7 +7782,7 @@
     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
-    echo "$CONFIG_STATUS generated by autoconf version 2.12"
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
     exit 0 ;;
   -help | --help | --hel | --he | --h)
     echo "\$ac_cs_usage"; exit 0 ;;
@@ -7704,9 +7806,11 @@
  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
 $ac_vpsub
 $extrasub
+s%@SHELL@%$SHELL%g
 s%@CFLAGS@%$CFLAGS%g
 s%@CPPFLAGS@%$CPPFLAGS%g
 s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
 s%@DEFS@%$DEFS%g
 s%@LDFLAGS@%$LDFLAGS%g
 s%@LIBS@%$LIBS%g
@@ -7726,8 +7830,8 @@
 s%@infodir@%$infodir%g
 s%@mandir@%$mandir%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@PACKAGE@%$PACKAGE%g
 s%@VERSION@%$VERSION%g
 s%@ACLOCAL@%$ACLOCAL%g
diff -Pur xntp3-5.93/configure.in xntp3-5.93-garmin/configure.in
--- xntp3-5.93/configure.in	Sat Apr 25 15:01:54 1998
+++ xntp3-5.93-garmin/configure.in	Fri Jan 19 22:31:59 2001
@@ -1352,6 +1352,15 @@
 fi
 AC_MSG_RESULT($ntp_ok)
 
+AC_MSG_CHECKING(Garmin GPS Handheld Receivers)
+AC_ARG_ENABLE(GARMIN,		[  --enable-GARMIN             + Garmin GPS Handheld Receivers],
+    [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
+if test "$ntp_ok" = "yes"; then
+    ntp_refclock=yes
+    AC_DEFINE(CLOCK_GARMIN)
+fi
+AC_MSG_RESULT($ntp_ok)
+
 AC_MSG_CHECKING(PST/Traconex 1020 WWV/WWVH receiver)
 AC_ARG_ENABLE(PST,		[  --enable-PST              + PST/Traconex 1020 WWV/WWVH receiver],
     [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
diff -Pur xntp3-5.93/html/driver38.html xntp3-5.93-garmin/html/driver38.html
--- xntp3-5.93/html/driver38.html	Wed Dec 31 16:00:00 1969
+++ xntp3-5.93-garmin/html/driver38.html	Fri Jan 19 22:33:21 2001
@@ -0,0 +1,92 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso8859-1">
+<title>Garmin GPS Handheld Receivers</title>
+</head>
+
+<body>
+<h3>Garmin GPS Handheld Receivers</h3>
+
+<hr>
+<h4>Synopsis</h4>
+Address: 127.127.38.<i>u</i><br>
+Reference ID: <TT>GPS</TT><br>
+Driver ID: <tt>GARMIN</tt><br>
+Serial Port: <tt>/dev/gps<i>u</i></tt>; 9600 bps, 8-bits, no parity<br>
+<br>Features: <tt>(none)</tt>
+<h4>Description</h4>
+
+<p>NTP clock driver for Garmin GPS handheld receivers using the Garmin
+proprietary protocol.  It is based on both documented and undocumented
+aspects of the Garmin proprietary protocol.
+
+<p>To use this driver, your Garmin GPS handheld receiver must be
+configured to use Garmin protocol interface mode, not NMEA.
+
+<p>This driver has been written and tested using a Linux based system.
+To achieve the best quality results, turn off serial port FIFOs and enable
+low latency tty driver processing.  In Linux, this is accomplished using
+the setserial application (e.g. setserial /dev/gps<i>u</i> uart 16550
+low_latency).  Even better results are obtained with kernel timestamps on
+received characters.  This is what I have been using for most of my tests.
+
+<p>This is a "sloppy" clock but I believe it is possible to recover
+sub-millisecond results with a good clock filter.  Without an accurate
+reference clock, I am unable to provide more quantitative performance
+results at this time.
+
+<p>I suspect that earlier versions of firmware may not return the
+undisciplined oscillator count as part of a date/time response.
+This information is needed to recover the higher accuracy results.
+Without this undocumented field, the driver will only achieve sub-second
+accuracy. I welcome technical support from the manufacturer to achieve
+universal support for the entire range of models and firmware versions.
+
+<p>This driver has been testing with the following units.
+I need feedback from users to populate this list!  Check for
+updates to this list, driver, and other related software at at <a
+href="http://www.isi.edu/~lindell/garmin.html"> NTP Drivers for Garmin
+GPS Handheld Receivers</a>
+
+<ul>
+<li> Garmin GPS 12 firmware version 4.54
+</ul>
+
+<h4>Fudge Factors</h4>
+
+<dl>
+<dt><tt>time1 <i>time</i></tt></dt>
+<dd>Specifies the time offset calibration factor, in seconds and fraction,
+with default 0.0.</dd>
+
+<dt><tt>time2 <i>time</i></tt></dt>
+<dd>Not used by this driver.</dd>
+
+<dt><tt>stratum <i>number</i></tt></dt>
+<dd>Specifies the driver stratum, in decimal from 0 to 15, with default 0.
+</dd>
+
+<dt><tt>refid <i>string</i></tt></dt>
+<dd>Specifies the driver reference identifier, an ASCII string from one to
+four characters, with default <tt>GPS</tt>.</dd>
+
+<dt><tt>flag1 0 | 1</tt></dt>
+<dd>Not used by this driver.</dd>
+
+<dt><tt>flag2 0 | 1</tt></dt>
+<dd>Not used by this driver.</dd>
+
+<dt><tt>flag3 0 | 1</tt></dt>
+<dd>Not used by this driver.</dd>
+
+<dt><tt>flag4 0 | 1</tt></dt>
+<dd>Not used by this driver.</dd>
+</dl>
+
+<hr>
+<address>
+Bob Lindell (lindell@isi.edu)
+</address>
+</body>
+</html>
diff -Pur xntp3-5.93/html/refclock.html xntp3-5.93-garmin/html/refclock.html
--- xntp3-5.93/html/refclock.html	Tue May 20 21:04:41 1997
+++ xntp3-5.93-garmin/html/refclock.html	Fri Jan 19 22:34:55 2001
@@ -84,6 +84,8 @@
 (<code>ARCRON_MSF</code>)
 <br><a href="driver28.html">Type 28</a> Shared memory driver
 (<code>SHM</code>)
+<br><a href="driver38.html">Type 38</a> Garmin GPS Handheld Receivers
+(<code>GARMIN</code>)
 
 <p>* All TrueTime receivers are now supported by one driver, type 5.
 Types 15 and 25 will be retained only for a limited time and may be
diff -Pur xntp3-5.93/include/ntp.h xntp3-5.93-garmin/include/ntp.h
--- xntp3-5.93/include/ntp.h	Fri Apr 24 16:42:46 1998
+++ xntp3-5.93-garmin/include/ntp.h	Fri Jan 19 22:36:04 2001
@@ -443,7 +443,8 @@
 #define REFCLK_PALISADE         29      /* Trimble Navigation Palisade GPS */
 #define REFCLK_ONCORE           30      /* Motorola UT Oncore GPS */
 #define REFCLK_GPS_JUPITER      31      /* Rockwell Jupiter GPS receiver */
-#define REFCLK_MAX		32	/* maximum index (room to expand) */
+#define REFCLK_GARMIN		38	/* Garmin GPS Handheld Receivers */
+#define REFCLK_MAX		38	/* maximum index (room to expand) */
 
 /*
  * We tell reference clocks from real peers by giving the reference
diff -Pur xntp3-5.93/libntp/clocktypes.c xntp3-5.93-garmin/libntp/clocktypes.c
--- xntp3-5.93/libntp/clocktypes.c	Tue Mar 17 15:01:53 1998
+++ xntp3-5.93-garmin/libntp/clocktypes.c	Fri Jan 19 22:53:20 2001
@@ -74,6 +74,14 @@
             "ONCORE" },
         { REFCLK_GPS_JUPITER,   "Rockwell Jupiter GPS Receiver (31)",
           "GPS_JUPITER" },
+	{ -1,			"", "" },
+	{ -1,			"", "" },
+	{ -1,			"", "" },
+	{ -1,			"", "" },
+	{ -1,			"", "" },
+	{ -1,			"", "" },
+	{ REFCLK_GARMIN,	"Garmin GPS Handheld Receivers (38)",
+	  "GPS_GARMIN"},
 	{ -1,			"", "" }
 };
 
diff -Pur xntp3-5.93/xntpd/Makefile.in xntp3-5.93-garmin/xntpd/Makefile.in
--- xntp3-5.93/xntpd/Makefile.in	Sat Apr 25 15:21:36 1998
+++ xntp3-5.93-garmin/xntpd/Makefile.in	Fri Jan 19 22:43:17 2001
@@ -120,7 +120,7 @@
 	refclock_atom.c refclock_ptbacts.c \
 	refclock_usno.c refclock_true.c refclock_hpgps.c \
 	refclock_shm.c refclock_gpsvme.c refclock_arbiter.c \
-	refclock_arc.c jupiter.h refclock_palisade.c
+	refclock_arc.c jupiter.h refclock_palisade.c refclock_garmin.c
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = ../config.h
 CONFIG_CLEAN_FILES = 
@@ -140,7 +140,8 @@
 refclock_msfees.o refclock_trak.o refclock_datum.o refclock_acts.o \
 refclock_heath.o refclock_nmea.o refclock_atom.o refclock_ptbacts.o \
 refclock_usno.o refclock_true.o refclock_hpgps.o refclock_shm.o \
-refclock_gpsvme.o refclock_arbiter.o refclock_arc.o refclock_palisade.o
+refclock_gpsvme.o refclock_arbiter.o refclock_arc.o refclock_palisade.o \
+refclock_garmin.o
 xntpd_LDADD = $(LDADD)
 xntpd_DEPENDENCIES =  version.o ../libntp/libntp.a
 xntpd_LDFLAGS = 
diff -Pur xntp3-5.93/xntpd/ntp_control.c xntp3-5.93-garmin/xntpd/ntp_control.c
--- xntp3-5.93/xntpd/ntp_control.c	Tue Mar 17 15:02:17 1998
+++ xntp3-5.93-garmin/xntpd/ntp_control.c	Fri Jan 19 22:40:09 2001
@@ -336,6 +336,13 @@
         CTL_SST_TS_UHF,         /* REFCLK_PALISADE (29) */
         CTL_SST_TS_UHF,         /* REFCLK_ONCORE (30) */
 	CTL_SST_TS_UHF,		/* REFCLK_JUPITER (31) */
+	CTL_SST_TS_UNSPEC,
+	CTL_SST_TS_UNSPEC,
+	CTL_SST_TS_UNSPEC,
+	CTL_SST_TS_UNSPEC,
+	CTL_SST_TS_UNSPEC,
+	CTL_SST_TS_UNSPEC,
+	CTL_SST_TS_UHF,		/* REFCLK_GPS_GARMIN (38) */
 };
 
 
diff -Pur xntp3-5.93/xntpd/refclock_conf.c xntp3-5.93-garmin/xntpd/refclock_conf.c
--- xntp3-5.93/xntpd/refclock_conf.c	Fri Apr 24 16:14:20 1998
+++ xntp3-5.93-garmin/xntpd/refclock_conf.c	Fri Jan 19 22:41:44 2001
@@ -192,6 +192,12 @@
 #define refclock_jupiter refclock_none
 #endif
 
+#ifdef CLOCK_GARMIN
+extern	struct refclock	refclock_garmin;
+#else
+#define	refclock_garmin	refclock_none
+#endif
+
 /*
  * Order is clock_start(), clock_shutdown(), clock_poll(),
  * clock_control(), clock_init(), clock_buginfo, clock_flags;
@@ -231,7 +237,13 @@
         &refclock_palisade,     /* 29 REFCLK_PALISADE */
         &refclock_oncore,       /* 30 REFCLK_ONCORE */
         &refclock_jupiter,      /* 31 REFCLK_GPS_JUPITER */
-	&refclock_none		/* 32 reserved */
+	&refclock_none,		/* 32 reserved */
+	&refclock_none,		/* 33 reserved */
+	&refclock_none,		/* 34 reserved */
+	&refclock_none,		/* 35 reserved */
+	&refclock_none,		/* 36 reserved */
+	&refclock_none,		/* 37 reserved */
+	&refclock_garmin	/* 38 REFCLOCK_GARMIN */
 };
 
 u_char num_refclock_conf = sizeof(refclock_conf)/sizeof(struct refclock *);
diff -Pur xntp3-5.93/xntpd/refclock_garmin.c xntp3-5.93-garmin/xntpd/refclock_garmin.c
--- xntp3-5.93/xntpd/refclock_garmin.c	Wed Dec 31 16:00:00 1969
+++ xntp3-5.93-garmin/xntpd/refclock_garmin.c	Wed Jan 24 13:58:12 2001
@@ -0,0 +1,907 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_GARMIN)
+
+/*
+ *	NTP clock driver for Garmin GPS handheld receivers (1.2)
+ *	Copyright (C) 2000 Bob Lindell (lindell@isi.edu)
+ *
+ *	This program is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU General Public License as
+ *	published by the Free Software Foundation; either version 2 of
+ *	the License, or (at your option) any later version.
+ *
+ *	This program is distributed in the hope that it will be useful,
+ *	but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *	GNU General Public License for more details.
+ *
+ *	You should have received a copy of the GNU General Public
+ *	License along with this program; if not, write to the Free
+ *	Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ *	MA  02111-1307, USA.
+ */
+
+/*
+ *	NTP clock driver for Garmin GPS handheld receivers using the
+ *	Garmin proprietary protocol.  It is based on both documented
+ *	and undocumented aspects of the Garmin proprietary protocol.
+ *
+ *	To use this driver, your Garmin GPS handheld receiver must be
+ *	configured to use Garmin protocol interface mode, not NMEA.
+ *
+ *	This driver has been written and tested using a Linux based
+ *	system.  To achieve the best quality results, turn off serial
+ *	port FIFOs and enable low latency tty driver processing.
+ *	In Linux, this is accomplished using the setserial application
+ *	(e.g. setserial /dev/gps0 uart 16550 low_latency).  Even better
+ *	results are obtained with kernel timestamps on received
+ *	characters.  This is what I have been using for most of my tests.
+ *
+ *	This is a "sloppy" clock but I believe it is possible to recover
+ *	sub-millisecond results with a good clock filter.  Without an
+ *	accurate reference clock, I am unable to provide more quantitative
+ *	performance results at this time.
+ *
+ *	I suspect that earlier versions of firmware may not return the
+ *	undisciplined oscillator count as part of a date/time response.
+ *	This information is needed to recover the higher accuracy results.
+ *	Without this undocumented field, the driver will only achieve
+ *	sub-second accuracy. I welcome technical support from the
+ *	manufacturer to achieve universal support for the entire range
+ *	of models and firmware versions.
+ *
+ *	This driver has been testing with the following units.
+ *	I need feedback from users to populate this list!  Check for
+ *	updates to this list, driver, and other related software
+ *	at http://www.isi.edu/~lindell/garmin.html.
+ *
+ *		* Garmin GPS 12 firmware version 4.54
+ *		* ??
+ */
+
+#define	HAVE_CFMAKERAW
+#define	XNTP3
+/* #define	TIMESTAMPS */
+
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/time.h>
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_stdlib.h"
+#include "ntp_unixtime.h"
+
+/*
+ *	One day, POSIX types will be a given.
+ */
+
+typedef unsigned char uint8_x;
+typedef short int16_x;
+typedef unsigned short uint16_x;
+typedef u_int32 uint32_x;
+
+/*
+ *	Generic functions
+ */
+
+#define	SIZEOF(x)		(sizeof(x) / sizeof((x)[0]))
+
+/*
+ *	Time constants
+ */
+
+#define	USEC_PER_SEC		1000000
+#define	SEC_PER_MIN		60
+#define	MIN_PER_HOUR		60
+#define	HOUR_PER_DAY		24
+#define	SEC_PER_DAY		(SEC_PER_MIN * MIN_PER_HOUR * HOUR_PER_DAY)
+
+/*
+ *	The Garmin proprietary protocol is partially documented
+ *	by the manufacturer.  The document, "Garmin GPS Interface
+ *	Specification", dated December, 1999, is available at
+ *	http://www.garmin.com/support/pdf/iop_spec.pdf.  A good reference
+ *	for some of the undocumented packet formats can be found at
+ *	http://artico.lma.fi.upm.es/numerico/miembros/antonio/async/.
+ */
+
+/*
+ *	Packet IDs at the Garmin protocol link layer.
+ */
+
+#define	PID_ACK_BYTE		6
+#define	PID_COMMAND_DATA	10
+#define	PID_DATE_TIME_DATA	14
+#define	PID_UNDOC_PVT		20
+#define	PID_NAK_BYTE		21
+#define	PID_UNDOC_ASYNC		28
+#define	PID_PVT_DATA		51
+
+/*
+ *	Packet commands at the Garmin protocol application layer.
+ */
+
+#define	CMND_TRANSFER_TIME	5
+
+/*
+ *	Garmin data structure constants
+ */
+
+#define	FIX_2D			2		/* At least a 2D fix */
+#define	CLK_SHIFT		9		/* LSB of oscillator */
+#define	CLK_MASK		((1 << CLK_SHIFT) - 1)
+
+/*
+ *	Garmin packet functions
+ */
+
+#define	PKT_MAX			(2 + 2 * 257 + 2)
+#define	PKT_PID(x)		((x)[0])
+#define	PKT_SIZE(x)		((x)[1])
+
+#ifdef	XNTP_BIG_ENDIAN
+#define	GTOH16(buf,i)		(((buf)[(i) + 1] << 8) | (buf)[i])
+#define	GTOH32(buf,i)		((GTOH16(buf,(i) + 2) << 16) | GTOH16(buf,i))
+#define	GTOHD(buf,i)		gtohd(buf,i)
+static
+double
+gtohd(uint8_x *buf,int i) {
+	union {
+		unsigned long l[2];
+		double d;
+	} x;
+
+	x.l[1] = GTOH32(buf,i);
+	x.l[0] = GTOH32(buf,i + 4);
+	return(x.d);
+}
+#else	/* XNTP_BIG_ENDIAN */
+#define	GTOH16(buf,i)		(*((uint16_x *) &(buf)[i]))
+#define	GTOH32(buf,i)		(*((uint32_x *) &(buf)[i]))
+#define	GTOHD(buf,i)		(*((double *) &(buf)[i]))
+#endif	/* XNTP_BIG_ENDIAN */
+
+/*
+ *	NTP daemon definitions
+ */
+
+#ifdef SYS_WINNT
+#define	DEVICE		"COM%d:"		/* COM 1 - 3 supported */
+#else
+#define	DEVICE		"/dev/gps%d"		/* name of radio device */
+#endif
+#define	SPEED232	B9600			/* UART speed (9600 bps) */
+#define	PRECISION	(-10)			/* precision (about 1 ms) */
+#define	REFID		"GPS\0"			/* reference id */
+#define	DESCRIPTION	"Garmin GPS Clock"	/* who we are */
+
+#define	BUF_SIZE		1024	/* ring buffer size */
+#define	MIN_SAMPLES		10	/* min samples per poll period */
+
+/*
+ *	NTP daemon unit control structure
+ */
+
+struct unit {
+	uint8_x buffer[BUF_SIZE];	/* received data */
+	l_fp ts[BUF_SIZE];		/* time of byte arrival */
+	uint16_x rp;			/* read pointer */
+	uint16_x wp;			/* write pointer */
+	double period;			/* period of counter (usecs) */
+	double tow0;			/* previous value of GPS tow */
+	uint32_x counter0;		/* previous value of counter */
+	int16_x leap;			/* GPS leap second offset to UTC */
+	int high;			/* High accuracy mode enabled */
+#ifdef	TIMESTAMPS
+	uint8_x tcnt;			/* byte count for timeval data */
+	struct timeval tv;		/* time of byte arrival */
+#endif	/* TIMESTAMPS */
+#ifdef	XNTP3
+#define	NSAMPLES		64
+	int coderecv;			/* total received samples */
+	l_fp filter[NSAMPLES];		/* offset filter */
+	l_fp lastref;			/* last reference timestamp */
+#endif	/* XNTP3 */
+};
+
+/*
+ *	Function prototypes
+ */
+
+typedef void (*callback)(struct recvbuf *,uint8_x *,l_fp *);
+
+static	int	gstart		P((int,struct peer *));
+static	void	gshutdown	P((int,struct peer *));
+static	void	greceive	P((struct recvbuf *));
+static	void	gpoll		P((int,struct peer *));
+static	int	gwrite		P((int,uint8_x *));
+static	void	gread		P((struct recvbuf *,callback));
+static	void	process		P((struct recvbuf *,uint8_x *,l_fp *));
+
+/*
+ *	NTP daemon transfer vector
+ */
+
+struct	refclock refclock_garmin = {
+	gstart,			/* start up driver */
+	gshutdown,		/* shut down driver */
+	gpoll,			/* transmit poll message */
+	noentry,		/* handle control */
+	noentry,		/* initialize driver */
+	noentry,		/* buginfo */
+	NOFLAGS			/* not used */
+};
+
+#ifdef	XNTP3
+#include <math.h>
+#define	NKEEP			32
+#define	NKEEP_SHIFT		5
+#define REFCLOCKMAXDISPERSE (FP_SECOND/4) /* max sample dispersion */
+
+/*
+ * Tables to compute the day of year from yyyymmdd timecode.
+ * Viva la leap.
+ */
+static int day1tab[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+static int day2tab[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+static
+int
+ymd2yd(
+	int y,
+	int m,
+	int d
+	)
+{
+	int i, *t;
+
+	if (m < 1 || m > 12 || d < 1)
+		return (-1);
+
+	if (((y%4 == 0) && (y%100 != 0)) || (y%400 == 0))
+		t = day2tab;	/* leap year */
+	else
+		t = day1tab;	/* not a leap year */
+	if (d > t[m - 1])
+		return (-1);
+	for (i = 0; i < m - 1; i++)
+		d += t[i];
+	return d;
+}
+
+/* Compare two l_fp's, used with qsort() */
+static
+int
+#ifdef QSORT_USES_VOID_P
+cmpl_fp(p1, p2)
+	const void *p1, *p2;
+{
+	register const l_fp *fp1 = (const l_fp *)p1;
+	register const l_fp *fp2 = (const l_fp *)p2;
+#else
+cmpl_fp(fp1, fp2)
+	register const l_fp *fp1;
+	register const l_fp *fp2;
+{
+#endif /* not QSORT_USES_VOID_P */
+
+	if (!L_ISGEQ(fp1, fp2))
+		return (-1);
+	if (L_ISEQU(fp1, fp2))
+		return (0);
+	return (1);
+}
+
+static
+void
+clock_process(peer)
+	struct peer *peer;
+{
+	struct unit *up;
+	struct refclockproc *pp;
+	register int i;
+	l_fp offset;
+
+	pp = peer->procptr;
+	up = (struct unit *)pp->unitptr;
+
+	/*
+	 * Calculate the offset
+	 */
+	if (!clocktime(pp->day, pp->hour, pp->minute, pp->second, GMT,
+		pp->lastrec.l_ui, &pp->yearstart, &offset.l_ui)) {
+		refclock_report(peer, CEVNT_BADTIME);
+		return;
+	}
+	if (pp->usec) {
+		TVUTOTSF(pp->usec, offset.l_uf);
+	} else {
+		MSUTOTSF(pp->msec, offset.l_uf);
+	}
+	L_ADD(&offset, &pp->fudgetime1);
+	up->lastref = offset;	/* save last reference time */
+	L_SUB(&offset, &pp->lastrec); /* form true offset */
+
+	/*
+	 * A rolling filter.  Initialize first time around.
+	 */
+	i = ((up->coderecv)) % NSAMPLES;
+
+	up->filter[i] = offset;
+	if (up->coderecv == 0)
+		for (i = 1; (u_int) i < NSAMPLES; i++)
+			up->filter[i] = up->filter[0];
+	up->coderecv++;
+}
+
+static
+void
+clock_receive(peer)
+	struct peer *peer;
+{
+	register struct unit *up;
+	struct refclockproc *pp;
+	register int i, n;
+	int j, k;
+	l_fp offset, median, lftmp;
+	u_fp disp;
+	l_fp off[NSAMPLES];
+	extern u_long current_time;
+
+	pp = peer->procptr;
+	up = (struct unit *)pp->unitptr;
+
+	/*
+	 * Copy the raw offsets and sort into ascending order
+	 */
+	for (i = 0; i < NSAMPLES; i++)
+		off[i] = up->filter[i];
+	qsort((char *)off, NSAMPLES, sizeof(l_fp), cmpl_fp);
+
+	/*
+	 * Reject the furthest from the median of NSAMPLES samples until
+	 * NKEEP samples remain.
+	 */
+	i = 0;
+	n = NSAMPLES;
+	while ((n - i) > NKEEP) {
+		lftmp = off[n - 1];
+		median = off[(n + i) / 2];
+		L_SUB(&lftmp, &median);
+		L_SUB(&median, &off[i]);
+		if (L_ISHIS(&median, &lftmp)) {
+			/* reject low end */
+			i++;
+		} else {
+			/* reject high end */
+			n--;
+		}
+	}
+
+	/*
+	 * Copy key values to the billboard to measure performance.
+	 */
+	pp->lastref = up->lastref;
+	pp->coderecv = up->coderecv;
+	pp->nstages = NKEEP + 2;
+	pp->filter[0] = off[0];			/* smallest offset */
+	pp->filter[1] = off[NSAMPLES-1];	/* largest offset */
+	for (j=2, k=i; k < n; j++, k++)
+		pp->filter[j] = off[k];		/* offsets actually examined */
+
+	/*
+	 * Compute the dispersion based on the difference between the
+	 * extremes of the remaining offsets. Add to this the time since
+	 * the last clock update, which represents the dispersion
+	 * increase with time. We know that NTP_MAXSKEW is 16. If the
+	 * sum is greater than the allowed sample dispersion, bail out.
+	 * If the loop is unlocked, return the most recent offset;
+	 * otherwise, return the median offset.
+	 */
+	lftmp = off[n - 1];
+	L_SUB(&lftmp, &off[i]);
+	disp = LFPTOFP(&lftmp);
+	if (disp > REFCLOCKMAXDISPERSE) {
+		refclock_report(peer, CEVNT_BADTIME);
+		return;
+	}
+
+	/*
+	 * Now compute the offset estimate.  If fudge flag 1
+	 * is set, average the remainder, otherwise pick the
+	 * median.
+	 */
+	if (pp->sloppyclockflag & CLK_FLAG1) {
+		L_CLR(&lftmp);
+		while (i < n) {
+			L_ADD(&lftmp, &off[i]);
+			i++;
+		}
+		i = NKEEP_SHIFT;
+		while (i > 0) {
+			L_RSHIFT(&lftmp);
+			i--;
+		}
+		offset = lftmp;
+	} else {
+		i = (n + i) / 2;
+		offset = off[i];
+	}
+
+	/*
+	 * The payload: filtered offset and dispersion.
+	 */
+
+	pp->offset = offset;
+	pp->dispersion = disp;
+	pp->lasttime = current_time;
+	refclock_receive(peer,&pp->offset,0,pp->dispersion,
+		&pp->lastrec,&pp->lastrec,pp->leap);
+}
+
+#ifdef	HAVE_TERMIOS
+#ifndef	HAVE_CFMAKERAW
+static
+void
+cfmakeraw(struct termios *t)
+{
+	t->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
+	t->c_oflag &= ~OPOST;
+	t->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+	t->c_cflag &= ~(CSIZE|PARENB);
+	t->c_cflag |= CS8;
+}
+#endif	/* HAVE_CFMAKERAW */
+#endif	/* HAVE_TERMIOS */
+
+static
+int
+clock_open(char *device,int mode)
+{
+	int fd;
+#ifdef	HAVE_TERMIOS
+	struct termios t;
+#endif	/* HAVE_TERMIOS */
+
+	fd = refclock_open(device,mode,0);
+#ifdef	HAVE_TERMIOS
+	tcgetattr(fd,&t);
+	cfmakeraw(&t);
+	t.c_cc[VTIME] = 0;
+	t.c_cc[VMIN] = 1;
+	tcsetattr(fd,TCSANOW,&t);
+#endif	/* HAVE_TERMIOS */
+	return(fd);
+}
+#endif	/* XNTP3 */
+
+/* Start async message generation of PID_PVT_DATA and PID_UNDOC_PVT */
+static uint8_x async[] = { PID_UNDOC_ASYNC, 2, 4, 3 };
+
+/*
+ *	start - open the devices and initialize data for
+ *	processing.
+ */
+
+static
+int
+gstart(int unit,struct peer *peer)
+{
+	struct unit *up;
+	struct refclockproc *pp;
+	char device[sizeof(DEVICE) + 1];
+
+	/*
+	 * Allocate and initialize structures
+	 */
+	up = (struct unit *) emalloc(sizeof(*up));
+	if (up == NULL)
+		return (FALSE);
+	memset((char *)up,0,sizeof(*up));
+	pp = peer->procptr;
+	pp->unitptr = (caddr_t)up;
+	pp->io.srcclock = (caddr_t)peer;
+	pp->io.clock_recv = greceive;
+	pp->io.datalen = 0;
+	peer->precision = PRECISION;
+	pp->clockdesc = DESCRIPTION;
+	memcpy((char *)&pp->refid,REFID,4);
+	(void)sprintf(device,DEVICE,unit);
+#ifdef	XNTP3
+	pp->io.fd = clock_open(device,SPEED232);
+#else	/* XNTP3 */
+	pp->io.fd = refclock_open(device,SPEED232,LDISC_RAW);
+#endif	/* XNTP3 */
+	if (pp->io.fd < 0) {
+		free(up);
+		return (FALSE);
+	}
+	if (!io_addclock(&pp->io)) {
+		(void) close(pp->io.fd);
+		free(up);
+		return (FALSE);
+	}
+	gwrite(pp->io.fd,async);
+	return (TRUE);
+}
+
+/*
+ *	shutdown - shut down the clock.
+ */
+
+static
+void
+gshutdown(int unit,struct peer *peer)
+{
+	struct unit *up;
+	struct refclockproc *pp;
+	/* Stop async message generation */
+	static uint8_x stop[] = { PID_UNDOC_ASYNC, 2, 0, 0 };
+
+	pp = peer->procptr;
+	up = (struct unit *)pp->unitptr;
+	gwrite(pp->io.fd,stop);
+	io_closeclock(&pp->io);
+	free(up);
+}
+
+/*
+ *	receive - receive data from the clock.
+ */
+
+static
+void
+greceive(struct recvbuf *rbufp)
+{
+	gread(rbufp,process);
+}
+
+/*
+ *	poll - called by the transmit procedure.
+ */
+
+static
+void
+gpoll(int unit,struct peer *peer)
+{
+	struct refclockproc *pp;
+	struct unit *up;
+
+	pp = peer->procptr;
+	up = (struct unit *)pp->unitptr;
+	pp->polls++;
+	/*
+	 *	Reexamine the GPS leap offset every poll period.
+	 *	Also support hot disconnects and reconnects of the GPS
+	 *	clock.  We don't want to deprive the user from going on
+	 *	an enjoyable hike with their receiver.
+	 */
+	gwrite(pp->io.fd,async);
+#ifdef	XNTP3
+	if (up->coderecv < (pp->coderecv + MIN_SAMPLES)) {
+#else	/* XNTP3 */
+	if (pp->coderecv < (pp->codeproc + MIN_SAMPLES)) {
+#endif	/* XNTP3 */
+		refclock_report(peer,CEVNT_TIMEOUT);
+		up->rp = up->wp;
+#ifdef	TIMESTAMPS
+		up->tcnt = 0;
+#endif	/* TIMESTAMPS */
+		return;
+	}
+	record_clock_stats(&peer->srcadr,pp->a_lastcode);
+#ifdef	XNTP3
+	clock_receive(peer);
+#else	/* XNTP3 */
+	refclock_receive(peer);
+#endif	/* XNTP3 */
+}
+
+
+/*
+ *	Process packets of the Garmin protocol.  The Garmin specification
+ *	refers to this as the application layer processing.
+ */
+
+static
+void
+process(struct recvbuf *rbufp,uint8_x *buf,l_fp *t)
+{
+	uint32_x counter;
+	struct unit *up;
+	struct refclockproc *pp;
+	struct peer *peer;
+	double tow;
+	/* Poll for date and time */
+	static uint8_x date[] = { PID_COMMAND_DATA, 2, CMND_TRANSFER_TIME, 0 };
+	/* Start async message generation of PID_UNDOC_PVT only */
+	static uint8_x simplepvt[] = { PID_UNDOC_ASYNC, 2, 4, 0 };
+
+	peer = (struct peer *)rbufp->recv_srcclock;
+	pp = peer->procptr;
+	up = (struct unit *)pp->unitptr;
+	if (PKT_PID(buf) == PID_UNDOC_PVT) {
+		/*
+		 *	Every second we get the current count of the
+		 *	undisciplined oscillator at the beginning of
+		 *	the second.  The nominal frequency is 0.5115
+		 *	Mhz which is half of 1.023 Mhz GPS data rate. We
+		 *	compute the period of this oscillator by measuring
+		 *	it against the computed GPS time of week (tow)
+		 *	field.  The tow field is actually reported in two
+		 *	parts, a value which drifts with the oscillator
+		 *	and a correction factor.
+		 */
+		if (GTOH16(buf,2) < FIX_2D)
+			return;
+		gwrite(pp->io.fd,date);	/* Ask for the data and time */
+		if (!up->high)
+			return;
+		counter = (GTOH32(buf,22) << CLK_SHIFT)
+			| (GTOH32(buf,26) & CLK_MASK);
+		tow = GTOHD(buf,6) - GTOHD(buf,70);
+		up->period = USEC_PER_SEC * (tow - up->tow0)
+			/ (counter - up->counter0);
+		up->counter0 = counter;
+		up->tow0 = tow;
+		return;
+	}
+	if (PKT_PID(buf) == PID_PVT_DATA) {
+		/*
+		 *	Every second we get a position, velocity,
+		 *	and time (PVT) solution of the GPS receiver.
+		 *	This gives the GPS leap second offset to UTC.
+		 *	The only reason we need this message is to
+		 *	correct the date and time packets.
+		 */
+		if (GTOH16(buf,18) < FIX_2D)
+			return;
+		up->leap = GTOH16(buf,60);
+		if (up->high)
+			/* turn off PID_PVT_DATA */
+			gwrite(pp->io.fd,simplepvt);
+		else
+			up->tow0 = GTOHD(buf,20);
+		return;
+	}
+	if (PKT_PID(buf) == PID_DATE_TIME_DATA) {
+		/*
+		 *	The Garmin documentation says we get back
+		 *	8 bytes including the data and time to the
+		 *	nearest second.  Some versions of the firmware
+		 *	throw in an additional 4 bytes containing the
+		 *	upper bits of the undisciplined oscillator count.
+		 */
+		pp->lastrec = *t;
+		pp->year = GTOH16(buf,4);
+		pp->day = ymd2yd(pp->year,buf[2],buf[3]);
+		pp->hour = GTOH16(buf,6);
+		pp->minute = buf[8];
+		pp->second = buf[9];
+		pp->msec = 0;
+		pp->leap = LEAP_NOWARNING;
+		pp->lencode = sprintf(pp->a_lastcode,
+			"%.02d/%.02d/%d %.02d:%.02d:%.02d",buf[2],buf[3],
+			pp->year,pp->hour,pp->minute,pp->second);
+		/*
+		 *	The time, which is reported to the nearest
+		 *	second, seems to drift relative to real time by
+		 *	a substantial fraction of a second.  This means
+		 *	that we may accidently report that we are in
+		 *	the previous or next second.  Use the GPS tow
+		 *	corrected to UTC instead.
+		 */
+		pp->hour = 0;
+		pp->minute = 0;
+		pp->usec = USEC_PER_SEC * modf(up->tow0,&tow);
+		pp->second = tow;
+		pp->second = (pp->second + SEC_PER_DAY - up->leap)
+			% SEC_PER_DAY;
+		/*
+		 *	Compute the offset into the current second
+		 *	by multiplying the elapsed count since the
+		 *	beginning of the second with the estimated period
+		 *	of the counter.  The response is missing the
+		 *	least significant bits of the oscillator count.
+		 *	This does not reduce the accuracy of the result
+		 *	since device responses seem to occur at some
+		 *	large multiple of the oscillator frequency.
+		 */
+		if (PKT_SIZE(buf) >= 12) {
+			counter = GTOH32(buf,10) << CLK_SHIFT;
+			pp->usec += up->period * (counter - up->counter0);
+			while (pp->usec >= USEC_PER_SEC) {
+				pp->usec -= USEC_PER_SEC;
+				pp->second++;
+			}
+			up->high = TRUE;
+		}
+		else
+			up->high = FALSE;
+#ifdef	XNTP3
+		clock_process(peer);
+#else	/* XNTP3 */
+		if (!refclock_process(pp))
+			refclock_report(peer,CEVNT_BADTIME);
+#endif	/* XNTP3 */
+		return;
+	}
+}
+
+/*
+ *	An implementation of the Garmin link layer protocol.  As defined
+ *	in the specification, all packet ACKs and NACKs are done only
+ *	at the link layer.
+ */
+
+#define	DLE		16
+#define	ETX		3
+
+#define	GETBYTE(c,up,rp)	{ \
+	if (rp != up->wp) { \
+		(c) = up->buffer[rp++]; \
+		rp = rp % SIZEOF(up->buffer); \
+	} \
+	else \
+		return(0); \
+}
+
+#define	GETBYTE_ESCAPED(c,up,rp)	{ \
+	GETBYTE(c,up,rp); \
+	if (c == DLE) \
+		GETBYTE(c,up,rp); \
+}
+
+#define	PUTBYTE(c,buf,len)	{ \
+	buf[len++] = c; \
+}
+
+#define	PUTBYTE_ESCAPED(c,buf,len)	{ \
+	PUTBYTE(c,buf,len); \
+	if (c == DLE) \
+		PUTBYTE(c,buf,len); \
+}
+
+/*
+ *	Write a packet to the GPS receiver.  Add the proper header,
+ *	trailer, and checksum.  Perform DLE escaping as defined in the
+ *	specification.
+ */
+
+static
+int
+gwrite(int fd,uint8_x *buf)
+{
+	uint8_x c,sum,packet[PKT_MAX];
+	uint16_x i,n,len;
+
+	len = 0;
+	PUTBYTE(DLE,packet,len);
+	sum = PKT_PID(buf);
+	PUTBYTE(sum,packet,len);
+	n = PKT_SIZE(buf) + 2;
+	for (i = 1;i < n; i++) {
+		c = buf[i];
+		PUTBYTE_ESCAPED(c,packet,len);
+		sum += c;
+	}
+	sum = 256 - sum;
+	PUTBYTE_ESCAPED(sum,packet,len);
+	PUTBYTE(DLE,packet,len);
+	PUTBYTE(ETX,packet,len);
+	return(write(fd,packet,len) == len);
+}
+
+/*
+ *	Attempt to parse whole packets.  If successful, ACK the packet if
+ *	necessary and return true.  Bad packets are dropped and get NACKed
+ *	if the PID is known.  There is a subtle flaw in the protocol here.
+ *	A NACK is susposed to return the PID.  But what if the received
+ *	PID byte was corrupted during transmission?  We send back the
+ *	PID we received, right or wrong.
+ */
+
+static
+int
+parse(int fd,struct unit *up,uint8_x *buf,l_fp *t)
+{
+	uint8_x c,sum;
+	uint16_x i,n,rp;
+	static uint8_x response[] = { 0, 2, 0, 0 };
+	/* This is partial list of packets that we should not ACK or NACK */
+	static uint8_x list[] = { PID_ACK_BYTE, PID_NAK_BYTE, PID_PVT_DATA,
+		PID_UNDOC_PVT };
+
+	rp = up->rp;
+	do {
+		*t = up->ts[rp];
+		GETBYTE(sum,up,rp);
+		if (sum != DLE)
+			continue;
+		GETBYTE(sum,up,rp);
+		if (sum == ETX)
+			continue;
+	} while (sum == DLE);
+	PKT_PID(buf) = sum;
+	GETBYTE_ESCAPED(n,up,rp);
+	sum += n;
+	PKT_SIZE(buf) = n;
+	n += 3;
+	for (i = 2;i < n; i++) {
+		GETBYTE_ESCAPED(c,up,rp);
+		sum += c;
+		buf[i] = c;
+	}
+	GETBYTE(c,up,rp);
+	PKT_PID(response) = PID_NAK_BYTE;
+	if (c == DLE) {
+		GETBYTE(c,up,rp);
+		if (c == ETX)
+			if (sum == 0)
+				PKT_PID(response) = PID_ACK_BYTE;
+	}
+	response[2] = PKT_PID(buf);
+	for (i = 0;i < SIZEOF(list); i++)
+		if (list[i] == PKT_PID(buf))
+			break;
+	if (i == SIZEOF(list))
+		gwrite(fd,response);
+	up->rp = rp;
+	if (PKT_PID(response) == PID_NAK_BYTE)
+		return(-1);
+	return(1);
+}
+
+/*
+ *	Collect the bytes as they come in from the serial port.  When
+ *	entire packets have been collected, pass them up to be processed.
+ *	Bad packets are silently dropped as if they were not received.
+ */
+
+static
+void
+gread(struct recvbuf *rbufp,callback func)
+{
+	uint8_x c,packet[PKT_MAX];
+	uint16_x i;
+	l_fp t;
+	int overflow;
+	struct refclockproc *pp;
+	struct peer *peer;
+	struct unit *up;
+
+	peer = (struct peer *)rbufp->recv_srcclock;
+	pp = peer->procptr;
+	up = (struct unit *)pp->unitptr;
+	overflow = FALSE;
+	for (i = 0;i < rbufp->recv_length; i++) {
+		c = rbufp->recv_buffer[i];
+#ifdef	TIMESTAMPS
+		if (up->tcnt < sizeof(up->tv)) {
+			((char *) &up->tv)[up->tcnt++] = c;
+			continue;
+		}
+		up->tcnt = 0;
+		up->tv.tv_sec += JAN_1970;
+		TVTOTS(&up->tv,&up->ts[up->wp]);
+#else	/* TIMESTAMPS */
+		up->ts[up->wp] = rbufp->recv_time;
+#endif	/* TIMESTAMPS */
+		up->buffer[up->wp++] = c;
+		up->wp = up->wp % SIZEOF(up->buffer);
+		overflow |= (up->wp == up->rp);
+	}
+	if (overflow)
+		up->rp = (up->wp + 1) % SIZEOF(up->buffer);
+	while (parse(pp->io.fd,up,packet,&t) > 0)
+		(*func)(rbufp,packet,&t);
+}
+
+#else
+int refclock_garmin_bs;
+#endif	/* REFCLOCK */
