aboutsummaryrefslogtreecommitdiff
path: root/contrib/ntp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ntp')
-rw-r--r--contrib/ntp/COPYRIGHT214
-rw-r--r--contrib/ntp/ChangeLog620
-rw-r--r--contrib/ntp/Makefile.in96
-rw-r--r--contrib/ntp/NEWS15
-rw-r--r--contrib/ntp/README.des1
-rw-r--r--contrib/ntp/acconfig.h103
-rw-r--r--contrib/ntp/aclocal.m4240
-rw-r--r--contrib/ntp/adjtimed/Makefile.in86
-rwxr-xr-xcontrib/ntp/build12
-rw-r--r--contrib/ntp/clockstuff/Makefile.in98
-rwxr-xr-xcontrib/ntp/config.guess18
-rw-r--r--contrib/ntp/config.h.in107
-rwxr-xr-xcontrib/ntp/config.sub11
-rwxr-xr-xcontrib/ntp/configure2204
-rw-r--r--contrib/ntp/configure.in134
-rwxr-xr-xcontrib/ntp/depcomp269
-rw-r--r--contrib/ntp/html/audio.htm153
-rw-r--r--contrib/ntp/html/build.htm24
-rw-r--r--contrib/ntp/html/copyright.htm217
-rw-r--r--contrib/ntp/html/driver30.htm82
-rw-r--r--contrib/ntp/html/driver35.htm82
-rw-r--r--contrib/ntp/html/driver36.htm839
-rw-r--r--contrib/ntp/html/driver37.htm75
-rw-r--r--contrib/ntp/html/driver6.htm431
-rw-r--r--contrib/ntp/html/driver7.htm792
-rw-r--r--contrib/ntp/html/driver8.htm26
-rw-r--r--contrib/ntp/html/hints/solaris-dosynctodr.html320
-rw-r--r--contrib/ntp/html/hints/solaris.html8
-rw-r--r--contrib/ntp/html/hints/solaris.xtra.S99ntpd1
-rw-r--r--contrib/ntp/html/hints/winnt.htm315
-rw-r--r--contrib/ntp/html/index.htm6
-rw-r--r--contrib/ntp/html/monopt.htm618
-rw-r--r--contrib/ntp/html/notes.htm27
-rw-r--r--contrib/ntp/html/ntpd.htm18
-rw-r--r--contrib/ntp/html/pps.htm25
-rw-r--r--contrib/ntp/html/qth.htm64
-rw-r--r--contrib/ntp/html/refclock.htm83
-rw-r--r--contrib/ntp/html/tickadj.htm4
-rw-r--r--contrib/ntp/include/Makefile.am2
-rw-r--r--contrib/ntp/include/Makefile.in41
-rw-r--r--contrib/ntp/include/audio.h13
-rwxr-xr-xcontrib/ntp/include/icom.h87
-rw-r--r--contrib/ntp/include/l_stdlib.h4
-rw-r--r--contrib/ntp/include/ntp.h11
-rw-r--r--contrib/ntp/include/ntp_refclock.h4
-rw-r--r--contrib/ntp/kernel/Makefile.in40
-rw-r--r--contrib/ntp/kernel/sys/Makefile.in39
-rw-r--r--contrib/ntp/libntp/Makefile.am5
-rw-r--r--contrib/ntp/libntp/Makefile.in505
-rw-r--r--contrib/ntp/libntp/audio.c154
-rw-r--r--contrib/ntp/libntp/authkeys.c2
-rw-r--r--contrib/ntp/libntp/clocktypes.c18
-rw-r--r--contrib/ntp/libntp/icom.c329
-rw-r--r--contrib/ntp/libntp/recvbuff.c18
-rw-r--r--contrib/ntp/libntp/syssignal.c10
-rw-r--r--contrib/ntp/libntp/systime.c58
-rw-r--r--contrib/ntp/libparse/Makefile.am91
-rw-r--r--contrib/ntp/libparse/Makefile.in337
-rw-r--r--contrib/ntp/libparse/clk_computime.c7
-rw-r--r--contrib/ntp/libparse/clk_dcf7000.c7
-rw-r--r--contrib/ntp/libparse/clk_hopf6021.c7
-rw-r--r--contrib/ntp/libparse/clk_meinberg.c7
-rw-r--r--contrib/ntp/libparse/clk_rawdcf.c47
-rw-r--r--contrib/ntp/libparse/clk_rcc8000.c7
-rw-r--r--contrib/ntp/libparse/clk_schmid.c7
-rw-r--r--contrib/ntp/libparse/clk_trimtaip.c7
-rw-r--r--contrib/ntp/libparse/clk_trimtsip.c7
-rw-r--r--contrib/ntp/libparse/data_mbg.c2
-rw-r--r--contrib/ntp/libparse/parse.c9
-rw-r--r--contrib/ntp/libparse/parse_conf.c7
-rw-r--r--contrib/ntp/libparse/parsesolaris.c6
-rw-r--r--contrib/ntp/libparse/parsestreams.c13
-rw-r--r--contrib/ntp/librsaref/Makefile.in122
-rwxr-xr-xcontrib/ntp/missing130
-rwxr-xr-xcontrib/ntp/mkinstalldirs20
-rw-r--r--contrib/ntp/ntpd/Makefile.am29
-rw-r--r--contrib/ntp/ntpd/Makefile.in629
-rw-r--r--contrib/ntp/ntpd/map_vme.c2
-rw-r--r--contrib/ntp/ntpd/ntp_control.c3
-rw-r--r--contrib/ntp/ntpd/ntp_intres.c2
-rw-r--r--contrib/ntp/ntpd/ntp_io.c46
-rw-r--r--contrib/ntp/ntpd/ntp_loopfilter.c31
-rw-r--r--contrib/ntp/ntpd/ntp_proto.c500
-rw-r--r--contrib/ntp/ntpd/ntp_refclock.c27
-rw-r--r--contrib/ntp/ntpd/ntpd.c71
-rw-r--r--contrib/ntp/ntpd/refclock_atom.c8
-rw-r--r--contrib/ntp/ntpd/refclock_chu.c720
-rw-r--r--contrib/ntp/ntpd/refclock_conf.c29
-rw-r--r--contrib/ntp/ntpd/refclock_fg.c350
-rw-r--r--contrib/ntp/ntpd/refclock_gpsvme.c51
-rw-r--r--contrib/ntp/ntpd/refclock_irig.c164
-rw-r--r--contrib/ntp/ntpd/refclock_jupiter.c11
-rw-r--r--contrib/ntp/ntpd/refclock_msfees.c36
-rw-r--r--contrib/ntp/ntpd/refclock_mx4200.c76
-rw-r--r--contrib/ntp/ntpd/refclock_nmea.c7
-rw-r--r--contrib/ntp/ntpd/refclock_oncore.c561
-rw-r--r--contrib/ntp/ntpd/refclock_palisade.c1
-rw-r--r--contrib/ntp/ntpd/refclock_parse.c284
-rw-r--r--contrib/ntp/ntpd/refclock_pcf.c215
-rw-r--r--contrib/ntp/ntpd/refclock_shm.c8
-rw-r--r--contrib/ntp/ntpd/refclock_wwv.c2754
-rw-r--r--contrib/ntp/ntpd/refclock_wwvb.c2
-rw-r--r--contrib/ntp/ntpdate/Makefile.in108
-rw-r--r--contrib/ntp/ntpdate/ntpdate.c104
-rw-r--r--contrib/ntp/ntpdc/Makefile.in96
-rw-r--r--contrib/ntp/ntpq/Makefile.in95
-rw-r--r--contrib/ntp/ntpq/ntpq.c2
-rw-r--r--contrib/ntp/ntpq/ntpq_ops.c20
-rw-r--r--contrib/ntp/ntptrace/Makefile.in87
-rw-r--r--contrib/ntp/ntptrace/ntptrace.c1
-rw-r--r--contrib/ntp/parseutil/Makefile.in101
-rw-r--r--contrib/ntp/scripts/Makefile.in14
-rw-r--r--contrib/ntp/scripts/README7
-rwxr-xr-xcontrib/ntp/scripts/freq_adj97
-rwxr-xr-xcontrib/ntp/scripts/ntp-status45
-rwxr-xr-xcontrib/ntp/scripts/ntpsweep301
-rwxr-xr-xcontrib/ntp/scripts/plot_summary.pl36
-rw-r--r--contrib/ntp/scripts/summary.pl74
-rw-r--r--contrib/ntp/util/Makefile.in132
119 files changed, 13310 insertions, 5245 deletions
diff --git a/contrib/ntp/COPYRIGHT b/contrib/ntp/COPYRIGHT
index 6507db7bb374..17504188d668 100644
--- a/contrib/ntp/COPYRIGHT
+++ b/contrib/ntp/COPYRIGHT
@@ -4,14 +4,15 @@ This file is automatically generated from html/copyright.htm
[INLINE] "Clone me," says Dolly sheepishly
_________________________________________________________________
-
+
The following copyright notice applies to all files collectively
called the Network Time Protocol Version 4 Distribution. Unless
specifically declared otherwise in an individual file, this notice
applies as if the text was explicitly included in the file.
+
/***********************************************************************
* *
- * Copyright (c) David L. Mills 1992-1999 *
+ * Copyright (c) David L. Mills 1992-2000 *
* *
* Permission to use, copy, modify, and distribute this software and *
* its documentation for any purpose and without fee is hereby *
@@ -24,7 +25,9 @@ This file is automatically generated from html/copyright.htm
* representations about the suitability this software for any *
* purpose. It is provided "as is" without express or implied *
* warranty. *
- **********************************************************************/
+ * *
+ ***********************************************************************
+ */
The following individuals contributed in part to the Network Time
Protocol Distribution Version 4 and are acknowledged as authors of
@@ -33,119 +36,128 @@ This file is automatically generated from html/copyright.htm
controller
2. [2]Viraj Bais <vbais@mailman1.intel.com> and [3]Clayton Kirkwood
<kirkwood@striderfm.intel.com> port to WindowsNT 3.5
- 3. [4]Karl Berry <karl@owl.HQ.ileaf.com> syslog to file option
- 4. [5]Piete Brooks <Piete.Brooks@cl.cam.ac.uk> MSF clock driver,
+ 3. [4]Michael Barone <michael,barone@lmco.com> GPSVME fixes
+ 4. [5]Karl Berry <karl@owl.HQ.ileaf.com> syslog to file option
+ 5. [6]Greg Brackley <greg.brackley@bigfoot.com> Major rework of WINNT
+ port. Clean up recvbuf and iosignal code into separate modules.
+ 6. [7]Piete Brooks <Piete.Brooks@cl.cam.ac.uk> MSF clock driver,
Trimble PARSE support
- 5. [6]Steve Clift <clift@ml.csiro.au> OMEGA clock driver
- 6. [7]Casey Crellin <casey@csc.co.za> vxWorks (Tornado) port and help
+ 7. [8]Steve Clift <clift@ml.csiro.au> OMEGA clock driver
+ 8. [9]Casey Crellin <casey@csc.co.za> vxWorks (Tornado) port and help
with target configuration
- 7. [8]Torsten Duwe <duwe@immd4.informatik.uni-erlangen.de> Linux port
- 8. [9]John A. Dundas III <dundas@salt.jpl.nasa.gov> Apple A/UX port
- 9. [10]Dennis Ferguson <dennis@mrbill.canet.ca> foundation code for
+ 9. [10]Sven Dietrich <sven_dietrich@trimble.com> Palisade reference
+ clock driver, NT adj. residuals, integrated Greg's Winnt port.
+ 10. [11]John A. Dundas III <dundas@salt.jpl.nasa.gov> Apple A/UX port
+ 11. [12]Torsten Duwe <duwe@immd4.informatik.uni-erlangen.de> Linux
+ port
+ 12. [13]Dennis Ferguson <dennis@mrbill.canet.ca> foundation code for
NTP Version 2 as specified in RFC-1119
- 10. [11]Glenn Hollinger <glenn@herald.usask.ca> GOES clock driver
- 11. [12]Mike Iglesias <iglesias@uci.edu> DEC Alpha port
- 12. [13]Jim Jagielski <jim@jagubox.gsfc.nasa.gov> A/UX port
- 13. [14]Jeff Johnson <jbj@chatham.usdesign.com> massive prototyping
+ 13. [14]Glenn Hollinger <glenn@herald.usask.ca> GOES clock driver
+ 14. [15]Mike Iglesias <iglesias@uci.edu> DEC Alpha port
+ 15. [16]Jim Jagielski <jim@jagubox.gsfc.nasa.gov> A/UX port
+ 16. [17]Jeff Johnson <jbj@chatham.usdesign.com> massive prototyping
overhaul
- 14. [15]William L. Jones <jones@hermes.chpc.utexas.edu> RS/6000 AIX
+ 17. [18]William L. Jones <jones@hermes.chpc.utexas.edu> RS/6000 AIX
modifications, HPUX modifications
- 15. [16]Dave Katz <dkatz@cisco.com> RS/6000 AIX port
- 16. [17]Craig Leres <leres@ee.lbl.gov> 4.4BSD port, ppsclock,
+ 18. [19]Hans Lambermont <Hans.Lambermont@nl.origin-it.com> or
+ [20]<H.Lambermont@chello.nl> ntpsweep
+ 19. [21]Frank Kardel [22]<Frank.Kardel@informatik.uni-erlangen.de>
+ PARSE <GENERIC> driver (14 reference clocks), STREAMS modules for
+ PARSE, support scripts, syslog cleanup
+ 20. [23]Dave Katz <dkatz@cisco.com> RS/6000 AIX port
+ 21. [24]Craig Leres <leres@ee.lbl.gov> 4.4BSD port, ppsclock,
Maganavox GPS clock driver
- 17. [18]George Lindholm <lindholm@ucs.ubc.ca> SunOS 5.1 port
- 18. [19]Louis A. Mamakos <louie@ni.umd.edu> MD5-based authentication
- 19. [20]Derek Mulcahy <derek@toybox.demon.co.uk> and [21]Damon
- Hart-Davis <d@hd.org> ARCRON MSF clock driver
- 20. [22]Lars H. Mathiesen <thorinn@diku.dk> adaptation of foundation
+ 22. [25]George Lindholm <lindholm@ucs.ubc.ca> SunOS 5.1 port
+ 23. [26]Louis A. Mamakos <louie@ni.umd.edu> MD5-based authentication
+ 24. [27]Lars H. Mathiesen <thorinn@diku.dk> adaptation of foundation
code for Version 3 as specified in RFC-1305
- 21. [23]David L. Mills <mills@udel.edu> Version 4 foundation,
- Spectractom WWVB, Austron GPS, Arbiter GPS, CHU, Heath, ATOM,
- ACTS, KSI/Odetics, IRIG clock drivers; PPS support; precision
- kernel; NTPv4 changes
- 22. [24]Wolfgang Moeller <moeller@gwdgv1.dnet.gwdg.de> VMS port
- 23. [25]Jeffrey Mogul <mogul@pa.dec.com> ntptrace utility
- 24. [26]Tom Moore <tmoore@fievel.daytonoh.ncr.com> i386 svr4 port
- 25. [27]Rainer Pruy <Rainer.Pruy@informatik.uni-erlangen.de>
+ 25. [28]David L. Mills <mills@udel.edu> Version 4 foundation: clock
+ discipline, authentication, precision kernel; clock drivers:
+ Spectracom, Austron, Arbiter, Heath, ATOM, ACTS, KSI/Odetics;
+ audio clock drivers: CHU, WWV/H, IRIG
+ 26. [29]Wolfgang Moeller <moeller@gwdgv1.dnet.gwdg.de> VMS port
+ 27. [30]Jeffrey Mogul <mogul@pa.dec.com> ntptrace utility
+ 28. [31]Tom Moore <tmoore@fievel.daytonoh.ncr.com> i386 svr4 port
+ 29. [32]Derek Mulcahy <derek@toybox.demon.co.uk> and [33]Damon
+ Hart-Davis <d@hd.org> ARCRON MSF clock driver
+ 30. [34]Rainer Pruy <Rainer.Pruy@informatik.uni-erlangen.de>
monitoring/trap scripts, statistics file handling
- 26. [28]Dirce Richards <dirce@zk3.dec.com> Digital UNIX V4.0 port
- 27. [29]Nick Sayer <mrapple@quack.kfu.com> SunOS streams modules
- 28. [30]Frank Kardel [31]<Frank.Kardel@informatik.uni-erlangen.de>
- PARSE <GENERIC> driver (14 reference clocks), STREAMS modules for
- PARSE, support scripts, syslog cleanup
- 29. [32]Ray Schnitzler <schnitz@unipress.com> Unixware1 port
- 30. [33]Michael Shields <shields@tembel.org> USNO clock driver
- 31. [34]Jeff Steinman <jss@pebbles.jpl.nasa.gov> Datum PTS clock
+ 31. [35]Dirce Richards <dirce@zk3.dec.com> Digital UNIX V4.0 port
+ 32. [36]Wilfredo Sánchez <wsanchez@apple.com> added support for
+ NetInfo
+ 33. [37]Nick Sayer <mrapple@quack.kfu.com> SunOS streams modules
+ 34. [38]Jack Sasportas <jack@innovativeinternet.com> Saved a Lot of
+ space on the stuff in the html/pic/ subdirectory
+ 35. [39]Ray Schnitzler <schnitz@unipress.com> Unixware1 port
+ 36. [40]Michael Shields <shields@tembel.org> USNO clock driver
+ 37. [41]Jeff Steinman <jss@pebbles.jpl.nasa.gov> Datum PTS clock
driver
- 32. [35]Harlan Stenn <harlan@pfcs.com> GNU automake/autoconfigure
- makeover
- 33. [36]Kenneth Stone <ken@sdd.hp.com> HP-UX port
- 34. [37]Ajit Thyagarajan <ajit@ee.udel.edu>IP multicast support
- 35. [38]Tomoaki TSURUOKA <tsuruoka@nc.fukuoka-u.ac.jp>TRAK clock
+ 38. [42]Harlan Stenn <harlan@pfcs.com> GNU automake/autoconfigure
+ makeover, various other bits (see the ChangeLog)
+ 39. [43]Kenneth Stone <ken@sdd.hp.com> HP-UX port
+ 40. [44]Ajit Thyagarajan <ajit@ee.udel.edu>IP multicast/anycast
+ support
+ 41. [45]Tomoaki TSURUOKA <tsuruoka@nc.fukuoka-u.ac.jp>TRAK clock
driver
- 36. [39]Paul A Vixie <vixie@vix.com> TrueTime GPS driver, generic
+ 42. [46]Paul A Vixie <vixie@vix.com> TrueTime GPS driver, generic
TrueTime clock driver
- 37. [40]Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> corrected and
+ 43. [47]Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> corrected and
validated HTML documents according to the HTML DTD
- 38. [41]Greg Brackley <greg.brackley@bigfoot.com> Major rework of
- WINNT port. Clean up recvbuf and iosignal code into separate
- modules.
- 39. [42]Sven Dietrich <sven_dietrich@trimble.com> Palisade reference
- clock driver, NT adj. residuals, integrated Greg's Winnt port.
- 40. [43]Wilfredo Sánchez <wsanchez@apple.com> added support for
- NetInfo
-
_________________________________________________________________
-
- [44][LINK]
+
+ [48][LINK]
- [45]David L. Mills <mills@udel.edu>
+ [49]David L. Mills <mills@udel.edu>
References
- 1. mailto: marka@syd.dms.csiro.au
- 2. mailto: vbais@mailman1.intel.co
- 3. mailto: kirkwood@striderfm.intel.com
- 4. mailto: karl@owl.HQ.ileaf.com
- 5. mailto: Piete.Brooks@cl.cam.ac.uk
- 6. mailto: clift@ml.csiro.au
- 7. mailto:casey@csc.co.za
- 8. mailto: duwe@immd4.informatik.uni-erlangen.de
- 9. mailto: dundas@salt.jpl.nasa.gov
- 10. mailto: dennis@mrbill.canet.ca
- 11. mailto: glenn@herald.usask.ca
- 12. mailto: iglesias@uci.edu
- 13. mailto: jagubox.gsfc.nasa.gov
- 14. mailto: jbj@chatham.usdesign.com
- 15. mailto: jones@hermes.chpc.utexas.edu
- 16. mailto: dkatz@cisco.com
- 17. mailto: leres@ee.lbl.gov
- 18. mailto: lindholm@ucs.ubc.ca
- 19. mailto: louie@ni.umd.edu
- 20. mailto: derek@toybox.demon.co.uk
- 21. mailto: d@hd.org
- 22. mailto: thorinn@diku.dk
- 23. mailto: mills@udel.edu
- 24. mailto: moeller@gwdgv1.dnet.gwdg.de
- 25. mailto: mogul@pa.dec.com
- 26. mailto: tmoore@fievel.daytonoh.ncr.com
- 27. mailto: Rainer.Pruy@informatik.uni-erlangen.de
- 28. mailto: dirce@zk3.dec.com
- 29. mailto: mrapple@quack.kfu.com
- 30. http://www4.informatik.uni-erlangen.de/~kardel
- 31. mailto: Frank.Kardel@informatik.uni-erlangen.de
- 32. mailto: schnitz@unipress.com
- 33. mailto: shields@tembel.org
- 34. mailto: pebbles.jpl.nasa.gov
- 35. mailto: harlan@pfcs.com
- 36. mailto: ken@sdd.hp.com
- 37. mailto: ajit@ee.udel.edu
- 38. mailto: tsuruoka@nc.fukuoka-u.ac.jp
- 39. mailto: vixie@vix.com
- 40. mailto: Ulrich.Windl@rz.uni-regensburg.de
- 41. mailto: greg.brackley@bigfoot.com
- 42. mailto: Sven_Dietrich@trimble.COM
- 43. mailto: wsanchez@apple.com
- 44. file://localhost/backroom/ntp4/html/index.htm
- 45. mailto:mills@udel.edu
+ 1. mailto:marka@syd.dms.csiro.au
+ 2. mailto:vbais@mailman1.intel.co
+ 3. mailto:kirkwood@striderfm.intel.com
+ 4. mailto:michael.barone@lmco.com
+ 5. mailto:karl@owl.HQ.ileaf.com
+ 6. mailto:greg.brackley@bigfoot.com
+ 7. mailto:Piete.Brooks@cl.cam.ac.uk
+ 8. mailto:clift@ml.csiro.au
+ 9. mailto:casey@csc.co.za
+ 10. mailto:Sven_Dietrich@trimble.COM
+ 11. mailto:dundas@salt.jpl.nasa.gov
+ 12. mailto:duwe@immd4.informatik.uni-erlangen.de
+ 13. mailto:dennis@mrbill.canet.ca
+ 14. mailto:glenn@herald.usask.ca
+ 15. mailto:iglesias@uci.edu
+ 16. mailto:jagubox.gsfc.nasa.gov
+ 17. mailto:jbj@chatham.usdesign.com
+ 18. mailto:jones@hermes.chpc.utexas.edu
+ 19. mailto:Hans.Lambermont@nl.origin-it.com
+ 20. mailto:H.Lambermont@chello.nl
+ 21. http://www4.informatik.uni-erlangen.de/~kardel
+ 22. mailto:Frank.Kardel@informatik.uni-erlangen.de
+ 23. mailto:dkatz@cisco.com
+ 24. mailto:leres@ee.lbl.gov
+ 25. mailto:lindholm@ucs.ubc.ca
+ 26. mailto:louie@ni.umd.edu
+ 27. mailto:thorinn@diku.dk
+ 28. mailto:mills@udel.edu
+ 29. mailto:moeller@gwdgv1.dnet.gwdg.de
+ 30. mailto:mogul@pa.dec.com
+ 31. mailto:tmoore@fievel.daytonoh.ncr.com
+ 32. mailto:derek@toybox.demon.co.uk
+ 33. mailto:d@hd.org
+ 34. mailto:Rainer.Pruy@informatik.uni-erlangen.de
+ 35. mailto:dirce@zk3.dec.com
+ 36. mailto:wsanchez@apple.com
+ 37. mailto:mrapple@quack.kfu.com
+ 38. mailto:jack@innovativeinternet.com
+ 39. mailto:schnitz@unipress.com
+ 40. mailto:shields@tembel.org
+ 41. mailto:pebbles.jpl.nasa.gov
+ 42. mailto:harlan@pfcs.com
+ 43. mailto:ken@sdd.hp.com
+ 44. mailto:ajit@ee.udel.edu
+ 45. mailto:tsuruoka@nc.fukuoka-u.ac.jp
+ 46. mailto:vixie@vix.com
+ 47. mailto:Ulrich.Windl@rz.uni-regensburg.de
+ 48. file://localhost/backroom/ntp4+/html/index.htm
+ 49. mailto:mills@udel.edu
diff --git a/contrib/ntp/ChangeLog b/contrib/ntp/ChangeLog
index a7abc1458223..1c498a6f014e 100644
--- a/contrib/ntp/ChangeLog
+++ b/contrib/ntp/ChangeLog
@@ -1,9 +1,627 @@
+2000-01-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99b
+
+2000-01-18 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_chu.c: NCHAN is used with generic ICOM.
+
+ * ntpd/refclock_wwv.c: Use new auido stuff
+ * ntpd/refclock_irig.c: Use new audio stuff
+ * ntpd/refclock_chu.c: Use new audio stuff
+ * ntpd/ntp_proto.c: Clean up
+ * ntpd/ntp_loopfilter.c (local_clock): Clean up error message
+ * include/icom.h: Number of arguments changed
+ * libntp/Makefile.am (libntp_a_SOURCES): Added audio.c
+ * libntp/audio.c: New file
+ * include/Makefile.am (noinst_HEADERS): audio.h added
+ * include/audio.h: New file
+ From: Dave Mills <mills@udel.edu>
+
+ * scripts/freq_adj: Added. FreeBSD frequency adjustment script.
+
+ * configure.in: Do a better job on my oncore_ok check for SCO.
+
+2000-01-15 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99a
+
+ * scripts/ntpsweep: New version
+ * html/copyright.htm: Added Hans Lambermont
+ From: Hans Lambermont <Hans.Lambermont@nl.origin-it.com>
+
+2000-01-14 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_oncore.c (oncore_start): Only dance with the
+ pps_device if it's there.
+ From: reg@dwf.com
+
+ * configure.in: ONCORE is OK if ac_cv_hdr_def_tiocdcdtimestamp=yes
+
+ * build: Just overwrite the log file each time; sometimes NFS goes
+ a little goofy.
+
+ * ntpd/refclock_fg.c: Syntax/punctuation cleanup
+
+2000-01-13 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * scripts/ntpsweep: New version
+ From: Hans Lambermont <Hans.Lambermont@nl.origin-it.com>
+
+ * ntpd/refclock_fg.c: New version
+ * html/driver37.htm: New version
+ From: Dmitry Smirnov <das@online.nsk.su>
+
+2000-01-12 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * README.des: Cleanup
+
+2000-01-12 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.99
+
+ * html/driver36.htm: Cleanup
+ * html/monopt.htm: Ditto
+ From: Dave Mills <mills@udel.edu>
+
+ * ntpd/ntp_intres.c (ntp_intres): Put "NTP_INTRES running" at a
+ higher debug level
+
+2000-01-11 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwv.c: More improvements
+ From: Dave Mills <mills@udel.edu>
+
+2000-01-10 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwv.c: Bugfixes/improvements
+ From: Dave Mills <mills@udel.edu>
+
+ * configure.in: Get the quoting right on the sys_errlist check.
+ From documentation by: Akim Demaille <akim@epita.fr>
+
+2000-01-08 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: <netinet/ip.h> cannot be detected...
+ * ntpd/ntp_io.h: ...but every OS has it
+ * ntpd/refclock_oncore.c: Lint removal
+ * ntpq/ntpq_ops.c: Lint removal
+ * ntpq/refclock_chu.c: chu_major() is not an audio routine (?), lint
+ * libntp/icom.c: AIX doesn't have <sys/termios.h>
+ From: Marc.Brett@westgeo.com
+
+ * ntpd/refclock_chu.c: NetBSD needs sys/ioctl.h
+ (chu_debug): NetBSED-specific debug output.
+ From: Frederick Bruckman <fb@enteract.com>
+
+2000-01-06 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98m
+ I skipped `l' - it looks like a `1'.
+
+ * html/driver7.htm: Doc update
+ * html/driver36.htm: Ditto
+ * html/audio.htm: Ditto
+
+ * ntpd/refclock_wwv.c: Dvae snuck another fix/change in on me.
+
+ * configure.in: 4.0.98k
+
+ * ntpd/refclock_chu.c (chu_start): Call icom_init with the speed
+ * ntpd/refclock_wwv.c (wwv_start): Ditto, plus other improvements.
+ * libntp/icom.c (icom_init): Add speed parameter
+ * include/icom.h: Update declaration
+ From: Dave Mills <mills@udel.edu>
+
+ * include/Makefile.am (noinst_HEADERS): Added icom.h
+ From: Frederick Bruckman <fb@enteract.com>
+
+2000-01-05 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98j
+
+ * ntpd/refclock_wwv.c (timecode): Make definition == declaration
+ (wwv_newchan): Ditto
+ (wwv_corr4): Dave fixed the declaration.
+
+ * flock-build: Add rackety to the flock - it runs SunOS 4.1.3/cc
+
+ * ntpd/refclock_wwv.c: Undo that declaration cleanup for now...
+
+ * ntpd/ntp_io.c (open_socket): TOS support
+ From: Marc.Brett@westgeo.com
+
+2000-01-04 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwv.c: Declaration cleanup
+ * ntpd/refclock_fg.c (fg_receive): Not all sprintf's are created
+ equal...
+ From: Marc.Brett@westgeo.com
+
+ * ntpd/refclock_wwv.c: Dave Cleaned and Improved things.
+ * ntpd/ntp_loopfilter.c (local_clock): Dave fixed something.
+
+ * ntpd/refclock_wwv.c: Rename max to p_max or s_max as appropriate
+ to avoid native SunOS compiler collision.
+ (wwv_epoch): Make declaration == definition
+ (wwv_rsec): Ditto
+ (wwv_newchan): Ditto
+ (wwv_qsy): Ditto
+ (timecode): Ditto
+
+ * ntpd/refclock_oncore.c (oncore_init_shmem): Use a cast to widen
+ mmap's NIL offset.
+
+ * ntpd/refclock_chu.c (chu_rf): Make declaration == definition.
+ Rename min/max to es_min/es_max to avoid native SunOS compiler
+ collision.
+ (chu_uart): Make declaration == definition.
+
+ * libntp/icom.c (sndpkt): Make declaration and definition equivalent.
+ (doublefreq): Ditto.
+
+ * ntpd/refclock_oncore.c (MAP_FAILED): Some systems do not #define
+ this.
+
+ * ntpd/refclock_wwv.c:
+ * ntpd/refclock_chu.c:
+ * libntp/icom.c:
+ * libntp/Makefile.am:
+ * include/icom.h:
+ * html/driver7.htm:
+ * html/driver36.htm:
+ Support for ICOM. The WWV/H driver, by the way, is getting truly
+ awesome. The CHU autotune function works okay as it is. I'd like
+ to find somebody else to test the audio drivers just to make sure
+ I haven't done something stupid. There is a new define ICOM
+ intended for the driver autotune function; however, I crafted the
+ thing in much the same way as the refclock_atom.c thing - it tries
+ to open /dev/icom and, if that fails, goes quietly to sleep.
+ From: Dave Mills <mills@udel.edu>
+
+2000-01-03 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_oncore.c (oncore_read_config): Patches and cleanup
+ From: Poul-Henning Kamp <phk@critter.freebsd.dk>
+ more isascii() stuff from HMS.
+
+ * ntpd/refclock_fg.c (fg_receive): Cast.
+ From: Tom Smith <smith@cag.lkg.dec.com>
+
+ * ntpd/map_vme.c (map_vme): tx.access_result indicates failure on
+ < 0, not <= 0. A fix that apparently did not get brought over
+ from the ntp3 base.
+ From: Michael Barone <michael.barone@lmco.com>
+
+ * configure.in: Move the ONCORE_SHMEM_STATUS check and definition
+ here.
+
+ * ntpd/refclock_oncore.c (oncore_init_shmem): Some systems do not
+ have MAP_HASSEMAPHORE.
+
+ * ntpd/refclock_oncore.c: Drive ONCORE_SHMEM_STATUS based on
+ HAVE_SYS_MMAN_H . If this needs finer checks, do it in
+ configure.in .
+ (oncore_read_config): Add the isascii() checks; older versions of
+ Unix don't guarantee correct behavior of is*() without it.
+
+ * ntpd/refclock_oncore.c: Add proof-of-concept support for
+ delivering receiver data stream to other processes through
+ a memory-mapped file.
+ From: Poul-Henning Kamp <phk@FreeBSD.org>
+
+2000-01-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (ac_refclock_chu): Provide the CHU driver by
+ default, and by default prefer the AUDIO version. We used to
+ limit this to SunOS or Solaris; now we drive by the availability
+ of the audioio header file.
+ Select the IRIG and WWV audio drivers the same way.
+
+ * flock-build: build ignores the -l flag; lose it.
+ (BUILD_ARGS): added.
+ * build: Remove unused -l stuff (LOG variable).
+
+ * ntpd/ntp_refclock.c: HAVE_PPSAPI header cleanup
+ From: Reg Clemens <reg@dwf.com>
+
+2000-01-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in (CLOCK_WWV): Require <sys/audioio.h> or <sun/audioio.h>
+
+1999-12-29 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98i
+
+ * ntpd/refclock_gpsvme.c: Fixes
+ From: Michael Barone <michael.barone@lmco.com>
+ Patch severely hacked by HMS to "make it conform". I hope I
+ didn't break anything.
+
+ * scripts/ntpsweep: Nifty utility
+ From: Hans.Lambermont@nl.origin-it.com
+
+ * ntpd/refclock_fg.c:
+ * ntpd/refclock_conf.c:
+ * ntpd/ntp_control.c:
+ * ntpd/Makefile.am:
+ * libntp/clocktypes.c:
+ * include/ntp.h:
+ * html/refclock.htm:
+ * html/driver37.htm:
+ * configure.in:
+ * acconfig.h:
+ Forum Graphic GPS clock support
+ From: Dmitry Smirnov <das@online.nsk.su>
+
+ * configure.in: Default to compile the IRIG, CHU and WWV/H
+ drivers and compile the CHU driver for audio, not modem.
+ Requested by Dave Mills.
+
+ * html/audio.htm:
+ * html/driver36.htm:
+ * html/qth.htm:
+ Dave wrote these to go along with the changes I checked in yesterday.
+
+1999-12-28 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwv.c:
+ * ntpd/refclock_conf.c:
+ * ntpd/refclock_chu.c:
+ * ntpd/ntp_refclock.c:
+ * ntpd/ntp_loopfilter.c:
+ * html/refclock.htm:
+ * html/pps.htm:
+ * html/index.htm:
+ * html/driver7.htm:
+ * html/driver6.htm:
+ * html/copyright.htm:
+
+ I indulged an old agenda to polish up some programs originally
+ written for a DSP evaluation board. The result is a really hot
+ audio driver for the NIST WWV/WWVH time/frequency station plus a
+ makeover for the CHU audio driver. Currently, they and their IRIG
+ audio driver buddy use the SunOS/Solaris audio interface, which is
+ clean and simple. I hook the line in jack to a shortwave radio and
+ these drivers (driver 7 for CHU and driver 36 for WWV) and the
+ drivers do the rest. The WWV/H driver is really hot - I am
+ currently watching the ionosphere move from the doppler that shows
+ up on the tick modulation tracked by the program. During midday
+ when the F2 layer settles down, the program closes in on a few
+ tens of microseconds of spare jitter and wander. This watch on
+ whichever 15/20 MHz signal sounds the best. At night on 5/10 MHz
+ and even 2.5 HMz where the multipath, interference and noise are
+ much worse, the driver bangs around somewhat more.
+
+ The CHU driver makeover discovered a few broken bones after all
+ these years, but its majority decoder is back in business. For
+ various reasons to icky to reveal here, its 103-modem demodulator
+ is not quite as good as the chip, but it comes close and hey,
+ 2025/2125 FSK is just not a good idea for HF radio. This driver is
+ not nearly as sophisitcated as the WWV/H driver, but here a few
+ hundred miles south of Ottawa, it does a passably good job.
+
+ I tell you this in the hopes of getting somebody interested in
+ porting the audio interface to other machines, in particular
+ Linux, FreeBSD and anything else with a sound card. When the
+ ionosphere stays cool, the WWV/H driver is as good as anything
+ else around here and with much less jitter than a serial port. The
+ only downside is all the audio drivers chew up a modest fraction
+ of cycles for the DSP routines - a few percent on the newer
+ silicon, up to half the cycles on an old Sparc IPC. Whattheheck,
+ these old machines aren't doing anything else around here except
+ serving time, and even when sucking cycles for DSP they still mind
+ the PPS microseconds.
+
+ The audio driver documentation had a makeover, too.
+ From: Dave Mills <mills@udel.edu>
+
+1999-12-20 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98h
+
+1999-12-19 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/syssignal.c: Small cleanup to Marc's patch.
+
+ * ntpd/ntp_refclock.c:
+ * ntpd/refclock_atom.c: Header cleanup
+ * html/driver30.htm: Cleanup and improvements.
+ From: Reg Clemens <reg@dwf.com>
+
+ * ntpd/ntp_refclock.c:
+ * ntpd/refclock_jupiter.c:
+ * ntpd/refclock_msfees.c:
+ * ntpd/refclock_mx4200.c:
+ Portability (Solaris) patches
+ * ntpd/refclock_mx4200.c:
+ Self-survey improvements, cleanup for, PPS re-activation
+ * libntp/syssignal.c:
+ Fix for "interrupted system call" (EINTR) failure of the PPS
+ ioctl(TIOCGPPSEV) call in Solaris. Not sure why it was
+ interrupted, but this works around the failure. Not sure if
+ the (now silent) interrupt affects the timing accuracy.
+ THERE IS A CHANCE THIS PART OF THE PATCH MAY ADVERSELY
+ AFFECT OTHER SYSTEMS!
+ * scripts/ntp-status: Added.
+ From: Marc.Brett@westgeo.com
+
+ * ntpdate/ntpdate.c: Deal with multiple addresses.
+ From: Jeffrey C Honig <jch@bsdi.com>
+
+ * ntpd/refclock_conf.c: Replaced macro SHM with CLOCK_SHM.
+ * ntpd/refclock_shm.c (shm_poll): Take clock time in UTC.
+ pp->day starts at 1, t->tm_yday starts at 0.
+ From: Jakob Stoklund Olesen <stoklund@taxidriver.dk>
+
+1999-12-16 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * NEWS: Updated ONCORE instructions
+ From: Kamal A Mostafa <kamal@whence.com>
+
+1999-12-13 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: 4.0.98g
+
+ * ntpd/refclock_oncore.c: Cleanup and fixes
+ From: Reg Clemens <reg@dwf.com> and Kamal A Mostafa <kamal@whence.com>
+
+1999-12-11 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwv.c: Cleanup/checkin of the current state of affairs.
+ From: Dave Mills <mills@udel.edu>
+
+ * ntpd/refclock_oncore.c: #elif conversion. I can only hope I did
+ it right.
+
+ * ntpd/refclock_oncore.c: Various patches
+ From: Reg Clemens <reg@dwf.com> and Kamal A Mostafa <kamal@whence.com>
+
+1999-12-09 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_proto.c (default_get_precision): Use the right arg type
+ to pass "sizeof freq" to sysctlbyname().
+ From: Ollivier Robert <roberto@eurocontrol.fr>
+
+ * ntpd/refclock_wwv.c: Cleanup and fixes.
+ From: Dave Mills <mills@udel.edu>
+
+1999-12-08 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/refclock_wwv.c: Cleanup and fixes
+ * ntpd/refclock_conf.c: WWV declaration cleanup.
+ From: Dave Mills <mills@udel.edu>
+
+1999-12-07 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libparse/clk_rawdcf.c (cvt_rawdcf): Buglet.
+ From: Frank Kardel <kardel@acm.org>
+
+1999-12-06 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/Makefile.am (ntpd_SOURCES): Added refclock_wwv.c
+
+ * ntpd/refclock_wwvb.c:
+ * ntpd/refclock_wwv.c:
+ * ntpd/refclock_conf.c:
+ * ntpd/refclock_chu.c:
+ * libntp/clocktypes.c:
+ * include/ntp.h: Dave cleaned some things up
+ Dave cleaned some things up (WWVB -> SPECTRACOM, CHU -> CHU_AUDIO,
+ WWV_AUDIO)
+
+ * acconfig.h: REFCLOCK_WWVB -> REFCLOCK_SPECTRACOM, added REFCLOCK_WWV
+ * configure.in: Deal with it.
+
+1999-12-05 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_refclock.c (refclock_open): More PPS cleanup
+ From: Dave Mills <mills@udel.edu>
+
+ * ntpq/ntpq.c:
+ * ntpq/ntpq_ops.c:
+ Make `ntpq -pn' independent of DNS, ad advertised.
+ From: Kamal A Mostafa <kamal@whence.com>
+
+ * ntpd/refclock_mx4200.c (mx4200_start): make missing 3rd
+ parameter a 0.
+
+1999-12-04 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpd/ntp_refclock.c (refclock_open): "flags" processing cleanup
+ (refclock_open): PPS device initialization cleanup
+ * include/ntp_refclock.h (LDISC_CHU):
+ (LDISC_PPS): Clean up comments
+ From: Dave Mills <mills@udel.edu>
+
+1999-12-03 Sven Dietrich <sven_dietrich@trimble.com>
+
+ * libntp/mexit.c: Moved WINNT port specific file to ports/winnt/libntp
+ * ports/winnt/libntp/libntp.dsp: Fix WinNT makefile for new source loc.
+
+1999-12-03 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/Makefile.am (libntp_a_SOURCES): Lose mexit.c - Sven will
+ move it to the winnt port area.
+
+1999-12-03 Sven Dietrich <sven_dietrich@trimble.com>
+
+ * libntp/systime.c: Removed adjtime hack for WINNT
+ * ports/winnt/ntpd/nt_clockstuff.c: Winnt double precision adjtime
+ * ports/winnt/inlcude/clockstuff.h: Remove no longer needed externs
+
+1999-12-02 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libparse/Makefile.in: Manually hacked to remove the
+ libparse_kernel.a.[co] cruft
+
+ * libparse/Makefile.am (k*.o): Generate these form the Makefile,
+ not from separate .c files
+
+ * html/tickadj.htm:
+ * html/notes.htm:
+ * html/hints/solaris.html:
+ Point to the new dosynctodr report.
+
+ * html/hints/solaris.xtra.S99ntpd:
+ Update. Should be rewritten to take advantage of the new -g
+ switch and perhaps a loop to wait until ntpd hits a reasonable
+ "state".
+
+ * html/hints/solaris-dosynctodr.html: New information
+ From: "John W. Sopko Jr." <sopko@cs.unc.edu>
+
+1999-12-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * libntp/authkeys.c (auth_moremem): Clear memory allocated for sk.
+ From: Hugo Mildenberger <hugo.mildenberger@topmail.de>
+
+1999-12-01 Sven Dietrich <sven_dietrich@trimble.com>
+
+ * libntp/recvbuff.c: Unused functions cleanup
+ * ntpd/ntpd.c: ProcessorAffinity, IO cleanup
+ * ports/winnt/instsrv/instsrv.c: Service name changed to NTP
+
+ NT port shouldn;t hop between CPUs. Set affinity to first processor.
+ Service name was NetworkTimeProtocol. Too long. Now NTP.
+
+1999-12-01 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * scripts/plot_summary.pl: Improved option parsing. Fixed one
+ minor Perl compatibility error.
+ * scripts/summary.pl: Official revision for NTPv4: Parse new
+ statistic file formats correctly, provide error checking for bad
+ input files, and guard against negative arguments to sqrt()
+ because of numeric effects. Use one pattern to select valid
+ statistic files. Add selectable output directory
+ (``--output-directory'') and improved option parsing. Directory
+ with statistic files (now settable also with
+ ``--input-directory'') defaults to ``/var/log/ntp''.
+ From: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+
+ * html/driver8.htm:
+ * libparse/clk_computime.c:
+ * libparse/clk_dcf7000.c:
+ * libparse/clk_hopf6021.c:
+ * libparse/clk_meinberg.c:
+ * libparse/clk_rawdcf.c:
+ * libparse/clk_rcc8000.c:
+ * libparse/clk_schmid.c:
+ * libparse/clk_trimtaip.c:
+ * libparse/clk_trimtsip.c:
+ * libparse/data_mbg.c:
+ * libparse/kclk_computime.c:
+ * libparse/kclk_dcf7000.c:
+ * libparse/kclk_hopf6021.c:
+ * libparse/kclk_meinberg.c:
+ * libparse/kclk_rawdcf.c:
+ * libparse/kclk_rcc8000.c:
+ * libparse/kclk_schmid.c:
+ * libparse/kclk_trimtaip.c:
+ * libparse/kclk_trimtsip.c:
+ * libparse/kparse.c:
+ * libparse/kparse_conf.c:
+ * libparse/parse.c:
+ * libparse/parse_conf.c:
+ * libparse/parsesolaris.c:
+ * libparse/parsestreams.c:
+ * ntpd/refclock_parse.c:
+ Mods and updates
+ From: Frank Kardel <kardel@acm.org>
+
+ * acconfig.h: PCF refclock
+ * configure.in:
+ * html/driver35.htm:
+ * html/refclock.htm:
+ * include/ntp.h:
+ * libntp/clocktypes.c:
+ * ntpd/Makefile.am:
+ * ntpd/ntp_control.c:
+ * ntpd/refclock_conf.c:
+ * ntpd/refclock_pcf.c:
+ From: Andreas Voegele <andreas.voegele@gmx.de>
+
+ * acconfig.h: DECL_STIME_1
+
+ * configure.in (iCFLAGS): Use -std1 for alpha*-dec-osf* if we are
+ using "cc".
+ Reported by: Tom Smith <smith@cag.lkg.dec.com>
+
+1999-11-30 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * include/l_stdlib.h: DECL_SYSTIME_1 --- a long *
+ * configure.in: Use it for DEC OSF[45]
+ Reported by: Tom Smith <smith@cag.lkg.dec.com>
+
+ * ntpd/refclock_parse.c: Add missing declarations
+ * ntptrace/ntptrace.c: Ditto
+ * ntpd/ntp_proto.c: Ditto
+ * ntpd/refclock_palisade.c: Ditto
+ From: Jonathan Stone <jonathan@dsg.stanford.edu>
+
+1999-11-18 Sven Dietrich <sven_dietrich@trimble.com>
+ * Win NT port updates
+ * ntpd.dsp: makefile only builds supported refclocks
+ * config.h: cleanup, undefine unsupported clock_atom
+ * win32_io, clock_NMEA: foundation for future refclock support
+ * recvbuff, transmitbuff, IOcompletionport: streamline packet handler
+ * html/hints/winnt.htm: Added up-to-date html docs for WINNT
+
+1999-11-17 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * html/copyright.htm: Credit Jack for his work.
+
+ * html/pic/*: Save a *ton* of space on the pictures.
+ From: Jack Sasportas <jack@innovativeinternet.com>
+
+1999-11-16 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in : changequote for osf[45] test.
+ Reported by: Tom Smith <smith@cag.lkg.dec.com>
+
+ * ntp_update: Ignore stuff in any A.* directory.
+
+1999-11-15 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * configure.in: Clean up header checks for sys/syssgi.h and
+ sys/select.h . Originally, we did not check for sys/select.h
+ under some versions of SCO (see xntp3-5). Somewhere in ntp4 we
+ dropped the SCO check and added the check for sys/syssgi.h,
+ exclusive of checking for sys/select.h. Marc Brett can't think of
+ a reason why we should not be checking for sys/select.h, so let's
+ look for it now.
+
+1999-11-13 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpdate/ntpdate.c: Add the ability for ntpdate to query a
+ multicast address. We use the response to the multicast address
+ to learn new servers which we then add to the peer list and query.
+ In changing this I made the list of peers a linked list.
+
+ To be complete I should detect a broadcast address and make it
+ behave the same way. But that requires a scan of the interface
+ list which is more complicated that I want to deal with...
+
+ Fix a bug, allowing ntpdate to compile if SLEWALWAYS and STEP_SLEW
+ are both defined.
+
+ From: Jeffrey C Honig <jch@bsdi.com>
+
+ * ntpd/ntp_refclock.c: sys/sio.h and SCO5_CLOCK cleanup
+ From: Kamal A Mostafa <kamal@whence.com>
+
+ * ntpd/ntp_loopfilter.c: Let -g do a "correct any" for the first
+ time adjustment.
+ From: Dave Mills <mills@udel.edu>
+
+ * configure.in: sys/sio.h needs to be checked independently.
+ Reported by: Kamal A Mostafa <kamal@whence.com>
+
1999-11-11 Harlan Stenn <stenn@whimsy.udel.edu>
* configure.in: 4.0.98f
* configure.in: DECL_PLOCK_0 and DECL_STIME_0 are for dec-osf5*, too
-
* ntpd/ntpd.c: DEC OSF cleanup (editorial comments by HMS)
From: Tom Smith <smith@cag.lkg.dec.com>
diff --git a/contrib/ntp/Makefile.in b/contrib/ntp/Makefile.in
index c8a8d7f880d3..fbb8f2fe9382 100644
--- a/contrib/ntp/Makefile.in
+++ b/contrib/ntp/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = foreign dist-tarZ #distdir=$(PACKAGE)$(VERSION)
#AUTOMAKE_OPTIONS = util/ansi2knr foreign dist-tarZ no-dependencies
@@ -141,7 +145,8 @@ CONFIG_CLEAN_FILES =
DIST_SOURCES =
DIST_COMMON = README ./stamp-h.in ChangeLog INSTALL Makefile.am \
Makefile.in NEWS TODO acconfig.h aclocal.m4 config.guess config.h.in \
-config.sub configure configure.in install-sh missing mkinstalldirs
+config.sub configure configure.in depcomp install-sh missing \
+mkinstalldirs
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -150,9 +155,9 @@ GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -253,15 +258,17 @@ tags-recursive:
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -269,12 +276,14 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LI
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP)
mostlyclean-tags:
@@ -288,50 +297,69 @@ maintainer-clean-tags:
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
+
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
- -rm -rf $(distdir)
+ -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
- dc_install_base=`cd $(distdir)/=inst && pwd`; \
- cd $(distdir)/=build \
+ chmod a-w $(distdir)
+ dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \
+ && cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) dist
- -rm -rf $(distdir)
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && test `find $$dc_install_base -type f -print | wc -l` -le 1 \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && $(MAKE) $(AM_MAKEFLAGS) distclean \
+ && rm -f $(distdir).tar.gz \
+ && test `find . -type f -print | wc -l` -eq 0
+ -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
@banner="$(distdir).tar.gz is ready for distribution"; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
echo "$$dashes"
dist: distdir
- -chmod -R a+r $(distdir)
- $(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
- -rm -rf $(distdir)
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
+ -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
dist-tarZ: distdir
- -chmod -R a+r $(distdir)
- $(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | compress -c > $(distdir).tar.Z
- -rm -rf $(distdir)
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+ $(AMTAR) chof - $(distdir) | compress -c > $(distdir).tar.Z
+ -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
dist-all: distdir
- -chmod -R a+r $(distdir)
- $(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
- $(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | compress -c > $(distdir).tar.Z
- -rm -rf $(distdir)
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
+ $(AMTAR) chof - $(distdir) | compress -c > $(distdir).tar.Z
+ -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
distdir: $(DISTFILES)
- -rm -rf $(distdir)
+ -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
mkdir $(distdir)
- -chmod 777 $(distdir)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
@@ -343,7 +371,6 @@ distdir: $(DISTFILES)
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
- chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
@@ -388,6 +415,7 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
+ -rm -f Makefile.in
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
diff --git a/contrib/ntp/NEWS b/contrib/ntp/NEWS
index 8fee9b0adb7d..4cafb97ea9f3 100644
--- a/contrib/ntp/NEWS
+++ b/contrib/ntp/NEWS
@@ -1,3 +1,18 @@
+* algorithmic improvements, bugfixes
+* Solaris dosynctodr info update
+* html/pic/* is *lots* smaller
+* New drivers: Forum Graphic GPS, WWV/H
+* Rewrite of the audio drivers
+* Driver updates: CHU, DCF, GPS/VME, Oncore, PCF, Ulink, WWVB, burst
+ If you use the ONCORE driver with a HARDPPS kernel module,
+ you *must* have a properly specified:
+ pps <filename> [assert/clear] [hardpps]
+ line in the /etc/ntp.conf file.
+* PARSE cleanup
+* PPS cleanup
+* ntpd, ntpq, ntpdate cleanup and fixes
+* NT port improvements
+* AIX, BSDI, DEC OSF, FreeBSD, NetBSD, Reliant, SCO, Solaris port improvements
(4.0.98)
* Solaris kernel FLL bug is fixed in 106541-07
* Bug/lint cleanup
diff --git a/contrib/ntp/README.des b/contrib/ntp/README.des
index 072d72e85950..8fa0ff855200 100644
--- a/contrib/ntp/README.des
+++ b/contrib/ntp/README.des
@@ -8,6 +8,7 @@ If you *need* DES support:
- first see if you can simply "want" DES support instead
- Get RSAREF or RSAEURO (or a reasonable facsimile thereof)
- - Unpack it in the top-level source directory of the NTP distribution
+ in a directory named rsaref2
(You should see directories like ports, rsaref2, scripts)
When you run configure, the Right Thing will happen.
diff --git a/contrib/ntp/acconfig.h b/contrib/ntp/acconfig.h
index 82051d95219e..a46ca673a0ba 100644
--- a/contrib/ntp/acconfig.h
+++ b/contrib/ntp/acconfig.h
@@ -25,6 +25,9 @@
/* Audio CHU? */
#undef AUDIO_CHU
+/* PARSE kernel PLL PPS support */
+#undef PPS_SYNC
+
/* ACTS modem service */
#undef CLOCK_ACTS
@@ -46,48 +49,33 @@
/* Datum/Bancomm bc635/VME interface */
#undef CLOCK_BANC
-/* ELV/DCF7000 clock */
-#undef CLOCK_DCF7000
-
-/* HOPF 6021 clock */
-#undef CLOCK_HOPF6021
-
-/* Meinberg clocks */
-#undef CLOCK_MEINBERG
-
-/* DCF77 raw time code */
-#undef CLOCK_RAWDCF
-
-/* RCC 8000 clock */
-#undef CLOCK_RCC8000
-
-/* Schmid DCF77 clock */
-#undef CLOCK_SCHMID
-
-/* Trimble GPS receiver/TAIP protocol */
-#undef CLOCK_TRIMTAIP
-
-/* Trimble GPS receiver/TSIP protocol */
-#undef CLOCK_TRIMTSIP
-
-/* WHARTON 400A Series protocol */
-#undef CLOCK_WHARTON_400A
-
-/* VARITEXT protocol */
-#undef CLOCK_VARITEXT
-
/* Diems Computime Radio Clock */
#undef CLOCK_COMPUTIME
+/* Chronolog K-series WWVB receiver */
+#undef CLOCK_CHRONOLOG
+
/* Datum Programmable Time System */
#undef CLOCK_DATUM
+/* ELV/DCF7000 clock */
+#undef CLOCK_DCF7000
+
+/* Dumb generic hh:mm:ss local clock */
+#undef CLOCK_DUMBCLOCK
+
+/* Forum Graphic GPS datating station driver */
+#undef CLOCK_FG
+
/* TrueTime GPS receiver/VME interface */
#undef CLOCK_GPSVME
/* Heath GC-1000 WWV/WWVH receiver */
#undef CLOCK_HEATH
+/* HOPF 6021 clock */
+#undef CLOCK_HOPF6021
+
/* HP 58503A GPS receiver */
#undef CLOCK_HPGPS
@@ -103,6 +91,9 @@
/* local clock reference */
#undef CLOCK_LOCAL
+/* Meinberg clocks */
+#undef CLOCK_MEINBERG
+
/* EES M201 MSF receiver */
#undef CLOCK_MSFEES
@@ -112,14 +103,17 @@
/* NMEA GPS receiver */
#undef CLOCK_NMEA
+/* Motorola UT Oncore GPS */
+#undef CLOCK_ONCORE
+
/* Palisade clock */
#undef CLOCK_PALISADE
/* PARSE driver interface */
#undef CLOCK_PARSE
-/* PARSE kernel PLL PPS support */
-#undef PPS_SYNC
+/* Conrad parallel port radio clock */
+#undef CLOCK_PCF
/* PCL 720 clock support */
#undef CLOCK_PPS720
@@ -130,11 +124,20 @@
/* PTB modem service */
#undef CLOCK_PTBACTS
+/* DCF77 raw time code */
+#undef CLOCK_RAWDCF
+
+/* RCC 8000 clock */
+#undef CLOCK_RCC8000
+
+/* Schmid DCF77 clock */
+#undef CLOCK_SCHMID
+
/* clock thru shared memory */
#undef CLOCK_SHM
-/* Motorola UT Oncore GPS */
-#undef CLOCK_ONCORE
+/* Spectracom 8170/Netclock/2 WWVB receiver */
+#undef CLOCK_SPECTRACOM
/* KSI/Odetics TPRO/S GPS receiver/IRIG interface */
#undef CLOCK_TPRO
@@ -142,23 +145,29 @@
/* TRAK 8810 GPS receiver */
#undef CLOCK_TRAK
+/* Trimble GPS receiver/TAIP protocol */
+#undef CLOCK_TRIMTAIP
+
+/* Trimble GPS receiver/TSIP protocol */
+#undef CLOCK_TRIMTSIP
+
/* Kinemetrics/TrueTime receivers */
#undef CLOCK_TRUETIME
+/* Ultralink M320 WWVB receiver */
+#undef CLOCK_ULINK
+
/* USNO modem service */
#undef CLOCK_USNO
-/* Spectracom 8170/Netclock/2 WWVB receiver */
-#undef CLOCK_WWVB
-
-/* Ultralink M320 WWVB receiver */
-#undef CLOCK_ULINK
+/* WHARTON 400A Series protocol */
+#undef CLOCK_WHARTON_400A
-/* Chronolog K-series WWVB receiver */
-#undef CLOCK_CHRONOLOG
+/* WWV audio driver */
+#undef CLOCK_WWV
-/* Dumb generic hh:mm:ss local clock */
-#undef CLOCK_DUMBCLOCK
+/* VARITEXT protocol */
+#undef CLOCK_VARITEXT
/* define if we need to declare int errno; */
#undef DECL_ERRNO
@@ -319,6 +328,10 @@
/* Might nlist() values require an extra level of indirection (AIX)? */
#undef NLIST_EXTRA_INDIRECTION
+/* Other needed NLIST stuff */
+#undef NLIST_STRUCT
+#undef NLIST_NAME_UNION
+
/* Should we recommend a minimum value for tickadj? */
#undef MIN_REC_TICKADJ
@@ -370,6 +383,9 @@
/* Do we need to #define _SVID3 when we #include <termios.h>? */
#undef TERMIOS_NEEDS__SVID3
+/* Do we have support for SHMEM_STATUS? */
+#undef ONCORE_SHMEM_STATUS
+
/***/
/* Which way should we declare... */
@@ -437,6 +453,7 @@
/* stime()? */
#undef DECL_STIME_0
+#undef DECL_STIME_1
/* strtol()? */
#undef DECL_STRTOL_0
diff --git a/contrib/ntp/aclocal.m4 b/contrib/ntp/aclocal.m4
index 4c96f8238645..981fd7243ead 100644
--- a/contrib/ntp/aclocal.m4
+++ b/contrib/ntp/aclocal.m4
@@ -1,4 +1,4 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4
+dnl aclocal.m4 generated automatically by aclocal 1.4a
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
@@ -51,7 +51,8 @@ AC_SUBST(PACKAGE)
VERSION=[$2]
AC_SUBST(VERSION)
dnl test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+if test "`CDPATH=: && cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
@@ -59,27 +60,24 @@ 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.
-missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
-AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
-AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
-AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
-dnl We check for tar when the user configures the end package.
-dnl This is sad, since we only need this for "dist". However,
-dnl there's no other good way to do it. We prefer GNU tar if
-dnl we can find it. If we can't find a tar, it doesn't really matter.
-AC_CHECK_PROGS(AMTAR, gnutar gtar tar)
-AMTARFLAGS=
-if test -n "$AMTAR"; then
- if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
- dnl We have GNU tar.
- AMTARFLAGS=o
- fi
-fi
-AC_SUBST(AMTARFLAGS)
-AC_REQUIRE([AC_PROG_MAKE_SET])])
+AM_MISSING_PROG(ACLOCAL, aclocal)
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake)
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG(AMTAR, tar)
+AM_MISSING_INSTALL_SH
+dnl We need awk for the "check" target. The system "awk" is bad on
+dnl some platforms.
+AC_REQUIRE([AC_PROG_AWK])
+AC_REQUIRE([AC_PROG_MAKE_SET])
+AC_REQUIRE([AM_DEP_TRACK])
+AC_REQUIRE([AM_SET_DEPDIR])
+ifdef([AC_PROVIDE_AC_PROG_CC], [AM_DEPENDENCIES(CC)], [
+ define([AC_PROG_CC], defn([AC_PROG_CC])[AM_DEPENDENCIES(CC)])])
+ifdef([AC_PROVIDE_AC_PROG_CXX], [AM_DEPENDENCIES(CXX)], [
+ define([AC_PROG_CXX], defn([AC_PROG_CXX])[AM_DEPENDENCIES(CXX)])])
+])
#
# Check to make sure that the build environment is sane.
@@ -124,21 +122,191 @@ fi
rm -f conftest*
AC_MSG_RESULT(yes)])
-dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
-dnl The program must properly implement --version.
-AC_DEFUN(AM_MISSING_PROG,
-[AC_MSG_CHECKING(for working $2)
-# 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.
-if ($2 --version) < /dev/null > /dev/null 2>&1; then
- $1=$2
- AC_MSG_RESULT(found)
+dnl AM_MISSING_PROG(NAME, PROGRAM)
+AC_DEFUN(AM_MISSING_PROG, [
+AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+dnl Like AM_MISSING_PROG, but only looks for install-sh.
+dnl AM_MISSING_INSTALL_SH()
+AC_DEFUN(AM_MISSING_INSTALL_SH, [
+AC_REQUIRE([AM_MISSING_HAS_RUN])
+if test -z "$install_sh"; then
+ install_sh="$ac_aux_dir/install-sh"
+ test -f "$install_sh" || install_sh="$ac_aux_dir/install.sh"
+ test -f "$install_sh" || install_sh="${am_missing_run}${ac_auxdir}/install-sh"
+ dnl FIXME: an evil hack: we remove the SHELL invocation from
+ dnl install_sh because automake adds it back in. Sigh.
+ install_sh="`echo $install_sh | sed -e 's/\${SHELL}//'`"
+fi
+AC_SUBST(install_sh)])
+
+dnl AM_MISSING_HAS_RUN.
+dnl Define MISSING if not defined so far and test if it supports --run.
+dnl If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN], [
+test x"${MISSING+set}" = xset || \
+ MISSING="\${SHELL} `CDPATH=: && cd $ac_aux_dir && pwd`/missing"
+dnl Use eval to expand $SHELL
+if eval "$MISSING --run :"; then
+ am_missing_run="$MISSING --run "
else
- $1="$3/missing $2"
- AC_MSG_RESULT(missing)
+ am_missing_run=
+ AC_MSG_WARN([\`missing' script is too old or missing])
fi
-AC_SUBST($1)])
+])
+
+dnl See how the compiler implements dependency checking.
+dnl Usage:
+dnl AM_DEPENDENCIES(NAME)
+dnl NAME is "CC", "CXX" or "OBJC".
+
+dnl We try a few techniques and use that to set a single cache variable.
+
+AC_DEFUN(AM_DEPENDENCIES,[
+AC_REQUIRE([AM_SET_DEPDIR])
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])
+ifelse([$1],CC,[
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_CPP])
+depcc="$CC"
+depcpp="$CPP"],[$1],CXX,[
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+depcc="$CXX"
+depcpp="$CXXCPP"],[$1],OBJC,[
+am_cv_OBJC_dependencies_compiler_type=gcc],[
+AC_REQUIRE([AC_PROG_][$1])
+depcc="$[$1]"
+depcpp=""])
+AC_MSG_CHECKING([dependency style of $depcc])
+AC_CACHE_VAL(am_cv_[$1]_dependencies_compiler_type,[
+if test -z "$AMDEP"; then
+ echo '#include "conftest.h"' > conftest.c
+ echo 'int i;' > conftest.h
+
+ am_cv_[$1]_dependencies_compiler_type=none
+ for depmode in `sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_depcomp"`; do
+ case "$depmode" in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ if depmode="$depmode" \
+ source=conftest.c object=conftest.o \
+ depfile=conftest.Po tmpdepfile=conftest.TPo \
+ $SHELL $am_depcomp $depcc -c conftest.c 2>/dev/null &&
+ grep conftest.h conftest.Po > /dev/null 2>&1; then
+ am_cv_[$1]_dependencies_compiler_type="$depmode"
+ break
+ fi
+ done
+
+ rm -f conftest.*
+else
+ am_cv_[$1]_dependencies_compiler_type=none
+fi
+])
+AC_MSG_RESULT($am_cv_[$1]_dependencies_compiler_type)
+[$1]DEPMODE="depmode=$am_cv_[$1]_dependencies_compiler_type"
+AC_SUBST([$1]DEPMODE)
+])
+
+dnl Choose a directory name for dependency files.
+dnl This macro is AC_REQUIREd in AM_DEPENDENCIES
+
+AC_DEFUN(AM_SET_DEPDIR,[
+if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
+ DEPDIR=.deps
+else
+ DEPDIR=_deps
+fi
+AC_SUBST(DEPDIR)
+])
+
+AC_DEFUN(AM_DEP_TRACK,[
+AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" = xno; then
+ AMDEP="#"
+else
+ am_depcomp="$ac_aux_dir/depcomp"
+ if test ! -f "$am_depcomp"; then
+ AMDEP="#"
+ else
+ AMDEP=
+ fi
+fi
+AC_SUBST(AMDEP)
+if test -z "$AMDEP"; then
+ AMDEPBACKSLASH='\'
+else
+ AMDEPBACKSLASH=
+fi
+pushdef([subst], defn([AC_SUBST]))
+subst(AMDEPBACKSLASH)
+popdef([subst])
+])
+
+dnl Generate code to set up dependency tracking.
+dnl This macro should only be invoked once -- use via AC_REQUIRE.
+dnl Usage:
+dnl AM_OUTPUT_DEPENDENCY_COMMANDS
+
+dnl
+dnl This code is only required when automatic dependency tracking
+dnl is enabled. FIXME. This creates each `.P' file that we will
+dnl need in order to bootstrap the dependency handling code.
+AC_DEFUN(AM_OUTPUT_DEPENDENCY_COMMANDS,[
+AC_OUTPUT_COMMANDS([
+test x"$AMDEP" != x"" ||
+for mf in $CONFIG_FILES; do
+ case "$mf" in
+ Makefile) dirpart=.;;
+ */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
+ *) continue;;
+ esac
+ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
+ $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+], [AMDEP="$AMDEP"
+ac_aux_dir="$ac_aux_dir"])])
# serial 1
diff --git a/contrib/ntp/adjtimed/Makefile.in b/contrib/ntp/adjtimed/Makefile.in
index f90fd26996f6..f223c8e0c35c 100644
--- a/contrib/ntp/adjtimed/Makefile.in
+++ b/contrib/ntp/adjtimed/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../ansi2knr #no-dependencies
@@ -130,6 +134,8 @@ DIST_COMMON = README Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/adjtimed$U.Po
SOURCES = adjtimed.c
OBJECTS = adjtimed$U.o
@@ -137,9 +143,9 @@ all: all-redirect
.SUFFIXES:
.SUFFIXES: .c .o
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps adjtimed/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu adjtimed/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -172,9 +178,6 @@ uninstall-binPROGRAMS:
rm -f $(DESTDIR)$(bindir)/$$f; \
done
-.c.o:
- $(COMPILE) -c $<
-
mostlyclean-compile:
-rm -f *.o core *.core
@@ -199,7 +202,6 @@ clean-kr:
distclean-kr:
maintainer-clean-kr:
-adjtimed$U.o:
adjtimed: $(adjtimed_OBJECTS) $(adjtimed_DEPENDENCIES)
@rm -f adjtimed
@@ -210,23 +212,27 @@ adjtimed_.o : $(ANSI2KNR)
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -243,18 +249,32 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
-adjtimed.o adjtimed.lo: adjtimed.c ../include/ntp_syslog.h \
- ../include/ntp_stdlib.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_string.h ../include/l_stdlib.h \
- ../include/adjtime.h
+
+@AMDEP@include $(DEPDIR)/adjtimed$U.Po
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf $(DEPDIR)
+
+maintainer-clean-depend:
+
+@AMDEP@CCDEPMODE = @CCDEPMODE@
+
+.c.o:
+@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c -o $@ $<
info-am:
info: info-am
@@ -292,25 +312,28 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
- mostlyclean-kr mostlyclean-tags mostlyclean-generic
+ mostlyclean-kr mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-binPROGRAMS clean-compile clean-kr clean-tags \
- clean-generic mostlyclean-am
+ clean-depend clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-binPROGRAMS distclean-compile distclean-kr \
- distclean-tags distclean-generic clean-am
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-binPROGRAMS \
maintainer-clean-compile maintainer-clean-kr \
- maintainer-clean-tags maintainer-clean-generic \
- distclean-am
+ maintainer-clean-tags maintainer-clean-depend \
+ maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -321,8 +344,9 @@ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \
-maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-exec-am install-exec \
+maintainer-clean-tags distdir mostlyclean-depend distclean-depend \
+clean-depend maintainer-clean-depend info-am info dvi-am dvi check \
+check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
diff --git a/contrib/ntp/build b/contrib/ntp/build
index e23865a3aaeb..8caf6413a7e5 100755
--- a/contrib/ntp/build
+++ b/contrib/ntp/build
@@ -1,13 +1,6 @@
#! /bin/sh
LOGF=make.log
-case "$1" in
- -l) LOG=1
- shift
- ;;
- *) LOG=0
- ;;
-esac
CONFIG_ARGS="$@"
@@ -52,8 +45,6 @@ BDIR="$BDIR$CCSUF"
cd $BDIR
(
-cp /dev/null $LOGF
-
[ -f config.status ] || ../configure $CONFIG_ARGS
case "$MAKE" in
@@ -62,5 +53,4 @@ case "$MAKE" in
*) $MAKE && $MAKE check
;;
esac
-) >> $LOGF 2>&1
-
+) > $LOGF 2>&1
diff --git a/contrib/ntp/clockstuff/Makefile.in b/contrib/ntp/clockstuff/Makefile.in
index 67797b8b9a68..8eea5a99e756 100644
--- a/contrib/ntp/clockstuff/Makefile.in
+++ b/contrib/ntp/clockstuff/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies
@@ -140,6 +144,9 @@ DIST_COMMON = README Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/chutest$U.Po $(DEPDIR)/clktest$U.Po \
+$(DEPDIR)/propdelay$U.Po
SOURCES = chutest.c clktest.c propdelay.c
OBJECTS = chutest$U.o clktest$U.o propdelay$U.o
@@ -147,9 +154,9 @@ all: all-redirect
.SUFFIXES:
.SUFFIXES: .c .o
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps clockstuff/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu clockstuff/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -163,9 +170,6 @@ distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS:
-.c.o:
- $(COMPILE) -c $<
-
mostlyclean-compile:
-rm -f *.o core *.core
@@ -190,9 +194,6 @@ clean-kr:
distclean-kr:
maintainer-clean-kr:
-chutest$U.o:
-clktest$U.o:
-propdelay$U.o:
propdelay: $(propdelay_OBJECTS) $(propdelay_DEPENDENCIES)
@rm -f propdelay
@@ -207,23 +208,27 @@ chutest_.o clktest_.o propdelay_.o : $(ANSI2KNR)
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -240,25 +245,34 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
-chutest.o chutest.lo: chutest.c ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h ../config.h \
- ../include/ntp_proto.h ../include/ntp.h \
- ../include/ntp_unixtime.h
-clktest.o clktest.lo: clktest.c ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h ../config.h \
- ../include/ntp_proto.h ../include/ntp.h \
- ../include/ntp_unixtime.h
-propdelay.o propdelay.lo: propdelay.c ../include/ntp_stdlib.h \
- ../include/ntp_types.h ../include/ntp_machine.h ../config.h \
- ../include/ntp_proto.h ../include/ntp_string.h \
- ../include/l_stdlib.h
+
+@AMDEP@include $(DEPDIR)/chutest$U.Po
+@AMDEP@include $(DEPDIR)/clktest$U.Po
+@AMDEP@include $(DEPDIR)/propdelay$U.Po
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf $(DEPDIR)
+
+maintainer-clean-depend:
+
+@AMDEP@CCDEPMODE = @CCDEPMODE@
+
+.c.o:
+@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c -o $@ $<
info-am:
info: info-am
@@ -295,25 +309,28 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \
- mostlyclean-kr mostlyclean-tags mostlyclean-generic
+ mostlyclean-kr mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-noinstPROGRAMS clean-compile clean-kr clean-tags \
- clean-generic mostlyclean-am
+ clean-depend clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-kr \
- distclean-tags distclean-generic clean-am
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-noinstPROGRAMS \
maintainer-clean-compile maintainer-clean-kr \
- maintainer-clean-tags maintainer-clean-generic \
- distclean-am
+ maintainer-clean-tags maintainer-clean-depend \
+ maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -324,8 +341,9 @@ clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \
-maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-exec-am install-exec \
+maintainer-clean-tags distdir mostlyclean-depend distclean-depend \
+clean-depend maintainer-clean-depend info-am info dvi-am dvi check \
+check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
diff --git a/contrib/ntp/config.guess b/contrib/ntp/config.guess
index 8ccccbce0367..a28a21411e2d 100755
--- a/contrib/ntp/config.guess
+++ b/contrib/ntp/config.guess
@@ -550,7 +550,7 @@ EOF
echo t90-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY*T3E:*:*:*)
- echo t3e-cray-unicosmk${UNAME_RELEASE}
+ echo alpha-cray-unicosmk${UNAME_RELEASE}
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
@@ -636,14 +636,15 @@ EOF
s/ .*//
p'`
case "$ld_supported_emulations" in
+ *ia64) echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 ;;
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- elf32ppc)
+ elf32ppc | elf32ppclinux)
# Determine Lib Version
- cat >dummy.c <<EOF
+ cat >$dummy.c <<EOF
#include <features.h>
#if defined(__GLIBC__)
extern char __libc_version[];
@@ -662,14 +663,14 @@ main(argc, argv)
}
EOF
LIBC=""
- ${CC-cc} dummy.c -o dummy 2>/dev/null
+ $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
if test "$?" = 0 ; then
- ./dummy | grep 1\.99 > /dev/null
+ ./$dummy | grep 1\.99 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
- rm -f dummy.c dummy
+ rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
esac
@@ -915,7 +916,7 @@ EOF
news*:NEWS-OS:*:6*)
echo mips-sony-newsos6
exit 0 ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
@@ -943,9 +944,6 @@ EOF
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
- *:"Mac OS":*:*)
- echo `uname -p`-apple-macos${UNAME_RELEASE}
- exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
diff --git a/contrib/ntp/config.h.in b/contrib/ntp/config.h.in
index f722c7de78eb..24fedb1c1186 100644
--- a/contrib/ntp/config.h.in
+++ b/contrib/ntp/config.h.in
@@ -83,6 +83,9 @@
/* Audio CHU? */
#undef AUDIO_CHU
+/* PARSE kernel PLL PPS support */
+#undef PPS_SYNC
+
/* ACTS modem service */
#undef CLOCK_ACTS
@@ -104,48 +107,33 @@
/* Datum/Bancomm bc635/VME interface */
#undef CLOCK_BANC
-/* ELV/DCF7000 clock */
-#undef CLOCK_DCF7000
-
-/* HOPF 6021 clock */
-#undef CLOCK_HOPF6021
-
-/* Meinberg clocks */
-#undef CLOCK_MEINBERG
-
-/* DCF77 raw time code */
-#undef CLOCK_RAWDCF
-
-/* RCC 8000 clock */
-#undef CLOCK_RCC8000
-
-/* Schmid DCF77 clock */
-#undef CLOCK_SCHMID
-
-/* Trimble GPS receiver/TAIP protocol */
-#undef CLOCK_TRIMTAIP
-
-/* Trimble GPS receiver/TSIP protocol */
-#undef CLOCK_TRIMTSIP
-
-/* WHARTON 400A Series protocol */
-#undef CLOCK_WHARTON_400A
-
-/* VARITEXT protocol */
-#undef CLOCK_VARITEXT
-
/* Diems Computime Radio Clock */
#undef CLOCK_COMPUTIME
+/* Chronolog K-series WWVB receiver */
+#undef CLOCK_CHRONOLOG
+
/* Datum Programmable Time System */
#undef CLOCK_DATUM
+/* ELV/DCF7000 clock */
+#undef CLOCK_DCF7000
+
+/* Dumb generic hh:mm:ss local clock */
+#undef CLOCK_DUMBCLOCK
+
+/* Forum Graphic GPS datating station driver */
+#undef CLOCK_FG
+
/* TrueTime GPS receiver/VME interface */
#undef CLOCK_GPSVME
/* Heath GC-1000 WWV/WWVH receiver */
#undef CLOCK_HEATH
+/* HOPF 6021 clock */
+#undef CLOCK_HOPF6021
+
/* HP 58503A GPS receiver */
#undef CLOCK_HPGPS
@@ -161,6 +149,9 @@
/* local clock reference */
#undef CLOCK_LOCAL
+/* Meinberg clocks */
+#undef CLOCK_MEINBERG
+
/* EES M201 MSF receiver */
#undef CLOCK_MSFEES
@@ -170,14 +161,17 @@
/* NMEA GPS receiver */
#undef CLOCK_NMEA
+/* Motorola UT Oncore GPS */
+#undef CLOCK_ONCORE
+
/* Palisade clock */
#undef CLOCK_PALISADE
/* PARSE driver interface */
#undef CLOCK_PARSE
-/* PARSE kernel PLL PPS support */
-#undef PPS_SYNC
+/* Conrad parallel port radio clock */
+#undef CLOCK_PCF
/* PCL 720 clock support */
#undef CLOCK_PPS720
@@ -188,11 +182,20 @@
/* PTB modem service */
#undef CLOCK_PTBACTS
+/* DCF77 raw time code */
+#undef CLOCK_RAWDCF
+
+/* RCC 8000 clock */
+#undef CLOCK_RCC8000
+
+/* Schmid DCF77 clock */
+#undef CLOCK_SCHMID
+
/* clock thru shared memory */
#undef CLOCK_SHM
-/* Motorola UT Oncore GPS */
-#undef CLOCK_ONCORE
+/* Spectracom 8170/Netclock/2 WWVB receiver */
+#undef CLOCK_SPECTRACOM
/* KSI/Odetics TPRO/S GPS receiver/IRIG interface */
#undef CLOCK_TPRO
@@ -200,23 +203,29 @@
/* TRAK 8810 GPS receiver */
#undef CLOCK_TRAK
+/* Trimble GPS receiver/TAIP protocol */
+#undef CLOCK_TRIMTAIP
+
+/* Trimble GPS receiver/TSIP protocol */
+#undef CLOCK_TRIMTSIP
+
/* Kinemetrics/TrueTime receivers */
#undef CLOCK_TRUETIME
+/* Ultralink M320 WWVB receiver */
+#undef CLOCK_ULINK
+
/* USNO modem service */
#undef CLOCK_USNO
-/* Spectracom 8170/Netclock/2 WWVB receiver */
-#undef CLOCK_WWVB
-
-/* Ultralink M320 WWVB receiver */
-#undef CLOCK_ULINK
+/* WHARTON 400A Series protocol */
+#undef CLOCK_WHARTON_400A
-/* Chronolog K-series WWVB receiver */
-#undef CLOCK_CHRONOLOG
+/* WWV audio driver */
+#undef CLOCK_WWV
-/* Dumb generic hh:mm:ss local clock */
-#undef CLOCK_DUMBCLOCK
+/* VARITEXT protocol */
+#undef CLOCK_VARITEXT
/* define if we need to declare int errno; */
#undef DECL_ERRNO
@@ -371,6 +380,10 @@
/* Might nlist() values require an extra level of indirection (AIX)? */
#undef NLIST_EXTRA_INDIRECTION
+/* Other needed NLIST stuff */
+#undef NLIST_STRUCT
+#undef NLIST_NAME_UNION
+
/* Should we recommend a minimum value for tickadj? */
#undef MIN_REC_TICKADJ
@@ -422,6 +435,9 @@
/* Do we need to #define _SVID3 when we #include <termios.h>? */
#undef TERMIOS_NEEDS__SVID3
+/* Do we have support for SHMEM_STATUS? */
+#undef ONCORE_SHMEM_STATUS
+
/* adjtime()? */
#undef DECL_ADJTIME_0
@@ -482,6 +498,7 @@
/* stime()? */
#undef DECL_STIME_0
+#undef DECL_STIME_1
/* strtol()? */
#undef DECL_STRTOL_0
@@ -702,8 +719,8 @@
/* Define if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
-/* Define if you have the <netinet/ip.h> header file. */
-#undef HAVE_NETINET_IP_H
+/* Define if you have the <netinet/in_systm.h> header file. */
+#undef HAVE_NETINET_IN_SYSTM_H
/* Define if you have the <netinfo/ni.h> header file. */
#undef HAVE_NETINFO_NI_H
diff --git a/contrib/ntp/config.sub b/contrib/ntp/config.sub
index eaa862353f38..e4944414bf64 100755
--- a/contrib/ntp/config.sub
+++ b/contrib/ntp/config.sub
@@ -162,7 +162,7 @@ esac
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
- tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
+ tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
@@ -171,7 +171,7 @@ case $basic_machine in
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
- | mips64vr5000 | miprs64vr5000el \
+ | mips64vr5000 | miprs64vr5000el | mcore \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
| thumb | d10v)
basic_machine=$basic_machine-unknown
@@ -191,7 +191,8 @@ case $basic_machine in
exit 1
;;
# Recognize the basic CPU types with company name.
- vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
+ # FIXME: clean up the formatting here.
+ vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
@@ -204,7 +205,7 @@ case $basic_machine in
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
- | mipstx39-* | mipstx39el-* \
+ | mipstx39-* | mipstx39el-* | mcore-* \
| f301-* | armv*-* | t3e-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
| thumb-* | v850-* | d30v-* | tic30-* | c30-* )
@@ -907,7 +908,7 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -rhapsody* | -macos* | -openstep* | -oskit*)
+ | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
diff --git a/contrib/ntp/configure b/contrib/ntp/configure
index e8fa8143953b..fd25f498acdf 100755
--- a/contrib/ntp/configure
+++ b/contrib/ntp/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.14.1
+# 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
@@ -12,6 +12,9 @@ ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
+ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors"
+ac_help="$ac_help
--enable-debugging + include debugging code"
ac_help="$ac_help
--enable-dst-minutes=60 + minutes per DST adjustment"
@@ -36,12 +39,14 @@ ac_help="$ac_help
ac_help="$ac_help
--enable-ATOM + PPS interface"
ac_help="$ac_help
- --enable-CHU + CHU modem/decoder"
+ --enable-CHU - CHU modem/decoder"
ac_help="$ac_help
- --enable-AUDIO-CHU s - CHU audio/decoder"
+ --enable-AUDIO-CHU s CHU audio/decoder"
ac_help="$ac_help
--enable-DATUM s Datum Programmable Time System"
ac_help="$ac_help
+ --enable-FG + Forum Graphic GPS"
+ac_help="$ac_help
--enable-HEATH s Heath GC-1000 WWV/WWVH receiver"
ac_help="$ac_help
--enable-HPGPS + HP 58503A GPS receiver"
@@ -76,11 +81,15 @@ ac_help="$ac_help
ac_help="$ac_help
--enable-DUMBCLOCK + Dumb generic hh:mm:ss local clock"
ac_help="$ac_help
+ --enable-PCF + Conrad parallel port radio clock"
+ac_help="$ac_help
+ --enable-SPECTRACOM + Spectracom 8170/Netclock/2 WWVB receiver"
+ac_help="$ac_help
--enable-TRUETIME s Kinemetrics/TrueTime receivers"
ac_help="$ac_help
- --enable-WWVB + Spectracom 8170/Netclock/2 WWVB receiver"
+ --enable-ULINK + Ultralink WWVB receiver"
ac_help="$ac_help
- --enable-ULINK + Ultralink WWVB receiver"
+ --enable-WWV + WWV Audio receiver"
ac_help="$ac_help
--enable-USNO s USNO modem service"
ac_help="$ac_help
@@ -451,7 +460,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.14.1"
+ echo "configure generated by autoconf version 2.13"
exit 0 ;;
-with-* | --with-*)
@@ -611,7 +620,7 @@ done
if test -r "$cache_file"; then
echo "loading cache $cache_file"
- test -f "$cache_file" && . $cache_file
+ . $cache_file
else
echo "creating cache $cache_file"
> $cache_file
@@ -654,130 +663,9 @@ done
if test -z "$ac_aux_dir"; then
{ echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
-
-
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:664: checking host system type" >&5
-if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
-
-# Make sure we can run config.sub.
- if $ac_config_sub sun4 >/dev/null 2>&1; then :
- else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
- fi
-
- ac_cv_host_alias=$host
- case "$ac_cv_host_alias" in
- NONE)
- case $nonopt in
- NONE)
- if ac_cv_host_alias=`$ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) ac_cv_host_alias=$nonopt ;;
- esac ;;
- esac
-
- ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
- ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
- ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
- ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-else
- echo $ac_n "(cached) $ac_c" 1>&6
-fi
-
-echo "$ac_t""$ac_cv_host" 1>&6
-
-host=$ac_cv_host
-host_alias=$ac_cv_host_alias
-host_cpu=$ac_cv_host_cpu
-host_vendor=$ac_cv_host_vendor
-host_os=$ac_cv_host_os
-
-
-
-
-
-echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:705: checking target system type" >&5
-if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
-
-# Make sure we can run config.sub.
- if $ac_config_sub sun4 >/dev/null 2>&1; then :
- else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
- fi
-
- ac_cv_target_alias=$target
- case "$ac_cv_target_alias" in
- NONE)
- case $nonopt in
- NONE)
- ac_cv_target_alias=$host_alias ;;
-
- *) ac_cv_target_alias=$nonopt ;;
- esac ;;
- esac
-
- ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
- ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
- ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
- ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-else
- echo $ac_n "(cached) $ac_c" 1>&6
-fi
-
-echo "$ac_t""$ac_cv_target" 1>&6
-
-target=$ac_cv_target
-target_alias=$ac_cv_target_alias
-target_cpu=$ac_cv_target_cpu
-target_vendor=$ac_cv_target_vendor
-target_os=$ac_cv_target_os
-
-
-
-
-
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:745: checking build system type" >&5
-if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
-
-# Make sure we can run config.sub.
- if $ac_config_sub sun4 >/dev/null 2>&1; then :
- else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
- fi
-
- ac_cv_build_alias=$build
- case "$ac_cv_build_alias" in
- NONE)
- case $nonopt in
- NONE)
- ac_cv_build_alias=$host_alias ;;
-
- *) ac_cv_build_alias=$nonopt ;;
- esac ;;
- esac
-
- ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
- ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
- ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
- ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-else
- echo $ac_n "(cached) $ac_c" 1>&6
-fi
-
-echo "$ac_t""$ac_cv_build" 1>&6
-
-build=$ac_cv_build
-build_alias=$ac_cv_build_alias
-build_cpu=$ac_cv_build_cpu
-build_vendor=$ac_cv_build_vendor
-build_os=$ac_cv_build_os
-
-
-
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# Do some error checking and defaulting for the host and target type.
@@ -800,6 +688,69 @@ NONE---*---* | *---NONE---* | *---*---NONE) ;;
*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
esac
+
+# Make sure we can run config.sub.
+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:699: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ 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=`${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:720: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+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:738: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+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/'`
+echo "$ac_t""$build" 1>&6
+
test "$host_alias" != "$target_alias" &&
test "$program_prefix$program_suffix$program_transform_name" = \
NONENONEs,x,x, &&
@@ -823,10 +774,10 @@ EOF_SED
rm -f conftestsed
fi
test "$program_prefix" != NONE &&
- program_transform_name="s,^,${program_prefix},;$program_transform_name"
+ program_transform_name="s,^,${program_prefix},; $program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
- program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
+ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
# sed with no file args requires a program.
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
@@ -843,9 +794,9 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
# 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:847: checking for a BSD compatible install" >&5
+echo "configure:798: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
-if eval "test \"\${ac_cv_path_install+set}\" = set"; 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=":"
@@ -863,10 +814,6 @@ else
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
- elif test $ac_prog = install &&
- grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
else
ac_cv_path_install="$ac_dir/$ac_prog -c"
break 2
@@ -895,12 +842,12 @@ echo "$ac_t""$INSTALL" 1>&6
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+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:904: checking whether build environment is sane" >&5
+echo "configure:851: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -937,10 +884,54 @@ Check your system clock" 1>&2; exit 1; }
fi
rm -f conftest*
echo "$ac_t""yes" 1>&6
+
+test x"${MISSING+set}" = xset || \
+ MISSING="\${SHELL} `CDPATH=: && cd $ac_aux_dir && pwd`/missing"
+if eval "$MISSING --run :"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ echo "configure: warning: \`missing' script is too old or missing" 1>&2
+fi
+
+for ac_prog in mawk gawk 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:903: 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=":"
+ 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"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+AWK="$ac_cv_prog_AWK"
+if test -n "$AWK"; then
+ echo "$ac_t""$AWK" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$AWK" && break
+done
+
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:942: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:933: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftestmake <<\EOF
@@ -965,12 +956,48 @@ else
fi
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval="$enable_dependency_tracking"
+ :
+fi
+
+if test "x$enable_dependency_tracking" = xno; then
+ AMDEP="#"
+else
+ am_depcomp="$ac_aux_dir/depcomp"
+ if test ! -f "$am_depcomp"; then
+ AMDEP="#"
+ else
+ AMDEP=
+ fi
+fi
+
+if test -z "$AMDEP"; then
+ AMDEPBACKSLASH='\'
+else
+ AMDEPBACKSLASH=
+fi
+
+
+
+
+
+if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
+ DEPDIR=.deps
+else
+ DEPDIR=_deps
+fi
+
+
+
PACKAGE=ntp
-VERSION=4.0.98f
+VERSION=4.0.99b
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+if test "`CDPATH=: && cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
{ echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
fi
cat >> confdefs.h <<EOF
@@ -983,116 +1010,50 @@ EOF
-missing_dir=`cd $ac_aux_dir && pwd`
-echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:989: 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.
-if (aclocal --version) < /dev/null > /dev/null 2>&1; then
- ACLOCAL=aclocal
- echo "$ac_t""found" 1>&6
-else
- ACLOCAL="$missing_dir/missing aclocal"
- echo "$ac_t""missing" 1>&6
-fi
-echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1002: 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.
-if (autoconf --version) < /dev/null > /dev/null 2>&1; then
- AUTOCONF=autoconf
- echo "$ac_t""found" 1>&6
-else
- AUTOCONF="$missing_dir/missing autoconf"
- echo "$ac_t""missing" 1>&6
-fi
-echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1015: 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.
-if (automake --version) < /dev/null > /dev/null 2>&1; then
- AUTOMAKE=automake
- echo "$ac_t""found" 1>&6
-else
- AUTOMAKE="$missing_dir/missing automake"
- echo "$ac_t""missing" 1>&6
-fi
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"}
-echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1028: 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.
-if (autoheader --version) < /dev/null > /dev/null 2>&1; then
- AUTOHEADER=autoheader
- echo "$ac_t""found" 1>&6
-else
- AUTOHEADER="$missing_dir/missing autoheader"
- echo "$ac_t""missing" 1>&6
-fi
-echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1041: 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.
-if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
- MAKEINFO=makeinfo
- echo "$ac_t""found" 1>&6
-else
- MAKEINFO="$missing_dir/missing makeinfo"
- echo "$ac_t""missing" 1>&6
-fi
-for ac_prog in gnutar gtar tar
-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:1058: checking for $ac_word" >&5
-if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$AMTAR"; then
- ac_cv_prog_AMTAR="$AMTAR" # 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_AMTAR="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-AMTAR="$ac_cv_prog_AMTAR"
-if test -n "$AMTAR"; then
- echo "$ac_t""$AMTAR" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-test -n "$AMTAR" && break
-done
-AMTARFLAGS=
-if test -n "$AMTAR"; then
- if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
- AMTARFLAGS=o
- fi
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"}
+
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+
+
+if test -z "$install_sh"; then
+ install_sh="$ac_aux_dir/install-sh"
+ test -f "$install_sh" || install_sh="$ac_aux_dir/install.sh"
+ test -f "$install_sh" || install_sh="${am_missing_run}${ac_auxdir}/install-sh"
+ install_sh="`echo $install_sh | sed -e 's/\${SHELL}//'`"
fi
+
+
+
+
+
+
+
+
ac_cv_var_oncore_ok=no
iCFLAGS="$CFLAGS"
@@ -1100,8 +1061,8 @@ iCFLAGS="$CFLAGS"
# 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:1104: checking for $ac_word" >&5
-if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
+echo "configure:1065: 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
@@ -1130,8 +1091,8 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1134: checking for $ac_word" >&5
-if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
+echo "configure:1095: 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
@@ -1177,12 +1138,12 @@ fi
if test -z "$CC"; then
case "`uname -s`" in
- *win32* | *WIN32* | *CYGWIN*)
+ *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:1185: checking for $ac_word" >&5
-if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
+echo "configure:1146: 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
@@ -1212,8 +1173,8 @@ 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 $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1217: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1178: 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.
@@ -1224,12 +1185,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 1228 "configure"
+#line 1189 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1194: \"$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
@@ -1254,14 +1215,14 @@ 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 $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1259: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1220: 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:1264: checking whether we are using GNU C" >&5
-if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
+echo "configure:1225: 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
cat > conftest.c <<EOF
@@ -1269,7 +1230,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1273: \"$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:1234: \"$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
@@ -1288,8 +1249,8 @@ 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:1292: checking whether ${CC-cc} accepts -g" >&5
-if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
+echo "configure:1253: 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
echo 'void f(){}' > conftest.c
@@ -1319,14 +1280,148 @@ else
fi
fi
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1286: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 1301 "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:1307: \"$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} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 1318 "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:1324: \"$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 1335 "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:1341: \"$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=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+
+
+
+
+
+
+depcc="$CC"
+depcpp="$CPP"
+echo $ac_n "checking dependency style of $depcc""... $ac_c" 1>&6
+echo "configure:1374: checking dependency style of $depcc" >&5
+if eval "test \"`echo '$''{'am_cv_CC_dependencies_compiler_type'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+if test -z "$AMDEP"; then
+ echo '#include "conftest.h"' > conftest.c
+ echo 'int i;' > conftest.h
+
+ am_cv_CC_dependencies_compiler_type=none
+ for depmode in `sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < "$am_depcomp"`; do
+ case "$depmode" in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ if depmode="$depmode" \
+ source=conftest.c object=conftest.o \
+ depfile=conftest.Po tmpdepfile=conftest.TPo \
+ $SHELL $am_depcomp $depcc -c conftest.c 2>/dev/null &&
+ grep conftest.h conftest.Po > /dev/null 2>&1; then
+ am_cv_CC_dependencies_compiler_type="$depmode"
+ break
+ fi
+ done
+
+ rm -f conftest.*
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+
+echo "$ac_t""$am_cv_CC_dependencies_compiler_type" 1>&6
+CCDEPMODE="depmode=$am_cv_CC_dependencies_compiler_type"
+
+
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1324: checking how to run the C preprocessor" >&5
+echo "configure:1419: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
-if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# This must be in double quotes, not single quotes, because CPP may get
@@ -1335,13 +1430,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1339 "configure"
+#line 1434 "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:1345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1440: \"$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
:
@@ -1352,13 +1447,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1356 "configure"
+#line 1451 "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:1362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1457: \"$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
:
@@ -1369,13 +1464,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1373 "configure"
+#line 1468 "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:1379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1474: \"$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
:
@@ -1410,6 +1505,14 @@ case "$target" in
CFLAGS="$CFLAGS -Wc,+Abi-socket"
;;
esac
+ ;;
+ alpha*-dec-osf*)
+ case "$CC" in
+ cc)
+ CFLAGS="$CFLAGS -std1"
+ ;;
+ esac
+ ;;
esac
case "$host" in
@@ -1433,8 +1536,8 @@ 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:1437: checking for $ac_word" >&5
-if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
+echo "configure:1540: 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
@@ -1463,9 +1566,9 @@ test -n "$AWK" && break
done
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1467: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1570: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftestmake <<\EOF
@@ -1505,8 +1608,8 @@ case "$GCC" in
CFLAGS="$CFLAGS -Wstrict-prototypes"
echo $ac_n "checking whether ${CC-cc} -pipe works""... $ac_c" 1>&6
-echo "configure:1509: checking whether ${CC-cc} -pipe works" >&5
-if eval "test \"\${ac_cv_prog_cc_pipe+set}\" = set"; then
+echo "configure:1612: checking whether ${CC-cc} -pipe works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_pipe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo 'void f(){}' > conftest.c
@@ -1575,8 +1678,8 @@ esac
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1579: checking whether ln -s works" >&5
-if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
+echo "configure:1682: 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
rm -f conftestdata
@@ -1597,13 +1700,13 @@ fi
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1601: checking whether ${CC-cc} needs -traditional" >&5
-if eval "test \"\${ac_cv_prog_gcc_traditional+set}\" = set"; then
+echo "configure:1704: 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 1607 "configure"
+#line 1710 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@@ -1621,7 +1724,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 1625 "configure"
+#line 1728 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@@ -1643,9 +1746,9 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
fi
echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:1647: checking for AIX" >&5
+echo "configure:1750: checking for AIX" >&5
cat > conftest.$ac_ext <<EOF
-#line 1649 "configure"
+#line 1752 "configure"
#include "confdefs.h"
#ifdef _AIX
yes
@@ -1668,17 +1771,17 @@ rm -f conftest*
ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:1672: checking for minix/config.h" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:1775: 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 1677 "configure"
+#line 1780 "configure"
#include "confdefs.h"
#include <minix/config.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1682: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1785: \"$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*
@@ -1716,7 +1819,7 @@ EOF
fi
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1720: checking for POSIXized ISC" >&5
+echo "configure:1823: 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
@@ -1739,8 +1842,8 @@ fi
# 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:1743: checking for $ac_word" >&5
-if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
+echo "configure:1846: 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
@@ -1769,8 +1872,8 @@ fi
# Extract the first word of "sh", so it can be a program name with args.
set dummy sh; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1773: checking for $ac_word" >&5
-if eval "test \"\${ac_cv_path_PATH_SH+set}\" = set"; then
+echo "configure:1876: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_PATH_SH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
case "$PATH_SH" in
@@ -1820,9 +1923,9 @@ esac
# 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:1824: checking for a BSD compatible install" >&5
+echo "configure:1927: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
-if eval "test \"\${ac_cv_path_install+set}\" = set"; 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=":"
@@ -1840,10 +1943,6 @@ else
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
- elif test $ac_prog = install &&
- grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
else
ac_cv_path_install="$ac_dir/$ac_prog -c"
break 2
@@ -1872,7 +1971,7 @@ echo "$ac_t""$INSTALL" 1>&6
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
@@ -1880,22 +1979,22 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
case "$target" in
*-pc-cygwin*)
echo $ac_n "checking for main in -ladvapi32""... $ac_c" 1>&6
-echo "configure:1884: checking for main in -ladvapi32" >&5
+echo "configure:1983: checking for main in -ladvapi32" >&5
ac_lib_var=`echo advapi32'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ladvapi32 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1892 "configure"
+#line 1991 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:1899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1998: \"$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
@@ -1925,15 +2024,15 @@ fi
;;
esac
echo $ac_n "checking for nlist in -lelf""... $ac_c" 1>&6
-echo "configure:1929: checking for nlist in -lelf" >&5
+echo "configure:2028: checking for nlist in -lelf" >&5
ac_lib_var=`echo elf'_'nlist | sed 'y%./+-%__p_%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lelf $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1937 "configure"
+#line 2036 "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
@@ -1944,7 +2043,7 @@ int main() {
nlist()
; return 0; }
EOF
-if { (eval echo configure:1948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2047: \"$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
@@ -1972,22 +2071,22 @@ else
fi
echo $ac_n "checking for main in -lkvm""... $ac_c" 1>&6
-echo "configure:1976: checking for main in -lkvm" >&5
+echo "configure:2075: checking for main in -lkvm" >&5
ac_lib_var=`echo kvm'_'main | sed 'y%./+-%__p_%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lkvm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1984 "configure"
+#line 2083 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:1991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2090: \"$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
@@ -2014,15 +2113,15 @@ else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for nlist in -lld""... $ac_c" 1>&6
-echo "configure:2018: checking for nlist in -lld" >&5
+echo "configure:2117: checking for nlist in -lld" >&5
ac_lib_var=`echo ld'_'nlist | sed 'y%./+-%__p_%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2026 "configure"
+#line 2125 "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
@@ -2033,7 +2132,7 @@ int main() {
nlist()
; return 0; }
EOF
-if { (eval echo configure:2037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2136: \"$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
@@ -2061,15 +2160,15 @@ else
fi
echo $ac_n "checking for nlist in -lmld""... $ac_c" 1>&6
-echo "configure:2065: checking for nlist in -lmld" >&5
+echo "configure:2164: checking for nlist in -lmld" >&5
ac_lib_var=`echo mld'_'nlist | sed 'y%./+-%__p_%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lmld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2073 "configure"
+#line 2172 "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
@@ -2080,7 +2179,7 @@ int main() {
nlist()
; return 0; }
EOF
-if { (eval echo configure:2084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2183: \"$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
@@ -2108,12 +2207,12 @@ else
fi
echo $ac_n "checking for gethostent""... $ac_c" 1>&6
-echo "configure:2112: checking for gethostent" >&5
-if eval "test \"\${ac_cv_func_gethostent+set}\" = set"; then
+echo "configure:2211: checking for gethostent" >&5
+if eval "test \"`echo '$''{'ac_cv_func_gethostent'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2117 "configure"
+#line 2216 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostent(); below. */
@@ -2122,7 +2221,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gethostent();
-char (*f)();
int main() {
@@ -2132,12 +2230,12 @@ int main() {
#if defined (__stub_gethostent) || defined (__stub___gethostent)
choke me
#else
-f = gethostent;
+gethostent();
#endif
; return 0; }
EOF
-if { (eval echo configure:2141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostent=yes"
else
@@ -2155,15 +2253,15 @@ if eval "test \"`echo '$ac_cv_func_'gethostent`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for gethostent in -lnsl""... $ac_c" 1>&6
-echo "configure:2159: checking for gethostent in -lnsl" >&5
+echo "configure:2257: checking for gethostent in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostent | sed 'y%./+-%__p_%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lnsl -lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2167 "configure"
+#line 2265 "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
@@ -2174,7 +2272,7 @@ int main() {
gethostent()
; return 0; }
EOF
-if { (eval echo configure:2178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2276: \"$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
@@ -2204,12 +2302,12 @@ fi
fi
echo $ac_n "checking for openlog""... $ac_c" 1>&6
-echo "configure:2208: checking for openlog" >&5
-if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
+echo "configure:2306: checking for openlog" >&5
+if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2213 "configure"
+#line 2311 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char openlog(); below. */
@@ -2218,7 +2316,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char openlog();
-char (*f)();
int main() {
@@ -2228,12 +2325,12 @@ int main() {
#if defined (__stub_openlog) || defined (__stub___openlog)
choke me
#else
-f = openlog;
+openlog();
#endif
; return 0; }
EOF
-if { (eval echo configure:2237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_openlog=yes"
else
@@ -2251,15 +2348,15 @@ if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for openlog in -lgen""... $ac_c" 1>&6
-echo "configure:2255: checking for openlog in -lgen" >&5
+echo "configure:2352: checking for openlog in -lgen" >&5
ac_lib_var=`echo gen'_'openlog | sed 'y%./+-%__p_%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lgen $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2263 "configure"
+#line 2360 "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
@@ -2270,7 +2367,7 @@ int main() {
openlog()
; return 0; }
EOF
-if { (eval echo configure:2274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2371: \"$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
@@ -2301,15 +2398,15 @@ fi
echo $ac_n "checking for sched_setscheduler in -lrt""... $ac_c" 1>&6
-echo "configure:2305: checking for sched_setscheduler in -lrt" >&5
+echo "configure:2402: checking for sched_setscheduler in -lrt" >&5
ac_lib_var=`echo rt'_'sched_setscheduler | sed 'y%./+-%__p_%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lrt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2313 "configure"
+#line 2410 "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
@@ -2320,7 +2417,7 @@ int main() {
sched_setscheduler()
; return 0; }
EOF
-if { (eval echo configure:2324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2421: \"$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
@@ -2346,15 +2443,15 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_setscheduler in -lposix4""... $ac_c" 1>&6
-echo "configure:2350: checking for sched_setscheduler in -lposix4" >&5
+echo "configure:2447: checking for sched_setscheduler in -lposix4" >&5
ac_lib_var=`echo posix4'_'sched_setscheduler | sed 'y%./+-%__p_%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lposix4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2358 "configure"
+#line 2455 "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
@@ -2365,7 +2462,7 @@ int main() {
sched_setscheduler()
; return 0; }
EOF
-if { (eval echo configure:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2466: \"$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
@@ -2395,12 +2492,12 @@ fi
fi
echo $ac_n "checking for setsockopt""... $ac_c" 1>&6
-echo "configure:2399: checking for setsockopt" >&5
-if eval "test \"\${ac_cv_func_setsockopt+set}\" = set"; then
+echo "configure:2496: checking for setsockopt" >&5
+if eval "test \"`echo '$''{'ac_cv_func_setsockopt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2404 "configure"
+#line 2501 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char setsockopt(); below. */
@@ -2409,7 +2506,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char setsockopt();
-char (*f)();
int main() {
@@ -2419,12 +2515,12 @@ int main() {
#if defined (__stub_setsockopt) || defined (__stub___setsockopt)
choke me
#else
-f = setsockopt;
+setsockopt();
#endif
; return 0; }
EOF
-if { (eval echo configure:2428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_setsockopt=yes"
else
@@ -2442,15 +2538,15 @@ if eval "test \"`echo '$ac_cv_func_'setsockopt`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for setsockopt in -lsocket""... $ac_c" 1>&6
-echo "configure:2446: checking for setsockopt in -lsocket" >&5
+echo "configure:2542: checking for setsockopt in -lsocket" >&5
ac_lib_var=`echo socket'_'setsockopt | sed 'y%./+-%__p_%'`
-if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2454 "configure"
+#line 2550 "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
@@ -2461,7 +2557,7 @@ int main() {
setsockopt()
; return 0; }
EOF
-if { (eval echo configure:2465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2561: \"$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
@@ -2492,12 +2588,12 @@ fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2496: checking for ANSI C header files" >&5
-if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
+echo "configure:2592: 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 2501 "configure"
+#line 2597 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2505,7 +2601,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2509: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2605: \"$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*
@@ -2522,7 +2618,7 @@ rm -f conftest*
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 2526 "configure"
+#line 2622 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2540,7 +2636,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2544 "configure"
+#line 2640 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2561,7 +2657,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2565 "configure"
+#line 2661 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2572,7 +2668,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2599,17 +2695,17 @@ for ac_hdr in bstring.h errno.h fcntl.h memory.h netdb.h poll.h resolv.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2603: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:2699: 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 2608 "configure"
+#line 2704 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2709: \"$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*
@@ -2639,17 +2735,17 @@ for ac_hdr in sched.h sgtty.h stdlib.h string.h termio.h termios.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2643: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:2739: 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 2648 "configure"
+#line 2744 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2749: \"$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*
@@ -2679,17 +2775,17 @@ for ac_hdr in timepps.h timex.h unistd.h utmp.h utmpx.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2683: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:2779: 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 2688 "configure"
+#line 2784 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2693: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2789: \"$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*
@@ -2715,21 +2811,21 @@ else
fi
done
-for ac_hdr in arpa/nameser.h net/if.h netinet/in.h netinet/ip.h
+for ac_hdr in arpa/nameser.h net/if.h netinet/in_systm.h netinet/in.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2723: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:2819: 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 2728 "configure"
+#line 2824 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2829: \"$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*
@@ -2759,17 +2855,17 @@ for ac_hdr in netinfo/ni.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2763: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:2859: 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 2768 "configure"
+#line 2864 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2869: \"$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*
@@ -2802,17 +2898,17 @@ for ac_hdr in sun/audioio.h sys/audioio.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2806: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:2902: 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 2811 "configure"
+#line 2907 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2912: \"$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*
@@ -2842,17 +2938,17 @@ for ac_hdr in sys/clkdefs.h sys/file.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2846: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:2942: 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 2851 "configure"
+#line 2947 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2952: \"$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*
@@ -2884,17 +2980,17 @@ case "$target" in
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2888: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:2984: 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 2893 "configure"
+#line 2989 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2994: \"$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*
@@ -2926,17 +3022,17 @@ for ac_hdr in sys/lock.h sys/mman.h sys/modem.h sys/param.h sys/ppsclock.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2930: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:3026: 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 2935 "configure"
+#line 3031 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3036: \"$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*
@@ -2966,17 +3062,17 @@ for ac_hdr in sys/ppstime.h sys/proc.h sys/resource.h sys/sched.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2970: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:3066: 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 2975 "configure"
+#line 3071 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3076: \"$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*
@@ -3008,59 +3104,17 @@ case "$target" in
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3012: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 3017 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3022: \"$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"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-fi
-done
-
- ;;
- *sgi*)
- for ac_hdr in sys/syssgi.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3054: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:3108: 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 3059 "configure"
+#line 3113 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3118: \"$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*
@@ -3087,22 +3141,22 @@ fi
done
;;
- *)
- for ac_hdr in sys/select.h
+esac
+for ac_hdr in sys/select.h sys/sockio.h sys/stat.h sys/stream.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3096: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:3150: 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 3101 "configure"
+#line 3155 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3160: \"$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*
@@ -3128,23 +3182,21 @@ else
fi
done
- ;;
-esac
-for ac_hdr in sys/sockio.h sys/stat.h sys/stream.h sys/stropts.h
+for ac_hdr in sys/stropts.h sys/sysctl.h sys/syssgi.h sys/termios.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3138: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:3190: 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 3143 "configure"
+#line 3195 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3148: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3200: \"$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*
@@ -3170,21 +3222,21 @@ else
fi
done
-for ac_hdr in sys/sysctl.h sys/termios.h sys/time.h
+for ac_hdr in sys/time.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3178: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:3230: 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 3183 "configure"
+#line 3235 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3188: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3240: \"$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*
@@ -3211,7 +3263,7 @@ fi
done
cat > conftest.$ac_ext <<EOF
-#line 3215 "configure"
+#line 3267 "configure"
#include "confdefs.h"
#include <sys/timepps.h>
#ifdef PPS_API_VERS_1
@@ -3226,17 +3278,17 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3230: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:3282: 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 3235 "configure"
+#line 3287 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3292: \"$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*
@@ -3269,17 +3321,17 @@ for ac_hdr in sys/timers.h sys/timex.h sys/tpro.h sys/types.h sys/wait.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3273: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:3325: 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 3278 "configure"
+#line 3330 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3335: \"$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*
@@ -3306,12 +3358,12 @@ fi
done
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3310: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"\${ac_cv_header_time+set}\" = set"; then
+echo "configure:3362: 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 3315 "configure"
+#line 3367 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -3320,7 +3372,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:3324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -3346,17 +3398,17 @@ case "$target" in
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3350: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:3402: 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 3355 "configure"
+#line 3407 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3360: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3412: \"$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*
@@ -3388,17 +3440,17 @@ done
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3392: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:3444: 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 3397 "configure"
+#line 3449 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3402: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3454: \"$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*
@@ -3429,17 +3481,17 @@ esac
ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
-echo "configure:3433: checking for nlist.h" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:3485: 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 3438 "configure"
+#line 3490 "configure"
#include "confdefs.h"
#include <nlist.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3495: \"$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*
@@ -3460,19 +3512,19 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
EOF
echo $ac_n "checking for n_un in struct nlist""... $ac_c" 1>&6
-echo "configure:3464: checking for n_un in struct nlist" >&5
-if eval "test \"\${ac_cv_struct_nlist_n_un+set}\" = set"; then
+echo "configure:3516: 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 3469 "configure"
+#line 3521 "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:3476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3528: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_nlist_n_un=yes
else
@@ -3497,12 +3549,12 @@ else
fi
echo $ac_n "checking for basic volatile support""... $ac_c" 1>&6
-echo "configure:3501: checking for basic volatile support" >&5
-if eval "test \"\${ac_cv_c_volatile+set}\" = set"; then
+echo "configure:3553: 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 3506 "configure"
+#line 3558 "configure"
#include "confdefs.h"
int main() {
@@ -3510,7 +3562,7 @@ int main() {
volatile int x;
; return 0; }
EOF
-if { (eval echo configure:3514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_volatile=yes
else
@@ -3543,8 +3595,8 @@ case "$target" in
echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
-echo "configure:3547: checking for ${CC-cc} option to accept ANSI C" >&5
-if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
+echo "configure:3599: checking for ${CC-cc} option to accept ANSI C" >&5
+if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
am_cv_prog_cc_stdc=no
@@ -3560,7 +3612,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIO
do
CC="$ac_save_CC $ac_arg"
cat > conftest.$ac_ext <<EOF
-#line 3564 "configure"
+#line 3616 "configure"
#include "confdefs.h"
#include <stdarg.h>
#include <stdio.h>
@@ -3597,7 +3649,7 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
; return 0; }
EOF
-if { (eval echo configure:3601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_prog_cc_stdc="$ac_arg"; break
else
@@ -3623,7 +3675,7 @@ esac
echo $ac_n "checking for function prototypes""... $ac_c" 1>&6
-echo "configure:3627: checking for function prototypes" >&5
+echo "configure:3679: checking for function prototypes" >&5
if test "$am_cv_prog_cc_stdc" != no; then
echo "$ac_t""yes" 1>&6
cat >> confdefs.h <<\EOF
@@ -3636,12 +3688,12 @@ else
U=_ ANSI2KNR=./ansi2knr
# Ensure some checks needed by ansi2knr itself.
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3640: checking for ANSI C header files" >&5
-if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
+echo "configure:3692: 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 3645 "configure"
+#line 3697 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -3649,7 +3701,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3705: \"$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*
@@ -3666,7 +3718,7 @@ rm -f conftest*
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 3670 "configure"
+#line 3722 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -3684,7 +3736,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 3688 "configure"
+#line 3740 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -3705,7 +3757,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 3709 "configure"
+#line 3761 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -3716,7 +3768,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:3720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -3743,17 +3795,17 @@ fi
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3747: checking for $ac_hdr" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:3799: 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 3752 "configure"
+#line 3804 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3809: \"$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*
@@ -3784,12 +3836,12 @@ fi
;;
esac
echo $ac_n "checking if C compiler permits function prototypes""... $ac_c" 1>&6
-echo "configure:3788: checking if C compiler permits function prototypes" >&5
-if eval "test \"\${ac_cv_have_prototypes+set}\" = set"; then
+echo "configure:3840: 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 3793 "configure"
+#line 3845 "configure"
#include "confdefs.h"
extern int foo (short);
@@ -3799,7 +3851,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:3803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_have_prototypes=yes
else
@@ -3821,12 +3873,12 @@ EOF
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3825: checking for working const" >&5
-if eval "test \"\${ac_cv_c_const+set}\" = set"; then
+echo "configure:3877: 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 3830 "configure"
+#line 3882 "configure"
#include "confdefs.h"
int main() {
@@ -3875,7 +3927,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:3879: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3931: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -3898,14 +3950,14 @@ fi
case "$host" in
$target)
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3902: checking whether byte ordering is bigendian" >&5
-if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
+echo "configure:3954: 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 3909 "configure"
+#line 3961 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3916,11 +3968,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3972: \"$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 3924 "configure"
+#line 3976 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3931,7 +3983,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -3951,7 +4003,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3955 "configure"
+#line 4007 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -3964,7 +4016,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:3968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4020: \"$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
@@ -4004,12 +4056,12 @@ EOF
;;
esac
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:4008: checking return type of signal handlers" >&5
-if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
+echo "configure:4060: 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 4013 "configure"
+#line 4065 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -4026,7 +4078,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:4030: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -4045,12 +4097,12 @@ EOF
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:4049: checking for off_t" >&5
-if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
+echo "configure:4101: checking for off_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4054 "configure"
+#line 4106 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -4061,31 +4113,29 @@ EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
- eval "ac_cv_type_off_t=yes"
+ ac_cv_type_off_t=yes
else
rm -rf conftest*
- eval "ac_cv_type_off_t=no"
+ ac_cv_type_off_t=no
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-else
- echo "$ac_t""no" 1>&6
- cat >> confdefs.h <<EOF
+echo "$ac_t""$ac_cv_type_off_t" 1>&6
+if test $ac_cv_type_off_t = no; then
+ cat >> confdefs.h <<\EOF
#define off_t long
EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:4084: checking for size_t" >&5
-if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
+echo "configure:4134: checking for size_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4089 "configure"
+#line 4139 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -4096,31 +4146,29 @@ EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
- eval "ac_cv_type_size_t=yes"
+ ac_cv_type_size_t=yes
else
rm -rf conftest*
- eval "ac_cv_type_size_t=no"
+ ac_cv_type_size_t=no
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-else
- echo "$ac_t""no" 1>&6
- cat >> confdefs.h <<EOF
+echo "$ac_t""$ac_cv_type_size_t" 1>&6
+if test $ac_cv_type_size_t = no; then
+ cat >> confdefs.h <<\EOF
#define size_t unsigned
EOF
fi
echo $ac_n "checking for time_t""... $ac_c" 1>&6
-echo "configure:4119: checking for time_t" >&5
-if eval "test \"\${ac_cv_type_time_t+set}\" = set"; then
+echo "configure:4167: checking for time_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_time_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4124 "configure"
+#line 4172 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -4131,31 +4179,29 @@ EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "(^|[^a-zA-Z_0-9])time_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
- eval "ac_cv_type_time_t=yes"
+ ac_cv_type_time_t=yes
else
rm -rf conftest*
- eval "ac_cv_type_time_t=no"
+ ac_cv_type_time_t=no
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_type_'time_t`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-else
- echo "$ac_t""no" 1>&6
- cat >> confdefs.h <<EOF
+echo "$ac_t""$ac_cv_type_time_t" 1>&6
+if test $ac_cv_type_time_t = no; then
+ cat >> confdefs.h <<\EOF
#define time_t long
EOF
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:4154: checking whether struct tm is in sys/time.h or time.h" >&5
-if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
+echo "configure:4200: 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 4159 "configure"
+#line 4205 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -4163,7 +4209,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:4167: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -4185,8 +4231,8 @@ fi
echo $ac_n "checking for a fallback value for HZ""... $ac_c" 1>&6
-echo "configure:4189: checking for a fallback value for HZ" >&5
-if eval "test \"\${ac_cv_var_default_hz+set}\" = set"; then
+echo "configure:4235: 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
ac_cv_var_default_hz=100
@@ -4207,8 +4253,8 @@ EOF
echo $ac_n "checking if we need to override the system's value for HZ""... $ac_c" 1>&6
-echo "configure:4211: checking if we need to override the system's value for HZ" >&5
-if eval "test \"\${ac_cv_var_override_hz+set}\" = set"; then
+echo "configure:4257: 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
ac_cv_var_override_hz=no
@@ -4241,20 +4287,20 @@ esac
echo $ac_n "checking struct sigaction for sa_sigaction""... $ac_c" 1>&6
-echo "configure:4245: checking struct sigaction for sa_sigaction" >&5
-if eval "test \"\${ac_cv_struct_sigaction_has_sa_sigaction+set}\" = set"; then
+echo "configure:4291: checking struct sigaction for sa_sigaction" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_sigaction_has_sa_sigaction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4251 "configure"
+#line 4297 "configure"
#include "confdefs.h"
#include <signal.h>
int main() {
struct sigaction act; act.sa_sigaction = 0;
; return 0; }
EOF
-if { (eval echo configure:4258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_sigaction_has_sa_sigaction=yes
else
@@ -4278,12 +4324,12 @@ EOF
fi
echo $ac_n "checking for struct ppsclockev""... $ac_c" 1>&6
-echo "configure:4282: checking for struct ppsclockev" >&5
-if eval "test \"\${ac_cv_struct_ppsclockev+set}\" = set"; then
+echo "configure:4328: checking for struct ppsclockev" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_ppsclockev'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4287 "configure"
+#line 4333 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -4302,7 +4348,7 @@ extern struct ppsclockev *pce;
return pce->serial;
; return 0; }
EOF
-if { (eval echo configure:4306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_ppsclockev=yes
else
@@ -4324,12 +4370,12 @@ EOF
fi
echo $ac_n "checking struct sockaddr for sa_len""... $ac_c" 1>&6
-echo "configure:4328: checking struct sockaddr for sa_len" >&5
-if eval "test \"\${ac_cv_struct_sockaddr_has_sa_len+set}\" = set"; then
+echo "configure:4374: 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 4333 "configure"
+#line 4379 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -4340,7 +4386,7 @@ extern struct sockaddr *ps;
return ps->sa_len;
; return 0; }
EOF
-if { (eval echo configure:4344: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_sockaddr_has_sa_len=yes
else
@@ -4362,12 +4408,12 @@ EOF
fi
echo $ac_n "checking struct clockinfo for hz""... $ac_c" 1>&6
-echo "configure:4366: checking struct clockinfo for hz" >&5
-if eval "test \"\${ac_cv_struct_clockinfo_has_hz+set}\" = set"; then
+echo "configure:4412: 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 4371 "configure"
+#line 4417 "configure"
#include "confdefs.h"
#include <sys/time.h>
@@ -4377,7 +4423,7 @@ extern struct clockinfo *pc;
return pc->hz;
; return 0; }
EOF
-if { (eval echo configure:4381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_clockinfo_has_hz=yes
else
@@ -4399,12 +4445,12 @@ EOF
fi
echo $ac_n "checking struct clockinfo for tickadj""... $ac_c" 1>&6
-echo "configure:4403: checking struct clockinfo for tickadj" >&5
-if eval "test \"\${ac_cv_struct_clockinfo_has_tickadj+set}\" = set"; then
+echo "configure:4449: 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 4408 "configure"
+#line 4454 "configure"
#include "confdefs.h"
#include <sys/time.h>
@@ -4414,7 +4460,7 @@ extern struct clockinfo *pc;
return pc->tickadj;
; return 0; }
EOF
-if { (eval echo configure:4418: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_clockinfo_has_tickadj=yes
else
@@ -4436,12 +4482,12 @@ EOF
fi
echo $ac_n "checking for struct ntptimeval""... $ac_c" 1>&6
-echo "configure:4440: checking for struct ntptimeval" >&5
-if eval "test \"\${ac_cv_struct_ntptimeval+set}\" = set"; then
+echo "configure:4486: checking for struct ntptimeval" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_ntptimeval'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4445 "configure"
+#line 4491 "configure"
#include "confdefs.h"
#include <sys/time.h>
@@ -4450,7 +4496,7 @@ int main() {
struct ntptimeval n;
; return 0; }
EOF
-if { (eval echo configure:4454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_ntptimeval=yes
else
@@ -4471,12 +4517,12 @@ EOF
fi
echo $ac_n "checking struct ntptimeval for time.tv_nsec""... $ac_c" 1>&6
-echo "configure:4475: checking struct ntptimeval for time.tv_nsec" >&5
-if eval "test \"\${ac_cv_struct_ntptimeval_tv_nsec+set}\" = set"; then
+echo "configure:4521: checking struct ntptimeval for time.tv_nsec" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_ntptimeval_tv_nsec'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4480 "configure"
+#line 4526 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_TIME_H
@@ -4499,7 +4545,7 @@ extern struct ntptimeval *ntv;
return ntv->time.tv_nsec;
; return 0; }
EOF
-if { (eval echo configure:4503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_ntptimeval_tv_nsec=yes
else
@@ -4521,12 +4567,12 @@ EOF
fi
echo $ac_n "checking for struct timespec in struct ntptimeval""... $ac_c" 1>&6
-echo "configure:4525: checking for struct timespec in struct ntptimeval" >&5
-if eval "test \"\${ac_cv_struct_ntptimeval_timespec+set}\" = set"; then
+echo "configure:4571: checking for struct timespec in struct ntptimeval" >&5
+if eval "test \"`echo '$''{'ac_cv_struct_ntptimeval_timespec'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4530 "configure"
+#line 4576 "configure"
#include "confdefs.h"
#include <sys/time.h>
#include <sys/timex.h>
@@ -4534,7 +4580,7 @@ int main() {
struct ntptimeval n; n.time.tv_nsec = 0;
; return 0; }
EOF
-if { (eval echo configure:4538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4584: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_ntptimeval_timespec=yes
else
@@ -4555,21 +4601,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:4559: checking for inline" >&5
-if eval "test \"\${ac_cv_c_inline+set}\" = set"; then
+echo "configure:4605: checking for inline" >&5
+if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 4566 "configure"
+#line 4612 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:4573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -4595,14 +4641,14 @@ EOF
esac
echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:4599: checking whether char is unsigned" >&5
-if eval "test \"\${ac_cv_c_char_unsigned+set}\" = set"; then
+echo "configure:4645: 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 4606 "configure"
+#line 4652 "configure"
#include "confdefs.h"
#ifdef __CHAR_UNSIGNED__
yes
@@ -4624,7 +4670,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 4628 "configure"
+#line 4674 "configure"
#include "confdefs.h"
/* volatile prevents gcc2 from optimizing the test away on sparcs. */
#if !defined(__STDC__) || __STDC__ != 1
@@ -4634,7 +4680,7 @@ main() {
volatile char c = 255; exit(c < 0);
}
EOF
-if { (eval echo configure:4638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4684: \"$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
@@ -4659,15 +4705,15 @@ fi
case "$host" in
$target)
echo $ac_n "checking size of signed char""... $ac_c" 1>&6
-echo "configure:4663: checking size of signed char" >&5
-if eval "test \"\${ac_cv_sizeof_signed_char+set}\" = set"; then
+echo "configure:4709: 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
if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 4671 "configure"
+#line 4717 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -4678,7 +4724,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:4682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4728: \"$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
@@ -4701,15 +4747,15 @@ EOF
*) case "$target" in
*-*-vxworks*)
echo $ac_n "checking size of signed char""... $ac_c" 1>&6
-echo "configure:4705: checking size of signed char" >&5
-if eval "test \"\${ac_cv_sizeof_signed_char+set}\" = set"; then
+echo "configure:4751: 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
if test "$cross_compiling" = yes; then
ac_cv_sizeof_signed_char=1
else
cat > conftest.$ac_ext <<EOF
-#line 4713 "configure"
+#line 4759 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -4720,7 +4766,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:4724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4770: \"$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
@@ -4749,15 +4795,15 @@ esac
case "$host" in
$target)
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:4753: checking size of int" >&5
-if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
+echo "configure:4799: 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
if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 4761 "configure"
+#line 4807 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -4768,7 +4814,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:4772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4818: \"$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
@@ -4791,15 +4837,15 @@ EOF
*) case "$target" in
*-*-vxworks*)
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:4795: checking size of int" >&5
-if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
+echo "configure:4841: 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
if test "$cross_compiling" = yes; then
ac_cv_sizeof_int=4
else
cat > conftest.$ac_ext <<EOF
-#line 4803 "configure"
+#line 4849 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -4810,7 +4856,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:4814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4860: \"$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
@@ -4839,15 +4885,15 @@ esac
case "$host" in
$target)
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:4843: checking size of long" >&5
-if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
+echo "configure:4889: 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
if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 4851 "configure"
+#line 4897 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -4858,7 +4904,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:4862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4908: \"$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
@@ -4881,15 +4927,15 @@ EOF
*) case "$target" in
*-*-vxworks*)
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:4885: checking size of long" >&5
-if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
+echo "configure:4931: 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
if test "$cross_compiling" = yes; then
ac_cv_sizeof_long=4
else
cat > conftest.$ac_ext <<EOF
-#line 4893 "configure"
+#line 4939 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -4900,7 +4946,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:4904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4950: \"$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
@@ -4927,12 +4973,12 @@ EOF
esac
echo $ac_n "checking for s_char""... $ac_c" 1>&6
-echo "configure:4931: checking for s_char" >&5
-if eval "test \"\${ac_cv_type_s_char+set}\" = set"; then
+echo "configure:4977: 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 4936 "configure"
+#line 4982 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -4943,19 +4989,17 @@ EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "(^|[^a-zA-Z_0-9])s_char[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
- eval "ac_cv_type_s_char=yes"
+ ac_cv_type_s_char=yes
else
rm -rf conftest*
- eval "ac_cv_type_s_char=no"
+ ac_cv_type_s_char=no
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_type_'s_char`\" = yes"; then
- echo "$ac_t""yes" 1>&6
-else
- echo "$ac_t""no" 1>&6
- cat >> confdefs.h <<EOF
+echo "$ac_t""$ac_cv_type_s_char" 1>&6
+if test $ac_cv_type_s_char = no; then
+ cat >> confdefs.h <<\EOF
#define s_char signed char
EOF
@@ -4992,12 +5036,12 @@ EOF
;;
esac
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:4996: checking for uid_t in sys/types.h" >&5
-if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
+echo "configure:5040: 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 5001 "configure"
+#line 5045 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -5031,12 +5075,12 @@ case "$target" in
for ac_func in __adjtimex __ntp_gettime
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5035: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5079: 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 5040 "configure"
+#line 5084 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5045,7 +5089,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5055,12 +5098,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5107: \"$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
@@ -5097,12 +5140,12 @@ case "$target" in
*) for ac_func in clock_settime
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5101: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5144: 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 5106 "configure"
+#line 5149 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5111,7 +5154,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5121,12 +5163,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5172: \"$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
@@ -5155,12 +5197,12 @@ esac
for ac_func in daemon getbootfile getdtablesize getrusage
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5159: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5201: 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 5164 "configure"
+#line 5206 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5169,7 +5211,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5179,12 +5220,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5229: \"$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
@@ -5211,12 +5252,12 @@ done
for ac_func in gettimeofday
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5215: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5256: 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 5220 "configure"
+#line 5261 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5225,7 +5266,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5235,12 +5275,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5284: \"$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
@@ -5270,12 +5310,12 @@ case "$target" in
*) for ac_func in getuid
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5274: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5314: 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 5279 "configure"
+#line 5319 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5284,7 +5324,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5294,12 +5333,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5342: \"$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
@@ -5328,12 +5367,12 @@ esac
for ac_func in K_open kvm_open memcpy memmove memset
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5332: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5371: 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 5337 "configure"
+#line 5376 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5342,7 +5381,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5352,12 +5390,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5399: \"$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
@@ -5388,12 +5426,12 @@ case "$target" in
*) for ac_func in mkstemp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5392: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5430: 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 5397 "configure"
+#line 5435 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5402,7 +5440,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5412,12 +5449,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5458: \"$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
@@ -5446,12 +5483,12 @@ esac
for ac_func in mktime
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5450: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5487: 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 5455 "configure"
+#line 5492 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5460,7 +5497,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5470,12 +5506,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5515: \"$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
@@ -5517,12 +5553,12 @@ case "$target" in
for ac_func in memlk
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5521: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5557: 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 5526 "configure"
+#line 5562 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5531,7 +5567,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5541,12 +5576,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5585: \"$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
@@ -5573,12 +5608,12 @@ done
for ac_func in mlockall
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5577: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5612: 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 5582 "configure"
+#line 5617 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5587,7 +5622,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5597,12 +5631,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5640: \"$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
@@ -5630,12 +5664,12 @@ done
*) for ac_func in mlockall
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5634: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5668: 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 5639 "configure"
+#line 5673 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5644,7 +5678,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5654,12 +5687,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5696: \"$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
@@ -5688,12 +5721,12 @@ esac
for ac_func in nice nlist
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5692: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5725: 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 5697 "configure"
+#line 5730 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5702,7 +5735,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5712,12 +5744,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5753: \"$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
@@ -5748,12 +5780,12 @@ case "$target" in
*) for ac_func in ntp_adjtime ntp_gettime
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5752: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5784: 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 5757 "configure"
+#line 5789 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5762,7 +5794,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5772,12 +5803,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5812: \"$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
@@ -5806,12 +5837,12 @@ esac
for ac_func in plock pututline pututxline rtprio
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5810: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5841: 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 5815 "configure"
+#line 5846 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5820,7 +5851,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5830,12 +5860,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5869: \"$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
@@ -5862,12 +5892,12 @@ done
for ac_func in random srandom mrand48 srand48
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5866: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5896: 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 5871 "configure"
+#line 5901 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5876,7 +5906,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5886,12 +5915,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5924: \"$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
@@ -5925,12 +5954,12 @@ case "$target" in
*) for ac_func in sched_setscheduler
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5929: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:5958: 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 5934 "configure"
+#line 5963 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5939,7 +5968,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -5949,12 +5977,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:5958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5986: \"$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
@@ -5983,12 +6011,12 @@ esac
for ac_func in setlinebuf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5987: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:6015: 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 5992 "configure"
+#line 6020 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5997,7 +6025,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -6007,12 +6034,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:6016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6043: \"$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
@@ -6039,12 +6066,12 @@ done
for ac_func in setpgid setpriority setsid settimeofday setvbuf sigaction
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6043: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:6070: 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 6048 "configure"
+#line 6075 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6053,7 +6080,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -6063,12 +6089,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:6072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6098: \"$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
@@ -6095,12 +6121,12 @@ done
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:6099: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:6125: 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 6104 "configure"
+#line 6130 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6109,7 +6135,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -6119,12 +6144,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:6128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6153: \"$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
@@ -6151,12 +6176,12 @@ done
for ac_func in strerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6155: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:6180: 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 6160 "configure"
+#line 6185 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6165,7 +6190,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -6175,12 +6199,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:6184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6208: \"$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
@@ -6219,12 +6243,12 @@ case "$target" in
*) for ac_func in timer_create timer_settime
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6223: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:6247: 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 6228 "configure"
+#line 6252 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6233,7 +6257,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -6243,12 +6266,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:6252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6275: \"$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
@@ -6281,12 +6304,12 @@ case "$target" in
*) for ac_func in umask
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6285: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:6308: 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 6290 "configure"
+#line 6313 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6295,7 +6318,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -6305,12 +6327,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:6314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6336: \"$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
@@ -6339,12 +6361,12 @@ esac
for ac_func in uname updwtmp updwtmpx vsprintf
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6343: checking for $ac_func" >&5
-if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+echo "configure:6365: 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 6348 "configure"
+#line 6370 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6353,7 +6375,6 @@ else
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
-char (*f)();
int main() {
@@ -6363,12 +6384,12 @@ int main() {
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-f = $ac_func;
+$ac_func();
#endif
; return 0; }
EOF
-if { (eval echo configure:6372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6393: \"$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
@@ -6394,12 +6415,12 @@ done
echo $ac_n "checking number of arguments to gettimeofday()""... $ac_c" 1>&6
-echo "configure:6398: checking number of arguments to gettimeofday()" >&5
-if eval "test \"\${ac_cv_func_Xettimeofday_nargs+set}\" = set"; then
+echo "configure:6419: 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 6403 "configure"
+#line 6424 "configure"
#include "confdefs.h"
#include <sys/time.h>
int main() {
@@ -6409,7 +6430,7 @@ settimeofday((struct timeval*)0,(struct timezone*)0);
; return 0; }
EOF
-if { (eval echo configure:6413: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_func_Xettimeofday_nargs=2
else
@@ -6431,12 +6452,12 @@ EOF
fi
echo $ac_n "checking number of arguments taken by setpgrp()""... $ac_c" 1>&6
-echo "configure:6435: checking number of arguments taken by setpgrp()" >&5
-if eval "test \"\${ac_cv_func_setpgrp_nargs+set}\" = set"; then
+echo "configure:6456: 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 6440 "configure"
+#line 6461 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_TYPES_H
@@ -6450,7 +6471,7 @@ int main() {
setpgrp(0,0);
; return 0; }
EOF
-if { (eval echo configure:6454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_func_setpgrp_nargs=2
else
@@ -6475,12 +6496,12 @@ save_CFLAGS=$CFLAGS
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:6479: checking argument pointer type of qsort()'s compare function and base" >&5
-if eval "test \"\${ac_cv_func_qsort_argtype+set}\" = set"; then
+echo "configure:6500: 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 6484 "configure"
+#line 6505 "configure"
#include "confdefs.h"
#include "l_stdlib.h"
@@ -6503,7 +6524,7 @@ qsort(base, 2, sizeof(char *), sortfunc);
; return 0; }
EOF
-if { (eval echo configure:6507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6528: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_func_qsort_argtype=void
else
@@ -6529,12 +6550,12 @@ esac
CFLAGS=$save_CFLAGS
echo $ac_n "checking if we need to declare 'errno'""... $ac_c" 1>&6
-echo "configure:6533: checking if we need to declare 'errno'" >&5
-if eval "test \"\${ac_cv_decl_errno+set}\" = set"; then
+echo "configure:6554: checking if we need to declare 'errno'" >&5
+if eval "test \"`echo '$''{'ac_cv_decl_errno'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6538 "configure"
+#line 6559 "configure"
#include "confdefs.h"
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -6543,7 +6564,7 @@ int main() {
errno = 0;
; return 0; }
EOF
-if { (eval echo configure:6547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_decl_errno=no
else
@@ -6564,12 +6585,12 @@ EOF
esac
echo $ac_n "checking if we may declare 'h_errno'""... $ac_c" 1>&6
-echo "configure:6568: checking if we may declare 'h_errno'" >&5
-if eval "test \"\${ac_cv_decl_h_errno+set}\" = set"; then
+echo "configure:6589: checking if we may declare 'h_errno'" >&5
+if eval "test \"`echo '$''{'ac_cv_decl_h_errno'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6573 "configure"
+#line 6594 "configure"
#include "confdefs.h"
#include <sys/types.h>
#ifdef HAVE_NETINET_IN_H
@@ -6588,7 +6609,7 @@ int main() {
extern int h_errno;
; return 0; }
EOF
-if { (eval echo configure:6592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_decl_h_errno=yes
else
@@ -6608,13 +6629,13 @@ EOF
;;
esac
-echo $ac_n "checking if declaring 'char *sys_errlist' is ok""... $ac_c" 1>&6
-echo "configure:6613: checking if declaring 'char *sys_errlist' is ok" >&5
-if eval "test \"\${ac_cv_decl_sys_errlist+set}\" = set"; then
+echo $ac_n "checking if declaring 'char *sys_errlist[]' is ok""... $ac_c" 1>&6
+echo "configure:6634: 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 6618 "configure"
+#line 6639 "configure"
#include "confdefs.h"
#include <stdio.h>
#ifdef HAVE_ERRNO_H
@@ -6625,7 +6646,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:6629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_decl_sys_errlist=yes
else
@@ -6646,12 +6667,12 @@ EOF
esac
echo $ac_n "checking if declaring 'syscall()' is ok""... $ac_c" 1>&6
-echo "configure:6650: checking if declaring 'syscall()' is ok" >&5
-if eval "test \"\${ac_cv_decl_syscall+set}\" = set"; then
+echo "configure:6671: 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 6655 "configure"
+#line 6676 "configure"
#include "confdefs.h"
#ifdef HAVE_SYS_TYPES_H
@@ -6670,7 +6691,7 @@ int main() {
extern int syscall P((int, ...));
; return 0; }
EOF
-if { (eval echo configure:6674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_decl_syscall=yes
else
@@ -6691,13 +6712,13 @@ EOF
esac
case "$target" in
- *-*-osf45*)
+ *-*-osf[45]*)
cat >> confdefs.h <<\EOF
#define DECL_PLOCK_0 1
EOF
cat >> confdefs.h <<\EOF
-#define DECL_STIME_0 1
+#define DECL_STIME_1 1
EOF
;;
@@ -6957,8 +6978,8 @@ EOF
esac
echo $ac_n "checking if we should use a streams device for ifconfig""... $ac_c" 1>&6
-echo "configure:6961: checking if we should use a streams device for ifconfig" >&5
-if eval "test \"\${ac_cv_var_use_streams_device_for_ifconfig+set}\" = set"; then
+echo "configure:6982: 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
ac_cv_var_use_streams_device_for_ifconfig=no
@@ -6967,8 +6988,8 @@ fi
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:6971: checking if we need extra room for SO_RCVBUF" >&5
-if eval "test \"\${ac_cv_var_rcvbuf_slop+set}\" = set"; then
+echo "configure:6992: 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
ans=no
@@ -6989,8 +7010,8 @@ EOF
esac
echo $ac_n "checking if we will open the broadcast socket""... $ac_c" 1>&6
-echo "configure:6993: checking if we will open the broadcast socket" >&5
-if eval "test \"\${ac_cv_var_open_bcast_socket+set}\" = set"; then
+echo "configure:7014: 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
ans=yes
@@ -7014,8 +7035,8 @@ EOF
esac
echo $ac_n "checking if we want the HPUX version of FindConfig()""... $ac_c" 1>&6
-echo "configure:7018: checking if we want the HPUX version of FindConfig()" >&5
-if eval "test \"\${ac_cv_var_hpux_findconfig+set}\" = set"; then
+echo "configure:7039: 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
ans=no
@@ -7036,8 +7057,8 @@ EOF
esac
echo $ac_n "checking if process groups are set with -pid""... $ac_c" 1>&6
-echo "configure:7040: checking if process groups are set with -pid" >&5
-if eval "test \"\${ac_cv_arg_setpgrp_negpid+set}\" = set"; then
+echo "configure:7061: 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
case "$target" in
@@ -7072,8 +7093,8 @@ EOF
esac
echo $ac_n "checking if we need a ctty for F_SETOWN""... $ac_c" 1>&6
-echo "configure:7076: checking if we need a ctty for F_SETOWN" >&5
-if eval "test \"\${ac_cv_func_ctty_for_f_setown+set}\" = set"; then
+echo "configure:7097: 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
case "$target" in
@@ -7105,7 +7126,7 @@ esac
ntp_warning='GRONK'
echo $ac_n "checking if we'll use clock_settime or settimeofday or stime""... $ac_c" 1>&6
-echo "configure:7109: checking if we'll use clock_settime or settimeofday or stime" >&5
+echo "configure:7130: 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=''
@@ -7134,8 +7155,8 @@ case "$ntp_warning" in
esac
echo $ac_n "checking if we have a losing syscall()""... $ac_c" 1>&6
-echo "configure:7138: checking if we have a losing syscall()" >&5
-if eval "test \"\${ac_cv_var_syscall_bug+set}\" = set"; then
+echo "configure:7159: 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
case "$target" in
@@ -7157,8 +7178,8 @@ EOF
esac
echo $ac_n "checking for Streams/TLI""... $ac_c" 1>&6
-echo "configure:7161: checking for Streams/TLI" >&5
-if eval "test \"\${ac_cv_var_streams_tli+set}\" = set"; then
+echo "configure:7182: 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
case "$ac_cv_header_sys_stropts_h" in
@@ -7186,12 +7207,12 @@ EOF
esac
echo $ac_n "checking for SIGIO""... $ac_c" 1>&6
-echo "configure:7190: checking for SIGIO" >&5
-if eval "test \"\${ac_cv_hdr_def_sigio+set}\" = set"; then
+echo "configure:7211: 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 7195 "configure"
+#line 7216 "configure"
#include "confdefs.h"
#include <signal.h>
#ifdef SIGIO
@@ -7214,8 +7235,8 @@ fi
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:7218: checking if we want to use signalled IO" >&5
-if eval "test \"\${ac_cv_var_signalled_io+set}\" = set"; then
+echo "configure:7239: 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
ans=no
@@ -7265,12 +7286,12 @@ EOF
esac
echo $ac_n "checking for SIGPOLL""... $ac_c" 1>&6
-echo "configure:7269: checking for SIGPOLL" >&5
-if eval "test \"\${ac_cv_hdr_def_sigpoll+set}\" = set"; then
+echo "configure:7290: 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 7274 "configure"
+#line 7295 "configure"
#include "confdefs.h"
#include <signal.h>
#ifdef SIGPOLL
@@ -7293,12 +7314,12 @@ fi
echo "$ac_t""$ac_cv_hdr_def_sigpoll" 1>&6
echo $ac_n "checking for SIGSYS""... $ac_c" 1>&6
-echo "configure:7297: checking for SIGSYS" >&5
-if eval "test \"\${ac_cv_hdr_def_sigsys+set}\" = set"; then
+echo "configure:7318: 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 7302 "configure"
+#line 7323 "configure"
#include "confdefs.h"
#include <signal.h>
#ifdef SIGSYS
@@ -7321,8 +7342,8 @@ fi
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:7325: checking if we can use SIGPOLL for UDP I/O" >&5
-if eval "test \"\${ac_cv_var_use_udp_sigpoll+set}\" = set"; then
+echo "configure:7346: 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
ans=no
@@ -7376,8 +7397,8 @@ EOF
esac
echo $ac_n "checking if we can use SIGPOLL for TTY I/O""... $ac_c" 1>&6
-echo "configure:7380: checking if we can use SIGPOLL for TTY I/O" >&5
-if eval "test \"\${ac_cv_var_use_tty_sigpoll+set}\" = set"; then
+echo "configure:7401: 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
ans=no
@@ -7433,12 +7454,12 @@ esac
case "$ac_cv_header_sys_sio_h" in
yes)
echo $ac_n "checking sys/sio.h for TIOCDCDTIMESTAMP""... $ac_c" 1>&6
-echo "configure:7437: checking sys/sio.h for TIOCDCDTIMESTAMP" >&5
-if eval "test \"\${ac_cv_hdr_def_tiocdcdtimestamp+set}\" = set"; then
+echo "configure:7458: checking sys/sio.h for TIOCDCDTIMESTAMP" >&5
+if eval "test \"`echo '$''{'ac_cv_hdr_def_tiocdcdtimestamp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7442 "configure"
+#line 7463 "configure"
#include "confdefs.h"
#include <sys/sio.h>
#ifdef TIOCDCDTIMESTAMP
@@ -7462,9 +7483,15 @@ echo "$ac_t""$ac_cv_hdr_def_tiocdcdtimestamp" 1>&6
;;
esac
+case "$ac_cv_hdr_def_tiocdcdtimestamp" in
+ yes)
+ ac_cv_var_oncore_ok=yes
+ ;;
+esac
+
echo $ac_n "checking if nlist() values might require extra indirection""... $ac_c" 1>&6
-echo "configure:7467: checking if nlist() values might require extra indirection" >&5
-if eval "test \"\${ac_cv_var_nlist_extra_indirection+set}\" = set"; then
+echo "configure:7494: 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
ans=no
@@ -7485,8 +7512,8 @@ EOF
esac
echo $ac_n "checking for a minimum recommended value of tickadj""... $ac_c" 1>&6
-echo "configure:7489: checking for a minimum recommended value of tickadj" >&5
-if eval "test \"\${ac_cv_var_min_rec_tickadj+set}\" = set"; then
+echo "configure:7516: 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
ans=no
@@ -7508,8 +7535,8 @@ EOF
esac
echo $ac_n "checking if the TTY code permits PARENB and IGNPAR""... $ac_c" 1>&6
-echo "configure:7512: checking if the TTY code permits PARENB and IGNPAR" >&5
-if eval "test \"\${ac_cv_var_no_parenb_ignpar+set}\" = set"; then
+echo "configure:7539: 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
ans=no
@@ -7533,7 +7560,7 @@ EOF
esac
echo $ac_n "checking if we're including debugging code""... $ac_c" 1>&6
-echo "configure:7537: checking if we're including debugging code" >&5
+echo "configure:7564: 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"
@@ -7551,7 +7578,7 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking for a the number of minutes in a DST adjustment""... $ac_c" 1>&6
-echo "configure:7555: checking for a the number of minutes in a DST adjustment" >&5
+echo "configure:7582: checking for a the number of minutes in a DST adjustment" >&5
# Check whether --enable-dst_minutes or --disable-dst_minutes was given.
if test "${enable_dst_minutes+set}" = set; then
enableval="$enable_dst_minutes"
@@ -7567,8 +7594,8 @@ EOF
echo "$ac_t""$ans" 1>&6
echo $ac_n "checking if we have the tty_clk line discipline/streams module""... $ac_c" 1>&6
-echo "configure:7571: checking if we have the tty_clk line discipline/streams module" >&5
-if eval "test \"\${ac_cv_var_tty_clk+set}\" = set"; then
+echo "configure:7598: 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
case "$ac_cv_header_sys_clkdefs_h$ac_cv_hdr_def_tiocdcdtimestamp" in
@@ -7585,8 +7612,8 @@ EOF
esac
echo $ac_n "checking for the ppsclock streams module""... $ac_c" 1>&6
-echo "configure:7589: checking for the ppsclock streams module" >&5
-if eval "test \"\${ac_cv_var_ppsclock+set}\" = set"; then
+echo "configure:7616: 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
ac_cv_var_ppsclock=$ac_cv_struct_ppsclockev
@@ -7601,15 +7628,15 @@ EOF
esac
echo $ac_n "checking for kernel multicast support""... $ac_c" 1>&6
-echo "configure:7605: checking for kernel multicast support" >&5
-if eval "test \"\${ac_cv_var_mcast+set}\" = set"; then
+echo "configure:7632: 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
ac_cv_var_mcast=no
case "$target" in
i386-sequent-sysv4) ;;
*) cat > conftest.$ac_ext <<EOF
-#line 7613 "configure"
+#line 7640 "configure"
#include "confdefs.h"
#include <netinet/in.h>
#ifdef IP_ADD_MEMBERSHIP
@@ -7636,8 +7663,8 @@ EOF
esac
echo $ac_n "checking availability of ntp_{adj,get}time()""... $ac_c" 1>&6
-echo "configure:7640: checking availability of ntp_{adj,get}time()" >&5
-if eval "test \"\${ac_cv_var_ntp_syscalls+set}\" = set"; then
+echo "configure:7667: 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
ac_cv_var_ntp_syscalls=no
@@ -7650,7 +7677,7 @@ else
ac_cv_var_ntp_syscalls=libc
;;
*) cat > conftest.$ac_ext <<EOF
-#line 7654 "configure"
+#line 7681 "configure"
#include "confdefs.h"
#include <sys/syscall.h>
#if defined(SYS_ntp_gettime) && defined(SYS_ntp_adjtime)
@@ -7690,12 +7717,12 @@ EOF
esac
echo $ac_n "checking if sys/timex.h has STA_FLL""... $ac_c" 1>&6
-echo "configure:7694: checking if sys/timex.h has STA_FLL" >&5
-if eval "test \"\${ac_cv_var_sta_fll+set}\" = set"; then
+echo "configure:7721: 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 7699 "configure"
+#line 7726 "configure"
#include "confdefs.h"
#include <sys/timex.h>
#ifdef STA_FLL
@@ -7718,8 +7745,8 @@ fi
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:7722: checking if we have kernel PLL support" >&5
-if eval "test \"\${ac_cv_var_kernel_pll+set}\" = set"; then
+echo "configure:7749: 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
case "$ac_cv_header_sys_timex_h$ac_cv_struct_ntptimeval$ac_cv_var_sta_fll$ac_cv_var_ntp_syscalls" in
@@ -7742,8 +7769,8 @@ EOF
esac
echo $ac_n "checking if SIOCGIFCONF returns buffer size in the buffer""... $ac_c" 1>&6
-echo "configure:7746: checking if SIOCGIFCONF returns buffer size in the buffer" >&5
-if eval "test \"\${ac_cv_var_size_returned_in_buffer+set}\" = set"; then
+echo "configure:7773: 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
ans=no
@@ -7771,8 +7798,8 @@ esac
echo $ac_n "checking if we want to use MD5 authentication""... $ac_c" 1>&6
-echo "configure:7775: checking if we want to use MD5 authentication" >&5
-if eval "test \"\${ac_cv_var_use_md5+set}\" = set"; then
+echo "configure:7802: 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
# Check whether --enable-md5 or --disable-md5 was given.
@@ -7796,10 +7823,10 @@ esac
# Check for ioctls TIOCGPPSEV
echo $ac_n "checking ioctl TIOCGPPSEV""... $ac_c" 1>&6
-echo "configure:7800: checking ioctl TIOCGPPSEV" >&5
+echo "configure:7827: checking ioctl TIOCGPPSEV" >&5
if test "$ac_cv_header_termios_h" = "yes"; then
cat > conftest.$ac_ext <<EOF
-#line 7803 "configure"
+#line 7830 "configure"
#include "confdefs.h"
#include <termios.h>
#ifdef TIOCGPPSEV
@@ -7820,7 +7847,6 @@ rm -f conftest*
else
ntp_ok=no
fi
-
if test "$ntp_ok" = "yes"; then
cat >> confdefs.h <<\EOF
#define HAVE_TIOCGPPSEV 1
@@ -7832,10 +7858,10 @@ echo "$ac_t""$ntp_ok" 1>&6
# Check for ioctls TIOCSPPS
echo $ac_n "checking ioctl TIOCSPPS""... $ac_c" 1>&6
-echo "configure:7836: checking ioctl TIOCSPPS" >&5
+echo "configure:7862: checking ioctl TIOCSPPS" >&5
if test "$ac_cv_header_termios_h" = "yes"; then
cat > conftest.$ac_ext <<EOF
-#line 7839 "configure"
+#line 7865 "configure"
#include "confdefs.h"
#include <termios.h>
#ifdef TIOCSPPS
@@ -7867,10 +7893,10 @@ echo "$ac_t""$ntp_ok" 1>&6
# Check for ioctls CIOGETEV
echo $ac_n "checking ioctl CIOGETEV""... $ac_c" 1>&6
-echo "configure:7871: checking ioctl CIOGETEV" >&5
+echo "configure:7897: checking ioctl CIOGETEV" >&5
if test "$ac_cv_header_sys_ppsclock_h" = "yes"; then
cat > conftest.$ac_ext <<EOF
-#line 7874 "configure"
+#line 7900 "configure"
#include "confdefs.h"
#include <sys/ppsclock.h>
#ifdef CIOGETEV
@@ -7891,7 +7917,6 @@ rm -f conftest*
else
ntp_ok=no
fi
-
if test "$ntp_ok" = "yes"; then
ac_cv_var_oncore_ok=yes
cat >> confdefs.h <<\EOF
@@ -7922,17 +7947,17 @@ esac
# Check for ioctls TIOCGSERIAL, TIOCSSERIAL, ASYNC_PPS_CD_POS, ASYNC_PPS_CD_NEG
ac_safe=`echo "linux/serial.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for linux/serial.h""... $ac_c" 1>&6
-echo "configure:7926: checking for linux/serial.h" >&5
-if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+echo "configure:7951: checking for linux/serial.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 7931 "configure"
+#line 7956 "configure"
#include "confdefs.h"
#include <linux/serial.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7961: \"$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*
@@ -7954,11 +7979,11 @@ else
fi
echo $ac_n "checking ioctl TIOCGSERIAL""... $ac_c" 1>&6
-echo "configure:7958: checking ioctl TIOCGSERIAL" >&5
+echo "configure:7983: checking ioctl TIOCGSERIAL" >&5
case "$ac_cv_header_sys_ppsclock_h$ac_cv_header_linux_serial_h" in
yesyes)
cat > conftest.$ac_ext <<EOF
-#line 7962 "configure"
+#line 7987 "configure"
#include "confdefs.h"
#include <sys/time.h>
typedef int u_int;
@@ -7991,7 +8016,6 @@ rm -f conftest*
ntp_ok=no
;;
esac
-
if test "$ntp_ok" = "yes"; then
cat >> confdefs.h <<\EOF
#define HAVE_TIO_SERIAL_STUFF 1
@@ -8000,12 +8024,27 @@ EOF
fi
echo "$ac_t""$ntp_ok" 1>&6
+# Check for SHMEM_STATUS support
+echo $ac_n "checking SHMEM_STATUS support""... $ac_c" 1>&6
+echo "configure:8030: checking SHMEM_STATUS support" >&5
+case "$ac_cv_header_sys_mman_h" in
+ yes) ntp_ok=yes ;;
+ *) ntp_ok=no ;;
+esac
+if test "$ntp_ok" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define ONCORE_SHMEM_STATUS 1
+EOF
+
+fi
+echo "$ac_t""$ntp_ok" 1>&6
+
ntp_refclock=no
# HPUX only, and by explicit request
echo $ac_n "checking Datum/Bancomm bc635/VME interface""... $ac_c" 1>&6
-echo "configure:8009: checking Datum/Bancomm bc635/VME interface" >&5
+echo "configure:8048: 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"
@@ -8029,7 +8068,7 @@ esac
#HPUX only, and only by explicit request
echo $ac_n "checking TrueTime GPS receiver/VME interface""... $ac_c" 1>&6
-echo "configure:8033: checking TrueTime GPS receiver/VME interface" >&5
+echo "configure:8072: 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"
@@ -8052,7 +8091,7 @@ case "$ntp_ok$target" in
esac
echo $ac_n "checking for PCL720 clock support""... $ac_c" 1>&6
-echo "configure:8056: checking for PCL720 clock support" >&5
+echo "configure:8095: 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
@@ -8068,7 +8107,7 @@ esac
echo "$ac_t""$ans" 1>&6
echo $ac_n "checking for SHM clock attached thru shared memory""... $ac_c" 1>&6
-echo "configure:8072: checking for SHM clock attached thru shared memory" >&5
+echo "configure:8111: 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"
@@ -8087,7 +8126,7 @@ fi
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:8091: checking for default inclusion of all suitable non-PARSE clocks" >&5
+echo "configure:8130: 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"
@@ -8099,7 +8138,7 @@ fi
echo "$ac_t""$ntp_eac" 1>&6
echo $ac_n "checking if we have support for PARSE clocks""... $ac_c" 1>&6
-echo "configure:8103: checking if we have support for PARSE clocks" >&5
+echo "configure:8142: 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
@@ -8109,16 +8148,24 @@ case "$ac_cv_header_termio_h$ac_cv_header_termios_h" in
esac
echo "$ac_t""$ntp_canparse" 1>&6
+echo $ac_n "checking if we have support for audio clocks""... $ac_c" 1>&6
+echo "configure:8153: checking if we have support for audio clocks" >&5
+case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h" in
+ *yes*) ntp_canaudio=yes ;;
+ *) ntp_canaudio=no ;;
+esac
+echo "$ac_t""$ntp_canaudio" 1>&6
+
# Requires modem control
echo $ac_n "checking ACTS modem service""... $ac_c" 1>&6
-echo "configure:8115: checking ACTS modem service" >&5
+echo "configure:8162: 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 8122 "configure"
+#line 8169 "configure"
#include "confdefs.h"
#include <termios.h>
#ifdef HAVE_SYS_IOCTL_H
@@ -8151,7 +8198,7 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking Arbiter 1088A/B GPS receiver""... $ac_c" 1>&6
-echo "configure:8155: checking Arbiter 1088A/B GPS receiver" >&5
+echo "configure:8202: 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"
@@ -8170,7 +8217,7 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking Arcron MSF receiver""... $ac_c" 1>&6
-echo "configure:8174: checking Arcron MSF receiver" >&5
+echo "configure:8221: 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"
@@ -8189,7 +8236,7 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking Austron 2200A/2201A GPS receiver""... $ac_c" 1>&6
-echo "configure:8193: checking Austron 2200A/2201A GPS receiver" >&5
+echo "configure:8240: 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"
@@ -8208,7 +8255,7 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking PPS interface""... $ac_c" 1>&6
-echo "configure:8212: checking PPS interface" >&5
+echo "configure:8259: checking PPS interface" >&5
# Check whether --enable-ATOM or --disable-ATOM was given.
if test "${enable_ATOM+set}" = set; then
enableval="$enable_ATOM"
@@ -8227,7 +8274,7 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking CHU modem/decoder""... $ac_c" 1>&6
-echo "configure:8231: checking CHU modem/decoder" >&5
+echo "configure:8278: checking CHU modem/decoder" >&5
# Check whether --enable-CHU or --disable-CHU was given.
if test "${enable_CHU+set}" = set; then
enableval="$enable_CHU"
@@ -8247,13 +8294,16 @@ echo "$ac_t""$ntp_ok" 1>&6
ac_refclock_chu=$ntp_ok
echo $ac_n "checking CHU audio/decoder""... $ac_c" 1>&6
-echo "configure:8251: checking CHU audio/decoder" >&5
+echo "configure:8298: checking CHU audio/decoder" >&5
# Check whether --enable-AUDIO-CHU or --disable-AUDIO-CHU was given.
if test "${enable_AUDIO_CHU+set}" = set; then
enableval="$enable_AUDIO_CHU"
ntp_ok=$enableval
else
- ntp_ok=no
+ case "$ntp_eac$ac_refclock_chu$ntp_canaudio" in
+ *no*) ntp_ok=no ;;
+ *) ntp_ok=yes ;;
+esac
fi
if test "$ntp_ok" = "yes"; then
@@ -8263,15 +8313,14 @@ EOF
fi
echo "$ac_t""$ntp_ok" 1>&6
-case "$ntp_ok$ac_refclock_chu$target" in
- yesyes*-*-sunos*) ;;
- yesyes*-*-solaris*) ;;
- yes*) echo "configure: warning: *** But the expected answer is...no ***" 1>&2 ;;
+# We used to check for sunos/solaris target...
+case "$ntp_ok$ac_refclock_chu$ntp_canaudio" in
+ yes*no*) echo "configure: warning: *** But the expected answer is...no ***" 1>&2 ;;
esac
# Not under HP-UX
echo $ac_n "checking Datum Programmable Time System""... $ac_c" 1>&6
-echo "configure:8275: checking Datum Programmable Time System" >&5
+echo "configure:8324: 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"
@@ -8295,16 +8344,35 @@ EOF
fi
echo "$ac_t""$ntp_ok" 1>&6
+echo $ac_n "checking Forum Graphic GPS""... $ac_c" 1>&6
+echo "configure:8349: checking Forum Graphic GPS" >&5
+# Check whether --enable-FG or --disable-FG was given.
+if test "${enable_FG+set}" = set; then
+ enableval="$enable_FG"
+ ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+fi
+
+if test "$ntp_ok" = "yes"; then
+ ntp_refclock=yes
+ cat >> confdefs.h <<\EOF
+#define CLOCK_FG 1
+EOF
+
+fi
+echo "$ac_t""$ntp_ok" 1>&6
+
# Requires modem control
echo $ac_n "checking Heath GC-1000 WWV/WWVH receiver""... $ac_c" 1>&6
-echo "configure:8301: checking Heath GC-1000 WWV/WWVH receiver" >&5
+echo "configure:8369: 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 8308 "configure"
+#line 8376 "configure"
#include "confdefs.h"
#include <termios.h>
#ifdef HAVE_SYS_IOCTL_H
@@ -8337,7 +8405,7 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking HP 58503A GPS receiver""... $ac_c" 1>&6
-echo "configure:8341: checking HP 58503A GPS receiver" >&5
+echo "configure:8409: 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"
@@ -8356,18 +8424,15 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking Sun IRIG audio decoder""... $ac_c" 1>&6
-echo "configure:8360: checking Sun IRIG audio decoder" >&5
+echo "configure:8428: 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"
ntp_ok=$enableval
else
- case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h" in
- *yes*)
- ntp_ok=$ntp_eac
- ;;
- *) ntp_ok=no
- ;;
+ case "$ntp_eac$ntp_canaudio" in
+ *no*) ntp_ok=no ;;
+ *) ntp_ok=yes ;;
esac
fi
@@ -8379,12 +8444,12 @@ EOF
fi
echo "$ac_t""$ntp_ok" 1>&6
-case "$ntp_ok$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h" in
- yesnono) echo "configure: warning: *** But the expected answer is... no ***" 1>&2 ;;
+case "$ntp_ok$ntp_canaudio" in
+ yesno) echo "configure: warning: *** But the expected answer is... no ***" 1>&2 ;;
esac
echo $ac_n "checking Leitch CSD 5300 Master Clock System Driver""... $ac_c" 1>&6
-echo "configure:8388: checking Leitch CSD 5300 Master Clock System Driver" >&5
+echo "configure:8453: 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"
@@ -8403,7 +8468,7 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking local clock reference""... $ac_c" 1>&6
-echo "configure:8407: checking local clock reference" >&5
+echo "configure:8472: 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"
@@ -8422,7 +8487,7 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking EES M201 MSF receiver""... $ac_c" 1>&6
-echo "configure:8426: checking EES M201 MSF receiver" >&5
+echo "configure:8491: 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"
@@ -8442,7 +8507,7 @@ echo "$ac_t""$ntp_ok" 1>&6
# Not Ultrix
echo $ac_n "checking Magnavox MX4200 GPS receiver""... $ac_c" 1>&6
-echo "configure:8446: checking Magnavox MX4200 GPS receiver" >&5
+echo "configure:8511: 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"
@@ -8469,7 +8534,7 @@ case "$ntp_ok$target" in
esac
echo $ac_n "checking NMEA GPS receiver""... $ac_c" 1>&6
-echo "configure:8473: checking NMEA GPS receiver" >&5
+echo "configure:8538: checking NMEA GPS receiver" >&5
# Check whether --enable-NMEA or --disable-NMEA was given.
if test "${enable_NMEA+set}" = set; then
enableval="$enable_NMEA"
@@ -8488,7 +8553,7 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking for ONCORE Motorola VP/UT Oncore GPS""... $ac_c" 1>&6
-echo "configure:8492: checking for ONCORE Motorola VP/UT Oncore GPS" >&5
+echo "configure:8557: checking for ONCORE Motorola VP/UT Oncore GPS" >&5
# Check whether --enable-ONCORE or --disable-ONCORE was given.
if test "${enable_ONCORE+set}" = set; then
enableval="$enable_ONCORE"
@@ -8510,7 +8575,7 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking for Palisade clock""... $ac_c" 1>&6
-echo "configure:8514: checking for Palisade clock" >&5
+echo "configure:8579: checking for Palisade clock" >&5
# Check whether --enable-PALISADE or --disable-PALISADE was given.
if test "${enable_PALISADE+set}" = set; then
enableval="$enable_PALISADE"
@@ -8536,7 +8601,7 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking PST/Traconex 1020 WWV/WWVH receiver""... $ac_c" 1>&6
-echo "configure:8540: checking PST/Traconex 1020 WWV/WWVH receiver" >&5
+echo "configure:8605: 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"
@@ -8556,7 +8621,7 @@ echo "$ac_t""$ntp_ok" 1>&6
# Not Ultrix
echo $ac_n "checking Rockwell Jupiter GPS receiver""... $ac_c" 1>&6
-echo "configure:8560: checking Rockwell Jupiter GPS receiver" >&5
+echo "configure:8625: 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"
@@ -8584,14 +8649,14 @@ esac
# Requires modem control
echo $ac_n "checking PTB modem service""... $ac_c" 1>&6
-echo "configure:8588: checking PTB modem service" >&5
+echo "configure:8653: 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 8595 "configure"
+#line 8660 "configure"
#include "confdefs.h"
#include <termios.h>
#ifdef HAVE_SYS_IOCTL_H
@@ -8624,7 +8689,7 @@ fi
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:8628: checking KSI/Odetics TPRO/S GPS receiver/IRIG interface" >&5
+echo "configure:8693: 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"
@@ -8652,7 +8717,7 @@ case "$ntp_ok$ac_cv_header_sys_tpro" in
esac
echo $ac_n "checking TRAK 8810 GPS receiver""... $ac_c" 1>&6
-echo "configure:8656: checking TRAK 8810 GPS receiver" >&5
+echo "configure:8721: 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"
@@ -8671,7 +8736,7 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking Chrono-log K-series WWVB receiver""... $ac_c" 1>&6
-echo "configure:8675: checking Chrono-log K-series WWVB receiver" >&5
+echo "configure:8740: checking Chrono-log K-series WWVB receiver" >&5
# Check whether --enable-CHRONOLOG or --disable-CHRONOLOG was given.
if test "${enable_CHRONOLOG+set}" = set; then
enableval="$enable_CHRONOLOG"
@@ -8690,7 +8755,7 @@ fi
echo "$ac_t""$ntp_ok" 1>&6
echo $ac_n "checking Dumb generic hh:mm:ss local clock""... $ac_c" 1>&6
-echo "configure:8694: checking Dumb generic hh:mm:ss local clock" >&5
+echo "configure:8759: checking Dumb generic hh:mm:ss local clock" >&5
# Check whether --enable-DUMBCLOCK or --disable-DUMBCLOCK was given.
if test "${enable_DUMBCLOCK+set}" = set; then
enableval="$enable_DUMBCLOCK"
@@ -8708,9 +8773,47 @@ EOF
fi
echo "$ac_t""$ntp_ok" 1>&6
+echo $ac_n "checking Conrad parallel port radio clock""... $ac_c" 1>&6
+echo "configure:8778: checking Conrad parallel port radio clock" >&5
+# Check whether --enable-PCF or --disable-PCF was given.
+if test "${enable_PCF+set}" = set; then
+ enableval="$enable_PCF"
+ ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+fi
+
+if test "$ntp_ok" = "yes"; then
+ ntp_refclock=yes
+ cat >> confdefs.h <<\EOF
+#define CLOCK_PCF 1
+EOF
+
+fi
+echo "$ac_t""$ntp_ok" 1>&6
+
+echo $ac_n "checking Spectracom 8170/Netclock/2 WWVB receiver""... $ac_c" 1>&6
+echo "configure:8797: checking Spectracom 8170/Netclock/2 WWVB receiver" >&5
+# Check whether --enable-SPECTRACOM or --disable-SPECTRACOM was given.
+if test "${enable_SPECTRACOM+set}" = set; then
+ enableval="$enable_SPECTRACOM"
+ ntp_ok=$enableval
+else
+ ntp_ok=$ntp_eac
+fi
+
+if test "$ntp_ok" = "yes"; then
+ ntp_refclock=yes
+ cat >> confdefs.h <<\EOF
+#define CLOCK_SPECTRACOM 1
+EOF
+
+fi
+echo "$ac_t""$ntp_ok" 1>&6
+
# Not on a vax-dec-bsd
echo $ac_n "checking Kinemetrics/TrueTime receivers""... $ac_c" 1>&6
-echo "configure:8714: checking Kinemetrics/TrueTime receivers" >&5
+echo "configure:8817: checking Kinemetrics/TrueTime receivers" >&5
# Check whether --enable-TRUETIME or --disable-TRUETIME was given.
if test "${enable_TRUETIME+set}" = set; then
enableval="$enable_TRUETIME"
@@ -8738,11 +8841,11 @@ case "$ntp_ok$target" in
yesvax-dec-bsd) echo "configure: warning: *** But the expected answer is... no ***" 1>&2 ;;
esac
-echo $ac_n "checking Spectracom 8170/Netclock/2 WWVB receiver""... $ac_c" 1>&6
-echo "configure:8743: 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"
+echo $ac_n "checking Ultralink M320 WWVB receiver""... $ac_c" 1>&6
+echo "configure:8846: checking Ultralink M320 WWVB receiver" >&5
+# Check whether --enable-ULINK or --disable-ULINK was given.
+if test "${enable_ULINK+set}" = set; then
+ enableval="$enable_ULINK"
ntp_ok=$enableval
else
ntp_ok=$ntp_eac
@@ -8751,41 +8854,47 @@ fi
if test "$ntp_ok" = "yes"; then
ntp_refclock=yes
cat >> confdefs.h <<\EOF
-#define CLOCK_WWVB 1
+#define CLOCK_ULINK 1
EOF
fi
echo "$ac_t""$ntp_ok" 1>&6
-echo $ac_n "checking Ultralink M320 WWVB receiver""... $ac_c" 1>&6
-echo "configure:8762: checking Ultralink M320 WWVB receiver" >&5
-# Check whether --enable-ULINK or --disable-ULINK was given.
-if test "${enable_ULINK+set}" = set; then
- enableval="$enable_ULINK"
+echo $ac_n "checking WWV receiver""... $ac_c" 1>&6
+echo "configure:8865: checking WWV receiver" >&5
+# Check whether --enable-WWV or --disable-WWV was given.
+if test "${enable_WWV+set}" = set; then
+ enableval="$enable_WWV"
ntp_ok=$enableval
else
- ntp_ok=$ntp_eac
+ case "$ntp_eac$ntp_canaudio" in
+ *no*) ntp_ok=no ;;
+ *) ntp_ok=yes ;;
+ esac
fi
if test "$ntp_ok" = "yes"; then
ntp_refclock=yes
cat >> confdefs.h <<\EOF
-#define CLOCK_ULINK 1
+#define CLOCK_WWV 1
EOF
fi
echo "$ac_t""$ntp_ok" 1>&6
+case "$ntp_ok$ntp_canaudio" in
+ yesno) echo "configure: warning: *** But the expected answer is... no ***" 1>&2 ;;
+esac
# Requires modem control
echo $ac_n "checking USNO modem service""... $ac_c" 1>&6
-echo "configure:8782: checking USNO modem service" >&5
+echo "configure:8891: 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 8789 "configure"
+#line 8898 "configure"
#include "confdefs.h"
#include <termios.h>
#ifdef HAVE_SYS_IOCTL_H
@@ -8818,7 +8927,7 @@ fi
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:8822: checking for default inclusion of all suitable PARSE clocks" >&5
+echo "configure:8931: 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"
@@ -8848,7 +8957,7 @@ ntp_parseutil=no
ntp_rawdcf=no
echo $ac_n "checking Diem Computime Radio Clock""... $ac_c" 1>&6
-echo "configure:8852: checking Diem Computime Radio Clock" >&5
+echo "configure:8961: 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"
@@ -8873,7 +8982,7 @@ case "$ntp_ok$ntp_canparse" in
esac
echo $ac_n "checking ELV/DCF7000 clock""... $ac_c" 1>&6
-echo "configure:8877: checking ELV/DCF7000 clock" >&5
+echo "configure:8986: checking ELV/DCF7000 clock" >&5
# Check whether --enable-DCF7000 or --disable-DCF7000 was given.
if test "${enable_DCF7000+set}" = set; then
enableval="$enable_DCF7000"
@@ -8898,7 +9007,7 @@ case "$ntp_ok$ntp_canparse" in
esac
echo $ac_n "checking HOPF 6021 clock""... $ac_c" 1>&6
-echo "configure:8902: checking HOPF 6021 clock" >&5
+echo "configure:9011: checking HOPF 6021 clock" >&5
# Check whether --enable-HOPF6021 or --disable-HOPF6021 was given.
if test "${enable_HOPF6021+set}" = set; then
enableval="$enable_HOPF6021"
@@ -8923,7 +9032,7 @@ case "$ntp_ok$ntp_canparse" in
esac
echo $ac_n "checking Meinberg clocks""... $ac_c" 1>&6
-echo "configure:8927: checking Meinberg clocks" >&5
+echo "configure:9036: checking Meinberg clocks" >&5
# Check whether --enable-MEINBERG or --disable-MEINBERG was given.
if test "${enable_MEINBERG+set}" = set; then
enableval="$enable_MEINBERG"
@@ -8948,7 +9057,7 @@ case "$ntp_ok$ntp_canparse" in
esac
echo $ac_n "checking DCF77 raw time code""... $ac_c" 1>&6
-echo "configure:8952: checking DCF77 raw time code" >&5
+echo "configure:9061: 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"
@@ -8977,8 +9086,8 @@ esac
case "$ntp_rawdcf" in
yes)
echo $ac_n "checking if we must enable parity for RAWDCF""... $ac_c" 1>&6
-echo "configure:8981: checking if we must enable parity for RAWDCF" >&5
-if eval "test \"\${ac_cv_var_rawdcf_parity+set}\" = set"; then
+echo "configure:9090: 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
ans=no
@@ -9005,7 +9114,7 @@ EOF
esac
echo $ac_n "checking RCC 8000 clock""... $ac_c" 1>&6
-echo "configure:9009: checking RCC 8000 clock" >&5
+echo "configure:9118: checking RCC 8000 clock" >&5
# Check whether --enable-RCC8000 or --disable-RCC8000 was given.
if test "${enable_RCC8000+set}" = set; then
enableval="$enable_RCC8000"
@@ -9030,7 +9139,7 @@ case "$ntp_ok$ntp_canparse" in
esac
echo $ac_n "checking Schmid DCF77 clock""... $ac_c" 1>&6
-echo "configure:9034: checking Schmid DCF77 clock" >&5
+echo "configure:9143: checking Schmid DCF77 clock" >&5
# Check whether --enable-SCHMID or --disable-SCHMID was given.
if test "${enable_SCHMID+set}" = set; then
enableval="$enable_SCHMID"
@@ -9055,7 +9164,7 @@ case "$ntp_ok$ntp_canparse" in
esac
echo $ac_n "checking Trimble GPS receiver/TAIP protocol""... $ac_c" 1>&6
-echo "configure:9059: checking Trimble GPS receiver/TAIP protocol" >&5
+echo "configure:9168: 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"
@@ -9080,7 +9189,7 @@ case "$ntp_ok$ntp_canparse" in
esac
echo $ac_n "checking Trimble GPS receiver/TSIP protocol""... $ac_c" 1>&6
-echo "configure:9084: checking Trimble GPS receiver/TSIP protocol" >&5
+echo "configure:9193: 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"
@@ -9105,7 +9214,7 @@ case "$ntp_ok$ntp_canparse" in
esac
echo $ac_n "checking WHARTON 400A Series clock""... $ac_c" 1>&6
-echo "configure:9109: checking WHARTON 400A Series clock" >&5
+echo "configure:9218: checking WHARTON 400A Series clock" >&5
# Check whether --enable-WHARTON or --disable-WHARTON was given.
if test "${enable_WHARTON+set}" = set; then
enableval="$enable_WHARTON"
@@ -9130,7 +9239,7 @@ case "$ntp_ok$ntp_canparse" in
esac
echo $ac_n "checking VARITEXT clock""... $ac_c" 1>&6
-echo "configure:9134: checking VARITEXT clock" >&5
+echo "configure:9243: checking VARITEXT clock" >&5
# Check whether --enable-VARITEXT or --disable-VARITEXT was given.
if test "${enable_VARITEXT+set}" = set; then
enableval="$enable_VARITEXT"
@@ -9158,7 +9267,7 @@ esac
echo $ac_n "checking if we need to make and use the parse libraries""... $ac_c" 1>&6
-echo "configure:9162: checking if we need to make and use the parse libraries" >&5
+echo "configure:9271: checking if we need to make and use the parse libraries" >&5
ans=no
case "$ntp_libparse" in
yes)
@@ -9186,7 +9295,7 @@ echo "$ac_t""$ans" 1>&6
echo $ac_n "checking if we need to make and use the RSAREF library""... $ac_c" 1>&6
-echo "configure:9190: checking if we need to make and use the RSAREF library" >&5
+echo "configure:9299: checking if we need to make and use the RSAREF library" >&5
ans=no
if test -f $srcdir/rsaref2/source/rsa.c
then
@@ -9204,7 +9313,7 @@ echo "$ac_t""$ans" 1>&6
echo $ac_n "checking if we can make dcf parse utilities""... $ac_c" 1>&6
-echo "configure:9208: checking if we can make dcf parse utilities" >&5
+echo "configure:9317: checking if we can make dcf parse utilities" >&5
ans=no
if test "$ntp_parseutil" = "yes"; then
case "$target" in
@@ -9219,7 +9328,7 @@ echo "$ac_t""$ans" 1>&6
echo $ac_n "checking if we can build kernel streams modules for parse""... $ac_c" 1>&6
-echo "configure:9223: checking if we can build kernel streams modules for parse" >&5
+echo "configure:9332: checking if we can build kernel streams modules for parse" >&5
ans=no
case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
yesyes)
@@ -9246,7 +9355,7 @@ esac
echo "$ac_t""$ans" 1>&6
echo $ac_n "checking if we need basic refclock support""... $ac_c" 1>&6
-echo "configure:9250: checking if we need basic refclock support" >&5
+echo "configure:9359: checking if we need basic refclock support" >&5
if test "$ntp_refclock" = "yes"; then
cat >> confdefs.h <<\EOF
#define REFCLOCK 1
@@ -9258,7 +9367,7 @@ echo "$ac_t""$ntp_refclock" 1>&6
echo $ac_n "checking if we want HP-UX adjtimed support""... $ac_c" 1>&6
-echo "configure:9262: checking if we want HP-UX adjtimed support" >&5
+echo "configure:9371: checking if we want HP-UX adjtimed support" >&5
case "$target" in
*-*-hpux[56789]*)
ans=yes
@@ -9276,8 +9385,8 @@ fi
echo "$ac_t""$ans" 1>&6
echo $ac_n "checking if we can read kmem""... $ac_c" 1>&6
-echo "configure:9280: checking if we can read kmem" >&5
-if eval "test \"\${ac_cv_var_can_kmem+set}\" = set"; then
+echo "configure:9389: 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
# Check whether --enable-kmem or --disable-kmem was given.
@@ -9329,8 +9438,8 @@ EOF
esac
echo $ac_n "checking if adjtime is accurate""... $ac_c" 1>&6
-echo "configure:9333: checking if adjtime is accurate" >&5
-if eval "test \"\${ac_cv_var_adjtime_is_accurate+set}\" = set"; then
+echo "configure:9442: 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
# Check whether --enable-accurate-adjtime or --disable-accurate-adjtime was given.
@@ -9381,8 +9490,8 @@ EOF
esac
echo $ac_n "checking the name of 'tick' in the kernel""... $ac_c" 1>&6
-echo "configure:9385: checking the name of 'tick' in the kernel" >&5
-if eval "test \"\${ac_cv_var_nlist_tick+set}\" = set"; then
+echo "configure:9494: 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
ans=_tick
@@ -9425,8 +9534,8 @@ EOF
esac
#
echo $ac_n "checking for the units of 'tick'""... $ac_c" 1>&6
-echo "configure:9429: checking for the units of 'tick'" >&5
-if eval "test \"\${ac_cv_var_tick_nano+set}\" = set"; then
+echo "configure:9538: 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
ans=usec
@@ -9449,8 +9558,8 @@ EOF
esac
#
echo $ac_n "checking the name of 'tickadj' in the kernel""... $ac_c" 1>&6
-echo "configure:9453: checking the name of 'tickadj' in the kernel" >&5
-if eval "test \"\${ac_cv_var_nlist_tickadj+set}\" = set"; then
+echo "configure:9562: 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
ans=_tickadj
@@ -9502,8 +9611,8 @@ EOF
esac
#
echo $ac_n "checking for the units of 'tickadj'""... $ac_c" 1>&6
-echo "configure:9506: checking for the units of 'tickadj'" >&5
-if eval "test \"\${ac_cv_var_tickadj_nano+set}\" = set"; then
+echo "configure:9615: 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
ans=usec
@@ -9526,8 +9635,8 @@ EOF
esac
#
echo $ac_n "checking half-heartedly for 'dosynctodr' in the kernel""... $ac_c" 1>&6
-echo "configure:9530: checking half-heartedly for 'dosynctodr' in the kernel" >&5
-if eval "test \"\${ac_cv_var_nlist_dosynctodr+set}\" = set"; then
+echo "configure:9639: 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
case "$target" in
@@ -9579,8 +9688,8 @@ EOF
esac
#
echo $ac_n "checking half-heartedly for 'noprintf' in the kernel""... $ac_c" 1>&6
-echo "configure:9583: checking half-heartedly for 'noprintf' in the kernel" >&5
-if eval "test \"\${ac_cv_var_nlist_noprintf+set}\" = set"; then
+echo "configure:9692: 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
case "$target" in
@@ -9629,8 +9738,8 @@ esac
echo $ac_n "checking for a default value for 'tick'""... $ac_c" 1>&6
-echo "configure:9633: checking for a default value for 'tick'" >&5
-if eval "test \"\${ac_cv_var_tick+set}\" = set"; then
+echo "configure:9742: 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
# Check whether --enable-tick or --disable-tick was given.
@@ -9673,8 +9782,8 @@ EOF
esac
echo $ac_n "checking for a default value for 'tickadj'""... $ac_c" 1>&6
-echo "configure:9677: checking for a default value for 'tickadj'" >&5
-if eval "test \"\${ac_cv_var_tickadj+set}\" = set"; then
+echo "configure:9786: 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
# Check whether --enable-tickadj or --disable-tickadj was given.
@@ -9806,8 +9915,8 @@ esac
echo $ac_n "checking if we want and can make the tickadj utility""... $ac_c" 1>&6
-echo "configure:9810: checking if we want and can make the tickadj utility" >&5
-if eval "test \"\${ac_cv_make_tickadj+set}\" = set"; then
+echo "configure:9919: checking if we want and can make the tickadj utility" >&5
+if eval "test \"`echo '$''{'ac_cv_make_tickadj'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_make_tickadj=yes
@@ -9822,8 +9931,8 @@ esac
echo $ac_n "checking if we want and can make the ntptime utility""... $ac_c" 1>&6
-echo "configure:9826: checking if we want and can make the ntptime utility" >&5
-if eval "test \"\${ac_cv_make_ntptime+set}\" = set"; then
+echo "configure:9935: 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
case "$target" in
@@ -9848,8 +9957,8 @@ case "$ac_cv_make_ntptime" in
esac
echo $ac_n "checking if we want UDP wildcard delivery""... $ac_c" 1>&6
-echo "configure:9852: checking if we want UDP wildcard delivery" >&5
-if eval "test \"\${ac_cv_var_udp_wildcard_delivery+set}\" = set"; then
+echo "configure:9961: 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
# Check whether --enable-udp-wildcard or --disable-udp-wildcard was given.
@@ -9927,8 +10036,8 @@ case "$host" in
esac
echo $ac_n "checking if we should always slew the time""... $ac_c" 1>&6
-echo "configure:9931: checking if we should always slew the time" >&5
-if eval "test \"\${ac_cv_var_slew_always+set}\" = set"; then
+echo "configure:10040: 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
# Check whether --enable-slew-always or --disable-slew-always was given.
@@ -9967,8 +10076,8 @@ EOF
esac
echo $ac_n "checking if we should step and slew the time""... $ac_c" 1>&6
-echo "configure:9971: checking if we should step and slew the time" >&5
-if eval "test \"\${ac_cv_var_step_slew+set}\" = set"; then
+echo "configure:10080: 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
# Check whether --enable-step-slew or --disable-step-slew was given.
@@ -10010,8 +10119,8 @@ EOF
esac
echo $ac_n "checking if ntpdate should step the time""... $ac_c" 1>&6
-echo "configure:10014: checking if ntpdate should step the time" >&5
-if eval "test \"\${ac_cv_var_ntpdate_step+set}\" = set"; then
+echo "configure:10123: 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
# Check whether --enable-ntpdate-step or --disable-ntpdate-step was given.
@@ -10041,8 +10150,8 @@ EOF
esac
echo $ac_n "checking if we should sync TODR clock every hour""... $ac_c" 1>&6
-echo "configure:10045: checking if we should sync TODR clock every hour" >&5
-if eval "test \"\${ac_cv_var_sync_todr+set}\" = set"; then
+echo "configure:10154: 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
# Check whether --enable-hourly-todr-sync or --disable-hourly-todr-sync was given.
@@ -10074,8 +10183,8 @@ EOF
esac
echo $ac_n "checking if we should avoid kernel FLL bug""... $ac_c" 1>&6
-echo "configure:10078: checking if we should avoid kernel FLL bug" >&5
-if eval "test \"\${ac_cv_var_kernel_fll_bug+set}\" = set"; then
+echo "configure:10187: checking if we should avoid kernel FLL bug" >&5
+if eval "test \"`echo '$''{'ac_cv_var_kernel_fll_bug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Check whether --enable-kernel-fll-bug or --disable-kernel-fll-bug was given.
@@ -10218,7 +10327,7 @@ do
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.14.1"
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -10291,11 +10400,15 @@ s%@AUTOMAKE@%$AUTOMAKE%g
s%@AUTOHEADER@%$AUTOHEADER%g
s%@MAKEINFO@%$MAKEINFO%g
s%@AMTAR@%$AMTAR%g
-s%@AMTARFLAGS@%$AMTARFLAGS%g
+s%@install_sh@%$install_sh%g
+s%@AWK@%$AWK%g
s%@SET_MAKE@%$SET_MAKE%g
+s%@AMDEP@%$AMDEP%g
+s%@AMDEPBACKSLASH@%$AMDEPBACKSLASH%g
+s%@DEPDIR@%$DEPDIR%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
-s%@AWK@%$AWK%g
+s%@CCDEPMODE@%$CCDEPMODE%g
s%@LN_S@%$LN_S%g
s%@RANLIB@%$RANLIB%g
s%@PATH_SH@%$PATH_SH%g
@@ -10532,15 +10645,56 @@ fi; done
EOF
cat >> $CONFIG_STATUS <<EOF
+AMDEP="$AMDEP"
+ac_aux_dir="$ac_aux_dir"
EOF
cat >> $CONFIG_STATUS <<\EOF
test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+
+test x"$AMDEP" != x"" ||
+for mf in $CONFIG_FILES; do
+ case "$mf" in
+ Makefile) dirpart=.;;
+ */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
+ *) continue;;
+ esac
+ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
+ $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+
chmod +x scripts/ntpver scripts/mkver
exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
#test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
diff --git a/contrib/ntp/configure.in b/contrib/ntp/configure.in
index 2facc50efafd..c8cf3da26034 100644
--- a/contrib/ntp/configure.in
+++ b/contrib/ntp/configure.in
@@ -5,7 +5,7 @@ AC_CANONICAL_SYSTEM
AC_DEFINE_UNQUOTED(STR_SYSTEM, "$target")
AM_CONFIG_HEADER(config.h)
AC_ARG_PROGRAM
-AM_INIT_AUTOMAKE(ntp, 4.0.98f)
+AM_INIT_AUTOMAKE(ntp, 4.0.99b)
AC_PREREQ(2.13)
ac_cv_var_oncore_ok=no
@@ -27,6 +27,14 @@ case "$target" in
CFLAGS="$CFLAGS -Wc,+Abi-socket"
;;
esac
+ ;;
+ alpha*-dec-osf*)
+ case "$CC" in
+ cc)
+ CFLAGS="$CFLAGS -std1"
+ ;;
+ esac
+ ;;
esac
case "$host" in
@@ -181,7 +189,7 @@ AC_HEADER_STDC
AC_CHECK_HEADERS(bstring.h errno.h fcntl.h memory.h netdb.h poll.h resolv.h)
AC_CHECK_HEADERS(sched.h sgtty.h stdlib.h string.h termio.h termios.h)
AC_CHECK_HEADERS(timepps.h timex.h unistd.h utmp.h utmpx.h)
-AC_CHECK_HEADERS(arpa/nameser.h net/if.h netinet/in.h netinet/ip.h)
+AC_CHECK_HEADERS(arpa/nameser.h net/if.h netinet/in_systm.h netinet/in.h)
AC_CHECK_HEADERS(netinfo/ni.h, [AC_DEFINE(HAVE_NETINFO)])
AC_CHECK_HEADERS(sun/audioio.h sys/audioio.h)
dnl AC_CHECK_HEADERS(sys/chudefs.h)
@@ -197,15 +205,10 @@ case "$target" in
*-*-sco*)
AC_CHECK_HEADERS(sys/sio.h)
;;
- *sgi*)
- AC_CHECK_HEADERS(sys/syssgi.h)
- ;;
- *)
- AC_CHECK_HEADERS(sys/select.h)
- ;;
esac
-AC_CHECK_HEADERS(sys/sockio.h sys/stat.h sys/stream.h sys/stropts.h)
-AC_CHECK_HEADERS(sys/sysctl.h sys/termios.h sys/time.h)
+AC_CHECK_HEADERS(sys/select.h sys/sockio.h sys/stat.h sys/stream.h)
+AC_CHECK_HEADERS(sys/stropts.h sys/sysctl.h sys/syssgi.h sys/termios.h)
+AC_CHECK_HEADERS(sys/time.h)
AC_EGREP_CPP(yes,
[#include <sys/timepps.h>
#ifdef PPS_API_VERS_1
@@ -726,7 +729,7 @@ esac
dnl See if char *sys_errlist[] is OK.
dnl If you get the quoting right on the next line, you tried something I didn't.
-AC_CACHE_CHECK(if declaring 'char *sys_errlist[]' is ok, ac_cv_decl_sys_errlist,
+AC_CACHE_CHECK([[if declaring 'char *sys_errlist[]' is ok]], ac_cv_decl_sys_errlist,
[AC_TRY_COMPILE([#include <stdio.h>
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -760,9 +763,11 @@ case "$ac_cv_decl_syscall" in
esac
case "$target" in
+changequote(<<, >>)dnl
*-*-osf[45]*)
+changequote([, ])dnl
AC_DEFINE(DECL_PLOCK_0)
- AC_DEFINE(DECL_STIME_0)
+ AC_DEFINE(DECL_STIME_1)
;;
*-*-riscos4*)
AC_DEFINE(DECL_ADJTIME_0)
@@ -1171,6 +1176,12 @@ case "$ac_cv_header_sys_sio_h" in
;;
esac
+case "$ac_cv_hdr_def_tiocdcdtimestamp" in
+ yes)
+ ac_cv_var_oncore_ok=yes
+ ;;
+esac
+
AC_CACHE_CHECK(if nlist() values might require extra indirection,
ac_cv_var_nlist_extra_indirection,
[ans=no
@@ -1359,7 +1370,6 @@ if test "$ac_cv_header_termios_h" = "yes"; then
else
ntp_ok=no
fi
-
if test "$ntp_ok" = "yes"; then
AC_DEFINE(HAVE_TIOCGPPSEV)
ac_cv_var_oncore_ok=yes
@@ -1396,7 +1406,6 @@ if test "$ac_cv_header_sys_ppsclock_h" = "yes"; then
else
ntp_ok=no
fi
-
if test "$ntp_ok" = "yes"; then
ac_cv_var_oncore_ok=yes
AC_DEFINE(HAVE_CIOGETEV)
@@ -1444,12 +1453,22 @@ typedef int u_int;
ntp_ok=no
;;
esac
-
if test "$ntp_ok" = "yes"; then
AC_DEFINE(HAVE_TIO_SERIAL_STUFF)
fi
AC_MSG_RESULT($ntp_ok)
+# Check for SHMEM_STATUS support
+AC_MSG_CHECKING(SHMEM_STATUS support)
+case "$ac_cv_header_sys_mman_h" in
+ yes) ntp_ok=yes ;;
+ *) ntp_ok=no ;;
+esac
+if test "$ntp_ok" = "yes"; then
+ AC_DEFINE(ONCORE_SHMEM_STATUS)
+fi
+AC_MSG_RESULT($ntp_ok)
+
dnl dnl These are for OPT_PROGRAMS in authstuff/
dnl AC_SUBST(AUTHCERT)
dnl AC_SUBST(AUTHSPEED)
@@ -1529,6 +1548,13 @@ case "$ac_cv_header_termio_h$ac_cv_header_termios_h" in
esac
AC_MSG_RESULT($ntp_canparse)
+AC_MSG_CHECKING([if we have support for audio clocks])
+case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h" in
+ *yes*) ntp_canaudio=yes ;;
+ *) ntp_canaudio=no ;;
+esac
+AC_MSG_RESULT($ntp_canaudio)
+
# Requires modem control
AC_MSG_CHECKING(ACTS modem service)
AC_ARG_ENABLE(ACTS, [ --enable-ACTS + ACTS modem service],
@@ -1585,7 +1611,7 @@ fi
AC_MSG_RESULT($ntp_ok)
AC_MSG_CHECKING(CHU modem/decoder)
-AC_ARG_ENABLE(CHU, [ --enable-CHU + CHU modem/decoder],
+AC_ARG_ENABLE(CHU, [ --enable-CHU - CHU modem/decoder],
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
if test "$ntp_ok" = "yes"; then
ntp_refclock=yes
@@ -1595,16 +1621,19 @@ AC_MSG_RESULT($ntp_ok)
ac_refclock_chu=$ntp_ok
AC_MSG_CHECKING(CHU audio/decoder)
-AC_ARG_ENABLE(AUDIO-CHU, [ --enable-AUDIO-CHU s - CHU audio/decoder],
- [ntp_ok=$enableval], [ntp_ok=no])
+AC_ARG_ENABLE(AUDIO-CHU, [ --enable-AUDIO-CHU s CHU audio/decoder],
+ [ntp_ok=$enableval],
+ [case "$ntp_eac$ac_refclock_chu$ntp_canaudio" in
+ *no*) ntp_ok=no ;;
+ *) ntp_ok=yes ;;
+esac])
if test "$ntp_ok" = "yes"; then
AC_DEFINE(AUDIO_CHU)
fi
AC_MSG_RESULT($ntp_ok)
-case "$ntp_ok$ac_refclock_chu$target" in
- yesyes*-*-sunos*) ;;
- yesyes*-*-solaris*) ;;
- yes*) AC_WARN(*** But the expected answer is...no ***) ;;
+# We used to check for sunos/solaris target...
+case "$ntp_ok$ac_refclock_chu$ntp_canaudio" in
+ yes*no*) AC_WARN(*** But the expected answer is...no ***) ;;
esac
# Not under HP-UX
@@ -1624,6 +1653,15 @@ if test "$ntp_ok" = "yes"; then
fi
AC_MSG_RESULT($ntp_ok)
+AC_MSG_CHECKING(Forum Graphic GPS)
+AC_ARG_ENABLE(FG, [ --enable-FG + Forum Graphic GPS],
+ [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
+if test "$ntp_ok" = "yes"; then
+ ntp_refclock=yes
+ AC_DEFINE(CLOCK_FG)
+fi
+AC_MSG_RESULT($ntp_ok)
+
# Requires modem control
AC_MSG_CHECKING(Heath GC-1000 WWV/WWVH receiver)
AC_ARG_ENABLE(HEATH, [ --enable-HEATH s Heath GC-1000 WWV/WWVH receiver],
@@ -1655,20 +1693,17 @@ AC_MSG_RESULT($ntp_ok)
AC_MSG_CHECKING(Sun IRIG audio decoder)
AC_ARG_ENABLE(IRIG, [ --enable-IRIG s Sun IRIG audio decoder],
[ntp_ok=$enableval],
- [case "$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h" in
- *yes*)
- ntp_ok=$ntp_eac
- ;;
- *) ntp_ok=no
- ;;
+ [case "$ntp_eac$ntp_canaudio" in
+ *no*) ntp_ok=no ;;
+ *) ntp_ok=yes ;;
esac])
if test "$ntp_ok" = "yes"; then
ntp_refclock=yes
AC_DEFINE(CLOCK_IRIG)
fi
AC_MSG_RESULT($ntp_ok)
-case "$ntp_ok$ac_cv_header_sun_audioio_h$ac_cv_header_sys_audioio_h" in
- yesnono) AC_WARN(*** But the expected answer is... no ***) ;;
+case "$ntp_ok$ntp_canaudio" in
+ yesno) AC_WARN(*** But the expected answer is... no ***) ;;
esac
AC_MSG_CHECKING(Leitch CSD 5300 Master Clock System Driver)
@@ -1848,6 +1883,24 @@ if test "$ntp_ok" = "yes"; then
fi
AC_MSG_RESULT($ntp_ok)
+AC_MSG_CHECKING(Conrad parallel port radio clock)
+AC_ARG_ENABLE(PCF, [ --enable-PCF + Conrad parallel port radio clock],
+ [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
+if test "$ntp_ok" = "yes"; then
+ ntp_refclock=yes
+ AC_DEFINE(CLOCK_PCF)
+fi
+AC_MSG_RESULT($ntp_ok)
+
+AC_MSG_CHECKING(Spectracom 8170/Netclock/2 WWVB receiver)
+AC_ARG_ENABLE(SPECTRACOM, [ --enable-SPECTRACOM + Spectracom 8170/Netclock/2 WWVB receiver],
+ [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
+if test "$ntp_ok" = "yes"; then
+ ntp_refclock=yes
+ AC_DEFINE(CLOCK_SPECTRACOM)
+fi
+AC_MSG_RESULT($ntp_ok)
+
# Not on a vax-dec-bsd
AC_MSG_CHECKING(Kinemetrics/TrueTime receivers)
AC_ARG_ENABLE(TRUETIME, [ --enable-TRUETIME s Kinemetrics/TrueTime receivers],
@@ -1869,23 +1922,30 @@ case "$ntp_ok$target" in
yesvax-dec-bsd) AC_WARN(*** But the expected answer is... no ***) ;;
esac
-AC_MSG_CHECKING(Spectracom 8170/Netclock/2 WWVB receiver)
-AC_ARG_ENABLE(WWVB, [ --enable-WWVB + Spectracom 8170/Netclock/2 WWVB receiver],
+AC_MSG_CHECKING(Ultralink M320 WWVB receiver)
+AC_ARG_ENABLE(ULINK, [ --enable-ULINK + Ultralink WWVB receiver],
[ntp_ok=$enableval], [ntp_ok=$ntp_eac])
if test "$ntp_ok" = "yes"; then
ntp_refclock=yes
- AC_DEFINE(CLOCK_WWVB)
+ AC_DEFINE(CLOCK_ULINK)
fi
AC_MSG_RESULT($ntp_ok)
-AC_MSG_CHECKING(Ultralink M320 WWVB receiver)
-AC_ARG_ENABLE(ULINK, [ --enable-ULINK + Ultralink WWVB receiver],
- [ntp_ok=$enableval], [ntp_ok=$ntp_eac])
+AC_MSG_CHECKING(WWV receiver)
+AC_ARG_ENABLE(WWV, [ --enable-WWV + WWV Audio receiver],
+ [ntp_ok=$enableval],
+ [case "$ntp_eac$ntp_canaudio" in
+ *no*) ntp_ok=no ;;
+ *) ntp_ok=yes ;;
+ esac])
if test "$ntp_ok" = "yes"; then
ntp_refclock=yes
- AC_DEFINE(CLOCK_ULINK)
+ AC_DEFINE(CLOCK_WWV)
fi
AC_MSG_RESULT($ntp_ok)
+case "$ntp_ok$ntp_canaudio" in
+ yesno) AC_WARN(*** But the expected answer is... no ***) ;;
+esac
# Requires modem control
AC_MSG_CHECKING(USNO modem service)
diff --git a/contrib/ntp/depcomp b/contrib/ntp/depcomp
new file mode 100755
index 000000000000..790609673880
--- /dev/null
+++ b/contrib/ntp/depcomp
@@ -0,0 +1,269 @@
+#! /bin/sh
+
+# depcomp - compile a program generating dependencies as side-effects
+# Copyright (C) 1999 Free Software Foundation, Inc.
+
+# 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, 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.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+# `libtool' can also be set to `yes' or `no'.
+
+depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ if "$@" -Wp,"$gccflag$tmpdepfile"; then :
+ else
+ stat=$?
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed 's/^[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+dashmd)
+ # The Java front end to gcc doesn't run cpp, so we can't use the -Wp
+ # trick. Instead we must use -M and then rename the resulting .d
+ # file. This is also the case for older versions of gcc, which
+ # don't implement -Wp.
+ if "$@" -MD; then :
+ else
+ stat=$?
+ rm -f FIXME
+ exit $stat
+ fi
+ FIXME: rewrite the file
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wc,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ stat=$?
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed 's/^[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ test -z "$dashmflag" && dashmflag=-M
+ ( IFS=" "
+ case " $* " in
+ *" --mode=compile "*) # this is libtool, let us make it quiet
+ for arg
+ do # cycle over the arguments
+ case "$arg" in
+ "--mode=compile")
+ # insert --quiet before "--mode=compile"
+ set fnord "$@" --quiet
+ shift # fnord
+ ;;
+ esac
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # "$arg"
+ done
+ ;;
+ esac
+ "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ # X makedepend
+ (
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in no)
+ set ""; shift
+ cleared=yes
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift;;
+ -*)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tail +3 "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the proprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ ( IFS=" "
+ case " $* " in
+ *" --mode=compile "*)
+ for arg
+ do # cycle over the arguments
+ case "$arg" in
+ "--mode=compile")
+ # insert --quiet before "--mode=compile"
+ set fnord "$@" --quiet
+ shift # fnord
+ ;;
+ esac
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # "$arg"
+ done
+ ;;
+ esac
+ "$@" -E |
+ sed -n '/^# [0-9][0-9]* "\([^"]*\)"/ s::'"$object"'\: \1:p' > "$tmpdepfile"
+ ) &
+ proc=$!
+ "$@"
+ stat=$?
+ wait "$proc"
+ if test "$stat" != 0; then exit $stat; fi
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed < "$tmpdepfile" -e 's/^[^:]*: //' -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/contrib/ntp/html/audio.htm b/contrib/ntp/html/audio.htm
new file mode 100644
index 000000000000..5df5570e482c
--- /dev/null
+++ b/contrib/ntp/html/audio.htm
@@ -0,0 +1,153 @@
+<html><head><title>
+Reference Clock Audio Drivers
+</title></head><body><h3>
+Reference Clock Audio Drivers
+</h3><hr>
+
+<p>There are some applications in which the computer time can be
+disciplined to an audio signal, rather than a serial timecode and
+communications port or special purpose bus peripheral. This is useful in
+such cases where the audio signal is sent over a telephone circuit, for
+example, or received directly from a shortwave receiver. In such cases
+the audio signal can be connected via an ordinary sound card or
+baseboard audio codec. The suite of NTP reference clock drivers
+currently includes three drivers suitable for these applications. They
+include a driver for the Inter Range Instrumentation Group (IRIG)
+signals produced by most radio clocks and timing devices, another for
+the Canadian time/frequency radio station CHU and a third for the NIST
+time/frequency radio stations WWV and WWVH. The radio drivers are
+designed to work with ordinary inexpensive shortwave radios and may be
+one of the least expensive ways to build a good primary time server.
+
+<p>All three drivers make ample use of sophisticated digital signal
+processing algorithms designed to efficiently extract timing signals
+from noise and interference. The radio station drivers in particular
+implement optimum linear demodulation and decoding techniques, including
+maximum likelihood and soft-decision methods. The documentation page for
+each driver contains an in-depth discussion on the algorithms and
+performance expectations. In some cases the algorithms are further
+analyzed, modelled and evaluated in a technical report.
+
+<p>Currently, the audio drivers are compatible with Sun operating
+systems, including Solaris and SunOS, and the native audio codec
+interface supported by these systems. In fact, the interface is quite
+generic and support for other systems, in particular the various Unix
+generics, should not be difficult. Volunteers are solicited.
+
+<p>The audio drivers include a number of common features designed to
+groom input signals, suppress spikes and normalize signal levels. An
+automatic gain control (AGC) feature provides protection against
+overdriven or underdriven input signals. It is designed to maintain
+adequate demodulator signal amplitude while avoiding occasional noise
+spikes. In order to assure reliable operation, the signal level must be
+in the range where the audio gain control is effective. In general, this
+means the input signal level must be such as to cause the AGC to set the
+gain somewhere in the middle of the range from 0 to 255, as indicated in
+the timecode displayed by the <tt>ntpq</tt> program.
+
+<p>The drivers operate by disciplining a logical clock based on the
+codec sample clock to the audio signal as received. This is done by
+stuffing or slipping samples as required to maintain exact frequency to
+the order of 0.1 PPM. In order for the driver to reliably lock on the
+audio signal, the sample clock frequency tolerance must be less than 250
+PPM (.025 percent) for the IRIG driver and half that for the radio
+drivers. The largest error observed so far is about 60 PPM, but it is
+possible some sound cards or codecs may exceed that value.
+
+<p>The drivers include provisions to select the input port and to
+monitor the input signal. The <tt>fudge flag 2</tt> selects the
+microphone port if set to zero or the line-in port if set to one. It
+does not seem useful to specify the compact disc player port. The
+<tt>fudge flag 3</tt> enables the input signal monitor using the
+previously selected output port and output gain. Both of these flags can
+be set in the configuration file or remotely using the <tt>ntpdc</tt>
+utility program.
+
+<H4>Shortwave Radio Drivers</H4>
+
+<p>The WWV/H and CHU audio drivers require an external shortwave radio
+with the radio output - speaker or headphone jack - connected to either
+the microphone or line-in port on the computer. There is some degree of
+art in setting up the radio and antenna and getting the setup to work.
+While the drivers are highly sophisticated and efficient in extracting
+timing signals from noise and interference, it always helps to have as
+clear a signal as possible.
+
+<p>The most important factor affecting the radio signal is the antenna.
+It need not be long - even 15 feet is enough if it is located outside of
+a metal frame building, preferably on the roof, and away from metallic
+objects. An ordinary CB whip mounted on a PVC pipe and wooden X-frame on
+the roof should work well with most portable radios, as they are
+optimized for small antennas.
+
+<p>The radio need not be located near the computer; in fact, it
+generally works better if the radio is outside the near field of
+computers and other electromagnetic noisemakers. It can be in the
+elevator penthouse connected by house wiring, which can also be used to
+power the radio. A couple of center-tapped audio transformers will
+minimize noise pickup and provide phantom power to the radio with return
+via the AC neutral wire.
+
+<p>The WWV/H and CHU transmitters operate on several frequencies
+simultaneously, so that in most parts of North America at least one
+frequency supports propagation to the receiver location at any given
+hour. While both drivers support the ICOM CI-V radio interface and can tune the radio automatically, computer-tunable radios are expensive and probably not cost effective compared to a GPS receiver. So, the radio frequency must usually be fixed and chosen by compromise.
+
+<p>Shortwave (3-30 MHz) radio propagation phenomena are well known to
+shortwave enthusiasts. The phenomena generally obey the following rules:
+
+<ul>
+
+<p><li>The optimum frequency is higher in daytime than nighttime, stays
+high longer on summer days and low longer on winter nights.
+
+<p><li>Transitions between daytime and nightime conditions generally
+occur somewhat after sunrise and sunset at the midpoint of the path from
+transmitter to receiver.
+
+<p><li>Ambient noise (static) on the lower frequencies follows the
+thunderstorm season, so is higher on summer afternoons and evenings.
+
+<p><li>The lower frequency bands are best for shorter distances, while
+the higher bands are best for longer distances.
+
+<p><li>The optimum frequencies are higher at the peak of the 11-year
+sunspot cycle and lower at the trough. The current sunspot cycle should
+peak in the first couple of years beginning the century.
+
+</ul>
+
+The best way to choose a frequency is to listen at various times over
+the day and determine the best highest (daytime) and lowest (nighttime)
+frequencies. Then, assuming one is available, choose the highest
+frequency between these frequencies. This strategy assumes that the high
+frequency is more problematic than the low, that the low frequency
+probably comes with severe multipath and static, and insures that
+probably twice a day the chosen frequency will work. For instance, on
+the east coast the best compromise CHU frequency is probably 7335 kHz
+and the best WWV frequency is probably 15 MHz.
+
+<h4>Debugging Aids</h4>
+
+<p>The audio drivers include extensive debugging support to help hook up
+the audio signals and monitor the driver operations. The documentation
+page for each driver describes the various messages that can be produced
+either in real-time or written to the <tt>clockstats</tt> file for
+later analysis. Of particular help in verifying signal connections and
+compatibility is a provision to monitor the signal via headphones or
+speaker.
+
+
+<p>The drivers write a synthesized timecode to the <tt>clockstats</tt>
+file each time the clock is set or verified and at other times if verbose monitoring is enabled. The format includes several fixed-length fields defining the Gregorian time to the millisecond, together with additional variable-length fields specific to each driver. The data include the intervals since the clock was last set or verified, the audio gain and various state variables and counters specific to each driver.
+
+<H4>Additional Information</H4>
+
+<A HREF="refclock.htm">Reference Clock Drivers</A>
+<br><A HREF="driver7.htm">Radio CHU Audio Demodulator/Decoder</A>
+<br><A HREF="driver36.htm">Radio WWV/H Audio Demodulator/Decoder</A>
+<br><A HREF="driver6.htm">IRIG Audio Decoder</A>
+
+<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
+href=mailto:mills@udel.edu> David L. Mills &lt;mills@udel.edu&gt;</a>
+</address></a></body></html>
diff --git a/contrib/ntp/html/build.htm b/contrib/ntp/html/build.htm
index c321bf35a8c6..44b0391b6fcd 100644
--- a/contrib/ntp/html/build.htm
+++ b/contrib/ntp/html/build.htm
@@ -177,28 +177,8 @@ function.</DD>
</DL>
<H4>Building and Installing under Windows NT</H4>
-
-Under Windows NT, you will need <TT>Visual C++ 5.0</TT> or above,
-<TT>InstallShield</TT> SDK, <TT>Perl5</TT> and some version of the
-archiving program <TT>ZIP</TT>. Note that the version of
-<TT>InstallShield</TT> that comes with VC++5.0 is not useable here,
-since it does not include the command line tools.
-
-<P>See the <TT>./scripts/wininstall/readme.nt</TT> file for directions
-to compile the sources, build the libraries and link the executables.
-Initiate the build by running either <TT>bldrel.bat</TT> or
-<TT>blddbg.bat</TT> to compile all of the source and create an
-<TT>InstallShield</TT> based graphical installation package.
-
-<P>To install the executables, make sure that you are logged in as a
-system account, or one with administrator privileges such as the
-"administrator" account. As part of the build an <TT>InstallShield</TT>
-based graphical installer was created. Run
-<TT>\ntp\scripts\wininstall\intel\disk1\setup.exe</TT> to begin the
-installation. This installer will prompt for basic defaults,
-copy the binaries, install the service, and start it up. The other
-option is to run <TT>\ntp\scripts\wininstall\distrib\install.bat</TT>
-which will do the basic installation from the command line.
+See <tt><a href="hints/winnt.htm">hints/winnt.htm</a> </tt>for directions
+to compile the sources and install the executables.
<hr><a href=index.htm><img align=left
src=pic/home.gif></a><address><a href="mailto:mills@udel.edu"> David L.
diff --git a/contrib/ntp/html/copyright.htm b/contrib/ntp/html/copyright.htm
index d5d8243d94a5..527b5d035df3 100644
--- a/contrib/ntp/html/copyright.htm
+++ b/contrib/ntp/html/copyright.htm
@@ -1,123 +1,202 @@
-<HTML><HEAD><TITLE>
+<html><head><title>
Copyright Notice
-</TITLE></HEAD><BODY><H3>
+</title></head><body><h3>
Copyright Notice
-</H3>
+</h3>
<IMG align=left HEIGHT=264 WIDTH=206 SRC=pic/sheepb.jpg >"Clone
me," says Dolly sheepishly
<br clear=left><hr>
-<P>The following copyright notice applies to all files collectively called the Network Time Protocol Version 4 Distribution. Unless specifically declared otherwise in an individual file, this notice applies as if the text was explicitly included in the file.
+<P>The following copyright notice applies to all files collectively
+called the Network Time Protocol Version 4 Distribution. Unless
+specifically declared otherwise in an individual file, this notice
+applies as if the text was explicitly included in the file.
<br>
-<PRE>/***********************************************************************
-&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *
-&nbsp;* Copyright (c) David L. Mills 1992-1999&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *
-&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *
-&nbsp;* Permission to use, copy, modify, and distribute this software and&nbsp;&nbsp; *
-&nbsp;* its documentation for any purpose and without fee is hereby&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *
-&nbsp;* granted, provided that the above copyright notice appears in all&nbsp;&nbsp;&nbsp; *
-&nbsp;* copies and that both the copyright notice and this permission&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *
-&nbsp;* notice appear in supporting documentation, and that the name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *
-&nbsp;* University of Delaware not be used in advertising or publicity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *
-&nbsp;* pertaining to distribution of the software without specific,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *
-&nbsp;* written prior permission. The University of Delaware makes no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *
-&nbsp;* representations about the suitability this software for any&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *
-&nbsp;* purpose. It is provided "as is" without express or implied&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *
-&nbsp;* warranty.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *
-&nbsp;**********************************************************************/</PRE>
-
-The following individuals contributed in part to the Network Time Protocol Distribution Version 4 and are acknowledged as authors of this work.
+<PRE>
+/***********************************************************************
+ * *
+ * Copyright (c) David L. Mills 1992-2000 *
+ * *
+ * Permission to use, copy, modify, and distribute this software and *
+ * its documentation for any purpose and without fee is hereby *
+ * granted, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission *
+ * notice appear in supporting documentation, and that the name *
+ * University of Delaware not be used in advertising or publicity *
+ * pertaining to distribution of the software without specific, *
+ * written prior permission. The University of Delaware makes no *
+ * representations about the suitability this software for any *
+ * purpose. It is provided "as is" without express or implied *
+ * warranty. *
+ * *
+ ***********************************************************************
+ */
+</PRE>
+
+The following individuals contributed in part to the Network Time
+Protocol Distribution Version 4 and are acknowledged as authors of this
+work.
<OL>
-<LI><A HREF="mailto: marka@syd.dms.csiro.au">Mark Andrews &lt;marka@syd.dms.csiro.au&gt;</a> Leitch atomic clock controller</LI>
+<LI><A HREF="mailto: marka@syd.dms.csiro.au">Mark Andrews
+&lt;marka@syd.dms.csiro.au&gt;</a> Leitch atomic clock controller</LI>
-<LI><A HREF="mailto: vbais@mailman1.intel.co">Viraj Bais &lt;vbais@mailman1.intel.com&gt;</a> and <A HREF="mailto: kirkwood@striderfm.intel.com">Clayton Kirkwood &lt;kirkwood@striderfm.intel.com&gt;</a> port to WindowsNT 3.5</LI>
+<LI><A HREF="mailto: vbais@mailman1.intel.co">Viraj Bais
+&lt;vbais@mailman1.intel.com&gt;</a> and <A HREF="mailto:
+kirkwood@striderfm.intel.com">Clayton Kirkwood
+&lt;kirkwood@striderfm.intel.com&gt;</a> port to WindowsNT 3.5</LI>
-<LI><A HREF="mailto: karl@owl.HQ.ileaf.com">Karl Berry &lt;karl@owl.HQ.ileaf.com&gt;</a> syslog to file option</LI>
+<LI><A HREF="mailto: michael.barone@lmco.com">Michael Barone
+&lt;michael,barone@lmco.com&gt;</a> GPSVME fixes</LI>
-<LI><A HREF="mailto: Piete.Brooks@cl.cam.ac.uk">Piete Brooks &lt;Piete.Brooks@cl.cam.ac.uk&gt;</a> MSF clock driver, Trimble PARSE support</LI>
+<LI><A HREF="mailto: karl@owl.HQ.ileaf.com">Karl Berry
+&lt;karl@owl.HQ.ileaf.com&gt;</a> syslog to file option</LI>
-<LI><A HREF="mailto: clift@ml.csiro.au">Steve Clift &lt;clift@ml.csiro.au&gt;</a> OMEGA clock driver</LI>
+<LI><A HREF="mailto: greg.brackley@bigfoot.com">Greg Brackley
+&lt;greg.brackley@bigfoot.com&gt;</a> Major rework of WINNT port. Clean
+up recvbuf and iosignal code into separate modules.</LI>
-<LI><A HREF="mailto:casey@csc.co.za">Casey Crellin &lt;casey@csc.co.za&gt;</a> vxWorks (Tornado) port and help with target configuration</LI>
+<LI><A HREF="mailto: Piete.Brooks@cl.cam.ac.uk">Piete Brooks
+&lt;Piete.Brooks@cl.cam.ac.uk&gt;</a> MSF clock driver, Trimble PARSE
+support</LI>
-<LI><A HREF="mailto: duwe@immd4.informatik.uni-erlangen.de">Torsten Duwe &lt;duwe@immd4.informatik.uni-erlangen.de&gt;</a> Linux port</LI>
+<LI><A HREF="mailto: clift@ml.csiro.au">Steve Clift
+&lt;clift@ml.csiro.au&gt;</a> OMEGA clock driver</LI>
-<LI><A HREF="mailto: dundas@salt.jpl.nasa.gov">John A. Dundas III &lt;dundas@salt.jpl.nasa.gov&gt;</a> Apple A/UX port</LI>
+<LI><A HREF="mailto:casey@csc.co.za">Casey Crellin
+&lt;casey@csc.co.za&gt;</a> vxWorks (Tornado) port and help with target
+configuration</LI>
-<LI><A HREF="mailto: dennis@mrbill.canet.ca">Dennis Ferguson &lt;dennis@mrbill.canet.ca&gt;</a> foundation code for NTP Version 2 as specified in RFC-1119</LI>
+<LI><A HREF="mailto: Sven_Dietrich@trimble.COM">Sven Dietrich
+&lt;sven_dietrich@trimble.com&gt;</a> Palisade reference clock driver,
+NT adj. residuals, integrated Greg's Winnt port.</LI>
-<LI><A HREF="mailto: glenn@herald.usask.ca">Glenn Hollinger &lt;glenn@herald.usask.ca&gt;</a> GOES clock driver</LI>
+<LI><A HREF="mailto: dundas@salt.jpl.nasa.gov">John A. Dundas III
+&lt;dundas@salt.jpl.nasa.gov&gt;</a> Apple A/UX port</LI>
-<LI><A HREF="mailto: iglesias@uci.edu">Mike Iglesias &lt;iglesias@uci.edu&gt;</a> DEC Alpha port</LI>
+<LI><A HREF="mailto: duwe@immd4.informatik.uni-erlangen.de">Torsten Duwe
+&lt;duwe@immd4.informatik.uni-erlangen.de&gt;</a> Linux port</LI>
-<LI><A HREF="mailto: jagubox.gsfc.nasa.gov">Jim Jagielski &lt;jim@jagubox.gsfc.nasa.gov&gt;</a> A/UX port</LI>
+<LI><A HREF="mailto: dennis@mrbill.canet.ca">Dennis Ferguson
+&lt;dennis@mrbill.canet.ca&gt;</a> foundation code for NTP Version 2 as
+specified in RFC-1119</LI>
-<LI><A HREF="mailto: jbj@chatham.usdesign.com">Jeff Johnson &lt;jbj@chatham.usdesign.com&gt;</a> massive prototyping overhaul</LI>
+<LI><A HREF="mailto: glenn@herald.usask.ca">Glenn Hollinger
+&lt;glenn@herald.usask.ca&gt;</a> GOES clock driver</LI>
-<LI><A HREF="mailto: jones@hermes.chpc.utexas.edu">William L. Jones &lt;jones@hermes.chpc.utexas.edu&gt;</a> RS/6000 AIX modifications, HPUX modifications</LI>
+<LI><A HREF="mailto: iglesias@uci.edu">Mike Iglesias
+&lt;iglesias@uci.edu&gt;</a> DEC Alpha port</LI>
-<LI><A HREF="mailto: dkatz@cisco.com">Dave Katz &lt;dkatz@cisco.com&gt;</a> RS/6000 AIX port</LI>
+<LI><A HREF="mailto: jagubox.gsfc.nasa.gov">Jim Jagielski
+&lt;jim@jagubox.gsfc.nasa.gov&gt;</a> A/UX port</LI>
-<LI><A HREF="mailto: leres@ee.lbl.gov">Craig Leres &lt;leres@ee.lbl.gov&gt;</a> 4.4BSD port, ppsclock, Maganavox GPS clock driver</LI>
+<LI><A HREF="mailto: jbj@chatham.usdesign.com">Jeff Johnson
+&lt;jbj@chatham.usdesign.com&gt;</a> massive prototyping overhaul</LI>
-<LI><A HREF="mailto: lindholm@ucs.ubc.ca">George Lindholm &lt;lindholm@ucs.ubc.ca&gt;</a> SunOS 5.1 port</LI>
+<LI><A HREF="mailto: jones@hermes.chpc.utexas.edu">William L. Jones
+&lt;jones@hermes.chpc.utexas.edu&gt;</a> RS/6000 AIX modifications, HPUX
+modifications</LI>
-<LI>
-<A HREF="mailto: louie@ni.umd.edu">Louis A. Mamakos &lt;louie@ni.umd.edu&gt;</a>
-MD5-based authentication</LI>
+<LI><A HREF="mailto:Hans.Lambermont@nl.origin-it.com">Hans Lambermont
+&lt;Hans.Lambermont@nl.origin-it.com&gt;</A> or <A
+HREF="mailto:H.Lambermont@chello.nl">&lt;H.Lambermont@chello.nl&gt;</A>
+ntpsweep</LI>
-<LI><A HREF="mailto: derek@toybox.demon.co.uk">Derek Mulcahy &lt;derek@toybox.demon.co.uk&gt;</a> and <A HREF="mailto: d@hd.org">Damon Hart-Davis &lt;d@hd.org&gt;</a> ARCRON MSF clock driver</LI>
+<LI><A HREF="http://www4.informatik.uni-erlangen.de/~kardel">Frank
+Kardel</A> <A HREF="mailto: Frank.Kardel@informatik.uni-erlangen.de">
+&lt;Frank.Kardel@informatik.uni-erlangen.de&gt;</a> PARSE
+&lt;GENERIC&gt; driver (14 reference clocks), STREAMS modules for PARSE,
+support scripts, syslog cleanup</LI>
-<LI><A HREF="mailto: thorinn@diku.dk">Lars H. Mathiesen &lt;thorinn@diku.dk&gt;</a> adaptation of foundation code for Version 3 as specified in RFC-1305</LI>
+<LI><A HREF="mailto: dkatz@cisco.com">Dave Katz
+&lt;dkatz@cisco.com&gt;</a> RS/6000 AIX port</LI>
-<LI><A HREF="mailto: mills@udel.edu">David L. Mills &lt;mills@udel.edu&gt;</a> Version 4 foundation, Spectractom WWVB, Austron GPS, Arbiter GPS, CHU, Heath, ATOM, ACTS, KSI/Odetics, IRIG clock drivers; PPS support; precision kernel; NTPv4 changes</LI>
+<LI><A HREF="mailto: leres@ee.lbl.gov">Craig Leres
+&lt;leres@ee.lbl.gov&gt;</a> 4.4BSD port, ppsclock, Maganavox GPS clock
+driver</LI>
-<LI><A HREF="mailto: moeller@gwdgv1.dnet.gwdg.de">Wolfgang Moeller &lt;moeller@gwdgv1.dnet.gwdg.de&gt;</a> VMS port</LI>
+<LI><A HREF="mailto: lindholm@ucs.ubc.ca">George Lindholm
+&lt;lindholm@ucs.ubc.ca&gt;</a> SunOS 5.1 port</LI>
-<LI><A HREF="mailto: mogul@pa.dec.com">Jeffrey Mogul &lt;mogul@pa.dec.com&gt;</a> ntptrace utility</LI>
+<LI><A HREF="mailto: louie@ni.umd.edu">Louis A. Mamakos
+&lt;louie@ni.umd.edu&gt;</a> MD5-based authentication</LI>
-<LI><A HREF="mailto: tmoore@fievel.daytonoh.ncr.com">Tom Moore &lt;tmoore@fievel.daytonoh.ncr.com&gt;</a> i386 svr4 port</LI>
+<LI><A HREF="mailto: thorinn@diku.dk">Lars H. Mathiesen
+&lt;thorinn@diku.dk&gt;</a> adaptation of foundation code for Version 3
+as specified in RFC-1305</LI>
-<LI><A HREF="mailto: Rainer.Pruy@informatik.uni-erlangen.de">Rainer Pruy &lt;Rainer.Pruy@informatik.uni-erlangen.de&gt;</a> monitoring/trap scripts, statistics file handling</LI>
+<LI><A HREF="mailto: mills@udel.edu">David L. Mills
+&lt;mills@udel.edu&gt;</a> Version 4 foundation: clock discipline,
+authentication, precision kernel; clock drivers: Spectracom, Austron,
+Arbiter, Heath, ATOM, ACTS, KSI/Odetics; audio clock drivers: CHU,
+WWV/H, IRIG</LI>
-<LI><A HREF="mailto: dirce@zk3.dec.com">Dirce Richards &lt;dirce@zk3.dec.com&gt;</a> Digital UNIX V4.0 port</LI>
+<LI><A HREF="mailto: moeller@gwdgv1.dnet.gwdg.de">Wolfgang Moeller
+&lt;moeller@gwdgv1.dnet.gwdg.de&gt;</a> VMS port</LI>
-<LI><A HREF="mailto: mrapple@quack.kfu.com">Nick Sayer &lt;mrapple@quack.kfu.com&gt;</a> SunOS streams modules</LI>
+<LI><A HREF="mailto: mogul@pa.dec.com">Jeffrey Mogul
+&lt;mogul@pa.dec.com&gt;</a> ntptrace utility</LI>
-<LI><A HREF="http://www4.informatik.uni-erlangen.de/~kardel">Frank Kardel</A> <A HREF="mailto:
-Frank.Kardel@informatik.uni-erlangen.de">
-&lt;Frank.Kardel@informatik.uni-erlangen.de&gt;</a>
-PARSE &lt;GENERIC> driver (14 reference clocks), STREAMS modules for PARSE, support scripts, syslog cleanup</LI>
+<LI><A HREF="mailto: tmoore@fievel.daytonoh.ncr.com">Tom Moore
+&lt;tmoore@fievel.daytonoh.ncr.com&gt;</a> i386 svr4 port</LI>
-<LI><A HREF="mailto: schnitz@unipress.com">Ray Schnitzler &lt;schnitz@unipress.com&gt;</a> Unixware1 port</LI>
+<LI><A HREF="mailto: derek@toybox.demon.co.uk">Derek Mulcahy
+&lt;derek@toybox.demon.co.uk&gt;</a> and <A HREF="mailto:
+d@hd.org">Damon Hart-Davis &lt;d@hd.org&gt;</a> ARCRON MSF clock
+driver</LI>
-<LI><A HREF="mailto: shields@tembel.org">Michael Shields &lt;shields@tembel.org&gt;</a> USNO clock driver</LI>
+<LI><A HREF="mailto: Rainer.Pruy@informatik.uni-erlangen.de">Rainer Pruy
+&lt;Rainer.Pruy@informatik.uni-erlangen.de&gt;</a> monitoring/trap
+scripts, statistics file handling</LI>
-<LI><A HREF="mailto: pebbles.jpl.nasa.gov">Jeff Steinman &lt;jss@pebbles.jpl.nasa.gov&gt;</a> Datum PTS clock driver</LI>
+<LI><A HREF="mailto: dirce@zk3.dec.com">Dirce Richards
+&lt;dirce@zk3.dec.com&gt;</a> Digital UNIX V4.0 port</LI>
-<LI><A HREF="mailto: harlan@pfcs.com">Harlan Stenn &lt;harlan@pfcs.com&gt;</a> GNU automake/autoconfigure makeover</LI>
+<LI><A HREF="mailto: wsanchez@apple.com">Wilfredo S&aacute;nchez
+&lt;wsanchez@apple.com&gt;</A> added support for NetInfo</LI>
-<LI><A HREF="mailto: ken@sdd.hp.com">Kenneth Stone &lt;ken@sdd.hp.com&gt;</a> HP-UX port</LI>
+<LI><A HREF="mailto: mrapple@quack.kfu.com">Nick Sayer
+&lt;mrapple@quack.kfu.com&gt;</a> SunOS streams modules</LI>
-<LI><A HREF="mailto: ajit@ee.udel.edu">Ajit Thyagarajan &lt;ajit@ee.udel.edu&gt;</a>IP multicast support</LI>
+<LI><A HREF="mailto: jack@innovativeinternet.com">Jack Sasportas
+&lt;jack@innovativeinternet.com&gt;</A> Saved a Lot of space on the
+stuff in the html/pic/ subdirectory</LI>
-<LI><A HREF="mailto: tsuruoka@nc.fukuoka-u.ac.jp">Tomoaki TSURUOKA &lt;tsuruoka@nc.fukuoka-u.ac.jp&gt;</a>TRAK clock driver</LI>
+<LI><A HREF="mailto: schnitz@unipress.com">Ray Schnitzler
+&lt;schnitz@unipress.com&gt;</a> Unixware1 port</LI>
-<LI><A HREF="mailto: vixie@vix.com">Paul A Vixie &lt;vixie@vix.com&gt;</a> TrueTime GPS driver, generic TrueTime clock driver</LI>
+<LI><A HREF="mailto: shields@tembel.org">Michael Shields
+&lt;shields@tembel.org&gt;</a> USNO clock driver</LI>
-<LI><A HREF="mailto: Ulrich.Windl@rz.uni-regensburg.de">Ulrich Windl &lt;Ulrich.Windl@rz.uni-regensburg.de&gt;</a> corrected and validated HTML documents according to the HTML DTD</LI>
+<LI><A HREF="mailto: pebbles.jpl.nasa.gov">Jeff Steinman
+&lt;jss@pebbles.jpl.nasa.gov&gt;</a> Datum PTS clock driver</LI>
-<LI><A HREF="mailto: greg.brackley@bigfoot.com">Greg Brackley &lt;greg.brackley@bigfoot.com&gt;</a> Major rework of WINNT port. Clean up recvbuf and iosignal code into separate modules.</LI>
+<LI><A HREF="mailto: harlan@pfcs.com">Harlan Stenn
+&lt;harlan@pfcs.com&gt;</a> GNU automake/autoconfigure makeover, various
+other bits (see the ChangeLog)</LI>
-<LI><A HREF="mailto: Sven_Dietrich@trimble.COM">Sven Dietrich &lt;sven_dietrich@trimble.com&gt;</a> Palisade reference clock driver, NT adj. residuals, integrated Greg's Winnt port.</LI>
+<LI><A HREF="mailto: ken@sdd.hp.com">Kenneth Stone
+&lt;ken@sdd.hp.com&gt;</a> HP-UX port</LI>
+
+<LI><A HREF="mailto: ajit@ee.udel.edu">Ajit Thyagarajan
+&lt;ajit@ee.udel.edu&gt;</a>IP multicast/anycast support</LI>
+
+<LI><A HREF="mailto: tsuruoka@nc.fukuoka-u.ac.jp">Tomoaki TSURUOKA
+&lt;tsuruoka@nc.fukuoka-u.ac.jp&gt;</a>TRAK clock driver</LI>
+
+<LI><A HREF="mailto: vixie@vix.com">Paul A Vixie
+&lt;vixie@vix.com&gt;</a> TrueTime GPS driver, generic TrueTime clock
+driver</LI>
+
+<LI><A HREF="mailto: Ulrich.Windl@rz.uni-regensburg.de">Ulrich Windl
+&lt;Ulrich.Windl@rz.uni-regensburg.de&gt;</a> corrected and validated
+HTML documents according to the HTML DTD</LI>
-<LI><A HREF="mailto: wsanchez@apple.com">Wilfredo S&aacute;nchez &lt;wsanchez@apple.com&gt;</A> added support for NetInfo</LI>
</OL>
-<hr><a href=index.htm><img align=left src=pic/home.gif&gt;</a><address><a
+<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
href=mailto:mills@udel.edu> David L. Mills &lt;mills@udel.edu&gt;</a>
-</address&gt;</a></body></html>
+</address></a></body></html>
diff --git a/contrib/ntp/html/driver30.htm b/contrib/ntp/html/driver30.htm
index 8d547b180c43..fab604b8a318 100644
--- a/contrib/ntp/html/driver30.htm
+++ b/contrib/ntp/html/driver30.htm
@@ -17,24 +17,32 @@ Motorola Oncore GPS receiver</H3>
<H4>
Synopsis</H4>
-Address: 127.127.30.0
-<BR>Reference ID: <TT>GPS</TT>
-<BR>Driver ID: ONCORE
-<BR>Serial Port: <TT>/dev/cuaa0</TT>; 9600 baud, 8-bits, no parity
-<BR>PPS Port: <TT>/dev/xpps0</TT>; <TT>PPS_CAPTUREASSERT</TT>
-required, <TT>PPS_OFFSETASSERT</TT> supported.
+Address: 127.127.30.0<BR>
+Reference ID: <TT>GPS</TT><BR>
+Driver ID: ONCORE<BR>
+Serial Port: <TT>/dev/oncore.serial.0</TT>; &nbsp;9600 baud, 8-bits,
+no parity.<BR>
+PPS Port: <TT>/dev/oncore.pps.0</TT>;&nbsp; <TT>PPS_CAPTUREASSERT</TT>
+required,&nbsp; <TT>PPS_OFFSETASSERT</TT> supported.
<H4>
Description</H4>
This driver supports various models of the <A
HREF="http://www.mot.com/AECS/PNSB/products">Motorola Oncore GPS
-receivers</A>. as long as they support the <I>Motorola Binary
+receivers</A> as long as they support the <I>Motorola Binary
Protocol</I>.
-<P>The two most interesting version of the Oncore are the "UT+"&nbsp;
-and the "Remote" which is a prepackaged "UT+".&nbsp; The evaluation kit
+<P>The three most interesting versions of the Oncore are the "VP",&nbsp;
+the "UT+",&nbsp;
+and the "Remote" which is a prepackaged "UT+".&nbsp;
+The "VP" is no longer available.
+
+<P>The evaluation kit
can also be recommended, it interfaces to a PC straightaway, using the
-parallel port for PPS input (supported under FreeBSD), and packs the
+serial (DCD) or parallel port for PPS input and packs the
receiver in a nice and sturdy box.
+Two less expensive interface kits are available from
+<A HREF="http://www.tapr.org">TAPR </A>.
+
<BR>&nbsp;
<CENTER><TABLE NOSAVE >
<TR NOSAVE>
@@ -61,18 +69,22 @@ WIDTH=210></TD>
</TR>
</TABLE></CENTER>
-<P>The driver requires a standard <TT>PPS</TT> interface for the pulse-
-per-second output from the receiver.&nbsp; The serial data stream alone
+<P>The driver requires a standard <TT>PPS</TT> interface for the
+pulse-per-second output from the receiver.&nbsp; The serial data stream alone
does not provide precision time stamps (0-50msec variance, according to
the manual), whereas the PPS output is precise down to 50 nsec (1 sigma)
-for the UT models. <P>The driver will use the "position hold" mode if
-available, with either the receivers built-in site-survey or a similar
-algorithm implemented in this driver.
+for the VP/UT models.
+
+<P>The driver will use the "position hold" mode with
+user provided coordinates,
+the receivers built-in site-survey,
+or a similar algorithm implemented in this driver.
<H4>
Monitor Data</H4>
The driver is quite chatty on stdout if ntpd is run with
debugging.&nbsp;
A manual will be required though.
+Additional information is written to the clockstats file, if configured.
<H4>
Fudge Factors</H4>
@@ -114,7 +126,7 @@ Not used by this driver.</DD>
<TT>flag2 0 | 1</TT></DT>
<DD>
-Assume GPS receiver is on a mobile platform if set.</DD>
+Not used by this driver.</DD>
<DT>
<TT>flag3 0 | 1</TT></DT>
@@ -128,26 +140,40 @@ Not used by this driver.</DD>
<DD>
Not used by this driver.</DD>
</DL>
-<B>Additional Information</B><B></B>
-<P>The driver has been developed under FreeBSD, and may still be pretty
-FreeBSD centric.&nbsp; Patches are most welcome.
-<P><B>Performance</B><B></B>
-<P>Really good.&nbsp; With the UT+, the generated PPS pulse is
-referenced
+<B>Additional Information</B>
+<P>The driver has been tested on FreeBSD, Linux and SunOS.
+
+<P>There is a driver specific configuration file <TT>/etc/ntp.oncore</TT>
+that contains information on the startup mode, the location of the GPS
+receiver, an offset of the PPS signal from zero, and the cable delay.
+The offset shifts the PPS signal to avoid interrupt pileups `on' the second,
+and adjust the timestamp accordingly.
+See the driver source for information on this file.
+The default with no file is: no delay, no offset, and a site survey is done
+to get the location of the gps receiver.
+
+<P>The <TT>/etc/ntp.conf</TT> file will need a line of the form<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+<TT> pps /dev/oncore.pps.0 [ assert/clear ] hardpps</TT><BR>
+if you want the oncore driver to control the kernel PLL.
+For more information, see the <A HREF=clockopt.htm>Reference Clock
+Options</A> page.
+
+<P><B>Performance</B>
+<P>Really good.&nbsp; With the VP/UT+, the generated PPS pulse is referenced
to UTC(GPS)&nbsp;with better than 50 nsec (1 sigma) accuracy.&nbsp; The
limiting factor will be the timebase of the computer and the precision
with which you can timestamp the rising flank of the
PPS&nbsp;signal.&nbsp;
Using FreeBSD,&nbsp; a FPGA&nbsp;based Timecounter/PPS&nbsp;interface
-and
-an ovenized quartz oscillator, that performance has been reproduced.
-&nbsp;For
-more details on this aspect:&nbsp; <A
+and an ovenized quartz oscillator, that performance has been reproduced.
+&nbsp;For more details on this aspect:&nbsp; <A
HREF="http://phk.freebsd.dk/rover.html">Sub-Microsecond
timekeeping under FreeBSD</A>
<HR>
<ADDRESS>
-Poul-Henning Kamp (phk@FreeBSD.org)</ADDRESS>
-
+Poul-Henning Kamp (phk@FreeBSD.org),
+Reg Clemens (reg@dwf.com)
+</ADDRESS>
</BODY>
</HTML>
diff --git a/contrib/ntp/html/driver35.htm b/contrib/ntp/html/driver35.htm
new file mode 100644
index 000000000000..d3b77e0e201a
--- /dev/null
+++ b/contrib/ntp/html/driver35.htm
@@ -0,0 +1,82 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>Conrad parallel port radio clock</title>
+</head>
+<body>
+
+<h3>Conrad parallel port radio clock</h3>
+<hr>
+
+<h4>Synopsis</h4>
+
+<p>Address: 127.127.35.<i>u</i><br>
+Reference ID: <tt>PCF</tt><br>
+Driver ID: <tt>PCF</tt><br>
+Parallel Port: <tt>/dev/pcfclock<i>u</i></tt>
+</p>
+
+<h4>Description</h4>
+
+<p>This driver supports the parallel port radio clocks sold by <a
+href="http://www.conrad-electronic.com/">Conrad Electronic</a> under
+order numbers 967602 and 642002. The battery-powered radio clock is
+put between a parallel port and your printer. It receives the legal
+German time, which is either CET or CEST, from the DCF77 transmitter
+and uses it to set internal quartz clock. The DCF77 transmitter is
+located near to Frankfurt/Main and covers a radius of more than 1500
+kilometers.
+
+<p>The driver requires that the pcfclock device driver be installed.
+A device driver for Linux&nbsp;2.2 is available at
+<a href="http://home.pages.de/~voegele/pcf.html">the pcfclock driver
+page</a>.
+</p>
+
+<p>The driver uses C library functions to convert the received
+timecode to UTC and therefore requires that the local timezone be
+CET/CEST. If your server is not located in Central Europe, you have
+to set the environment variable TZ to CET before <tt>ntpd</tt> is
+started.</p>
+
+<h4>Monitor Data</h4>
+
+<p>Each timecode is written to the <tt>clockstats</tt> file in the format
+<tt>YYYY MM DD HH MI SS</tt>.</p>
+
+<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>PCF</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>Andreas Voegele (andreas.voegele@gmx.de)</address>
+
+</body>
+</html>
diff --git a/contrib/ntp/html/driver36.htm b/contrib/ntp/html/driver36.htm
new file mode 100644
index 000000000000..6f70dcc7ea9c
--- /dev/null
+++ b/contrib/ntp/html/driver36.htm
@@ -0,0 +1,839 @@
+<html><head><title>
+Radio WWV/H Audio Demodulator/Decoder
+</title></head><body><h3>
+Radio WWV/H Audio Demodulator/Decoder
+</h3><hr>
+
+<h4>Synopsis</h4>
+
+Address: 127.127.36.<I>u</I>
+<br>Reference ID: <tt>WWV</tt> or <tt>WWVH</tt>
+<br>Driver ID: <tt>WWV_AUDIO</tt>
+<br>Autotune Port: <tt>/dev/icom</tt>; 9600 baud, 8-bits, no parity
+<br>Audio Device: <tt>/dev/audio</tt> and <tt>/dev/audioctl</tt>
+
+<h4>Description</h4>
+
+This driver synchronizes the computer time using data encoded in
+shortwave radio transmissions from NIST time/frequency stations WWV in
+Ft. Collins, CO, and WWVH in Kauai, HI. Transmissions are made
+continuously on 2.5, 5, 10, 15 and 20 MHz. An ordinary shortwave
+receiver can be tuned manually to one of these frequencies or, in the
+case of ICOM receivers, the receiver can be tuned automatically by the
+driver as propagation conditions change throughout the day and night.
+The performance of this driver when tracking one of the stations is
+ordinarily better than 1 ms in time with frequency drift less than 0.5
+PPM when not tracking either station.
+
+<p>The demodulation and decoding algorithms used by this driver are
+based on a machine language program developed for the TAPR DSP93 DSP
+unit, which uses the TI 320C25 DSP chip. The analysis, design and
+performance of the program running on this unit is described in: Mills,
+D.L. A precision radio clock for WWV transmissions. Electrical
+Engineering Report 97-8-1, University of Delaware, August 1997, 25 pp.
+Available from <a href=http://www.eecis.udel.edu/~mills/reports.htm>
+www.eecis.udel.edu/~mills/reports.htm</a>. For use in this driver, the
+original program was rebuilt in the C language and adapted to the NTP
+driver interface. The algorithms have been modified somewhat to improve
+performance under weak signal conditions and to provide an automatic
+station identification feature.
+
+<p>This driver incorporates several features in common with other audio
+drivers such as described in the <a href=driver7.htm>Radio CHU Audio
+Demodulator/Decoder</a> and the <a href=driver6.htm>IRIG Audio
+Decoder</a> pages. They include automatic gain control (AGC), selectable
+audio codec port and signal monitoring capabilities. For a discussion of
+these common features, as well as a guide to hookup, debugging and
+monitoring, see the <a href=audio.htm>Reference Clock Audio Drivers</a>
+page.
+
+<p>The WWV signal format is described in NIST Special Publication 432
+(Revised 1990). It consists of three elements, a 5-ms, 1000-Hz pulse,
+which occurs at the beginning of each second, a 800-ms, 1000-Hz pulse,
+which occurs at the beginning of each minute, and a pulse-width
+modulated 100-Hz subcarrier for the data bits, one bit per second. The
+WWVH format is identical, except that the 1000-Hz pulses are sent at
+1200 Hz. Each minute encodes nine BCD digits for the time of century
+plus seven bits for the daylight savings time (DST) indicator, leap
+warning indicator and DUT1 correction.
+
+<h4>Program Architecture</h4>
+
+<p>As in the original program, the clock discipline is modelled as a
+Markov process, with probabilistic state transitions corresponding to a
+conventional clock and the probabilities of received decimal digits. The
+result is a performance level which results in very high accuracy and
+reliability, even under conditions when the minute beep of the signal,
+normally its most prominent feature, can barely be detected by ear with
+a shortwave receiver.
+
+<p>The analog audio signal from the shortwave radio is sampled at 8000
+Hz and converted to digital representation. The 1000/1200-Hz pulses and
+100-Hz subcarrier are first separated using two IIR filters, a 600-Hz
+bandpass filter centered on 1100 Hz and a 150-Hz lowpass filter. The
+minute sync pulse is extracted using a 800-ms synchronous matched filter
+and pulse grooming logic which discriminates between WWV and WWVH
+signals and noise. The second sync pulse is extracted using a 5-ms FIR
+matched filter and 8000-stage comb filter.
+
+<p>The phase of the 100-Hz subcarrier relative to the second sync pulse
+is fixed at the transmitter; however, the audio highpass filter in most
+radios affects the phase response at 100 Hz in unpredictable ways. The
+driver adjusts for each radio using two 170-ms synchronous matched
+filters. The I (in-phase) filter is used to demodulate the subcarrier
+envelope, while the Q (quadrature-phase) filter is used in a tracking
+loop to discipline the codec sample clock and thus the demodulator
+phase.
+
+<p>The data bit probabilities are determined from the subcarrier
+envelope using a threshold-corrected slicer. The averaged envelope
+amplitude 30 ms from the beginning of the second establishes the minimum
+(noise floor) value, while the amplitude 200 ms from the beginning
+establishes the maximum (signal peak) value. The slice level is midway
+between these two values. The negative-going envelope transition at the
+slice level establishes the length of the data pulse, which in turn
+establish probabilities for binary zero (P0) or binary one (P1). The
+values are established by linear interpolation between the pulse lengths
+for P0 (300 ms) and P1 (500 ms) so that the sum is equal to one. If the
+driver has not synchronized to the minute pulse, or if the data bit
+amplitude, signal/noise ratio (SNR) or length are below thresholds, the
+bit is considered invalid and all three probabilities are set to zero.
+
+<p>The difference between the P1 and P0 probabilities, or likelihood,
+for each data bit is exponentially averaged in a set of 60 accumulators,
+one for each second, to determine the semi-static miscellaneous bits,
+such as DST indicator, leap second warning and DUT1 correction. In this
+design, an average value larger than a positive threshold is interpreted
+as a hit on one and a value smaller than a negative threshold as a hit
+on zero. Values between the two thresholds, which can occur due to
+signal fades or loss of signal, are interpreted as a miss, and result in
+no change of indication.
+
+<p>The BCD digit in each digit position of the timecode is represented
+as four data bits, all of which must be valid for the digit itself to be
+considered valid. If so, the bits are correlated with the bits
+corresponding to each of the valid decimal digits in this position. If
+the digit is invalid, the correlated value for all digits in this
+position is assumed zero. In either case, the values for all digits are
+exponentially averaged in a likelihood vector associated with this
+position. The digit associated with the maximum over all of the averaged
+values then becomes the maximum likelihood selection for this position
+and the ratio of the maximum over the next lower value becomes the
+likelihood ratio.
+
+<p>The decoding matrix contains nine row vectors, one for each digit
+position. Each row vector includes the maximum likelihood digit,
+likelihood vector and other related data. The maximum likelihood digit
+for each of the nine digit positions becomes the maximum likelihood time
+of the century. A built-in transition function implements a conventional
+clock with decimal digits that count the minutes, hours, days and years,
+as corrected for leap seconds and leap years. The counting operation
+also rotates the likelihood vector corresponding to each digit as it
+advances. Thus, once the clock is set, each clock digit should
+correspond to the maximum likelihood digit as transmitted.
+
+<p>Each row of the decoding matrix also includes a compare counter and
+the difference (modulo the radix) between the current clock digit and
+most recently determined maximum likelihood digit. If a digit likelihood
+exceeds the decision level and the difference is constant for a number
+of successive minutes in any row, the maximum likelihood digit replaces
+the clock digit in that row. When this condition is true for all rows
+and the second epoch has been reliably determined, the clock is set (or
+verified if it has already been set) and delivers correct time to the
+integral second. The fraction within the second is derived from the
+logical master clock, which runs at 8000 Hz and drives all system timing
+functions.
+
+<p>The logical master clock is derived from the audio codec clock. Its
+frequency is disciplined by a frequency-lock loop (FLL) which operates
+independently of the data recovery functions. At averaging intervals
+determined by the measured jitter, the frequency error is calculated as
+the difference between the most recent and the current second epoch
+divided by the interval. The sample clock frequency is then corrected by
+this amount using an exponential average. When first started, the
+frequency averaging interval is eight seconds, in order to compensate
+for intrinsic codec clock frequency offsets up to 125 PPM. Under most
+conditions, the averaging interval doubles in stages from the initial
+value to over 1000 seconds, which results in an ultimate frequency
+precision of 0.125 PPM, or about 11 ms/day.
+
+<p>It is important that the logical clock frequency is stable and
+accurately determined, since in most applications the shortwave radio
+will be tuned to a fixed frequency where WWV or WWVH signals are not
+available throughout the day. In addition, in some parts of the US,
+especially on the west coast, signals from either or both WWV and WWVH
+may be available at different times or even at the same time. Since the
+propagation times from either station are almost always different, each
+station must be reliably identified before attempting to set the clock.
+
+<p>Station identification uses the 800-ms minute pulse transmitted by
+each station. In the acquisition phase the entire minute is searched
+using both the WWV and WWVH using matched filters and a pulse gate
+discriminator similar to that found in radar acquisition and tracking
+receivers. The peak amplitude found determines a range gate and window
+where the next pulse is expected to be found. The minute is scanned
+again to verify the peak is indeed in the window and with acceptable
+amplitude, SNR and jitter. At this point the receiver begins to track
+the second sync pulse and operate as above until the clock is set.
+
+<p>Once the minute is synchronized, the range gate is fixed and only
+energy within the window is considered for the minute sync pulse. A
+compare counter increments by one if the minute pulse has acceptable
+amplitude, SNR and jitter and decrements otherwise. This is used as a
+quality indicator and reported in the timecode and also for the autotune
+function described below.
+
+<h4>Performance</h4>
+
+<p>It is the intent of the design that the accuracy and stability of the
+indicated time be limited only by the characteristics of the propagation
+medium. Conventional wisdom is that synchronization via the HF medium is
+good only to a millisecond under the best propagation conditions. The
+performance of the NTP daemon disciplined by the driver is clearly
+better than this, even under marginal conditions. Ordinarily, with
+marginal to good signals and a frequency averaging interval of 1024 s,
+the frequency is stabilized within 0.1 PPM and the time within 125 <font
+face=Symbol>m</font>s. The frequency stability characteristic is highly
+important, since the clock may have to free-run for several hours before
+reacquiring the WWV/H signal.
+
+<p>The expected accuracy over a typical day was determined using the
+DSP93 and an oscilloscope and cesium oscillator calibrated with a GPS
+receiver. With marginal signals and allowing 15 minutes for initial
+synchronization and frequency compensation, the time accuracy determined
+from the WWV/H second sync pulse was reliably within 125 <font
+face=Symbol>m</font>s. In the particular DSP-93 used for program
+development, the uncorrected CPU clock frequency offset was
+45.8&plusmn;0.1 PPM. Over the first hour after initial synchronization,
+the clock frequency drifted about 1 PPM as the frequency averaging
+interval increased to the maximum 1024 s. Once reaching the maximum, the
+frequency wandered over the day up to 1 PPM, but it is not clear whether
+this is due to the stability of the DSP-93 clock oscillator or the
+changing height of the ionosphere. Once the frequency had stabilized and
+after loss of the WWV/H signal, the frequency drift was less than 0.5
+PPM, which is equivalent to 1.8 ms/h or 43 ms/d. This resulted in a step
+phase correction up to several milliseconds when the signal returned.
+
+<p>The measured propagation delay from the WWV transmitter at Boulder,
+CO, to the receiver at Newark, DE, is 23.5&plusmn;0.1 ms. This is
+measured to the peak of the pulse after the second sync comb filter and
+includes components due to the ionospheric propagation delay, nominally
+8.9 ms, communications receiver delay and program delay. The propagation
+delay can be expected to change about 0.2 ms over the day, as the result
+of changing ionosphere height. The DSP93 program delay was measured at
+5.5 ms, most of which is due to the 400-Hz bandpass filter and 5-ms
+matched filter. Similar delays can be expected of this driver.
+
+<h4>Program Operation</h4>
+
+The driver begins operation immediately upon startup. It first searches
+for one or both of the stations WWV and WWVH and attempts to acquire
+minute sync. This may take some fits and starts, as the driver expects
+to see three consecutive minutes with good signals and low jitter. If
+the autotune function is active, the driver will rotate over all five
+frequencies and both WWV and WWVH stations until three good minutes are
+found.
+
+<p>The driver then acquires second sync, which can take up to several
+minutes, depending on signal quality. At the same time the driver
+accumulates likelihood values for each of the nine digits of the clock,
+plus the seven miscellaneous bits included in the WWV/H transmission
+format. The minute units digit is decoded first and, when five
+repetitions have compared correctly, the remaining eight digits are
+decoded. When five repetitions of all nine digits have decoded
+correctly, which normally takes 15 minutes with good signals and up to
+an hour when buried in noise, and the second sync alarm has not been
+raised for two minutes, the clock is set (or verified) and is selectable
+to discipline the system clock.
+
+<p>As long as the clock is set or verified, the system clock offsets are
+provided once each second to the reference clock interface, where they
+are saved in a buffer. At the end of each minute, the buffer samples are
+groomed by the median filter and trimmed-mean averaging functions. Using
+these functions, the system clock can in principle be disciplined to a
+much finer resolution than the 125-<font face=Symbol>m</font>s sample
+interval would suggest, although the ultimate accuracy is probably
+limited by propagation delay variations as the ionspheric height varies
+throughout the day and night.
+
+<p>As long as signals are available, the clock frequency is disciplined
+for use during times when the signals are unavailable. The algorithm
+refines the frequency offset using increasingly longer averaging
+intervals to 1024 s, where the precision is about 0.1 PPM. With good
+signals, it takes well over two hours to reach this degree of precision;
+however, it can take many more hours than this in case of marginal
+signals. Once reaching the limit, the algorithm will follow frequency
+variations due to temperature fluctuations and ionospheric height
+variations.
+
+<p>It may happen as the hours progress around the clock that WWV and
+WWVH signals may appear alone, together or not at all. When the driver
+is first started, the NTP reference identifier appears as <tt>NONE</tt>.
+When the driver has acquired one or both stations and mitigated which
+one is best, it sets the station identifier in the timecode as described
+below. In addition, the NTP reference identifier is set to the station
+callsign. If the propagation delays has been properly set with the
+<tt>fudge time1</tt> (WWV) and <tt>fudge time2</tt> (WWVH) commands in
+the configuration file, handover from one station to the other will be
+seamless.
+
+<p>Once the clock has been set for the first time, it will appear
+reachable and selectable to discipline the system clock, even if the
+broadcast signal fades to obscurity. A consequence of this design is
+that, once the clock is set, the time and frequency are disciplined only
+by the second sync pulse and the clock digits themselves are driven by
+the clock state machine and ordinarily never changed. However, as long
+as the clock is set correctly, it will continue to read correctly after
+a period of signal loss, as long as it does not drift more than 500 ms
+from the correct time. Assuming the clock frequency can be disciplined
+within 1 PPM, the clock could coast without signals for some 5.8 days
+without exceeding that limit. If for some reason this did happen, the
+clock would be in the wrong second and would never resynchronize. To
+protect against this most unlikely situation, if after four days with no
+signals, the clock is considered unset and resumes the synchronization
+procedure from the beginning.
+
+<p>To work well, the driver needs a communications receiver with good
+audio response at 100 Hz. Most shortwave and communications receivers
+roll off the audio response below 250 Hz, so this can be a problem,
+especially with receivers using DSP technology, since DSP filters can
+have very fast rolloff outside the passband. Some DSP transceivers, in
+particular the ICOM 775, have a programmable low frequency cutoff which
+can be set as low as 80 Hz. However, this particular radio has a strong
+low frequency buzz at about 10 Hz which appears in the audio output and
+can affect data recovery under marginal conditions. Although not tested,
+it would seem very likely that a cheap shortwave receiver could function
+just as well as an expensive communications receiver.
+
+<h4>Autotune</h4>
+
+<p>The driver includes provisions to automatically tune the radio in
+response to changing radio propagation conditions throughout the day and
+night. The radio interface is compatible with the ICOM CI-V standard,
+which is a bidirectional serial bus operating at TTL levels. The bus can
+be connected to a serial port using a level converter such as the CT-17.
+The serial port speed is presently compiled in the program, but can be
+changed in the driver source file.
+
+<p>Each ICOM radio is assigned a unique 8-bit ID select code, usually
+expressed in hex format. To activate the CI-V interface, the
+<tt>mode</tt> keyword of the <tt>server</tt> configuration command
+specifies a nonzero select code in decimal format. A table of ID select
+codes for the known ICOM radios is given below. A missing <tt>mode</tt>
+keyword or a zero argument leaves the interface disabled. The driver
+will attempt to open the device <tt>/dev/icom</tt> and, if successful
+will activate the autotune function and tune the radio to each operating
+frequency in turn while attempting to acquire minute sync from either
+WWV or WWVH. However, the driver is liberal in what it assumes of the
+configuration. If the <tt>/dev/icom</tt> link is not present or the open
+fails or the CI-V bus or radio is inoperative, the driver quietly gives
+up with no harm done.
+
+<p>Once acquiring minute sync, the driver operates as described above to
+set the clock. However, during seconds 59, 0 and 1 of each minute it
+tunes the radio to one of the five broadcast frequencies to measure the
+sync pulse and data pulse amplitudes and SNR and update the compare
+counter. Each of the five frequencies are probed in a five-minute
+rotation to build a database of current propagation conditions for all
+signals that can be heard at the time. At the end of each rotation, a
+mitigation procedure scans the database and retunes the radio to the
+best frequency and station found. For this to work well, the radio
+should be set for a fast AGC recovery time. This is most important while
+tracking a strong signal, which is normally the case, and then probing
+another frequency, which may have much weaker signals.
+
+<p>Reception conditions for each frequency and station are evaluated
+according to a metric which considers the minute sync pulse amplitude,
+SNR and jitter, as well as, the data pulse amplitude and SNR. The minute
+pulse is evaluated at second 0, while the data pulses are evaluated at
+seconds 59 and 1. The results are summarized in a scoreboard of three
+bits
+
+<dl>
+
+<p><dt><tt>0x0001</tt>
+<dd>Jitter exceeded. The difference in epoches between the last minute
+sync pulse and the current one exceeds 50 ms (400 samples).</dd>
+
+<dt><tt>0x0002</tt>
+<dd>Minute pulse error. For the minute sync pulse in second 0, either
+the amplitude or SNR is below threshold (2000 and 20 dB,
+respectively).</dd>
+
+<dt><tt>0x0004</tt>
+<dd>Minute pulse error. For both of the data pulses in seocnds 59 and 1,
+either the amplitude or SNR is below threshold (1000 and 10 dB,
+respectively).</dd>
+
+</dl>
+
+<p>If none of the scoreboard bits are set, the compare counter is
+increased by one to a maximum of six. If any bits are set, the counter
+is decreased by one to a minimum of zero. At the end of each minute, the
+frequency and station with the maximum compare count is chosen, with
+ties going to the highest frequency.
+
+<h4>Diagnostics</h4>
+
+<p>The autotune process produces diagnostic information along with the
+timecode. This is very useful for evaluating the performance of the
+algorithm, as well as radio propagation conditions in general. The
+message is produced once each minute for each frequency in turn after
+minute sync has been acquired.
+
+<p><tt>wwv5 port agc wwv wwvh</tt>
+
+<p>where <tt>port</tt> and <tt>agc</tt> are the audio port and gain,
+respectively, for this frequency and <tt>wwv</tt> and <tt>wwvh</tt> are
+two sets of fields, one each for WWV and WWVH. Each of the two fields
+has the format
+
+<p><tt>ident score comp sync/snr/jitr</tt>
+
+<p>where <tt>ident</tt>encodes the station (<tt>C</tt> for WWV,
+<tt>H</tt> for WWVH) and frequency (2, 5, 10, 15 and 20), <tt>score</tt>
+is the scoreboard described above, <tt>comp</tt> is the compare counter,
+<tt>sync</tt> is the minute sync pulse amplitude, <tt>snr</tt> the SNR
+of the pulse and <tt>jitr</tt> is the sample difference between the
+current epoch and the last epoch. An example is:
+
+<p><tt>wwv5 2 111 C20 0100 6 8348/30.0/-3 H20 0203 0 22/-12.4/8846</tt>
+
+<p>Here the radio is tuned to 20 MHz and the line-in port AGC is
+currently 111 at that frequency. The message contains a report for WWV
+(<tt>C20</tt>) and WWVH (<tt>H20</tt>). The WWV report scoreboard is
+0100 and the compare count is 6, which suggests very good reception
+conditions, and the minute sync amplitude and SNR are well above
+thresholds (2000 and 20 dB, respectively). Probably the most sensitive
+indicator of reception quality is the jitter, -3 samples, which is well
+below threshold (50 ms or 400 samples). While the message shows solid
+reception conditions from WWV, this is not the case for WWVH. Both the
+minute sync amplitude and SNR are below thresholds and the jitter is
+above threshold.
+
+<p>A sequence of five messages, one for each minute, might appear as
+follows:
+
+<p><pre>wwv5 2 95 C2 0107 0 164/7.2/8100 H2 0207 0 80/-5.5/7754
+wwv5 2 99 C5 0104 0 3995/21.8/395 H5 0207 0 27/-9.3/18826
+wwv5 2 239 C10 0105 0 9994/30.0/2663 H10 0207 0 54/-16.1/-529
+wwv5 2 155 C15 0103 3 3300/17.8/-1962 H15 0203 0 236/17.0/4873
+wwv5 2 111 C20 0100 6 8348/30.0/-3 H20 0203 0 22/-12.4/8846</pre>
+
+<p>Clearly, the only frequencies that are available are 15 MHz and 20
+MHz and propagation may be failing for 15 MHz. However, minute sync
+pulses are being heard on 5 and 10 MHz, even though the data pulses are
+not. This is typical of late afternoon when the maximum usable frequency
+(MUF) is falling and the ionospheric loss at the lower frequencies is
+beginning to decrease.
+
+<h4>Debugging Aids</h4>
+
+<p>The most convenient way to track the driver status is using the
+<tt>ntpq</tt> program and the <tt>clockvar</tt> command. This displays
+the last determined timecode and related status and error counters, even
+when the driver is not discipline the system clock. If the debugging
+trace feature (<tt>-d</tt> on the <tt>ntpd</tt> command line)is enabled,
+the driver produces detailed status messages as it operates. If the
+<tt>fudge flag 4</tt> is set, these messages are written to the
+<tt>clockstats</tt> file. All messages produced by this driver have the
+prefix <tt>chu</tt> for convenient filtering with the Unix <tt>grep</tt>
+command.
+
+<p>In the following descriptions the units of amplitude, phase,
+probability and likelihood are normalized to the range 0-6000 for
+convenience. In addition, the signal/noise ratio (SNR) and likelihood
+ratio are measured in decibels and the words with bit fields are in
+hex. Most messages begin with a leader in the following format:
+
+<p><tt>wwvn ss stat sigl</tt>
+
+<p>where <tt>wwvn</tt> is the message code, <tt>ss</tt> the second of
+minute, <tt>stat</tt> the driver status word and <tt>sigl</tt> the
+second sync pulse amplitude. A full explanation of the status bits is
+contained in the driver source listing; however, the following are the
+most useful for debugging.
+
+<dl>
+
+<p><dt><tt>0x0001</tt>
+<dd>Minute sync. Set when the decoder has identified a station and
+acquired the minute sync pulse.</dd>
+<p><dt><tt>0x0002</tt>
+<dd>Second sync. Set when the decoder has acquired the second sync pulse
+and within 125 <font face=Symbol>m</font>s of the correct phase.</dd>
+
+<p><dt><tt>0x0004</tt>
+<dd>Minute unit sync. Set when the decoder has reliably determined the
+unit digit of the minute.</dd>
+
+<p><dt><tt>0x0008</tt>
+<dd>Clock set. Set when the decoder has reliably determined all nine
+digits of the timecode and is selectable to discipline the system
+clock.</dd>
+
+</dl>
+
+<p>With debugging enabled the driver produces messages in the following
+formats:
+
+<p>Format <tt>wwv8</tt> messages are produced once per minute by the WWV
+and WWVH station processes before minute sync has been acquired. They
+show the progress of identifying and tracking the minute pulse of each
+station.
+
+<p><tt>wwv8 port agc ident comp ampl snr epoch jitr offs</tt>
+
+<p>where <tt>port</tt> and <tt>agc</tt> are the audio port and gain,
+respectively. The <tt>ident</tt>encodes the station (<tt>C</tt> for WWV,
+<tt>H</tt> for WWVH) and frequency (2, 5, 10, 15 and 20). For the
+encoded frequency, <tt>comp</tt> is the compare counter, <tt>ampl</tt>
+the pulse amplitude, <tt>snr</tt> the SNR, <tt>epoch</tt> the sample
+number of the minute pulse in the minute, <tt>jitr</tt> the change since
+the last <tt>epoch</tt> and <tt>offs</tt> the minute pulse offset
+relative to the second pulse. An example is:
+
+<p><tt> wwv8 2 127 C15 2 9247 30.0 18843 -1 1</tt>
+<br><tt>wwv8 2 127 H15 0 134 -2.9 19016 193 174</tt>
+
+<p>Here the radio is tuned to 15 MHz and the line-in port AGC is
+currently 127 at that frequency. The driver has not yet acquired minute
+sync, WWV has been heard for at least two minutes, and WWVH is in the
+noise. The WWV minute pulse amplitude and SNR are well above the
+threshold (2000 and 6 dB, respectively) and the minute epoch has been
+determined -1 sample relative to the last one and 1 sample relative to
+the second sync pulse. The compare counter has incrmented to two; when
+it gets to three, minute sync has been acquired.
+
+<p>Format <tt>wwv3</tt> messages are produced after minute sync has been
+acquired and until the seconds unit digit is determined. They show the
+results of decoding each bit of the transmitted timecode.
+
+<p><tt>wwv3 ss stat sigl ampl phas snr prob like</tt>
+
+<p>where <tt>ss</tt>, <tt>stat</tt> and <tt>sigl</tt> are as above,
+<tt>ampl</tt> is the subcarrier amplitude, <tt>phas</tt> the subcarrier
+phase, <tt>snr</tt> the subcarrier SNR, <tt>prob</tt> the bit
+probability and <tt>like</tt> the bit likelihood. An example is:
+
+<p><tt>wwv3 28 0123 4122 4286 0 24.8 -5545 -1735</tt>
+
+<p>Here the driver has acquired minute and second sync, but has not yet
+determined the seconds unit digit. However, it has just decoded bit 28
+of the minute. The results show the second sync pulse amplitude well
+over the threshold (500), subcarrier amplitude well above the threshold
+(1000), good subcarrier tracking phase and SNR well above the threshold
+(10 dB). The bit is almost certainly a zero and the likelihood of a zero
+in this second is very high.
+<p>Format <tt>wwv4</tt> messages are produced for each of the nine BCD
+timecode digits until the clock has been set or verified. They show the
+results of decoding each digit of the transmitted timecode.
+<p><tt>wwv4 ss stat sigl radx ckdig mldig diff cnt like snr</tt>
+
+<p>where <tt>ss</tt>, <tt>stat</tt> and <tt>sigl</tt> are as above,
+<tt>radx</tt> is the digit radix (3, 4, 6, 10), <tt>ckdig</tt> the
+current clock digit, <tt>mldig</tt> the maximum likelihood digit,
+<tt>diff</tt> the difference between these two digits modulo the radix,
+<tt>cnt</tt> the compare counter, <tt>like</tt> the digit likelihood and
+<tt>snr</tt> the likelihood ratio. An example is:
+
+<p><tt>wwv4 8 010f 5772 10 9 9 0 6 4615 6.1</tt>
+
+<p>Here the driver has previousl set or verified the clock. It has just
+decoded the digit preceding second 8 of the minute. The digit radix is
+10, the current clock and maximum likelihood digits are both 9, the
+likelihood is well above the threshold (1000) and the likelihood
+function well above threshold (3.0 dB). Short of a hugely unlikely
+probability conspiracy, the clock digit is most certainly a 9.
+
+<p>Format <tt>wwv2</tt> messages are produced at each master oscillator
+frequency update, which starts at 8 s, but eventually climbs to 1024 s.
+They show the progress of the algorithm as it refines the frequency
+measurement to a precision of 0.1 PPM.
+
+<p><tt>wwv2 ss stat sigl avint avcnt avinc jitr delt freq</tt>
+
+<p>where <tt>ss</tt>, <tt>stat</tt> and <tt>sigl</tt> are as above,
+<tt>avint</tt> is the averaging interval, <tt>avcnt</tt> the averaging
+interval counter, <tt>avinc</tt> the interval increment, <tt>jitr</tt>
+the sample change between the beginning and end of the interval,
+<tt>delt</tt> the computed frequency change and <tt>freq</tt> the
+current frequency (PPM). An example is:
+
+<p><tt>wwv2 22 030f 5795 256 256 4 0 0.0 66.7</tt>
+
+<p>Here the driver has acquired minute and second sync and set the
+clock. The averaging interval has increased to 256 s on the way to 1024
+s, has stayed at that interval for 4 averaging intervals, has measured
+no change in frequency and the current frequency is 66.7 PPM.
+
+<p>If the CI-V interface for ICOM radios is active, a debug level
+greater than 1 will produce a trace of the CI-V command and response
+messages. Interpretation of these messages requires knowledge of the
+CI-V protocol, which is beyond the scope of this document.
+
+<h4>Monitor Data</h4>
+
+When enabled by the <tt>filegen</tt> facility, every received timecode
+is written to the <tt>clockstats</tt> file in the following format:
+
+<pre>
+ sq yy ddd hh:mm:ss.fff ld du lset agc stn rfrq errs freq cons
+
+ s sync indicator
+ q quality character
+ yyyy Gregorian year
+ ddd day of year
+ hh hour of day
+ mm minute of hour
+ fff millisecond of second
+ l leap second warning
+ d DST state
+ dut DUT sign and magnitude
+ lset minutes since last set
+ agc audio gain
+ ident station identifier and frequency
+ comp minute sync compare counter
+ errs bit error counter
+ freq frequency offset
+ avgt averaging time
+</pre>
+
+The fields beginning with <tt>year</tt> and extending through
+<tt>dut</tt> are decoded from the received data and are in fixed-length
+format. The <tt>agc</tt> and <tt>lset</tt> fields, as well as the
+following driver-dependent fields, are in variable-length format.
+
+<dl>
+
+<dt><tt>s</tt>
+<dd>The sync indicator is initially <tt>?</tt> before the clock is set,
+but turns to space when all nine digits of the timecode are correctly
+set.</dd>
+
+<dt><tt>q</tt>
+<dd>The quality character is a four-bit hexadecimal code showing which
+alarms have been raised. Each bit is associated with a specific alarm
+condition according to the following:
+<dl>
+
+<dt><tt>0x8</tt>
+<dd>Sync alarm. The decoder may not be in correct second or minute phase
+relative to the transmitter.</dd>
+
+<dt><tt>0x4</tt>
+<dd>Error alarm. More than 30 data bit errors occurred in the last
+minute.</dd>
+
+<dt><tt>0x2</tt>
+<dd>Symbol alarm. The probability of correct decoding for a digit or
+miscellaneous bit has fallen below the threshold.</dd>
+
+<dt><tt>0x1</tt>
+<dd>Decoding alarm. A maximum likelihood digit fails to agree with the
+current associated clock digit.</dd>
+
+</dl>
+
+It is important to note that one or more of the above alarms does not
+necessarily indicate a clock error, but only that the decoder has
+detected a condition that may in future result in an error.
+
+<dt><tt>yyyy ddd hh:mm:ss.fff</tt></tt>
+<dd>The timecode format itself is self explanatory. Since the driver
+latches the on-time epoch directly from the second sync pulse, the
+fraction <tt>fff</tt>is always zero. Although the transmitted timecode
+includes only the year of century, the Gregorian year is augmented 2000
+if the indicated year is less than 72 and 1900 otherwise.</dd>
+
+<dt><tt>l</tt>
+<dd>The leap second warning is normally space, but changes to <tt>L</tt>
+if a leap second is to occur at the end of the month of June or
+December.</dd>
+
+<dt><tt>d</tt>
+<dd>The DST state is <tt>S</tt> or <tt>D</tt> when standard time or
+daylight time is in effect, respectively. The state is <tt>I</tt> or
+<tt>O</tt> when daylight time is about to go into effect or out of
+effect, respectively.</dd>
+<dt><tt>dut</tt>
+<dd>The DUT sign and magnitude shows the current UT1 offset relative to
+the displayed UTC time, in deciseconds.</dd>
+
+<dt><tt>lset</tt>
+<dd>Before the clock is set, the interval since last set is the number
+of minutes since the driver was started; after the clock is set, this
+is number of minutes since the time was last verified relative to the
+broadcast signal.</dd>
+
+<dt><tt>agc</tt>
+<dd>The audio gain shows the current codec gain setting in the range 0
+to 255. Ordinarily, the receiver audio gain control or IRIG level
+control should be set for a value midway in this range.
+
+<dt><tt>ident</tt>
+<dd>The station identifier shows the station, <tt>C</tt> for WWV or
+<tt>H</tt> for WWVH, and frequency being tracked. If neither station is
+heard on any frequency, the station identifier shows <tt>X</tt>.</dd>
+
+<dt><tt>comp</tt>
+<dd>The minute sync compare counter is useful to determine the quality
+of the minute sync signal and can range from 0 (no signal) to 5
+(best).</dd>
+
+<dt><tt>errs</tt>
+<dd>The bit error counter is useful to determine the quality of the data
+signal received in the most recent minute. It is normal to drop a couple
+of data bits under good signal conditions and increasing numbers as
+conditions worsen. While the decoder performs moderately well even with
+half the bits are in error in any minute, usually by that point the sync
+signals are lost and the decoder reverts to free-run anyway.</dd>
+
+<dt><tt>freq</tt>
+<dd>The frequency offset is the current estimate of the codec frequency
+offset to within 0.1 PPM. This may wander a bit over the day due to
+local temperature fluctuations and propagation conditions.</dd>
+
+<dt><tt>avgt</tt>
+<dd>The averaging time is the interval between frequency updates in
+powers of two to a maximum of 1024 s. Attainment of the maximum
+indicates the driver is operating at the best possible resolution in
+time and frequency.</dd>
+
+</dl>
+
+<p>An example timecode is:
+
+<p><tt> 0 2000 006 22:36:00.000 S +3 1 115 C20 6 5 66.4 1024</tt>
+
+<p>Here the clock has been set and no alarms are raised. The year, day
+and time are displayed along with no leap warning, standard time and DUT
++0.3 s. The clock was set on the last minute, the AGC is safely in the
+middle ot the range 0-255, and the receiver is tracking WWV on 20 MHz.
+Excellent reeiving conditions prevail, as indicated by the compare count
+6 and 5 bit errors during the last minute. The current frequency is 66.4
+PPM and the averaging interval is 1024 s, indicating the maximum
+precision available.
+
+<h4>Modes</h4>
+
+<p>The <tt>mode</tt> keyword of the <tt>server</tt> configuration
+command specifies the ICOM ID select code. A missing or zero argument
+disables the CI-V interface. Following are the ID select codes for the
+known radios.
+<p><table cols=6 width=100%>
+
+<tr>
+<td>Radio</td>
+<td>Hex</td>
+<td>Decimal</td>
+<td>Radio</td>
+<td>Hex</td>
+<td>Decimal</td>
+</tr>
+
+<tr>
+<td>IC725</td>
+<td>0x28</td>
+<td>40</td>
+<td>IC781</td>
+<td>0x26</td>
+<td>38</td>
+</tr>
+
+<tr>
+<td>IC726</td>
+<td>0x30</td>
+<td>48</td>
+<td>R7000</td>
+<td>0x08</td>
+<td>8</td>
+</tr>
+
+<tr>
+<td>IC735</td>
+<td>0x04</td>
+<td>4</td>
+<td>R71</td>
+<td>0x1A</td>
+<td>26</td>
+</tr>
+<tr>
+<td>IC751</td>
+<td>0x1c</td>
+<td>28</td>
+<td>R7100</td>
+<td>0x34</td>
+<td>52</td>
+</tr>
+<tr>
+<td>IC761</td>
+<td>0x1e</td>
+<td>30</td>
+<td>R72</td>
+<td>0x32</td>
+<td>50</td>
+</tr>
+
+<tr>
+<td>IC765</td>
+<td>0x2c</td>
+<td>44</td>
+<td>R8500</td>
+<td>0x4a</td>
+<td>74</td>
+</tr>
+
+<tr>
+<td>IC775</td>
+<td>0x46</td>
+<td>68</td>
+<td>R9000</td>
+<td>0x2a</td>
+<td>42</td>
+</tr>
+
+</table>
+
+<h4>Fudge Factors</h4>
+
+<dl>
+
+<dt><tt>time1 <I>time</I></tt></dt>
+<dd>Specifies the propagation delay for WWV (40:40:49.0N 105:02:27.0W),
+in seconds and fraction, with default 0.0.dd>
+
+<dt><tt>time2 <I>time</I></tt></dt>
+<dd>Specifies the propagation delay for WWVH (21:59:26.0N 159:46:00.0W),
+in seconds and fraction, with default 0.0.
+</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>Ordinarily, this field specifies the driver reference identifier;
+however, the driver sets the reference identifier automatically as
+described above.
+<dt><tt>flag1 0 | 1</tt></dt>
+<dd>Not used by this driver.</dd>
+
+<dt><tt>flag2 0 | 1</tt></dt>
+<dd>Specifies the microphone port if set to zero or the line-in port if
+set to one. It does not seem useful to specify the compact disc player
+port.</dd>
+<dt><tt>flag3 0 | 1</tt></dt>
+<dd>Enables audio monitoring of the input signal. For this purpose, the
+speaker volume must be set before the driver is started.</dd>
+
+<dt><tt>flag4 0 | 1</tt></dt>
+<dd>Enable verbose <tt>clockstats</tt> recording if set.</dd>
+</dl>
+<h4>Additional Information</h4>
+
+<A HREF="refclock.htm">Reference Clock Drivers</A>
+<br><A HREF="audio.htm">Reference Clock Audio Drivers</A>
+<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
+href=mailto:mills@udel.edu> David L. Mills &lt;mills@udel.edu&gt;</a>
+</address></a></body></html>
diff --git a/contrib/ntp/html/driver37.htm b/contrib/ntp/html/driver37.htm
new file mode 100644
index 000000000000..6f6c8b36973b
--- /dev/null
+++ b/contrib/ntp/html/driver37.htm
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>Forum Graphic GPS Dating station</title>
+</head>
+<body>
+
+<h3>Forum Graphic GPS Dating station</h3>
+<hr>
+
+<h4>Synopsis</h4>
+
+<p>Address: 127.127.37.<i>u</i><br>
+Reference ID: <tt>GPS</tt><br>
+Driver ID: <tt>GPS</tt><br>
+Parallel Port: <tt>/dev/fgclock<i>u</i></tt>
+</p>
+
+<h4>Description</h4>
+
+<p>This driver supports the Forum Graphic GPS Dating station sold by <a
+href="http://www.emr.fr/gpsclock.htm">EMR company</a>.
+
+<p>Unfortunately sometime FG GPS start continues reporting of the same
+date. The only way to fix this problem is GPS power cycling and ntpd
+restart after GPS power-up.
+</P>
+After Jan,10 2000 my FG GPS unit start send a wrong answer after 10:00am
+till 11:00am. It repeat hour value in result string twice. I wroite a small
+code to avoid such problem. Unfortunately I have no second FG GPS unit
+to evaluate this problem. Please let me know if your GPS has no problems
+after Y2K.
+<p>
+
+<h4>Monitor Data</h4>
+
+<p>Each timecode is written to the <tt>clockstats</tt> file in the format
+<tt>YYYY YD HH MI SS</tt>.</p>
+
+<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>FG</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>Dmitry Smirnov (das@amt.ru)</address>
+
+</body>
+</html>
diff --git a/contrib/ntp/html/driver6.htm b/contrib/ntp/html/driver6.htm
index a728a542adf2..9fac9789c7de 100644
--- a/contrib/ntp/html/driver6.htm
+++ b/contrib/ntp/html/driver6.htm
@@ -1,253 +1,242 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
- <TITLE>IRIG Audio Decoder II for Sun SPARCstation
-</TITLE>
-</HEAD>
-<BODY>
-
-<H3>
-IRIG Audio Decoder</H3>
-
-<HR>
-<H4>
-Synopsis</H4>
+<html><head><title>
+IRIG Audio Decoder
+</title></head><body><h3>
+IRIG Audio Decoder
+</h3><hr>
+
+<H4>Synopsis</H4>
+
Address: 127.127.6.<I>u</I>
<BR>Reference ID: <TT>IRIG</TT>
<BR>Driver ID: <TT>IRIG_AUDIO</TT>
<BR>Audio Device: <TT>/dev/audio</TT> and <TT>/dev/audioctl</TT>
<P>Note: This driver supersedes an older one of the same name, address
-and ID which required replacing the original kernel audio driver with another
-which works only on older Sun SPARCstation systems. The new driver described
-here uses the stock kernel audio driver and works in SunOS 4.1.3 and Solaris
-2.6 versions and probably all versions in between. The new driver requires
-no modification of the operating system. While it is generic and likely
-portable to other systems, it is somewhat slower than the original, since
-the extensive signal conditioning, filtering and decoding is done in user
-space, not kernel space.
-<H4>
-Description</H4>
-This driver supports the Inter-Range Instrumentation Group (IRIG) standard
-time distribution signal using the audio codec native to the Sun SPARCstation.
-This signal is generated by several radio clocks, including those made
-by Arbiter, Austron, Bancomm, Odetics, Spectracom and TrueTime, among others,
-although it is often an add-on option. The signal is connected via an optional
-attenuator box and cable to either the microphone or line-in ports on a
-Sun SPARCstation <TT>/dev/audio</TT> audio codec device. The driver receives,
-demodulates and decodes the IRIG-B and IRIG-E signal formats using internal
-filters designed to reduce the effects of noise and interfering signals.
-
-<P>The IRIG signal format uses an amplitude-modulated carrier with pulse-width
-modulated data bits. For IRIG-B, the carrier frequency is 1000 Hz and bit
-rate 100 b/s; for IRIG-E, the carrier frequenchy is 100 Hz and bit rate
-10 b/s. While IRIG-B provides the best accuracy, generally within a few
-tens of microseconds relative to IRIG time, it can also generate a significant
-load on the processor with older workstations. Generally, the accuracy
-with IRIG-E is about ten times worse than IRIG-B, but the processor load
-is ten times less.
+and ID which required replacing the original kernel audio driver with
+another which works only on older Sun SPARCstation systems. The new
+driver described here uses the stock kernel audio driver and works in
+SunOS 4.1.3 and Solaris 2.6 versions and probably all versions in
+between. The new driver requires no modification of the operating
+system. While it is generic and likely portable to other systems, it is
+somewhat slower than the original, since the extensive signal
+conditioning, filtering and decoding is done in user space, not kernel
+space.
+
+<H4>Description</H4>
+
+This driver supports the Inter-Range Instrumentation Group (IRIG)
+standard time distribution signal using the audio codec native to some
+workstations. This signal is generated by several radio clocks,
+including those made by Arbiter, Austron, Bancomm, Odetics, Spectracom
+and TrueTime, among others, although it is often an add-on option. The
+signal is connected via an optional attenuator box and cable to either
+the microphone or line-in port. The driver receives, demodulates and
+decodes the IRIG-B and IRIG-E signal formats using internal filters
+designed to reduce the effects of noise and interference.
+
+<p>This driver incorporates several features in common with other audio
+drivers such as described in the <a href=driver7.htm>Radio CHU Audio
+Demodulator/Decoder</a> and the <a href=driver36.htm>Radio WWV/H Audio
+Demodulator/Decoder</a> pages. They include automatic gain control
+(AGC), selectable audio codec port and signal monitoring capabilities.
+For a discussion of these common features, as well as a guide to hookup,
+debugging and monitoring, see the <a href=audio.htm>Reference Clock
+Audio Drivers</a> page.
+
+<P>The IRIG signal format uses an amplitude-modulated carrier with
+pulse-width modulated data bits. For IRIG-B, the carrier frequency is
+1000 Hz and bit rate 100 b/s; for IRIG-E, the carrier frequenchy is 100
+Hz and bit rate 10 b/s. While IRIG-B provides the best accuracy,
+generally within a few tens of microseconds relative to IRIG time, it
+can also generate a significant load on the processor with older
+workstations. Generally, the accuracy with IRIG-E is about ten times
+worse than IRIG-B, but the processor load is ten times less.
<P>The program processes 8000-Hz mu-law companded samples using separate
signal filters for IRIG-B and IRIG-E, a comb filter, envelope detector
-and automatic threshold corrector. Cycle crossings relative to the corrected
-slice level determine the width of each pulse and its value - zero, one
-or position identifier. The data encode 20 BCD digits which determine the
-second, minute, hour and day of the year and sometimes the year and synchronization
-condition. The comb filter exponentially averages the corresponding samples
-of successive baud intervals in order to reliably identify the reference
-carrier cycle. A type-II phase-lock loop (PLL) performs additional integration
-and interpolation to accurately determine the zero crossing of that cycle,
-which determines the reference timestamp. A pulse-width discriminator demodulates
-the data pulses, which are then encoded as the BCD digits of the timecode.
+and automatic threshold corrector. Cycle crossings relative to the
+corrected slice level determine the width of each pulse and its value -
+zero, one or position identifier. The data encode 20 BCD digits which
+determine the second, minute, hour and day of the year and sometimes the
+year and synchronization condition. The comb filter exponentially
+averages the corresponding samples of successive baud intervals in order
+to reliably identify the reference carrier cycle. A type-II phase-lock
+loop (PLL) performs additional integration and interpolation to
+accurately determine the zero crossing of that cycle, which determines
+the reference timestamp. A pulse-width discriminator demodulates the
+data pulses, which are then encoded as the BCD digits of the timecode.
The timecode and reference timestamp are updated once each second with
-IRIG-B (ten seconds with IRIG-E) and local clock offset samples saved for
-later processing. At poll intervals of 64 s, the saved samples are processed
-by a trimmed-mean filter and used to update the system clock.
+IRIG-B (ten seconds with IRIG-E) and local clock offset samples saved
+for later processing. At poll intervals of 64 s, the saved samples are
+processed by a trimmed-mean filter and used to update the system clock.
<P>Infinite impulse response (IIR) filters are used with both IRIG-B and
-IRIG-E formats. An 800-Hz highpass filter is used for IRIG-B and a 130-Hz
-lowpass filter for IRIG-E. These are intended for use with noisy signals,
-such as might be received over a telephone line or radio circuit, or when
-interfering signals may be present in the audio passband. The driver determines
-which IRIG format is in use by sampling the amplitude of each filter output
-and selecting the one with maximum signal. An automatic gain control feature
-provides protection against overdriven or underdriven input signal amplitudes.
-It is designed to maintain adequate demodulator signal amplitude while
-avoiding occasional noise spikes. In order to assure reliable capture,
-the decompanded input signal amplitude must be greater than 100 units and
-the codec sample frequency error less than 250 PPM (.025 percent).
-
-<P>The program performs a number of error checks to protect against overdriven
-or underdriven input signal levels, incorrect signal format or improper
-hardware configuration. Specifically, if any of the following errors occur
-for a timecode, the data are rejected. Secifically, if any of the following
-errors occur for a time measurement, the data are rejected.
+IRIG-E formats. An 800-Hz highpass filter is used for IRIG-B and a
+130-Hz lowpass filter for IRIG-E. These are intended for use with noisy
+signals, such as might be received over a telephone line or radio
+circuit, or when interfering signals may be present in the audio
+passband. The driver determines which IRIG format is in use by sampling
+the amplitude of each filter output and selecting the one with maximum
+signal. An automatic gain control feature provides protection against
+overdriven or underdriven input signal amplitudes. It is designed to
+maintain adequate demodulator signal amplitude while avoiding occasional
+noise spikes. In order to assure reliable capture, the decompanded input
+signal amplitude must be greater than 100 units and the codec sample
+frequency error less than 250 PPM (.025 percent).
+
+<P>The program performs a number of error checks to protect against
+overdriven or underdriven input signal levels, incorrect signal format
+or improper hardware configuration. Specifically, if any of the
+following errors occur for a timecode, the data are rejected.
+Secifically, if any of the following errors occur for a time
+measurement, the data are rejected.
+
<OL>
-<LI>
-The peak carrier amplitude is less than 100 units. This usually means dead
-IRIG signal source, broken cable or wrong input port.</LI>
-
-<BR>&nbsp;
-<LI>
-The frequency error is greater than +-250 PPM (.025 percent). This usually
-means broken codec hardware or wrong codec configuration.</LI>
-
-<BR>&nbsp;
-<LI>
-The modulation index is less than 0.5. This usually means overdriven IRIG
-signal or wrong IRIG format.</LI>
-
-<BR>&nbsp;
-<LI>
-A frame synchronization error has occured. This usually means wrong IRIG
-signal format or the IRIG signal source has lost synchronization (signature
-control).</LI>
-
-<BR>&nbsp;
-<LI>
-A data decoding error has occured. This usually means wrong IRIG signal
-format.</LI>
-
-<BR>&nbsp;
-<LI>
-The current second of the day is not exactly one greater than the previous
-one. This usually means a very noisy IRIG signal or insufficient CPU resources.</LI>
-
-<BR>&nbsp;
-<LI>
-An audio codec error (overrun) occured. This usually means insufficient
-CPU resources, as sometimes happens with Sun SPARC IPCs when doing something
-useful.</LI>
-</OL>
-Note that additional checks are done elsewhere in the reference clock interface
-routines.
-
-<P>Unlike other drivers, which can have multiple instantiations, this one
-supports only one. It does not seem likely that more than one audio codec
-would be useful in a single machine. More than one would probably chew
-up too much CPU time anyway.
-<H4>
-IRIG-B Timecode Format</H4>
-The 100 elements of the IRIG timecode are numbered from 0 through 99. Position
-identifiers occur at elements 0, 9, 19 and every ten thereafter to 99.
-The control function (CF) elements begin at element 50 (CF 1) and extend
-to element 78 (CF 27). The straight-binary-seconds (SBS) field, which encodes
-the seconds of the UTC day, begins at element 80 (CF 28) and extends to
-element 97 (CF 44). The encoding of elements 50 (CF 1) through 78 (CF 27)
-is device dependent. This driver presently decodes the CF elements, but
-does nothing with them.
-
-<P>Where feasible, the IRIG signal source should be operated with signature
-control so that, if the signal is lost or mutilated, the source produces
-an unmodulated signal, rather than possibly random digits. The driver will
-automatically reject the data and declare itself unsynchronized in this
-case. Some devices, in particular Spectracom radio/satellite clocks, provide
-additional year and status indication in the format:
-<PRE>&nbsp;&nbsp;&nbsp;&nbsp; Element&nbsp;&nbsp; CF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Function
-&nbsp;&nbsp;&nbsp;&nbsp; -------------------------------------
-&nbsp;&nbsp;&nbsp;&nbsp; 55&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time sync status
-&nbsp;&nbsp;&nbsp;&nbsp; 60-63&nbsp;&nbsp;&nbsp;&nbsp; 10-13&nbsp;&nbsp;&nbsp;&nbsp; BCD year units
-&nbsp;&nbsp;&nbsp;&nbsp; 65-68&nbsp;&nbsp;&nbsp;&nbsp; 15-18&nbsp;&nbsp;&nbsp;&nbsp; BCD year tens</PRE>
-Other devices set these elements to zero.
-<H4>
-Performance</H4>
-The mu-law companded data format allows considerable latitude in signal
-levels; however, an automatic gain control (AGC) function is implemented
-to further compensate for varying input signal levels and to avoid signal
-distortion. For proper operation, the IRIG signal source should be configured
-for analog signal levels, NOT digital TTL levels.
-
-<P>The accuracy of the system clock synchronized to the IRIG-B source with
-this driver and the <TT>ntpd</TT> daemon is 10-20 microseconds with a Sun
-UltraSPARC II and maybe twice that with a Sun SPARC IPC. The processor
-resources consumed by the daemon can be significant, ranging from about
-1.2 percent on the faster UltraSPARC II to 38 percent on the slower SPARC
-IPC. However, the overall timing accuracy is limited by the resolution
-and stability of the CPU clock oscillator and the interval between clock
-corrections, which is 64 s with this driver. This performance, while probably
-the best that can be achieved by the daemon itself, can be improved with
-assist from the PPS discipline as described elsewhere in the documentation.
-<H4>
-Monitor Data</H4>
-The timecode format used for debugging and data recording includes data
-helpful in diagnosing problems with the IRIG signal and codec connections.
-With debugging enabled (-d -d -d on the ntpd command line), the driver
-produces one line for each timecode in the following format:
-<PRE>00 1 98 23 19:26:52 721 143 0.694 47 20 0.083 66.5 3094572411.00027</PRE>
-The first field containes the error flags in hex, where the hex bits are
-interpreted as below. This is followed by the IRIG status indicator, year
-of century, day of year and time of day. The status indicator and year
-are not produced by some IRIG devices. Following these fields are the signal
-amplitude (0-8100), codec gain (0-255), field phase (0-79), time constant
-(2-20), modulation index (0-1), carrier phase error (0+-0.5) and carrier
-frequency error (PPM). The last field is the on-time timestamp in NTP format.
-The fraction part is a good indicator of how well the driver is doing.
-With an UltrSPARC 30, this is normally within a few tens of microseconds
-relative to the IRIG-B signal and within a few hundred microseconds with
-IRIG-E.
-<H4>
-Fudge Factors</H4>
-<DL>
-<DT>
-<TT>time1 <I>time</I></TT></DT>
+<LI>The peak carrier amplitude is less than 100 units. This usually
+means dead IRIG signal source, broken cable or wrong input port.</LI>
+
+<LI>The frequency error is greater than &plusmn;250 PPM (.025 percent).
+This usually means broken codec hardware or wrong codec
+configuration.</LI>
+
+<LI>The modulation index is less than 0.5. This usually means overdriven
+IRIG signal or wrong IRIG format.</LI>
-<DD>
-Specifies the time offset calibration factor, in seconds and fraction,
-with default 0.0.</DD>
+<LI>A frame synchronization error has occured. This usually means wrong
+IRIG signal format or the IRIG signal source has lost synchronization
+(signature control).</LI>
-<DT>
-<TT>time2 <I>time</I></TT></DT>
+<LI>A data decoding error has occured. This usually means wrong IRIG
+signal format.</LI>
-<DD>
-Not used by this driver.</DD>
+<LI>The current second of the day is not exactly one greater than the
+previous one. This usually means a very noisy IRIG signal or
+insufficient CPU resources.</LI>
-<DT>
-<TT>stratum <I>number</I></TT></DT>
+<LI>An audio codec error (overrun) occured. This usually means
+insufficient CPU resources, as sometimes happens with Sun SPARC IPCs
+when doing something useful.</LI>
-<DD>
-Specifies the driver stratum, in decimal from 0 to 15, with default 0.</DD>
+</OL>
-<DT>
-<TT>refid <I>string</I></TT></DT>
+Note that additional checks are done elsewhere in the reference clock
+interface routines.
+
+<P>Unlike other drivers, which can have multiple instantiations, this
+one supports only one. It does not seem likely that more than one audio
+codec would be useful in a single machine. More than one would probably
+chew up too much CPU time anyway.
+
+<H4>IRIG-B Timecode Format</H4>
+The 100 elements of the IRIG timecode are numbered from 0 through 99.
+Position identifiers occur at elements 0, 9, 19 and every ten thereafter
+to 99. The control function (CF) elements begin at element 50 (CF 1) and
+extend to element 78 (CF 27). The straight-binary-seconds (SBS) field,
+which encodes the seconds of the UTC day, begins at element 80 (CF 28)
+and extends to element 97 (CF 44). The encoding of elements 50 (CF 1)
+through 78 (CF 27) is device dependent. This driver presently decodes
+the CF elements, but does nothing with them.
+
+<P>Where feasible, the IRIG signal source should be operated with
+signature control so that, if the signal is lost or mutilated, the
+source produces an unmodulated signal, rather than possibly random
+digits. The driver will automatically reject the data and declare itself
+unsynchronized in this case. Some devices, in particular Spectracom
+radio/satellite clocks, provide additional year and status indication in
+the format:
+
+<PRE> Element CF Function
+ -------------------------------------
+ 55 6 time sync status
+ 60-63 10-13 BCD year units
+ 65-68 15-18 BCD year tens
+</PRE>
-<DD>
-Specifies the driver reference identifier, an ASCII string from one to
-four characters, with default <TT>IRIG</TT>.</DD>
+Other devices set these elements to zero.
-<DT>
-<TT>flag1 0 | 1</TT></DT>
+<H4>Performance</H4>
-<DD>
-Not used by this driver.</DD>
+The mu-law companded data format allows considerable latitude in signal
+levels; however, an automatic gain control (AGC) function is implemented
+to further compensate for varying input signal levels and to avoid
+signal distortion. For proper operation, the IRIG signal source should
+be configured for analog signal levels, NOT digital TTL levels.
+
+<P>The accuracy of the system clock synchronized to the IRIG-B source
+with this driver and the <TT>ntpd</TT> daemon is 10-20 <font
+face=symbol>m</font>s with a Sun UltraSPARC II and maybe twice that with
+a Sun SPARC IPC. The processor resources consumed by the daemon can be
+significant, ranging from about 1.2 percent on the faster UltraSPARC II
+to 38 percent on the slower SPARC IPC. However, the overall timing
+accuracy is limited by the resolution and stability of the CPU clock
+oscillator and the interval between clock corrections, which is 64 s
+with this driver. This performance, while probably the best that can be
+achieved by the daemon itself, can be improved with assist from the PPS
+discipline as described elsewhere in the documentation.
+
+<H4>Monitor Data</H4>
-<DT>
-<TT>flag2 0 | 1</TT></DT>
+The timecode format used for debugging and data recording includes data
+helpful in diagnosing problems with the IRIG signal and codec
+connections. With debugging enabled (-d on the ntpd command line), the
+driver produces one line for each timecode in the following format:
+
+<p><tt>00 1 98 23 19:26:52 721 143 0.694 47 20 0.083 66.5
+3094572411.00027</tt>
+
+<p>The first field containes the error flags in hex, where the hex bits
+are interpreted as below. This is followed by the IRIG status indicator,
+year of century, day of year and time of day. The status indicator and
+year are not produced by some IRIG devices. Following these fields are
+the signal amplitude (0-8100), codec gain (0-255), field phase (0-79),
+time constant (2-20), modulation index (0-1), carrier phase error
+(0&plusmn;0.5) and carrier frequency error (PPM). The last field is the
+on-time timestamp in NTP format. The fraction part is a good indicator
+of how well the driver is doing. With an UltrSPARC 30, this is normally
+within a few tens of microseconds relative to the IRIG-B signal and
+within a few hundred microseconds with IRIG-E.
+
+<H4>Fudge Factors</H4>
-<DD>
-Specifies the microphone port if set to zero or the line-in port if set
-to one. It does not seem useful to specify the compact disc player port.</DD>
+<DL>
-<DT>
-<TT>flag3 0 | 1</TT></DT>
+<DT><TT>time1 <I>time</I></TT></DT>
+<DD>Specifies the time offset calibration factor, in seconds and
+fraction, with default 0.0.</DD>
-<DD>
-Enables audio monitoring of the input signal. For this purpose, the speaker
-volume must be set before the driver is started.</DD>
+<DT><TT>time2 <I>time</I></TT></DT>
+<DD>Not used by this driver.</DD>
-<DT>
-<TT>flag4 0 | 1</TT></DT>
+<DT><TT>stratum <I>number</I></TT></DT>
+<DD>Specifies the driver stratum, in decimal from 0 to 15, with default
+0.</DD>
-<DD>
-Enable verbose <TT>clockstats</TT> recording if set.</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>IRIG</TT>.</DD>
+
+<DT><TT>flag1 0 | 1</TT></DT>
+<DD>Not used by this driver.</DD>
+
+<DT><TT>flag2 0 | 1</TT></DT>
+<DD>Specifies the microphone port if set to zero or the line-in port if
+set to one. It does not seem useful to specify the compact disc player
+port.</DD>
+
+<DT><TT>flag3 0 | 1</TT></DT>
+<DD>Enables audio monitoring of the input signal. For this purpose, the
+speaker volume must be set before the driver is started.</DD>
+
+<DT><TT>flag4 0 | 1</TT></DT>
+<DD>Enable verbose <TT>clockstats</TT> recording if set.</DD>
</DL>
-Additional Information
-<P><A HREF="refclock.htm">Reference Clock Drivers</A>&nbsp;
-<HR>
-<ADDRESS>
-David L. Mills (mills@udel.edu)</ADDRESS>
+<H4>Additional Information</H4>
+
+<A HREF="refclock.htm">Reference Clock Drivers</A>
+<br><A HREF="audio.htm">Reference Clock Audio Drivers</A>
-</BODY>
-</HTML>
+<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
+href=mailto:mills@udel.edu> David L. Mills &lt;mills@udel.edu&gt;</a>
+</address></a></body></html>
diff --git a/contrib/ntp/html/driver7.htm b/contrib/ntp/html/driver7.htm
index 0394fbfb3291..59950723814b 100644
--- a/contrib/ntp/html/driver7.htm
+++ b/contrib/ntp/html/driver7.htm
@@ -1,227 +1,591 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
- <TITLE>Canadian CHU Radio Modem/Audio Decoder
-</TITLE>
-</HEAD>
-<BODY>
-
-<H3>
-CHU Audio/Modem Decoder</H3>
-
-<HR>
-<H4>
-Synopsis</H4>
+<html><head><title>
+Radio CHU Audio Demodulator/Decoder
+</title></head><body><h3>
+Radio CHU Audio Demodulator/Decoder
+</h3><hr>
+
+<h4>Synopsis</h4>
+
Address: 127.127.7.<I>u</I>
-<BR>Reference ID: <TT>CHU</TT>
-<BR>Driver ID: <TT>CHU</TT>
-<BR>Serial Port: <TT>/dev/chu<I>u</I></TT>; 300 baud, 8-bits, no parity
-<BR>Audio Device: <TT>/dev/audio</TT> and <TT>/dev/audioctl</TT>
-<H4>
-Description</H4>
-This driver synchronizes the computer time using data encoded in radio
-transmissions from Canadian time/frequency station CHU in Ottawa, Ontario.
-Transmissions are made continuously on 3330 kHz, 7335 kHz and 14670 kHz
-in upper sideband, compatible AM mode. An ordinary shortwave receiver can
-be tuned manually to one of these frequencies or, in the case of ICOM receivers,
-the receiver can be tuned automatically using the <TT>minimuf</TT> and
-<TT>icom</TT> programs as propagation conditions change throughout the
-day and night.
-
-<P>This driver replaces an earlier one built by Dennis Ferguson in 1988.
-The earlier driver required a special line discipline which preprocessed
-the signal in order to improve accuracy and avoid errors. The new driver
-includes more powerful algorithms implemented directly in the driver and
-requires no line discipline. It decodes the data using a maximum-likelihood
-technique which exploits the considerable degree of redundancy available
-to maximize accuracy and minimize errors.
+<br>Reference ID: <tt>CHU</tt>
+<br>Driver ID: <tt>CHU</tt>
+<br>Modem Port: <tt>/dev/chu<I>u</I></tt>; 300 baud, 8-bits, no parity
+<br>Autotune Port: <tt>/dev/icom</tt>; 9600 baud, 8-bits, no parity
+<br>Audio Device: <tt>/dev/audio</tt> and <tt>/dev/audioctl</tt>
-<P>While there are currently no known commercial CHU receivers, a simple
+<h4>Description</h4>
+
+This driver synchronizes the computer time using data encoded in radio
+transmissions from Canadian time/frequency station CHU in Ottawa,
+Ontario. Transmissions are made continuously on 3330 kHz, 7335 kHz and
+14670 kHz in upper sideband, compatible AM mode. An ordinary shortwave
+receiver can be tuned manually to one of these frequencies or, in the
+case of ICOM receivers, the receiver can be tuned automatically as
+propagation conditions change throughout the day and night. The
+performance of this driver when tracking the station is ordinarily
+better than 1 ms in time with frequency drift less than 0.5 PPM when not
+tracking the station.
+
+<p>While there are currently no known commercial CHU receivers, a simple
but effective receiver/demodulator can be constructed from an ordinary
-shortwave receiver and Bell 103 compatible, 300-bps modem or modem chip,
-as described in the <A HREF="file:///J|/ntp4/html/pps.htm">Pulse-per-second
-(PPS) Signal Interfacing</A> page. The driver can be compiled to use this
-modem to receive the radio signal and demodulate the data. Alternatively,
-the driver can be compiled to use the audio codec of the Sun workstation
-or another with compatible audio drivers. In the latter case, the driver
+shortwave receiver and Bell 103 compatible, 300-b/s modem or modem chip,
+as described in the <a href=pps.htm>Pulse-per-second (PPS) Signal
+Interfacing</a> page. The driver can be compiled to use a modem to
+receive the radio signal and demodulate the data. Alternatively, the
+driver can be compiled to use the audio codec of the Sun workstation or
+another with compatible audio interface. In the latter case, the driver
implements the modem using DSP routines, so the radio can be connected
directly to either the microphone on line input port.
-<P>The CHU time broadcast includes an audio signal compatible with the
+<p>The driver replaces an earlier one built by Dennis Ferguson in 1988.
+The earlier driver required a special line discipline which preprocessed
+the signal in order to improve accuracy and avoid errors. The new driver
+includes more powerful algorithms implemented directly in the driver and
+requires no line discipline. It decodes the data using a
+maximum-likelihood technique which exploits the considerable degree of
+redundancy available to maximize accuracy and minimize errors.
+
+<p>This driver incorporates several features in common with other audio
+drivers such as described in the <a href=driver36.htm>Radio WWV/H Audio
+Demodulator/Decoder</a> and the <a href=driver6.htm>IRIG Audio
+Decoder</a> pages. They include automatic gain control (AGC), selectable
+audio codec port and signal monitoring capabilities. For a discussion of
+these common features, as well as a guide to hookup, debugging and
+monitoring, see the <a href=audio.htm>Reference Clock Audio Drivers</a>
+page.
+
+<p>Ordinarily, the driver poll interval is set to 14 (about 4.5 h),
+although this can be changed with configuration commands. As long as the
+clock is set or verified at least once during this interval, the NTP
+algorithms will consider the source reachable and selectable to
+discipline the system clock. However, if this does not happen for eight
+poll intervals, the algorithms will consider the source unreachable and
+some other source will be chosen (if available) to discipline the system
+clock.
+
+<p>The decoding algorithms take advantage of all the redundancy
+available in each broadcast message or burst. In each burst described in
+the next section, every character is sent twice and, in the case of
+format A bursts, the burst is sent eight times every minute. In the case
+of format B bursts, which are sent once each minute, the burst is
+considered correct only if every character matches its repetition in the
+burst. In the case of format A messages, a majority decoder requires at
+least six repetitions for each digit in the timecode and more than
+half of the repetitions decode to the same digit. Every character in
+every burst provides an independent timestamp upon arrival with a
+potential total of over 60 timestamps for each minute.
+
+<p>A timecode in the format described below is assembled when all bursts
+have been received in the minute. The timecode is considered valid and
+the clock set when at least one valid format B burst has been decoded
+and the above requirements are met. The <tt>yyyy</tt> year field in the
+timecode indicates whether a valid format B burst has been received.
+Upon startup, this field is initialized at zero; when a valid format B
+burst is received, it will be set to the correct Gregorian year. The
+<tt>q</tt> quality character field in the timecode indicates whether a
+valid timecode has been determined. If any of the high order three bits
+of this character are set, the timecode is invalid.
+
+<p>Once the clock has been set for the first time, it will appear
+reachable and selectable to discipline the system clock, even if the
+broadcast signal is lost. Since the signals are almost always available
+during some period of the day and the NTP clock discipline algorithms
+are designed to work well even in this case, it is unlikely that the
+system clock could drift more than a few tens of milliseconds during
+periods of signal loss. To protect against this most unlikely situation,
+if after four days with no signals, the clock is considered unset and
+resumes the synchronization procedure from the beginning.
+
+<p>The last three fields in the timecode are useful in assessing the
+quality of the radio channel during the most recent minute bursts were
+received. The <tt>bcnt</tt> field shows the number of format A bursts in
+the range 1-8. The <tt>dist</tt> field shows the majority decoder
+distance, or the minimum number of sample repetitions for each digit of
+the timecode in the range 0-16. The <tt>tsmp</tt> field shows the number
+of timestamps determined in the range 0-60. For a valid timecode,
+<tt>bcnt</tt> must be at least 3, <tt>dist</tt> must be greater than
+<tt>bcnt</tt> and <tt>tsmp</tt> must be at least 20.
+
+<h4>Program Operation</h4>
+
+<p>The program consists of four major parts: the DSP modem, maximum
+likelihood UART, burst assembler and majority decoder. The DSP modem
+demodulates Bell 103 modem answer-frequency signals; that is, frequency-
+shift keyed (FSK) tones of 2225 Hz (mark) and 2025 Hz (space). This is
+done using a 4th-order IIR filter and limiter/discriminator with 500-Hz
+bandpass centered on 2125 Hz and followed by a FIR raised-cosine lowpass
+filter optimized for the 300-b/s data rate. Alternately, the driver can
+be compiled to delete the modem and input 300 b/s data directly from an
+external modem via a serial port.
+
+<p>The maximum likelihood UART is implemented using a set of eight
+11-stage shift registers, one for each of eight phases of the 300-b/s
+bit clock. At each phase a new baseband signal value from the DSP modem
+is shifted into the corresponding register and the maximum and minimum
+over all 11 samples computed. This establishes a slice level midway
+between the maximum and minimum over all stages. For each stage, a
+signal level above this level is a mark (1) and below is a space (0). A
+quality metric is calculated for each register with respect to the slice
+level and the a-priori signal consisting of a mark bit (previous stop
+bit), space (start) bit, eight arbitrary information bits and the first
+of the two mark (stop) bits.
+<p>The shift registers are processed in round-robin order as each modem
+value arrives until one of them shows a valid framing pattern consisting
+of a mark bit, space bit, eight arbitrary data bits and a mark bit. When
+found, the data bits from the register with the best metric is chosen as
+the maximum likelihood character and the UART begins to process the next
+character.
+
+<p>The burst assembler processes characters either from the maximum
+likelihood UART or directly from the serial port as configured. A burst
+begins when a character is received and is processed after a timeout
+interval when no characters are received. If the interval between
+characters is greater than two characters, but less than the timeout
+interval, the burst is rejected as a runt and a new burst begun. As each
+character is received, a timestamp is captured and saved for later
+processing.
+
+<p>A valid burst consists of ten characters in two replicated
+five-character blocks. A format B block contains the year and other
+information in ten hexadecimal digits. A format A block contains the
+timecode in ten decimal digits, the first of which is a framing code
+(6). The burst assembler must deal with cases where the first character
+of a format A burst is lost or is noise. This is done using the framing
+code to correct the phase, either one character early or one character
+late.
+
+<p>The burst distance is incremented by one for each bit in the first
+block that matches the corresponding bit in the second block and
+decremented by one otherwise. In a format B burst the second block is
+bit-inverted relative to the first, so a perfect burst of five 8-bit
+characters has distance -40. In a format A block the two blocks are
+identical, so a perfect burst has distance +40. Format B bursts must be
+perfect to be acceptable; however, format A bursts, which are further
+processed by the majority decoder, are acceptable if the distance is at
+least 28.
+
+<p>Each minute of transmission includes eight format A bursts containing
+two timecodes for each second from 31 through 39. The majority decoder
+uses a decoding matrix of ten rows, one for each digit position in the
+timecode, and 16 columns, one for each 4-bit code combination that might
+be decoded at that position. In order to use the character timestamps,
+it is necessary to reliably determine the second number of each burst.
+In a valid burst, the last digit of the two timecodes in the block must
+match and the value must be in the range 2-9 and greater than in the
+previous burst.
+
+<p>As each hex digit of a valid burst is processed, the value at the row
+corresponding to the digit position in the timecode and column
+corresponding to the code found at that position is incremented. At the
+end of each minute of transmission, each row of the decoding matrix
+encodes the number of occurrences of each code found at the
+corresponding position of the timecode. However, the first digit
+(framing code) is always 6, the ninth (second tens) is always 3 and the
+last (second units) changes for each burst, so are not used.
+
+<p>The maximum over all occurrences at each timecode digit position is
+the distance for that position and the corresponding code is the maximum
+likelihood candidate. If the distance is zero, the decoder assumes a
+miss; if the distance is not more than half the total number of
+occurrences, the decoder assumes a soft error; if two different codes
+with the same distance are found, the decoder assumes a hard error. In
+all these cases the decoder encodes a non-decimal character which will
+later cause a format error when the timecode is reformatted. The
+decoding distance is defined as the minimum distance over the first nine
+digits; the tenth digit varies over the seconds and is uncounted.
+
+<p>The result of the majority decoder is a nine-digit timecode
+representing the maximum likelihood candidate for the transmitted
+timecode in that minute. Note that the second and fraction within the
+minute are always zero and that the actual reference point to calculate
+timestamp offsets is backdated to the first second of the minute. At
+this point the timecode block is reformatted and the year, days, hours
+and minutes extracted along with other information from the format B
+burst, including DST state, DUT1 correction and leap warning. The
+reformatting operation checks the timecode for invalid code combinations
+that might have been left by the majority decoder and rejects the entire
+timecode if found.
+
+<p>If the timecode is valid, it is passed to the reference clock
+interface along with the backdated timestamp offsets accumulated over
+the minute. A perfect set of nine bursts could generate as many as 90
+timestamps, but the maximum the interface can handle is 60. These are
+processed by the interface using a median filter and trimmed-mean
+average, so the resulting system clock correction is usually much better
+than would otherwise be the case with radio noise, UART jitter and
+occasional burst errors.
+
+<h4>Autotune</h4>
+
+<p>The driver includes provisions to automatically tune the radio in
+response to changing radio propagation conditions throughout the day and
+night. The radio interface is compatible with the ICOM CI-V standard,
+which is a bidirectional serial bus operating at TTL levels. The bus can
+be connected to a standard serial port using a level converter such as
+the CT-17. The serial port speed is presently compiled in the program,
+but can be changed in the <tt>icom.h</tt> header file.
+
+<p>Each ICOM radio is assigned a unique 8-bit ID select code, usually
+expressed in hex format. To activate the CI-V interface, the
+<tt>mode</tt> keyword of the <tt>server</tt> configuration command
+specifies a nonzero select code in decimal format. A table of ID select
+codes for the known ICOM radios is given below. A missing <tt>mode</tt>
+keyword or a zero argument leaves the interface disabled. The driver
+will attempt to open the device <tt>/dev/icom</tt> and, if successful
+will tune the radio to 3.330 MHz. If after five minutes at this
+frequency not more than two format A bursts have been received for any
+minute, the driver will tune to 7.335 MHz, then to 14.670 MHz, then
+return to 3.330 MHz and continue in this cycle.
+
+<p>The driver is liberal in what it assumes of the configuration. If the
+<tt>/dev/icom</tt> link is not present or the open fails or the CI-V bus
+or radio is inoperative, the driver quietly gives up with no harm done.
+
+<h4>Radio Broadcast Format</h4>
+
+<p>The CHU time broadcast includes an audio signal compatible with the
Bell 103 modem standard (mark = 2225 Hz, space = 2025 Hz). It consist of
-nine, ten-character bursts transmitted at 300 bps and beginning each second
-from second 31 to second 39 of the minute. Each character consists of eight
-data bits plus one start bit and two stop bits to encode two hex digits.
-The burst data consist of five characters (ten hex digits) followed by
-a repeat of these characters. In format A, the characters are repeated
-in the same polarity; in format B, the characters are repeated in the opposite
-polarity.
-
-<P>Format A bursts are sent at seconds 32 through 39 of the minute in hex
-digits
-
-<P><TT>&nbsp;&nbsp;&nbsp; 6dddhhmmss6dddhhmmss</TT>
-
-<P>The first ten digits encode a frame marker (<TT>6</TT>) followed by
-the day (<TT>ddd</TT>), hour (<TT>hh </TT>in UTC), minute (<TT>mm</TT>)
-and the second (<TT>ss</TT>). Since format A bursts are sent during the
-third decade of seconds the tens digit of <TT>ss </TT>is always 3. The
-driver uses this to determine correct burst synchronization. These digits
-are then repeated with the same polarity.
-
-<P>Format B bursts are sent at second 31 of the minute in hex digits
-
-<P><TT>&nbsp;&nbsp;&nbsp; xdyyyyttaaxdyyyyttaa</TT>
-
-<P>The first ten digits encode a code (<TT>x </TT>described below) followed
-by the DUT1 (<TT>d </TT>in deciseconds), Gregorian year (<TT>yyyy</TT>),
-difference TAI - UTC (<TT>tt</TT>) and daylight time indicator (<TT>aa</TT>)
-peculiar to Canada. These digits are then repeated with inverted polarity.
-
-<P>The <TT>x </TT>is coded
-
-<P>1&nbsp;&nbsp;&nbsp; Sign of DUT (0 = +)
-<BR>2&nbsp;&nbsp;&nbsp; Leap second warning. One second will be added.
-<BR>4&nbsp;&nbsp;&nbsp; Leap second warning. One second will be subtracted.
-This is not likely to happen in our universe.
-<BR>8&nbsp;&nbsp;&nbsp; Even parity bit for this nibble.
-
-<P>By design, the last stop bit of the last character in the burst coincides
-with 0.5 second. Since characters have 11 bits and are transmitted at 300
-bps, the last stop bit of the first character coincides with 0.5 - 10 *
-11/300 = 0.133 second. Depending on the UART, character interrupts can
-vary somewhere between the beginning of bit 9 and end of bit 11. These
-eccentricities can be corrected along with the radio propagation delay
-using <TT>fudge time1</TT>.
-<H4>
-Debugging aids</H4>
-The timecode format used for debugging and data recording includes data
-helpful in diagnosing problems with the radio signal and serial connections.
-With debugging enabled (<TT>-d -d -d</TT> on the <TT>ntpd </TT>command
-line), the driver produces one line for each burst in two formats corresponding
-to format A and B. Following is format A:
-
-<P><TT>&nbsp;&nbsp;&nbsp; n b f s m code</TT>
-
-<P>where <TT>n </TT>is the number of characters in the burst (0-11), <TT>b
-</TT>the burst distance (0-40), <TT>f </TT>the field alignment (-1, 0,
-1), <TT>s </TT>the synchronization distance (0-16), <TT>m </TT>the burst
-number (2-9) and <TT>code </TT>the burst characters as received. Note that
-the hex digits in each character are reversed, so the burst
-
-<P><TT>&nbsp;&nbsp;&nbsp; 10 38 0 16 9 06851292930685129293</TT>
-
-<P>is interpreted as containing 11 characters with burst distance 38, field
-alignment 0, synchronization distance 16 and burst number 9. The nibble-swapped
-timecode shows day 58, hour 21, minute 29 and second 39.
-
-<P>When the audio driver is compiled, format A is preceded by the gain
-(0-255) and relative signal level (0-9999). The receiver volume control
-should be set so that the gain is near the middle of the range 0-255, which
-results in a signal level near 1000.
-
-<P>Following is format B:
-
-<P><TT>&nbsp;&nbsp;&nbsp; n b s code</TT>
-
-<P>where <TT>n </TT>is the number of characters in the burst (0-11), <TT>b
-</TT>the burst distance (0-40), <TT>s </TT>the synchronization distance
-(0-40) and <TT>code </TT>the burst characters as received. Note that the
-hex digits in each character are reversed and the last ten digits inverted,
-so the burst
-
-<P>&nbsp;&nbsp;&nbsp; <TT>11 40 1091891300ef6e76ecff</TT>
-
-<P>is interpreted as containing 11 characters with burst distance 40. The
-nibble-swapped timecode shows DUT1 +0.1 second, year 1998 and TAI - UTC
-31 seconds.
-
-<P>In addition to the above, the reference timecode is updated and written
-to the clockstats file and debug score after the last burst received in
-the minute. The format is
-
-<P>&nbsp;&nbsp;&nbsp;<TT> qq yyyy ddd hh:mm:ss nn dd tt</TT>
-
-<P>where <TT>qq </TT>are the error flags, as described below, <TT>yyyy
-</TT>is the year, <TT>ddd </TT>the day, <TT>hh:mm:ss </TT>the time of day,
-<TT>nn </TT>the number of format A bursts received during the previous
-minute, <TT>dd </TT>the decoding distance and <TT>tt </TT>the number of
-timestamps. The error flags are cleared after every update.
-
-<P>For accuracy better than the low milliseconds, the <TT>fudge time1</TT>
-variable can be used to set the propagation delay and compensate for inherent
-latencies in the serial port hardware and operating system. This can be
-done conveniently using the <TT>minimuf</TT> program.
-<H4>
-Monitor Data</H4>
-When enabled by the <TT>flag4</TT> fudge flag, every received timecode
-burst in both format A or format B is written to the <TT>clockstats</TT>
-file.
-<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>CHU</TT>.</DD>
-
-<DT>
-<TT>flag1 0 | 1</TT></DT>
-
-<DD>
-Not used by this driver.</DD>
-
-<DT>
-<TT>flag2 0 | 1</TT></DT>
-
-<DD>
-When the audio driver is compiled, this flag selects the audio input
+nine, ten-character bursts transmitted at 300 b/s and beginning each
+second from second 31 to second 39 of the minute. Each character
+consists of eight data bits plus one start bit and two stop bits to
+encode two hex digits. The burst data consist of five characters (ten
+hex digits) followed by a repeat of these characters. In format A, the
+characters are repeated in the same polarity; in format B, the
+characters are repeated in the opposite polarity.
+
+<p>Format A bursts are sent at seconds 32 through 39 of the minute in
+hex digits
+
+<p><tt>6dddhhmmss6dddhhmmss</tt>
+<p>The first ten digits encode a frame marker (<tt>6</tt>) followed by
+the day (<tt>ddd</tt>), hour (<tt>hh</tt>), minute (<tt>mm</tt>) and
+second (<tt>ss</tt>). Since format A bursts are sent during the
+third decade of seconds the tens digit of <tt>ss</tt> is always 3. The
+driver uses this to determine correct burst synchronization. These
+digits are then repeated with the same polarity.
+<p>Format B bursts are sent at second 31 of the minute in hex digits
+
+<p><tt>xdyyyyttaaxdyyyyttaa</tt>
+
+<p>The first ten digits encode a code (<tt>x</tt> described below)
+followed by the DUT1 (<tt>d</tt> in deciseconds), Gregorian year
+(<tt>yyyy</tt>), difference TAI - UTC (<tt>tt</tt>) and daylight time
+indicator (<tt>aa</tt>) peculiar to Canada. These digits are then
+repeated with inverted polarity.
+
+<p>The <tt>x</tt> is coded
+
+<dl>
+
+<dt><tt>1</tt>
+<dd>Sign of DUT (0 = +)/dd>
+
+<dt><tt>2</tt>
+<dd>Leap second warning. One second will be added.</dd>
+
+<dt><tt>4</tt>
+<dd>Leap second warning. One second will be subtracted. This is not
+likely to happen in our universe.</dd>
+
+<dt><tt>8</tt>
+<dd>Even parity bit for this nibble.</dd>
+
+</dl>
+
+<p>By design, the last stop bit of the last character in the burst
+coincides with 0.5 second. Since characters have 11 bits and are
+transmitted at 300 b/s, the last stop bit of the first character
+coincides with 0.5 - 10 * 11/300 = 0.133 second. Depending on the UART,
+character interrupts can vary somewhere between the beginning of bit 9
+and end of bit 11. These eccentricities can be corrected along with the
+radio propagation delay using the <tt>fudge time1</tt> variable.
+
+<h4>Debugging Aids</h4>
+
+<p>The most convenient way to track the program status is using the
+<tt>ntpq</tt> program and the <tt>clockvar</tt> command. This displays
+the last determined timecode and related status and error counters, even
+when the program is not discipline the system clock. If the debugging
+trace feature (<tt>-d</tt> on the <tt>ntpd</tt> command line)is enabled,
+the program produces detailed status messages as it operates. If the
+<tt>fudge flag 4</tt> is set, these messages are written to the
+<tt>clockstats</tt> file. All messages produced by this driver have the
+prefix <tt>chu</tt> for convenient filtering with the Unix <tt>grep</tt>
+command.
+
+<p>With debugging enabled the driver produces messages in the following
+formats:
+
+<p>A format <tt>chuA</tt> message is produced for each format A burst
+received in seconds 32 through 39 of the minute:
+
+<p><tt>chuA n b s code</tt>
+
+<p>where <tt>n</tt> is the number of characters in the burst (0-11),
+<tt>b</tt> the burst distance (0-40), <tt>s</tt> the synchronization
+distance (0-40) and <tt>code</tt> the burst characters as received. Note
+that the hex digits in each character are reversed and the last ten
+digits inverted, so the burst
+<p><tt>11 40 1091891300ef6e76ecff</tt>
+<p>is interpreted as containing 11 characters with burst distance 40.
+The nibble-swapped timecode shows DUT1 +0.1 second, year 1998 and TAI -
+UTC 31 seconds.
+
+<p>A format <tt>chuB</tt> message is produced for each format B burst
+received in second 31 of the minute:
+
+<p><tt>chuB n b f s m code</tt>
+
+<p>where <tt>n</tt> is the number of characters in the burst (0-11),
+<tt>b</tt> the burst distance (0-40), <tt>f</tt> the field alignment (-
+1, 0, 1), <tt>s</tt>the synchronization distance (0-16), <tt>m</tt>the
+burst number (2-9) and <tt>code</tt> the burst characters as received.
+Note that the hex digits in each character are reversed, so the burst
+
+<p><tt>10 38 0 16 9 06851292930685129293</tt>
+
+<p>is interpreted as containing 11 characters with burst distance 38,
+field alignment 0, synchronization distance 16 and burst number 9. The
+nibble-swapped timecode shows day 58, hour 21, minute 29 and second 39.
+
+<p>If the CI-V interface for ICOM radios is active, a debug level
+greater than 1 will produce a trace of the CI-V command and response
+messages. Interpretation of these messages requires knowledge of the
+CI-V protocol, which is beyond the scope of this document.
+
+<h4>Monitor Data</h4>
+
+When enabled by the <tt>filegen</tt> facility, every received timecode
+is written to the <tt>clockstats</tt> file in the following format:
+
+<pre>
+ sq yy ddd hh:mm:ss.fff ld dut lset agc rfrq bcnt dist tsmp
+
+ s sync indicator
+ q quality character
+ yyyy Gregorian year
+ ddd day of year
+ hh hour of day
+ mm minute of hour
+ ss second of minute
+ fff millisecond of second
+ l leap second warning
+ d DST state
+ dut DUT sign and magnitude in deciseconds
+ lset minutes since last set
+ agc audio gain (0-255)
+ rfrq radio frequency
+ bcnt burst count
+ dist decoding distance
+ tsmp timestamps captured
+</pre>
+
+The fields beginning with <tt>year</tt> and extending through
+<tt>dut</tt> are decoded from the received data and are in fixed-length
+format. The <tt>agc</tt> and <tt>lset</tt> fields, as well as the
+following driver-dependent fields, are in variable-length format.
+
+<dl>
+
+<dt><tt>s</tt>
+<dd>The sync indicator is initially <tt>?</tt> before the clock is set,
+but turns to space when the clock is correctly set.</dd>
+
+<dt><tt>q</tt>
+<dd>The quality character is a four-bit hexadecimal code showing which
+alarms have been raised during the most recent minute. Each bit is
+associated with a specific alarm condition according to the following:
+
+<dl>
+<dt><tt>8</tt>
+<dd>Decoder alarm. A majority of repetitions for at least one digit of
+the timecode fails to agree.
+</dd>
+
+<dt><tt>4</tt>
+<dd>Timestamp alarm. Fewer than 20 timestamps have been determined.</dd>
+
+<dt><tt>2</tt>
+<dd>Format alarm. The majority timecode contains invalid bit
+combinations.</dd>
+
+<dt><tt>1</tt>
+<dd>Frame alarm. A framing or format error occurred on at least one
+burst during the minute.</dd>
+
+</dl>
+
+It is important to note that one or more of the above alarms does not
+necessarily indicate a clock error, but only that the decoder has
+detected a condition that may in future result in an error.
+
+<dt><tt>yyyy ddd hh:mm:ss.fff</tt></tt>
+<dd>The timecode format itself is self explanatory. Note that the
+Gregorian year is decoded directly from the transmitted timecode.</dd>
+<dt><tt>l</tt>
+<dd>The leap second warning is normally space, but changes to <tt>L</tt>
+if a leap second is to occur at the end of the month of June or
+December.</dd>
+
+<dt><tt>d</tt>
+<dd>The DST code for Canada encodes the state for all provinces.</dd>
+
+<dt><tt>dut</tt>
+<dd>The DUT sign and magnitude shows the current UT1 offset relative to
+the displayed UTC time, in deciseconds.</dd>
+
+<dt><tt>lset</tt>
+<dd>Before the clock is set, the interval since last set is the number
+of minutes since the program was started; after the clock is set, this
+is number of minutes since the time was last verified relative to the
+broadcast signal.</dd>
+
+<dt><tt>agc</tt>
+<dd>The audio gain shows the current codec gain setting in the range 0
+to 255. Ordinarily, the receiver audio gain control or IRIG level
+control should be set for a value midway in this range.
+
+<dt><tt>rfrq</tt>
+<dd>The current radio frequency, if the CI-V interface is active, or 'X'
+if not.</dd>
+
+<dt><tt>bcnt</tt>
+<dd>The number of format A bursts received during the most recent minute
+bursts were received.</dd>
+
+<dt><tt>dist</tt>
+<dd>The minimum decoding distance determined during the most recent
+minute bursts were received.</dd>
+
+<dt><tt>tsmp</tt>
+<dd>The number of timestamps determined during the most recent
+minute bursts were received.</dd>
+</dl>
+
+<h4>Modes</h4>
+
+<p>The <tt>mode</tt> keyword of the <tt>server</tt> configuration
+command specifies the ICOM ID select code. A missing or zero argument
+disables the CI-V interface. Following are the ID select codes for the
+known radios.
+
+<p><table cols=6 width=100%>
+
+<tr>
+<td>Radio</td>
+<td>Hex</td>
+<td>Decimal</td>
+<td>Radio</td>
+<td>Hex</td>
+<td>Decimal</td>
+</tr>
+
+<tr>
+<td>IC725</td>
+<td>0x28</td>
+<td>40</td>
+<td>IC781</td>
+<td>0x26</td>
+<td>38</td>
+</tr>
+
+<tr>
+<td>IC726</td>
+<td>0x30</td>
+<td>48</td>
+<td>R7000</td>
+<td>0x08</td>
+<td>8</td>
+</tr>
+
+<tr>
+<td>IC735</td>
+<td>0x04</td>
+<td>4</td>
+<td>R71</td>
+<td>0x1A</td>
+<td>26</td>
+</tr>
+
+<tr>
+<td>IC751</td>
+<td>0x1c</td>
+<td>28</td>
+<td>R7100</td>
+<td>0x34</td>
+<td>52</td>
+</tr>
+
+<tr>
+<td>IC761</td>
+<td>0x1e</td>
+<td>30</td>
+<td>R72</td>
+<td>0x32</td>
+<td>50</td>
+</tr>
+
+<tr>
+<td>IC765</td>
+<td>0x2c</td>
+<td>44</td>
+<td>R8500</td>
+<td>0x4a</td>
+<td>74</td>
+</tr>
+
+<tr>
+<td>IC775</td>
+<td>0x46</td>
+<td>68</td>
+<td>R9000</td>
+<td>0x2a</td>
+<td>42</td>
+</tr>
+
+</table>
+
+<h4>Fudge Factors</h4>
+
+<dl>
+
+<dt><tt>time1 <I>time</I></tt></dt>
+<dd>Specifies the propagation delay for CHU (45:18N 75:45N), 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>CHU</tt>.</dd>
+
+<dt><tt>flag1 0 | 1</tt></dt>
+<dd>Not used by this driver.</dd>
+
+<dt><tt>flag2 0 | 1</tt></dt>
+<dd>When the audio driver is compiled, this flag selects the audio input
port, where 0 is the mike port (default) and 1 is the line-in port. It
-does not seem useful to select the compact disc player port.</DD>
-
-<DT>
-<TT>flag3 0 | 1</TT></DT>
+does not seem useful to select the compact disc player port.</dd>
-<DD>
-When the audio driver is compiled, this flag enables audio monitoring of
-the input signal. For this purpose, the speaker volume must be set
-before the driver is started.</DD>
+<dt><tt>flag3 0 | 1</tt></dt>
+<dd>When the audio driver is compiled, this flag enables audio
+monitoring of the input signal. For this purpose, the speaker volume
+must be set before the driver is started.</dd>
-<DT>
-<TT>flag4 0 | 1</TT></DT>
+<dt><tt>flag4 0 | 1</tt></dt>
+<dd>Enable verbose <tt>clockstats</tt> recording if set.</dd>
-<DD>
-Enable verbose <TT>clockstats</TT> recording if set.</DD>
-</DL>
-Additional Information
+</dl>
-<P><A HREF="file:///J|/ntp4/html/refclock.htm">Reference Clock Drivers</A>&nbsp;
-<HR>
-<ADDRESS>
-David L. Mills (mills@udel.edu)</ADDRESS>
+<h4>Additional Information</h4>
+<A HREF="refclock.htm">Reference Clock Drivers</A>
+<br><A HREF="audio.htm">Reference Clock Audio Drivers</A>
-</BODY>
-</HTML>
+<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
+href=mailto:mills@udel.edu> David L. Mills &lt;mills@udel.edu&gt;</a>
+</address></a></body></html>
diff --git a/contrib/ntp/html/driver8.htm b/contrib/ntp/html/driver8.htm
index 890b6c5e9706..17ab6c357e0d 100644
--- a/contrib/ntp/html/driver8.htm
+++ b/contrib/ntp/html/driver8.htm
@@ -82,7 +82,7 @@ available. refclock_ppstime lists then the PPS timestamp and
refclock_ppsskew lists the difference between RS232
derived timestamp and the PPS timestamp.
-<P>Currently, fourteen clock types (devices /dev/refclock-0 -
+<P>Currently, eighteen clock types (devices /dev/refclock-0 -
/dev/refclock-3) are supported by the PARSE driver.
<BR>A note on the implementations:
<UL><li>These implementations where mainly done <B><I>WITHOUT</I></B>
@@ -120,16 +120,16 @@ the vendors web pages. They are linked to the respective vendors.
<B><TT>server 127.127.8.0-3 mode 0</TT></B>
<p><B><TT><A HREF="http://www.meinberg.de">Meinberg </A>PZF535/<A
-HREF="http://www.meinberg.de/english/pzf509.htm">PZF509 receiver</A> (FM
+HREF="http://www.meinberg.de/english/products/pzf509.htm">PZF509 receiver</A> (FM
demodulation/TCXO / 50us)</TT></B>
<BR>
<LI>
<B><TT>server 127.127.8.0-3 mode 1</TT></B>
<p><B><TT><A HREF="http://www.meinberg.de">Meinberg </A> PZF535/<A
-HREF="http://www.meinberg.de/english/pzf509.htm">PZF509
+HREF="http://www.meinberg.de/english/products/pzf509.htm">PZF509
receiver</A> (FM demodulation/OCXO / 50us)</TT></B>
-<BR><A HREF="http://www.meinberg.de/english/pzf509.htm"><IMG
+<BR><A HREF="http://www.meinberg.de/english/products/pzf509.htm"><IMG
SRC="pic/pzf509.jpg" ALT="BILD PZF509" HEIGHT=300 WIDTH=260
ALIGN=TEXTTOP></A>
<BR>
@@ -137,9 +137,9 @@ ALIGN=TEXTTOP></A>
<B><TT>server 127.127.8.0-3 mode 2</TT></B>
<p><B><TT><A HREF="http://www.meinberg.de">Meinberg </A> DCF U/A
-31/<A HREF="http://www.meinberg.de/english/c51.htm">DCF C51 receiver</A>
+31/<A HREF="http://www.meinberg.de/english/products/c51.htm">DCF C51 receiver</A>
(AM demodulation / 4ms)</TT></B>
-<BR><A HREF="http://www.meinberg.de/english/c51.htm"><IMG
+<BR><A HREF="http://www.meinberg.de/english/products/c51.htm"><IMG
SRC="pic/c51.jpg" ALT="BILD C51" HEIGHT=180 WIDTH=330 ALIGN=TEXTTOP></A>
<BR>
<LI>
@@ -171,9 +171,9 @@ demodulation
<B><TT>server 127.127.8.0-3 mode 7</TT></B>
<p><B><TT><A HREF="http://www.meinberg.de">Meinberg </A> <A
-HREF="http://www.meinberg.de/english/gps167.htm">GPS166/GPS167
+HREF="http://www.meinberg.de/english/products/gps167.htm">GPS166/GPS167
receiver</A> (GPS / &lt;&lt;1us)</TT></B>
-<BR><A HREF="http://www.meinberg.de/english/gps167.htm"><IMG
+<BR><A HREF="http://www.meinberg.de/english/products/gps167.htm"><IMG
SRC="pic/gps167.jpg" ALT="BILD GPS167" HEIGHT=300 WIDTH=280
ALIGN=TEXTTOP></A>
<BR>
@@ -237,6 +237,16 @@ ALIGN=TEXTTOP></A>
<p><B><TT>WHARTON 400A Series Clocks with a 404.2 Serial
Interface</TT></B>
+<LI>
+<B><TT>server 127.127.8.0-3 mode 16</TT></B>
+
+<p><B><TT>RAWDCF receiver (DTR=low/RTS=high)
+</TT></B>
+<LI>
+<B><TT>server 127.127.8.0-3 mode 17</TT></B>
+
+<p><B><TT>VARITEXT Receiver (MSF)
+</TT></B>
</UL>
<p>
Actual data formats and set-up requirements of the various clocks can be
diff --git a/contrib/ntp/html/hints/solaris-dosynctodr.html b/contrib/ntp/html/hints/solaris-dosynctodr.html
new file mode 100644
index 000000000000..d6b97a9c1f0c
--- /dev/null
+++ b/contrib/ntp/html/hints/solaris-dosynctodr.html
@@ -0,0 +1,320 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+
+
+<!-- Sun Template V4.0 9/9/98 -->
+<HTML>
+<HEAD>
+<TITLE>Symptoms and Resolutions Article 19195</TITLE>
+<META NAME="GENERATOR" CONTENT="Sun Microsystems, Inc.">
+<META HTTP-EQUIV="content-type" CONTENT="text/html;charset=iso-8859-1">
+
+<!-- INSERT YOUR META TAGS HERE -->
+
+<META NAME="PUBLISHED_DATE" CONTENT="">
+<META NAME="KEYWORDS" CONTENT="">
+<META NAME="DESCRIPTION" CONTENT="">
+
+<!-- END META TAGS -->
+
+<LINK REL="Stylesheet" TYPE="text/css" HREF="/style.css" TITLE="Style">
+
+</HEAD>
+<!--stopindex-->
+<BODY BGCOLOR="#FFFFFF" LINK="#666699" ALINK="#FFFFFF">
+
+
+<TABLE WIDTH="623" BORDER="0" CELLSPACING="0" CELLPADDING="0">
+ <TR>
+ <TD COLSPAN="2" VALIGN="TOP" WIDTH="623">
+ <IMG BORDER="0" SRC="/images/homebuy.gif" WIDTH="149" HEIGHT="32" ALT="Home * Buy * My Sun(sm)" USEMAP="#lefttop"><IMG BORDER="0" SRC="/images/globalnavbar.gif" WIDTH="474" HEIGHT="32" ALT="sun.com Global Sections" USEMAP="#topnav"></TD>
+ </TR>
+ <TR>
+ <TD COLSPAN="2" VALIGN="TOP" WIDTH="623">
+
+ <!-- TITLEBAR IMAGE: INSERT CUSTOMIZED TITLEBAR IMAGE BELOW -->
+
+ <A HREF="http://www.sun.com/"><IMG BORDER="0" SRC="/images/sunlogo.gif" WIDTH="149" HEIGHT="72" ALT="Sun Microsystems"></A><IMG BORDER="0" SRC="/images/titlebar/doc.title.gif" WIDTH="474" HEIGHT="72"></TD>
+ </TR>
+ <!-- Begin Search Elements -->
+ <TR VALIGN="top">
+ <TD BGCOLOR="#666699">
+ <TABLE BORDER="0" WIDTH="157" CELLSPACING="0" CELLPADDING="0">
+ <TR>
+ <TD BGCOLOR="#666699" COLSPAN="2" WIDTH="157" VALIGN="TOP"><IMG BORDER="0" SRC="/images/search/contract/search1.gif" WIDTH="157" HEIGHT="16" ALT="Search SunSolve"></TD>
+ </TR>
+ <TR>
+ <TD VALIGN="top" ALIGN="center" WIDTH="141" BGCOLOR="#666699"><FORM ACTION="search.pl" METHOD="POST"><FONT SIZE="2"><INPUT TYPE="text" NAME="zone_32" SIZE="14"></FONT><input type=hidden name=mode value=results><BR>
+<INPUT TYPE="image" SRC="/images/search/contract/search5.gif" BORDER="0" NAME="Search"><IMG SRC="/images/cg_clear.gif" ALT="" WIDTH="2" HEIGHT="1" BORDER="0" HSPACE="29" VSPACE="0"><BR>
+
+<A HREF="search.pl?mode=advanced"><IMG BORDER="0" SRC="/images/search/contract/search3.gif" WIDTH="144" HEIGHT="16" ALT="Advanced Search"></A><BR>
+
+<A HREF="search.pl?mode=product"><IMG SRC="/images/search/contract/search4.gif" BORDER="0" ALT="Product Search" WIDTH="144" HEIGHT="19"></A><BR>
+
+<A HREF="show.pl?target=help/search_tips"><IMG SRC="/images/search/contract/search6.gif" BORDER="0" ALT="Search Tips" WIDTH="144" HEIGHT="27"></A></TD>
+ <TD ALIGN="right"><IMG SRC="/images/search/contract/search2.gif" ALT="" WIDTH="13" HEIGHT="117" BORDER="0"></TD>
+ </TR>
+ <!-- End Search Elements -->
+ <!-- Begin User Personalization (Must limit to 10 Characters)-->
+ <TR>
+ <TD COLSPAN="2"><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="157"><TR><TD COLSPAN="3" ALIGN="right"><IMG SRC="/images/home_con/welcom_1.gif" ALT="" WIDTH="156" HEIGHT="4" BORDER="0"></TD></TR>
+ <TR><TD BGCOLOR="#333366"><IMG SRC="/images/home_con/welcom_2.gif" ALT="" WIDTH="17" HEIGHT="19" BORDER="0"></TD><TD BGCOLOR="#333366" VALIGN="middle"><NOBR><FONT FACE="Geneva, Helvetica, Arial, SunSans-Regular" COLOR="#99CC33" SIZE="-2">sopko</FONT></NOBR></TD><TD BGCOLOR="#333366" ALIGN="right"><A HREF="edit-user-form.pl?viewmode=contractuser"><IMG SRC="/images/home_con/welcom_3.gif" ALT="Edit" WIDTH="45" HEIGHT="19" BORDER="0"></A></TD></TR>
+ </TABLE>
+ </TD>
+ </TR>
+ <!-- End User Personalization -->
+
+ <TR>
+ <TD COLSPAN="2" ALIGN="right" VALIGN="top" WIDTH="157" BGCOLOR="#666699"><IMG BORDER="0" SRC="/images/ssolvecontents.gif" WIDTH="157" HEIGHT="37" ALT="Contents Of SunSolve"><BR>
+
+
+
+
+
+ <!-- PILLS: CHANGE THE PILL FOR CURRENT SECTION TO THE HIGHLIGHTED PILL -->
+ <!-- Beginning of Nav area -->
+<A HREF="show.pl?target=patches/patch-access" onmouseover="window.status='All Public Patches'; return true" onmouseout="window.status=''; return true">
+<IMG BORDER="0" SRC="/images/nav/p1.gif" WIDTH="157" HEIGHT="19" ALT="All Public Patches"></A><BR>
+<A HREF="suncourier.pl" onmouseover="window.status='Submit a Service Order'; return true" onmouseout="window.status=''; return true">
+<IMG BORDER="0" SRC="/images/nav/p5.gif" WIDTH="157" HEIGHT="19" ALT="Submit a Service Order"></A><BR>
+<A HREF="show.pl?target=resources/tools" onmouseover="window.status='Diagnostic Tools'; return true" onmouseout="window.status=''; return true">
+<IMG BORDER="0" SRC="/images/nav/p4.gif" WIDTH="157" HEIGHT="19" ALT="Diagnostic Tools"></A><BR>
+<A HREF="show.pl?target=help/collections" onmouseover="window.status='Support Docs.'; return true" onmouseout="window.status=''; return true">
+<IMG BORDER="0" SRC="/images/nav/cp2.gif" WIDTH="157" HEIGHT="19" ALT="Support Docs."></A><BR>
+<A HREF="show.pl?target=resources/y2k" onmouseover="window.status='Y2K Central'; return true" onmouseout="window.status=''; return true">
+<IMG BORDER="0" SRC="/images/nav/p3.gif" WIDTH="157" HEIGHT="19" ALT="Y2K Central"></A><BR>
+<A HREF="show.pl?target=security/sec" onmouseover="window.status='Security Information'; return true" onmouseout="window.status=''; return true">
+<IMG BORDER="0" SRC="/images/nav/p2.gif" WIDTH="157" HEIGHT="19" ALT="Security Information"></A><BR>
+<br><table cellpadding="0" cellspacing="0" border="0" width="157">
+<tr><td width="8">&nbsp;</td><td width="149">
+<table cellpadding="0" cellspacing="0" border="0">
+<BR><tr><td><BR><img src="/images/line.gif" alt="------" width="140" height="11" border="0"><br>
+ <A HREF="mark.pl"
+ onmouseover="window.status='Marked Docs.';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Marked Docs.</FONT></A><BR>
+ <A HREF="notify.pl"
+ onmouseover="window.status='Notifications';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Notifications</FONT></A><BR>
+ <A HREF="/plain-cgi/show.pl?target=home_con"
+ onmouseover="window.status='Low Graphics';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Low Graphics</FONT></A><BR>
+ <A HREF="show.pl?target=link"
+ onmouseover="window.status='SunSolve Servers';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">SunSolve Servers</FONT></A><BR>
+ <A HREF="show.pl?target=about_sunsolve"
+ onmouseover="window.status='About SunSolve';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">About SunSolve</FONT></A><BR>
+ <A HREF="feedback.pl"
+ onmouseover="window.status='Contact Us';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Contact Us</FONT></A><BR>
+ <A HREF="show.pl?target=help/sitemap"
+ onmouseover="window.status='Site Map';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Site Map</FONT></A><BR>
+ <A HREF="show.pl?target=article/article"
+ onmouseover="window.status='Articles';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Articles</FONT></A><BR>
+ <A HREF="show.pl?target=home_con"
+ onmouseover="window.status='Home';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Home</FONT></A><BR>
+ <A HREF="show.pl?target=help/faq"
+ onmouseover="window.status='Help';return true"
+ onmouseout="window.status='';return true">
+ <font class="locallink" color="#dddddd">Help</FONT></A><BR>
+<br></td></tr></table></td></tr></table>
+<!-- End of Nav area -->
+
+ </FORM>
+ <br><br><!-- some spacers -->
+ </TD>
+ </TR>
+ </TABLE>
+ </TD>
+ <TD VALIGN="TOP" WIDTH="466">
+
+
+ <!--startindex-->
+ <!-- ============ -->
+ <!-- MAIN CONTENT -->
+ <!-- ============ -->
+
+
+
+<table width=100% cellpadding=16 cellspacing=0 border=0>
+ <tr>
+<td width=100% valign=top>
+<CENTER><FONT FACE="Geneva, Helvetica, Arial, SunSans-Regular" SIZE="2">
+[&nbsp;<a href="retrieve.pl?type=0&doc=srdb%2F19195&display=plain">Printer Friendly Page</a>&nbsp;]
+[&nbsp;<b>Was this document useful? <a href="retrieve.pl?type=0&doc=srdb/19195&vote=yes">Yes</a> or <a href="retrieve.pl?type=0&doc=srdb/19195&vote=no">No</a></b>&nbsp;]<br>[&nbsp;<a href="notify.pl?action=add&doc=srdb%2F19195&type=synopsis">Notify if Document Changes</a>&nbsp;]
+[&nbsp;<a href="mark.pl?action=add&doc=srdb%2F19195&type=0">Mark Document for Download</a>&nbsp;]<br>[&nbsp;<a href="notify.pl">View/Edit Notifications</a>&nbsp;]
+[&nbsp;<a href="mark.pl">View/Edit Marked Documents</a>&nbsp;]<br></FONT></CENTER><br>
+ <SCRIPT Language="JavaScript">
+ <!-- Hide javascript from older browsers
+ function jump()
+ {
+ var ctl = document.docform.jumplist;
+ location.href = ctl.options[ctl.selectedIndex].value;
+ }
+ // End hiding contents -->
+ </SCRIPT>
+<a name="top">
+<form name="docform"><div align=center><font size=2> Jump to <select name="jumplist" size=1 onchange="jump();"></font><option value="#Hardware">Hardware</option>
+<option value="#Product">Product</option>
+<option value="#Product-Area">Product Area</option>
+<option value="#Synopsis">Synopsis</option>
+<option value="#Problem-Description">Problem Description</option>
+<option value="#Document-Content">Document Content</option>
+<option value="#Problem-Solution">Problem Solution</option>
+<option value="#SRDB-ID">SRDB ID</option>
+<option value="#OS">OS</option>
+</select></div></form>
+<table width=100% cellpadding=2 cellspacing=0 border=0>
+<tr bgcolor=#666699><td><font size=2 color=#ffffff><b>SRDB ID</b></font></td>
+<td bgcolor=#ffffff><font size=2>&nbsp;</font></td>
+<td><font size=2 color=#ffffff><b>Synopsis</b></font></td>
+<td bgcolor=#ffffff><font size=2>&nbsp;</font></td>
+<td><font size=2 color=#ffffff><b>Date</b></font></td>
+</tr>
+<tr bgcolor=#CCCCE7><td><font size=2><b>19195</b></font></td>
+<td bgcolor=#ffffff><font size=2>&nbsp;</font></td>
+<td><font size=2><b>Upgraded to 2.6, using xntpd, but the system clock is drifting. Worked fine</b></font></td>
+<td bgcolor=#ffffff><font size=2>&nbsp;</font></td>
+<td><font size=2><b>4 Sep 1999</b></font></td>
+</tr>
+</table><br clear>
+<table width=100% cellpadding=2 cellspacing=0 border=0><tr bgcolor=#999999>
+<td><font size=2 color=#ffffff><b><a name=Problem-Description>Problem Description</a></b></font></td>
+<td align=right><b><a href="#top"><font size=2 color=#ffffff>Top</font></a></b></td></tr></table>
+<pre>Ever since upgrading to Solaris 2.6, the system clock has been drifting and
+there are messages like 'synchronisation lost', 'Previous time adjustment
+didn''t complete' and 'time reset (step)' a lot in the /var/adm/messages
+file. The system either was previously working fine with the freeware
+xntpd or the configuration was copied from another system that was
+using the freeware version.
+-- 23-Apr-99 08:22 US/Eastern --</pre><table width=100% cellpadding=2 cellspacing=0 border=0><tr bgcolor=#999999>
+<td><font size=2 color=#ffffff><b><a name=Problem-Solution>Problem Solution</a></b></font></td>
+<td align=right><b><a href="#top"><font size=2 color=#ffffff>Top</font></a></b></td></tr></table>
+<pre>The common lore for setting up xntpd on Solaris using
+the freeware version included the warning to set the
+kernel variable <font color=red>dosynctodr</font> to 0 in the /etc/system
+file thus: set <font color=red>dosynctodr</font>=0
+
+When using NTP on Solaris 2.6 or later, the kernel
+variable MUST be left at the default value of 1. Prior
+to 2.6 this variable controlled whether or not to rein
+in the softclock using the hardware clock, with the result
+that NTP and the hardware clock would fight for control of
+the soft clock; thus before 2.6 you had to set <font color=red>dosynctodr</font>
+to 0. At 2.6, every system call that adjusts the softclock
+also sets the hard clock, thus while NTP controls the soft
+clock, the hard clock is also controlled. Setting
+<font color=red>dosynctodr</font> to 0 reverts the behavior back to the pre 2.6
+defaulkt behavior, having exactly the opposite effect
+as that intended.
+
+Do not set <font color=red>dosynctodr</font> to 0.</pre><table width=100% cellpadding=2 cellspacing=0 border=0>
+<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=Product-Area>Product Area</a></b></font></td>
+<td bgcolor=#cccccc valign=top width=75%><font size=2>Bundled Network</font></td></tr>
+<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=Product>Product</a></b></font></td>
+<td bgcolor=#cccccc valign=top width=75%><font size=2>NTP</font></td></tr>
+<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=OS>OS</a></b></font></td>
+<td bgcolor=#cccccc valign=top width=75%><font size=2>Solaris 2.6</font></td></tr>
+<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=Hardware>Hardware</a></b></font></td>
+<td bgcolor=#cccccc valign=top width=75%><font size=2>Ultra 2</font></td></tr>
+<tr><td bgcolor=#999999 valign=top width=25%><font color=#ffffff size=2><b><a name=Document-Content>Document Content</a></b></font></td>
+<td bgcolor=#cccccc valign=top width=75%><font size=2>with freeware xntpd.</font></td></tr>
+</table><br clear>
+<font size=2><a href="#top">Top</a></font><br><br>
+</td></tr></table>
+
+ <!-- =================== -->
+ <!-- END OF MAIN CONTENT -->
+ <!-- =================== -->
+ <!--stopindex-->
+
+ <!-- DON'T CHANGE INFORMATION OTHER THAN titlebar BELOW THIS LINE -->
+
+ <!-- Altered Table Structure from Template to format properly with new design -->
+ </TD>
+ </TR>
+ <TR>
+ <TD>&nbsp;</TD>
+ <TD VALIGN="top">
+ <center>
+ <IMG SRC="/images/cg_grey_line.gif" ALT="" WIDTH="466" HEIGHT="2" BORDER="0"><BR>
+ <IMG SRC="/images/cg_clear.gif" ALT="" WIDTH="1" HEIGHT="2" BORDER="0" HSPACE="0" VSPACE="4">
+ </center>
+ <CENTER>
+ <FONT FACE="Geneva, Helvetica, Arial, SunSans-Regular" SIZE="2">
+ [ <A HREF="edit-user-form.pl?viewmode=contractuser">Edit Account</A> ]
+ [ <A HREF="show.pl?target=patches/patch-access">Patches</A> ]
+ [ <A HREF="suncourier.pl">Submit a Service Order</A> ]<br>
+ [ <A HREF="show.pl?target=resources/tools">Diagnostic Tools</A> ]
+ [ <A HREF="show.pl?target=help/collections">Support Docs.</A> ]
+ [ <A HREF="show.pl?target=resources/y2k">Y2K Central</A> ]
+ [ <A HREF="show.pl?target=security/sec">Security Information</A> ] <br>
+ [ <A HREF="show.pl?target=link">SunSolve Servers </A> ]
+ [ <A HREF="show.pl?target=about_sunsolve">About SunSolve</A> ]
+ [ <A HREF="feedback.pl">Contact Us</A> ]
+ [ <A HREF="show.pl?target=help/sitemap">Site Map</A> ]
+ [ <A HREF="show.pl?target=article/article">Articles</A> ]
+ [ <A HREF="show.pl?target=home_con">Home</A> ]
+ [ <A HREF="show.pl?target=help/faq">Help</A> ]
+ </FONT>
+ </CENTER>
+
+<!-- MAPS -->
+<MAP NAME="lefttop">
+<AREA SHAPE="rect" HREF="http://www.sun.com/MySun/" ALT="My Sun" COORDS="89,0 149,32">
+<AREA SHAPE="rect" HREF="show.pl?target=home_con" ALT="Home" COORDS="0,0 42,32">
+<AREA SHAPE="rect" HREF="http://www.sun.com/sales/" ALT="Buy" COORDS="54,0 78,32">
+</MAP>
+
+
+<MAP NAME="topnav">
+<AREA SHAPE="rect" HREF="http://www.sun.com/java/" ALT="Java Technologies" COORDS="4,0,67,32">
+<AREA SHAPE="rect" HREF="http://www.sun.com/products-n-solutions/" ALT="Products and Solutions" COORDS="74,0,141,32">
+<AREA SHAPE="rect" HREF="http://www.sun.com/service/" ALT="Support, Education, and Consulting" COORDS="148,0,249,32">
+<AREA SHAPE="rect" HREF="http://www.sun.com/tech/" ALT="Technology and Research" COORDS="261,0,324,32">
+<AREA SHAPE="rect" HREF="http://www.sun.com/developers/developers.html" ALT="For Developers" COORDS="334,0,396,32">
+<AREA SHAPE="rect" HREF="http://www.sun.com/corporateoverview/" ALT="Corporate Information" COORDS="406,0,482,32">
+</MAP>
+
+<!-- INSERT titlebar HREFS BELOW -->
+<MAP NAME="titlebar">
+<!-- LINK TO SEC HOME Removed because no longer needed on this template -->
+<AREA SHAPE="rect" HREF="/visual/home/" ALT="SunSolve Online(tm)" COORDS="0,21,215,51"> <!-- LINK TO CURRENT PILL HOME -->
+</MAP>
+
+
+<!-- begin copyright notice -->
+
+<BR>
+<CENTER>
+<FONT FACE="Geneva, Helvetica, Arial, SunSans-Regular" COLOR="#999999" SIZE="2">
+<br>
+Copyright 1994-1999 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA.
+<br>
+All rights reserved.
+<a href="http://www.sun.com/share/text/SMICopyright.html">Legal Terms</a>.
+<a href="http://www.sun.com/privacy/">Privacy Policy</a>.
+</font>
+</CENTER>
+
+<!-- end copyright notice -->
+
+ </TD>
+ </TR>
+</TABLE>
+
+</BODY>
+</HTML>
+
diff --git a/contrib/ntp/html/hints/solaris.html b/contrib/ntp/html/hints/solaris.html
index 8595fbfc3e17..64b361a14326 100644
--- a/contrib/ntp/html/hints/solaris.html
+++ b/contrib/ntp/html/hints/solaris.html
@@ -14,9 +14,13 @@ that you will have problems; upgrading would be a really good plan.
<P>
<H3>All Solaris versions</H3>
<P>
-Proper operation of ntp under Solaris requires setting the kernel
+ We have a report that says starting with Solaris 2.6 we should leave
+ <I>dosynctodr</I> alone.
+ <A HREF="solaris-dosynctodr.html">Here is the report</A>.
+<P>
+Proper operation of ntp under Solaris may require setting the kernel
variable <I>dosynctodr</I> to zero (meaning "do not synchronize the clock
-to the hardware time-of-day clock"). This can be done with the
+to the hardware time-of-day clock"). This can be done with the
tickadj utility:
<BLOCKQUOTE><TT>
tickadj -s
diff --git a/contrib/ntp/html/hints/solaris.xtra.S99ntpd b/contrib/ntp/html/hints/solaris.xtra.S99ntpd
index 33662ba73fd0..d8058fd43d42 100644
--- a/contrib/ntp/html/hints/solaris.xtra.S99ntpd
+++ b/contrib/ntp/html/hints/solaris.xtra.S99ntpd
@@ -2,6 +2,7 @@
if [ $1 = "start" ]; then
if [ -x /usr/local/bin/xntpd ]; then
echo "Starting NTP daemon, takes about 1 minute... "
+ # dosynctodr may need to be left alone as of with Solaris 2.6
# The following line is unnecessary if you turn off
# dosynctodr in /etc/system.
/usr/local/bin/tickadj -s
diff --git a/contrib/ntp/html/hints/winnt.htm b/contrib/ntp/html/hints/winnt.htm
new file mode 100644
index 000000000000..06c0e4179c09
--- /dev/null
+++ b/contrib/ntp/html/hints/winnt.htm
@@ -0,0 +1,315 @@
+<html>
+<head>
+ <title>NTP on Windows NT</title>
+</head>
+<body>
+
+<h1>
+NTP 4.x for Windows NT</h1>
+
+<h2>
+Introduction</h2>
+The NTP 4 distribution runs as service on (i386) Windows NT 4.0 and Windows
+2000. The binaries now work on all dual processor systems (mostly Dell)
+that have been tested. This port has not been tested on the Alpha platform.
+<p>Refer to System Requirements and Instructions for how to compile the
+program.
+<h2>
+Reference Clocks</h2>
+Refernce clock support under Windows NT is tricky because the IO functions
+are so much different. The following reference clocks are supported by
+Windows NT:
+<p><a href="../driver1.htm">Type 1</a> Undisciplined Local Clock (LOCAL)
+<br><a href="../driver29.htm">Type 29</a> Trimble Navigation Palisade GPS
+(GPS_PALISADE)
+<h2>
+Functions Supported</h2>
+All NTP functions are supported with some constraints. See the TODO list
+below.
+<h2>
+Accuracy</h2>
+Greg Brackley has implemented a fantastic interpolation scheme that improves
+the precision of the NTP clock using a realtime thread (is that poetic
+or what!) which captures a tick count from the 8253 counter after each
+OS tick. The count is used to interpolate the time between operating system
+ticks.
+<p>On a typical 200+ MHz system NTP achieves a precision of about 5 microseconds
+and synchronizes the clock to +/-500 microseconds using the <a href="http://www.trimble.com/products/ntp">Trimble
+Palisade</a> as UTC reference. This allows distributed applications to
+use the 10 milliseconds ticks available to them with high confidence.
+<h2>
+Binaries</h2>
+Recent InstallShield based executable versions of NTP for Windows NT (i386)
+are available from:
+<br><a href="http://www.trimble.com/oem/ntp">http://www.trimble.com/oem/ntp</a>
+and <a href="http://www.five-ten-sg.com/">http://www.five-ten-sg.com/</a>
+<h2>
+ToDo</h2>
+
+<ul>
+<li>
+MD5 authentication causes problems with DNS. If you use encryption/authentication,
+you have to use IP numbers in <tt>ntp.conf.</tt></li>
+
+<li>
+NMEA refclock support is in development.</li>
+
+<li>
+See if precision can be improved by using CPU cycle counter for tick interpolation.</li>
+
+<li>
+Make precision time available to applications using NTP_GETTIME API</li>
+</ul>
+
+<h2>
+Compiling Requirements</h2>
+
+<ul>
+<li>
+<tt>Windows NT 4.0 or 5.0 (2000)</tt></li>
+
+<li>
+<tt>Microsoft Visual C++ 6.0</tt></li>
+
+<li>
+<tt>Perl5 </tt><a href="http://www.perl.org">http://www.perl.org</a></li>
+
+<li>
+Some version of the archiving program <tt>ZIP</tt>.</li>
+</ul>
+
+<h2>
+Compiling Instructions</h2>
+
+<ol>
+<li>
+Install Perl and set the PERL environment variable to your Perl directory
+(e.g. C:\PERL)</li>
+
+<li>
+Unpack the NTP-4.x.tar.gz</li>
+
+<li>
+Open the .\ports\winnt\ntp.dsw Visual C workspace</li>
+
+<li>
+Batch build all projects</li>
+</ol>
+
+<h2>
+Configuration File</h2>
+The default NTP configuration file path is %SystemRoot%<tt>\system32\drivers\etc\.
+</tt>(%SystemRoot%
+is an environmental variable that can be determined by typing "set" at
+the "Command Prompt" or from the "System" icon in the "Control Panel").
+<br>Refer to your system environment and <tt>c</tt>reate your<tt> ntp.conf</tt>
+file in the directory corresponding to your system&nbsp; installation.
+<br><tt>The older &lt;WINDIR>\ntp.conf </tt>is still supported but you
+will get a log entry reporting that the first file wasn't found.
+<h2>
+Installation Instructions</h2>
+The <tt>instsrv</tt> program in the instsrv subdirectory of the distribution
+can be used to install 'ntpd' as a service and start automatically at boot
+time. Instsrv is automatically compiled with the rest of the distribution
+if you followed the steps above.
+<ol>
+<li>
+Start a command prompt and enter "instsrv.exe &lt;pathname_for_ntpd.exe>"</li>
+
+<li>
+Clicking on the "Services" icon in the "Control Panel" will display the
+list of currently installed services in a dialog box. The NetworkTimeProtocol
+service should show up in this list. Select it in the list and hit the
+"Start" button in the dialog box. The NTP service should start.</li>
+
+<li>
+View the event log by clicking on the "Event Viewer" icon in the "Administrative
+Tools" group, there should be several successful startup messages from
+NTP. NTP will keep running and restart automatically when the machine is
+rebooted.</li>
+</ol>
+You can change the start mode (automatic/manual) and other startup parameters
+correponding to the NTP service (eg. location of conf file) also in the
+"Services" dialog box if you wish.
+<h2>
+Removing NTP</h2>
+You can also use <tt>instsrv</tt> to delete the NTP service by entering:
+"instsrv.exe remove"
+<h2>
+Command Line Parameters and Registry Entries</h2>
+Unlike the Unix environment, there is no clean way to run 'ntpdate' and
+reset the clock before starting 'ntpd' at boot time.
+<br>NTP will step the clock up to 1000 seconds by default. While there
+is no reason that the system clock should be that much off during bootup
+if 'ntpd' was running before, you may wish to override this default and/or
+pass other command line directives.
+<p>Use the registry editor to edit the value for the ntpd executable under
+LocalMachine\System\CurrentControlSet\Services\NetworkTimeProtocol.
+<p>Add the -g option behind "%INSTALLDIR>\ntpd". This will force NTP to
+accept large time errors (including 1.1.1980 00:00)
+<h2>
+Bug Reports</h2>
+Send bug reports to <a href="news://comp.protocols.time.ntp">news://comp.protocols.time.ntp</a>
+and Sven_Dietrich@Trimble.COM
+<h2>
+Change Log</h2>
+
+<h3>
+Last revision 15 November 1999&nbsp; Version 4.0.98f.</h3>
+<b>by Sven Dietrich (sven_dietrich@trimble.com)</b>
+<p><b>Significant Changes:</b>
+<ul>
+<li>
+Fixed I/O problem delaying packet responses which resulted in no-replys
+to NTPQ and others.</li>
+
+<li>
+The default configuration file path is <tt>&lt;WINDIR>\system32\drivers\etc\ntp.conf.
+The old &lt;WINDIR>\ntp.conf </tt>is still supported but you will get a
+log entry reporting that the first file wasn't found. The NTP 3.x legacy
+<tt>ntp.ini</tt>
+file is no longer supported.</li>
+</ul>
+<b>Known Problems / TODO:</b>
+<ul>
+<li>
+MD5 and name resolution do not yet get along. If you define MD5, you cannot
+use DNS names, only IP numbers.</li>
+</ul>
+
+<h3>
+Last revision 27 July 1999&nbsp; Version 4.0.95.</h3>
+This version compiles under WINNT with Visual C 6.0.
+<p>Greg Brackley and Sven Dietrich
+<p>Significant changes:
+<br>-Visual Studio v6.0 support
+<br>-Winsock 2.0 support
+<br>-Use of I/O completion ports for sockets and comm port I/O
+<br>-Removed the use of multimedia timers (from ntpd, others need removing)
+<br>-Use of waitable timers (with user mode APC) and performance counters
+to fake getting a better time
+<br>-Trimble Palisade NTP Reference Clock support
+<br>-General cleanup, prototyping of functions
+<br>-Moved receiver buffer code to a separate module (removed unused members
+from the recvbuff struct)
+<br>-Moved io signal code to a separate module
+<h3>
+Last revision:&nbsp; 20-Oct-1996</h3>
+This version corrects problems with building the XNTP
+<br>version 3.5-86 distribution under Windows NT.
+<p>The following files were modified:
+<br>&nbsp;blddbg.bat
+<br>&nbsp;bldrel.bat
+<br>&nbsp;include\ntp_machine.h
+<br>&nbsp;xntpd\ntp_unixclock.c
+<br>&nbsp;xntpd\ntp_refclock.c
+<br>&nbsp;scripts\wininstall\build.bat
+<br>&nbsp;scripts\wininstall\setup.rul
+<br>&nbsp;scripts\wininstall\readme.nt
+<br>&nbsp;scripts\wininstall\distrib\ntpog.wri
+<br>&nbsp;html\hints\winnt (this file)
+<p>In order to build the entire Windows NT distribution you
+<br>need to modify the file scripts\wininstall\build.bat
+<br>with the installation directory of the InstallShield
+<br>software.&nbsp; Then, simply type "bldrel" for non-debug
+<br>or "blddbg" for debug executables.
+<p>Greg Schueman
+<br>&nbsp;&nbsp;&nbsp; &lt;schueman@acm.org>
+<h3>
+Last revision:&nbsp; 07-May-1996</h3>
+This set of changes fixes all known bugs, and it includes
+<br>several major enhancements.
+<p>Many changes have been made both to the build environment as
+<br>well as the code.&nbsp; There is no longer an ntp.mak file, instead
+<br>there is a buildntall.bat file that will build the entire
+<br>release in one shot.&nbsp; The batch file requires Perl.&nbsp; Perl
+<br>is easily available from the NT Resource Kit or on the Net.
+<p>The multiple interface support was adapted from Larry Kahn's
+<br>work on the BIND NT port.&nbsp; I have not been able to test it
+<br>adequately as I only have NT servers with one network
+<br>interfaces on which to test.
+<p>Enhancements:
+<br>* Event Logging now works correctly.
+<br>* Version numbers now work (requires Perl during build)
+<br>* Support for multiple network interface cards (untested)
+<br>* NTP.CONF now default, but supports ntp.ini if not found
+<br>* Installation procedure automated.
+<br>* All paths now allow environment variables such as %windir%
+<p>Bug fixes:
+<br>* INSTSRV replaced, works correctly
+<br>* Cleaned up many warnings
+<br>* Corrected use of an uninitialized variable in XNTPD
+<br>* Fixed ntpdate -b option
+<br>* Fixed ntpdate to accept names as well as IP addresses
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Winsock WSAStartup was
+called after a gethostbyname())
+<br>* Fixed problem with "longjmp" in xntpdc/ntpdc.c that
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; caused a software exception
+on doing a Control-C in xntpdc.
+<br>&nbsp;A Cntrl-C now terminates the program.
+<p>See below for more detail:
+<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Note: SIGINT is not supported for any
+Win32 application including
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows NT and Windows 95. When a CTRL+C
+interrupt occurs, Win32
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; operating systems generate a new thread
+to specifically handle that
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; interrupt. This can cause a single-thread
+application such as UNIX,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to become multithreaded, resulting in
+unexpected behavior.
+<br>&nbsp;
+<p>Possible enhancements and things left to do:
+<br>* Reference clock drivers for NT (at least Local Clock support)
+<br>* Control Panel Applet
+<br>* InstallShield based installation, like NT BIND has
+<br>* Integration with NT Performance Monitor
+<br>* SNMP integration
+<br>* Fully test multiple interface support
+<br>&nbsp;
+<p>Known problems:
+<br>*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bug in ntptrace - if no Stratum
+1 servers are available,
+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+such as on an IntraNet, the application crashes.
+<h3>
+Last revision:&nbsp; 12-Apr-1995</h3>
+This NTPv3 distribution includes a sample configuration file and the project
+<br>makefiles for WindowsNT 3.5 platform using Microsoft Visual C++ 2.0
+compiler.
+<br>Also included is a small routine to install the NTP daemon as a "service"
+<br>on a WindowsNT box. Besides xntpd, the utilities that have been ported
+are
+<br>ntpdate and xntpdc. The port to WindowsNT 3.5 has been tested using
+a Bancomm
+<br>TimeServe2000 GPS receiver clock that acts as a strata 1 NTP server
+with no
+<br>authentication (it has not been tested with any refclock drivers compiled
+in).
+<br>Following are the known flaws in this port:
+<br>1) currently, I do not know of a way in NT to get information about
+multiple
+<br>&nbsp;&nbsp; network interface cards. The current port uses just one
+socket bound to
+<br>&nbsp;&nbsp; INADDR_ANY address. Therefore when dealing with a multihomed
+NT time server,
+<br>&nbsp;&nbsp; clients should point to the default address on the server
+(otherwise the
+<br>&nbsp;&nbsp; reply is not guaranteed to come from the same interface
+to which the
+<br>&nbsp;&nbsp; request was sent). Working with Microsoft to get this
+resolved.
+<br>2) There is some problem with "longjmp" in xntpdc/ntpdc.c that causes
+a
+<br>&nbsp;&nbsp; software exception on doing a Control-C in xntpdc. Be
+patient!
+<br>3) The error messages logged by xntpd currently contain only the numerical
+<br>&nbsp;&nbsp; error code. Corresponding error message string has to
+be looked up in
+<br>&nbsp;&nbsp; "Books Online" on Visual C++ 2.0 under the topic "Numerical
+List of Error
+<br>&nbsp;&nbsp; Codes".
+<p>Last HTML Update: November 17, 1999
+<br><a href="mailto://sven_dietrich@trimble.com">Sven_Dietrich@Trimble.COM</a>
+</body>
+</html>
diff --git a/contrib/ntp/html/index.htm b/contrib/ntp/html/index.htm
index a676c871e88a..c5cca919710a 100644
--- a/contrib/ntp/html/index.htm
+++ b/contrib/ntp/html/index.htm
@@ -1,8 +1,8 @@
-<HTML><HEAD><TITLE>
+<html><head><title>
The Network Time Protocol (NTP) Distribution
-</TITLE></HEAD><BODY><H3>
+</title></head><body><h3>
The Network Time Protocol (NTP) Distribution
-</H3>
+</h3>
<IMG align=left SRC=pic/barnstable.gif>From <i>pogo</i>, Walt Kelly
diff --git a/contrib/ntp/html/monopt.htm b/contrib/ntp/html/monopt.htm
index fc6ba84e0ca3..267bbccc93ab 100644
--- a/contrib/ntp/html/monopt.htm
+++ b/contrib/ntp/html/monopt.htm
@@ -1,370 +1,250 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
- <TITLE>Monitoring Options
-</TITLE>
-</HEAD>
-<BODY>
-
-<H3>
-Monitoring Options</H3>
-
-<HR>
-<H4>
-Monitoring Support</H4>
-<TT>ntpd</TT> includes a comprehensive monitoring facility suitable for
-continuous, long term recording of server and client timekeeping performance.
-See the <TT>statistics</TT> command below for a listing and example of
-each type of statistics currently supported. Statistic files are managed
-using file generation sets and scripts in the ./scripts directory of this
-distribution. Using these facilities and Unix <TT>cron</TT> jobs, the data
-can be automatically summarized and archived for retrospective analysis.
-<H4>
-Monitoring Commands</H4>
-
-<DL>
-<DT>
-<TT>statistics <I>name</I> [...]</TT></DT>
-
-<DD>
-Enables writing of statistics records. Currently, four kinds of <I><TT>name</TT></I>
-statistics are supported.</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DL>
-<DT>
-<TT>loopstats</TT></DT>
-
-<DD>
-Enables recording of loop filter statistics information. Each update of
-the local clock outputs a line of the following form to the file generation
-set named <TT>loopstats</TT>:</DD>
-
-<PRE>50935 75440.031 0.000006019 13.778190 0.000351733 0.013380 6</PRE>
-
-<DD>
-The first two fields show the date (Modified Julian Day) and time (seconds
-and fraction past UTC midnight). The next five fields show time offset
-(seconds), frequency offset (parts per million - PPM), RMS jitter (seconds),
-Allan deviation (PPM) and clock discipline time constant.</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DT>
-<TT>peerstats</TT></DT>
-
-<DD>
-Enables recording of peer statistics information. This includes statistics
-records of all peers of a NTP server and of special signals, where present
-and configured. Each valid update appends a line of the following form
-to the current element of a file generation set named <TT>peerstats</TT>:</DD>
-
-<PRE>48773 10847.650 127.127.4.1 9714 -0.001605 0.00000 0.00142</PRE>
-
-<DD>
-The first two fields show the date (Modified Julian Day) and time (seconds
-and fraction past UTC midnight). The next two fields show the peer address
-in dotted-quad notation and status, respectively. The status field is encoded
-in hex in the format described in Appendix A of the NTP specification RFC
-1305. The final three fields show the offset, delay and RMS jitter, all
-in seconds.</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DT>
-<TT>clockstats</TT></DT>
-
-<DD>
-Enables recording of clock driver statistics information. Each update received
-from a clock driver appends a line of the following form to the file generation
-set named <TT>clockstats</TT>:</DD>
-
-<PRE>49213 525.624 127.127.4.1 93 226 00:08:29.606 D</PRE>
-
-<DD>
-The first two fields show the date (Modified Julian Day) and time (seconds
-and fraction past UTC midnight). The next field shows the clock address
-in dotted-quad notation, The final field shows the last timecode received
-from the clock in decoded ASCII format, where meaningful. In some clock
-drivers a good deal of additional information can be gathered and displayed
-as well. See information specific to each clock for further details.</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DT>
-<TT>rawstats</TT></DT>
-
-<DD>
-Enables recording of raw-timestamp statistics information. This includes
+<html><head><title>
+Monitoring Options
+</title></head><body><h3>
+Monitoring Options
+</h3><hr>
+
+<h4>Monitoring Support</h4>
+
+<tt>ntpd</tt> includes a comprehensive monitoring facility suitable for
+continuous, long term recording of server and client timekeeping
+performance. See the <tt>statistics</tt> command below for a listing and
+example of each type of statistics currently supported. Statistic files
+are managed using file generation sets and scripts in the ./scripts
+directory of this distribution. Using these facilities and Unix
+<tt>cron</tt> jobs, the datacan be automatically summarized and archived
+for retrospective analysis.
+
+<h4>Monitoring Commands</h4>
+
+<dl>
+
+<dt><tt>statistics <I>name</I> [...]</tt></dt>
+<dd>Enables writing of statistics records. Currently, four kinds of
+<I><tt>name</tt></I>statistics are supported.</dd>
+
+<dl>
+
+<dt><tt>loopstats</tt></dt>
+<dd>Enables recording of loop filter statistics information. Each update
+of the local clock outputs a line of the following form to the file
+generation set named <tt>loopstats</tt>:</dd>
+
+<p><dd><tt>50935 75440.031 0.000006019 13.778190 0.000351733 0.013380
+6</tt></dd>
+
+<p><dd>The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight). The next five fields show time
+offset (seconds), frequency offset (parts per million - PPM), RMS jitter
+(seconds), Allan deviation (PPM) and clock discipline time
+constant.</dd>
+
+<dt><tt>peerstats</tt></dt>
+<dd>Enables recording of peer statistics information. This includes
statistics records of all peers of a NTP server and of special signals,
-where present and configured. Each NTP message received from a peer or
-clock driver appends a line of the following form to the file generation
-set named <TT>rawstats</TT>:</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DD>
-<TT>50928 2132.543 128.4.1.1 128.4.1.20 3102453281.584327000 3102453281.58622800031
-02453332.540806000 3102453332.541458000</TT></DD>
-
-<DD>
-<TT>&nbsp;</TT></DD>
-
-<DD>
-The first two fields show the date (Modified Julian Day) and time (seconds
-and fraction past UTC midnight). The next field shows the peer or clock
-address in dotted-quad notation, The final four fields show the originate,
-receive, transmit and final NTP timestamps in order. The timestamp values
-are as received and before processing by the various data smoothing and
-mitigation algorithms.</DD>
-</DL>
-
-<DD>
-&nbsp;</DD>
-
-<DT>
-<TT>statsdir <I>directory_path</I></TT></DT>
-
-<DD>
-Indicates the full path of a directory where statistics files should be
-created (see below). This keyword allows the (otherwise constant) <TT>filegen</TT>
-filename prefix to be modified for file generation sets, which is useful
-for handling statistics logs.</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DT>
-<TT>filegen <I>name</I> [file <I>filename</I>] [type <I>typename</I>] [link
-| nolink] [enable | disable]</TT></DT>
-
-<DT>
-<TT>&nbsp;</TT></DT>
-
-<DD>
-Configures setting of generation file set <I>name</I>. Generation file
-sets provide a means for handling files that are continuously growing during
-the lifetime of a server. Server statistics are a typical example for such
-files. Generation file sets provide access to a set of files used to store
-the actual data. At any time at most one element of the set is being written
-to. The type given specifies when and how data will be directed to a new
-element of the set. This way, information stored in elements of a file
-set that are currently unused are available for administrational operations
-without the risk of disturbing the operation of <TT>ntpd</TT>. (Most important:
-they can be removed to free space for new data produced.)</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DD>
-Note that this command can be sent from the <TT>ntpdc</TT> program running
-at a remote location.</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DL>
-<DT>
-<I><TT>name</TT></I></DT>
-
-<DD>
-This is the type of the statistics records, as shown in the <TT>statististics</TT>
-command.</DD>
-
-<DD>
-&nbsp;</DD>
-</DL>
-
-<DD>
-<TT>file <I>filename</I></TT></DD>
-
-<DL>
-<DD>
-This is the file name for the statistics records. Filenames of set members
-are built from three elements:</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DL>
-<DT>
-prefix</DT>
-
-<DD>
-This is a constant filename path. It is not subject to modifications via
-the <TT>filegen</TT> option. It is defined by the server, usually specified
-as a compile-time constant. It may, however, be configurable for individual
-file generation sets via other commands. For example, the prefix used with
-<TT>loopstats</TT> and <TT>peerstats</TT> generation can be configured
-using the <TT>statsdir</TT> option explained above.</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DT>
-<I><TT>filename</TT></I></DT>
-
-<DD>
-This string is directly concatenated to the prefix mentioned above (no
-intervening <TT>/</TT> (slash)). This can be modified using the <TT>file</TT>
-argument to the <TT>filegen</TT> statement. No <TT>..</TT> elements are
-allowed in this component to prevent filenames referring to parts outside
-the filesystem hierarchy denoted by <TT>prefix</TT>.</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DT>
-suffix</DT>
-
-<DD>
-This part is reflects individual elements of a file set. It is generated
-according to the type of a file set.</DD>
-</DL>
-
-<DD>
-&nbsp;</DD>
-</DL>
-
-<DD>
-<TT>type <I>typename</I></TT></DD>
-
-<DL>
-<DD>
-A file generation set is characterized by its type. The following types
-are supported:</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DL>
-<DT>
-<TT>none</TT></DT>
-
-<DD>
-The file set is actually a single plain file.</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DT>
-<TT>pid</TT></DT>
-
-<DD>
-One element of file set is used per incarnation of a <TT>ntpd</TT> server.
-This type does not perform any changes to file set members during runtime,
-however it provides an easy way of separating files belonging to different
-<TT>ntpd</TT> server incarnations. The set member filename is built by
-appending a <TT>.</TT> (dot) to concatenated <I>prefix</I> and <I>filename</I>
-strings, and appending the decimal representation of the process ID of
-the <TT>ntpd</TT> server process.</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DT>
-<TT>day</TT></DT>
-
-<DD>
-One file generation set element is created per day. A day is defined as
-the period between 00:00 and 24:00 UTC. The file set member suffix consists
-of a <TT>.</TT> (dot) and a day specification in the form <TT>YYYYMMDD.
-YYYY</TT> is a 4-digit year number (e.g., 1992). <TT>MM</TT> is a two digit
-month number. <TT>DD</TT> is a two digit day number. Thus, all information
-written at 10 December 1992 would end up in a file named <TT><I>prefix
-filename</I>.19921210</TT>.</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DT>
-<TT>week</TT></DT>
-
-<DD>
-Any file set member contains data related to a certain week of a year.
-The term week is defined by computing day-of-year modulo 7. Elements of
-such a file generation set are distinguished by appending the following
-suffix to the file set filename base: A dot, a 4-digit year number, the
-letter <TT>W</TT>, and a 2-digit week number. For example, information
-from January, 10th 1992 would end up in a file with suffix <TT>.1992W1</TT>.</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DT>
-<TT>month</TT></DT>
-
-<DD>
-One generation file set element is generated per month. The file name suffix
-consists of a dot, a 4-digit year number, and a 2-digit month.</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DT>
-<TT>year</TT></DT>
-
-<DD>
-One generation file element is generated per year. The filename suffix
-consists of a dot and a 4 digit year number.</DD>
-
-<DD>
-&nbsp;</DD>
-
-<DT>
-<TT>age</TT></DT>
-
-<DD>
-This type of file generation sets changes to a new element of the file
-set every 24 hours of server operation. The filename suffix consists of
-a dot, the letter <TT>a</TT>, and an 8-digit number. This number is taken
-to be the number of seconds the server is running at the start of the corresponding
-24-hour period. Information is only written to a file generation by specifying
-<TT>enabl</TT>; output is prevented by specifying <TT>disable</TT>.</DD>
-
-<DD>
-&nbsp;</DD>
-</DL>
-</DL>
-
-<DD>
-<TT>link | nolink</TT></DD>
-
-<DL>
-<DD>
-It is convenient to be able to access the current element of a file generation
-set by a fixed name. This feature is enabled by specifying <TT>link</TT>
-and disabled using <TT>nolink</TT>. If <TT>link</TT> is specified, a hard
-link from the current file set element to a file without suffix is created.
-When there is already a file with this name and the number of links of
-this file is one, it is renamed appending a dot, the letter <TT>C</TT>,
-and the pid of the <TT>ntpd</TT> server process. When the number of links
-is greater than one, the file is unlinked. This allows the current file
-to be accessed by a constant name.</DD>
-
-<DD>
-&nbsp;</DD>
-</DL>
-
-<DD>
-<TT>enable | disable</TT></DD>
-
-<DL>
-<DD>
-Enables or disables the recording function.</DD>
-</DL>
-</DL>
-
-<HR>
-<ADDRESS>
-David L. Mills (mills@udel.edu)</ADDRESS>
-
-</BODY>
-</HTML>
+where present and configured. Each valid update appends a line of the
+following form to the current element of a file generation set named
+<tt>peerstats</tt>:</dd>
+
+<p><dd><tt>48773 10847.650 127.127.4.1 9714 -0.001605 0.00000
+0.00142</tt></dd>
+
+<p><dd>The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight). The next two fields show the
+peer address in dotted-quad notation and status, respectively. The
+status field is encoded in hex in the format described in Appendix A of
+the NTP specification RFC 1305. The final three fields show the offset,
+delay and RMS jitter, all in seconds.</dd>
+
+<dt><tt>clockstats</tt></dt>
+<dd>Enables recording of clock driver statistics information. Each
+update received from a clock driver appends a line of the following form
+to the file generation set named <tt>clockstats</tt>:</dd>
+
+<p><dd><tt>49213 525.624 127.127.4.1 93 226 00:08:29.606 D</tt></dd>
+<p><dd>The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight). The next field shows the clock
+address in dotted-quad notation, The final field shows the last timecode
+received from the clock in decoded ASCII format, where meaningful. In
+some clock drivers a good deal of additional information can be gathered
+and displayed as well. See information specific to each clock for
+further details.</dd>
+
+<dt><tt>rawstats</tt></dt>
+<dd>Enables recording of raw-timestamp statistics information. This
+includes statistics records of all peers of a NTP server and of special
+signals, where present and configured. Each NTP message received from a
+peer or clock driver appends a line of the following form to the file
+generation set named <tt>rawstats</tt>:</dd>
+
+<p><dd><tt>50928 2132.543 128.4.1.1 128.4.1.20 3102453281.584327000
+3102453281.58622800031 02453332.540806000 3102453332.541458000</tt></dd>
+
+<p><dd>The first two fields show the date (Modified Julian Day) and time
+(seconds and fraction past UTC midnight). The next two fields show the
+remote peer or clock address followed by the local address in
+dotted-quad notation, The final four fields show the originate, receive,
+transmit and final NTP timestamps in order. The timestamp values are as
+received and before processing by the various data smoothing and
+mitigation algorithms.</dd>
+
+</dl>
+
+<dt><tt>statsdir <I>directory_path</I></tt></dt>
+<dd>Indicates the full path of a directory where statistics files should
+be created (see below). This keyword allows the (otherwise constant)
+<tt>filegen</tt> filename prefix to be modified for file generation
+sets, which is useful for handling statistics logs.</dd>
+
+<dt><tt>filegen <I>name</I> [file <I>filename</I>] [type
+<I>typename</I>] [link | nolink] [enable | disable]</tt></dt>
+<dd>Configures setting of generation file set <I>name</I>. Generation
+file sets provide a means for handling files that are continuously
+growing during the lifetime of a server. Server statistics are a typical
+example for such files. Generation file sets provide access to a set of
+files used to store the actual data. At any time at most one element of
+the set is being written to. The type given specifies when and how data
+will be directed to a new element of the set. This way, information
+stored in elements of a file set that are currently unused are available
+for administrational operations without the risk of disturbing the
+operation of <tt>ntpd</tt>. (Most important: they can be removed to free
+space for new data produced.)</dd>
+
+<dd>Note that this command can be sent from the <tt>ntpdc</tt> program
+running at a remote location.</dd>
+
+<dl>
+
+<dt><I><tt>name</tt></I></dt>
+<dd>This is the type of the statistics records, as shown in the
+<tt>statististics</tt> command.</dd>
+
+</dl>
+
+<dd><tt>file <I>filename</I></tt></dd>
+
+<dl>
+
+<dd>This is the file name for the statistics records. Filenames of set
+members are built from three concatenated elements
+<I><tt>prefix</tt></I>, <I><tt>filename</tt></I> and
+<I><tt>suffix</tt></I>:</dd>
+
+<dl>
+
+<dt><I><tt>prefix</tt></I></dt>
+<dd>This is a constant filename path. It is not subject to modifications
+via the <tt>filegen</tt> option. It is defined by the server, usually
+specified as a compile-time constant. It may, however, be configurable
+for individual file generation sets via other commands. For example, the
+prefix used with <tt>loopstats</tt> and <tt>peerstats</tt> generation
+can be configured using the <tt>statsdir</tt> option explained
+above.</dd>
+
+<dt><I><tt>filename</tt></I></dt>
+<dd>This string is directly concatenated to the prefix mentioned above
+(no intervening <tt>/</tt> (slash)). This can be modified using the
+<tt>file</tt> argument to the <tt>filegen</tt> statement. No <tt>..</tt>
+elements are allowed in this component to prevent filenames referring to
+parts outside the filesystem hierarchy denoted by <tt>prefix</tt>.</dd>
+
+<dt><I><tt>suffix</tt></I></dt>
+<dd>This part is reflects individual elements of a file set. It is
+generated according to the type of a file set.</dd>
+
+</dl>
+
+</dl>
+
+<dd><tt>type <I>typename</I></tt></dd>
+
+<dl>
+
+<dd>A file generation set is characterized by its type. The following
+types are supported:</dd>
+
+<dl>
+
+<dt><tt>none</tt></dt>
+<dd>The file set is actually a single plain file.</dd>
+
+<dt><tt>pid</tt></dt>
+<dd>One element of file set is used per incarnation of a <tt>ntpd</tt>
+server. This type does not perform any changes to file set members
+during runtime, however it provides an easy way of separating files
+belonging to different <tt>ntpd</tt> server incarnations. The set member
+filename is built by appending a <tt>.</tt> (dot) to concatenated
+<I>prefix</I> and <I>filename</I> strings, and appending the decimal
+representation of the process ID of the <tt>ntpd</tt> server
+process.</dd>
+
+<dt><tt>day</tt></dt>
+<dd>One file generation set element is created per day. A day is defined
+as the period between 00:00 and 24:00 UTC. The file set member suffix
+consists of a <tt>.</tt> (dot) and a day specification in the form
+<tt>YYYYMMdd. YYYY</tt> is a 4-digit year number (e.g., 1992).
+<tt>MM</tt> is a two digit month number. <tt>dd</tt> is a two digit day
+number. Thus, all information written at 10 December 1992 would end up
+in a file named <tt><I>prefix filename</I>.19921210</tt>.</dd>
+
+<dt><tt>week</tt></dt>
+<dd>Any file set member contains data related to a certain week of a
+year. The term week is defined by computing day-of-year modulo 7.
+Elements of such a file generation set are distinguished by appending
+the following suffix to the file set filename base: A dot, a 4-digit
+year number, the letter <tt>W</tt>, and a 2-digit week number. For
+example, information from January, 10th 1992 would end up in a file with
+suffix <tt>.1992W1</tt>.</dd>
+
+<dt><tt>month</tt></dt>
+<dd>One generation file set element is generated per month. The file
+name suffix consists of a dot, a 4-digit year number, and a 2-digit
+month.</dd>
+
+<dt><tt>year</tt></dt>
+<dd>One generation file element is generated per year. The filename
+suffix consists of a dot and a 4 digit year number.</dd>
+
+<dt><tt>age</tt></dt>
+<dd>This type of file generation sets changes to a new element of the
+file set every 24 hours of server operation. The filename suffix
+consists of a dot, the letter <tt>a</tt>, and an 8-digit number. This
+number is taken to be the number of seconds the server is running at the
+start of the corresponding 24-hour period. Information is only written
+to a file generation by specifying <tt>enable</tt>; output is prevented
+by specifying <tt>disable</tt>.</dd>
+
+</dl>
+
+</dl>
+
+<dd><tt>link | nolink</tt></dd>
+
+<dl>
+
+<dd>It is convenient to be able to access the current element of a file
+generation set by a fixed name. This feature is enabled by specifying
+<tt>link</tt> and disabled using <tt>nolink</tt>. If <tt>link</tt> is
+specified, a hard link from the current file set element to a file
+without suffix is created. When there is already a file with this name
+and the number of links of this file is one, it is renamed appending a
+dot, the letter <tt>C</tt>, and the pid of the <tt>ntpd</tt> server
+process. When the number of links is greater than one, the file is
+unlinked. This allows the current file to be accessed by a constant
+name.</dd>
+
+</dl>
+
+<dd><tt>enable | disable</tt></dd>
+
+<dl>
+
+<dd>Enables or disables the recording function.</dd>
+
+</dl>
+
+</dl>
+
+<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
+href=mailto:mills@udel.edu> David L. Mills &lt;mills@udel.edu&gt;</a>
+</address></a></body></html>
diff --git a/contrib/ntp/html/notes.htm b/contrib/ntp/html/notes.htm
index 6b20cbc44ab6..e9f648cd2ccf 100644
--- a/contrib/ntp/html/notes.htm
+++ b/contrib/ntp/html/notes.htm
@@ -1244,18 +1244,21 @@ value of <TT>tick</TT>.
<P>The <TT>tickadj</TT> program can reset several other kernel variables
if asked. It can change the value of <TT>tick</TT> if asked. This is
-handy
-to compensate for kernel bugs which cause the clock to run with a very
-large frequency error, as with SunOS 4.1.1 systems. It can also be used
-to set the value of the kernel <TT>dosynctodr</TT> variable to zero.
-This
-variable controls whether to synchronize the system clock to the time-
-of-day
-clock, something you really don't want to be happen when <TT>ntpd</TT>
-is trying to keep it under control. In some systems, such as recent Sun
-Solaris kernels, the <TT>dosynctodr </TT>variable is the only one that
-can be changed by the <TT>tickadj </TT>program. In this and other modern
-kernels, it is not necessary to change the other variables in any case.
+handy to compensate for kernel bugs which cause the clock to run with a
+very large frequency error, as with SunOS 4.1.1 systems. It can also be
+used to set the value of the kernel <TT>dosynctodr</TT> variable to
+zero. This variable controls whether to synchronize the system clock to
+the time-of-day clock, something you really don't want to be happen
+when <TT>ntpd</TT> is trying to keep it under control. In some systems,
+such as recent Sun Solaris kernels, the <TT>dosynctodr </TT>variable is
+the only one that can be changed by the <TT>tickadj </TT>program. In
+this and other modern kernels, it is not necessary to change the other
+variables in any case.
+
+<P>
+We have a report that says starting with Solaris 2.6 we should
+leave <I>dosynctodr</I> alone.
+<A HREF="solaris-dosynctodr.html">Here is the report</A>.
<P>In order to maintain reasonable correctness bounds, as well as
reasonably
diff --git a/contrib/ntp/html/ntpd.htm b/contrib/ntp/html/ntpd.htm
index a90dfcbd5fc8..0ba0ac73fba3 100644
--- a/contrib/ntp/html/ntpd.htm
+++ b/contrib/ntp/html/ntpd.htm
@@ -6,11 +6,10 @@
<H4>Synopsis</H4>
-<TT>ntpd [ -aAbdm ] [ -c <I>conffile</I> ] [ -f <I>driftfile</I> ] [ -k
-<I>keyfile</I> ] [ -l <I>logfile</I> ] [ -p <I>pidfile</I> ] [ -r
+<TT>ntpd [ -aAbdm ] [ -c <I>conffile</I> ] [ -f <I>driftfile</I> ] [ -g
+] [ -k <I>keyfile</I> ] [ -l <I>logfile</I> ] [ -p <I>pidfile</I> ] [ -r
<I>broadcastdelay</I> ] [ -s <I>statsdir</I> ] [ -t <I>key</I> ] [ -v
-<I>variable</I> ] [ -V
-<I>variable</I> ]</TT>
+<I>variable</I> ] [ -V <I>variable</I> ] [ -x ]</TT>
<H4>Description</H4>
@@ -43,9 +42,10 @@ local host is to be configured as a broadcast/multicast client or
manycast client, with all peers being determined by listening to
broadcasts at run time.
-<P>If NetInfo support is built into <TT>ntpd</TT>, then <TT>ntpd</TT> will
-attempt to read its configuration from the NetInfo if the default ntp.conf
-file cannot be read and no file is specified by the <TT>-c</TT> option.
+<P>If NetInfo support is built into <TT>ntpd</TT>, then <TT>ntpd</TT>
+will attempt to read its configuration from the NetInfo if the default
+ntp.conf file cannot be read and no file is specified by the <TT>-c</TT>
+option.
<P>Various internal <TT>ntpd</TT> variables can be displayed and
configuration options altered while the daemon is running using the
@@ -85,7 +85,8 @@ each occurrence indicating greater detail of display.</DD>
<DT><TT>-g</TT></DT>
<DD>Normally, the daemon exits if the offset exceeds a 1000-s sanity
limit. This option overrides this limit and allows the time to be set to
-any value without restriction.</DD>
+any value without restriction; however, this can happen only once. After
+that, the daemon will exit of the limit is exceeded.
<DT><TT>-k <I>keyfile</I></TT></DT>
<DD>Specify the name and path of the file containing the NTP
@@ -128,7 +129,6 @@ stepped, not gradually slewed. This option forces the time to be slewed
in all cases. Note: Since the slew rate is limited to 0.5 ms/s, each
second of adjustment requires an amortization interval of 2000 s. Thus,
an adjustment of many seconds can take hours or days to amortize.</DD>
-
</DL>
<H4>The Configuration File</H4>
diff --git a/contrib/ntp/html/pps.htm b/contrib/ntp/html/pps.htm
index a002c1f048c1..97850d71c4f2 100644
--- a/contrib/ntp/html/pps.htm
+++ b/contrib/ntp/html/pps.htm
@@ -1,18 +1,19 @@
-<HTML><HEAD><TITLE>
+<html><head><title>
Pulse-per-second (PPS) Signal Interfacing
-</TITLE></HEAD><BODY><H3>
+</title></head><body><h3>
Pulse-per-second (PPS) Signal Interfacing
-</H3><HR>
+</h3><hr>
-<P>Some radio clocks and related timekeeping gear have a pulse-per-
-second (PPS) signal that can be used to discipline the local clock
-oscillator to a high degree of precision, typically to the order less
-than 20 <FONT FACE=Symbol>m</FONT>s in time and 0.01 PPM in frequency.
-The PPS signal can be connected in either of two ways: via the data
-leads of a serial port or via the modem control leads. Either way
-requires conversion of the PPS signal, usually at TTL levels, to RS232
-levels, which can be done using a circuit such as described in the <A
-HREF=gadget.htm>Gadget Box PPS Level Converter and CHU Modem</A> page.
+<P>Some radio clocks and related timekeeping gear have a
+pulse-per-second (PPS) signal that can be used to discipline the local
+clock oscillator to a high degree of precision, typically to the order
+less than 20 <font face=Symbol>m</font>s in time and 0.01 PPM in
+frequency. The PPS signal can be connected in either of two ways: via
+the data leads of a serial port or via the modem control leads. Either
+way requires conversion of the PPS signal, usually at TTL levels, to
+RS232 levels, which can be done using a circuit such as described in the
+<A HREF=gadget.htm>Gadget Box PPS Level Converter and CHU Modem</A>
+page.
<P>The data leads interface requires regenerating the PPS pulse and
converting to RS232 signal levels, so that the pulse looks like a
diff --git a/contrib/ntp/html/qth.htm b/contrib/ntp/html/qth.htm
new file mode 100644
index 000000000000..200d3fb1f67b
--- /dev/null
+++ b/contrib/ntp/html/qth.htm
@@ -0,0 +1,64 @@
+<html><head><title>
+Stations, Frequencies and Geographic Coordinates
+</title></head><body><h3>
+Stations, Frequencies and Geographic Coordinates
+</h3><hr>
+
+The following data were obtained from the International Frequency List
+published by the ITU and other sources.
+
+<p><table cols=3 width=100%>
+
+<tr>
+<td>Station</td>
+<td>Frequencies</td>
+<td>Coordinates</td>
+</tr>
+
+<tr>
+<td>WWV Ft. Collins, CO</td>
+<td>2.5/5/10/15/20 MHz</td>
+<td>40:40:49.0N 105:02:27.0W</td>
+</tr>
+
+<tr>
+<td>WWVB Ft. Collins, CO</td>
+<td>60 kHz</td>
+<td>40:40:28.3N 105:02:39.5W</td>
+</tr>
+
+<tr>
+<td>WWVH Kauai, HI</td>
+<td>2.5/5/10/15 MHz</td>
+<td>21:59:26.0N 159:46:00.0W</td>
+</tr>
+
+<tr>
+<td>CHU Ottawa, CA</td>
+<td>3330/7335/14670 kHz</td>
+<td>45:18N 75:45N</td>
+</tr>
+
+<tr>
+<td>DCF77 Mainflingen, DE</td>
+<td>77.5 kHz</td>
+<td>50:01N 9:00E</td>
+</tr>
+
+<tr>
+<td>MSF Rugby, UK</td>
+<td>60 kHz</td>
+<td>52:22N 1:11W</td>
+</tr>
+
+<tr>
+<td>TDF Allouis, FR</td>
+<td>162 kHz</td>
+<td>47:10N 2:12E</td>
+</tr>
+
+</table>
+
+<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
+href=mailto:mills@udel.edu> David L. Mills &lt;mills@udel.edu&gt;</a>
+</address></a></body></html>
diff --git a/contrib/ntp/html/refclock.htm b/contrib/ntp/html/refclock.htm
index 5747e3fea656..80c62a265a59 100644
--- a/contrib/ntp/html/refclock.htm
+++ b/contrib/ntp/html/refclock.htm
@@ -1,6 +1,6 @@
-<HTML><HEAD><TITLE>
+<html><head><title>
Reference Clock Drivers
-</TITLE></HEAD><BODY><H3>
+</title></head><body><h3>
Reference Clock Drivers
</H3>
@@ -19,13 +19,11 @@ Reference Clock Drivers
The Tardis
<hr>
-<H4>Reference Clock Drivers</H4>
-
-Support for most of the commonly available radio and modem clocks is
-included in the default configuration of the NTP daemon for Unix
-<TT>ntpd</TT>. Individual clocks can be activated by configuration file
-commands, specifically the <TT>server</TT> and <TT>fudge</TT> commands
-described in the <A HREF=ntpd.htm><TT>ntpd</TT> program manual
+Support for most of the commonly available radio and modem reference
+clocks is included in the default configuration of the NTP daemon for
+Unix <TT>ntpd</TT>. Individual clocks can be activated by configuration
+file commands, specifically the <TT>server</TT> and <TT>fudge</TT>
+commands described in the <A HREF=ntpd.htm><TT>ntpd</TT> program manual
page</A>. The following discussion presents Information on how to select
and configure the device drivers in a running Unix system.
@@ -39,13 +37,42 @@ device is normally specified by adding a soft link
<TT>/dev/device<I>u</I></TT> to the particular hardware device involved,
where <I><TT>u</TT></I> correspond to the unit number above.
+<p>Most clock drivers communicate with the reference clock using a
+serial port, usually at 9600 bps. There are several application program
+interfaces (API) used in the various Unix and NT systems, most of which
+can be detected at configuration time. Thus, it is important that the
+NTP daemon and utilities be compiled on the target system or clone. In
+some cases special features are available, such as timestamping in the
+kernel or pulse-per-second (PPS) interface. In most cases these features
+can be detected at configuration time as well; however, the kernel may
+have to be recompiled in order for them to work.
+
+<p>The audio drivers are a special case. These include support for the
+NIST time/frequency stations WWV and WWVH, the Canadian time/frequency
+station CHU and generic IRIG signals. Currently, support for the Solaris
+and SunOS audio API is included in the distribution. It is left to the
+volunteer corps to extend this support to other systems. Further
+information on hookup, debugging and monitoring is given in the <a
+href=audio.htm>Audio Drivers</a> page.
+
+<p>Some drivers depending on longwave and shortwave radio services need
+to know the radio propagation time from the transmitter to the receiver,
+which can amount to some tens of milliseconds. This must be calculated
+for each specific receiver location and requires the geographic
+coordinates of both the transmitter and receiver. The transmitter
+coordinates for various radio services are given in the <a
+href=qth.htm>Stations, Frequencies and Geographic Coordinates</a> page.
+Receiver coordinates can be obtained or estimated from various sources.
+The actual calculations are beyond the scope of this document.
+
<P>Following is a list showing the type and title of each driver
currently implemented. The compile-time identifier for each is shown in
parentheses. Click on a selected type for specific description and
configuration documentation, including the clock address, reference ID,
-driver ID, device name and speed, and features (line disciplines, etc.).
-For those drivers without specific documentation, please contact the
-author listed in the <A HREF=copyright.htm>copyright page</A>.
+driver ID, device name and serial line speed, and features (line
+disciplines, etc.). For those drivers without specific documentation,
+please contact the author listed in the <A HREF=copyright.htm>Copyright
+Notice</A> page.
<P><A HREF=driver1.htm>Type 1</A> Undisciplined Local Clock
(<TT>LOCAL</TT>)
@@ -54,13 +81,13 @@ author listed in the <A HREF=copyright.htm>copyright page</A>.
<BR><A HREF=driver3.htm>Type 3</A> PSTI/Traconex 1020 WWV/WWVH
Receiver
(<TT>WWV_PST</TT>)
-<BR><A HREF=driver4.htm>Type 4</A> Spectracom 8170 and Netclock/2 WWVB
-Receivers (<TT>WWVB_SPEC</TT>)
+<BR><A HREF=driver4.htm>Type 4</A> Spectracom WWVB and GPS Receivers
+(<TT>WWVB_SPEC</TT>)
<BR><A HREF=driver5.htm>Type 5</A> TrueTime GPS/GOES/OMEGA Receivers
(<TT>TRUETIME</TT>)
<BR><A HREF=driver6.htm>Type 6</A> IRIG Audio Decoder
(<TT>IRIG_AUDIO</TT>)
-<BR><A HREF=driver7.htm>Type 7</A> CHU Audio/Modem Decoder
+<BR><A HREF=driver7.htm>Type 7</A> Radio CHU Audio Demodulator/Decoder
(<TT>CHU</TT>)
<BR><A HREF=driver8.htm>Type 8</A> Generic Reference Driver
(<TT>PARSE</TT>)
@@ -93,29 +120,33 @@ Receivers (<TT>WWVB_SPEC</TT>)
(<TT>ACTS_USNO</TT>)
<BR><A HREF=driver5.htm>Type 25</A> * TrueTime generic receivers
<BR><A HREF=driver26.htm>Type 26</A> Hewlett Packard 58503A GPS
-Receiver
-(<TT>GPS_HP</TT>)
+Receiver (<TT>GPS_HP</TT>)
<BR><A HREF=driver27.htm>Type 27</A> Arcron MSF Receiver
(<TT>MSF_ARCRON</TT>)
-<BR><A HREF=driver28.htm>Type 28</A> Shared memory driver
+<BR><A HREF=driver28.htm>Type 28</A> Shared Memory Driver
(<TT>SHM</TT>)
-<BR><A HREF=driver29.htm>Type 29</A> Trimble Navigation Palisade GPS (<TT>GPS_PALISADE</TT>)
-<BR><A HREF=driver30.htm>Type 30 Motorola UT Oncore GPS
+<BR><A HREF=driver29.htm>Type 29</A> Trimble Navigation Palisade GPS
+(<TT>GPS_PALISADE</TT>)
+<BR><A HREF=driver30.htm>Type 30</A> Motorola UT Oncore GPS
(<TT>GPS_ONCORE</TT>)
<BR>Type 31 Rockwell Jupiter GPS (<TT>GPS_JUPITER</TT>)
-<BR><A HREF=driver34.htm>Type 34</A> Ultralink WWVB receivers
+<BR><A HREF=driver34.htm>Type 34</A> Ultralink WWVB Receivers
+<BR><A HREF=driver35.htm>Type 35</A> Conrad Parallel Port Radio Clock
+(<TT>PCF</TT>)
+<BR><A HREF=driver36.htm>Type 36</A> Radio WWV/H Audio
+Demodulator/Decoder(<TT>WWV</TT>)
+<BR><A HREF=driver37.htm>Type 37</A> Forum Graphic GPS Dating station
+(<TT>FG</TT>)
<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 reassigned
-in future.
-
+Types 15 and 25 will be retained only for a limited time and may be
+reassigned in future.
<P>Additional Information
-
<P><A HREF=prefer.htm>Mitigation Rules and the <TT>prefer</TT>
Keyword</A>
<BR><A HREF=rdebug.htm>Debugging Hints for Reference Clock Drivers</A>
<BR><A HREF=ldisc.htm>Line Disciplines and Streams Drivers</A>
+<BR><A HREF=audio.htm>Reference Clock Audio Drivers</A>
<BR><A HREF=pps.htm>Pulse-per-second (PPS) Signal Interfacing</A>
<BR><A HREF=howto.htm>How To Write a Reference Clock Driver</A>
<BR><A HREF=index.htm>The Network Time Protocol (NTP)
diff --git a/contrib/ntp/html/tickadj.htm b/contrib/ntp/html/tickadj.htm
index 7d3a863e5669..7dc11c0cfddb 100644
--- a/contrib/ntp/html/tickadj.htm
+++ b/contrib/ntp/html/tickadj.htm
@@ -25,6 +25,10 @@ call, and <TT>dosynctodr</TT>, which indicates to the kernels on some machines
whether they should internally adjust the system clock to keep it in line
with time-of-day clock or not.
+<P>We have a report that says starting with Solaris 2.6 we should
+leave <I>dosynctodr</I> alone.
+<A HREF="solaris-dosynctodr.html">Here is the report</A>.
+
<P>By default, with no arguments, <TT>tickadj</TT> reads the variables
of interest in the kernel and displays them. At the same time, it determines
an "optimal" value for the value of the <TT>tickadj</TT> variable if the
diff --git a/contrib/ntp/include/Makefile.am b/contrib/ntp/include/Makefile.am
index 1f80c16cf4fb..d7f28f6155ab 100644
--- a/contrib/ntp/include/Makefile.am
+++ b/contrib/ntp/include/Makefile.am
@@ -6,9 +6,11 @@ ETAGS_ARGS = $(srcdir)/Makefile.am
noinst_HEADERS = \
adjtime.h \
ascii.h \
+ audio.h \
binio.h \
global.h \
gps.h \
+ icom.h \
ieee754io.h \
iosignal.h \
l_stdlib.h \
diff --git a/contrib/ntp/include/Makefile.in b/contrib/ntp/include/Makefile.in
index 0453bf4f00ea..c1557c0604a3 100644
--- a/contrib/ntp/include/Makefile.in
+++ b/contrib/ntp/include/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
@@ -104,9 +108,11 @@ ETAGS_ARGS = $(srcdir)/Makefile.am
noinst_HEADERS = \
adjtime.h \
ascii.h \
+ audio.h \
binio.h \
global.h \
gps.h \
+ icom.h \
ieee754io.h \
iosignal.h \
l_stdlib.h \
@@ -156,32 +162,36 @@ GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps include/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -198,7 +208,7 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
@@ -240,6 +250,7 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-am
diff --git a/contrib/ntp/include/audio.h b/contrib/ntp/include/audio.h
new file mode 100644
index 000000000000..284411c20d50
--- /dev/null
+++ b/contrib/ntp/include/audio.h
@@ -0,0 +1,13 @@
+/*
+ * Header file for audio drivers
+ */
+#include "ntp_types.h"
+
+#define AUDIO_BUFSIZ 160 /* codec buffer size (Solaris only) */
+
+/*
+ * Function prototypes
+ */
+int audio_init P((void));
+int audio_gain P((int, int));
+void audio_show P((void));
diff --git a/contrib/ntp/include/icom.h b/contrib/ntp/include/icom.h
new file mode 100755
index 000000000000..aac62c8d3de4
--- /dev/null
+++ b/contrib/ntp/include/icom.h
@@ -0,0 +1,87 @@
+/*
+ * Header file for ICOM radios
+ */
+#include "ntp_types.h"
+
+/*
+ * Common definitions
+ */
+#define P_ERMSG 0x1 /* trace bus error messages */
+#define P_TRACE 0x2 /* trace CI-V messges */
+#define RETRY 3 /* max packet retries */
+#define IBAUD B1200 /* autotune port speed */
+
+/*
+ * Radio identifier codes
+ */
+#define IC1271 0x24
+#define IC1275 0x18
+#define IC271 0x20
+#define IC275 0x10
+#define IC375 0x12
+#define IC471 0x22
+#define IC475 0x14
+#define IC575 0x16
+#define IC725 0x28
+#define IC726 0x30
+#define IC735 0x04
+#define IC751 0x1c
+#define IC761 0x1e
+#define IC765 0x2c
+#define IC775 0x46
+#define IC781 0x26
+#define IC970 0x2e
+#define R7000 0x08
+#define R71 0x1a
+#define R7100 0x34
+#define R72 0x32
+#define R8500 0x4a
+#define R9000 0x2a
+
+/*
+ * CI-V frame codes
+ */
+#define PR 0xfe /* preamble */
+#define TX 0xe0 /* controller address */
+#define FI 0xfd /* end of message */
+#define ACK 0xfb /* controller normal reply */
+#define NAK 0xfa /* controller error reply */
+#define PAD 0xff /* transmit padding */
+
+/*
+ * CI-V controller commands
+ */
+#define V_FREQT 0x00 /* freq set (transceive) */
+#define V_MODET 0x01 /* set mode (transceive) */
+#define V_RBAND 0x02 /* read band edge */
+#define V_RFREQ 0x03 /* read frequency */
+#define V_RMODE 0x04 /* read mode */
+#define V_SFREQ 0x05 /* set frequency */
+#define V_SMODE 0x06 /* set mode */
+#define V_SVFO 0x07 /* select vfo */
+#define V_SMEM 0x08 /* select channel/bank */
+#define V_WRITE 0x09 /* write channel */
+#define V_VFOM 0x0a /* memory -> vfo */
+#define V_CLEAR 0x0b /* clear channel */
+#define V_ROFFS 0x0c /* read tx offset */
+#define V_SOFFS 0x0d /* write tx offset */
+#define V_SCAN 0x0e /* scan control */
+#define V_SPLIT 0x0f /* split control */
+#define V_DIAL 0x10 /* set dial tuning step */
+#define V_ATTEN 0x11 /* set attenuator */
+#define V_SANT 0x12 /* select antenna */
+#define V_ANNC 0x13 /* announce control */
+#define V_WRCTL 0x14 /* write controls */
+#define V_RDCTL 0x15 /* read controls */
+#define V_TOGL 0x16 /* set switches */
+#define V_ASCII 0x17 /* send CW message */
+#define V_POWER 0x18 /* power control */
+#define V_RDID 0x19 /* read model ID */
+#define V_SETW 0x1a /* read/write channel/bank data */
+#define V_CTRL 0x7f /* miscellaneous control */
+
+/*
+ * Function prototypes
+ */
+int icom_init P((char *, int, int));
+int icom_freq P((int, int, double));
diff --git a/contrib/ntp/include/l_stdlib.h b/contrib/ntp/include/l_stdlib.h
index fdabe67163f7..949cf8ff4ad7 100644
--- a/contrib/ntp/include/l_stdlib.h
+++ b/contrib/ntp/include/l_stdlib.h
@@ -169,6 +169,10 @@ extern int vsprintf P((char *, const char *, ...));
extern int stime P((const time_t *));
#endif
+#ifdef DECL_STIME_1
+extern int stime P((long *));
+#endif
+
#ifdef DECL_STRERROR_0
extern char * strerror P((int errnum));
#endif
diff --git a/contrib/ntp/include/ntp.h b/contrib/ntp/include/ntp.h
index 790e0a5e0aca..f4d01de5df7a 100644
--- a/contrib/ntp/include/ntp.h
+++ b/contrib/ntp/include/ntp.h
@@ -343,10 +343,10 @@ struct peer {
#define REFCLK_LOCALCLOCK 1 /* external (e.g., lockclock) */
#define REFCLK_GPS_TRAK 2 /* TRAK 8810 GPS Receiver */
#define REFCLK_WWV_PST 3 /* PST/Traconex 1020 WWV/H */
-#define REFCLK_WWVB_SPECTRACOM 4 /* Spectracom 8170/Netclock WWVB */
+#define REFCLK_SPECTRACOM 4 /* Spectracom (generic) Receivers */
#define REFCLK_TRUETIME 5 /* TrueTime (generic) Receivers */
-#define REFCLK_IRIG_AUDIO 6 /* IRIG-B audio decoder */
-#define REFCLK_CHU 7 /* scratchbuilt CHU (Canada) */
+#define REFCLK_IRIG_AUDIO 6 /* IRIG-B/W audio decoder */
+#define REFCLK_CHU_AUDIO 7 /* CHU audio demodulator/decoder */
#define REFCLK_PARSE 8 /* generic driver (usually DCF77,GPS,MSF) */
#define REFCLK_GPS_MX4200 9 /* Magnavox MX4200 GPS */
#define REFCLK_GPS_AS2201 10 /* Austron 2201A GPS */
@@ -373,7 +373,10 @@ struct peer {
#define REFCLK_CHRONOLOG 32 /* Chrono-log K WWVB receiver */
#define REFCLK_DUMBCLOCK 33 /* Dumb localtime clock */
#define REFCLK_ULINK 34 /* Ultralink M320 WWVB receiver */
-#define REFCLK_MAX 34 /* Grow as needed... */
+#define REFCLK_PCF 35 /* Conrad parallel port radio clock */
+#define REFCLK_WWV_AUDIO 36 /* WWV/H audio demodulator/decoder */
+#define REFCLK_FG 37 /* Forum Graphic GPS */
+#define REFCLK_MAX 37 /* Grow as needed... */
/*
* We tell reference clocks from real peers by giving the reference
diff --git a/contrib/ntp/include/ntp_refclock.h b/contrib/ntp/include/ntp_refclock.h
index ad278a3c5576..fd1d0801d98e 100644
--- a/contrib/ntp/include/ntp_refclock.h
+++ b/contrib/ntp/include/ntp_refclock.h
@@ -165,8 +165,8 @@ struct refclockbug {
#define LDISC_CLK 0x1 /* tty_clk \n intercept */
#define LDISC_CLKPPS 0x2 /* tty_clk \377 intercept */
#define LDISC_ACTS 0x4 /* tty_clk #* intercept */
-#define LDISC_CHU 0x8 /* tty_chu */
-#define LDISC_PPS 0x10 /* ppsclock */
+#define LDISC_CHU 0x8 /* depredated */
+#define LDISC_PPS 0x10 /* ppsclock, ppsapi */
#define LDISC_RAW 0x20 /* raw binary */
struct refclockproc {
diff --git a/contrib/ntp/kernel/Makefile.in b/contrib/ntp/kernel/Makefile.in
index 1a4d1ed96071..d3836b0b203e 100644
--- a/contrib/ntp/kernel/Makefile.in
+++ b/contrib/ntp/kernel/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
@@ -115,9 +119,9 @@ GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps kernel/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu kernel/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -179,15 +183,17 @@ tags-recursive:
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -195,12 +201,14 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -217,7 +225,7 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
@@ -229,7 +237,6 @@ distdir: $(DISTFILES)
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
- chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
@@ -270,6 +277,7 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-recursive
diff --git a/contrib/ntp/kernel/sys/Makefile.in b/contrib/ntp/kernel/sys/Makefile.in
index 530f3861f876..7bd669f2f62b 100644
--- a/contrib/ntp/kernel/sys/Makefile.in
+++ b/contrib/ntp/kernel/sys/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../../util/ansi2knr no-dependencies
@@ -121,32 +125,36 @@ GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps kernel/sys/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu kernel/sys/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -163,7 +171,7 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
@@ -205,6 +213,7 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-am
diff --git a/contrib/ntp/libntp/Makefile.am b/contrib/ntp/libntp/Makefile.am
index 9ba3c097d914..c984c89b6107 100644
--- a/contrib/ntp/libntp/Makefile.am
+++ b/contrib/ntp/libntp/Makefile.am
@@ -7,11 +7,12 @@ libntp_a_SOURCES = a_md5encrypt.c adjtime.c atoint.c atolfp.c atouint.c \
clocktime.c clocktypes.c decodenetnum.c dofptoa.c dolfptoa.c \
emalloc.c findconfig.c fptoa.c fptoms.c getopt.c hextoint.c \
hextolfp.c humandate.c inttoa.c lib_strbuf.c machines.c md5c.c \
- memmove.c mexit.c mfptoa.c mfptoms.c modetoa.c mstolfp.c msutotsf.c \
+ memmove.c mfptoa.c mfptoms.c modetoa.c mstolfp.c msutotsf.c \
msyslog.c netof.c numtoa.c numtohost.c octtoint.c prettydate.c \
ranny.c refnumtoa.c statestr.c syssignal.c systime.c tsftomsu.c \
tstotv.c tvtoa.c tvtots.c uglydate.c uinttoa.c utvtoa.c ymd2yd.c \
- mfp_mul.c binio.c ieee754io.c gpstolfp.c recvbuff.c iosignal.c
+ mfp_mul.c binio.c ieee754io.c gpstolfp.c recvbuff.c iosignal.c \
+ icom.c audio.c
libntp_a_LIBADD = @LIBOBJS@
libntp_a_DEPENDENCIES = @LIBOBJS@
INCLUDES = -I$(top_srcdir)/include
diff --git a/contrib/ntp/libntp/Makefile.in b/contrib/ntp/libntp/Makefile.in
index 53eda6771c6f..c89e8f9038bf 100644
--- a/contrib/ntp/libntp/Makefile.in
+++ b/contrib/ntp/libntp/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies
@@ -105,11 +109,12 @@ libntp_a_SOURCES = a_md5encrypt.c adjtime.c atoint.c atolfp.c atouint.c \
clocktime.c clocktypes.c decodenetnum.c dofptoa.c dolfptoa.c \
emalloc.c findconfig.c fptoa.c fptoms.c getopt.c hextoint.c \
hextolfp.c humandate.c inttoa.c lib_strbuf.c machines.c md5c.c \
- memmove.c mexit.c mfptoa.c mfptoms.c modetoa.c mstolfp.c msutotsf.c \
+ memmove.c mfptoa.c mfptoms.c modetoa.c mstolfp.c msutotsf.c \
msyslog.c netof.c numtoa.c numtohost.c octtoint.c prettydate.c \
ranny.c refnumtoa.c statestr.c syssignal.c systime.c tsftomsu.c \
tstotv.c tvtoa.c tvtots.c uglydate.c uinttoa.c utvtoa.c ymd2yd.c \
- mfp_mul.c binio.c ieee754io.c gpstolfp.c recvbuff.c iosignal.c
+ mfp_mul.c binio.c ieee754io.c gpstolfp.c recvbuff.c iosignal.c \
+ icom.c audio.c
libntp_a_LIBADD = @LIBOBJS@
libntp_a_DEPENDENCIES = @LIBOBJS@
@@ -130,6 +135,7 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LIBS = @LIBS@
ANSI2KNR = ../util/ansi2knr
+libntp_a_AR = $(AR) cru
am_libntp_a_OBJECTS = a_md5encrypt$U.o adjtime$U.o atoint$U.o \
atolfp$U.o atouint$U.o authencrypt$U.o authkeys$U.o authparity$U.o \
authreadkeys$U.o authusekey$U.o buftvtots$U.o caljulian$U.o \
@@ -137,12 +143,12 @@ calleapwhen$U.o caltontp$U.o calyearstart$U.o clocktime$U.o \
clocktypes$U.o decodenetnum$U.o dofptoa$U.o dolfptoa$U.o emalloc$U.o \
findconfig$U.o fptoa$U.o fptoms$U.o getopt$U.o hextoint$U.o \
hextolfp$U.o humandate$U.o inttoa$U.o lib_strbuf$U.o machines$U.o \
-md5c$U.o memmove$U.o mexit$U.o mfptoa$U.o mfptoms$U.o modetoa$U.o \
-mstolfp$U.o msutotsf$U.o msyslog$U.o netof$U.o numtoa$U.o numtohost$U.o \
+md5c$U.o memmove$U.o mfptoa$U.o mfptoms$U.o modetoa$U.o mstolfp$U.o \
+msutotsf$U.o msyslog$U.o netof$U.o numtoa$U.o numtohost$U.o \
octtoint$U.o prettydate$U.o ranny$U.o refnumtoa$U.o statestr$U.o \
syssignal$U.o systime$U.o tsftomsu$U.o tstotv$U.o tvtoa$U.o tvtots$U.o \
uglydate$U.o uinttoa$U.o utvtoa$U.o ymd2yd$U.o mfp_mul$U.o binio$U.o \
-ieee754io$U.o gpstolfp$U.o recvbuff$U.o iosignal$U.o
+ieee754io$U.o gpstolfp$U.o recvbuff$U.o iosignal$U.o icom$U.o audio$U.o
libntp_a_OBJECTS = $(am_libntp_a_OBJECTS)
AR = ar
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -158,6 +164,32 @@ strerror.c
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/a_md5encrypt$U.Po $(DEPDIR)/adjtime$U.Po \
+$(DEPDIR)/atoint$U.Po $(DEPDIR)/atolfp$U.Po $(DEPDIR)/atouint$U.Po \
+$(DEPDIR)/audio$U.Po $(DEPDIR)/authencrypt$U.Po $(DEPDIR)/authkeys$U.Po \
+$(DEPDIR)/authparity$U.Po $(DEPDIR)/authreadkeys$U.Po \
+$(DEPDIR)/authusekey$U.Po $(DEPDIR)/binio$U.Po $(DEPDIR)/buftvtots$U.Po \
+$(DEPDIR)/caljulian$U.Po $(DEPDIR)/calleapwhen$U.Po \
+$(DEPDIR)/caltontp$U.Po $(DEPDIR)/calyearstart$U.Po \
+$(DEPDIR)/clocktime$U.Po $(DEPDIR)/clocktypes$U.Po \
+$(DEPDIR)/decodenetnum$U.Po $(DEPDIR)/dofptoa$U.Po \
+$(DEPDIR)/dolfptoa$U.Po $(DEPDIR)/emalloc$U.Po \
+$(DEPDIR)/findconfig$U.Po $(DEPDIR)/fptoa$U.Po $(DEPDIR)/fptoms$U.Po \
+$(DEPDIR)/getopt$U.Po $(DEPDIR)/gpstolfp$U.Po $(DEPDIR)/hextoint$U.Po \
+$(DEPDIR)/hextolfp$U.Po $(DEPDIR)/humandate$U.Po $(DEPDIR)/icom$U.Po \
+$(DEPDIR)/ieee754io$U.Po $(DEPDIR)/inttoa$U.Po $(DEPDIR)/iosignal$U.Po \
+$(DEPDIR)/lib_strbuf$U.Po $(DEPDIR)/machines$U.Po $(DEPDIR)/md5c$U.Po \
+$(DEPDIR)/memmove$U.Po $(DEPDIR)/mfp_mul$U.Po $(DEPDIR)/mfptoa$U.Po \
+$(DEPDIR)/mfptoms$U.Po $(DEPDIR)/mktime.Po $(DEPDIR)/modetoa$U.Po \
+$(DEPDIR)/mstolfp$U.Po $(DEPDIR)/msutotsf$U.Po $(DEPDIR)/msyslog$U.Po \
+$(DEPDIR)/netof$U.Po $(DEPDIR)/numtoa$U.Po $(DEPDIR)/numtohost$U.Po \
+$(DEPDIR)/octtoint$U.Po $(DEPDIR)/prettydate$U.Po $(DEPDIR)/ranny$U.Po \
+$(DEPDIR)/recvbuff$U.Po $(DEPDIR)/refnumtoa$U.Po \
+$(DEPDIR)/statestr$U.Po $(DEPDIR)/strerror.Po $(DEPDIR)/syssignal$U.Po \
+$(DEPDIR)/systime$U.Po $(DEPDIR)/tsftomsu$U.Po $(DEPDIR)/tstotv$U.Po \
+$(DEPDIR)/tvtoa$U.Po $(DEPDIR)/tvtots$U.Po $(DEPDIR)/uglydate$U.Po \
+$(DEPDIR)/uinttoa$U.Po $(DEPDIR)/utvtoa$U.Po $(DEPDIR)/ymd2yd$U.Po
SOURCES = $(libntp_a_SOURCES)
OBJECTS = $(am_libntp_a_OBJECTS)
@@ -165,9 +197,9 @@ all: all-redirect
.SUFFIXES:
.SUFFIXES: .c .o
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps libntp/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu libntp/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -181,9 +213,6 @@ distclean-noinstLIBRARIES:
maintainer-clean-noinstLIBRARIES:
-.c.o:
- $(COMPILE) -c $<
-
mostlyclean-compile:
-rm -f *.o core *.core
@@ -208,74 +237,10 @@ clean-kr:
distclean-kr:
maintainer-clean-kr:
-a_md5encrypt$U.o:
-adjtime$U.o:
-atoint$U.o:
-atolfp$U.o:
-atouint$U.o:
-authencrypt$U.o:
-authkeys$U.o:
-authparity$U.o:
-authreadkeys$U.o:
-authusekey$U.o:
-buftvtots$U.o:
-caljulian$U.o:
-calleapwhen$U.o:
-caltontp$U.o:
-calyearstart$U.o:
-clocktime$U.o:
-clocktypes$U.o:
-decodenetnum$U.o:
-dofptoa$U.o:
-dolfptoa$U.o:
-emalloc$U.o:
-findconfig$U.o:
-fptoa$U.o:
-fptoms$U.o:
-getopt$U.o:
-hextoint$U.o:
-hextolfp$U.o:
-humandate$U.o:
-inttoa$U.o:
-lib_strbuf$U.o:
-machines$U.o:
-md5c$U.o:
-memmove$U.o:
-mexit$U.o:
-mfptoa$U.o:
-mfptoms$U.o:
-modetoa$U.o:
-mstolfp$U.o:
-msutotsf$U.o:
-msyslog$U.o:
-netof$U.o:
-numtoa$U.o:
-numtohost$U.o:
-octtoint$U.o:
-prettydate$U.o:
-ranny$U.o:
-refnumtoa$U.o:
-statestr$U.o:
-syssignal$U.o:
-systime$U.o:
-tsftomsu$U.o:
-tstotv$U.o:
-tvtoa$U.o:
-tvtots$U.o:
-uglydate$U.o:
-uinttoa$U.o:
-utvtoa$U.o:
-ymd2yd$U.o:
-mfp_mul$U.o:
-binio$U.o:
-ieee754io$U.o:
-gpstolfp$U.o:
-recvbuff$U.o:
-iosignal$U.o:
libntp.a: $(libntp_a_OBJECTS) $(libntp_a_DEPENDENCIES)
-rm -f libntp.a
- $(AR) cru libntp.a $(libntp_a_OBJECTS) $(libntp_a_LIBADD)
+ $(libntp_a_AR) libntp.a $(libntp_a_OBJECTS) $(libntp_a_LIBADD)
$(RANLIB) libntp.a
a_md5encrypt_.c: a_md5encrypt.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/a_md5encrypt.c; then echo $(srcdir)/a_md5encrypt.c; else echo a_md5encrypt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > a_md5encrypt_.c
@@ -287,6 +252,8 @@ atolfp_.c: atolfp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/atolfp.c; then echo $(srcdir)/atolfp.c; else echo atolfp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > atolfp_.c
atouint_.c: atouint.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/atouint.c; then echo $(srcdir)/atouint.c; else echo atouint.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > atouint_.c
+audio_.c: audio.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/audio.c; then echo $(srcdir)/audio.c; else echo audio.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > audio_.c
authencrypt_.c: authencrypt.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/authencrypt.c; then echo $(srcdir)/authencrypt.c; else echo authencrypt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > authencrypt_.c
authkeys_.c: authkeys.c $(ANSI2KNR)
@@ -337,6 +304,8 @@ hextolfp_.c: hextolfp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/hextolfp.c; then echo $(srcdir)/hextolfp.c; else echo hextolfp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > hextolfp_.c
humandate_.c: humandate.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/humandate.c; then echo $(srcdir)/humandate.c; else echo humandate.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > humandate_.c
+icom_.c: icom.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/icom.c; then echo $(srcdir)/icom.c; else echo icom.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > icom_.c
ieee754io_.c: ieee754io.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ieee754io.c; then echo $(srcdir)/ieee754io.c; else echo ieee754io.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ieee754io_.c
inttoa_.c: inttoa.c $(ANSI2KNR)
@@ -351,8 +320,6 @@ md5c_.c: md5c.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/md5c.c; then echo $(srcdir)/md5c.c; else echo md5c.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > md5c_.c
memmove_.c: memmove.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memmove.c; then echo $(srcdir)/memmove.c; else echo memmove.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memmove_.c
-mexit_.c: mexit.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mexit.c; then echo $(srcdir)/mexit.c; else echo mexit.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mexit_.c
mfp_mul_.c: mfp_mul.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mfp_mul.c; then echo $(srcdir)/mfp_mul.c; else echo mfp_mul.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > mfp_mul_.c
mfptoa_.c: mfptoa.c $(ANSI2KNR)
@@ -409,13 +376,13 @@ utvtoa_.c: utvtoa.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/utvtoa.c; then echo $(srcdir)/utvtoa.c; else echo utvtoa.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > utvtoa_.c
ymd2yd_.c: ymd2yd.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ymd2yd.c; then echo $(srcdir)/ymd2yd.c; else echo ymd2yd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ymd2yd_.c
-a_md5encrypt_.o adjtime_.o atoint_.o atolfp_.o atouint_.o \
+a_md5encrypt_.o adjtime_.o atoint_.o atolfp_.o atouint_.o audio_.o \
authencrypt_.o authkeys_.o authparity_.o authreadkeys_.o authusekey_.o \
binio_.o buftvtots_.o caljulian_.o calleapwhen_.o caltontp_.o \
calyearstart_.o clocktime_.o clocktypes_.o decodenetnum_.o dofptoa_.o \
dolfptoa_.o emalloc_.o findconfig_.o fptoa_.o fptoms_.o getopt_.o \
-gpstolfp_.o hextoint_.o hextolfp_.o humandate_.o ieee754io_.o inttoa_.o \
-iosignal_.o lib_strbuf_.o machines_.o md5c_.o memmove_.o mexit_.o \
+gpstolfp_.o hextoint_.o hextolfp_.o humandate_.o icom_.o ieee754io_.o \
+inttoa_.o iosignal_.o lib_strbuf_.o machines_.o md5c_.o memmove_.o \
mfp_mul_.o mfptoa_.o mfptoms_.o mktime_.o modetoa_.o mstolfp_.o \
msutotsf_.o msyslog_.o netof_.o numtoa_.o numtohost_.o octtoint_.o \
prettydate_.o ranny_.o recvbuff_.o refnumtoa_.o statestr_.o strerror_.o \
@@ -424,23 +391,27 @@ uglydate_.o uinttoa_.o utvtoa_.o ymd2yd_.o : $(ANSI2KNR)
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -457,258 +428,98 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
-a_md5encrypt.o: a_md5encrypt.c ../include/ntp_machine.h ../config.h \
- ../include/ntp_proto.h ../include/ntp_types.h \
- ../include/ntp_fp.h ../include/ntp_string.h ../include/global.h \
- ../include/md5.h ../include/ntp_stdlib.h ../include/l_stdlib.h
-adjtime.o: adjtime.c ../config.h
-atoint.o: atoint.c ../include/ntp_types.h ../include/ntp_machine.h \
- ../config.h ../include/ntp_proto.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-atolfp.o: atolfp.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_string.h
-atouint.o: atouint.c ../include/ntp_types.h ../include/ntp_machine.h \
- ../config.h ../include/ntp_proto.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-authencrypt.o: authencrypt.c ../include/ntp_machine.h ../config.h \
- ../include/ntp_proto.h
-authkeys.o: authkeys.c ../config.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../include/ntp_proto.h \
- ../include/ntp_fp.h ../include/ntp.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_string.h \
- ../include/ntp_stdlib.h ../include/l_stdlib.h
-authparity.o: authparity.c ../include/ntp_stdlib.h \
- ../include/ntp_types.h ../include/ntp_machine.h ../config.h \
- ../include/ntp_proto.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-authreadkeys.o: authreadkeys.c ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h ../config.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h \
- ../include/ntp_syslog.h
-authusekey.o: authusekey.c ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_string.h ../include/ntp_stdlib.h \
- ../include/l_stdlib.h
-binio.o: binio.c ../include/binio.h ../include/ntp_stdlib.h \
- ../include/ntp_types.h ../include/ntp_machine.h ../config.h \
- ../include/ntp_proto.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-buftvtots.o: buftvtots.c ../config.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp_unixtime.h
-caljulian.o: caljulian.c ../include/ntp_types.h ../include/ntp_machine.h \
- ../config.h ../include/ntp_proto.h ../include/ntp_calendar.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-calleapwhen.o: calleapwhen.c ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_calendar.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-caltontp.o: caltontp.c ../include/ntp_types.h ../include/ntp_machine.h \
- ../config.h ../include/ntp_proto.h ../include/ntp_calendar.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-calyearstart.o: calyearstart.c ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_calendar.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-clocktime.o: clocktime.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_unixtime.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-clocktypes.o: clocktypes.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp.h lib_strbuf.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-decodenetnum.o: decodenetnum.c ../include/ntp_stdlib.h \
- ../include/ntp_types.h ../include/ntp_machine.h ../config.h \
- ../include/ntp_proto.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-desc.o: desc.c ../include/global.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/rsaref.h ../include/md2.h ../include/md5.h \
- ../include/des.h
-dofptoa.o: dofptoa.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- lib_strbuf.h ../include/ntp_string.h ../include/ntp_stdlib.h \
- ../include/l_stdlib.h
-dolfptoa.o: dolfptoa.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- lib_strbuf.h ../include/ntp_string.h ../include/ntp_stdlib.h \
- ../include/l_stdlib.h
-emalloc.o: emalloc.c ../include/ntp_types.h ../include/ntp_machine.h \
- ../config.h ../include/ntp_proto.h ../include/ntp_malloc.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h ../include/ntp_syslog.h
-findconfig.o: findconfig.c ../config.h ../include/ntp_stdlib.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-fptoa.o: fptoa.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-fptoms.o: fptoms.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h
-getopt.o: getopt.c ../include/ntp_stdlib.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-gpstolfp.o: gpstolfp.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h
-hextoint.o: hextoint.c ../include/ntp_stdlib.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-hextolfp.o: hextolfp.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_string.h ../include/ntp_stdlib.h \
- ../include/l_stdlib.h
-humandate.o: humandate.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_unixtime.h lib_strbuf.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-ieee754io.o: ieee754io.c ../config.h ../include/l_stdlib.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/ntp_fp.h \
- ../include/ieee754io.h
-inttoa.o: inttoa.c lib_strbuf.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-iosignal.o: iosignal.c ../config.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h ../include/ntp_if.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h ../include/iosignal.h
-lib_strbuf.o: lib_strbuf.c lib_strbuf.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h
-machines.o: machines.c ../config.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp_syslog.h \
- ../include/ntp_stdlib.h ../include/ntp_types.h \
- ../include/ntp_string.h ../include/l_stdlib.h \
- ../include/ntp_unixtime.h
-md5c.o: md5c.c ../include/global.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/md5.h
-memmove.o: memmove.c ../config.h
-mexit.o: mexit.c
-mfp_mul.o: mfp_mul.c ../include/ntp_stdlib.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_string.h ../include/l_stdlib.h \
- ../include/ntp_fp.h
-mfptoa.o: mfptoa.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-mfptoms.o: mfptoms.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-modetoa.o: modetoa.c lib_strbuf.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-mstolfp.o: mstolfp.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-msutotsf.o: msutotsf.c ../include/ntp_types.h ../include/ntp_machine.h \
- ../config.h ../include/ntp_proto.h
-msyslog.o: msyslog.c ../config.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../include/ntp_proto.h \
- ../include/ntp_string.h ../include/ntp_stdlib.h \
- ../include/l_stdlib.h ../include/ntp_syslog.h
-netof.o: netof.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-numtoa.o: numtoa.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- lib_strbuf.h ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-numtohost.o: numtohost.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h lib_strbuf.h
-octtoint.o: octtoint.c ../include/ntp_stdlib.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-prettydate.o: prettydate.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_unixtime.h lib_strbuf.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-ranny.o: ranny.c ../include/ntp_stdlib.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-recvbuff.o: recvbuff.c ../config.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h \
- ../include/ntp_syslog.h ../include/ntp_io.h \
- ../include/recvbuff.h ../include/ntp.h ../include/iosignal.h \
- ../include/ntp_refclock.h
-refnumtoa.o: refnumtoa.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- lib_strbuf.h ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-statestr.o: statestr.c ../config.h ../include/ntp_stdlib.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp_string.h \
- ../include/l_stdlib.h ../include/ntp_fp.h ../include/ntp.h \
- lib_strbuf.h ../include/ntp_refclock.h ../include/recvbuff.h \
- ../include/ntp_control.h
-syssignal.o: syssignal.c ../config.h ../include/ntp_syslog.h \
- ../include/ntp_stdlib.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../include/ntp_proto.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-systime.o: systime.c ../config.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_syslog.h \
- ../include/ntp_unixtime.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-tsftomsu.o: tsftomsu.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-tstotv.o: tstotv.c ../include/ntp_types.h ../include/ntp_machine.h \
- ../config.h ../include/ntp_proto.h
-tvtoa.o: tvtoa.c lib_strbuf.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h ../include/ntp_unixtime.h
-tvtots.o: tvtots.c ../include/ntp_types.h ../include/ntp_machine.h \
- ../config.h ../include/ntp_proto.h
-uglydate.o: uglydate.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_unixtime.h lib_strbuf.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-uinttoa.o: uinttoa.c lib_strbuf.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-utvtoa.o: utvtoa.c lib_strbuf.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h ../include/ntp_unixtime.h
-ymd2yd.o: ymd2yd.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_unixtime.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
+
+@AMDEP@include $(DEPDIR)/a_md5encrypt$U.Po
+@AMDEP@include $(DEPDIR)/adjtime$U.Po
+@AMDEP@include $(DEPDIR)/atoint$U.Po
+@AMDEP@include $(DEPDIR)/atolfp$U.Po
+@AMDEP@include $(DEPDIR)/atouint$U.Po
+@AMDEP@include $(DEPDIR)/audio$U.Po
+@AMDEP@include $(DEPDIR)/authencrypt$U.Po
+@AMDEP@include $(DEPDIR)/authkeys$U.Po
+@AMDEP@include $(DEPDIR)/authparity$U.Po
+@AMDEP@include $(DEPDIR)/authreadkeys$U.Po
+@AMDEP@include $(DEPDIR)/authusekey$U.Po
+@AMDEP@include $(DEPDIR)/binio$U.Po
+@AMDEP@include $(DEPDIR)/buftvtots$U.Po
+@AMDEP@include $(DEPDIR)/caljulian$U.Po
+@AMDEP@include $(DEPDIR)/calleapwhen$U.Po
+@AMDEP@include $(DEPDIR)/caltontp$U.Po
+@AMDEP@include $(DEPDIR)/calyearstart$U.Po
+@AMDEP@include $(DEPDIR)/clocktime$U.Po
+@AMDEP@include $(DEPDIR)/clocktypes$U.Po
+@AMDEP@include $(DEPDIR)/decodenetnum$U.Po
+@AMDEP@include $(DEPDIR)/dofptoa$U.Po
+@AMDEP@include $(DEPDIR)/dolfptoa$U.Po
+@AMDEP@include $(DEPDIR)/emalloc$U.Po
+@AMDEP@include $(DEPDIR)/findconfig$U.Po
+@AMDEP@include $(DEPDIR)/fptoa$U.Po
+@AMDEP@include $(DEPDIR)/fptoms$U.Po
+@AMDEP@include $(DEPDIR)/getopt$U.Po
+@AMDEP@include $(DEPDIR)/gpstolfp$U.Po
+@AMDEP@include $(DEPDIR)/hextoint$U.Po
+@AMDEP@include $(DEPDIR)/hextolfp$U.Po
+@AMDEP@include $(DEPDIR)/humandate$U.Po
+@AMDEP@include $(DEPDIR)/icom$U.Po
+@AMDEP@include $(DEPDIR)/ieee754io$U.Po
+@AMDEP@include $(DEPDIR)/inttoa$U.Po
+@AMDEP@include $(DEPDIR)/iosignal$U.Po
+@AMDEP@include $(DEPDIR)/lib_strbuf$U.Po
+@AMDEP@include $(DEPDIR)/machines$U.Po
+@AMDEP@include $(DEPDIR)/md5c$U.Po
+@AMDEP@include $(DEPDIR)/memmove$U.Po
+@AMDEP@include $(DEPDIR)/mfp_mul$U.Po
+@AMDEP@include $(DEPDIR)/mfptoa$U.Po
+@AMDEP@include $(DEPDIR)/mfptoms$U.Po
+@AMDEP@include $(DEPDIR)/mktime.Po
+@AMDEP@include $(DEPDIR)/modetoa$U.Po
+@AMDEP@include $(DEPDIR)/mstolfp$U.Po
+@AMDEP@include $(DEPDIR)/msutotsf$U.Po
+@AMDEP@include $(DEPDIR)/msyslog$U.Po
+@AMDEP@include $(DEPDIR)/netof$U.Po
+@AMDEP@include $(DEPDIR)/numtoa$U.Po
+@AMDEP@include $(DEPDIR)/numtohost$U.Po
+@AMDEP@include $(DEPDIR)/octtoint$U.Po
+@AMDEP@include $(DEPDIR)/prettydate$U.Po
+@AMDEP@include $(DEPDIR)/ranny$U.Po
+@AMDEP@include $(DEPDIR)/recvbuff$U.Po
+@AMDEP@include $(DEPDIR)/refnumtoa$U.Po
+@AMDEP@include $(DEPDIR)/statestr$U.Po
+@AMDEP@include $(DEPDIR)/strerror.Po
+@AMDEP@include $(DEPDIR)/syssignal$U.Po
+@AMDEP@include $(DEPDIR)/systime$U.Po
+@AMDEP@include $(DEPDIR)/tsftomsu$U.Po
+@AMDEP@include $(DEPDIR)/tstotv$U.Po
+@AMDEP@include $(DEPDIR)/tvtoa$U.Po
+@AMDEP@include $(DEPDIR)/tvtots$U.Po
+@AMDEP@include $(DEPDIR)/uglydate$U.Po
+@AMDEP@include $(DEPDIR)/uinttoa$U.Po
+@AMDEP@include $(DEPDIR)/utvtoa$U.Po
+@AMDEP@include $(DEPDIR)/ymd2yd$U.Po
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf $(DEPDIR)
+
+maintainer-clean-depend:
+
+@AMDEP@CCDEPMODE = @CCDEPMODE@
+
+.c.o:
+@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c -o $@ $<
info-am:
info: info-am
@@ -745,25 +556,28 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
- mostlyclean-kr mostlyclean-tags mostlyclean-generic
+ mostlyclean-kr mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-noinstLIBRARIES clean-compile clean-kr clean-tags \
- clean-generic mostlyclean-am
+ clean-depend clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-noinstLIBRARIES distclean-compile distclean-kr \
- distclean-tags distclean-generic clean-am
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-kr \
- maintainer-clean-tags maintainer-clean-generic \
- distclean-am
+ maintainer-clean-tags maintainer-clean-depend \
+ maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -774,8 +588,9 @@ clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \
-maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-exec-am install-exec \
+maintainer-clean-tags distdir mostlyclean-depend distclean-depend \
+clean-depend maintainer-clean-depend info-am info dvi-am dvi check \
+check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
diff --git a/contrib/ntp/libntp/audio.c b/contrib/ntp/libntp/audio.c
new file mode 100644
index 000000000000..3228bba62a46
--- /dev/null
+++ b/contrib/ntp/libntp/audio.c
@@ -0,0 +1,154 @@
+/*
+ * audio.c - audio interface for reference clock audio drivers
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "audio.h"
+#include <unistd.h>
+#include <stdio.h>
+
+#ifdef HAVE_SYS_AUDIOIO_H
+#include <sys/audioio.h>
+#endif /* HAVE_SYS_AUDIOIO_H */
+#ifdef HAVE_SUN_AUDIOIO_H
+#include <sun/audioio.h>
+#endif /* HAVE_SUN_AUDIOIO_H */
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif /* HAVE_SYS_IOCTL_H */
+
+#include <fcntl.h>
+
+/*
+ * Global variables
+ */
+#ifdef HAVE_SYS_AUDIOIO_H
+static struct audio_device device; /* audio device ident */
+static struct audio_info info; /* audio device info */
+static int ctl_fd; /* audio control file descriptor */
+#endif /* HAVE_SYS_AUDIOIO_H */
+
+
+/*
+ * audio_init - open and initialize audio device
+ *
+ * This code works with SunOS 4.x and Solaris 2.x; however, it is
+ * believed generic and applicable to other systems with a minor twid
+ * or two. All it does is open the device, set the buffer size (Solaris
+ * only), preset the gain and set the input port. It assumes that the
+ * codec sample rate (8000 Hz), precision (8 bits), number of channels
+ * (1) and encoding (ITU-T G.711 mu-law companded) have been set by
+ * default.
+ */
+int
+audio_init(void)
+{
+ int fd;
+#ifdef HAVE_SYS_AUDIOIO_H
+ int rval;
+#endif /* HAVE_SYS_AUDIOIO_H */
+
+ /*
+ * Open audio device
+ */
+ fd = open("/dev/audio", O_RDWR | O_NONBLOCK, 0777);
+ if (fd < 0) {
+ perror("audio:");
+ return (fd);
+ }
+
+#ifdef HAVE_SYS_AUDIOIO_H
+ /*
+ * Open audio control device
+ */
+ ctl_fd = open("/dev/audioctl", O_RDWR);
+ if (ctl_fd < 0) {
+ perror("audioctl:");
+ close(fd);
+ return(ctl_fd);
+ }
+
+ /*
+ * Set audio device parameters.
+ */
+ rval = audio_gain((AUDIO_MAX_GAIN - AUDIO_MIN_GAIN) / 2,
+ AUDIO_MICROPHONE);
+ if (rval < 0) {
+ close(ctl_fd);
+ close(fd);
+ return(rval);
+ }
+#endif /* HAVE_SYS_AUDIOIO_H */
+ return (fd);
+}
+
+
+/*
+ * audio_gain - adjust codec gain and port
+ */
+int
+audio_gain(
+ int gain, /* gain 0-255 */
+ int port /* port */
+ )
+{
+#ifdef HAVE_SYS_AUDIOIO_H
+ int rval;
+#endif /* HAVE_SYS_AUDIOIO_H */
+
+#ifdef HAVE_SYS_AUDIOIO_H
+ AUDIO_INITINFO(&info);
+ info.record.buffer_size = AUDIO_BUFSIZ;
+ info.record.gain = gain;
+ info.record.port = port;
+ info.record.error = 0;
+ rval = ioctl(ctl_fd, (int)AUDIO_SETINFO, &info);
+ if (rval < 0) {
+ perror("audio:");
+ return (rval);
+ }
+ return (info.record.error);
+#else
+ return (0);
+#endif /* HAVE_SYS_AUDIOIO_H */
+}
+
+
+/*
+ * audio_show - display audio parameters
+ *
+ * This code doesn't really do anything, except satisfy curiousity and
+ * verify the ioctl's work.
+ */
+void
+audio_show(void)
+{
+#ifdef HAVE_SYS_AUDIOIO_H
+ ioctl(ctl_fd, (int)AUDIO_GETDEV, &device);
+ printf("audio: name %s, version %s, config %s\n",
+ device.name, device.version, device.config);
+ ioctl(ctl_fd, (int)AUDIO_GETINFO, &info);
+ printf(
+ "audio: samples %d, channels %d, precision %d, encoding %d\n",
+ info.record.sample_rate, info.record.channels,
+ info.record.precision, info.record.encoding);
+ printf("audio: gain %d, port %d, buffer %d\n",
+ info.record.gain, info.record.port,
+ info.record.buffer_size);
+ printf("audio: gain %d, port %d\n",
+ info.record.gain, info.record.port);
+ printf(
+ "audio: samples %d, eof %d, pause %d, error %d, waiting %d, balance %d\n",
+ info.record.samples, info.record.eof,
+ info.record.pause, info.record.error,
+ info.record.waiting, info.record.balance);
+ printf("audio: monitor %d, muted %d\n",
+ info.monitor_gain, info.output_muted);
+#endif /* HAVE_SYS_AUDIOIO_H */
+#ifdef __NetBSD__
+ printf("audio: monitor %d, blocksize %d, hiwat %d, lowat %d, mode %d\n",
+ info.monitor_gain, info.blocksize, info.hiwat, info.lowat, info.mode);
+#endif /* __NetBSD__ */
+}
diff --git a/contrib/ntp/libntp/authkeys.c b/contrib/ntp/libntp/authkeys.c
index 39ca4938f3d4..578688bdf27c 100644
--- a/contrib/ntp/libntp/authkeys.c
+++ b/contrib/ntp/libntp/authkeys.c
@@ -193,7 +193,7 @@ auth_moremem(void)
struct savekey *sk;
int i;
- sk = (struct savekey *)malloc(MEMINC * sizeof(struct savekey));
+ sk = (struct savekey *)calloc(MEMINC, sizeof(struct savekey));
if (sk == 0)
return (0);
diff --git a/contrib/ntp/libntp/clocktypes.c b/contrib/ntp/libntp/clocktypes.c
index c9a67668aa6d..520dce43cd57 100644
--- a/contrib/ntp/libntp/clocktypes.c
+++ b/contrib/ntp/libntp/clocktypes.c
@@ -18,14 +18,14 @@ struct clktype clktypes[] = {
"GPS_TRAK" },
{ REFCLK_WWV_PST, "PSTI/Traconex WWV/WWVH Receiver (3)",
"WWV_PST" },
- { REFCLK_WWVB_SPECTRACOM, "Spectracom WWVB Receiver (4)",
- "WWVB_SPEC" },
+ { REFCLK_SPECTRACOM, "Spectracom (generic) Receivers (4)",
+ "SPECTRACOM" },
{ REFCLK_TRUETIME, "TrueTime (generic) Receivers (5)",
"TRUETIME" },
{ REFCLK_IRIG_AUDIO, "IRIG Audio Decoder (6)",
"IRIG_AUDIO" },
- { REFCLK_CHU, "Scratchbuilt CHU Receiver (7)",
- "CHU" },
+ { REFCLK_CHU_AUDIO, "CHU Audio Demodulator/Decoder (7)",
+ "CHU_AUDIO" },
{ REFCLK_PARSE, "Generic reference clock driver (8)",
"GENERIC" },
{ REFCLK_GPS_MX4200, "Magnavox MX4200 GPS Receiver (9)",
@@ -76,10 +76,16 @@ struct clktype clktypes[] = {
"GPS_JUPITER" },
{ REFCLK_CHRONOLOG, "Chrono-log K (32)",
"CHRONOLOG" },
- { REFCLK_DUMBCLOCK, "Dumb generic hh:mm:ss local clock",
+ { REFCLK_DUMBCLOCK, "Dumb generic hh:mm:ss local clock (33)",
"DUMBCLOCK" },
- { REFCLK_ULINK, "Ultralink M320 WWVB receiver",
+ { REFCLK_ULINK, "Ultralink M320 WWVB receiver (34)",
"ULINK_M320"},
+ { REFCLK_PCF, "Conrad parallel port radio clock (35)",
+ "PCF"},
+ { REFCLK_WWV_AUDIO, "WWV/H Audio Demodulator/Decoder (36)",
+ "WWV_AUDIO"},
+ { REFCLK_FG, "Forum Graphic GPS Dating Station (37)",
+ "GPS_FG"},
{ -1, "", "" }
};
diff --git a/contrib/ntp/libntp/icom.c b/contrib/ntp/libntp/icom.c
new file mode 100644
index 000000000000..4d6efc57f784
--- /dev/null
+++ b/contrib/ntp/libntp/icom.c
@@ -0,0 +1,329 @@
+/*
+ * Program to control ICOM radios
+ *
+ * This is a ripoff of the utility routines in the ICOM software
+ * distribution. The only function provided is to load the radio
+ * frequency. All other parameters must be manually set before use.
+ */
+#include "icom.h"
+#include <unistd.h>
+#include <stdio.h>
+
+#ifdef HAVE_TERMIOS_H
+# include <termios.h>
+#endif /* HAVE_TERMIOS_H */
+#ifdef HAVE_SYS_TERMIOS_H
+# include <sys/termios.h>
+#endif /* HAVE_SYS_TERMIOS_H */
+
+#include <fcntl.h>
+#include <errno.h>
+
+/*
+ * Scraps
+ */
+#define BMAX 50 /* max command length */
+#define DICOM /dev/icom/ /* ICOM port link */
+
+/*
+ * FSA definitions
+ */
+#define S_IDLE 0 /* idle */
+#define S_HDR 1 /* header */
+#define S_TX 2 /* address */
+#define S_DATA 3 /* data */
+#define S_ERROR 4 /* error */
+
+/*
+ * Local function prototypes
+ */
+static void doublefreq P((double, u_char *, int));
+static int sndpkt P((int, int, u_char *, u_char *));
+static int sndoctet P((int, int));
+static int rcvoctet P((int));
+
+/*
+ * Local variables
+ */
+static int flags; /* trace flags */
+static int state; /* fsa state */
+
+
+/*
+ * icom_freq(fd, ident, freq) - load radio frequency
+ */
+int
+icom_freq( /* returns 0 (ok), EIO (error) */
+ int fd, /* file descriptor */
+ int ident, /* ICOM radio identifier */
+ double freq /* frequency (MHz) */
+ )
+{
+ u_char cmd[BMAX], rsp[BMAX];
+ int temp;
+ cmd[0] = V_SFREQ;
+ if (ident == IC735)
+ temp = 4;
+ else
+ temp = 5;
+ doublefreq(freq * 1e6, &cmd[1], temp);
+ temp = sndpkt(fd, ident, cmd, rsp);
+ if (temp < 1 || rsp[0] != ACK)
+ return (EIO);
+ return (0);
+}
+
+
+/*
+ * doublefreq(freq, y, len) - double to ICOM frequency with padding
+ */
+static void
+doublefreq( /* returns void */
+ double freq, /* frequency */
+ u_char *x, /* radio frequency */
+ int len /* length (octets) */
+ )
+{
+ int i;
+ char s1[11];
+ char *y;
+
+ sprintf(s1, " %10.0f", freq);
+ y = s1 + 10;
+ i = 0;
+ while (*y != ' ') {
+ x[i] = *y-- & 0x0f;
+ x[i] = x[i] | ((*y-- & 0x0f) << 4);
+ i++;
+ }
+ for (; i < len; i++)
+ x[i] = 0;
+ x[i] = FI;
+}
+
+
+/*
+ * Packet routines
+ *
+ * These routines send a packet and receive the response. If an error
+ * (collision) occurs on transmit, the packet is resent. If an error
+ * occurs on receive (timeout), all input to the terminating FI is
+ * discarded and the packet is resent. If the maximum number of retries
+ * is not exceeded, the program returns the number of octets in the user
+ * buffer; otherwise, it returns zero.
+ *
+ * ICOM frame format
+ *
+ * Frames begin with a two-octet preamble PR-PR followyd by the
+ * transceiver address RE, controller address TX, control code CN, zero
+ * or more data octets DA (depending on command), and terminator FI.
+ * Since the bus is bidirectional, every octet output is echoed on
+ * input. Every valid frame sent is answered with a frame in the same
+ * format, but with the RE and TX fields interchanged. The CN field is
+ * set to NAK if an error has occurred. Otherwise, the data are returned
+ * in this and following DA octets. If no data are returned, the CN
+ * octet is set to ACK.
+ *
+ * +------+------+------+------+------+--//--+------+
+ * | PR | PR | RE | TX | CN | DA | FI |
+ * +------+------+------+------+------+--//--+------+
+ */
+/*
+ * icom_open() - open and initialize serial interface
+ *
+ * This routine opens the serial interface for raw transmission; that
+ * is, character-at-a-time, no stripping, checking or monkeying with the
+ * bits. For Unix, an input operation ends either with the receipt of a
+ * character or a 0.5-s timeout.
+ */
+int
+icom_init(
+ char *device, /* device name/link */
+ int speed, /* line speed */
+ int trace /* trace flags */ )
+{
+ struct termios ttyb;
+ int fd;
+
+ flags = trace;
+ fd = open(device, O_RDWR, 0777);
+ if (fd < 0)
+ return (fd);
+ tcgetattr(fd, &ttyb);
+ ttyb.c_iflag = 0; /* input modes */
+ ttyb.c_oflag = 0; /* output modes */
+ ttyb.c_cflag = IBAUD|CS8|CREAD|CLOCAL; /* control modes */
+ ttyb.c_lflag = 0; /* local modes */
+ ttyb.c_cc[VMIN] = 0; /* min chars */
+ ttyb.c_cc[VTIME] = 5; /* receive timeout */
+ cfsetispeed(&ttyb, (u_int)speed);
+ cfsetospeed(&ttyb, (u_int)speed);
+ tcsetattr(fd, TCSANOW, &ttyb);
+ return (fd);
+}
+
+
+/*
+ * sndpkt(r, x, y) - send packet and receive response
+ *
+ * This routine sends a command frame, which consists of all except the
+ * preamble octets PR-PR. It then listens for the response frame and
+ * returns the payload to the caller. The routine checks for correct
+ * response header format; that is, the length of the response vector
+ * returned to the caller must be at least 2 and the RE and TX octets
+ * must be interchanged; otherwise, the operation is retried up to
+ * the number of times specified in a global variable.
+ *
+ * The trace function, which is enabled by the P_TRACE bit of the global
+ * flags variable, prints all characters received or echoed on the bus
+ * preceded by a T (transmit) or R (receive). The P_ERMSG bit of the
+ * flags variable enables printing of bus error messages.
+ *
+ * Note that the first octet sent is a PAD in order to allow time for
+ * the radio to flush its receive buffer after sending the previous
+ * response. Even with this precaution, some of the older radios
+ * occasionally fail to receive a command and it has to be sent again.
+ */
+static int
+sndpkt( /* returns octet count */
+ int fd, /* file descriptor */
+ int r, /* radio address */
+ u_char *cmd, /* command vector */
+ u_char *rsp /* response vector */
+ )
+{
+ int i, j, temp;
+
+ (void)tcflush(fd, TCIOFLUSH);
+ for (i = 0; i < RETRY; i++) {
+ state = S_IDLE;
+
+ /*
+ * Transmit packet.
+ */
+ if (flags & P_TRACE)
+ printf("icom T:");
+ sndoctet(fd, PAD); /* send header */
+ sndoctet(fd, PR);
+ sndoctet(fd, PR);
+ sndoctet(fd, r);
+ sndoctet(fd, TX);
+ for (j = 0; j < BMAX; j++) { /* send body */
+ if (sndoctet(fd, cmd[j]) == FI)
+ break;
+ }
+ while (rcvoctet(fd) != FI); /* purge echos */
+ if (cmd[0] == V_FREQT || cmd[0] == V_MODET)
+ return (0); /* shortcut for broadcast */
+
+ /*
+ * Receive packet. First, delete all characters
+ * preceeding a PR, then discard all PRs. Check that the
+ * RE and TX fields are correctly interchanged, then
+ * copy the remaining data and FI to the user buffer.
+ */
+ if (flags & P_TRACE)
+ printf("\nicom R:");
+ j = 0;
+ while ((temp = rcvoctet(fd)) != FI) {
+ switch (state) {
+
+ case S_IDLE:
+ if (temp != PR)
+ continue;
+ state = S_HDR;
+ break;
+
+ case S_HDR:
+ if (temp == PR) {
+ continue;
+ } else if (temp != TX) {
+ if (flags & P_ERMSG)
+ printf(
+ "icom: TX error\n");
+ state = S_ERROR;
+ }
+ state = S_TX;
+ break;
+
+ case S_TX:
+ if (temp != r) {
+ if (flags & P_ERMSG)
+ printf(
+ "icom: RE error\n");
+ state = S_ERROR;
+ }
+ state = S_DATA;
+ break;
+
+ case S_DATA:
+ if (j >= BMAX ) {
+ if (flags & P_ERMSG)
+ printf(
+ "icom: buffer overrun\n");
+ state = S_ERROR;
+ j = 0;
+ }
+ rsp[j++] = (u_char)temp;
+ break;
+
+ case S_ERROR:
+ break;
+ }
+ }
+ if (flags & P_TRACE)
+ printf("\n");
+ if (j > 0) {
+ rsp[j++] = FI;
+ return (j);
+ }
+ }
+ if (flags & P_ERMSG)
+ printf("icom: retries exceeded\n");
+ return (0);
+}
+
+
+/*
+ * Interface routines
+ *
+ * These routines read and write octets on the bus. In case of receive
+ * timeout a FI code is returned. In case of output collision (echo
+ * does not match octet sent), the remainder of the collision frame
+ * (including the trailing FI) is discarded.
+ */
+/*
+ * sndoctet(fd, x) - send octet
+ */
+static int
+sndoctet( /* returns octet */
+ int fd, /* file descriptor */
+ int x /* octet */
+ )
+{
+ u_char y;
+
+ y = (u_char)x;
+ write(fd, &y, 1);
+ return (x);
+}
+
+
+/*
+ * rcvoctet(fd) - receive octet
+ */
+static int
+rcvoctet( /* returns octet */
+ int fd /* file descriptor */
+ )
+{
+ u_char y;
+
+ if (read(fd, &y, 1) < 1)
+ y = FI; /* come here if timeout */
+ if (flags & P_TRACE && y != PAD)
+ printf(" %02x", y);
+ return (y);
+}
+
+/* end program */
diff --git a/contrib/ntp/libntp/recvbuff.c b/contrib/ntp/libntp/recvbuff.c
index 37166a4a5c42..96d212d1d3fa 100644
--- a/contrib/ntp/libntp/recvbuff.c
+++ b/contrib/ntp/libntp/recvbuff.c
@@ -24,7 +24,6 @@ static struct recvbuf *volatile fulllist; /* lifo buffers with data */
static struct recvbuf *volatile beginlist; /* fifo buffers with data */
#if defined(HAVE_IO_COMPLETION_PORT)
-static HANDLE fulldatabufferevent;
static CRITICAL_SECTION RecvCritSection;
# define RECV_BLOCK_IO() EnterCriticalSection(&RecvCritSection)
# define RECV_UNBLOCK_IO() LeaveCriticalSection(&RecvCritSection)
@@ -116,22 +115,10 @@ init_recvbuff(int nbufs)
#if defined(HAVE_IO_COMPLETION_PORT)
InitializeCriticalSection(&RecvCritSection);
- fulldatabufferevent = CreateEvent(NULL, FALSE,FALSE, NULL);
#endif
}
-#if defined(HAVE_IO_COMPLETION_PORT)
-
-/* Return the new full buffer event handle . This handle is
- * signalled when a recv buffer is placed in the full list.
- */
-HANDLE
-get_recv_buff_event()
-{
- return fulldatabufferevent;
-}
-#endif
/*
* getrecvbufs - get receive buffers which have data in them
@@ -224,11 +211,6 @@ add_full_recv_buffer(
fulllist = rb;
full_recvbufs++;
-#if defined(HAVE_IO_COMPLETION_PORT)
- if (!SetEvent(fulldatabufferevent)) {
- msyslog(LOG_ERR, "Can't set receive buffer event");
- }
-#endif
RECV_UNBLOCK_IO();
}
diff --git a/contrib/ntp/libntp/syssignal.c b/contrib/ntp/libntp/syssignal.c
index 50c65b7c3d11..6ec4c4c16c54 100644
--- a/contrib/ntp/libntp/syssignal.c
+++ b/contrib/ntp/libntp/syssignal.c
@@ -41,6 +41,16 @@ signal_no_reset(
vec.sa_flags = 0;
#endif
+#ifdef SA_RESTART
+/* Added for PPS clocks on Solaris 7 which get EINTR errors */
+# ifdef SIGPOLL
+ if (sig == SIGPOLL) vec.sa_flags = SA_RESTART;
+# endif
+# ifdef SIGIO
+ if (sig == SIGIO) vec.sa_flags = SA_RESTART;
+# endif
+#endif
+
while (1)
{
struct sigaction ovec;
diff --git a/contrib/ntp/libntp/systime.c b/contrib/ntp/libntp/systime.c
index 5e50fc52d6cd..2ef6ef9da7ca 100644
--- a/contrib/ntp/libntp/systime.c
+++ b/contrib/ntp/libntp/systime.c
@@ -25,12 +25,6 @@
#include "ntp_unixtime.h"
#include "ntp_stdlib.h"
-#if defined SYS_WINNT
-#include "ntp_timer.h"
-extern DWORD units_per_tick;
-static long last_Adj = 0;
-#endif
-
int systime_10ms_ticks = 0; /* adj sysclock in 10ms increments */
#define MAXFREQ 500e-6
@@ -80,6 +74,7 @@ get_systime(
(void) GETTIMEOFDAY(&tv, (struct timezone *)0);
now->l_i = tv.tv_sec + JAN_1970;
+#if defined RELIANTUNIX_CLOCK || defined SCO5_CLOCK
if (systime_10ms_ticks) {
/* fake better than 10ms resolution by interpolating
accumulated residual (in adj_systime(), see below) */
@@ -92,9 +87,10 @@ get_systime(
}
}
dtemp *= FRAC;
- } else {
- dtemp = tv.tv_usec * FRAC / 1e6;
- }
+ } else
+#endif
+
+ dtemp = tv.tv_usec * FRAC / 1e6;
if (dtemp >= FRAC)
now->l_i++;
@@ -108,6 +104,7 @@ get_systime(
* adj_systime - called once every second to make system time adjustments.
* Returns 1 if okay, 0 if trouble.
*/
+#if !defined SYS_WINNT
int
adj_systime(
double now
@@ -116,12 +113,7 @@ adj_systime(
double dtemp;
struct timeval adjtv;
u_char isneg = 0;
-#if !defined SYS_WINNT && !defined SYS_CYGWIN32
struct timeval oadjtv;
-#else
- int rc;
- long dwTimeAdjustment;
-#endif
/*
* Add the residual from the previous adjustment to the new
@@ -134,6 +126,7 @@ adj_systime(
dtemp = -dtemp;
}
+#if defined RELIANTUNIX_CLOCK || defined SCO5_CLOCK
if (systime_10ms_ticks) {
/* accumulate changes until we have enough to adjust a tick */
if (dtemp < 5000e-6) {
@@ -145,43 +138,18 @@ adj_systime(
else sys_residual = dtemp - 10000e-6;
dtemp = 10000e-6;
}
- } else {
+ } else
+#endif
if (dtemp > sys_maxfreq)
dtemp = sys_maxfreq;
- }
-#ifdef SYS_WINNT
- dtemp = dtemp * 1000000.0;
-#else
dtemp = dtemp * 1e6 + .5;
-#endif
+
if (isneg)
dtemp = -dtemp;
adjtv.tv_sec = 0;
adjtv.tv_usec = (int32)dtemp;
-#if defined SYS_WINNT || defined SYS_CYGWIN32
- /* dtemp is in micro seconds. NT uses 100 ns units,
- * so a unit change in dwTimeAdjustment corresponds
- * to slewing 10 ppm.
- * Calculate the number of 100ns units to add,
- * and leave the remainder in dtemp */
- dwTimeAdjustment = dtemp / 10;
- dtemp += (double) -dwTimeAdjustment * 10.0;
- dwTimeAdjustment += units_per_tick;
-
- /* only adjust the clock if adjustment changes */
- if (last_Adj != dwTimeAdjustment) {
- last_Adj = dwTimeAdjustment;
-# ifdef DEBUG
- if (debug > 1)
- printf("SetSystemTimeAdjustment( %ld)\n", dwTimeAdjustment);
-# endif
- rc = !SetSystemTimeAdjustment(dwTimeAdjustment, FALSE);
- }
- else rc = 0;
- if (rc)
-#else
/*
* Here we do the actual adjustment. If for some reason the adjtime()
* call fails, like it is not implemented or something like that,
@@ -190,17 +158,12 @@ adj_systime(
*/
/* casey - we need a posix type thang here */
if (adjtime(&adjtv, &oadjtv) < 0)
-#endif /* SYS_WINNT */
{
msyslog(LOG_ERR, "Can't adjust time: %m");
return 0;
}
else {
-#if !defined (SYS_WINNT) && !defined (SYS_CYGWIN32)
sys_residual += oadjtv.tv_usec / 1e6;
-#else
- sys_residual = dtemp / 1000000.0;
-#endif /* SYS_WINNT */
}
#ifdef DEBUG
if (debug > 6)
@@ -208,6 +171,7 @@ adj_systime(
#endif
return 1;
}
+#endif
/*
diff --git a/contrib/ntp/libparse/Makefile.am b/contrib/ntp/libparse/Makefile.am
index c0f838b798a3..d7479e75d89c 100644
--- a/contrib/ntp/libparse/Makefile.am
+++ b/contrib/ntp/libparse/Makefile.am
@@ -1,12 +1,4 @@
#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
-#
-# this is sick - i want the source to be compile with
-# two time with different flags resulting different
-# objects - still need to find a way to communicate
-# that to automake/autoconf
-#
-# Frank Kardel
-#
AUTOMAKE_OPTIONS = ../util/ansi2knr
noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@
EXTRA_LIBRARIES = libparse.a libparse_kernel.a
@@ -31,19 +23,20 @@ libparse_a_SOURCES = parse.c \
info_trimble.c \
trim_info.c
-libparse_kernel_a_SOURCES = kparse.c \
- kparse_conf.c \
- kclk_meinberg.c \
- kclk_schmid.c \
- kclk_rawdcf.c \
- kclk_trimtsip.c \
- kclk_dcf7000.c \
- kclk_trimtaip.c \
- kclk_rcc8000.c \
- kclk_hopf6021.c \
- kclk_computime.c \
- kclk_wharton.c \
- kclk_varitext.c
+libparse_kernel_a_SOURCES =
+libparse_kernel_a_LIBADD = kparse$U.o \
+ kparse_conf$U.o \
+ kclk_computime$U.o \
+ kclk_dcf7000$U.o \
+ kclk_hopf6021$U.o \
+ kclk_meinberg$U.o \
+ kclk_rawdcf$U.o \
+ kclk_rcc8000$U.o \
+ kclk_schmid$U.o \
+ kclk_trimtaip$U.o \
+ kclk_trimtsip$U.o \
+ kclk_varitext$U.o \
+ kclk_wharton$U.o
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/kernel
ETAGS_ARGS = Makefile.am
@@ -58,24 +51,44 @@ info_trimble.c: $(top_srcdir)/include/trimble.h mkinfo_rcmd.sed mkinfo_scmd.sed
sed -n -f mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > info_trimble.c || rm -f info_trimble.c
sed -n -f mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.c || rm -f info_trimble.c
-#
-# HACK following below...
-#
-kparse_conf.o: parse_conf.c
-kparse.o: parse.c
-kclk_rawdcf.o: clk_rawdcf.c
-kclk_trimtsip.o: clk_trimtsip.c
-kclk_meinberg.o: clk_meinberg.c
-kclk_schmid.o: clk_schmid.c
-kclk_rawdcf.o: clk_rawdcf.c
-kclk_trimtsip.o: clk_trimtsip.c
-kclk_dcf7000.o: clk_dcf7000.c
-kclk_trimtaip.o: clk_trimtaip.c
-kclk_rcc8000.o: clk_rcc8000.c
-kclk_hopf6021.o: clk_hopf6021.c
-kclk_computime.o: clk_computime.c
-kclk_wharton.o: clk_wharton.c
-kclk_varitext.o: clk_varitext.c
+kclk_computime$U.o: clk_computime$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_dcf7000$U.o: clk_dcf7000$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_hopf6021$U.o: clk_hopf6021$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_meinberg$U.o: clk_meinberg$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_rawdcf$U.o: clk_rawdcf$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_rcc8000$U.o: clk_rcc8000$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_schmid$U.o: clk_schmid$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_trimtaip$U.o: clk_trimtaip$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_trimtsip$U.o: clk_trimtsip$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_varitext$U.o: clk_varitext$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_wharton$U.o: clk_wharton$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kparse$U.o: parse$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kparse_conf$U.o: parse_conf$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
parsestreams.loadable_module.o: $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a
$(LD) -r -o $@ $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a
diff --git a/contrib/ntp/libparse/Makefile.in b/contrib/ntp/libparse/Makefile.in
index 44f3174fb255..8682c2bc8ba7 100644
--- a/contrib/ntp/libparse/Makefile.in
+++ b/contrib/ntp/libparse/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,16 +96,9 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
-#
-# this is sick - i want the source to be compile with
-# two time with different flags resulting different
-# objects - still need to find a way to communicate
-# that to automake/autoconf
-#
-# Frank Kardel
-#
AUTOMAKE_OPTIONS = ../util/ansi2knr
@@ -130,19 +126,20 @@ libparse_a_SOURCES = parse.c \
trim_info.c
-libparse_kernel_a_SOURCES = kparse.c \
- kparse_conf.c \
- kclk_meinberg.c \
- kclk_schmid.c \
- kclk_rawdcf.c \
- kclk_trimtsip.c \
- kclk_dcf7000.c \
- kclk_trimtaip.c \
- kclk_rcc8000.c \
- kclk_hopf6021.c \
- kclk_computime.c \
- kclk_wharton.c \
- kclk_varitext.c
+libparse_kernel_a_SOURCES =
+libparse_kernel_a_LIBADD = kparse$U.o \
+ kparse_conf$U.o \
+ kclk_computime$U.o \
+ kclk_dcf7000$U.o \
+ kclk_hopf6021$U.o \
+ kclk_meinberg$U.o \
+ kclk_rawdcf$U.o \
+ kclk_rcc8000$U.o \
+ kclk_schmid$U.o \
+ kclk_trimtaip$U.o \
+ kclk_trimtsip$U.o \
+ kclk_varitext$U.o \
+ kclk_wharton$U.o
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/kernel
@@ -160,6 +157,7 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LIBS = @LIBS@
ANSI2KNR = ../util/ansi2knr
+libparse_a_AR = $(AR) cru
libparse_a_LIBADD =
am_libparse_a_OBJECTS = parse$U.o parse_conf$U.o clk_meinberg$U.o \
clk_schmid$U.o clk_rawdcf$U.o clk_trimtsip$U.o clk_dcf7000$U.o \
@@ -167,11 +165,11 @@ clk_trimtaip$U.o clk_rcc8000$U.o clk_hopf6021$U.o clk_computime$U.o \
clk_wharton$U.o clk_varitext$U.o data_mbg$U.o info_trimble$U.o \
trim_info$U.o
libparse_a_OBJECTS = $(am_libparse_a_OBJECTS)
-libparse_kernel_a_LIBADD =
-am_libparse_kernel_a_OBJECTS = kparse$U.o kparse_conf$U.o \
-kclk_meinberg$U.o kclk_schmid$U.o kclk_rawdcf$U.o kclk_trimtsip$U.o \
-kclk_dcf7000$U.o kclk_trimtaip$U.o kclk_rcc8000$U.o kclk_hopf6021$U.o \
-kclk_computime$U.o kclk_wharton$U.o kclk_varitext$U.o
+libparse_kernel_a_AR = $(AR) cru
+libparse_kernel_a_DEPENDENCIES = kparse$U.o kparse_conf$U.o \
+kclk_computime$U.o kclk_dcf7000$U.o kclk_hopf6021$U.o kclk_meinberg$U.o \
+kclk_rawdcf$U.o kclk_rcc8000$U.o kclk_schmid$U.o kclk_trimtaip$U.o \
+kclk_trimtsip$U.o kclk_varitext$U.o kclk_wharton$U.o
libparse_kernel_a_OBJECTS = $(am_libparse_kernel_a_OBJECTS)
AR = ar
PROGRAMS = $(noinst_PROGRAMS)
@@ -197,6 +195,17 @@ DIST_COMMON = README Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/clk_computime$U.Po \
+$(DEPDIR)/clk_dcf7000$U.Po $(DEPDIR)/clk_hopf6021$U.Po \
+$(DEPDIR)/clk_meinberg$U.Po $(DEPDIR)/clk_rawdcf$U.Po \
+$(DEPDIR)/clk_rcc8000$U.Po $(DEPDIR)/clk_schmid$U.Po \
+$(DEPDIR)/clk_trimtaip$U.Po $(DEPDIR)/clk_trimtsip$U.Po \
+$(DEPDIR)/clk_varitext$U.Po $(DEPDIR)/clk_wharton$U.Po \
+$(DEPDIR)/data_mbg$U.Po $(DEPDIR)/info_trimble$U.Po \
+$(DEPDIR)/parse$U.Po $(DEPDIR)/parse_conf$U.Po \
+$(DEPDIR)/parsesolaris$U.Po $(DEPDIR)/parsestreams$U.Po \
+$(DEPDIR)/trim_info$U.Po
SOURCES = $(libparse_a_SOURCES) $(libparse_kernel_a_SOURCES) parsesolaris.c parsestreams.c
OBJECTS = $(am_libparse_a_OBJECTS) $(am_libparse_kernel_a_OBJECTS) parsesolaris$U.o parsestreams$U.o
@@ -204,9 +213,9 @@ all: all-redirect
.SUFFIXES:
.SUFFIXES: .c .o
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps libparse/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu libparse/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -220,9 +229,6 @@ distclean-noinstLIBRARIES:
maintainer-clean-noinstLIBRARIES:
-.c.o:
- $(COMPILE) -c $<
-
mostlyclean-compile:
-rm -f *.o core *.core
@@ -247,44 +253,15 @@ clean-kr:
distclean-kr:
maintainer-clean-kr:
-parse$U.o:
-parse_conf$U.o:
-clk_meinberg$U.o:
-clk_schmid$U.o:
-clk_rawdcf$U.o:
-clk_trimtsip$U.o:
-clk_dcf7000$U.o:
-clk_trimtaip$U.o:
-clk_rcc8000$U.o:
-clk_hopf6021$U.o:
-clk_computime$U.o:
-clk_wharton$U.o:
-clk_varitext$U.o:
-data_mbg$U.o:
-info_trimble$U.o:
-trim_info$U.o:
libparse.a: $(libparse_a_OBJECTS) $(libparse_a_DEPENDENCIES)
-rm -f libparse.a
- $(AR) cru libparse.a $(libparse_a_OBJECTS) $(libparse_a_LIBADD)
+ $(libparse_a_AR) libparse.a $(libparse_a_OBJECTS) $(libparse_a_LIBADD)
$(RANLIB) libparse.a
-kparse$U.o:
-kparse_conf$U.o:
-kclk_meinberg$U.o:
-kclk_schmid$U.o:
-kclk_rawdcf$U.o:
-kclk_trimtsip$U.o:
-kclk_dcf7000$U.o:
-kclk_trimtaip$U.o:
-kclk_rcc8000$U.o:
-kclk_hopf6021$U.o:
-kclk_computime$U.o:
-kclk_wharton$U.o:
-kclk_varitext$U.o:
libparse_kernel.a: $(libparse_kernel_a_OBJECTS) $(libparse_kernel_a_DEPENDENCIES)
-rm -f libparse_kernel.a
- $(AR) cru libparse_kernel.a $(libparse_kernel_a_OBJECTS) $(libparse_kernel_a_LIBADD)
+ $(libparse_kernel_a_AR) libparse_kernel.a $(libparse_kernel_a_OBJECTS) $(libparse_kernel_a_LIBADD)
$(RANLIB) libparse_kernel.a
mostlyclean-noinstPROGRAMS:
@@ -295,12 +272,10 @@ clean-noinstPROGRAMS:
distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS:
-parsesolaris$U.o:
parsesolaris: $(parsesolaris_OBJECTS) $(parsesolaris_DEPENDENCIES)
@rm -f parsesolaris
$(LINK) $(parsesolaris_LDFLAGS) $(parsesolaris_OBJECTS) $(parsesolaris_LDADD) $(LIBS)
-parsestreams$U.o:
parsestreams: $(parsestreams_OBJECTS) $(parsestreams_DEPENDENCIES)
@rm -f parsestreams
@@ -331,32 +306,6 @@ data_mbg_.c: data_mbg.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/data_mbg.c; then echo $(srcdir)/data_mbg.c; else echo data_mbg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > data_mbg_.c
info_trimble_.c: info_trimble.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/info_trimble.c; then echo $(srcdir)/info_trimble.c; else echo info_trimble.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > info_trimble_.c
-kclk_computime_.c: kclk_computime.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kclk_computime.c; then echo $(srcdir)/kclk_computime.c; else echo kclk_computime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kclk_computime_.c
-kclk_dcf7000_.c: kclk_dcf7000.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kclk_dcf7000.c; then echo $(srcdir)/kclk_dcf7000.c; else echo kclk_dcf7000.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kclk_dcf7000_.c
-kclk_hopf6021_.c: kclk_hopf6021.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kclk_hopf6021.c; then echo $(srcdir)/kclk_hopf6021.c; else echo kclk_hopf6021.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kclk_hopf6021_.c
-kclk_meinberg_.c: kclk_meinberg.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kclk_meinberg.c; then echo $(srcdir)/kclk_meinberg.c; else echo kclk_meinberg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kclk_meinberg_.c
-kclk_rawdcf_.c: kclk_rawdcf.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kclk_rawdcf.c; then echo $(srcdir)/kclk_rawdcf.c; else echo kclk_rawdcf.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kclk_rawdcf_.c
-kclk_rcc8000_.c: kclk_rcc8000.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kclk_rcc8000.c; then echo $(srcdir)/kclk_rcc8000.c; else echo kclk_rcc8000.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kclk_rcc8000_.c
-kclk_schmid_.c: kclk_schmid.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kclk_schmid.c; then echo $(srcdir)/kclk_schmid.c; else echo kclk_schmid.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kclk_schmid_.c
-kclk_trimtaip_.c: kclk_trimtaip.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kclk_trimtaip.c; then echo $(srcdir)/kclk_trimtaip.c; else echo kclk_trimtaip.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kclk_trimtaip_.c
-kclk_trimtsip_.c: kclk_trimtsip.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kclk_trimtsip.c; then echo $(srcdir)/kclk_trimtsip.c; else echo kclk_trimtsip.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kclk_trimtsip_.c
-kclk_varitext_.c: kclk_varitext.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kclk_varitext.c; then echo $(srcdir)/kclk_varitext.c; else echo kclk_varitext.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kclk_varitext_.c
-kclk_wharton_.c: kclk_wharton.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kclk_wharton.c; then echo $(srcdir)/kclk_wharton.c; else echo kclk_wharton.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kclk_wharton_.c
-kparse_.c: kparse.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kparse.c; then echo $(srcdir)/kparse.c; else echo kparse.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kparse_.c
-kparse_conf_.c: kparse_conf.c $(ANSI2KNR)
- $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/kparse_conf.c; then echo $(srcdir)/kparse_conf.c; else echo kparse_conf.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > kparse_conf_.c
parse_.c: parse.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/parse.c; then echo $(srcdir)/parse.c; else echo parse.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > parse_.c
parse_conf_.c: parse_conf.c $(ANSI2KNR)
@@ -370,31 +319,32 @@ trim_info_.c: trim_info.c $(ANSI2KNR)
clk_computime_.o clk_dcf7000_.o clk_hopf6021_.o clk_meinberg_.o \
clk_rawdcf_.o clk_rcc8000_.o clk_schmid_.o clk_trimtaip_.o \
clk_trimtsip_.o clk_varitext_.o clk_wharton_.o data_mbg_.o \
-info_trimble_.o kclk_computime_.o kclk_dcf7000_.o kclk_hopf6021_.o \
-kclk_meinberg_.o kclk_rawdcf_.o kclk_rcc8000_.o kclk_schmid_.o \
-kclk_trimtaip_.o kclk_trimtsip_.o kclk_varitext_.o kclk_wharton_.o \
-kparse_.o kparse_conf_.o parse_.o parse_conf_.o parsesolaris_.o \
-parsestreams_.o trim_info_.o : $(ANSI2KNR)
+info_trimble_.o parse_.o parse_conf_.o parsesolaris_.o parsestreams_.o \
+trim_info_.o : $(ANSI2KNR)
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -411,67 +361,49 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
-clk_computime.o clk_computime.lo: clk_computime.c ../config.h
-clk_dcf7000.o clk_dcf7000.lo: clk_dcf7000.c ../config.h
-clk_hopf6021.o clk_hopf6021.lo: clk_hopf6021.c ../config.h
-clk_meinberg.o clk_meinberg.lo: clk_meinberg.c ../config.h
-clk_rawdcf.o clk_rawdcf.lo: clk_rawdcf.c ../config.h
-clk_rcc8000.o clk_rcc8000.lo: clk_rcc8000.c ../config.h
-clk_schmid.o clk_schmid.lo: clk_schmid.c ../config.h
-clk_trimtaip.o clk_trimtaip.lo: clk_trimtaip.c ../config.h
-clk_trimtsip.o clk_trimtsip.lo: clk_trimtsip.c ../config.h
-clk_varitext.o clk_varitext.lo: clk_varitext.c ../config.h
-clk_wharton.o clk_wharton.lo: clk_wharton.c ../config.h
-data_mbg.o data_mbg.lo: data_mbg.c ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h ../include/ntp_fp.h \
- ../include/mbg_gps166.h ../include/binio.h \
- ../include/ieee754io.h
-info_trimble.o info_trimble.lo: info_trimble.c ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntpd.h ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp.h ../include/ntp_malloc.h \
- ../include/ntp_refclock.h ../include/recvbuff.h \
- ../include/trimble.h
-kclk_computime.o kclk_computime.lo: kclk_computime.c clk_computime.c \
- ../config.h
-kclk_dcf7000.o kclk_dcf7000.lo: kclk_dcf7000.c clk_dcf7000.c ../config.h
-kclk_hopf6021.o kclk_hopf6021.lo: kclk_hopf6021.c clk_hopf6021.c \
- ../config.h
-kclk_meinberg.o kclk_meinberg.lo: kclk_meinberg.c clk_meinberg.c \
- ../config.h
-kclk_rawdcf.o kclk_rawdcf.lo: kclk_rawdcf.c clk_rawdcf.c ../config.h
-kclk_rcc8000.o kclk_rcc8000.lo: kclk_rcc8000.c clk_rcc8000.c ../config.h
-kclk_schmid.o kclk_schmid.lo: kclk_schmid.c clk_schmid.c ../config.h
-kclk_trimtaip.o kclk_trimtaip.lo: kclk_trimtaip.c clk_trimtaip.c \
- ../config.h
-kclk_trimtsip.o kclk_trimtsip.lo: kclk_trimtsip.c clk_trimtsip.c \
- ../config.h
-kclk_varitext.o kclk_varitext.lo: kclk_varitext.c clk_varitext.c \
- ../config.h
-kclk_wharton.o kclk_wharton.lo: kclk_wharton.c clk_wharton.c ../config.h
-kparse.o kparse.lo: kparse.c parse.c ../config.h
-kparse_conf.o kparse_conf.lo: kparse_conf.c parse_conf.c ../config.h
-parse.o parse.lo: parse.c ../config.h
-parse_conf.o parse_conf.lo: parse_conf.c ../config.h
-parsesolaris.o parsesolaris.lo: parsesolaris.c sys/systm.h \
- ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/parse.h ../include/parse_conf.h \
- ../kernel/sys/parsestreams.h ../kernel/sys/ppsclock.h \
- ../include/ntp_string.h
-
-trim_info.o trim_info.lo: trim_info.c ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/trimble.h
+
+@AMDEP@include $(DEPDIR)/clk_computime$U.Po
+@AMDEP@include $(DEPDIR)/clk_dcf7000$U.Po
+@AMDEP@include $(DEPDIR)/clk_hopf6021$U.Po
+@AMDEP@include $(DEPDIR)/clk_meinberg$U.Po
+@AMDEP@include $(DEPDIR)/clk_rawdcf$U.Po
+@AMDEP@include $(DEPDIR)/clk_rcc8000$U.Po
+@AMDEP@include $(DEPDIR)/clk_schmid$U.Po
+@AMDEP@include $(DEPDIR)/clk_trimtaip$U.Po
+@AMDEP@include $(DEPDIR)/clk_trimtsip$U.Po
+@AMDEP@include $(DEPDIR)/clk_varitext$U.Po
+@AMDEP@include $(DEPDIR)/clk_wharton$U.Po
+@AMDEP@include $(DEPDIR)/data_mbg$U.Po
+@AMDEP@include $(DEPDIR)/info_trimble$U.Po
+@AMDEP@include $(DEPDIR)/parse$U.Po
+@AMDEP@include $(DEPDIR)/parse_conf$U.Po
+@AMDEP@include $(DEPDIR)/parsesolaris$U.Po
+@AMDEP@include $(DEPDIR)/parsestreams$U.Po
+@AMDEP@include $(DEPDIR)/trim_info$U.Po
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf $(DEPDIR)
+
+maintainer-clean-depend:
+
+@AMDEP@CCDEPMODE = @CCDEPMODE@
+
+.c.o:
+@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c -o $@ $<
info-am:
info: info-am
@@ -509,28 +441,30 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-kr mostlyclean-noinstPROGRAMS \
- mostlyclean-tags mostlyclean-generic
+ mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-noinstLIBRARIES clean-compile clean-kr \
- clean-noinstPROGRAMS clean-tags clean-generic \
- mostlyclean-am
+ clean-noinstPROGRAMS clean-tags clean-depend \
+ clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-noinstLIBRARIES distclean-compile distclean-kr \
distclean-noinstPROGRAMS distclean-tags \
- distclean-generic clean-am
+ distclean-depend distclean-generic clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-kr \
maintainer-clean-noinstPROGRAMS maintainer-clean-tags \
- maintainer-clean-generic distclean-am
+ maintainer-clean-depend maintainer-clean-generic \
+ distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -543,12 +477,13 @@ maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
maintainer-clean-kr mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS tags \
mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
-distdir info-am info dvi-am dvi check check-am installcheck-am \
-installcheck install-exec-am install-exec install-data-am install-data \
-install-am install uninstall-am uninstall all-redirect all-am all \
-install-strip installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+distdir mostlyclean-depend distclean-depend clean-depend \
+maintainer-clean-depend info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all install-strip installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
#
@@ -559,24 +494,44 @@ info_trimble.c: $(top_srcdir)/include/trimble.h mkinfo_rcmd.sed mkinfo_scmd.sed
sed -n -f mkinfo_scmd.sed $(top_srcdir)/include/trimble.h > info_trimble.c || rm -f info_trimble.c
sed -n -f mkinfo_rcmd.sed $(top_srcdir)/include/trimble.h >> info_trimble.c || rm -f info_trimble.c
-#
-# HACK following below...
-#
-kparse_conf.o: parse_conf.c
-kparse.o: parse.c
-kclk_rawdcf.o: clk_rawdcf.c
-kclk_trimtsip.o: clk_trimtsip.c
-kclk_meinberg.o: clk_meinberg.c
-kclk_schmid.o: clk_schmid.c
-kclk_rawdcf.o: clk_rawdcf.c
-kclk_trimtsip.o: clk_trimtsip.c
-kclk_dcf7000.o: clk_dcf7000.c
-kclk_trimtaip.o: clk_trimtaip.c
-kclk_rcc8000.o: clk_rcc8000.c
-kclk_hopf6021.o: clk_hopf6021.c
-kclk_computime.o: clk_computime.c
-kclk_wharton.o: clk_wharton.c
-kclk_varitext.o: clk_varitext.c
+kclk_computime$U.o: clk_computime$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_dcf7000$U.o: clk_dcf7000$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_hopf6021$U.o: clk_hopf6021$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_meinberg$U.o: clk_meinberg$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_rawdcf$U.o: clk_rawdcf$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_rcc8000$U.o: clk_rcc8000$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_schmid$U.o: clk_schmid$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_trimtaip$U.o: clk_trimtaip$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_trimtsip$U.o: clk_trimtsip$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_varitext$U.o: clk_varitext$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kclk_wharton$U.o: clk_wharton$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kparse$U.o: parse$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
+
+kparse_conf$U.o: parse_conf$U.c
+ $(COMPILE) -DPARSESTREAM -c $< -o $@
parsestreams.loadable_module.o: $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a
$(LD) -r -o $@ $(parsestreams_OBJECTS) libparse_kernel.a ../libntp/libntp.a
diff --git a/contrib/ntp/libparse/clk_computime.c b/contrib/ntp/libparse/clk_computime.c
index 8e050c00fcad..2b19392519fa 100644
--- a/contrib/ntp/libparse/clk_computime.c
+++ b/contrib/ntp/libparse/clk_computime.c
@@ -4,9 +4,9 @@
#if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_COMPUTIME)
/*
- * /src/NTP/ntp-4/libparse/clk_computime.c,v 4.5 1998/06/14 21:09:34 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/libparse/clk_computime.c,v 4.6 1999/11/28 09:13:49 kardel RELEASE_19991128_A
*
- * clk_computime.c,v 4.5 1998/06/14 21:09:34 kardel RELEASE_19990228_A
+ * clk_computime.c,v 4.6 1999/11/28 09:13:49 kardel RELEASE_19991128_A
*
* Supports Diem's Computime Radio Clock
*
@@ -171,6 +171,9 @@ int clk_computime_bs;
/*
* clk_computime.c,v
+ * Revision 4.6 1999/11/28 09:13:49 kardel
+ * RECON_4_0_98F
+ *
* Revision 4.5 1998/06/14 21:09:34 kardel
* Sun acc cleanup
*
diff --git a/contrib/ntp/libparse/clk_dcf7000.c b/contrib/ntp/libparse/clk_dcf7000.c
index 845b46716d08..c113ec7a7d90 100644
--- a/contrib/ntp/libparse/clk_dcf7000.c
+++ b/contrib/ntp/libparse/clk_dcf7000.c
@@ -1,7 +1,7 @@
/*
- * /src/NTP/ntp-4/libparse/clk_dcf7000.c,v 4.5 1998/06/14 21:09:34 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/libparse/clk_dcf7000.c,v 4.6 1999/11/28 09:13:49 kardel RELEASE_19991128_A
*
- * clk_dcf7000.c,v 4.5 1998/06/14 21:09:34 kardel RELEASE_19990228_A
+ * clk_dcf7000.c,v 4.6 1999/11/28 09:13:49 kardel RELEASE_19991128_A
*
* ELV DCF7000 module
*
@@ -165,6 +165,9 @@ int clk_dcf7000_bs;
* History:
*
* clk_dcf7000.c,v
+ * Revision 4.6 1999/11/28 09:13:49 kardel
+ * RECON_4_0_98F
+ *
* Revision 4.5 1998/06/14 21:09:34 kardel
* Sun acc cleanup
*
diff --git a/contrib/ntp/libparse/clk_hopf6021.c b/contrib/ntp/libparse/clk_hopf6021.c
index 06efc6ff6dc2..d55c111ab5d3 100644
--- a/contrib/ntp/libparse/clk_hopf6021.c
+++ b/contrib/ntp/libparse/clk_hopf6021.c
@@ -1,7 +1,7 @@
/*
- * /src/NTP/ntp-4/libparse/clk_hopf6021.c,v 4.6 1998/11/15 20:27:57 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/libparse/clk_hopf6021.c,v 4.7 1999/11/28 09:13:49 kardel RELEASE_19991128_A
*
- * clk_hopf6021.c,v 4.6 1998/11/15 20:27:57 kardel RELEASE_19990228_A
+ * clk_hopf6021.c,v 4.7 1999/11/28 09:13:49 kardel RELEASE_19991128_A
*
* Radiocode Clocks HOPF Funkuhr 6021 mit serieller Schnittstelle
* base code version from 24th Nov 1995 - history at end
@@ -254,6 +254,9 @@ int clk_hopf6021_bs;
* History:
*
* clk_hopf6021.c,v
+ * Revision 4.7 1999/11/28 09:13:49 kardel
+ * RECON_4_0_98F
+ *
* Revision 4.6 1998/11/15 20:27:57 kardel
* Release 4.0.73e13 reconcilation
*
diff --git a/contrib/ntp/libparse/clk_meinberg.c b/contrib/ntp/libparse/clk_meinberg.c
index fdffa1bf33c6..2e58cf68f73d 100644
--- a/contrib/ntp/libparse/clk_meinberg.c
+++ b/contrib/ntp/libparse/clk_meinberg.c
@@ -1,7 +1,7 @@
/*
- * /src/NTP/ntp-4/libparse/clk_meinberg.c,v 4.7 1999/02/21 11:09:14 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/libparse/clk_meinberg.c,v 4.8 1999/11/28 09:13:50 kardel RELEASE_19991128_A
*
- * clk_meinberg.c,v 4.7 1999/02/21 11:09:14 kardel RELEASE_19990228_A
+ * clk_meinberg.c,v 4.8 1999/11/28 09:13:50 kardel RELEASE_19991128_A
*
* Meinberg clock support
*
@@ -718,6 +718,9 @@ int clk_meinberg_bs;
* History:
*
* clk_meinberg.c,v
+ * Revision 4.8 1999/11/28 09:13:50 kardel
+ * RECON_4_0_98F
+ *
* Revision 4.7 1999/02/21 11:09:14 kardel
* cleanup
*
diff --git a/contrib/ntp/libparse/clk_rawdcf.c b/contrib/ntp/libparse/clk_rawdcf.c
index ac854c57b223..c4df5b5bceda 100644
--- a/contrib/ntp/libparse/clk_rawdcf.c
+++ b/contrib/ntp/libparse/clk_rawdcf.c
@@ -1,7 +1,7 @@
/*
- * /src/NTP/ntp-4/libparse/clk_rawdcf.c,v 4.6 1998/06/14 21:09:37 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/libparse/clk_rawdcf.c,v 4.9 1999/12/06 13:42:23 kardel Exp
*
- * clk_rawdcf.c,v 4.6 1998/06/14 21:09:37 kardel RELEASE_19990228_A
+ * clk_rawdcf.c,v 4.9 1999/12/06 13:42:23 kardel Exp
*
* Raw DCF77 pulse clock support
*
@@ -88,6 +88,10 @@ static u_long pps_rawdcf P((parse_t *, int, timestamp_t *));
static u_long cvt_rawdcf P((unsigned char *, int, struct format *, clocktime_t *, void *));
static u_long inp_rawdcf P((parse_t *, unsigned int, timestamp_t *));
+typedef struct last_tcode {
+ time_t tcode; /* last converted time code */
+} last_tcode_t;
+
clockformat_t clock_rawdcf =
{
inp_rawdcf, /* DCF77 input handling */
@@ -97,7 +101,7 @@ clockformat_t clock_rawdcf =
"RAW DCF77 Timecode", /* direct decoding / time synthesis */
61, /* bit buffer */
- 0 /* no private data (currently in input buffer) */
+ sizeof(last_tcode_t)
};
static struct dcfparam
@@ -316,11 +320,12 @@ cvt_rawdcf(
void *local
)
{
+ last_tcode_t *t = (last_tcode_t *)local;
register unsigned char *s = (unsigned char *)buffer;
register unsigned char *e = s + size;
register unsigned char *b = dcfparameter.onebits;
register unsigned char *c = dcfparameter.zerobits;
- register unsigned rtc = CVT_NONE;
+ u_long rtc = CVT_NONE;
register unsigned int i, lowmax, highmax, cutoff, span;
#define BITS 9
unsigned char histbuf[BITS];
@@ -458,7 +463,30 @@ cvt_rawdcf(
c++;
}
- return (rtc == CVT_NONE) ? convert_rawdcf(buffer, size, &dcfparameter, clock_time) : rtc;
+ if (rtc == CVT_NONE)
+ {
+ rtc = convert_rawdcf(buffer, size, &dcfparameter, clock_time);
+ if (rtc == CVT_OK)
+ {
+ time_t newtime;
+
+ newtime = parse_to_unixtime(clock_time, &rtc);
+ if ((rtc == CVT_OK) && t)
+ {
+ if ((newtime - t->tcode) == 60) /* guard against multi bit errors */
+ {
+ clock_time->utctime = newtime;
+ }
+ else
+ {
+ rtc = CVT_FAIL|CVT_BADTIME;
+ }
+ t->tcode = newtime;
+ }
+ }
+ }
+
+ return rtc;
}
/*
@@ -555,6 +583,15 @@ int clk_rawdcf_bs;
* History:
*
* clk_rawdcf.c,v
+ * Revision 4.9 1999/12/06 13:42:23 kardel
+ * transfer correctly converted time codes always into tcode
+ *
+ * Revision 4.8 1999/11/28 09:13:50 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.7 1999/04/01 20:07:20 kardel
+ * added checking for minutie increment of timestamps in clk_rawdcf.c
+ *
* Revision 4.6 1998/06/14 21:09:37 kardel
* Sun acc cleanup
*
diff --git a/contrib/ntp/libparse/clk_rcc8000.c b/contrib/ntp/libparse/clk_rcc8000.c
index 09405c73d20e..ecafbde37d98 100644
--- a/contrib/ntp/libparse/clk_rcc8000.c
+++ b/contrib/ntp/libparse/clk_rcc8000.c
@@ -1,7 +1,7 @@
/*
- * /src/NTP/ntp-4/libparse/clk_rcc8000.c,v 4.5 1998/06/14 21:09:38 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/libparse/clk_rcc8000.c,v 4.6 1999/11/28 09:13:51 kardel RELEASE_19991128_A
*
- * clk_rcc8000.c,v 4.5 1998/06/14 21:09:38 kardel RELEASE_19990228_A
+ * clk_rcc8000.c,v 4.6 1999/11/28 09:13:51 kardel RELEASE_19991128_A
*
* Radiocode Clocks Ltd RCC 8000 Intelligent Off-Air Master Clock support
*
@@ -172,6 +172,9 @@ int clk_rcc8000_bs;
* History:
*
* clk_rcc8000.c,v
+ * Revision 4.6 1999/11/28 09:13:51 kardel
+ * RECON_4_0_98F
+ *
* Revision 4.5 1998/06/14 21:09:38 kardel
* Sun acc cleanup
*
diff --git a/contrib/ntp/libparse/clk_schmid.c b/contrib/ntp/libparse/clk_schmid.c
index 049b4e49c02d..5fb426833a0e 100644
--- a/contrib/ntp/libparse/clk_schmid.c
+++ b/contrib/ntp/libparse/clk_schmid.c
@@ -1,7 +1,7 @@
/*
- * /src/NTP/ntp-4/libparse/clk_schmid.c,v 4.4 1998/06/13 12:06:03 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/libparse/clk_schmid.c,v 4.5 1999/11/28 09:13:51 kardel RELEASE_19991128_A
*
- * clk_schmid.c,v 4.4 1998/06/13 12:06:03 kardel RELEASE_19990228_A
+ * clk_schmid.c,v 4.5 1999/11/28 09:13:51 kardel RELEASE_19991128_A
*
* Schmid clock support
*
@@ -211,6 +211,9 @@ int clk_schmid_bs;
* History:
*
* clk_schmid.c,v
+ * Revision 4.5 1999/11/28 09:13:51 kardel
+ * RECON_4_0_98F
+ *
* Revision 4.4 1998/06/13 12:06:03 kardel
* fix SYSV clock name clash
*
diff --git a/contrib/ntp/libparse/clk_trimtaip.c b/contrib/ntp/libparse/clk_trimtaip.c
index 2fd1eab74694..f18aaa06704a 100644
--- a/contrib/ntp/libparse/clk_trimtaip.c
+++ b/contrib/ntp/libparse/clk_trimtaip.c
@@ -1,7 +1,7 @@
/*
- * /src/NTP/ntp-4/libparse/clk_trimtaip.c,v 4.6 1998/08/16 18:46:27 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/libparse/clk_trimtaip.c,v 4.7 1999/11/28 09:13:51 kardel RELEASE_19991128_A
*
- * clk_trimtaip.c,v 4.6 1998/08/16 18:46:27 kardel RELEASE_19990228_A
+ * clk_trimtaip.c,v 4.7 1999/11/28 09:13:51 kardel RELEASE_19991128_A
*
* Trimble SV6 clock support - several collected codepieces
*/
@@ -161,6 +161,9 @@ int clk_trimtaip_bs;
* History:
*
* clk_trimtaip.c,v
+ * Revision 4.7 1999/11/28 09:13:51 kardel
+ * RECON_4_0_98F
+ *
* Revision 4.6 1998/08/16 18:46:27 kardel
* (clock_trimtaip =): changed format name
*
diff --git a/contrib/ntp/libparse/clk_trimtsip.c b/contrib/ntp/libparse/clk_trimtsip.c
index 52a753649ea6..54367f849093 100644
--- a/contrib/ntp/libparse/clk_trimtsip.c
+++ b/contrib/ntp/libparse/clk_trimtsip.c
@@ -1,7 +1,7 @@
/*
- * /src/NTP/ntp-4/libparse/clk_trimtsip.c,v 4.12 1999/02/28 13:00:08 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/libparse/clk_trimtsip.c,v 4.13 1999/11/28 09:13:51 kardel RELEASE_19991128_A
*
- * clk_trimtsip.c,v 4.12 1999/02/28 13:00:08 kardel RELEASE_19990228_A
+ * clk_trimtsip.c,v 4.13 1999/11/28 09:13:51 kardel RELEASE_19991128_A
*
* Trimble TSIP support - CURRENTLY VERY MUCH UNDER CONSTRUCTION
*/
@@ -372,6 +372,9 @@ int clk_trimtsip_bs;
* History:
*
* clk_trimtsip.c,v
+ * Revision 4.13 1999/11/28 09:13:51 kardel
+ * RECON_4_0_98F
+ *
* Revision 4.12 1999/02/28 13:00:08 kardel
* *** empty log message ***
*
diff --git a/contrib/ntp/libparse/data_mbg.c b/contrib/ntp/libparse/data_mbg.c
index af7987d0714a..2545b98182ae 100644
--- a/contrib/ntp/libparse/data_mbg.c
+++ b/contrib/ntp/libparse/data_mbg.c
@@ -1,5 +1,5 @@
/*
- * /src/NTP/ntp-4/libparse/data_mbg.c,v 4.3 1999/02/21 12:17:42 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/libparse/data_mbg.c,v 4.3 1999/02/21 12:17:42 kardel RELEASE_19991128_A
*
* $Created: Sun Jul 20 12:08:14 1997 $
*
diff --git a/contrib/ntp/libparse/parse.c b/contrib/ntp/libparse/parse.c
index 3d8485e14254..869b70f8b964 100644
--- a/contrib/ntp/libparse/parse.c
+++ b/contrib/ntp/libparse/parse.c
@@ -1,7 +1,7 @@
/*
- * /src/NTP/ntp-4/libparse/parse.c,v 4.13 1999/02/28 11:50:20 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/libparse/parse.c,v 4.14 1999/11/28 09:13:52 kardel RELEASE_19991128_A
*
- * parse.c,v 4.13 1999/02/28 11:50:20 kardel RELEASE_19990228_A
+ * parse.c,v 4.14 1999/11/28 09:13:52 kardel RELEASE_19991128_A
*
* Parser module for reference clock
*
@@ -27,7 +27,7 @@
#if defined(REFCLOCK) && defined(CLOCK_PARSE)
#if !(defined(lint) || defined(__GNUC__))
-static char rcsid[] = "parse.c,v 4.13 1999/02/28 11:50:20 kardel RELEASE_19990228_A";
+static char rcsid[] = "parse.c,v 4.14 1999/11/28 09:13:52 kardel RELEASE_19991128_A";
#endif
#include <sys/types.h>
@@ -869,6 +869,9 @@ int parse_bs;
* History:
*
* parse.c,v
+ * Revision 4.14 1999/11/28 09:13:52 kardel
+ * RECON_4_0_98F
+ *
* Revision 4.13 1999/02/28 11:50:20 kardel
* (timepacket): removed unecessary code
*
diff --git a/contrib/ntp/libparse/parse_conf.c b/contrib/ntp/libparse/parse_conf.c
index 3333cd97d6e1..353775d01407 100644
--- a/contrib/ntp/libparse/parse_conf.c
+++ b/contrib/ntp/libparse/parse_conf.c
@@ -1,7 +1,7 @@
/*
- * /src/NTP/ntp-4/libparse/parse_conf.c,v 4.4 1999/02/28 15:27:25 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/libparse/parse_conf.c,v 4.5 1999/11/28 09:13:53 kardel RELEASE_19991128_A
*
- * parse_conf.c,v 4.4 1999/02/28 15:27:25 kardel RELEASE_19990228_A
+ * parse_conf.c,v 4.5 1999/11/28 09:13:53 kardel RELEASE_19991128_A
*
* Parser configuration module for reference clocks
*
@@ -131,6 +131,9 @@ int parse_conf_bs;
* History:
*
* parse_conf.c,v
+ * Revision 4.5 1999/11/28 09:13:53 kardel
+ * RECON_4_0_98F
+ *
* Revision 4.4 1999/02/28 15:27:25 kardel
* wharton clock integration
*
diff --git a/contrib/ntp/libparse/parsesolaris.c b/contrib/ntp/libparse/parsesolaris.c
index e0e7c23bd382..ef56da570e96 100644
--- a/contrib/ntp/libparse/parsesolaris.c
+++ b/contrib/ntp/libparse/parsesolaris.c
@@ -1,7 +1,7 @@
/*
- * /src/NTP/ntp-4/libparse/parsesolaris.c,v 4.6 1998/11/15 21:56:08 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/libparse/parsesolaris.c,v 4.6 1998/11/15 21:56:08 kardel RELEASE_19991128_A
*
- * parsesolaris.c,v 4.6 1998/11/15 21:56:08 kardel RELEASE_19990228_A
+ * parsesolaris.c,v 4.6 1998/11/15 21:56:08 kardel RELEASE_19991128_A
*
* STREAMS module for reference clocks
*
@@ -19,7 +19,7 @@
#define _KERNEL /* it is a _KERNEL module */
#ifndef lint
-static char rcsid[] = "parsesolaris.c,v 4.6 1998/11/15 21:56:08 kardel RELEASE_19990228_A";
+static char rcsid[] = "parsesolaris.c,v 4.6 1998/11/15 21:56:08 kardel RELEASE_19991128_A";
#endif
#include <sys/types.h>
diff --git a/contrib/ntp/libparse/parsestreams.c b/contrib/ntp/libparse/parsestreams.c
index 1578229e19a8..8510ea114729 100644
--- a/contrib/ntp/libparse/parsestreams.c
+++ b/contrib/ntp/libparse/parsestreams.c
@@ -1,7 +1,7 @@
/*
- * /src/NTP/ntp-4/libparse/parsestreams.c,v 4.6 1998/12/20 23:45:31 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/libparse/parsestreams.c,v 4.7 1999/11/28 09:13:53 kardel RELEASE_19991128_A
*
- * parsestreams.c,v 4.6 1998/12/20 23:45:31 kardel RELEASE_19990228_A
+ * parsestreams.c,v 4.7 1999/11/28 09:13:53 kardel RELEASE_19991128_A
*
* STREAMS module for reference clocks
* (SunOS4.x)
@@ -23,7 +23,7 @@
#endif
#ifndef lint
-static char rcsid[] = "parsestreams.c,v 4.6 1998/12/20 23:45:31 kardel RELEASE_19990228_A";
+static char rcsid[] = "parsestreams.c,v 4.7 1999/11/28 09:13:53 kardel RELEASE_19991128_A";
#endif
#ifndef KERNEL
@@ -239,7 +239,7 @@ xxxinit(
}
else
{
- static char revision[] = "4.6";
+ static char revision[] = "4.7";
char *s, *S, *t;
s = rcsid; /* NOOP - keep compilers happy */
@@ -522,7 +522,7 @@ parseopen(
#ifdef VDDRV
printf("%s: Copyright (C) 1991-1998, Frank Kardel\n", parsesync_vd.Drv_name);
#else
- printf("%s: Copyright (C) 1991-1998, Frank Kardel\n", "parsestreams.c,v 4.6 1998/12/20 23:45:31 kardel RELEASE_19990228_A");
+ printf("%s: Copyright (C) 1991-1998, Frank Kardel\n", "parsestreams.c,v 4.7 1999/11/28 09:13:53 kardel RELEASE_19991128_A");
#endif
notice = 1;
}
@@ -1307,6 +1307,9 @@ zs_xsisr(
* History:
*
* parsestreams.c,v
+ * Revision 4.7 1999/11/28 09:13:53 kardel
+ * RECON_4_0_98F
+ *
* Revision 4.6 1998/12/20 23:45:31 kardel
* fix types and warnings
*
diff --git a/contrib/ntp/librsaref/Makefile.in b/contrib/ntp/librsaref/Makefile.in
index e2373e26ad42..70b69fcf6470 100644
--- a/contrib/ntp/librsaref/Makefile.in
+++ b/contrib/ntp/librsaref/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
#AUTOMAKE_OPTIONS = ../util/ansi2knr
@@ -143,6 +147,7 @@ LIBRARIES = $(noinst_LIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LIBS = @LIBS@
+librsaref_a_AR = $(AR) cru
librsaref_a_LIBADD =
am_librsaref_a_OBJECTS = desc.o digit.o md2c.o md5c.o nn.o prime.o \
r_dh.o r_encode.o r_enhanc.o r_keygen.o r_random.o r_stdlib.o rsa.o
@@ -158,16 +163,22 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/desc.Po $(DEPDIR)/digit.Po \
+$(DEPDIR)/md2c.Po $(DEPDIR)/md5c.Po $(DEPDIR)/nn.Po $(DEPDIR)/prime.Po \
+$(DEPDIR)/r_dh.Po $(DEPDIR)/r_encode.Po $(DEPDIR)/r_enhanc.Po \
+$(DEPDIR)/r_keygen.Po $(DEPDIR)/r_random.Po $(DEPDIR)/r_stdlib.Po \
+$(DEPDIR)/rsa.Po
SOURCES = $(librsaref_a_SOURCES)
OBJECTS = $(am_librsaref_a_OBJECTS)
all: all-redirect
.SUFFIXES:
-.SUFFIXES: .c .o
+.SUFFIXES: .c .h .o
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps librsaref/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu librsaref/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -181,9 +192,6 @@ distclean-noinstLIBRARIES:
maintainer-clean-noinstLIBRARIES:
-.c.o:
- $(COMPILE) -c $<
-
mostlyclean-compile:
-rm -f *.o core *.core
@@ -193,44 +201,35 @@ distclean-compile:
-rm -f *.tab.c
maintainer-clean-compile:
-desc.o:
-digit.o:
-md2c.o:
-md5c.o:
-nn.o:
-prime.o:
-r_dh.o:
-r_encode.o:
-r_enhanc.o:
-r_keygen.o:
-r_random.o:
-r_stdlib.o:
-rsa.o:
librsaref.a: $(librsaref_a_OBJECTS) $(librsaref_a_DEPENDENCIES)
-rm -f librsaref.a
- $(AR) cru librsaref.a $(librsaref_a_OBJECTS) $(librsaref_a_LIBADD)
+ $(librsaref_a_AR) librsaref.a $(librsaref_a_OBJECTS) $(librsaref_a_LIBADD)
$(RANLIB) librsaref.a
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -247,7 +246,7 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
@@ -255,6 +254,37 @@ distdir: $(DISTFILES)
fi; \
done
+@AMDEP@include $(DEPDIR)/desc.Po
+@AMDEP@include $(DEPDIR)/digit.Po
+@AMDEP@include $(DEPDIR)/md2c.Po
+@AMDEP@include $(DEPDIR)/md5c.Po
+@AMDEP@include $(DEPDIR)/nn.Po
+@AMDEP@include $(DEPDIR)/prime.Po
+@AMDEP@include $(DEPDIR)/r_dh.Po
+@AMDEP@include $(DEPDIR)/r_encode.Po
+@AMDEP@include $(DEPDIR)/r_enhanc.Po
+@AMDEP@include $(DEPDIR)/r_keygen.Po
+@AMDEP@include $(DEPDIR)/r_random.Po
+@AMDEP@include $(DEPDIR)/r_stdlib.Po
+@AMDEP@include $(DEPDIR)/rsa.Po
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf $(DEPDIR)
+
+maintainer-clean-depend:
+
+@AMDEP@CCDEPMODE = @CCDEPMODE@
+
+.c.o:
+@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c -o $@ $<
+
info-am:
info: info-am
dvi-am:
@@ -291,25 +321,28 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
+ -rm -f Makefile.in
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
- mostlyclean-tags mostlyclean-generic
+ mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-am
-clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \
- mostlyclean-am
+clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
+ clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-noinstLIBRARIES distclean-compile \
- distclean-tags distclean-generic clean-am
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-tags \
- maintainer-clean-generic distclean-am
+ maintainer-clean-depend maintainer-clean-generic \
+ distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -319,12 +352,13 @@ maintainer-clean: maintainer-clean-am
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
-check-am installcheck-am installcheck install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all install-strip installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+clean-tags maintainer-clean-tags distdir mostlyclean-depend \
+distclean-depend clean-depend maintainer-clean-depend info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all install-strip \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
#EXTRA_DIST =
diff --git a/contrib/ntp/missing b/contrib/ntp/missing
index a6abd069801c..c60e9d772f4b 100755
--- a/contrib/ntp/missing
+++ b/contrib/ntp/missing
@@ -1,7 +1,7 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
-# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
+# Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# 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
@@ -23,6 +23,19 @@ if test $# -eq 0; then
exit 1
fi
+run=:
+
+case "$1" in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
case "$1" in
-h|--h|--he|--hel|--help)
@@ -35,19 +48,23 @@ error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
- bison touch file \`y.tab.c'
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
- yacc touch file \`y.tab.c'"
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing - GNU libit 0.0"
+ echo "missing 0.2 - GNU automake"
;;
-*)
@@ -80,7 +97,17 @@ WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`configure.in'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
- touch config.h.in
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case "$f" in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
;;
automake)
@@ -89,9 +116,9 @@ WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
- find . -type f -name Makefile.am -print \
- | sed 's/^\(.*\).am$/touch \1.in/' \
- | sh
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
;;
bison|yacc)
@@ -100,7 +127,51 @@ WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
- touch y.tab.c
+ rm -f y.tab.c y.tab.h
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f y.tab.h ]; then
+ echo >y.tab.h
+ fi
+ if [ ! -f y.tab.c ]; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f lex.yy.c ]; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
;;
makeinfo)
@@ -119,6 +190,45 @@ WARNING: \`$1' is missing on your system. You should only need it if
touch $file
;;
+ tar)
+ shift
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ fi
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar ${1+"$@"} && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar ${1+"$@"} && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case "$firstarg" in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" ${1+"$@"} && exit 0
+ ;;
+ esac
+ case "$firstarg" in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" ${1+"$@"} && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
diff --git a/contrib/ntp/mkinstalldirs b/contrib/ntp/mkinstalldirs
index 91f6d04e17c2..b8d650a99b0a 100755
--- a/contrib/ntp/mkinstalldirs
+++ b/contrib/ntp/mkinstalldirs
@@ -1,26 +1,34 @@
-#!/bin/sh
+#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
-# Last modified: 1994-03-25
# Public domain
+# $Id: mkinstalldirs,v 1.2 1999/12/20 04:14:36 stenn Exp $
+
errstatus=0
-for file in ${1+"$@"} ; do
+for file
+do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
- for d in ${1+"$@"} ; do
+ for d
+ do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp" 1>&2
- mkdir "$pathcomp" || errstatus=$?
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
fi
pathcomp="$pathcomp/"
diff --git a/contrib/ntp/ntpd/Makefile.am b/contrib/ntp/ntpd/Makefile.am
index 992668443255..2fd16c431d57 100644
--- a/contrib/ntp/ntpd/Makefile.am
+++ b/contrib/ntp/ntpd/Makefile.am
@@ -15,22 +15,19 @@ EXTRA_PROGRAMS = check_y2k
check-local: @MAKE_CHECK_Y2K@
[ -z "@MAKE_CHECK_Y2K@" ] || ./@MAKE_CHECK_Y2K@
-ntpd_SOURCES = map_vme.c ntp_config.c ntp_control.c ntp_io.c \
- ntp_loopfilter.c ntp_monitor.c ntp_peer.c ntp_proto.c \
- ntp_refclock.c ntp_request.c ntp_restrict.c ntp_timer.c \
- ntp_util.c ntp_intres.c ntp_filegen.c ntpd.c \
- refclock_conf.c refclock_chu.c refclock_local.c \
- refclock_pst.c refclock_wwvb.c refclock_mx4200.c \
- refclock_parse.c refclock_as2201.c refclock_bancomm.c \
- refclock_tpro.c refclock_leitch.c refclock_irig.c \
- refclock_msfees.c refclock_trak.c refclock_datum.c \
- refclock_acts.c refclock_heath.c refclock_nmea.c \
- refclock_atom.c refclock_ptbacts.c refclock_jupiter.c \
- refclock_usno.c refclock_true.c refclock_hpgps.c \
- refclock_shm.c refclock_gpsvme.c refclock_arbiter.c \
- refclock_arc.c refclock_palisade.c refclock_palisade.h \
- refclock_oncore.c refclock_chronolog.c refclock_dumbclock.c \
- refclock_ulink.c jupiter.h
+ntpd_SOURCES = jupiter.h map_vme.c ntp_config.c ntp_control.c ntp_filegen.c \
+ ntp_intres.c ntp_io.c ntp_loopfilter.c ntp_monitor.c ntp_peer.c \
+ ntp_proto.c ntp_refclock.c ntp_request.c ntp_restrict.c ntp_timer.c \
+ ntp_util.c ntpd.c refclock_acts.c refclock_arbiter.c refclock_arc.c \
+ refclock_as2201.c refclock_atom.c refclock_bancomm.c \
+ refclock_chronolog.c refclock_chu.c refclock_conf.c refclock_datum.c \
+ refclock_dumbclock.c refclock_fg.c refclock_gpsvme.c refclock_heath.c \
+ refclock_hpgps.c refclock_irig.c refclock_jupiter.c refclock_leitch.c \
+ refclock_local.c refclock_msfees.c refclock_mx4200.c refclock_nmea.c \
+ refclock_oncore.c refclock_palisade.c refclock_palisade.h \
+ refclock_parse.c refclock_pcf.c refclock_pst.c refclock_ptbacts.c \
+ refclock_shm.c refclock_tpro.c refclock_trak.c refclock_true.c \
+ refclock_ulink.c refclock_usno.c refclock_wwv.c refclock_wwvb.c
$(PROGRAMS): $(LDADD)
diff --git a/contrib/ntp/ntpd/Makefile.in b/contrib/ntp/ntpd/Makefile.in
index ac5e59191f96..d12a34387c09 100644
--- a/contrib/ntp/ntpd/Makefile.in
+++ b/contrib/ntp/ntpd/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
@@ -110,22 +114,19 @@ ETAGS_ARGS = Makefile.am
check_PROGRAMS = @MAKE_CHECK_Y2K@
EXTRA_PROGRAMS = check_y2k
-ntpd_SOURCES = map_vme.c ntp_config.c ntp_control.c ntp_io.c \
- ntp_loopfilter.c ntp_monitor.c ntp_peer.c ntp_proto.c \
- ntp_refclock.c ntp_request.c ntp_restrict.c ntp_timer.c \
- ntp_util.c ntp_intres.c ntp_filegen.c ntpd.c \
- refclock_conf.c refclock_chu.c refclock_local.c \
- refclock_pst.c refclock_wwvb.c refclock_mx4200.c \
- refclock_parse.c refclock_as2201.c refclock_bancomm.c \
- refclock_tpro.c refclock_leitch.c refclock_irig.c \
- refclock_msfees.c refclock_trak.c refclock_datum.c \
- refclock_acts.c refclock_heath.c refclock_nmea.c \
- refclock_atom.c refclock_ptbacts.c refclock_jupiter.c \
- refclock_usno.c refclock_true.c refclock_hpgps.c \
- refclock_shm.c refclock_gpsvme.c refclock_arbiter.c \
- refclock_arc.c refclock_palisade.c refclock_palisade.h \
- refclock_oncore.c refclock_chronolog.c refclock_dumbclock.c \
- refclock_ulink.c jupiter.h
+ntpd_SOURCES = jupiter.h map_vme.c ntp_config.c ntp_control.c ntp_filegen.c \
+ ntp_intres.c ntp_io.c ntp_loopfilter.c ntp_monitor.c ntp_peer.c \
+ ntp_proto.c ntp_refclock.c ntp_request.c ntp_restrict.c ntp_timer.c \
+ ntp_util.c ntpd.c refclock_acts.c refclock_arbiter.c refclock_arc.c \
+ refclock_as2201.c refclock_atom.c refclock_bancomm.c \
+ refclock_chronolog.c refclock_chu.c refclock_conf.c refclock_datum.c \
+ refclock_dumbclock.c refclock_fg.c refclock_gpsvme.c refclock_heath.c \
+ refclock_hpgps.c refclock_irig.c refclock_jupiter.c refclock_leitch.c \
+ refclock_local.c refclock_msfees.c refclock_mx4200.c refclock_nmea.c \
+ refclock_oncore.c refclock_palisade.c refclock_palisade.h \
+ refclock_parse.c refclock_pcf.c refclock_pst.c refclock_ptbacts.c \
+ refclock_shm.c refclock_tpro.c refclock_trak.c refclock_true.c \
+ refclock_ulink.c refclock_usno.c refclock_wwv.c refclock_wwvb.c
subdir = ntpd
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -143,21 +144,22 @@ check_y2k_OBJECTS = check_y2k$U.o
check_y2k_LDADD = $(LDADD)
check_y2k_DEPENDENCIES = version.o ../libntp/libntp.a
check_y2k_LDFLAGS =
-am_ntpd_OBJECTS = map_vme$U.o ntp_config$U.o ntp_control$U.o ntp_io$U.o \
-ntp_loopfilter$U.o ntp_monitor$U.o ntp_peer$U.o ntp_proto$U.o \
-ntp_refclock$U.o ntp_request$U.o ntp_restrict$U.o ntp_timer$U.o \
-ntp_util$U.o ntp_intres$U.o ntp_filegen$U.o ntpd$U.o refclock_conf$U.o \
-refclock_chu$U.o refclock_local$U.o refclock_pst$U.o refclock_wwvb$U.o \
-refclock_mx4200$U.o refclock_parse$U.o refclock_as2201$U.o \
-refclock_bancomm$U.o refclock_tpro$U.o refclock_leitch$U.o \
-refclock_irig$U.o refclock_msfees$U.o refclock_trak$U.o \
-refclock_datum$U.o refclock_acts$U.o refclock_heath$U.o \
-refclock_nmea$U.o refclock_atom$U.o refclock_ptbacts$U.o \
-refclock_jupiter$U.o refclock_usno$U.o refclock_true$U.o \
-refclock_hpgps$U.o refclock_shm$U.o refclock_gpsvme$U.o \
-refclock_arbiter$U.o refclock_arc$U.o refclock_palisade$U.o \
-refclock_oncore$U.o refclock_chronolog$U.o refclock_dumbclock$U.o \
-refclock_ulink$U.o
+am_ntpd_OBJECTS = map_vme$U.o ntp_config$U.o ntp_control$U.o \
+ntp_filegen$U.o ntp_intres$U.o ntp_io$U.o ntp_loopfilter$U.o \
+ntp_monitor$U.o ntp_peer$U.o ntp_proto$U.o ntp_refclock$U.o \
+ntp_request$U.o ntp_restrict$U.o ntp_timer$U.o ntp_util$U.o ntpd$U.o \
+refclock_acts$U.o refclock_arbiter$U.o refclock_arc$U.o \
+refclock_as2201$U.o refclock_atom$U.o refclock_bancomm$U.o \
+refclock_chronolog$U.o refclock_chu$U.o refclock_conf$U.o \
+refclock_datum$U.o refclock_dumbclock$U.o refclock_fg$U.o \
+refclock_gpsvme$U.o refclock_heath$U.o refclock_hpgps$U.o \
+refclock_irig$U.o refclock_jupiter$U.o refclock_leitch$U.o \
+refclock_local$U.o refclock_msfees$U.o refclock_mx4200$U.o \
+refclock_nmea$U.o refclock_oncore$U.o refclock_palisade$U.o \
+refclock_parse$U.o refclock_pcf$U.o refclock_pst$U.o \
+refclock_ptbacts$U.o refclock_shm$U.o refclock_tpro$U.o \
+refclock_trak$U.o refclock_true$U.o refclock_ulink$U.o \
+refclock_usno$U.o refclock_wwv$U.o refclock_wwvb$U.o
ntpd_OBJECTS = $(am_ntpd_OBJECTS)
ntpd_DEPENDENCIES = version.o ../libntp/libntp.a
ntpd_LDFLAGS =
@@ -171,16 +173,43 @@ DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/check_y2k$U.Po $(DEPDIR)/map_vme$U.Po \
+$(DEPDIR)/ntp_config$U.Po $(DEPDIR)/ntp_control$U.Po \
+$(DEPDIR)/ntp_filegen$U.Po $(DEPDIR)/ntp_intres$U.Po \
+$(DEPDIR)/ntp_io$U.Po $(DEPDIR)/ntp_loopfilter$U.Po \
+$(DEPDIR)/ntp_monitor$U.Po $(DEPDIR)/ntp_peer$U.Po \
+$(DEPDIR)/ntp_proto$U.Po $(DEPDIR)/ntp_refclock$U.Po \
+$(DEPDIR)/ntp_request$U.Po $(DEPDIR)/ntp_restrict$U.Po \
+$(DEPDIR)/ntp_timer$U.Po $(DEPDIR)/ntp_util$U.Po $(DEPDIR)/ntpd$U.Po \
+$(DEPDIR)/refclock_acts$U.Po $(DEPDIR)/refclock_arbiter$U.Po \
+$(DEPDIR)/refclock_arc$U.Po $(DEPDIR)/refclock_as2201$U.Po \
+$(DEPDIR)/refclock_atom$U.Po $(DEPDIR)/refclock_bancomm$U.Po \
+$(DEPDIR)/refclock_chronolog$U.Po $(DEPDIR)/refclock_chu$U.Po \
+$(DEPDIR)/refclock_conf$U.Po $(DEPDIR)/refclock_datum$U.Po \
+$(DEPDIR)/refclock_dumbclock$U.Po $(DEPDIR)/refclock_fg$U.Po \
+$(DEPDIR)/refclock_gpsvme$U.Po $(DEPDIR)/refclock_heath$U.Po \
+$(DEPDIR)/refclock_hpgps$U.Po $(DEPDIR)/refclock_irig$U.Po \
+$(DEPDIR)/refclock_jupiter$U.Po $(DEPDIR)/refclock_leitch$U.Po \
+$(DEPDIR)/refclock_local$U.Po $(DEPDIR)/refclock_msfees$U.Po \
+$(DEPDIR)/refclock_mx4200$U.Po $(DEPDIR)/refclock_nmea$U.Po \
+$(DEPDIR)/refclock_oncore$U.Po $(DEPDIR)/refclock_palisade$U.Po \
+$(DEPDIR)/refclock_parse$U.Po $(DEPDIR)/refclock_pcf$U.Po \
+$(DEPDIR)/refclock_pst$U.Po $(DEPDIR)/refclock_ptbacts$U.Po \
+$(DEPDIR)/refclock_shm$U.Po $(DEPDIR)/refclock_tpro$U.Po \
+$(DEPDIR)/refclock_trak$U.Po $(DEPDIR)/refclock_true$U.Po \
+$(DEPDIR)/refclock_ulink$U.Po $(DEPDIR)/refclock_usno$U.Po \
+$(DEPDIR)/refclock_wwv$U.Po $(DEPDIR)/refclock_wwvb$U.Po
SOURCES = check_y2k.c $(ntpd_SOURCES)
OBJECTS = check_y2k$U.o $(am_ntpd_OBJECTS)
all: all-redirect
.SUFFIXES:
-.SUFFIXES: .c .o
+.SUFFIXES: .c .h .o
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps ntpd/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu ntpd/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -222,9 +251,6 @@ distclean-checkPROGRAMS:
maintainer-clean-checkPROGRAMS:
-.c.o:
- $(COMPILE) -c $<
-
mostlyclean-compile:
-rm -f *.o core *.core
@@ -249,60 +275,10 @@ clean-kr:
distclean-kr:
maintainer-clean-kr:
-check_y2k$U.o:
check_y2k: $(check_y2k_OBJECTS) $(check_y2k_DEPENDENCIES)
@rm -f check_y2k
$(LINK) $(check_y2k_LDFLAGS) $(check_y2k_OBJECTS) $(check_y2k_LDADD) $(LIBS)
-map_vme$U.o:
-ntp_config$U.o:
-ntp_control$U.o:
-ntp_io$U.o:
-ntp_loopfilter$U.o:
-ntp_monitor$U.o:
-ntp_peer$U.o:
-ntp_proto$U.o:
-ntp_refclock$U.o:
-ntp_request$U.o:
-ntp_restrict$U.o:
-ntp_timer$U.o:
-ntp_util$U.o:
-ntp_intres$U.o:
-ntp_filegen$U.o:
-ntpd$U.o:
-refclock_conf$U.o:
-refclock_chu$U.o:
-refclock_local$U.o:
-refclock_pst$U.o:
-refclock_wwvb$U.o:
-refclock_mx4200$U.o:
-refclock_parse$U.o:
-refclock_as2201$U.o:
-refclock_bancomm$U.o:
-refclock_tpro$U.o:
-refclock_leitch$U.o:
-refclock_irig$U.o:
-refclock_msfees$U.o:
-refclock_trak$U.o:
-refclock_datum$U.o:
-refclock_acts$U.o:
-refclock_heath$U.o:
-refclock_nmea$U.o:
-refclock_atom$U.o:
-refclock_ptbacts$U.o:
-refclock_jupiter$U.o:
-refclock_usno$U.o:
-refclock_true$U.o:
-refclock_hpgps$U.o:
-refclock_shm$U.o:
-refclock_gpsvme$U.o:
-refclock_arbiter$U.o:
-refclock_arc$U.o:
-refclock_palisade$U.o:
-refclock_oncore$U.o:
-refclock_chronolog$U.o:
-refclock_dumbclock$U.o:
-refclock_ulink$U.o:
ntpd: $(ntpd_OBJECTS) $(ntpd_DEPENDENCIES)
@rm -f ntpd
@@ -363,6 +339,8 @@ refclock_datum_.c: refclock_datum.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_datum.c; then echo $(srcdir)/refclock_datum.c; else echo refclock_datum.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_datum_.c
refclock_dumbclock_.c: refclock_dumbclock.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_dumbclock.c; then echo $(srcdir)/refclock_dumbclock.c; else echo refclock_dumbclock.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_dumbclock_.c
+refclock_fg_.c: refclock_fg.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_fg.c; then echo $(srcdir)/refclock_fg.c; else echo refclock_fg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_fg_.c
refclock_gpsvme_.c: refclock_gpsvme.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_gpsvme.c; then echo $(srcdir)/refclock_gpsvme.c; else echo refclock_gpsvme.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_gpsvme_.c
refclock_heath_.c: refclock_heath.c $(ANSI2KNR)
@@ -389,6 +367,8 @@ refclock_palisade_.c: refclock_palisade.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_palisade.c; then echo $(srcdir)/refclock_palisade.c; else echo refclock_palisade.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_palisade_.c
refclock_parse_.c: refclock_parse.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_parse.c; then echo $(srcdir)/refclock_parse.c; else echo refclock_parse.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_parse_.c
+refclock_pcf_.c: refclock_pcf.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_pcf.c; then echo $(srcdir)/refclock_pcf.c; else echo refclock_pcf.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_pcf_.c
refclock_pst_.c: refclock_pst.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_pst.c; then echo $(srcdir)/refclock_pst.c; else echo refclock_pst.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_pst_.c
refclock_ptbacts_.c: refclock_ptbacts.c $(ANSI2KNR)
@@ -405,6 +385,8 @@ refclock_ulink_.c: refclock_ulink.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_ulink.c; then echo $(srcdir)/refclock_ulink.c; else echo refclock_ulink.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_ulink_.c
refclock_usno_.c: refclock_usno.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_usno.c; then echo $(srcdir)/refclock_usno.c; else echo refclock_usno.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_usno_.c
+refclock_wwv_.c: refclock_wwv.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_wwv.c; then echo $(srcdir)/refclock_wwv.c; else echo refclock_wwv.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_wwv_.c
refclock_wwvb_.c: refclock_wwvb.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/refclock_wwvb.c; then echo $(srcdir)/refclock_wwvb.c; else echo refclock_wwvb.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > refclock_wwvb_.c
check_y2k_.o map_vme_.o ntp_config_.o ntp_control_.o ntp_filegen_.o \
@@ -413,34 +395,38 @@ ntp_proto_.o ntp_refclock_.o ntp_request_.o ntp_restrict_.o \
ntp_timer_.o ntp_util_.o ntpd_.o refclock_acts_.o refclock_arbiter_.o \
refclock_arc_.o refclock_as2201_.o refclock_atom_.o refclock_bancomm_.o \
refclock_chronolog_.o refclock_chu_.o refclock_conf_.o \
-refclock_datum_.o refclock_dumbclock_.o refclock_gpsvme_.o \
-refclock_heath_.o refclock_hpgps_.o refclock_irig_.o \
+refclock_datum_.o refclock_dumbclock_.o refclock_fg_.o \
+refclock_gpsvme_.o refclock_heath_.o refclock_hpgps_.o refclock_irig_.o \
refclock_jupiter_.o refclock_leitch_.o refclock_local_.o \
refclock_msfees_.o refclock_mx4200_.o refclock_nmea_.o \
refclock_oncore_.o refclock_palisade_.o refclock_parse_.o \
-refclock_pst_.o refclock_ptbacts_.o refclock_shm_.o refclock_tpro_.o \
-refclock_trak_.o refclock_true_.o refclock_ulink_.o refclock_usno_.o \
-refclock_wwvb_.o : $(ANSI2KNR)
+refclock_pcf_.o refclock_pst_.o refclock_ptbacts_.o refclock_shm_.o \
+refclock_tpro_.o refclock_trak_.o refclock_true_.o refclock_ulink_.o \
+refclock_usno_.o refclock_wwv_.o refclock_wwvb_.o : $(ANSI2KNR)
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -457,356 +443,84 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
-check_y2k.o: check_y2k.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_malloc.h \
- ../include/ntp_refclock.h ../include/recvbuff.h \
- ../include/ntp_calendar.h ../include/parse.h \
- ../include/parse_conf.h
-map_vme.o: map_vme.c ../config.h
-ntp_config.o: ntp_config.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ../include/ntp_filegen.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-ntp_control.o: ntp_control.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_control.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-ntp_filegen.o: ntp_filegen.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_string.h ../include/ntp_calendar.h \
- ../include/ntp_filegen.h ../include/ntp_stdlib.h \
- ../include/l_stdlib.h
-ntp_intres.o: ntp_intres.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_request.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-ntp_io.o: ntp_io.c ../config.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h ../include/iosignal.h \
- ../include/ntp_if.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-ntp_loopfilter.o: ntp_loopfilter.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h \
- ../include/ntp_syscall.h
-ntp_monitor.o: ntp_monitor.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h ../include/ntp_if.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-ntp_peer.o: ntp_peer.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-ntp_proto.o: ntp_proto.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h \
- ../include/ntp_unixtime.h ../include/ntp_control.h
-ntp_refclock.o: ntp_refclock.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-ntp_request.o: ntp_request.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_request.h ../include/ntp_control.h \
- ../include/ntp_if.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h \
- ../include/ntp_syscall.h
-ntp_restrict.o: ntp_restrict.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_if.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-ntp_timer.o: ntp_timer.c ../config.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-ntp_util.o: ntp_util.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ../include/ntp_filegen.h \
- ../include/ntp_if.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-ntpd.o: ntpd.c ../config.h ../include/ntpd.h ../include/ntp_syslog.h \
- ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../include/ntp_proto.h \
- ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-refclock_acts.o: refclock_acts.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h \
- ../include/ntp_control.h
-refclock_arbiter.o: refclock_arbiter.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-refclock_arc.o: refclock_arc.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-refclock_as2201.o: refclock_as2201.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-refclock_atom.o: refclock_atom.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-refclock_bancomm.o: refclock_bancomm.c ../config.h
-refclock_chronolog.o: refclock_chronolog.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_calendar.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-refclock_chu.o: refclock_chu.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_calendar.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-refclock_conf.o: refclock_conf.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-refclock_datum.o: refclock_datum.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-refclock_dumbclock.o: refclock_dumbclock.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_calendar.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-refclock_gpsvme.o: refclock_gpsvme.c ../config.h
-refclock_heath.o: refclock_heath.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-refclock_hpgps.o: refclock_hpgps.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-refclock_irig.o: refclock_irig.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_calendar.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-refclock_jupiter.o: refclock_jupiter.c ../config.h
-refclock_leitch.o: refclock_leitch.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-refclock_local.o: refclock_local.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h \
- ../include/ntp_syscall.h
-refclock_msfees.o: refclock_msfees.c ../config.h
-refclock_mx4200.o: refclock_mx4200.c ../config.h
-refclock_nmea.o: refclock_nmea.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-refclock_oncore.o: refclock_oncore.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-refclock_palisade.o: refclock_palisade.c ../config.h refclock_palisade.h \
- ../include/ntpd.h ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_control.h ../include/ntp_unixtime.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-refclock_parse.o: refclock_parse.c ../config.h
-refclock_pst.o: refclock_pst.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-refclock_ptbacts.o: refclock_ptbacts.c ../config.h refclock_acts.c \
- ../include/ntpd.h ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h \
- ../include/ntp_control.h
-refclock_shm.o: refclock_shm.c ../config.h
-refclock_tpro.o: refclock_tpro.c ../config.h
-refclock_trak.o: refclock_trak.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h ../include/ntp_unixtime.h
-refclock_true.o: refclock_true.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-refclock_ulink.o: refclock_ulink.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_calendar.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-refclock_usno.o: refclock_usno.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h \
- ../include/ntp_control.h
-refclock_wwvb.o: refclock_wwvb.c ../config.h ../include/ntpd.h \
- ../include/ntp_syslog.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_select.h \
- ../include/ntp_malloc.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_io.h \
- ../include/ntp_calendar.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
+
+@AMDEP@include $(DEPDIR)/check_y2k$U.Po
+@AMDEP@include $(DEPDIR)/map_vme$U.Po
+@AMDEP@include $(DEPDIR)/ntp_config$U.Po
+@AMDEP@include $(DEPDIR)/ntp_control$U.Po
+@AMDEP@include $(DEPDIR)/ntp_filegen$U.Po
+@AMDEP@include $(DEPDIR)/ntp_intres$U.Po
+@AMDEP@include $(DEPDIR)/ntp_io$U.Po
+@AMDEP@include $(DEPDIR)/ntp_loopfilter$U.Po
+@AMDEP@include $(DEPDIR)/ntp_monitor$U.Po
+@AMDEP@include $(DEPDIR)/ntp_peer$U.Po
+@AMDEP@include $(DEPDIR)/ntp_proto$U.Po
+@AMDEP@include $(DEPDIR)/ntp_refclock$U.Po
+@AMDEP@include $(DEPDIR)/ntp_request$U.Po
+@AMDEP@include $(DEPDIR)/ntp_restrict$U.Po
+@AMDEP@include $(DEPDIR)/ntp_timer$U.Po
+@AMDEP@include $(DEPDIR)/ntp_util$U.Po
+@AMDEP@include $(DEPDIR)/ntpd$U.Po
+@AMDEP@include $(DEPDIR)/refclock_acts$U.Po
+@AMDEP@include $(DEPDIR)/refclock_arbiter$U.Po
+@AMDEP@include $(DEPDIR)/refclock_arc$U.Po
+@AMDEP@include $(DEPDIR)/refclock_as2201$U.Po
+@AMDEP@include $(DEPDIR)/refclock_atom$U.Po
+@AMDEP@include $(DEPDIR)/refclock_bancomm$U.Po
+@AMDEP@include $(DEPDIR)/refclock_chronolog$U.Po
+@AMDEP@include $(DEPDIR)/refclock_chu$U.Po
+@AMDEP@include $(DEPDIR)/refclock_conf$U.Po
+@AMDEP@include $(DEPDIR)/refclock_datum$U.Po
+@AMDEP@include $(DEPDIR)/refclock_dumbclock$U.Po
+@AMDEP@include $(DEPDIR)/refclock_fg$U.Po
+@AMDEP@include $(DEPDIR)/refclock_gpsvme$U.Po
+@AMDEP@include $(DEPDIR)/refclock_heath$U.Po
+@AMDEP@include $(DEPDIR)/refclock_hpgps$U.Po
+@AMDEP@include $(DEPDIR)/refclock_irig$U.Po
+@AMDEP@include $(DEPDIR)/refclock_jupiter$U.Po
+@AMDEP@include $(DEPDIR)/refclock_leitch$U.Po
+@AMDEP@include $(DEPDIR)/refclock_local$U.Po
+@AMDEP@include $(DEPDIR)/refclock_msfees$U.Po
+@AMDEP@include $(DEPDIR)/refclock_mx4200$U.Po
+@AMDEP@include $(DEPDIR)/refclock_nmea$U.Po
+@AMDEP@include $(DEPDIR)/refclock_oncore$U.Po
+@AMDEP@include $(DEPDIR)/refclock_palisade$U.Po
+@AMDEP@include $(DEPDIR)/refclock_parse$U.Po
+@AMDEP@include $(DEPDIR)/refclock_pcf$U.Po
+@AMDEP@include $(DEPDIR)/refclock_pst$U.Po
+@AMDEP@include $(DEPDIR)/refclock_ptbacts$U.Po
+@AMDEP@include $(DEPDIR)/refclock_shm$U.Po
+@AMDEP@include $(DEPDIR)/refclock_tpro$U.Po
+@AMDEP@include $(DEPDIR)/refclock_trak$U.Po
+@AMDEP@include $(DEPDIR)/refclock_true$U.Po
+@AMDEP@include $(DEPDIR)/refclock_ulink$U.Po
+@AMDEP@include $(DEPDIR)/refclock_usno$U.Po
+@AMDEP@include $(DEPDIR)/refclock_wwv$U.Po
+@AMDEP@include $(DEPDIR)/refclock_wwvb$U.Po
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf $(DEPDIR)
+
+maintainer-clean-depend:
+
+@AMDEP@CCDEPMODE = @CCDEPMODE@
+
+.c.o:
+@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c -o $@ $<
info-am:
info: info-am
@@ -847,27 +561,29 @@ distclean-generic:
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-checkPROGRAMS \
mostlyclean-compile mostlyclean-kr mostlyclean-tags \
- mostlyclean-generic
+ mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-compile clean-kr \
- clean-tags clean-generic mostlyclean-am
+ clean-tags clean-depend clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-binPROGRAMS distclean-checkPROGRAMS \
distclean-compile distclean-kr distclean-tags \
- distclean-generic clean-am
+ distclean-depend distclean-generic clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-binPROGRAMS \
maintainer-clean-checkPROGRAMS maintainer-clean-compile \
maintainer-clean-kr maintainer-clean-tags \
- maintainer-clean-generic distclean-am
+ maintainer-clean-depend maintainer-clean-generic \
+ distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -879,10 +595,11 @@ mostlyclean-checkPROGRAMS distclean-checkPROGRAMS clean-checkPROGRAMS \
maintainer-clean-checkPROGRAMS mostlyclean-compile distclean-compile \
clean-compile maintainer-clean-compile mostlyclean-kr distclean-kr \
clean-kr maintainer-clean-kr tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi \
-check-local check check-am installcheck-am installcheck install-exec-am \
-install-exec install-data-am install-data install-am install \
-uninstall-am uninstall all-redirect all-am all install-strip \
+clean-tags maintainer-clean-tags distdir mostlyclean-depend \
+distclean-depend clean-depend maintainer-clean-depend info-am info \
+dvi-am dvi check-local check check-am installcheck-am installcheck \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all install-strip \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
diff --git a/contrib/ntp/ntpd/map_vme.c b/contrib/ntp/ntpd/map_vme.c
index 3c161cc91450..e4569ce66763 100644
--- a/contrib/ntp/ntpd/map_vme.c
+++ b/contrib/ntp/ntpd/map_vme.c
@@ -74,7 +74,7 @@ map_vme (
}
if(tx.error)
printf("io_testr failed internal error %d\n",tx.error);
- if(tx.access_result <= 0) {
+ if(tx.access_result < 0) {
printf("io_testr failed\n");
exit(2);
}
diff --git a/contrib/ntp/ntpd/ntp_control.c b/contrib/ntp/ntpd/ntp_control.c
index e63765f0d2b4..e2fb03995f52 100644
--- a/contrib/ntp/ntpd/ntp_control.c
+++ b/contrib/ntp/ntpd/ntp_control.c
@@ -341,6 +341,9 @@ static u_char clocktypes[] = {
CTL_SST_TS_LF, /* REFCLK_CHRONOLOG (32) */
CTL_SST_TS_LF, /* REFCLK_DUMBCLOCK (32) */
CTL_SST_TS_LF, /* REFCLK_ULINK (33) */
+ CTL_SST_TS_LF, /* REFCLK_PCF (35) */
+ CTL_SST_TS_LF, /* REFCLK_WWW (36) */
+ CTL_SST_TS_LF, /* REFCLK_FG (37) */
};
diff --git a/contrib/ntp/ntpd/ntp_intres.c b/contrib/ntp/ntpd/ntp_intres.c
index 182991464875..e9a387e07590 100644
--- a/contrib/ntp/ntpd/ntp_intres.c
+++ b/contrib/ntp/ntpd/ntp_intres.c
@@ -152,7 +152,7 @@ ntp_intres(void)
#endif /* NTP_POSIX_SOURCE */
#ifdef DEBUG
- if (debug) {
+ if (debug > 1) {
msyslog(LOG_INFO, "NTP_INTRES running");
}
#endif
diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c
index e9202491fe7d..6ab7d267d8a2 100644
--- a/contrib/ntp/ntpd/ntp_io.c
+++ b/contrib/ntp/ntpd/ntp_io.c
@@ -19,6 +19,12 @@
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
+#ifdef HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#else /* Some old linux systems at least have in_system.h instead. */
+# include <netinet/in_system.h>
+#endif /* HAVE_NETINET_IN_SYSTM_H */
+#include <netinet/ip.h>
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
@@ -880,7 +886,7 @@ open_socket(
int turn_off_reuse
)
{
- int fd;
+ int fd, tos;
int on = 1, off = 0;
/* create a datagram (UDP) socket */
@@ -905,6 +911,15 @@ open_socket(
msyslog(LOG_ERR, "setsockopt SO_REUSEADDR on fails: %m");
}
+#if defined(IPTOS_LOWDELAY) && defined(IPPROTO_IP) && defined(IP_TOS)
+ /* set IP_TOS to minimize packet delay */
+ tos = IPTOS_LOWDELAY;
+ if (setsockopt(fd, IPPROTO_IP, IP_TOS, (char *) &tos, sizeof(tos)) < 0)
+ {
+ msyslog(LOG_ERR, "setsockopt IPTOS_LOWDELAY on fails: %m");
+ }
+#endif /* IPTOS_LOWDELAY && IPPROTO_IP && IP_TOS */
+
/*
* bind the local address.
*/
@@ -1326,11 +1341,7 @@ input_handler(
{
char buf[RX_BUFF_SIZE];
-#ifndef SYS_WINNT
(void) read(fd, buf, sizeof buf);
-#else
- (void) ReadFile((HANDLE)fd, buf, (DWORD)sizeof buf, NULL, NULL);
-#endif /* SYS_WINNT */
packets_dropped++;
goto select_again;
}
@@ -1340,14 +1351,8 @@ input_handler(
i = (rp->datalen == 0
|| rp->datalen > sizeof(rb->recv_space))
? sizeof(rb->recv_space) : rp->datalen;
-#ifndef SYS_WINNT
rb->recv_length =
- read(fd, (char *)&rb->recv_space, (unsigned)i)
-#else /* SYS_WINNT */
- ReadFile((HANDLE)fd, (char *)&rb->recv_space, (DWORD)i,
- (LPDWORD)&(rb->recv_length), NULL)
-#endif /* SYS_WINNT */
- ;
+ read(fd, (char *)&rb->recv_space, (unsigned)i);
if (rb->recv_length == -1)
{
@@ -1546,35 +1551,20 @@ input_handler(
}
else if (n == -1)
{
-#ifndef SYS_WINNT
int err = errno;
-#else
- DWORD err = WSAGetLastError();
-#endif /* SYS_WINNT */
/*
* extended FAU debugging output
*/
msyslog(LOG_ERR, "select(%d, %s, 0L, 0L, &0.000000) error: %m",
maxactivefd+1, fdbits(maxactivefd, &activefds));
- if (
-#ifndef SYS_WINNT
- (err == EBADF)
-#else
- (err == WSAEBADF)
-#endif /* SYS_WINNT */
- )
- {
+ if (err == EBADF) {
int j, b;
fds = activefds;
for (j = 0; j <= maxactivefd; j++)
if (
-#ifndef SYS_WINNT
(FD_ISSET(j, &fds) && (read(j, &b, 0) == -1))
-#else
- (FD_ISSET(j, &fds) && (!ReadFile((HANDLE)j, &b, 0, NULL, NULL)))
-#endif /* SYS_WINNT */
)
msyslog(LOG_ERR, "Bad file descriptor %d", j);
}
diff --git a/contrib/ntp/ntpd/ntp_loopfilter.c b/contrib/ntp/ntpd/ntp_loopfilter.c
index 6e0e134af921..15b625de6f20 100644
--- a/contrib/ntp/ntpd/ntp_loopfilter.c
+++ b/contrib/ntp/ntpd/ntp_loopfilter.c
@@ -194,7 +194,7 @@ local_clock(
#ifndef SYS_WINNT
if (fabs(fp_offset) >= clock_panic && !correct_any) {
msyslog(LOG_ERR,
- "time error %.0f over %d seconds; set clock manually)",
+ "time error %.0f over %d seconds; set clock manually",
fp_offset, (int)clock_panic);
return (-1);
}
@@ -286,7 +286,7 @@ local_clock(
* reset or shaken, but never stirred.
*/
default:
- if (allow_set_backward) {
+ if (allow_set_backward | correct_any) {
step_systime(fp_offset);
NLOG(NLOG_SYNCEVENT|NLOG_SYSEVENT)
msyslog(LOG_NOTICE, "time reset %.6f s",
@@ -299,7 +299,6 @@ local_clock(
fp_offset);
rstclock(S_FREQ);
last_offset = clock_offset = fp_offset;
- return (0);
}
break;
}
@@ -355,7 +354,8 @@ local_clock(
ULOGTOD(sys_poll + 1)) {
#ifdef DEBUG
if (debug)
- printf("local_clock: popcorn %.6f %.6f\n",
+ printf(
+ "local_clock: popcorn %.6f %.6f\n",
fp_offset, last_offset);
#endif
last_offset = fp_offset;
@@ -364,14 +364,17 @@ local_clock(
/*
* Compute the FLL and PLL frequency adjustments
- * conditioned on two weighting factors, one
- * which limits the time constant determined
- * from the Allan intercept, the other which
- * limits the gain factor as a function of
- * update interval. The net effect is to favor
- * the PLL adjustments at the smaller update
- * intervals and the FLL adjustments at the
- * larger ones.
+ * conditioned on intricate weighting factors.
+ * For the FLL, the averaging interval is
+ * clamped not to decrease below the Allan
+ * intercept and the gain is decreased from
+ * unity for mu above CLOCK_MINSEC (1024 s) to
+ * zero below CLOCK_MINSEC (256 s). For the PLL,
+ * the averaging interval is clamped not to
+ * exceed the sustem poll interval. These
+ * measures insure stability of the clock
+ * discipline even when the rules of fair
+ * engagement are broken.
*/
dtemp = max(mu, allan_xpt);
etemp = min(max(0, mu - CLOCK_MINSEC) /
@@ -379,7 +382,8 @@ local_clock(
flladj = fp_offset * etemp / (dtemp *
CLOCK_AVG);
dtemp = ULOGTOD(SHIFT_PLL + 2 + sys_poll);
- plladj = fp_offset * mu / (dtemp * dtemp);
+ etemp = min(mu, ULOGTOD(sys_poll));
+ plladj = fp_offset * etemp / (dtemp * dtemp);
clock_offset = fp_offset;
break;
}
@@ -664,6 +668,7 @@ rstclock(
int trans /* new state */
)
{
+ correct_any = FALSE;
state = trans;
switch (state) {
diff --git a/contrib/ntp/ntpd/ntp_proto.c b/contrib/ntp/ntpd/ntp_proto.c
index 6d5429144b47..a24c0e3e567f 100644
--- a/contrib/ntp/ntpd/ntp_proto.c
+++ b/contrib/ntp/ntpd/ntp_proto.c
@@ -70,6 +70,7 @@ static double clock_combine P((struct peer **, int));
static void peer_xmit P((struct peer *));
static void fast_xmit P((struct recvbuf *, int, u_long));
static void clock_update P((void));
+int default_get_precision P((void));
#ifdef MD5
static void make_keylist P((struct peer *));
#endif /* MD5 */
@@ -100,8 +101,8 @@ transmit(
peer->valid++;
if (oreach & 0x80)
peer->valid--;
- if (!(peer->flags & FLAG_CONFIG) &&
- peer->valid > NTP_SHIFT / 2 && (peer->reach & 0x80) &&
+ if (!(peer->flags & FLAG_CONFIG) && peer->valid >
+ NTP_SHIFT / 2 && (peer->reach & 0x80) &&
peer->status < CTL_PST_SEL_SYNCCAND)
peer->reach = 0;
peer->reach <<= 1;
@@ -259,8 +260,8 @@ receive(
if (PKT_MODE(pkt->li_vn_mode) == MODE_PRIVATE) {
if (restrict_mask & RES_NOQUERY)
return;
- process_private(rbufp, ((restrict_mask & RES_NOMODIFY) ==
- 0));
+ process_private(rbufp, ((restrict_mask &
+ RES_NOMODIFY) == 0));
return;
}
if (PKT_MODE(pkt->li_vn_mode) == MODE_CONTROL) {
@@ -289,17 +290,18 @@ receive(
/*
* If we are not a broadcast client, ignore broadcast packets.
*/
- if ((PKT_MODE(pkt->li_vn_mode) == MODE_BROADCAST && !sys_bclient))
+ if ((PKT_MODE(pkt->li_vn_mode) == MODE_BROADCAST &&
+ !sys_bclient))
return;
/*
* This is really awful ugly. We figure out whether an extension
* field is present and then measure the MAC size. If the number
* of words following the packet header is less than or equal to
- * 5, no extension field is present and these words constitute the
- * MAC. If the number of words is greater than 5, an extension
- * field is present and the first word contains the length of
- * the extension field and the MAC follows that.
+ * 5, no extension field is present and these words constitute
+ * the MAC. If the number of words is greater than 5, an
+ * extension field is present and the first word contains the
+ * length of the extension field and the MAC follows that.
*/
has_mac = 0;
/* pkeyid = 0; */
@@ -321,7 +323,8 @@ receive(
* MAC itself.
*/
/* pkeyid = (u_long)ntohl(pkt->keyid2) & 0xffffffff; */
- skeyid = tkeyid = (u_long)ntohl(pkt->keyid3) & 0xffffffff;
+ skeyid = tkeyid = (u_long)ntohl(pkt->keyid3) &
+ 0xffffffff;
}
/*
@@ -364,11 +367,12 @@ receive(
/*
* For multicast mode, generate the session key
- * and install in the key cache. For client mode,
- * generate the session key for the unicast
- * address. For server mode, the session key should
- * already be in the key cache, since it was
- * generated when the last request was sent.
+ * and install in the key cache. For client
+ * mode, generate the session key for the
+ * unicast address. For server mode, the session
+ * key should already be in the key cache, since
+ * it was generated when the last request was
+ * sent.
*/
if (hismode == MODE_BROADCAST) {
tkeyid = session_key(
@@ -389,7 +393,8 @@ receive(
* Compute the cryptosum. Note a clogging attack may
* succceed in bloating the key cache.
*/
- if (authdecrypt(skeyid, (u_int32 *)pkt, authlen, has_mac))
+ if (authdecrypt(skeyid, (u_int32 *)pkt, authlen,
+ has_mac))
is_authentic = 1;
else
sys_badauth++;
@@ -409,137 +414,148 @@ receive(
peer = findpeer(&rbufp->recv_srcadr, rbufp->dstadr, rbufp->fd,
hismode, &retcode);
/*
- * The new association matching rules are driven by a table specified
- * in ntp.h. We have replaced the *default* behaviour of replying
- * to bogus packets in server mode in this version.
- * A packet must now match an association in order to be processed.
- * In the event that no association exists, then an association is
- * mobilized if need be. Two different associations can be mobilized
- * a) passive associations
- * b) client associations due to broadcasts or manycasts.
+ * The new association matching rules are driven by a table
+ * specified in ntp.h. We have replaced the *default* behaviour
+ * of replying to bogus packets in server mode in this version.
+ * A packet must now match an association in order to be
+ * processed. In the event that no association exists, then an
+ * association is mobilized if need be. Two different
+ * associations can be mobilized a) passive associations b)
+ * client associations due to broadcasts or manycasts.
*/
is_error = 0;
switch (retcode) {
case AM_FXMIT:
- /*
- * If the client is configured purely as a broadcast client and
- * not as an manycast server, it has no business being a server.
- * Simply go home. Otherwise, send a MODE_SERVER response and go
- * home. Note that we don't do a authentication check here,
- * since we can't set the system clock; but, we do set the
- * key ID to zero to tell the caller about this.
- */
- if (!sys_bclient || sys_manycastserver) {
- if (is_authentic)
- fast_xmit(rbufp, MODE_SERVER, skeyid);
- else
- fast_xmit(rbufp, MODE_SERVER, 0);
- }
-
- /*
- * We can't get here if an association is mobilized, so just
- * toss the key, if appropriate.
- */
- if (!is_mystic && skeyid > NTP_MAXKEY)
- authtrust(skeyid, 0);
- return;
+
+ /*
+ * If the client is configured purely as a broadcast
+ * client and not as an manycast server, it has no
+ * business being a server. Simply go home. Otherwise,
+ * send a MODE_SERVER response and go home. Note that we
+ * don't do a authentication check here, since we can't
+ * set the system clock; but, we do set the key ID to
+ * zero to tell the caller about this.
+ */
+ if (!sys_bclient || sys_manycastserver) {
+ if (is_authentic)
+ fast_xmit(rbufp, MODE_SERVER, skeyid);
+ else
+ fast_xmit(rbufp, MODE_SERVER, 0);
+ }
+
+ /*
+ * We can't get here if an association is mobilized, so
+ * just toss the key, if appropriate.
+ */
+ if (!is_mystic && skeyid > NTP_MAXKEY)
+ authtrust(skeyid, 0);
+ return;
case AM_MANYCAST:
- /*
- * This could be in response to a multicast packet sent by
- * the "manycast" mode association. Find peer based on the
- * originate timestamp in the packet. Note that we don't
- * mobilize a new association, unless the packet is properly
- * authenticated. The response must be properly authenticated
- * and it's darn funny of the manycaster isn't around now.
- */
- if ((sys_authenticate && !is_authentic)) {
- is_error = 1;
- break;
- }
- peer2 = (struct peer *)findmanycastpeer(&pkt->org);
- if (peer2 == 0) {
- is_error = 1;
- break;
- }
-
- /*
- * Create a new association and copy the peer variables to it.
- * If something goes wrong, carefully pry the new association
- * away and return its marbles to the candy store.
- */
- peer = newpeer(&rbufp->recv_srcadr,
- rbufp->dstadr, MODE_CLIENT, PKT_VERSION(pkt->li_vn_mode),
- NTP_MINDPOLL, NTP_MAXDPOLL, 0, skeyid);
- if (peer == 0) {
- is_error = 1;
- break;
- }
- peer_config_manycast(peer2, peer);
- break;
+
+ /*
+ * This could be in response to a multicast packet sent
+ * by the "manycast" mode association. Find peer based
+ * on the originate timestamp in the packet. Note that
+ * we don't mobilize a new association, unless the
+ * packet is properly authenticated. The response must
+ * be properly authenticated and it's darn funny of the
+ * manycaster isn't around now.
+ */
+ if ((sys_authenticate && !is_authentic)) {
+ is_error = 1;
+ break;
+ }
+ peer2 = (struct peer *)findmanycastpeer(&pkt->org);
+ if (peer2 == 0) {
+ is_error = 1;
+ break;
+ }
+
+ /*
+ * Create a new association and copy the peer variables
+ * to it. If something goes wrong, carefully pry the new
+ * association away and return its marbles to the candy
+ * store.
+ */
+ peer = newpeer(&rbufp->recv_srcadr, rbufp->dstadr,
+ MODE_CLIENT, PKT_VERSION(pkt->li_vn_mode),
+ NTP_MINDPOLL, NTP_MAXDPOLL, 0, skeyid);
+ if (peer == 0) {
+ is_error = 1;
+ break;
+ }
+ peer_config_manycast(peer2, peer);
+ break;
case AM_ERR:
- /*
- * Something bad happened. Dirty floor will be mopped by the
- * code at the end of this adventure.
- */
- is_error = 1;
- break;
+
+ /*
+ * Something bad happened. Dirty floor will be mopped by
+ * the code at the end of this adventure.
+ */
+ is_error = 1;
+ break;
case AM_NEWPASS:
- /*
- * Okay, we're going to keep him around. Allocate him some
- * memory. But, don't do that unless the packet is properly
- * authenticated.
- */
- if ((sys_authenticate && !is_authentic)) {
- is_error = 1;
- break;
- }
- peer = newpeer(&rbufp->recv_srcadr,
- rbufp->dstadr, MODE_PASSIVE, PKT_VERSION(pkt->li_vn_mode),
- NTP_MINDPOLL, NTP_MAXDPOLL, 0, skeyid);
- break;
+
+ /*
+ * Okay, we're going to keep him around. Allocate him
+ * some memory. But, don't do that unless the packet is
+ * properly authenticated.
+ */
+ if ((sys_authenticate && !is_authentic)) {
+ is_error = 1;
+ break;
+ }
+ peer = newpeer(&rbufp->recv_srcadr, rbufp->dstadr,
+ MODE_PASSIVE, PKT_VERSION(pkt->li_vn_mode),
+ NTP_MINDPOLL, NTP_MAXDPOLL, 0, skeyid);
+ break;
case AM_NEWBCL:
- /*
- * Broadcast client being set up now. Do this only if the
- * packet is properly authenticated.
- */
- if ((restrict_mask & RES_NOPEER) || !sys_bclient ||
- (sys_authenticate && !is_authentic)) {
- is_error = 1;
- break;
- }
- peer = newpeer(&rbufp->recv_srcadr,
- rbufp->dstadr, MODE_MCLIENT, PKT_VERSION(pkt->li_vn_mode),
- NTP_MINDPOLL, NTP_MAXDPOLL, 0, skeyid);
- if (peer == 0)
- break;
- peer->flags |= FLAG_MCAST1 | FLAG_MCAST2 | FLAG_BURST;
- peer->hmode = MODE_CLIENT;
- break;
+
+ /*
+ * Broadcast client being set up now. Do this only if
+ * the packet is properly authenticated.
+ */
+ if ((restrict_mask & RES_NOPEER) || !sys_bclient ||
+ (sys_authenticate && !is_authentic)) {
+ is_error = 1;
+ break;
+ }
+ peer = newpeer(&rbufp->recv_srcadr, rbufp->dstadr,
+ MODE_MCLIENT, PKT_VERSION(pkt->li_vn_mode),
+ NTP_MINDPOLL, NTP_MAXDPOLL, 0, skeyid);
+ if (peer == 0)
+ break;
+ peer->flags |= FLAG_MCAST1 | FLAG_MCAST2 | FLAG_BURST;
+ peer->hmode = MODE_CLIENT;
+ break;
case AM_POSSBCL:
case AM_PROCPKT:
- /*
- * It seems like it is okay to process the packet now
- */
- break;
+
+ /*
+ * It seems like it is okay to process the packet now
+ */
+ break;
default:
- /*
- * shouldn't be getting here, but simply return anyway!
- */
- is_error = 1;
+
+ /*
+ * shouldn't be getting here, but simply return anyway!
+ */
+ is_error = 1;
}
if (is_error) {
/*
- * Error stub. If we get here, something broke. We scuttle
- * the autokey if necessary and sink the ship. This can
- * occur only upon mobilization, so we can throw the
- * structure away without fear of breaking anything.
+ * Error stub. If we get here, something broke. We
+ * scuttle the autokey if necessary and sink the ship.
+ * This can occur only upon mobilization, so we can
+ * throw the structure away without fear of breaking
+ * anything.
*/
if (!is_mystic && skeyid > NTP_MAXKEY)
authtrust(skeyid, 0);
@@ -548,8 +564,8 @@ receive(
unpeer(peer);
#ifdef DEBUG
if (debug)
- printf("match error code %d assoc %d\n", retcode,
- peer_associations);
+ printf("match error code %d assoc %d\n",
+ retcode, peer_associations);
#endif
return;
}
@@ -572,22 +588,23 @@ receive(
/*
* Determine if this guy is basically trustable. If not, flush
- * the bugger. If this is the first packet that is authenticated,
- * flush the clock filter. This is to foil clogging attacks that
- * might starve the poor dear.
+ * the bugger. If this is the first packet that is
+ * authenticated, flush the clock filter. This is to foil
+ * clogging attacks that might starve the poor dear.
*/
peer->flash = 0;
if (is_authentic)
peer->flags |= FLAG_AUTHENTIC;
else
peer->flags &= ~FLAG_AUTHENTIC;
- if (peer->hmode == MODE_BROADCAST && (restrict_mask & RES_DONTTRUST))
+ if (peer->hmode == MODE_BROADCAST && (restrict_mask &
+ RES_DONTTRUST))
peer->flash |= TEST10; /* access denied */
if (peer->flags & FLAG_AUTHENABLE) {
if (!(peer->flags & FLAG_AUTHENTIC))
- peer->flash |= TEST5; /* authentication failed */
+ peer->flash |= TEST5; /* auth failed */
else if (skeyid == 0)
- peer->flash |= TEST9; /* peer not authenticated */
+ peer->flash |= TEST9; /* peer not auth */
else if (!(oflags & FLAG_AUTHENABLE)) {
peer_clear(peer);
report_event(EVNT_PEERAUTH, peer);
@@ -596,10 +613,10 @@ receive(
if ((peer->flash & ~(u_int)TEST9) != 0) {
/*
- * The packet is bogus, so we throw it away before becoming
- * a denial-of-service hazard. We don't throw the current
- * association away if it is configured or if it has prior
- * reachable friends.
+ * The packet is bogus, so we throw it away before
+ * becoming a denial-of-service hazard. We don't throw
+ * the current association away if it is configured or
+ * if it has prior reachable friends.
*/
if (!is_mystic && skeyid > NTP_MAXKEY)
authtrust(skeyid, 0);
@@ -617,8 +634,8 @@ receive(
#ifdef MD5
/*
* The autokey dance. The cha-cha requires that the hash of the
- * current session key matches the previous key identifier. Heaps
- * of trouble if the steps falter.
+ * current session key matches the previous key identifier.
+ * Heaps of trouble if the steps falter.
*/
if (skeyid > NTP_MAXKEY) {
int i;
@@ -633,7 +650,8 @@ receive(
} else if (peer->flags & FLAG_MCAST2) {
if (peer->pkeyid > NTP_MAXKEY)
authtrust(peer->pkeyid, 0);
- for (i = 0; i < 4 && tkeyid != peer->pkeyid; i++) {
+ for (i = 0; i < 4 && tkeyid != peer->pkeyid;
+ i++) {
tkeyid = session_key(
ntohl((&rbufp->recv_srcadr)->sin_addr.s_addr),
ntohl(rbufp->dstadr->bcast.sin_addr.s_addr),
@@ -642,7 +660,8 @@ receive(
} else {
if (peer->pkeyid > NTP_MAXKEY)
authtrust(peer->pkeyid, 0);
- for (i = 0; i < 4 && tkeyid != peer->pkeyid; i++) {
+ for (i = 0; i < 4 && tkeyid != peer->pkeyid;
+ i++) {
tkeyid = session_key(
ntohl((&rbufp->recv_srcadr)->sin_addr.s_addr),
ntohl(rbufp->dstadr->sin.sin_addr.s_addr),
@@ -658,9 +677,10 @@ receive(
#endif /* MD5 */
/*
- * Gawdz, it's come to this. Process the dang packet. If something
- * breaks and the association doesn't deserve to live, toss it.
- * Be careful in active mode and return a packet anyway.
+ * Gawdz, it's come to this. Process the dang packet. If
+ * something breaks and the association doesn't deserve to live,
+ * toss it. Be careful in active mode and return a packet
+ * anyway.
*/
process_packet(peer, pkt, &(rbufp->recv_time));
if (!(peer->flags & FLAG_CONFIG) && peer->reach == 0) {
@@ -810,15 +830,15 @@ process_packet(
p_disp = CLOCK_PHI * (peer->rec.l_ui - p_org.l_ui);
/*
- * If running in a broadcast association, the clock offset is (t1
- * - t0) corrected by the one-way delay, but we can't measure
- * that directly; therefore, we start up in client/server mode,
- * calculate the clock offset, using the engineered refinement
- * algorithms, while also receiving broadcasts. When a broadcast
- * is received in client/server mode, we calculate a correction
- * factor to use after switching back to broadcast mode. We know
- * NTP_SKEWFACTOR == 16, which accounts for the simplified ei
- * calculation.
+ * If running in a broadcast association, the clock offset is
+ * (t1 - t0) corrected by the one-way delay, but we can't
+ * measure that directly; therefore, we start up in
+ * client/server mode, calculate the clock offset, using the
+ * engineered refinement algorithms, while also receiving
+ * broadcasts. When a broadcast is received in client/server
+ * mode, we calculate a correction factor to use after switching
+ * back to broadcast mode. We know NTP_SKEWFACTOR == 16, which
+ * accounts for the simplified ei calculation.
*
* If FLAG_MCAST2 is set, we are a broadcast/multicast client.
* If FLAG_MCAST1 is set, we haven't calculated the propagation
@@ -868,7 +888,8 @@ process_packet(
clock_filter(peer, p_offset, p_del, fabs(p_disp));
clock_select();
record_peer_stats(&peer->srcadr, ctlpeerstatus(peer),
- peer->offset, peer->delay, peer->disp, SQRT(peer->variance));
+ peer->offset, peer->delay, peer->disp,
+ SQRT(peer->variance));
return(1);
}
@@ -941,7 +962,8 @@ clock_update(void)
else
sys_refid = sys_peer->srcadr.sin_addr.s_addr;
sys_reftime = sys_peer->rec;
- sys_rootdelay = sys_peer->rootdelay + fabs(sys_peer->delay);
+ sys_rootdelay = sys_peer->rootdelay +
+ fabs(sys_peer->delay);
sys_leap = leap_consensus;
}
if (oleap != sys_leap)
@@ -992,14 +1014,15 @@ poll_update(
else
peer->nextdate += RANDPOLL(BURST_INTERVAL1);
} else {
- update = max(min(peer->ppoll, peer->hpoll), peer->minpoll);
+ update = max(min(peer->ppoll, peer->hpoll),
+ peer->minpoll);
peer->nextdate = peer->outdate + RANDPOLL(update);
}
#ifdef DEBUG
if (debug > 1)
printf("poll_update: at %lu %s poll %d burst %d last %lu next %lu\n",
- current_time, ntoa(&peer->srcadr), hpoll, peer->burst,
- peer->outdate, peer->nextdate);
+ current_time, ntoa(&peer->srcadr), hpoll,
+ peer->burst, peer->outdate, peer->nextdate);
#endif
}
@@ -1079,7 +1102,8 @@ clock_filter(
*/
peer->filter_offset[peer->filter_nextpt] = sample_offset;
peer->filter_delay[peer->filter_nextpt] = sample_delay;
- x = LOGTOD(peer->precision) + LOGTOD(sys_precision) + sample_disp;
+ x = LOGTOD(peer->precision) + LOGTOD(sys_precision) +
+ sample_disp;
peer->filter_disp[peer->filter_nextpt] = min(x, MAXDISPERSE);
peer->filter_epoch[peer->filter_nextpt] = current_time;
distance[0] = min(x + fabs(sample_delay) / 2, MAXDISTANCE);
@@ -1115,7 +1139,8 @@ clock_filter(
x = NTP_FWEIGHT * (x + peer->filter_disp[ord[i]]);
if (i < n) {
z += 1. / distance[i];
- off += peer->filter_offset[ord[i]] / distance[i];
+ off += peer->filter_offset[ord[i]] /
+ distance[i];
y += DIFF(peer->filter_offset[ord[i]],
peer->filter_offset[ord[0]]);
}
@@ -1239,7 +1264,7 @@ clock_select(void)
peer->flags &= ~FLAG_SYSPEER;
peer->status = CTL_PST_SEL_REJECT;
if (peer->flags & FLAG_NOSELECT)
- continue; /* noselect (survey only) */
+ continue; /* noselect (survey) */
if (peer->reach == 0)
continue; /* unreachable */
if (peer->stratum > 1 && peer->refid ==
@@ -1248,7 +1273,7 @@ clock_select(void)
if (root_distance(peer) >= MAXDISTANCE + 2 *
CLOCK_PHI * ULOGTOD(sys_poll)) {
peer->seldisptoolarge++;
- continue; /* too noisy or broken */
+ continue; /* noisy or broken */
}
/*
@@ -1321,7 +1346,7 @@ clock_select(void)
if (debug > 1)
for (i = 0; i < nl3; i++)
printf("select: endpoint %2d %.6f\n",
- endpoint[index[i]].type, endpoint[index[i]].val);
+ endpoint[index[i]].type, endpoint[index[i]].val);
#endif
i = 0;
j = nl3 - 1;
@@ -1367,9 +1392,10 @@ clock_select(void)
} else {
if (sys_peer != 0) {
report_event(EVNT_PEERSTCHG,
- (struct peer *)0);
+ (struct peer *)0);
NLOG(NLOG_SYNCSTATUS)
- msyslog(LOG_INFO, "synchronisation lost");
+ msyslog(LOG_INFO,
+ "synchronisation lost");
}
sys_peer = 0;
return;
@@ -1416,7 +1442,7 @@ clock_select(void)
if (debug > 1)
for (i = 0; i < nlist; i++)
printf("select: %s distance %.6f\n",
- ntoa(&peer_list[i]->srcadr), synch[i]);
+ ntoa(&peer_list[i]->srcadr), synch[i]);
#endif
/*
@@ -1506,7 +1532,8 @@ clock_select(void)
typesystem = peer_list[i];
if (peer_list[i]->flags & FLAG_PREFER) {
typeprefer = peer_list[i];
- if (fabs(typeprefer->offset) < clock_max)
+ if (fabs(typeprefer->offset) <
+ clock_max)
pps_update = 1;
}
} else {
@@ -1519,24 +1546,26 @@ clock_select(void)
* Mitigation rules of the game. There are several types of
* peers that make a difference here: (1) prefer local peers
* (type REFCLK_LOCALCLOCK with FLAG_PREFER) or prefer modem
- * peers (type REFCLK_NIST_ATOM etc with FLAG_PREFER), (2) pps peers
- * (type REFCLK_ATOM_PPS), (3) remaining prefer peers (flag
- * FLAG_PREFER), (4) the existing system peer, if any, (5) the
- * head of the survivor list. Note that only one peer can be
+ * peers (type REFCLK_NIST_ATOM etc with FLAG_PREFER), (2) pps
+ * peers (type REFCLK_ATOM_PPS), (3) remaining prefer peers
+ * (flag FLAG_PREFER), (4) the existing system peer, if any, (5)
+ * the head of the survivor list. Note that only one peer can be
* declared prefer. The order of preference is in the order
* stated. Note that all of these must be at the lowest stratum,
* i.e., the stratum of the head of the survivor list.
*/
osys_peer = sys_peer;
- if (typeprefer && (typeprefer->refclktype == REFCLK_LOCALCLOCK ||
- typeprefer->sstclktype == CTL_SST_TS_TELEPHONE || !typepps)) {
+ if (typeprefer && (typeprefer->refclktype == REFCLK_LOCALCLOCK
+ || typeprefer->sstclktype == CTL_SST_TS_TELEPHONE ||
+ !typepps)) {
sys_peer = typeprefer;
sys_peer->status = CTL_PST_SEL_SYSPEER;
sys_offset = sys_peer->offset;
sys_epsil = sys_peer->variance;
#ifdef DEBUG
if (debug > 1)
- printf("select: prefer offset %.6f\n", sys_offset);
+ printf("select: prefer offset %.6f\n",
+ sys_offset);
#endif
} else if (typepps && pps_update) {
sys_peer = typepps;
@@ -1650,15 +1679,18 @@ peer_xmit(
if (peer->flags & FLAG_SKEY) {
/*
- * In SKEY mode, allocate and initialize a key list if
- * not already done. Then, use the list in inverse
- * order, discarding keys once used. Keep the latest
- * key around until the next one, so clients can use
- * client/server packets to compute propagation delay.
- * Note we have to wait until the receive side of the
- * socket is bound and the server address confirmed.
+ * In autokey mode, allocate and initialize a
+ * key list if not already done. Then, use the
+ * list in inverse order, discarding keys once
+ * used. Keep the latest key around until the
+ * next one, so clients can use client/server
+ * packets to compute propagation delay. Note we
+ * have to wait until the receive side of the
+ * socket is bound and the server address
+ * confirmed.
*/
- if (ntohl(peer->dstadr->sin.sin_addr.s_addr) == 0 &&
+ if (ntohl(peer->dstadr->sin.sin_addr.s_addr) ==
+ 0 &&
ntohl(peer->dstadr->bcast.sin_addr.s_addr) == 0)
peer->keyid = 0;
else {
@@ -1686,13 +1718,13 @@ peer_xmit(
get_systime(&peer->xmt);
L_ADD(&peer->xmt, &sys_authdelay);
HTONL_FP(&peer->xmt, &xpkt.xmt);
- sendlen += authencrypt(xkeyid, (u_int32 *)&xpkt, sendlen);
+ sendlen += authencrypt(xkeyid, (u_int32 *)&xpkt,
+ sendlen);
get_systime(&xmt_tx);
sendpkt(&peer->srcadr, find_rtt ? any_interface :
- peer->dstadr,
- ((peer->cast_flags & MDF_MCAST) && !find_rtt) ?
- ((peer->cast_flags & MDF_ACAST) ? -7 : peer->ttl) : -7,
- &xpkt, sendlen);
+ peer->dstadr, ((peer->cast_flags & MDF_MCAST) &&
+ !find_rtt) ? ((peer->cast_flags & MDF_ACAST) ? -7 :
+ peer->ttl) : -7, &xpkt, sendlen);
/*
* Calculate the encryption delay. Keep the minimum over
@@ -1710,9 +1742,9 @@ peer_xmit(
#ifdef DEBUG
if (debug)
printf(
- "transmit: at %ld to %s mode %d keyid %08lx index %d\n",
- current_time, ntoa(&peer->srcadr),
- peer->hmode, xkeyid, peer->keynumber);
+ "transmit: at %ld to %s mode %d keyid %08lx index %d\n",
+ current_time, ntoa(&peer->srcadr),
+ peer->hmode, xkeyid, peer->keynumber);
#endif
} else {
/*
@@ -1721,10 +1753,9 @@ peer_xmit(
get_systime(&(peer->xmt));
HTONL_FP(&peer->xmt, &xpkt.xmt);
sendpkt(&(peer->srcadr), find_rtt ? any_interface :
- peer->dstadr,
- ((peer->cast_flags & MDF_MCAST) && !find_rtt) ?
- ((peer->cast_flags & MDF_ACAST) ? -7 : peer->ttl) : -8,
- &xpkt, sendlen);
+ peer->dstadr, ((peer->cast_flags & MDF_MCAST) &&
+ !find_rtt) ? ((peer->cast_flags & MDF_ACAST) ? -7 :
+ peer->ttl) : -8, &xpkt, sendlen);
peer->sent++;
#ifdef DEBUG
if (debug)
@@ -1783,10 +1814,11 @@ fast_xmit(
get_systime(&xmt_ts);
L_ADD(&xmt_ts, &sys_authdelay);
HTONL_FP(&xmt_ts, &xpkt.xmt);
- sendlen += authencrypt(xkeyid, (u_int32 *)&xpkt, sendlen);
+ sendlen += authencrypt(xkeyid, (u_int32 *)&xpkt,
+ sendlen);
get_systime(&xmt_tx);
sendpkt(&rbufp->recv_srcadr, rbufp->dstadr, -9, &xpkt,
- sendlen);
+ sendlen);
/*
* Calculate the encryption delay. Keep the minimum over
@@ -1803,9 +1835,9 @@ fast_xmit(
#ifdef DEBUG
if (debug)
printf(
- "transmit: at %ld to %s mode %d keyid %08lx\n",
- current_time, ntoa(&rbufp->recv_srcadr),
- xmode, xkeyid);
+ "transmit: at %ld to %s mode %d keyid %08lx\n",
+ current_time, ntoa(&rbufp->recv_srcadr),
+ xmode, xkeyid);
#endif
} else {
@@ -1868,15 +1900,14 @@ make_keylist(
peer->keylist[i] = keyid;
peer->keynumber = i;
keyid = session_key(
- ntohl(peer->dstadr->sin.sin_addr.s_addr),
- (peer->hmode == MODE_BROADCAST || (peer->flags &
- FLAG_MCAST2)) ?
- ntohl(peer->dstadr->bcast.sin_addr.s_addr):
- ntohl(peer->srcadr.sin_addr.s_addr),
- keyid, ltemp);
+ ntohl(peer->dstadr->sin.sin_addr.s_addr),
+ (peer->hmode == MODE_BROADCAST || (peer->flags &
+ FLAG_MCAST2)) ?
+ ntohl(peer->dstadr->bcast.sin_addr.s_addr):
+ ntohl(peer->srcadr.sin_addr.s_addr), keyid, ltemp);
ltemp -= 1 << peer->hpoll;
if (auth_havekey(keyid) || keyid <= NTP_MAXKEY ||
- ltemp <= (1 << (peer->hpoll + 1)))
+ ltemp <= (1 << (peer->hpoll + 1)))
break;
}
}
@@ -1925,23 +1956,21 @@ default_get_precision(void)
#endif
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
u_long freq;
- int j;
+ size_t j;
/* Try to see if we can find the frequency of of the counter
* which drives our timekeeping
*/
j = sizeof freq;
- i = sysctlbyname("kern.timecounter.frequency",
- &freq, &j , 0, 0);
+ i = sysctlbyname("kern.timecounter.frequency", &freq, &j , 0,
+ 0);
if (i)
- i = sysctlbyname("machdep.tsc_freq",
- &freq, &j , 0, 0);
+ i = sysctlbyname("machdep.tsc_freq", &freq, &j , 0, 0);
if (i)
- i = sysctlbyname("machdep.i586_freq",
- &freq, &j , 0, 0);
+ i = sysctlbyname("machdep.i586_freq", &freq, &j , 0, 0);
if (i)
- i = sysctlbyname("machdep.i8254_freq",
- &freq, &j , 0, 0);
+ i = sysctlbyname("machdep.i8254_freq", &freq, &j , 0,
+ 0);
if (!i) {
for (i = 1; freq ; i--)
freq >>= 1;
@@ -1977,7 +2006,7 @@ default_get_precision(void)
val = diff;
}
}
- NLOG(NLOG_SYSINFO) /* conditional if clause for conditional syslog */
+ NLOG(NLOG_SYSINFO)
msyslog(LOG_INFO, "precision = %ld usec", val);
if (usec >= HUSECS)
val = MINSTEP; /* val <= MINSTEP; fast machine */
@@ -2042,9 +2071,9 @@ init_proto(void)
* Some system clocks should only be adjusted in 10ms increments.
*/
#if defined RELIANTUNIX_CLOCK
- systime_10ms_ticks = 1; /* Reliant UNIX */
+ systime_10ms_ticks = 1; /* Reliant UNIX */
#elif defined SCO5_CLOCK
- if (sys_precision >= (s_char)-10) /* pre- SCO OpenServer 5.0.6 */
+ if (sys_precision >= (s_char)-10) /* pre-SCO OpenServer 5.0.6 */
systime_10ms_ticks = 1;
#endif
if (systime_10ms_ticks)
@@ -2066,21 +2095,24 @@ proto_config(
* Figure out what he wants to change, then do it
*/
switch (item) {
- case PROTO_KERNEL:
+ case PROTO_KERNEL:
+
/*
* Turn on/off kernel discipline
*/
kern_enable = (int)value;
break;
- case PROTO_NTP:
+ case PROTO_NTP:
+
/*
* Turn on/off clock discipline
*/
ntp_enable = (int)value;
break;
- case PROTO_MONITOR:
+ case PROTO_MONITOR:
+
/*
* Turn on/off monitoring
*/
@@ -2090,14 +2122,16 @@ proto_config(
mon_stop(MON_ON);
break;
- case PROTO_FILEGEN:
+ case PROTO_FILEGEN:
+
/*
* Turn on/off statistics
*/
stats_control = (int)value;
break;
- case PROTO_BROADCLIENT:
+ case PROTO_BROADCLIENT:
+
/*
* Turn on/off facility to listen to broadcasts
*/
@@ -2108,39 +2142,45 @@ proto_config(
io_unsetbclient();
break;
- case PROTO_MULTICAST_ADD:
+ case PROTO_MULTICAST_ADD:
+
/*
* Add muliticast group address
*/
io_multicast_add(value);
break;
- case PROTO_MULTICAST_DEL:
+ case PROTO_MULTICAST_DEL:
+
/*
* Delete multicast group address
*/
io_multicast_del(value);
break;
- case PROTO_BROADDELAY:
+ case PROTO_BROADDELAY:
+
/*
* Set default broadcast delay
*/
sys_bdelay = dvalue;
break;
- case PROTO_AUTHENTICATE:
+ case PROTO_AUTHENTICATE:
+
/*
* Specify the use of authenticated data
*/
sys_authenticate = (int)value;
break;
- default:
+ default:
+
/*
* Log this error
*/
- msyslog(LOG_ERR, "proto_config: illegal item %d, value %ld",
+ msyslog(LOG_ERR,
+ "proto_config: illegal item %d, value %ld",
item, value);
break;
}
diff --git a/contrib/ntp/ntpd/ntp_refclock.c b/contrib/ntp/ntpd/ntp_refclock.c
index c7b9166973de..c47031cca70f 100644
--- a/contrib/ntp/ntpd/ntp_refclock.c
+++ b/contrib/ntp/ntpd/ntp_refclock.c
@@ -20,11 +20,12 @@
#ifdef REFCLOCK
#ifdef TTYCLK
-# ifdef SCO5_CLOCK
-# include <sys/sio.h>
-# else
+# ifdef HAVE_SYS_CLKDEFS_H
# include <sys/clkdefs.h>
# endif
+# ifdef HAVE_SYS_SIO_H
+# include <sys/sio.h>
+# endif
#endif /* TTYCLK */
#ifdef HAVE_PPSCLOCK_H
@@ -32,7 +33,13 @@
#endif /* HAVE_PPSCLOCK_H */
#ifdef HAVE_PPSAPI
-#include <sys/timepps.h>
+# ifdef HAVE_TIMEPPS_H
+# include <timepps.h>
+# else
+# ifdef HAVE_SYS_TIMEPPS_H
+# include <sys/timepps.h>
+# endif
+# endif
#endif /* HAVE_PPSAPI */
/*
@@ -755,10 +762,11 @@ int
refclock_open(
char *dev, /* device name pointer */
int speed, /* serial port speed (code) */
- int flags /* line discipline flags */
+ int lflags /* line discipline flags */
)
{
int fd, i;
+ int flags;
#ifdef HAVE_TERMIOS
struct termios ttyb, *ttyp;
#endif /* HAVE_TERMIOS */
@@ -775,6 +783,9 @@ refclock_open(
/*
* Open serial port and set default options
*/
+ flags = lflags;
+ if (strcmp(dev, pps_device) == 0)
+ flags |= LDISC_PPS;
#ifdef O_NONBLOCK
fd = open(dev, O_RDWR | O_NONBLOCK, 0777);
#else
@@ -936,12 +947,6 @@ refclock_open(
"refclock_open: fd %d ioctl failed: %m", fd);
return (0);
}
-
- /*
- * If this is the PPS device, so say and initialize the thing.
- */
- if (strcmp(dev, pps_device) == 0)
- (void)refclock_ioctl(fd, LDISC_PPS);
return (fd);
}
#endif /* HAVE_TERMIOS || HAVE_SYSV_TTYS || HAVE_BSD_TTYS */
diff --git a/contrib/ntp/ntpd/ntpd.c b/contrib/ntp/ntpd/ntpd.c
index 923b1f702653..3dbef6074263 100644
--- a/contrib/ntp/ntpd/ntpd.c
+++ b/contrib/ntp/ntpd/ntpd.c
@@ -108,13 +108,13 @@
#define SIGDIE4 SIGTERM
#endif /* SYS_WINNT */
-#if defined SYS_WINNT || defined SYS_CYGWIN32
+#if defined SYS_WINNT
/* handles for various threads, process, and objects */
HANDLE ResolverThreadHandle = NULL;
/* variables used to inform the Service Control Manager of our current state */
SERVICE_STATUS ssStatus;
SERVICE_STATUS_HANDLE sshStatusHandle;
-HANDLE WaitHandles[3] = { NULL, NULL, NULL };
+HANDLE WaitHandles[2] = { NULL, NULL };
char szMsgPath[255];
static BOOL WINAPI OnConsoleEvent(DWORD dwCtrlType);
#endif /* SYS_WINNT */
@@ -122,11 +122,7 @@ static BOOL WINAPI OnConsoleEvent(DWORD dwCtrlType);
/*
* Scheduling priority we run at
*/
-#if !defined SYS_WINNT
# define NTPD_PRIO (-12)
-#else
-# define NTPD_PRIO REALTIME_PRIORITY_CLASS
-#endif
/*
* Debugging flag
@@ -230,13 +226,35 @@ set_process_priority(void)
int done = 0;
#ifdef SYS_WINNT
+ DWORD SingleCPUMask = 0;
+ DWORD ProcessAffinityMask, SystemAffinityMask;
+ if (!GetProcessAffinityMask(GetCurrentProcess(), &ProcessAffinityMask, &SystemAffinityMask))
+ msyslog(LOG_ERR, "GetProcessAffinityMask: %m");
+ else {
+ SingleCPUMask = 1;
+# ifdef DEBUG
+ msyslog(LOG_INFO, "System AffinityMask = %x", SystemAffinityMask );
+# endif
+ }
+ while (SingleCPUMask && !(SingleCPUMask & SystemAffinityMask)) {
+ SingleCPUMask = SingleCPUMask << 1;
+ }
+
+ if (!SingleCPUMask)
+ msyslog(LOG_ERR, "Can't set Processor Affinity Mask");
+ else if (!SetProcessAffinityMask(GetCurrentProcess(), SingleCPUMask))
+ msyslog(LOG_ERR, "SetProcessAffinityMask: %m");
+# ifdef DEBUG
+ else msyslog(LOG_INFO,"ProcessorAffinity Mask: %x", SingleCPUMask );
+# endif
+
if (!SetPriorityClass(GetCurrentProcess(), (DWORD) REALTIME_PRIORITY_CLASS))
msyslog(LOG_ERR, "SetPriorityClass: %m");
else
++done;
-#else /* not SYS_WINNT */
-# if defined(HAVE_SCHED_SETSCHEDULER)
+#endif
+# if defined(HAVE_SCHED_SETSCHEDULER)
if (!done) {
extern int config_priority_override, config_priority;
int pmax, pmin;
@@ -300,11 +318,11 @@ set_process_priority(void)
}
# endif /* HAVE_BSD_NICE */
# endif /* NTPD_PRIO && NTPD_PRIO != 0 */
-#endif /* not SYS_WINNT */
if (!done)
msyslog(LOG_ERR, "set_process_priority: No way found to improve our priority");
}
+
/*
* Main program. Initialize us, disconnect us from the tty if necessary,
* and loop waiting for I/O and/or timer expiries.
@@ -549,7 +567,6 @@ service_main(
# define LOG_NTP LOG_DAEMON
# endif
openlog(cp, LOG_PID | LOG_NDELAY, LOG_NTP);
-#ifndef SYS_CYGWIN32
# ifdef DEBUG
if (debug)
setlogmask(LOG_UPTO(LOG_DEBUG));
@@ -557,8 +574,6 @@ service_main(
# endif /* DEBUG */
setlogmask(LOG_UPTO(LOG_DEBUG)); /* @@@ was INFO */
# endif /* LOG_DAEMON */
-#endif
-
#endif /* !SYS_WINNT && !VMS */
NLOG(NLOG_SYSINFO) /* conditional if clause for conditional syslog */
@@ -669,7 +684,7 @@ service_main(
/*
* Set up signals we should never pay attention to.
*/
-#if defined SIGPIPE && !defined SYS_CYGWIN32
+#if defined SIGPIPE
(void) signal_no_reset(SIGPIPE, SIG_IGN);
#endif /* SIGPIPE */
@@ -759,33 +774,20 @@ service_main(
* yet to learn about anything else that is.
*/
# if defined(HAVE_IO_COMPLETION_PORT)
- {
WaitHandles[0] = CreateEvent(NULL, FALSE, FALSE, NULL); /* exit reques */
- WaitHandles[1] = get_recv_buff_event();
- WaitHandles[2] = get_timer_handle();
+ WaitHandles[1] = get_timer_handle();
for (;;) {
- DWORD Index = MsgWaitForMultipleObjectsEx(sizeof(WaitHandles)/sizeof(WaitHandles[0]), WaitHandles, INFINITE, QS_ALLEVENTS, MWMO_ALERTABLE);
+ DWORD Index = WaitForMultipleObjectsEx(sizeof(WaitHandles)/sizeof(WaitHandles[0]), WaitHandles, FALSE, 1000, MWMO_ALERTABLE);
switch (Index) {
case WAIT_OBJECT_0 + 0 : /* exit request */
exit(0);
break;
- case WAIT_OBJECT_0 + 1 : {/* recv buffer */
- if (NULL != (rbuf = get_full_recv_buffer())) {
- if (rbuf->receiver != NULL) {
- rbuf->receiver(rbuf);
- }
- freerecvbuf(rbuf);
- }
- }
- break;
-
- case WAIT_OBJECT_0 + 2 : /* 1 second timer */
+ case WAIT_OBJECT_0 + 1 : /* timer */
timer();
break;
-
- case WAIT_OBJECT_0 + 3 : { /* Windows message */
+ case WAIT_OBJECT_0 + 2 : { /* Windows message */
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
if (msg.message == WM_QUIT) {
@@ -800,10 +802,9 @@ service_main(
case WAIT_TIMEOUT :
break;
- }
+ } /* switch */
+ rbuflist = getrecvbufs(); /* get received buffers */
- }
- }
# else /* normal I/O */
was_alarmed = 0;
@@ -858,7 +859,7 @@ service_main(
else if (nfound == -1 && errno != EINTR)
msyslog(LOG_ERR, "select() error: %m");
else if (debug) {
-# if !defined SYS_VXWORKS && !defined SYS_CYGWIN32 && !defined SCO5_CLOCK /* to unclutter log */
+# if !defined SYS_VXWORKS && !defined SCO5_CLOCK /* to unclutter log */
msyslog(LOG_DEBUG, "select(): nfound=%d, error: %m", nfound);
# endif
}
@@ -887,6 +888,7 @@ service_main(
was_alarmed = 0;
}
+# endif /* HAVE_IO_COMPLETION_PORT */
/*
* Call the data procedure to handle each received
* packet.
@@ -908,7 +910,6 @@ service_main(
* Go around again
*/
}
-# endif /* HAVE_IO_COMPLETION_PORT */
exit(1); /* unreachable */
return 1; /* DEC OSF cc braindamage */
}
diff --git a/contrib/ntp/ntpd/refclock_atom.c b/contrib/ntp/ntpd/refclock_atom.c
index 63e17c1f6c04..764f6e0d09b1 100644
--- a/contrib/ntp/ntpd/refclock_atom.c
+++ b/contrib/ntp/ntpd/refclock_atom.c
@@ -26,7 +26,13 @@
# include <sys/ppsclock.h>
#endif
#ifdef HAVE_PPSAPI
-#include <sys/timepps.h>
+# ifdef HAVE_TIMEPPS_H
+# include <timepps.h>
+# else
+# ifdef HAVE_SYS_TIMEPPS_H
+# include <sys/timepps.h>
+# endif
+# endif
#endif /* HAVE_PPSAPI */
/*
diff --git a/contrib/ntp/ntpd/refclock_chu.c b/contrib/ntp/ntpd/refclock_chu.c
index 0b2ae78e1b73..4235b8edd258 100644
--- a/contrib/ntp/ntpd/refclock_chu.c
+++ b/contrib/ntp/ntpd/refclock_chu.c
@@ -1,38 +1,35 @@
/*
- * refclock_chu - clock driver for Canadian radio CHU receivers
+ * refclock_chu - clock driver for Canadian CHU time/frequency station
*/
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#if defined(REFCLOCK) && defined(CLOCK_CHU)
-/* #define AUDIO_CHUa */
-
#include <stdio.h>
#include <ctype.h>
#include <sys/time.h>
#include <time.h>
#include <math.h>
-#ifdef AUDIO_CHU
-#ifdef HAVE_SYS_AUDIOIO_H
-#include <sys/audioio.h>
-#endif /* HAVE_SYS_AUDIOIO_H */
-#ifdef HAVE_SUN_AUDIOIO_H
-#include <sun/audioio.h>
-#endif /* HAVE_SUN_AUDIOIO_H */
-#endif /* AUDIO_CHU */
-
#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
#include "ntp_calendar.h"
#include "ntp_stdlib.h"
+#ifdef AUDIO_CHU
+#include "audio.h"
+#endif /* AUDIO_CHU */
+
+#define ICOM 1 /* undefine to suppress ICOM code */
+
+#ifdef ICOM
+#include "icom.h"
+#endif /* ICOM */
/*
- * Clock driver for Canadian radio CHU receivers
+ * Audio CHU demodulator/decoder
*
* This driver synchronizes the computer time using data encoded in
* radio transmissions from Canadian time/frequency station CHU in
@@ -40,8 +37,14 @@
* 7335 kHz and 14670 kHz in upper sideband, compatible AM mode. An
* ordinary shortwave receiver can be tuned manually to one of these
* frequencies or, in the case of ICOM receivers, the receiver can be
- * tuned automatically using the minimuf and icom programs as
- * propagation conditions change throughout the day and night.
+ * tuned automatically using this program as propagation conditions
+ * change throughout the day and night.
+ *
+ * The driver receives, demodulates and decodes the radio signals when
+ * connected to the audio codec of a Sun workstation running SunOS or
+ * Solaris, and with a little help, other workstations with similar
+ * codecs or sound cards. In this implementation, only one audio driver
+ * and codec can be supported on a single machine.
*
* The driver can be compiled to use a Bell 103 compatible modem or
* modem chip to receive the radio signal and demodulate the data.
@@ -168,28 +171,34 @@
* input port, where 0 is the mike port (default) and 1 is the line-in
* port. It does not seem useful to select the compact disc player port.
* Fudge flag3 enables audio monitoring of the input signal. For this
- * purpose, the speaker volume must be set before the driver is started.
+ * purpose, the speaker volume must be set before the driver is started.
+ *
+ * The ICOM code is normally compiled in the driver. It isn't used,
+ * unless the mode keyword on the server configuration command specifies
+ * a nonzero ICOM ID select code. The C-IV trace is turned on if the
+ * debug level is greater than one.
*/
-
/*
* Interface definitions
*/
#define SPEED232 B300 /* uart speed (300 baud) */
#define PRECISION (-10) /* precision assumed (about 1 ms) */
#define REFID "CHU" /* reference ID */
+#ifdef ICOM
+#define DWELL 5 /* minutes before qsy */
+#define NCHAN 3 /* number of channels */
+#endif /* ICOM */
#ifdef AUDIO_CHU
#define DESCRIPTION "CHU Modem Receiver" /* WRU */
/*
* Audio demodulator definitions
*/
-#define AUDIO_BUFSIZ 160 /* codec buffer size (Solaris only) */
-#define SAMPLE 8000 /* nominal sample rate (Hz) */
+#define SECOND 8000 /* nominal sample rate (Hz) */
#define BAUD 300 /* modulation rate (bps) */
#define OFFSET 128 /* companded sample offset */
#define SIZE 256 /* decompanding table size */
#define MAXSIG 6000. /* maximum signal level */
-#define DRPOUT 100. /* dropout signal level */
#define LIMIT 1000. /* soft limiter threshold */
#define AGAIN 6. /* baseband gain */
#define LAG 10 /* discriminator lag */
@@ -208,8 +217,8 @@
#define MINCHAR 9 /* min characters per burst */
#define MINDIST 28 /* min burst distance (of 40) */
#define MINSYNC 8 /* min sync distance (of 16) */
-#define MINDEC .5 /* decoder majority rule (of 1.) */
#define MINSTAMP 20 /* min timestamps (of 60) */
+#define PANIC (4 * 1440) /* panic restart */
/*
* Hex extension codes (>= 16)
@@ -219,24 +228,37 @@
#define HEX_HARD 18 /* hard error */
/*
- * Error flags (up->errflg)
+ * Status bits (status)
*/
-#define CHU_ERR_RUNT 0x001 /* runt burst */
-#define CHU_ERR_NOISE 0x002 /* noise burst */
-#define CHU_ERR_BFRAME 0x004 /* invalid format B frame sync */
-#define CHU_ERR_BFORMAT 0x008 /* invalid format B data */
-#define CHU_ERR_AFRAME 0x010 /* invalid format A frame sync */
-#define CHU_ERR_DECODE 0x020 /* invalid data decode */
-#define CHU_ERR_STAMP 0x040 /* too few timestamps */
-#define CHU_ERR_AFORMAT 0x080 /* invalid format A data */
-#ifdef AUDIO_CHU
-#define CHU_ERR_ERROR 0x100 /* codec error (overrun) */
-#endif /* AUDIO_CHU */
+#define RUNT 0x0001 /* runt burst */
+#define NOISE 0x0002 /* noise burst */
+#define BFRAME 0x0004 /* invalid format B frame sync */
+#define BFORMAT 0x0008 /* invalid format B data */
+#define AFRAME 0x0010 /* invalid format A frame sync */
+#define AFORMAT 0x0020 /* invalid format A data */
+#define DECODE 0x0040 /* invalid data decode */
+#define STAMP 0x0080 /* too few timestamps */
+#define INYEAR 0x0100 /* valid B frame */
+#define INSYNC 0x0200 /* clock synchronized */
+
+/*
+ * Alarm status bits (alarm)
+ *
+ * These alarms are set at the end of a minute in which at least one
+ * burst was received. SYNERR is raised if the AFRAME or BFRAME status
+ * bits are set during the minute, FMTERR is raised if the AFORMAT or
+ * BFORMAT status bits are set, DECERR is raised if the DECODE status
+ * bit is set and TSPERR is raised if the STAMP status bit is set.
+ */
+#define SYNERR 0x01 /* frame sync error */
+#define FMTERR 0x02 /* data format error */
+#define DECERR 0x04 /* data decoding error */
+#define TSPERR 0x08 /* insufficient data */
#ifdef AUDIO_CHU
struct surv {
double shift[12]; /* mark register */
- double max, min; /* max/min envelope signals */
+ double es_max, es_min; /* max/min envelope signals */
double dist; /* sample distance */
int uart; /* decoded character */
};
@@ -253,8 +275,14 @@ struct chuunit {
l_fp laststamp; /* last buffer timestamp */
l_fp charstamp; /* character time as a l_fp */
int errflg; /* error flags */
+ int status; /* status bits */
int bufptr; /* buffer index pointer */
- int pollcnt; /* poll message counter */
+ char ident[10]; /* transmitter frequency */
+#ifdef ICOM
+ int chan; /* frequency identifier */
+ int dwell; /* dwell minutes at current frequency */
+ int fd_icom; /* ICOM file descriptor */
+#endif /* ICOM */
/*
* Character burst variables
@@ -264,9 +292,18 @@ struct chuunit {
int ndx; /* buffer start index */
int prevsec; /* previous burst second */
int burdist; /* burst distance */
+ int mindist; /* minimum distance */
int syndist; /* sync distance */
int burstcnt; /* format A bursts this minute */
+ /*
+ * Format particulars
+ */
+ int leap; /* leap/dut code */
+ int dut; /* UTC1 correction */
+ int tai; /* TAI - UTC correction */
+ int dst; /* Canadian DST code */
+
#ifdef AUDIO_CHU
/*
* Audio codec variables
@@ -313,28 +350,23 @@ static void chu_poll P((int, struct peer *));
static void chu_decode P((struct peer *, int));
static void chu_burst P((struct peer *));
static void chu_clear P((struct peer *));
-static void chu_update P((struct peer *, int));
-static void chu_year P((struct peer *, int));
+static void chu_a P((struct peer *, int));
+static void chu_b P((struct peer *, int));
static int chu_dist P((int, int));
+static int chu_major P((struct peer *));
#ifdef AUDIO_CHU
static void chu_uart P((struct surv *, double));
static void chu_rf P((struct peer *, double));
static void chu_gain P((struct peer *));
-static int chu_audio P((void));
-static void chu_debug P((void));
#endif /* AUDIO_CHU */
/*
* Global variables
*/
static char hexchar[] = "0123456789abcdef_-=";
-#ifdef AUDIO_CHU
-#ifdef HAVE_SYS_AUDIOIO_H
-struct audio_device device; /* audio device ident */
-#endif /* HAVE_SYS_AUDIOIO_H */
-static struct audio_info info; /* audio device info */
-static int chu_ctl_fd; /* audio control file descriptor */
-#endif /* AUDIO_CHU */
+#ifdef ICOM
+static double qsy[NCHAN] = {3.33, 7.335, 14.67}; /* frequencies (MHz) */
+#endif /* ICOM */
/*
* Transfer vector
@@ -361,11 +393,11 @@ chu_start(
{
struct chuunit *up;
struct refclockproc *pp;
-
- /*
- * Local variables
- */
int fd; /* file descriptor */
+#ifdef ICOM
+ char tbuf[80]; /* trace buffer */
+ int temp;
+#endif /* ICOM */
#ifdef AUDIO_CHU
int i; /* index */
double step; /* codec adjustment */
@@ -373,16 +405,18 @@ chu_start(
/*
* Open audio device
*/
- fd = open("/dev/audio", O_RDWR | O_NONBLOCK, 0777);
- if (fd == -1) {
- perror("chu: audio");
+ fd = audio_init();
+ if (fd < 0)
return (0);
- }
+#ifdef DEBUG
+ if (debug)
+ audio_show();
+#endif
#else
char device[20]; /* device name */
/*
- * Open serial port. Use RAW line discipline (required).
+ * Open serial port in raw mode.
*/
(void)sprintf(device, DEVICE, unit);
if (!(fd = refclock_open(device, SPEED232, LDISC_RAW))) {
@@ -418,14 +452,8 @@ chu_start(
pp->clockdesc = DESCRIPTION;
memcpy((char *)&pp->refid, REFID, 4);
DTOLFP(CHAR, &up->charstamp);
- up->pollcnt = 2;
#ifdef AUDIO_CHU
- up->gain = (AUDIO_MAX_GAIN - AUDIO_MIN_GAIN) / 2;
- if (chu_audio() < 0) {
- io_closeclock(&pp->io);
- free(up);
- return (0);
- }
+ up->gain = 127;
/*
* The companded samples are encoded sign-magnitude. The table
@@ -441,8 +469,43 @@ chu_start(
if (i % 16 == 0)
step *= 2.;
}
- DTOLFP(1. / SAMPLE, &up->tick);
+ DTOLFP(1. / SECOND, &up->tick);
#endif /* AUDIO_CHU */
+ strcpy(up->ident, "X");
+#ifdef ICOM
+ temp = 0;
+#ifdef DEBUG
+ if (debug > 1)
+ temp = P_TRACE;
+#endif
+ if (peer->ttl > 0) {
+ if (peer->ttl & 0x80)
+ up->fd_icom = icom_init("/dev/icom", B1200,
+ temp);
+ else
+ up->fd_icom = icom_init("/dev/icom", B9600,
+ temp);
+ }
+ if (up->fd_icom > 0) {
+ if (icom_freq(up->fd_icom, peer->ttl & 0x7f,
+ qsy[up->chan]) < 0) {
+ NLOG(NLOG_SYNCEVENT | NLOG_SYSEVENT)
+ msyslog(LOG_ERR,
+ "ICOM bus error; autotune disabled");
+ up->errflg = CEVNT_FAULT;
+ close(up->fd_icom);
+ up->fd_icom = 0;
+ } else {
+ sprintf(up->ident, "%.1f", qsy[up->chan]);
+ sprintf(tbuf, "chu: QSY to %s MHz", up->ident);
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif
+ }
+ }
+#endif /* ICOM */
return (1);
}
@@ -462,6 +525,8 @@ chu_shutdown(
pp = peer->procptr;
up = (struct chuunit *)pp->unitptr;
io_closeclock(&pp->io);
+ if (up->fd_icom > 0)
+ close(up->fd_icom);
free(up);
}
@@ -479,15 +544,12 @@ chu_receive(
struct refclockproc *pp;
struct peer *peer;
- /*
- * Local variables
- */
double sample; /* codec sample */
u_char *dpt; /* buffer pointer */
l_fp ltemp; /* l_fp temp */
- double dtemp; /* double temp */
int isneg; /* parity flag */
- int i, j; /* index temps */
+ double dtemp;
+ int i, j;
peer = (struct peer *)rbufp->recv_srcclock;
pp = peer->procptr;
@@ -499,7 +561,7 @@ chu_receive(
*/
up->timestamp = rbufp->recv_time;
up->bufcnt = rbufp->recv_length;
- DTOLFP(up->bufcnt * 1. / SAMPLE, &ltemp);
+ DTOLFP(up->bufcnt * 1. / SECOND, &ltemp);
L_SUB(&up->timestamp, &ltemp);
dpt = (u_char *)&rbufp->recv_space;
for (up->bufptr = 0; up->bufptr < up->bufcnt; up->bufptr++) {
@@ -517,14 +579,13 @@ chu_receive(
sample = -MAXSIG;
up->clipcnt++;
}
- up->seccnt = (up->seccnt + 1) % SAMPLE;
+ up->seccnt = (up->seccnt + 1) % SECOND;
if (up->seccnt == 0) {
if (pp->sloppyclockflag & CLK_FLAG2)
- up->port = AUDIO_LINE_IN;
+ up->port = 2;
else
- up->port = AUDIO_MICROPHONE;
+ up->port = 1;
chu_gain(peer);
- up->clipcnt = 0;
}
chu_rf(peer, sample);
@@ -584,7 +645,7 @@ chu_receive(
* code. Hopefully, the compiler will efficiently implement the move-
* and-muiltiply-and-add operations.
*/
-void
+static void
chu_rf(
struct peer *peer, /* peer structure pointer */
double sample /* analog sample */
@@ -603,10 +664,11 @@ chu_rf(
double lpf; /* lowpass signal */
double span; /* UART signal span */
double dist; /* UART signal distance */
- int i, j; /* index temps */
+ int i, j;
pp = peer->procptr;
up = (struct chuunit *)pp->unitptr;
+
/*
* Bandpass filter. 4th-order elliptic, 500-Hz bandpass centered
* at 2125 Hz. Passband ripple 0.3 dB, stopband ripple 50 dB.
@@ -684,10 +746,7 @@ chu_rf(
lpf += (up->lpf[2] = up->lpf[1]) * 2.003159e-01;
lpf += (up->lpf[1] = up->lpf[0]) * 1.084671e-01;
lpf += up->lpf[0] = disc * 2.538771e-02;
-/*
-printf("%8.3f %8.3f\n", disc, lpf);
-return;
-*/
+
/*
* Maximum likelihood decoder. The UART updates each of the
* eight survivors and determines the span, slice level and
@@ -697,11 +756,11 @@ return;
* survivor with maximum distance determines the final decoded
* character.
*/
- up->baud += 1. / SAMPLE;
+ up->baud += 1. / SECOND;
if (up->baud > 1. / (BAUD * 8.)) {
up->baud -= 1. / (BAUD * 8.);
sp = &up->surv[up->decptr];
- span = sp->max - sp->min;
+ span = sp->es_max - sp->es_min;
up->maxsignal += (span - up->maxsignal) / 80.;
if (up->dbrk > 0) {
up->dbrk--;
@@ -734,34 +793,31 @@ return;
* program selects over the last eight survivors the one with maximum
* distance to determine the decoded character.
*/
-void
+static void
chu_uart(
struct surv *sp, /* survivor structure pointer */
double sample /* baseband signal */
)
{
- /*
- * Local variables
- */
- double max, min; /* max/min envelope */
+ double es_max, es_min; /* max/min envelope */
double slice; /* slice level */
double dist; /* distance */
- double dtemp; /* double temp */
- int i; /* index temp */
+ double dtemp;
+ int i;
/*
* Save the sample and shift right. At the same time, measure
* the maximum and minimum over all eleven samples.
*/
- max = -1e6;
- min = 1e6;
+ es_max = -1e6;
+ es_min = 1e6;
sp->shift[0] = sample;
for (i = 11; i > 0; i--) {
sp->shift[i] = sp->shift[i - 1];
- if (sp->shift[i] > max)
- max = sp->shift[i];
- if (sp->shift[i] < min)
- min = sp->shift[i];
+ if (sp->shift[i] > es_max)
+ es_max = sp->shift[i];
+ if (sp->shift[i] < es_min)
+ es_min = sp->shift[i];
}
/*
@@ -770,7 +826,7 @@ chu_uart(
* the distance on the assumption the first and last bits must
* be mark, the second space and the rest either mark or space.
*/
- slice = (max + min) / 2.;
+ slice = (es_max + es_min) / 2.;
dist = 0;
sp->uart = 0;
for (i = 1; i < 12; i++) {
@@ -779,19 +835,19 @@ chu_uart(
if (dtemp > slice)
sp->uart |= 0x1;
if (i == 1 || i == 11) {
- dist += dtemp - min;
+ dist += dtemp - es_min;
} else if (i == 10) {
- dist += max - dtemp;
+ dist += es_max - dtemp;
} else {
if (dtemp > slice)
- dist += dtemp - min;
+ dist += dtemp - es_min;
else
- dist += max - dtemp;
+ dist += es_max - dtemp;
}
}
- sp->max = max;
- sp->min = min;
- sp->dist = dist / (11 * (max - min));
+ sp->es_max = es_max;
+ sp->es_min = es_min;
+ sp->dist = dist / (11 * (es_max - es_min));
}
@@ -836,11 +892,8 @@ chu_decode(
struct refclockproc *pp;
struct chuunit *up;
- /*
- * Local variables
- */
l_fp tstmp; /* timestamp temp */
- double dtemp; /* double temp */
+ double dtemp;
pp = peer->procptr;
up = (struct chuunit *)pp->unitptr;
@@ -888,10 +941,7 @@ chu_burst(
struct chuunit *up;
struct refclockproc *pp;
- /*
- * Local variables
- */
- int i; /* index temp */
+ int i;
pp = peer->procptr;
up = (struct chuunit *)pp->unitptr;
@@ -903,7 +953,7 @@ chu_burst(
* match the inverse for format B.
*/
if (up->ndx < MINCHAR) {
- up->errflg |= CHU_ERR_RUNT;
+ up->status |= RUNT;
return;
}
up->burdist = 0;
@@ -913,15 +963,16 @@ chu_burst(
/*
* If the burst distance is at least MINDIST, this must be a
* format A burst; if the value is not greater than -MINDIST, it
- * must be a format B burst; otherwise, it is a noise burst and
- * of no use to anybody.
+ * must be a format B burst. If the B burst is perfect, we
+ * believe it; otherwise, it is a noise burst and of no use to
+ * anybody.
*/
if (up->burdist >= MINDIST) {
- chu_update(peer, up->ndx);
+ chu_a(peer, up->ndx);
} else if (up->burdist <= -MINDIST) {
- chu_year(peer, up->ndx);
+ chu_b(peer, up->ndx);
} else {
- up->errflg |= CHU_ERR_NOISE;
+ up->status |= NOISE;
return;
}
@@ -931,18 +982,16 @@ chu_burst(
* process the minute. Don't do this if this is called from the
* timer interrupt routine.
*/
- if (peer->outdate == current_time)
- up->pollcnt = 2;
- else
+ if (peer->outdate != current_time)
peer->nextdate = current_time + 10;
}
/*
- * chu_year - decode format B burst
+ * chu_b - decode format B burst
*/
static void
-chu_year(
+chu_b(
struct peer *peer,
int nchar
)
@@ -950,16 +999,10 @@ chu_year(
struct refclockproc *pp;
struct chuunit *up;
- /*
- * Local variables
- */
u_char code[11]; /* decoded timecode */
+ char tbuf[80]; /* trace buffer */
l_fp offset; /* timestamp offset */
- int leap; /* leap/dut code */
- int dut; /* UTC1 correction */
- int tai; /* TAI - UTC correction */
- int dst; /* Canadian DST code */
- int i; /* index temp */
+ int i;
pp = peer->procptr;
up = (struct chuunit *)pp->unitptr;
@@ -970,37 +1013,39 @@ chu_year(
* is considered valid only if all characters are valid; that
* is, only if the distance is 40.
*/
- sprintf(pp->a_lastcode, "%2d %2d ", nchar, -up->burdist);
+ sprintf(tbuf, "chuB %04x %2d %2d ", up->status, nchar,
+ -up->burdist);
for (i = 0; i < nchar; i++)
- sprintf(&pp->a_lastcode[strlen(pp->a_lastcode)], "%02x",
+ sprintf(&tbuf[strlen(tbuf)], "%02x",
up->cbuf[i]);
- pp->lencode = strlen(pp->a_lastcode);
if (pp->sloppyclockflag & CLK_FLAG4)
- record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ record_clock_stats(&peer->srcadr, tbuf);
#ifdef DEBUG
- if (debug > 2)
- printf("chu: %s\n", pp->a_lastcode);
+ if (debug)
+ printf("%s\n", tbuf);
#endif
- if (-up->burdist < 40) {
- up->errflg |= CHU_ERR_BFRAME;
+ if (up->burdist > -40) {
+ up->status |= BFRAME;
return;
}
+ up->status |= INYEAR;
/*
* Convert the burst data to internal format. If this succeeds,
- * save the timestamps for later. The leap, dut, tai and dst are
- * presently unused.
+ * save the timestamps for later.
*/
for (i = 0; i < 5; i++) {
code[2 * i] = hexchar[up->cbuf[i] & 0xf];
code[2 * i + 1] = hexchar[(up->cbuf[i] >>
4) & 0xf];
}
- if (sscanf((char *)code, "%1x%1d%4d%2d%2x", &leap, &dut,
- &pp->year, &tai, &dst) != 5) {
- up->errflg |= CHU_ERR_BFORMAT;
+ if (sscanf((char *)code, "%1x%1d%4d%2d%2x", &up->leap, &up->dut,
+ &pp->year, &up->tai, &up->dst) != 5) {
+ up->status |= BFORMAT;
return;
}
+ if (up->leap & 0x8)
+ up->dut = -up->dut;
offset.l_ui = 31;
offset.l_f = 0;
for (i = 0; i < nchar && i < 10; i++) {
@@ -1014,10 +1059,10 @@ chu_year(
/*
- * chu_update - decode format A burst
+ * chu_a - decode format A burst
*/
static void
-chu_update(
+chu_a(
struct peer *peer,
int nchar
)
@@ -1025,13 +1070,11 @@ chu_update(
struct refclockproc *pp;
struct chuunit *up;
- /*
- * Local variables
- */
+ char tbuf[80]; /* trace buffer */
l_fp offset; /* timestamp offset */
int val; /* distance */
- int temp; /* common temp */
- int i, j, k; /* index temps */
+ int temp;
+ int i, j, k;
pp = peer->procptr;
up = (struct chuunit *)pp->unitptr;
@@ -1061,31 +1104,29 @@ chu_update(
k = i;
}
}
-
temp = (up->cbuf[k + 4] >> 4) & 0xf;
if (temp > 9 || k + 9 >= nchar || temp != ((up->cbuf[k + 9] >>
4) & 0xf))
temp = 0;
#ifdef AUDIO_CHU
- sprintf(pp->a_lastcode, "%3d %4.0f %2d %2d %2d %2d %1d ",
- up->gain, up->maxsignal, nchar, up->burdist, k, up->syndist,
- temp);
+ sprintf(tbuf, "chuA %04x %4.0f %2d %2d %2d %2d %1d ",
+ up->status, up->maxsignal, nchar, up->burdist, k,
+ up->syndist, temp);
#else
- sprintf(pp->a_lastcode, "%2d %2d %2d %2d %1d ", nchar,
- up->burdist, k, up->syndist, temp);
+ sprintf(tbuf, "chuA %04x %2d %2d %2d %2d %1d ", up->status,
+ nchar, up->burdist, k, up->syndist, temp);
#endif /* AUDIO_CHU */
for (i = 0; i < nchar; i++)
- sprintf(&pp->a_lastcode[strlen(pp->a_lastcode)], "%02x",
+ sprintf(&tbuf[strlen(tbuf)], "%02x",
up->cbuf[i]);
- pp->lencode = strlen(pp->a_lastcode);
if (pp->sloppyclockflag & CLK_FLAG4)
- record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ record_clock_stats(&peer->srcadr, tbuf);
#ifdef DEBUG
- if (debug > 2)
- printf("chu: %s\n", pp->a_lastcode);
+ if (debug)
+ printf("%s\n", tbuf);
#endif
if (up->syndist < MINSYNC) {
- up->errflg |= CHU_ERR_AFRAME;
+ up->status |= AFRAME;
return;
}
@@ -1127,8 +1168,10 @@ chu_update(
i += 2;
continue;
}
- up->decode[i++][up->cbuf[j] & 0xf]++;
- up->decode[i++][(up->cbuf[j] >> 4) & 0xf]++;
+ up->decode[i][up->cbuf[j] & 0xf]++;
+ i++;
+ up->decode[i][(up->cbuf[j] >> 4) & 0xf]++;
+ i++;
}
up->burstcnt++;
}
@@ -1140,53 +1183,155 @@ chu_update(
static void
chu_poll(
int unit,
- struct peer *peer
+ struct peer *peer /* peer structure pointer */
)
{
struct refclockproc *pp;
struct chuunit *up;
-
- /*
- * Local variables
- */
- u_char code[11]; /* decoded timecode */
- l_fp toffset, offset; /* l_fp temps */
- int mindist; /* minimum distance */
- int val1, val2; /* maximum distance */
- int synchar; /* should be a 6 in traffic */
- double dtemp; /* double temp */
- int temp; /* common temp */
- int i, j, k; /* index temps */
-
+ char synchar, qual, leapchar;
+ int minset;
+ int temp;
+#ifdef ICOM
+ char tbuf[80]; /* trace buffer */
+#endif /* ICOM */
pp = peer->procptr;
up = (struct chuunit *)pp->unitptr;
+ if (pp->coderecv == pp->codeproc)
+ up->errflg = CEVNT_TIMEOUT;
+ else
+ pp->polls++;
+ minset = ((current_time - peer->update) + 30) / 60;
+ if (up->status & INSYNC) {
+ if (minset > PANIC)
+ up->status = 0;
+ else
+ peer->reach |= 1;
+ }
/*
* Process the last burst, if still in the burst buffer.
* Don't mess with anything if nothing has been heard.
*/
chu_burst(peer);
- if (up->pollcnt == 0)
- refclock_report(peer, CEVNT_TIMEOUT);
- else
- up->pollcnt--;
- if (up->burstcnt == 0) {
- chu_clear(peer);
+#ifdef ICOM
+ if (up->burstcnt > 2) {
+ up->dwell = 0;
+ } else if (up->dwell < DWELL) {
+ up->dwell++;
+ } else if (up->fd_icom > 0) {
+ up->dwell = 0;
+ up->chan = (up->chan + 1) % NCHAN;
+ icom_freq(up->fd_icom, peer->ttl & 0x7f, qsy[up->chan]);
+ sprintf(up->ident, "%.3f", qsy[up->chan]);
+ sprintf(tbuf, "chu: QSY to %s MHz", up->ident);
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif
+ }
+#endif /* ICOM */
+ if (up->burstcnt == 0)
return;
+ temp = chu_major(peer);
+ if (up->status & INYEAR)
+ up->status |= INSYNC;
+ qual = 0;
+ if (up->status & (BFRAME | AFRAME))
+ qual |= SYNERR;
+ if (up->status & (BFORMAT | AFORMAT))
+ qual |= FMTERR;
+ if (up->status & DECODE)
+ qual |= DECERR;
+ if (up->status & STAMP)
+ qual |= TSPERR;
+ synchar = leapchar = ' ';
+ if (!(up->status & INSYNC)) {
+ pp->leap = LEAP_NOTINSYNC;
+ synchar = '?';
+ } else if (up->leap & 0x2) {
+ pp->leap = LEAP_ADDSECOND;
+ leapchar = 'L';
+ } else {
+ pp->leap = LEAP_NOWARNING;
}
+#ifdef AUDIO_CHU
+ sprintf(pp->a_lastcode,
+ "%c%1X %4d %3d %02d:%02d:%02d.000 %c%x %+d %d %d %s %d %d %d %d",
+ synchar, qual, pp->year, pp->day, pp->hour, pp->minute,
+ pp->second, leapchar, up->dst, up->dut, minset, up->gain,
+ up->ident, up->tai, up->burstcnt, up->mindist, up->ntstamp);
+#else
+ sprintf(pp->a_lastcode,
+ "%c%1X %4d %3d %02d:%02d:%02d.000 %c%x %+d %d %s %d %d %d %d",
+ synchar, qual, pp->year, pp->day, pp->hour, pp->minute,
+ pp->second, leapchar, up->dst, up->dut, minset,
+ up->ident, up->tai, up->burstcnt, up->mindist, up->ntstamp);
+#endif /* AUDIO_CHU */
+ pp->lencode = strlen(pp->a_lastcode);
/*
- * Majority decoder. Select the character with the most
- * occurrences for each burst position. The distance for the
- * character is this number of occurrences. If no occurrences
- * are found, assume a miss '_'; if only a single occurrence is
- * found, assume a soft error '-'; if two different characters
+ * If timestamps have been stuffed, the timecode is ipso fatso
+ * correct and can be selected to discipline the clock.
+ */
+ if (temp > 0) {
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ refclock_receive(peer);
+ } else if (pp->sloppyclockflag & CLK_FLAG4) {
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ }
+#ifdef DEBUG
+ if (debug)
+ printf("chu: timecode %d %s\n", pp->lencode,
+ pp->a_lastcode);
+#endif
+ chu_clear(peer);
+ if (up->errflg)
+ refclock_report(peer, up->errflg);
+ up->errflg = 0;
+}
+
+
+/*
+ * chu_major - majority decoder
+ */
+static int
+chu_major(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct chuunit *up;
+
+ u_char code[11]; /* decoded timecode */
+ l_fp toffset, offset; /* l_fp temps */
+ int val1, val2; /* maximum distance */
+ int synchar; /* stray cat */
+ double dtemp;
+ int temp;
+ int i, j, k;
+
+ pp = peer->procptr;
+ up = (struct chuunit *)pp->unitptr;
+
+ /*
+ * Majority decoder. Each burst encodes two replications at each
+ * digit position in the timecode. Each row of the decoding
+ * matrix encodes the number of occurences of each digit found
+ * at the corresponding position. The maximum over all
+ * occurences at each position is the distance for this position
+ * and the corresponding digit is the maximumn likelihood
+ * candidate. If the distance is zero, assume a miss '_'; if the
+ * distance is not more than half the total number of
+ * occurences, assume a soft error '-'; if two different digits
* with the same distance are found, assume a hard error '='.
- * The decoding distance is defined as the minimum of the
- * character distances.
+ * These will later cause a format error when the timecode is
+ * interpreted. The decoding distance is defined as the minimum
+ * distance over the first nine digits. The tenth digit varies
+ * over the seconds, so we don't count it.
*/
- mindist = 16;
- for (i = 0; i < 10; i++) {
+ up->mindist = 16;
+ for (i = 0; i < 9; i++) {
val1 = val2 = 0;
k = 0;
for (j = 0; j < 16; j++) {
@@ -1197,21 +1342,30 @@ chu_poll(
k = j;
}
}
- if (val1 > 0 && val1 == val2)
+ if (val1 == 0)
+ code[i] = HEX_MISS;
+ else if (val1 == val2)
code[i] = HEX_HARD;
- else if (val1 < 2)
+ else if (val1 <= up->burstcnt)
code[i] = HEX_SOFT;
else
code[i] = k;
- if (val1 < mindist)
- mindist = val1;
+ if (val1 < up->mindist)
+ up->mindist = val1;
code[i] = hexchar[code[i]];
}
code[i] = 0;
- if (mindist < up->burstcnt * 2 * MINDEC)
- up->errflg |= CHU_ERR_DECODE;
+
+ /*
+ * A valid timecode requires at least three bursts and a
+ * decoding distance greater than half the total number of
+ * occurences. A valid timecode also requires at least 20 valid
+ * timestamps.
+ */
+ if (up->burstcnt < 3 || up->mindist <= up->burstcnt)
+ up->status |= DECODE;
if (up->ntstamp < MINSTAMP)
- up->errflg |= CHU_ERR_STAMP;
+ up->status |= STAMP;
/*
* Compute the timecode timestamp from the days, hours and
@@ -1220,34 +1374,21 @@ chu_poll(
* seconds. Note that this code relies on the filesystem time
* for the years and does not use the years of the timecode.
*/
- if (sscanf((char *)code, "%1x%3d%2d%2d", &synchar, &pp->day, &pp->hour,
- &pp->minute) != 4)
- up->errflg |= CHU_ERR_AFORMAT;
- sprintf(pp->a_lastcode,
- "%02x %4d %3d %02d:%02d:%02d %2d %2d %2d",
- up->errflg, pp->year, pp->day, pp->hour, pp->minute,
- pp->second, up->burstcnt, mindist, up->ntstamp);
- pp->lencode = strlen(pp->a_lastcode);
- record_clock_stats(&peer->srcadr, pp->a_lastcode);
-#ifdef DEBUG
- if (debug > 2)
- printf("chu: %s\n", pp->a_lastcode);
-#endif
- if (up->errflg & (CHU_ERR_DECODE | CHU_ERR_STAMP |
- CHU_ERR_AFORMAT)) {
- refclock_report(peer, CEVNT_BADREPLY);
- chu_clear(peer);
- return;
+ if (sscanf((char *)code, "%1x%3d%2d%2d", &synchar, &pp->day,
+ &pp->hour, &pp->minute) != 4) {
+ up->status |= AFORMAT;
+ return (0);
+ }
+ if (up->status & (DECODE | STAMP)) {
+ up->errflg = CEVNT_BADREPLY;
+ return (0);
}
L_CLR(&offset);
if (!clocktime(pp->day, pp->hour, pp->minute, 0, GMT,
up->tstamp[0].l_ui, &pp->yearstart, &offset.l_ui)) {
- refclock_report(peer, CEVNT_BADTIME);
- chu_clear(peer);
- return;
+ up->errflg = CEVNT_BADTIME;
+ return (0);
}
- pp->polls++;
- pp->leap = LEAP_NOWARNING;
pp->lastref = offset;
pp->variance = 0;
for (i = 0; i < up->ntstamp; i++) {
@@ -1256,9 +1397,7 @@ chu_poll(
LFPTOD(&toffset, dtemp);
SAMPLE(dtemp + FUDGE + pp->fudgetime1);
}
- if (i > 0)
- refclock_receive(peer);
- chu_clear(peer);
+ return (i);
}
@@ -1267,25 +1406,22 @@ chu_poll(
*/
static void
chu_clear(
- struct peer *peer
+ struct peer *peer /* peer structure pointer */
)
{
struct refclockproc *pp;
struct chuunit *up;
-
- /*
- * Local variables
- */
- int i, j; /* index temps */
+ int i, j;
pp = peer->procptr;
up = (struct chuunit *)pp->unitptr;
/*
- * Clear stuff for following minute.
+ * Clear stuff for the minute.
*/
- up->ndx = up->ntstamp = up->prevsec = 0;
- up->errflg = 0;
+ up->ndx = up->prevsec = 0;
+ up->burstcnt = up->mindist = up->ntstamp = 0;
+ up->status &= INSYNC | INYEAR;
up->burstcnt = 0;
for (i = 0; i < 20; i++) {
for (j = 0; j < 16; j++)
@@ -1303,12 +1439,9 @@ chu_dist(
int y /* another octet of bits */
)
{
- /*
- * Local variables
- */
int val; /* bit count */
- int temp; /* misc temporary */
- int i; /* index temporary */
+ int temp;
+ int i;
/*
* The distance is determined as the weight of the exclusive OR
@@ -1353,112 +1486,23 @@ chu_gain(
/*
* Apparently, the codec uses only the high order bits of the
* gain control field. Thus, it may take awhile for changes to
- * wiggle the hardware bits. Set the new bits in the structure
- * and call AUDIO_SETINFO. Upon return, the old bits are in the
- * structure.
+ * wiggle the hardware bits.
*/
if (up->clipcnt == 0) {
up->gain += 4;
- if (up->gain > AUDIO_MAX_GAIN)
- up->gain = AUDIO_MAX_GAIN;
- } else if (up->clipcnt > SAMPLE / 100) {
+ if (up->gain > 255)
+ up->gain = 255;
+ } else if (up->clipcnt > SECOND / 100) {
up->gain -= 4;
- if (up->gain < AUDIO_MIN_GAIN)
- up->gain = AUDIO_MIN_GAIN;
- }
- AUDIO_INITINFO(&info);
- info.record.port = up->port;
- info.record.gain = up->gain;
- info.record.error = 0;
- ioctl(chu_ctl_fd, (int)AUDIO_SETINFO, &info);
- if (info.record.error)
- up->errflg |= CHU_ERR_ERROR;
-}
-
-
-/*
- * chu_audio - initialize audio device
- *
- * This code works with SunOS 4.1.3 and Solaris 2.6; however, it is
- * believed generic and applicable to other systems with a minor twid
- * or two. All it does is open the device, set the buffer size (Solaris
- * only), preset the gain and set the input port. It assumes that the
- * codec sample rate (8000 Hz), precision (8 bits), number of channels
- * (1) and encoding (ITU-T G.711 mu-law companded) have been set by
- * default.
- */
-static int
-chu_audio(
- )
-{
- /*
- * Open audio control device
- */
- if ((chu_ctl_fd = open("/dev/audioctl", O_RDWR)) < 0) {
- perror("audioctl");
- return(-1);
- }
-#ifdef HAVE_SYS_AUDIOIO_H
- /*
- * Set audio device parameters.
- */
- AUDIO_INITINFO(&info);
- info.record.buffer_size = AUDIO_BUFSIZ;
- if (ioctl(chu_ctl_fd, (int)AUDIO_SETINFO, &info) < 0) {
- perror("AUDIO_SETINFO");
- close(chu_ctl_fd);
- return(-1);
+ if (up->gain < 0)
+ up->gain = 0;
}
-#endif /* HAVE_SYS_AUDIOIO_H */
-#ifdef DEBUG
- chu_debug();
-#endif /* DEBUG */
- return(0);
+ audio_gain(up->gain, up->port);
+ up->clipcnt = 0;
}
-
-
-#ifdef DEBUG
-/*
- * chu_debug - display audio parameters
- *
- * This code doesn't really do anything, except satisfy curiousity and
- * verify the ioctl's work.
- */
-static void
-chu_debug(
- )
-{
- if (debug == 0)
- return;
-#ifdef HAVE_SYS_AUDIOIO_H
- ioctl(chu_ctl_fd, (int)AUDIO_GETDEV, &device);
- printf("chu: name %s, version %s, config %s\n",
- device.name, device.version, device.config);
-#endif /* HAVE_SYS_AUDIOIO_H */
- ioctl(chu_ctl_fd, (int)AUDIO_GETINFO, &info);
- printf(
- "chu: samples %d, channels %d, precision %d, encoding %d\n",
- info.record.sample_rate, info.record.channels,
- info.record.precision, info.record.encoding);
-#ifdef HAVE_SYS_AUDIOIO_H
- printf("chu: gain %d, port %d, buffer %d\n",
- info.record.gain, info.record.port,
- info.record.buffer_size);
-#else /* HAVE_SYS_AUDIOIO_H */
- printf("chu: gain %d, port %d\n",
- info.record.gain, info.record.port);
-#endif /* HAVE_SYS_AUDIOIO_H */
- printf(
- "chu: samples %d, eof %d, pause %d, error %d, waiting %d, balance %d\n",
- info.record.samples, info.record.eof,
- info.record.pause, info.record.error,
- info.record.waiting, info.record.balance);
- printf("chu: monitor %d, muted %d\n",
- info.monitor_gain, info.output_muted);
-}
-#endif /* DEBUG */
#endif /* AUDIO_CHU */
+
#else
int refclock_chu_bs;
#endif /* REFCLOCK */
diff --git a/contrib/ntp/ntpd/refclock_conf.c b/contrib/ntp/ntpd/refclock_conf.c
index d203dd7c22ff..71140c8192af 100644
--- a/contrib/ntp/ntpd/refclock_conf.c
+++ b/contrib/ntp/ntpd/refclock_conf.c
@@ -42,7 +42,13 @@ extern struct refclock refclock_chu;
#define refclock_chu refclock_none
#endif
-#ifdef CLOCK_WWVB
+#ifdef CLOCK_WWV
+extern struct refclock refclock_wwv;
+#else
+#define refclock_wwv refclock_none
+#endif
+
+#ifdef CLOCK_SPECTRACOM
extern struct refclock refclock_wwvb;
#else
#define refclock_wwvb refclock_none
@@ -168,7 +174,7 @@ extern struct refclock refclock_arc;
#define refclock_arc refclock_none
#endif
-#ifdef SHM
+#ifdef CLOCK_SHM
extern struct refclock refclock_shm;
#else
#define refclock_shm refclock_none
@@ -210,6 +216,18 @@ extern struct refclock refclock_ulink;
#define refclock_ulink refclock_none
#endif
+#ifdef CLOCK_PCF
+extern struct refclock refclock_pcf;
+#else
+#define refclock_pcf refclock_none
+#endif
+
+#ifdef CLOCK_FG
+extern struct refclock refclock_fg;
+#else
+#define refclock_fg refclock_none
+#endif
+
/*
* Order is clock_start(), clock_shutdown(), clock_poll(),
@@ -222,10 +240,10 @@ struct refclock *refclock_conf[] = {
&refclock_local, /* 1 REFCLK_LOCAL */
&refclock_trak, /* 2 REFCLK_GPS_TRAK */
&refclock_pst, /* 3 REFCLK_WWV_PST */
- &refclock_wwvb, /* 4 REFCLK_WWVB_SPECTRACOM */
+ &refclock_wwvb, /* 4 REFCLK_SPECTRACOM */
&refclock_true, /* 5 REFCLK_TRUETIME */
&refclock_irig, /* 6 REFCLK_IRIG_AUDIO */
- &refclock_chu, /* 7 REFCLK_CHU */
+ &refclock_chu, /* 7 REFCLK_CHU_AUDIO */
&refclock_parse, /* 8 REFCLK_PARSE */
&refclock_mx4200, /* 9 REFCLK_GPS_MX4200 */
&refclock_as2201, /* 10 REFCLK_GPS_AS2201 */
@@ -253,6 +271,9 @@ struct refclock *refclock_conf[] = {
&refclock_chronolog, /* 32 REFCLK_CHRONOLOG */
&refclock_dumbclock, /* 33 REFCLK_DUMBCLOCK */
&refclock_ulink, /* 34 REFCLOCK_ULINK */
+ &refclock_pcf, /* 35 REFCLOCK_PCF */
+ &refclock_wwv, /* 36 REFCLOCK_WWV_AUDIO */
+ &refclock_fg /* 37 REFCLOCK_FG */
};
u_char num_refclock_conf = sizeof(refclock_conf)/sizeof(struct refclock *);
diff --git a/contrib/ntp/ntpd/refclock_fg.c b/contrib/ntp/ntpd/refclock_fg.c
new file mode 100644
index 000000000000..f1320b010d9e
--- /dev/null
+++ b/contrib/ntp/ntpd/refclock_fg.c
@@ -0,0 +1,350 @@
+/*
+ * refclock_fg - clock driver for the Forum Graphic GPS datating station
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_FG)
+
+#include <time.h>
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+/*
+ * This driver supports the Forum Graphic GPS dating station.
+ * More information about FG GPS is available on http://www.forumgraphic.com
+ * Contact das@amt.ru for any question about this driver.
+ */
+
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/fgclock%d"
+#define PRECISION (-10) /* precision assumed (about 1 ms) */
+#define REFID "GPS"
+#define DESCRIPTION "Forum Graphic GPS dating station"
+#define LENFG 26 /* timecode length */
+#define SPEED232 B9600 /* uart speed (9600 baud) */
+
+/*
+ * Function prototypes
+ */
+static int fg_init P((int));
+static int fg_start P((int, struct peer *));
+static void fg_shutdown P((int, struct peer *));
+static void fg_poll P((int, struct peer *));
+static void fg_receive P((struct recvbuf *));
+
+/*
+ * Forum Graphic unit control structure
+ */
+
+struct fgunit {
+ int pollnum; /* Use peer.poll instead? */
+ int status; /* Hug to check status information on GPS */
+ int y2kwarn; /* Y2K bug */
+};
+
+/*
+ * Queries definition
+ */
+static char fginit[] = { 0x10, 0x48, 0x10, 0x0D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0 };
+static char fgdate[] = { 0x10, 0x44, 0x10, 0x0D, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+0, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_fg = {
+ fg_start, /* start up driver */
+ fg_shutdown, /* shut down driver */
+ fg_poll, /* transmit poll message */
+ noentry, /* not used */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used */
+ NOFLAGS /* not used */
+};
+
+/*
+ * fg_init - Initialization of FG GPS.
+ */
+
+static int
+fg_init(
+ int fd
+ )
+{
+ if (write(fd, fginit, LENFG) != LENFG)
+ return 0;
+
+ return (1);
+
+}
+
+/*
+ * fg_start - open the device and initialize data for processing
+ */
+static int
+fg_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct fgunit *up;
+ int fd;
+ char device[20];
+
+
+ /*
+ * Open device file for reading.
+ */
+ (void)sprintf(device, DEVICE, unit);
+
+#ifdef DEBUG
+ if (debug)
+ printf ("starting FG with device %s\n",device);
+#endif
+ if (!(fd = refclock_open(device, SPEED232, LDISC_CLK)))
+ return (0);
+
+ /*
+ * Allocate and initialize unit structure
+ */
+
+ if (!(up = (struct fgunit *)
+ emalloc(sizeof(struct fgunit)))) {
+ (void) close(fd);
+ return (0);
+ }
+ memset((char *)up, 0, sizeof(struct fgunit));
+ pp = peer->procptr;
+ pp->unitptr = (caddr_t)up;
+ pp->io.clock_recv = fg_receive;
+ pp->io.srcclock = (caddr_t)peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ (void) close(fd);
+ return (0);
+ }
+
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 3);
+ up->pollnum = 0;
+
+ /*
+ * Setup dating station to use GPS receiver.
+ * GPS receiver should work before this operation.
+ */
+ if(!fg_init(pp->io.fd))
+ refclock_report(peer, CEVNT_FAULT);
+
+ return (1);
+}
+
+
+/*
+ * fg_shutdown - shut down the clock
+ */
+static void
+fg_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ struct fgunit *up;
+
+ pp = peer->procptr;
+ up = (struct fgunit *)pp->unitptr;
+ io_closeclock(&pp->io);
+ free(up);
+}
+
+
+/*
+ * fg_poll - called by the transmit procedure
+ */
+static void
+fg_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+
+ /*
+ * Time to poll the clock. The FG clock responds to a
+ * "<DLE>D<DLE><CR>" by returning a timecode in the format specified
+ * above. If nothing is heard from the clock for two polls,
+ * declare a timeout and keep going.
+ */
+
+ if (write(pp->io.fd, fgdate, LENFG) != LENFG)
+ refclock_report(peer, CEVNT_FAULT);
+ else
+ pp->polls++;
+
+ if (peer->burst > 0)
+ return;
+ /*
+ if (pp->coderecv == pp->codeproc) {
+ refclock_report(peer, CEVNT_TIMEOUT);
+ return;
+ }
+ */
+ peer->burst = NSTAGE;
+
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+
+
+ return;
+
+}
+
+/*
+ * fg_receive - receive data from the serial interface
+ */
+static void
+fg_receive(
+ struct recvbuf *rbufp
+ )
+{
+ struct refclockproc *pp;
+ struct fgunit *up;
+ struct peer *peer;
+ char *bpt;
+
+ /*
+ * Initialize pointers and read the timecode and timestamp
+ * We can't use gtlin function because we need bynary data in buf */
+
+ peer = (struct peer *)rbufp->recv_srcclock;
+ pp = peer->procptr;
+ up = (struct fgunit *)pp->unitptr;
+
+ /*
+ * Below hug to implement receiving of status information
+ */
+ if(!up->pollnum)
+ {
+ up->pollnum++;
+ return;
+ }
+
+
+ if (rbufp->recv_length < (LENFG-2))
+ {
+ refclock_report(peer, CEVNT_BADREPLY);
+ return; /* The reply is invalid discard it. */
+ }
+
+ /* Below I trying to find a correct reply in buffer.
+ * Sometime GPS reply located in the beginnig of buffer,
+ * sometime you can find it with some offset.
+ */
+
+ bpt = (char *)rbufp->recv_space.X_recv_buffer;
+ while(*bpt != '')
+ bpt++;
+
+#define BP2(x) ( bpt[x] & 15 )
+#define BP1(x) (( bpt[x] & 240 ) >> 4)
+
+ pp->year = BP1(2)*10 + BP2(2);
+
+ if(pp->year == 94)
+ {
+ refclock_report(peer, CEVNT_BADREPLY);
+ if(!fg_init(pp->io.fd))
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ /* GPS is just powered up. The date is invalid -
+ discarding it. Initilize GPS one more time */
+ /* Sorry - this driver will broken in 2094 ;) */
+ }
+
+ if (pp->year < 99)
+ pp->year += 100;
+
+ pp->year += 1900;
+ pp->day = 100 * BP2(3) + 10 * BP1(4) + BP2(4);
+
+/*
+ After Jan, 10 2000 Forum Graphic GPS receiver had a very strange
+ benahour. It doubles day number for an hours in replys after 10:10:10 UTC
+ and doubles min every hour at HH:10:ss for a minute.
+ Hope it is a problem of my unit only and not a Y2K problem of FG GPS.
+ Below small code to avoid such situation.
+*/
+ if(up->y2kwarn > 10)
+ pp->hour = BP1(6)*10 + BP2(6);
+ else
+ pp->hour = BP1(5)*10 + BP2(5);
+
+ if((up->y2kwarn > 10) && (pp->hour == 10))
+ {
+ pp->minute = BP1(7)*10 + BP2(7);
+ pp->second = BP1(8)*10 + BP2(8);
+ pp->msec = BP1(9)*10 + BP2(9);
+ pp->usec = BP1(10);
+ } else {
+ pp->hour = BP1(5)*10 + BP2(5);
+ pp->minute = BP1(6)*10 + BP2(6);
+ pp->second = BP1(7)*10 + BP2(7);
+ pp->msec = BP1(8)*10 + BP2(8);
+ pp->usec = BP1(9);
+ }
+
+ if((pp->hour == 10) && (pp->minute == 10))
+ {
+ up->y2kwarn++;
+ }
+
+ sprintf(pp->a_lastcode, "%d %d %d %d %d", pp->year, pp->day, pp->hour, pp->minute, pp->second);
+ pp->lencode = strlen(pp->a_lastcode);
+ /*get_systime(&pp->lastrec);*/
+
+#ifdef DEBUG
+ if (debug)
+ printf ("fg: time is %04d/%03d %02d:%02d:%02d UTC\n",
+ pp->year, pp->day, pp->hour, pp->minute, pp->second);
+#endif
+
+ if (peer->stratum <= 1)
+ peer->refid = pp->refid;
+ pp->disp = (10e-6);
+ pp->lastrec = rbufp->recv_time; /* Is it better then get_systime()? */
+ /* pp->leap = LEAP_NOWARNING; */
+
+ /*
+ * Process the new sample in the median filter and determine the
+ * timecode timestamp.
+ */
+
+ if (!refclock_process(pp))
+ refclock_report(peer, CEVNT_BADTIME);
+
+ refclock_receive(peer);
+ return;
+}
+
+
+#else
+int refclock_fg_bs;
+#endif /* REFCLOCK */
diff --git a/contrib/ntp/ntpd/refclock_gpsvme.c b/contrib/ntp/ntpd/refclock_gpsvme.c
index a7c6d23d3a4f..b37466b5ee7d 100644
--- a/contrib/ntp/ntpd/refclock_gpsvme.c
+++ b/contrib/ntp/ntpd/refclock_gpsvme.c
@@ -40,9 +40,10 @@
extern int init_vme(); /* This is just a call to map_vme() */
/* It doesn't have to be extern */
-unsigned short *greg[NREGS]; /* GPS registers defined in gps.h */
-void *gps_base; /* Base address of GPS VME card returned by */
/* the map_vme() call */
+extern unsigned short *greg[NREGS]; /* made extern to avoid being in both map_vme.c and this file */
+extern void *gps_base; /* mjb lmco 12/20/99 */
+
extern caddr_t map_vme ();
extern void unmap_vme(); /* Unmaps the VME space */
@@ -57,6 +58,8 @@ struct vmedate { /* structure needed by ntp */
};
struct vmedate *get_gpsvme_time();
+struct vmedate * time_vme; /* added to emulate LM refclock_gpsvme
+ (Made global per RES suggestion to fix mem leak DW lmco) mjb lmco 12/15/99 */
/* END OF STUFF FROM RES */
@@ -134,13 +137,13 @@ static u_char sloppyclockflag[MAXUNITS];
* Function prototypes
*/
static void vme_init (void);
-static int vme_start (u_int, struct peer *);
-static void vme_shutdown (int);
+static int vme_start (int, struct peer *);
+static void vme_shutdown (int, struct peer *);
static void vme_report_event (struct vmeunit *, int);
static void vme_receive (struct recvbuf *);
static void vme_poll (int unit, struct peer *);
-static void vme_control (u_int, struct refclockstat *, struct refclockstat *);
-static void vme_buginfo (int, struct refclockbug *);
+static void vme_control (int, struct refclockstat *, struct refclockstat *, struct peer *);
+static void vme_buginfo (int, struct refclockbug *, struct peer *);
/*
* Transfer vector
@@ -233,6 +236,8 @@ vme_start(
} else {
vme = (struct vmeunit *)
emalloc(sizeof(struct vmeunit));
+ time_vme = (struct vmedate *)malloc(sizeof(struct vmedate)); /* Added to emulate LM's refclock_gpsvme
+ (added to fix mem lead DW lmco) mjb lmco 12/22/99 */
}
}
bzero((char *)vme, sizeof(struct vmeunit));
@@ -347,9 +352,6 @@ vme_poll(
struct tm *tadr;
- vme = (struct vmeunit *)emalloc(sizeof(struct vmeunit *));
- tptr = (struct vmedate *)emalloc(sizeof(struct vmedate *));
-
if (unit >= MAXUNITS) {
msyslog(LOG_ERR, "vme_poll: unit %d invalid", unit);
@@ -435,13 +437,14 @@ vme_poll(
}
/*
- * vme_control - set fudge factors, return statistics
+ * vme_control - set fudge factors, return statistics2
*/
static void
vme_control(
u_int unit,
struct refclockstat *in,
- struct refclockstat *out
+ struct refclockstat *out,
+ struct peer * peer
)
{
register struct vmeunit *vme;
@@ -453,7 +456,8 @@ vme_control(
if (in != 0) {
if (in->haveflags & CLK_HAVETIME1)
- fudgefactor[unit] = in->fudgetime1;
+ DTOLFP(in->fudgetime1, &fudgefactor[unit]); /* added mjb lmco 12/20/99 */
+
if (in->haveflags & CLK_HAVEVAL1) {
stratumtouse[unit] = (u_char)(in->fudgeval1 & 0xf);
if (unitinuse[unit]) {
@@ -482,16 +486,19 @@ vme_control(
out->haveflags
= CLK_HAVETIME1|CLK_HAVEVAL1|CLK_HAVEVAL2|CLK_HAVEFLAG1;
out->clockdesc = VMEDESCRIPTION;
- out->fudgetime1 = fudgefactor[unit];
- out->fudgetime2.l_ui = 0;
- out->fudgetime2.l_uf = 0;
- out->fudgeval1 = (LONG)stratumtouse[unit];
+ LFPTOD(&fudgefactor[unit], out->fudgetime1); /* added mjb lmco 12/20/99 */
+
+ out ->fudgetime2 = 0; /* should do what above was supposed to do mjb lmco 12/20/99 */
+
+ out->fudgeval1 = (long)stratumtouse[unit]; /*changed from above LONG was not
+ defined mjb lmco 12/15/99 */
+
out->fudgeval2 = 0;
out->flags = sloppyclockflag[unit];
if (unitinuse[unit]) {
vme = vmeunits[unit];
out->lencode = vme->lencode;
- out->lastcode = vme->lastcode;
+ out->p_lastcode = vme->lastcode;
out->timereset = current_time - vme->timestarted;
out->polls = vme->polls;
out->noresponse = vme->noreply;
@@ -501,7 +508,7 @@ vme_control(
out->currentstatus = vme->status;
} else {
out->lencode = 0;
- out->lastcode = "";
+ out->p_lastcode = "";
out->polls = out->noresponse = 0;
out->badformat = out->baddata = 0;
out->timereset = 0;
@@ -516,7 +523,8 @@ vme_control(
static void
vme_buginfo(
int unit,
- register struct refclockbug *bug
+ register struct refclockbug *bug,
+ struct peer * peer
)
{
register struct vmeunit *vme;
@@ -559,7 +567,7 @@ vme_buginfo(
struct vmedate *
get_gpsvme_time(void)
{
- struct vmedate *time_vme;
+ extern struct vmedate *time_vme;
unsigned short set, hr, min, sec, ums, hms, status;
int ret;
char ti[3];
@@ -570,7 +578,6 @@ get_gpsvme_time(void)
char *gpsmicro;
gpsmicro = (char *) malloc(7);
- time_vme = (struct vmedate *)malloc(sizeof(struct vmedate ));
*greg = (unsigned short *)malloc(sizeof(short) * NREGS);
@@ -602,7 +609,7 @@ get_gpsvme_time(void)
/* unmap_vme(); */
if (!status) {
- return ((void *)NULL);
+ return (NULL); /* fixed mjb lmco 12/20/99 */
}
else
return (time_vme);
diff --git a/contrib/ntp/ntpd/refclock_irig.c b/contrib/ntp/ntpd/refclock_irig.c
index eccbda81cfdf..ab4b52506d6a 100644
--- a/contrib/ntp/ntpd/refclock_irig.c
+++ b/contrib/ntp/ntpd/refclock_irig.c
@@ -11,12 +11,6 @@
#include <ctype.h>
#include <sys/time.h>
#include <math.h>
-#ifdef HAVE_SYS_AUDIOIO_H
-#include <sys/audioio.h>
-#endif /* HAVE_SYS_AUDIOIO_H */
-#ifdef HAVE_SUN_AUDIOIO_H
-#include <sun/audioio.h>
-#endif /* HAVE_SUN_AUDIOIO_H */
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif /* HAVE_SYS_IOCTL_H */
@@ -26,6 +20,7 @@
#include "ntp_refclock.h"
#include "ntp_calendar.h"
#include "ntp_stdlib.h"
+#include "audio.h"
/*
* Audio IRIG-B/E demodulator/decoder
@@ -149,8 +144,7 @@
#define REFID "IRIG" /* reference ID */
#define DESCRIPTION "Generic IRIG Audio Driver" /* WRU */
-#define AUDIO_BUFSIZ 160 /* codec buffer size (Solaris only) */
-#define SAMPLES 8000 /* nominal sample rate (Hz) */
+#define SECOND 8000 /* nominal sample rate (Hz) */
#define BAUD 80 /* samples per baud interval */
#define OFFSET 128 /* companded sample offset */
#define SIZE 256 /* decompanding table size */
@@ -162,7 +156,7 @@
#define MAXSIG 6000. /* maximum signal level */
#define DRPOUT 100. /* dropout signal level */
#define MODMIN 0.5 /* minimum modulation index */
-#define MAXFREQ (250e-6 * SAMPLES) /* freq tolerance (.025%) */
+#define MAXFREQ (250e-6 * SECOND) /* freq tolerance (.025%) */
#define PI 3.1415926535 /* the real thing */
/*
@@ -269,8 +263,6 @@ static void irig_base P((struct peer *, double));
static void irig_rf P((struct peer *, double));
static void irig_decode P((struct peer *, int));
static void irig_gain P((struct peer *));
-static int irig_audio P((void));
-static void irig_debug P((void));
/*
* Transfer vector
@@ -288,11 +280,6 @@ struct refclock refclock_irig = {
/*
* Global variables
*/
-#ifdef HAVE_SYS_AUDIOIO_H
-struct audio_device device; /* audio device ident */
-#endif /* HAVE_SYS_AUDIOIO_H */
-static struct audio_info info; /* audio device info */
-static int irig_ctl_fd; /* audio control file descriptor */
static char hexchar[] = { /* really quick decoding table */
'0', '8', '4', 'c', /* 0000 0001 0010 0011 */
'2', 'a', '6', 'e', /* 0100 0101 0110 0111 */
@@ -323,11 +310,13 @@ irig_start(
/*
* Open audio device
*/
- fd = open("/dev/audio", O_RDWR | O_NONBLOCK, 0777);
- if (fd == -1) {
- perror("audio");
+ fd = audio_init();
+ if (fd < 0)
return (0);
- }
+#ifdef DEBUG
+ if (debug)
+ audio_show();
+#endif
/*
* Allocate and initialize unit structure
@@ -359,11 +348,7 @@ irig_start(
up->tc = MINTC;
up->decim = 1;
up->fdelay = IRIG_B;
- up->gain = (AUDIO_MAX_GAIN - AUDIO_MIN_GAIN) / 2;
- if (irig_audio() < 0) {
- io_closeclock(&pp->io);
- return(0);
- }
+ up->gain = 127;
up->pollcnt = 2;
/*
@@ -380,7 +365,7 @@ irig_start(
if (i % 16 == 0)
step *= 2.;
}
- DTOLFP(1. / SAMPLES, &up->tick);
+ DTOLFP(1. / SECOND, &up->tick);
return (1);
}
@@ -436,7 +421,7 @@ irig_receive(
*/
up->timestamp = rbufp->recv_time;
up->bufcnt = rbufp->recv_length;
- DTOLFP((double)up->bufcnt / SAMPLES, &ltemp);
+ DTOLFP((double)up->bufcnt / SECOND, &ltemp);
L_SUB(&up->timestamp, &ltemp);
dpt = rbufp->recv_buffer;
for (up->bufptr = 0; up->bufptr < up->bufcnt; up->bufptr++) {
@@ -462,7 +447,7 @@ irig_receive(
* unit produces a change of 360 degrees; a frequency
* change of one unit produces a change of 1 Hz.
*/
- up->phase += up->freq / SAMPLES;
+ up->phase += up->freq / SECOND;
if (up->phase >= .5) {
up->phase -= 1.;
} else if (up->phase < -.5) {
@@ -478,7 +463,7 @@ irig_receive(
* Once each second, determine the IRIG format, codec
* port and gain.
*/
- up->seccnt = (up->seccnt + 1) % SAMPLES;
+ up->seccnt = (up->seccnt + 1) % SECOND;
if (up->seccnt == 0) {
if (up->irig_b > up->irig_e) {
up->decim = 1;
@@ -488,11 +473,10 @@ irig_receive(
up->fdelay = IRIG_E;
}
if (pp->sloppyclockflag & CLK_FLAG2)
- up->port = AUDIO_LINE_IN;
+ up->port = 2;
else
- up->port = AUDIO_MICROPHONE;
+ up->port = 1;
irig_gain(peer);
- up->clipcnt = 0;
up->irig_b = up->irig_e = 0;
}
}
@@ -755,7 +739,7 @@ irig_base(
* this plus the delay since the last carrier positive
* zero crossing.
*/
- DTOLFP(up->decim * (dtemp / SAMPLES + 1.) + up->fdelay,
+ DTOLFP(up->decim * (dtemp / SECOND + 1.) + up->fdelay,
&ltemp);
pp->lastrec = up->timestamp;
L_SUB(&pp->lastrec, &ltemp);
@@ -890,9 +874,9 @@ irig_decode(
"%02x %c %2d %3d %02d:%02d:%02d %4.0f %3d %6.3f %2d %2d %6.3f %6.1f %s",
up->errflg, syncchar, pp->year, pp->day,
pp->hour, pp->minute, pp->second,
- up->maxsignal, info.record.gain, up->modndx,
+ up->maxsignal, up->gain, up->modndx,
up->envxing, up->tc, up->yxing, up->freq *
- 1e6 / SAMPLES, ulfptoa(&up->montime, 6));
+ 1e6 / SECOND, ulfptoa(&up->montime, 6));
pp->lencode = strlen(pp->a_lastcode);
if (up->timecnt == 0 || pp->sloppyclockflag &
CLK_FLAG4)
@@ -964,116 +948,22 @@ irig_gain(
/*
* Apparently, the codec uses only the high order bits of the
* gain control field. Thus, it may take awhile for changes to
- * wiggle the hardware bits. Set the new bits in the structure
- * and call AUDIO_SETINFO. Upon return, the old bits are in the
- * structure.
+ * wiggle the hardware bits.
*/
if (up->clipcnt == 0) {
up->gain += 4;
- if (up->gain > AUDIO_MAX_GAIN)
- up->gain = AUDIO_MAX_GAIN;
- } else if (up->clipcnt > SAMPLES / 100) {
+ if (up->gain > 255)
+ up->gain = 255;
+ } else if (up->clipcnt > SECOND / 100) {
up->gain -= 4;
- if (up->gain < AUDIO_MIN_GAIN)
- up->gain = AUDIO_MIN_GAIN;
- }
- AUDIO_INITINFO(&info);
- info.record.port = up->port;
- info.record.gain = up->gain;
- info.record.error = 0;
- ioctl(irig_ctl_fd, (int)AUDIO_SETINFO, &info);
- if (info.record.error)
- up->errflg |= IRIG_ERR_ERROR;
-}
-
-
-/*
- * irig_audio - initialize audio device
- *
- * This code works with SunOS 4.1.3 and Solaris 2.6; however, it is
- * believed generic and applicable to other systems with a minor twid
- * or two. All it does is open the device, set the buffer size (Solaris
- * only), preset the gain and set the input port. It assumes that the
- * codec sample rate (8000 Hz), precision (8 bits), number of channels
- * (1) and encoding (ITU-T G.711 mu-law companded) have been set by
- * default.
- */
-static int
-irig_audio(
- )
-{
- /*
- * Open audio control device
- */
- if ((irig_ctl_fd = open("/dev/audioctl", O_RDWR)) < 0) {
- perror("audioctl");
- return(-1);
+ if (up->gain < 0)
+ up->gain = 0;
}
-#ifdef HAVE_SYS_AUDIOIO_H
- /*
- * Set audio device parameters.
- */
- AUDIO_INITINFO(&info);
- info.record.buffer_size = AUDIO_BUFSIZ;
- if (ioctl(irig_ctl_fd, (int)AUDIO_SETINFO, &info) < 0) {
- perror("AUDIO_SETINFO");
- close(irig_ctl_fd);
- return(-1);
- }
-#endif /* HAVE_SYS_AUDIOIO_H */
-#ifdef DEBUG
- irig_debug();
-#endif /* DEBUG */
- return(0);
+ audio_gain(up->gain, up->port);
+ up->clipcnt = 0;
}
-#ifdef DEBUG
-/*
- * irig_debug - display audio parameters
- *
- * This code doesn't really do anything, except satisfy curiousity and
- * verify the ioctl's work.
- */
-static void
-irig_debug(
- )
-{
- if (debug == 0)
- return;
-#ifdef HAVE_SYS_AUDIOIO_H
- ioctl(irig_ctl_fd, (int)AUDIO_GETDEV, &device);
- printf("irig: name %s, version %s, config %s\n",
- device.name, device.version, device.config);
-#endif /* HAVE_SYS_AUDIOIO_H */
- ioctl(irig_ctl_fd, (int)AUDIO_GETINFO, &info);
- printf(
- "irig: samples %d, channels %d, precision %d, encoding %d\n",
- info.record.sample_rate, info.record.channels,
- info.record.precision, info.record.encoding);
-#ifdef HAVE_SYS_AUDIOIO_H
- printf("irig: gain %d, port %d, buffer %d\n",
- info.record.gain, info.record.port,
- info.record.buffer_size);
-#else /* HAVE_SYS_AUDIOIO_H */
- printf("irig: gain %d, port %d\n",
- info.record.gain, info.record.port);
-#endif /* HAVE_SYS_AUDIOIO_H */
- printf(
- "irig: samples %d, eof %d, pause %d, error %d, waiting %d, balance %d\n",
- info.record.samples, info.record.eof,
- info.record.pause, info.record.error,
- info.record.waiting, info.record.balance);
-#ifdef __NetBSD__
- printf("irig: monitor %d, blocksize %d, hiwat %d, lowat %d, mode %d\n",
- info.monitor_gain, info.blocksize, info.hiwat, info.lowat, info.mode);
-#else /* __NetBSD__ */
- printf("irig: monitor %d, muted %d\n",
- info.monitor_gain, info.output_muted);
-#endif /* __NetBSD__ */
-}
-#endif /* DEBUG */
-
#else
int refclock_irig_bs;
#endif /* REFCLOCK */
diff --git a/contrib/ntp/ntpd/refclock_jupiter.c b/contrib/ntp/ntpd/refclock_jupiter.c
index f22714bdf792..b337e0cff872 100644
--- a/contrib/ntp/ntpd/refclock_jupiter.c
+++ b/contrib/ntp/ntpd/refclock_jupiter.c
@@ -762,10 +762,11 @@ jupiter_process(register struct peer *peer)
}
/* Compare two l_fp's, used with qsort() */
-int
#ifdef QSORT_USES_VOID_P
+int
jupiter_cmpl_fp(register const void *p1, register const void *p2)
#else
+int
jupiter_cmpl_fp(register const l_fp *fp1, register const l_fp *fp2)
#endif
{
@@ -960,7 +961,7 @@ jupiter_pps(register struct peer *peer)
/*
* jupiter_debug - print debug messages
*/
-#if __STDC__
+#if defined(__STDC__)
static void
jupiter_debug(struct peer *peer, char *fmt, ...)
#else
@@ -968,17 +969,17 @@ static void
jupiter_debug(peer, fmt, va_alist)
struct peer *peer;
char *fmt;
-#endif
+#endif /* __STDC__ */
{
va_list ap;
if (debug) {
-#if __STDC__
+#if defined(__STDC__)
va_start(ap, fmt);
#else
va_start(ap);
-#endif
+#endif /* __STDC__ */
/*
* Print debug message to stdout
* In the future, we may want to get get more creative...
diff --git a/contrib/ntp/ntpd/refclock_msfees.c b/contrib/ntp/ntpd/refclock_msfees.c
index 01fe27fb1375..db6c6b17a696 100644
--- a/contrib/ntp/ntpd/refclock_msfees.c
+++ b/contrib/ntp/ntpd/refclock_msfees.c
@@ -322,10 +322,6 @@ static int deltas[60];
static l_fp acceptable_slop; /* = { 0, 1 << (FRACTION_PREC -2) }; */
static l_fp onesec; /* = { 1, 0 }; */
-#ifdef DEBUG
-static int debug;
-#endif
-
#ifndef DUMP_BUF_SIZE /* Size of buffer to be used by dump_buf */
#define DUMP_BUF_SIZE 10112
#endif
@@ -354,8 +350,13 @@ static void msfees_init P((void));
static void dump_buf P((l_fp *coffs, int from, int to, char *text));
static void ees_report_event P((struct eesunit *ees, int code));
static void ees_receive P((struct recvbuf *rbufp));
-static int offcompare P((l_fp *a, l_fp *b));
static void ees_process P((struct eesunit *ees));
+#ifdef QSORT_USES_VOID_P
+static int offcompare P((const void *va, const void *vb));
+#else
+static int offcompare P((const l_fp *a, const l_fp *b));
+#endif /* QSORT_USES_VOID_P */
+
/*
* Transfer vector
@@ -1221,14 +1222,27 @@ ees_receive(
/* offcompare - auxiliary comparison routine for offset sort */
+#ifdef QSORT_USES_VOID_P
+static int
+offcompare(
+ const void *va,
+ const void *vb
+ )
+{
+ const l_fp *a = (const l_fp *)va;
+ const l_fp *b = (const l_fp *)vb;
+ return(L_ISGEQ(a, b) ? (L_ISEQU(a, b) ? 0 : 1) : -1);
+}
+#else
static int
offcompare(
- l_fp *a,
- l_fp *b
+ const l_fp *a,
+ const l_fp *b
)
{
return(L_ISGEQ(a, b) ? (L_ISEQU(a, b) ? 0 : 1) : -1);
}
+#endif /* QSORT_USES_VOID_P */
/* ees_process - process a pile of samples from the clock */
@@ -1349,12 +1363,12 @@ ees_process(
new = offset.l_uf + ((diff * (samd -1)) / samd);
/* Sign change -> need to fix up int part */
- if ((new & (1 << 31)) !=
- (((long) offset.l_uf) & ( 1 << 31)))
+ if ((new & 0x80000000) !=
+ (((long) offset.l_uf) & 0x80000000))
{ NLOG(NLOG_CLOCKINFO) /* conditional if clause for conditional syslog */
msyslog(LOG_INFO, "I: %lx != %lx (%lx %lx), so add %d",
- new & (1 << 31),
- ((long) offset.l_uf) & ( 1 << 31),
+ new & 0x80000000,
+ ((long) offset.l_uf) & 0x80000000,
new, (long) offset.l_uf,
(new < 0) ? -1 : 1);
offset.l_ui += (new < 0) ? -1 : 1;
diff --git a/contrib/ntp/ntpd/refclock_mx4200.c b/contrib/ntp/ntpd/refclock_mx4200.c
index 28f563f8a809..f08bb2336c4e 100644
--- a/contrib/ntp/ntpd/refclock_mx4200.c
+++ b/contrib/ntp/ntpd/refclock_mx4200.c
@@ -127,9 +127,6 @@ struct ppsclockev {
*/
#define INTERVAL 1 /* Interval between position measurements (s) */
#define AVGING_TIME 24 /* Number of hours to average */
-#define USUAL_EDOP 1.06066 /* used for normalizing EDOP */
-#define USUAL_NDOP 1.06066 /* used for normalizing NDOP */
-#define USUAL_VDOP 2.00 /* used for normalizing VDOP */
#define NOT_INITIALIZED -9999. /* initial pivot longitude */
/*
@@ -165,13 +162,13 @@ static char pmvxg[] = "PMVXG";
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
#ifndef __attribute__
#define __attribute__(args)
-#endif
-#endif
+#endif /* __attribute__ */
+#endif /* __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) */
#else
#ifndef __attribute__
#define __attribute__(args)
-#endif
-#endif
+#endif /* __attribute__ */
+#endif /* __GNUC__ */
/* XXX end */
/*
@@ -230,18 +227,6 @@ mx4200_start(
int fd;
char gpsdev[20];
-#ifdef HAVE_TIOCGPPSEV
-#ifdef HAVE_TERMIOS
- struct termios ttyb;
-#endif /* HAVE_TERMIOS */
-#ifdef HAVE_SYSV_TTYS
- struct termio ttyb;
-#endif /* HAVE_SYSV_TTYS */
-#ifdef HAVE_BSD_TTYS
- struct sgttyb ttyb;
-#endif /* HAVE_BSD_TTYS */
-#endif /* HAVE_TIOCGPPSEV */
-
/*
* Open serial port
*/
@@ -249,24 +234,6 @@ mx4200_start(
if (!(fd = refclock_open(gpsdev, SPEED232, LDISC_PPS))) {
return (0);
}
-#ifdef HAVE_TIOCGPPSEV
- if (fdpps > 0) {
- /*
- * Truly nasty hack in order to get this to work on Solaris 7.
- * Really, refclock_open() should set the port properly, but
- * it doesn't work (as of ntp-4.0.98a) - almost 99% dropped
- * PPS signals with "Interrupted system call". Even this
- * still gives a 5% error rate.
- */
- ttyb.c_iflag = IGNCR;
- ttyb.c_oflag = 0;
- ttyb.c_cflag = CS8 | CREAD | CLOCAL;
- ttyb.c_lflag = ICANON;
- if (tcsetattr(fdpps, TCSAFLUSH, &ttyb) < 0) {
- return (0);
- }
- }
-#endif /* HAVE_TIOCGPPSEV */
/*
* Allocate unit structure
@@ -360,9 +327,9 @@ mx4200_config(
up->filt_lat = 0.0;
up->filt_lon = 0.0;
up->filt_alt = 0.0;
- up->edop = USUAL_EDOP;
- up->ndop = USUAL_NDOP;
- up->vdop = USUAL_VDOP;
+ up->edop = 1;
+ up->ndop = 1;
+ up->vdop = 1;
up->last_leap = 0; /* LEAP_NOWARNING */
up->clamp_time = current_time + (AVGING_TIME * 60 * 60);
up->log_time = current_time + SLEEPTIME;
@@ -612,7 +579,7 @@ mx4200_ref(
minute = (lon - (double)(int)lon) * 60.0;
sprintf(lons,"%03d%02.4f", (int)lon, minute);
- mx4200_send(peer, "%s,%03d,,,,,%s,%c,%s,%c,%.2f,", pmvxg,
+ mx4200_send(peer, "%s,%03d,,,,,%s,%c,%s,%c,%.2f,%d", pmvxg,
PMVXG_S_INITMODEA,
/* day of month */
/* month of year */
@@ -622,8 +589,8 @@ mx4200_ref(
nsc, /* north/south */
lons, /* longitude DDDMM.MMMM */
ewc, /* east/west */
- alt); /* Altitude */
- /* Altitude Reference */
+ alt, /* Altitude */
+ 1); /* Altitude Reference (0=WGS84 ellipsoid, 1=MSL geoid) */
msyslog(LOG_DEBUG,
"mx4200: reconfig to fixed location: %s %c, %s %c, %.2f m",
@@ -1359,19 +1326,19 @@ mx4200_parse_p(
/*
* Calculate running weighted averages
*/
- weight = USUAL_EDOP / up->edop;
+ weight = 1. / up->edop;
weight *= weight;
up->avg_lon = (up->filt_lon * up->avg_lon) + (weight * lon);
up->filt_lon += weight;
up->avg_lon = up->avg_lon / up->filt_lon;
- weight = USUAL_NDOP / up->ndop;
+ weight = 1. / up->ndop;
weight *= weight;
up->avg_lat = (up->filt_lat * up->avg_lat) + (weight * lat);
up->filt_lat += weight;
up->avg_lat = up->avg_lat / up->filt_lat;
- weight = USUAL_VDOP / up->vdop;
+ weight = 1. / up->vdop;
weight *= weight;
up->avg_alt = (up->filt_alt * up->avg_alt) + (weight * alt);
up->filt_alt += weight;
@@ -1673,15 +1640,15 @@ mx4200_pps(
/*
* mx4200_debug - print debug messages
*/
-#if __STDC__
+#if defined(__STDC__)
static void
mx4200_debug(struct peer *peer, char *fmt, ...)
#else
- static void
+static void
mx4200_debug(peer, fmt, va_alist)
struct peer *peer;
char *fmt;
-#endif
+#endif /* __STDC__ */
{
va_list ap;
struct refclockproc *pp;
@@ -1689,11 +1656,11 @@ mx4200_debug(peer, fmt, va_alist)
if (debug) {
-#if __STDC__
+#if defined(__STDC__)
va_start(ap, fmt);
#else
va_start(ap);
-#endif
+#endif /* __STDC__ */
pp = peer->procptr;
up = (struct mx4200unit *)pp->unitptr;
@@ -1712,11 +1679,12 @@ mx4200_debug(peer, fmt, va_alist)
/*
* Send a character string to the receiver. Checksum is appended here.
*/
+#if defined(__STDC__)
static void
-#if __STDC__
mx4200_send(struct peer *peer, char *fmt, ...)
#else
- mx4200_send(peer, fmt, va_alist)
+static void
+mx4200_send(peer, fmt, va_alist)
struct peer *peer;
char *fmt;
va_dcl
@@ -1731,7 +1699,7 @@ mx4200_send(struct peer *peer, char *fmt, ...)
char buf[1024];
u_char ck;
-#if __STDC__
+#if defined(__STDC__)
va_start(ap, fmt);
#else
va_start(ap);
diff --git a/contrib/ntp/ntpd/refclock_nmea.c b/contrib/ntp/ntpd/refclock_nmea.c
index 211d01e3d6ad..d90f71c3950c 100644
--- a/contrib/ntp/ntpd/refclock_nmea.c
+++ b/contrib/ntp/ntpd/refclock_nmea.c
@@ -32,7 +32,11 @@
/*
* Definitions
*/
-#define DEVICE "/dev/gps%d" /* name of radio device */
+#ifdef SYS_WINNT
+# define DEVICE "COM%d:" /* COM 1 - 3 supported */
+#else
+# define DEVICE "/dev/gps%d" /* name of radio device */
+#endif
#define SPEED232 B4800 /* uart speed (4800 bps) */
#define PRECISION (-9) /* precision assumed (about 2 ms) */
#define DCD_PRECISION (-20) /* precision assumed (about 1 us) */
@@ -98,6 +102,7 @@ nmea_start(
* Open serial port. Use CLK line discipline, if available.
*/
(void)sprintf(device, DEVICE, unit);
+
if (!(fd = refclock_open(device, SPEED232, LDISC_CLK)))
return (0);
diff --git a/contrib/ntp/ntpd/refclock_oncore.c b/contrib/ntp/ntpd/refclock_oncore.c
index 9ff3d2383636..e0ba177cc1a4 100644
--- a/contrib/ntp/ntpd/refclock_oncore.c
+++ b/contrib/ntp/ntpd/refclock_oncore.c
@@ -55,6 +55,13 @@
#define POS_HOLD_AVERAGE 10000 /* nb, 10000s ~= 2h45m */
+/*
+ * ONCORE_SHMEM_STATUS will create a mmap(2)'ed file named according to a
+ * "STATUS" line in the oncore config file, which contains the most recent
+ * copy of all types of messages we recognize. This file can be mmap(2)'ed
+ * by monitoring and statistics programs.
+ */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -66,6 +73,14 @@
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
+#ifdef ONCORE_SHMEM_STATUS
+# ifdef HAVE_SYS_MMAN_H
+# include <sys/mman.h>
+# ifndef MAP_FAILED
+# define MAP_FAILED ((u_char *) -1)
+# endif /* not MAP_FAILED */
+# endif /* HAVE_SYS_MMAN_H */
+#endif /* ONCORE_SHMEM_STATUS */
#ifdef HAVE_PPSAPI
# ifdef HAVE_TIMEPPS_H
@@ -77,6 +92,10 @@
# endif
#endif
+#ifdef HAVE_SYS_SIO_H
+# include <sys/sio.h>
+#endif
+
#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_unixtime.h"
@@ -122,6 +141,8 @@ struct instance {
int unit; /* 127.127.30.unit */
int ttyfd; /* TTY file descriptor */
int ppsfd; /* PPS file descriptor */
+ int statusfd; /* Status shm descriptor */
+ u_char *shmem;
#ifdef HAVE_PPSAPI
pps_handle_t pps_h;
pps_params_t pps_p;
@@ -134,7 +155,6 @@ struct instance {
struct peer *peer;
int Bj_day;
- int assert;
long delay; /* ns */
long offset; /* ns */
@@ -144,11 +164,11 @@ struct instance {
double ss_ht;
int ss_count;
u_char ss_ht_type;
- int posn_set;
+ u_char posn_set;
- int printed;
+ u_char printed;
+ u_char polled;
int pollcnt;
- int polled;
u_int ev_serial;
int Rcvptr;
u_char Rcvbuf[500];
@@ -160,6 +180,8 @@ struct instance {
u_char Az;
u_char init_type;
s_char saw_tooth;
+ u_char timeout; /* flag to retry Cj after Fa reset */
+ s_char assert;
};
#define rcvbuf instance->Rcvbuf
@@ -172,7 +194,6 @@ static void oncore_receive P((struct recvbuf *));
static void oncore_sendmsg P((int fd, u_char *, u_int));
static void oncore_shutdown P((int, struct peer *));
static int oncore_start P((int, struct peer *));
-static void oncore_stats P((struct instance *));
static void oncore_msg_any P((struct instance *, u_char *, u_int, int));
static void oncore_msg_As P((struct instance *, u_char *, u_int));
@@ -180,6 +201,7 @@ static void oncore_msg_At P((struct instance *, u_char *, u_int));
static void oncore_msg_Ay P((struct instance *, u_char *, u_int));
static void oncore_msg_Az P((struct instance *, u_char *, u_int));
static void oncore_msg_Bj P((struct instance *, u_char *, u_int));
+static void oncore_msg_Cb P((struct instance *, u_char *, u_int));
static void oncore_msg_Cf P((struct instance *, u_char *, u_int));
static void oncore_msg_Cj P((struct instance *, u_char *, u_int));
static void oncore_msg_Ea P((struct instance *, u_char *, u_int));
@@ -201,11 +223,12 @@ struct refclock refclock_oncore = {
* for the the UT or VP Oncore.
*/
-static struct {
+static struct msg_desc {
const char flag[3];
const int len;
void (*handler) P((struct instance *, u_char *, u_int));
const char *fmt;
+ int shmem;
} oncore_messages[] = {
/* Ea and En first since they're most common */
{ "Ea", 76, oncore_msg_Ea, "mdyyhmsffffaaaaoooohhhhmmmmvvhhddtntimsdimsdimsdimsdimsdimsdimsdimsdsC" },
@@ -223,7 +246,7 @@ static struct {
{ "AB", 8, 0, "" },
{ "Bb", 92, 0, "" },
{ "Bj", 8, oncore_msg_Bj, "" },
- { "Cb", 33, 0, "" },
+ { "Cb", 33, oncore_msg_Cb, "" },
{ "Cf", 7, oncore_msg_Cf, "" },
{ "Cg", 8, 0, "" },
{ "Ch", 9, 0, "" },
@@ -234,6 +257,7 @@ static struct {
{ {0}, 7, 0, ""}
};
+static unsigned int oncore_shmem_Cb;
/*
* Position Set.
@@ -262,6 +286,11 @@ u_char oncore_cmd_Asx[]= { 'A', 's', 0x7f, 0xff, 0xff, 0xff,
u_char oncore_cmd_Aw[] = { 'A', 'w', 1 };
/*
+ * Output Almanac when it changes
+ */
+u_char oncore_cmd_Be[] = { 'B', 'e', 1 };
+
+/*
* Read back PPS Offset for Output
*/
u_char oncore_cmd_Ay[] = { 'A', 'y', 0, 0, 0, 0 };
@@ -281,7 +310,7 @@ u_char oncore_cmd_AB[] = { 'A', 'B', 4 };
/*
* Visible Satellite Status Msg.
*/
-u_char oncore_cmd_Bb[] = { 'B', 'b', 0 }; /* just turn off */
+u_char oncore_cmd_Bb[] = { 'B', 'b', 1 };
/*
* Leap Second Pending Message
@@ -357,6 +386,10 @@ static u_char oncore_cmd_Fa[] = { 'F', 'a' };
/* from buffer, char *buf, result to an int */
#define buf_w32(buf) (((buf)[0]&0200) ? (-(~w32(buf)+1)) : w32(buf))
+extern int pps_assert;
+extern int pps_hardpps;
+
+
/*
* oncore_start - initialize data for processing
*/
@@ -400,8 +433,7 @@ oncore_start(
if ((stat1.st_dev == stat2.st_dev) && (stat1.st_ino == stat2.st_ino)) {
/* same device here */
if (!(fd1 = refclock_open(device1, SPEED, LDISC_RAW
-#ifdef HAVE_PPSAPI
-#else
+#if !defined(HAVE_PPSAPI) && !defined(TIOCDCDTIMESTAMP)
| LDISC_PPS
#endif
))) {
@@ -435,7 +467,7 @@ oncore_start(
instance->ppsfd = fd2;
instance->Bj_day = -1;
- instance->assert = 1;
+ instance->assert = pps_assert;
/* go read any input data in /etc/ntp.oncoreX */
@@ -444,10 +476,26 @@ oncore_start(
#ifdef HAVE_PPSAPI
if (time_pps_create(fd2, &instance->pps_h) < 0) {
perror("time_pps_create");
- exit(1);
+ return(0);
}
- if (instance->assert) {
+ if (time_pps_getcap(instance->pps_h, &mode) < 0) {
+ msyslog(LOG_ERR,
+ "refclock_ioctl: time_pps_getcap failed: %m");
+ return (0);
+ }
+
+ if (time_pps_getparams(instance->pps_h, &instance->pps_p) < 0) {
+ msyslog(LOG_ERR,
+ "refclock_ioctl: time_pps_getparams failed: %m");
+ return (0);
+ }
+
+ /* nb. only turn things on, if someone else has turned something
+ * on before we get here, leave it alone!
+ */
+
+ if (instance->assert) { /* nb, default or ON */
instance->pps_p.mode = PPS_CAPTUREASSERT | PPS_OFFSETASSERT;
instance->pps_p.assert_offset.tv_sec = 0;
instance->pps_p.assert_offset.tv_nsec = 0;
@@ -457,16 +505,41 @@ oncore_start(
instance->pps_p.clear_offset.tv_nsec = 0;
}
instance->pps_p.mode |= PPS_TSFMT_TSPEC;
+ instance->pps_p.mode &= mode; /* only do it if it is legal */
+
if (time_pps_setparams(instance->pps_h, &instance->pps_p) < 0) {
perror("time_pps_setparams");
exit(1);
}
- if (time_pps_kcbind(instance->pps_h, PPS_KC_HARDPPS,
- instance->pps_p.mode & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR),
- PPS_TSFMT_TSPEC) < 0) {
- perror("time_pps_kcbind");
+
+ if (pps_device) {
+ if (stat(pps_device, &stat1)) {
+ perror("ONCORE: stat pps_device");
+ return(0);
+ }
+
+ /* must have hardpps ON, and fd2 must be the same device as on the pps line */
+
+ if (pps_hardpps && ((stat1.st_dev == stat2.st_dev) && (stat1.st_ino == stat2.st_ino))) {
+ int i;
+
+ if (instance->assert)
+ i = PPS_CAPTUREASSERT;
+ else
+ i = PPS_CAPTURECLEAR;
+
+ if (i&mode) {
+ if (time_pps_kcbind(instance->pps_h, PPS_KC_HARDPPS, i,
+ PPS_TSFMT_TSPEC) < 0) {
+ msyslog(LOG_ERR,
+ "refclock_ioctl: time_pps_kcbind failed: %m");
+ return (0);
+ }
+ }
+ }
}
#endif
+
instance->pp = pp;
instance->peer = peer;
instance->o_state = ONCORE_NO_IDEA;
@@ -500,6 +573,7 @@ oncore_start(
* We send info from config to Oncore later.
*/
+ instance->timeout = 1;
mode = instance->init_type;
if (mode == 3 || mode == 4) {
oncore_sendmsg(instance->ttyfd, oncore_cmd_Cf, sizeof oncore_cmd_Cf);
@@ -514,10 +588,85 @@ oncore_start(
}
instance->pollcnt = 2;
-
return (1);
}
+
+
+static void
+oncore_init_shmem(struct instance *instance, char *filename)
+{
+#ifdef ONCORE_SHMEM_STATUS
+ int i, l, n;
+ char *buf;
+ struct msg_desc *mp;
+ static unsigned int oncore_shmem_length;
+
+ if (oncore_messages[0].shmem == 0) {
+ n = 1;
+ for (mp = oncore_messages; mp->flag[0]; mp++) {
+ mp->shmem = n;
+ /* Allocate space for multiplexed almanac */
+ if (!strcmp(mp->flag, "Cb")) {
+ oncore_shmem_Cb = n;
+ n += (mp->len + 2) * 34;
+ }
+ n += mp->len + 2;
+ }
+ oncore_shmem_length = n + 2;
+ fprintf(stderr, "ONCORE: SHMEM length: %d bytes\n", oncore_shmem_length);
+ }
+ instance->statusfd = open(filename, O_RDWR|O_CREAT|O_TRUNC, 0644);
+ if (instance->statusfd < 0) {
+ perror(filename);
+ exit(4);
+ }
+ buf = malloc(oncore_shmem_length);
+ if (buf == NULL) {
+ perror("malloc");
+ exit(4);
+ }
+ memset(buf, 0, sizeof(buf));
+ i = write(instance->statusfd, buf, oncore_shmem_length);
+ if (i != oncore_shmem_length) {
+ perror(filename);
+ exit(4);
+ }
+ free(buf);
+ instance->shmem = (u_char *) mmap(0, oncore_shmem_length,
+ PROT_READ | PROT_WRITE,
+#ifdef MAP_HASSEMAPHORE
+ MAP_HASSEMAPHORE |
+#endif
+ MAP_SHARED,
+ instance->statusfd, (off_t)0);
+ if (instance->shmem == MAP_FAILED) {
+ instance->shmem = 0;
+ close (instance->statusfd);
+ exit(4);
+ }
+ for (mp = oncore_messages; mp->flag[0]; mp++) {
+ l = mp->shmem;
+ instance->shmem[l + 0] = mp->len >> 8;
+ instance->shmem[l + 1] = mp->len & 0xff;
+ instance->shmem[l + 2] = '@';
+ instance->shmem[l + 3] = '@';
+ instance->shmem[l + 4] = mp->flag[0];
+ instance->shmem[l + 5] = mp->flag[1];
+ if (!strcmp(mp->flag, "Cb")) {
+ for (i = 1; i < 35; i++) {
+ instance->shmem[l + i * 35 + 0] = mp->len >> 8;
+ instance->shmem[l + i * 35 + 1] = mp->len & 0xff;
+ instance->shmem[l + i * 35 + 2] = '@';
+ instance->shmem[l + i * 35 + 3] = '@';
+ instance->shmem[l + i * 35 + 4] = mp->flag[0];
+ instance->shmem[l + i * 35 + 5] = mp->flag[1];
+ }
+ }
+ }
+#endif /* ONCORE_SHMEM_STATUS */
+}
+
/*
* Read Input file if it exists.
*/
@@ -603,11 +752,10 @@ oncore_read_config(
*/
FILE *fd;
- char *cp, line[100], units[2], device[20];
- int i, j, sign, lat_flg, long_flg, ht_flg, mode;
+ char *cp, *cc, *ca, line[100], units[2], device[20];
+ int i, sign, lat_flg, long_flg, ht_flg, mode;
double f1, f2, f3;
-
sprintf(device, "%s%d", INIT_FILE, instance->unit);
if ((fd=fopen(device, "r")) == NULL)
if ((fd=fopen(INIT_FILE, "r")) == NULL) {
@@ -618,22 +766,54 @@ oncore_read_config(
mode = 0;
lat_flg = long_flg = ht_flg = 0;
while (fgets(line, 100, fd)) {
- if ((cp=strchr(line, '#')))
+
+ /* Remove comments */
+ if ((cp = strchr(line, '#')))
*cp = '\0';
- i = strlen(line);
- for (j=0; j<i; j++) /* just in case lower case */
- if (islower((int)line[j]))
- line[j] = toupper(line[j]);
- for (j=0; j<i; j++) /* let them use `=' between terms */
- if (line[j] == '=')
- line[j] = ' ';
- for (j=0; j<i; j++)
- if (line[j] != ' ')
+
+ /* Remove trailing space */
+ for (i = strlen(line);
+ i > 0 && isascii((int)line[i - 1]) && isspace((int)line[i - 1]);
+ )
+ line[--i] = '\0';
+
+ /* Remove leading space */
+ for (cc = line; *cc && isascii((int)*cc) && isspace((int)*cc); cc++)
+ continue;
+
+ /* Stop if nothing left */
+ if (!*cc)
+ continue;
+
+ /* Lowercase the command and find the arg */
+ for (ca = cc; *ca; ca++) {
+ if (isascii((int)*ca) && islower((int)*ca)) {
+ *ca = toupper(*ca);
+ } else if (isascii((int)*ca) && isspace((int)*ca)) {
break;
- if (!strncmp(&line[j], "LAT", 3)) {
- j += 3;
+ } else if (*ca == '=') {
+ *ca = ' ';
+ break;
+ }
+ }
+
+ /* Remove space leading the arg */
+ for (; *ca && isascii((int)*ca) && isspace((int)*ca); ca++)
+ continue;
+
+ if (!strncmp(cc, "STATUS", 6)) {
+ oncore_init_shmem(instance, ca);
+ continue;
+ }
+
+ /* Uppercase argument as well */
+ for (cp = ca; *cp; cp++)
+ if (isascii((int)*cp) && islower((int)*cp))
+ *cp = toupper(*cp);
+
+ if (!strncmp(cc, "LAT", 3)) {
f1 = f2 = f3 = 0;
- sscanf(&line[j], "%lf %lf %lf", &f1, &f2, &f3);
+ sscanf(ca, "%lf %lf %lf", &f1, &f2, &f3);
sign = 1;
if (f1 < 0) {
f1 = -f1;
@@ -641,10 +821,9 @@ oncore_read_config(
}
instance->ss_lat = sign*1000*(fabs(f3) + 60*(fabs(f2) + 60*f1)); /*miliseconds*/
lat_flg++;
- } else if (!strncmp(&line[j], "LON", 3)) {
- j += 3;
+ } else if (!strncmp(cc, "LON", 3)) {
f1 = f2 = f3 = 0;
- sscanf(&line[j], "%lf %lf %lf", &f1, &f2, &f3);
+ sscanf(ca, "%lf %lf %lf", &f1, &f2, &f3);
sign = 1;
if (f1 < 0) {
f1 = -f1;
@@ -652,29 +831,24 @@ oncore_read_config(
}
instance->ss_long = sign*1000*(fabs(f3) + 60*(fabs(f2) + 60*f1)); /*miliseconds*/
long_flg++;
- } else if (!strncmp(&line[j], "HT", 2)) {
- instance->ss_ht_type = 0;
- if (!strncmp(&line[j], "HTGPS", 5)) {
+ } else if (!strncmp(cc, "HT", 2)) {
+ if (!strncmp(cc, "HTGPS", 5))
instance->ss_ht_type = 0;
- j +=3;
- }
- if (!strncmp(&line[j], "HTMSL", 5)) {
+ else if (!strncmp(cc, "HTMSL", 5))
instance->ss_ht_type = 1;
- j +=3;
- }
- j += 2;
+ else
+ instance->ss_ht_type = 0;
f1 = 0;
units[0] = '\0';
- sscanf(&line[j], "%lf %1s", &f1, units);
+ sscanf(ca, "%lf %1s", &f1, units);
if (units[0] == 'F')
f1 = 0.3048 * f1;
instance->ss_ht = 100 * f1; /* cm */
ht_flg++;
- } else if (!strncmp(&line[j], "DELAY", 5)) {
- j += 5;
+ } else if (!strncmp(cc, "DELAY", 5)) {
f1 = 0;
units[0] = '\0';
- sscanf(&line[j], "%lf %1s", &f1, units);
+ sscanf(ca, "%lf %1s", &f1, units);
if (units[0] == 'N')
;
else if (units[0] == 'U')
@@ -686,11 +860,10 @@ oncore_read_config(
if (f1 < 0 || f1 > 1.e9)
f1 = 0;
instance->delay = f1; /* delay in ns */
- } else if (!strncmp(&line[j], "OFFSET", 6)) {
- j += 6;
+ } else if (!strncmp(cc, "OFFSET", 6)) {
f1 = 0;
units[0] = '\0';
- sscanf(&line[j], "%lf %1s", &f1, units);
+ sscanf(ca, "%lf %1s", &f1, units);
if (units[0] == 'N')
;
else if (units[0] == 'U')
@@ -702,15 +875,14 @@ oncore_read_config(
if (f1 < 0 || f1 > 1.e9)
f1 = 0;
instance->offset = f1; /* offset in ns */
- } else if (!strncmp(&line[j], "MODE", 4)) {
- j += 4;
- sscanf(&line[j], "%d", &mode);
+ } else if (!strncmp(cc, "MODE", 4)) {
+ sscanf(ca, "%d", &mode);
if (mode < 0 || mode > 4)
mode = 4;
instance->init_type = mode;
- } else if (!strncmp(&line[j], "ASSERT", 6)) {
+ } else if (!strncmp(cc, "ASSERT", 6)) {
instance->assert = 1;
- } else if (!strncmp(&line[j], "CLEAR", 5)) {
+ } else if (!strncmp(cc, "CLEAR", 5)) {
instance->assert = 0;
}
}
@@ -763,6 +935,16 @@ oncore_poll(
struct instance *instance;
instance = (struct instance *) peer->procptr->unitptr;
+ if (instance->timeout) {
+ char *cp;
+
+ oncore_sendmsg(instance->ttyfd, oncore_cmd_Cj, sizeof oncore_cmd_Cj);
+ instance->o_state = ONCORE_ID_SENT;
+ cp = "state = ONCORE_ID_SENT";
+ record_clock_stats(&(instance->peer->srcadr), cp);
+ return;
+ }
+
if (!instance->pollcnt)
refclock_report(peer, CEVNT_TIMEOUT);
else
@@ -822,7 +1004,8 @@ oncore_consume(
struct instance *instance
)
{
- int i, l, j, m;
+ int i, j, m;
+ unsigned l;
while (rcvptr >= 7) {
if (rcvbuf[0] != '@' || rcvbuf[1] != '@') {
@@ -858,6 +1041,9 @@ oncore_consume(
for (i = 2; i < l-3; i++)
j ^= rcvbuf[i];
if (j == rcvbuf[l-3]) {
+ if (instance->shmem != NULL)
+ memcpy(instance->shmem + oncore_messages[m].shmem + 2,
+ rcvbuf, l);
oncore_msg_any(instance, rcvbuf, (unsigned) (l-3), m);
if (oncore_messages[m].handler)
oncore_messages[m].handler(instance, rcvbuf, (unsigned) (l-3));
@@ -942,6 +1128,33 @@ oncore_msg_any(
/*
+ * Demultiplex the almanac into shmem
+ */
+static void
+oncore_msg_Cb(
+ struct instance *instance,
+ u_char *buf,
+ u_int len
+ )
+{
+ int i;
+
+ if (instance->shmem == NULL)
+ return;
+
+ if (buf[4] == 5)
+ i = buf[5];
+ else if (buf[4] == 4 && buf[5] <= 5)
+ i = buf[5] + 24;
+ else if (buf[4] == 4 && buf[5] <= 10)
+ i = buf[5] + 23;
+ else
+ i = 34;
+ i *= 35;
+ memcpy(instance->shmem + oncore_shmem_Cb + i + 2, buf, len + 3);
+}
+
+/*
* Set to Factory Defaults (Reasonable for UT w/ no Battery Backup
* not so for VP (eeprom) or UT with battery
*/
@@ -964,6 +1177,15 @@ oncore_msg_Cf(
+/* there are good reasons NOT to do a @@Fa command with the ONCORE.
+ * Doing it, it was found that under some circumstances the following
+ * command would fail if issued immediately after the return from the
+ * @@Fa, but a 2sec delay seemed to fix things. Since simply calling
+ * sleep(2) is wastefull, and may cause trouble for some OS's, repeating
+ * itimer, we set a flag, and test it at the next POLL. If it hasnt
+ * been cleared, we reissue the @@Ca that is issued below.
+ */
+
static void
oncore_msg_Fa(
struct instance *instance,
@@ -981,12 +1203,6 @@ oncore_msg_Fa(
exit(1);
}
- /* sometimes the @@Cj request does not produce any output
- PERHAPS the ONCORE is still busy from the selftest???
- try a 2 second sleep here to see if it makes any difference
- */
-
- sleep(2);
oncore_sendmsg(instance->ttyfd, oncore_cmd_Cj, sizeof oncore_cmd_Cj);
instance->o_state = ONCORE_ID_SENT;
cp = "state = ONCORE_ID_SENT";
@@ -1006,19 +1222,41 @@ oncore_msg_Cj(
u_int len
)
{
- const char *cp;
+ char *cp, *cp1;
int mode;
+ instance->timeout = 0;
if (instance->o_state != ONCORE_ID_SENT)
return;
memcpy(instance->Cj, buf, len);
+ /* Write Receiver ID to clockstats file */
+
+ instance->Cj[294] = '\0';
+ for (cp=(char *)instance->Cj; cp< (char *) &instance->Cj[294]; ) {
+ cp1 = strchr(cp, '\r');
+ if (!cp1)
+ cp1 = (char *)&instance->Cj[294];
+ *cp1 = '\0';
+ record_clock_stats(&(instance->peer->srcadr), cp);
+ *cp1 = '\r';
+ cp = cp1+2;
+ }
+#ifdef HAVE_PPSAPI
+ if (instance->assert)
+ cp = "Timing on Assert.";
+ else
+ cp = "Timing on Clear.";
+ record_clock_stats(&(instance->peer->srcadr), cp);
+#endif
+
oncore_sendmsg(instance->ttyfd, oncore_cmd_Cg, sizeof oncore_cmd_Cg); /* Set Posn Fix mode (not Idle (VP)) */
oncore_sendmsg(instance->ttyfd, oncore_cmd_Bb, sizeof oncore_cmd_Bb); /* turn off */
oncore_sendmsg(instance->ttyfd, oncore_cmd_Ek, sizeof oncore_cmd_Ek); /* turn off */
oncore_sendmsg(instance->ttyfd, oncore_cmd_Aw, sizeof oncore_cmd_Aw); /* UTC time */
oncore_sendmsg(instance->ttyfd, oncore_cmd_AB, sizeof oncore_cmd_AB); /* Appl type static */
+ oncore_sendmsg(instance->ttyfd, oncore_cmd_Be, sizeof oncore_cmd_Be); /* Tell us the Almanac */
mode = instance->init_type;
if (debug)
@@ -1094,6 +1332,7 @@ oncore_msg_Ea(
)
{
const char *cp;
+ char Msg[160];
if (instance->o_state != ONCORE_ALMANAC && instance->o_state != ONCORE_RUN)
return;
@@ -1128,6 +1367,7 @@ oncore_msg_Ea(
/* Read back Position Hold Params */
oncore_sendmsg(instance->ttyfd, oncore_cmd_Asx, sizeof oncore_cmd_Asx);
/* Read back PPS Offset for Output */
+ /* Nb. This will fail silently for early UT (no plus) model */
oncore_sendmsg(instance->ttyfd, oncore_cmd_Ayx, sizeof oncore_cmd_Ayx);
/* Read back Cable Delay for Output */
oncore_sendmsg(instance->ttyfd, oncore_cmd_Azx, sizeof oncore_cmd_Azx);
@@ -1184,14 +1424,6 @@ oncore_msg_Ea(
instance->ss_ht += buf_w32(&instance->Ea[23]); /* GPS ellipse */
instance->ss_count++;
- if (debug)
- printf("ONCORE: AVG %d %d %d %d\n",
- instance->ss_count,
- (unsigned) (instance->ss_lat / instance->ss_count),
- (unsigned) (instance->ss_long / instance->ss_count),
- (unsigned) (instance->ss_ht / instance->ss_count)
- );
-
if (instance->ss_count != POS_HOLD_AVERAGE)
return;
@@ -1199,6 +1431,10 @@ oncore_msg_Ea(
instance->ss_long /= POS_HOLD_AVERAGE;
instance->ss_ht /= POS_HOLD_AVERAGE;
+ sprintf(Msg, "Surveyed posn: lat %.3f long %.3f ht %.3f",
+ instance->ss_lat, instance->ss_long, instance->ss_ht);
+ record_clock_stats(&(instance->peer->srcadr), Msg);
+
w32_buf(&oncore_cmd_As[2], (int) instance->ss_lat);
w32_buf(&oncore_cmd_As[6], (int) instance->ss_long);
w32_buf(&oncore_cmd_As[10], (int) instance->ss_ht);
@@ -1240,6 +1476,9 @@ oncore_msg_En(
struct ppsclockev ev;
int r = TIOCGPPSEV;
#endif
+#if TIOCDCDTIMESTAMP
+ struct timeval tv;
+#endif
#endif /* ! HAVE_PPS_API */
if (instance->o_state != ONCORE_RUN)
@@ -1311,7 +1550,8 @@ oncore_msg_En(
DTOLFP(dmy, &ts);
ts.l_ui = tsp->tv_sec;
#endif /* 0 */
-#else /* ! HAVE_PPSAPI */
+#else
+# if defined(HAVE_TIOCGPPSEV) || defined(HAVE_CIOGETEV)
j = instance->ev_serial;
if (ioctl(instance->ppsfd, r, (caddr_t) &ev) < 0) {
perror("ONCORE: IOCTL:");
@@ -1333,6 +1573,18 @@ oncore_msg_En(
/* convert timeval -> ntp l_fp */
TVTOTS(tsp, &ts);
+# else
+# if defined(TIOCDCDTIMESTAMP)
+ if(ioctl(instance->ppsfd, TIOCDCDTIMESTAMP, &tv) < 0) {
+ perror("ONCORE: ioctl(TIOCDCDTIMESTAMP)");
+ return;
+ }
+ tsp = &tv;
+ TVTOTS(tsp, &ts);
+# else
+#error "Cannot compile -- no PPS mechanism configured!"
+# endif
+# endif
#endif
/* now have timestamp in ts */
/* add in saw_tooth and offset */
@@ -1427,19 +1679,25 @@ oncore_msg_At(
u_int len
)
{
-
if (instance->site_survey != ONCORE_SS_UNKNOWN)
return;
- if (buf[4] == 2)
+ if (buf[4] == 2) {
+ record_clock_stats(&(instance->peer->srcadr),
+ "Initiating hardware 3D site survey");
instance->site_survey = ONCORE_SS_HW;
- else {
- instance->site_survey = ONCORE_SS_SW;
-
+ } else {
+ char Msg[160];
/*
* Probably a VP or an older UT which can't do site-survey.
* We will have to do it ourselves
*/
+
+ sprintf(Msg, "Initiating software 3D site survey (%d samples)",
+ POS_HOLD_AVERAGE);
+ record_clock_stats(&(instance->peer->srcadr), Msg);
+ instance->site_survey = ONCORE_SS_SW;
+
oncore_cmd_At[2] = 0;
instance->ss_lat = instance->ss_long = instance->ss_ht = 0;
oncore_sendmsg(instance->ttyfd, oncore_cmd_At, sizeof oncore_cmd_At);
@@ -1497,7 +1755,11 @@ oncore_msg_As(
u_int len
)
{
- int lat, lon, ht;
+ char Msg[120], ew, ns;
+ const char *Ht;
+ double xd, xm, xs, yd, ym, ys, hm, hft;
+ int idx, idy, is, imx, imy;
+ long lat, lon, ht;
if (!instance->printed || instance->As)
return;
@@ -1515,86 +1777,7 @@ oncore_msg_As(
instance->ss_ht_type = buf[16];
- if (instance->Ay && instance->Az)
- oncore_stats(instance);
-}
-
-
-
-/*
- * get PPS Offset
- */
-static void
-oncore_msg_Ay(
- struct instance *instance,
- u_char *buf,
- u_int len
- )
-{
- if (!instance->printed || instance->Ay)
- return;
-
- instance->Ay = 1;
-
- instance->offset = buf_w32(&buf[4]);
-
- if (instance->As && instance->Az)
- oncore_stats(instance);
-}
-
-
-
-/*
- * get Cable Delay
- */
-static void
-oncore_msg_Az(
- struct instance *instance,
- u_char *buf,
- u_int len
- )
-{
- if (!instance->printed || instance->Az)
- return;
-
- instance->Az = 1;
-
- instance->delay = buf_w32(&buf[4]);
-
- if (instance->As && instance->Ay)
- oncore_stats(instance);
-}
-
-
-
-/*
- * print init data in ONCORE to clockstats file
- */
-static void
-oncore_stats(
- struct instance *instance
- )
-{
- char Msg[120], ew, ns, *cp, *cp1;
- const char *Ht;
- double xd, xm, xs, yd, ym, ys, hm, hft;
- int idx, idy, is, imx, imy;
- long lat, lon;
-
- /* First, Receiver ID */
-
- instance->Cj[294] = '\0';
- for (cp=(char *)instance->Cj; cp< (char *) &instance->Cj[294]; ) {
- cp1 = strchr(cp, '\r');
- if (!cp1)
- cp1 = (char *)&instance->Cj[294];
- *cp1 = '\0';
- record_clock_stats(&(instance->peer->srcadr), cp);
- *cp1 = '\r';
- cp = cp1+2;
- }
-
- /* Next Position */
+ /* Print out Position */
record_clock_stats(&(instance->peer->srcadr), "Posn:");
ew = 'E';
@@ -1637,24 +1820,58 @@ oncore_stats(
ys = is/1000.;
sprintf(Msg, "Lat = %c %3ddeg %2dm %5.2fs, Long = %c %3ddeg %2dm %5.2fs, Alt = %5.2fm (%5.2fft) %s", ns, idx, imx, xs, ew, idy, imy, ys, hm, hft, Ht);
record_clock_stats(&(instance->peer->srcadr), Msg);
+}
- /* finally, cable delay and PPS offset */
- sprintf(Msg, "Cable delay is set to %ld ns", instance->delay);
- record_clock_stats(&(instance->peer->srcadr), Msg);
+
+/*
+ * get PPS Offset
+ * Nb. @@Ay is not supported for early UT (no plus) model
+ */
+static void
+oncore_msg_Ay(
+ struct instance *instance,
+ u_char *buf,
+ u_int len
+ )
+{
+ char Msg[120];
+
+ if (!instance->printed || instance->Ay)
+ return;
+
+ instance->Ay = 1;
+
+ instance->offset = buf_w32(&buf[4]);
sprintf(Msg, "PPS Offset is set to %ld ns", instance->offset);
record_clock_stats(&(instance->peer->srcadr), Msg);
-
-#ifdef HAVE_PPSAPI
- if (instance->assert)
- cp = "Timing on Assert.";
- else
- cp = "Timing on Clear.";
- record_clock_stats(&(instance->peer->srcadr), cp);
-#endif
}
+
+
+/*
+ * get Cable Delay
+ */
+static void
+oncore_msg_Az(
+ struct instance *instance,
+ u_char *buf,
+ u_int len
+ )
+{
+ char Msg[120];
+
+ if (!instance->printed || instance->Az)
+ return;
+
+ instance->Az = 1;
+
+ instance->delay = buf_w32(&buf[4]);
+
+ sprintf(Msg, "Cable delay is set to %ld ns", instance->delay);
+ record_clock_stats(&(instance->peer->srcadr), Msg);
+}
#else
int refclock_oncore_bs;
#endif /* REFCLOCK */
diff --git a/contrib/ntp/ntpd/refclock_palisade.c b/contrib/ntp/ntpd/refclock_palisade.c
index b9a0e2ac9b62..bedf6e89bd01 100644
--- a/contrib/ntp/ntpd/refclock_palisade.c
+++ b/contrib/ntp/ntpd/refclock_palisade.c
@@ -86,6 +86,7 @@ struct refclock refclock_palisade = {
NOFLAGS /* not used */
};
+int day_of_year P((char *dt));
/*
* palisade_start - open the devices and initialize data for processing
diff --git a/contrib/ntp/ntpd/refclock_parse.c b/contrib/ntp/ntpd/refclock_parse.c
index 6771a139ed10..95b93aa2fce1 100644
--- a/contrib/ntp/ntpd/refclock_parse.c
+++ b/contrib/ntp/ntpd/refclock_parse.c
@@ -1,7 +1,7 @@
/*
- * /src/NTP/ntp-4/ntpd/refclock_parse.c,v 4.29 1999/02/28 19:58:23 kardel RELEASE_19990228_A
+ * /src/NTP/ntp-4/ntpd/refclock_parse.c,v 4.36 1999/11/28 17:18:20 kardel RELEASE_19991128_A
*
- * refclock_parse.c,v 4.29 1999/02/28 19:58:23 kardel RELEASE_19990228_A
+ * refclock_parse.c,v 4.36 1999/11/28 17:18:20 kardel RELEASE_19991128_A
*
* generic reference clock driver for receivers
*
@@ -134,7 +134,7 @@
#include "ascii.h"
#include "ieee754io.h"
-static char rcsid[]="refclock_parse.c,v 4.29 1999/02/28 19:58:23 kardel RELEASE_19990228_A";
+static char rcsid[]="refclock_parse.c,v 4.36 1999/11/28 17:18:20 kardel RELEASE_19991128_A";
/**===========================================================================
** external interface to ntp mechanism
@@ -341,7 +341,7 @@ struct parseunit
u_char flags; /* flags (leap_control) */
u_long lastchange; /* time (ntp) when last state change accured */
u_long statetime[CEVNT_MAX+1]; /* accumulated time of clock states */
- u_char pollneeddata; /* 1 for receive sample expected in PPS mode */
+ u_long pollneeddata; /* current_time(!=0) for receive sample expected in PPS mode */
u_short lastformat; /* last format used */
u_long lastsync; /* time (ntp) when clock was last seen fully synchronized */
u_long lastmissed; /* time (ntp) when poll didn't get data (powerup heuristic) */
@@ -609,16 +609,17 @@ static poll_info_t wsdcf_pollinfo = { WS_POLLRATE, WS_POLLCMD, WS_CMDSIZE };
* RAWDCF receivers that need to be powered from DTR
* (like Expert mouse clock)
*/
-static int rawdcfdtr_init P((struct parseunit *));
-#define RAWDCFDTR_DESCRIPTION "RAW DCF77 CODE (DTR OPTION)"
-#define RAWDCFDTR_INIT rawdcfdtr_init
+static int rawdcf_init_1 P((struct parseunit *));
+#define RAWDCFDTRSET_DESCRIPTION "RAW DCF77 CODE (DTR SET/RTS CLR)"
+#define RAWDCFDTRSET_INIT rawdcf_init_1
/*
- * RAWDCF receivers that need to be powered from RTS
+ * RAWDCF receivers that need to be powered from
+ * DTR CLR and RTS SET
*/
-static int rawdcfrts_init P((struct parseunit *));
-#define RAWDCFRTS_DESCRIPTION "RAW DCF77 CODE (RTS OPTION)"
-#define RAWDCFRTS_INIT rawdcfrts_init
+static int rawdcf_init_2 P((struct parseunit *));
+#define RAWDCFDTRCLRRTSSET_DESCRIPTION "RAW DCF77 CODE (DTR CLR/RTS SET)"
+#define RAWDCFDTRCLRRTSSET_INIT rawdcf_init_2
/*
* Trimble GPS receivers (TAIP and TSIP protocols)
@@ -766,6 +767,8 @@ static poll_info_t rcc8000_pollinfo = { RCC_POLLRATE, RCC_POLLCMD, RCC_CMDSIZE }
#define COMPUTIME_SAMPLES 5
#define COMPUTIME_KEEP 3
+static poll_info_t we400a_pollinfo = { 60, "T", 1 };
+
/*
* Varitext Radio Clock Receiver
*/
@@ -1144,7 +1147,7 @@ static struct parse_clockinfo
{ /* mode 14 */
RAWDCF_FLAGS,
NO_POLL,
- RAWDCFDTR_INIT,
+ RAWDCFDTRSET_INIT,
NO_EVENT,
NO_END,
NO_MESSAGE,
@@ -1152,7 +1155,7 @@ static struct parse_clockinfo
RAWDCF_ROOTDELAY,
RAWDCF_BASEDELAY,
DCF_A_ID,
- RAWDCFDTR_DESCRIPTION,
+ RAWDCFDTRSET_DESCRIPTION,
RAWDCF_FORMAT,
DCF_TYPE,
RAWDCF_MAXUNSYNC,
@@ -1165,31 +1168,54 @@ static struct parse_clockinfo
RAWDCF_KEEP
},
{ /* mode 15 */
- 0, /* operation flags (io modes) */
- NO_POLL, /* active poll routine */
- NO_INIT, /* active poll init routine */
- NO_EVENT, /* special event handling (e.g. reset clock) */
- NO_END, /* active poll end routine */
- NO_MESSAGE, /* process a lower layer message */
- NO_DATA, /* local data area for "poll" mechanism */
- 0, /* rootdelay */
- 11.0 /* bits */ / 9600, /* current offset by which the RS232
- time code is delayed from the actual time */
- DCF_ID, /* ID code */
- "WHARTON 400A Series clock", /* device name */
- "WHARTON 400A Series clock Output Format 1", /* fixed format */
- /* Must match a format-name in a libparse/clk_xxx.c file */
- DCF_TYPE, /* clock type (ntp control) */
- (1*60*60)/*?*/, /* time to trust oscillator after loosing synch */
- B9600, /* terminal input & output baudrate */
- (CS8|CREAD|PARENB|CLOCAL|HUPCL), /* terminal control flags */
- 0, /* terminal input flags */
- 0, /* terminal output flags */
- 0, /* terminal local flags */
- 5/*?*/, /* samples for median filter */
- 3/*?*/, /* samples for median filter to keep */
+ 0, /* operation flags (io modes) */
+ poll_dpoll, /* active poll routine */
+ poll_init, /* active poll init routine */
+ NO_EVENT, /* special event handling (e.g. reset clock) */
+ NO_END, /* active poll end routine */
+ NO_MESSAGE, /* process a lower layer message */
+ ((void *)(&we400a_pollinfo)), /* local data area for "poll" mechanism */
+ 0, /* rootdelay */
+ 1.0 / 960, /* current offset by which the RS232
+ time code is delayed from the actual time */
+ DCF_ID, /* ID code */
+ "WHARTON 400A Series clock", /* device name */
+ "WHARTON 400A Series clock Output Format 5", /* fixed format */
+ /* Must match a format-name in a libparse/clk_xxx.c file */
+ DCF_TYPE, /* clock type (ntp control) */
+ (1*60*60), /* time to trust oscillator after loosing synch */
+ B9600, /* terminal input & output baudrate */
+ (CS8|CREAD|PARENB|CLOCAL|HUPCL),/* terminal control flags */
+ 0, /* terminal input flags */
+ 0, /* terminal output flags */
+ 0, /* terminal local flags */
+ 5, /* samples for median filter */
+ 3, /* samples for median filter to keep */
},
- { /* mode 16 */
+ { /* mode 16 - RAWDCF RTS set, DTR clr */
+ RAWDCF_FLAGS,
+ NO_POLL,
+ RAWDCFDTRCLRRTSSET_INIT,
+ NO_EVENT,
+ NO_END,
+ NO_MESSAGE,
+ NO_DATA,
+ RAWDCF_ROOTDELAY,
+ RAWDCF_BASEDELAY,
+ DCF_A_ID,
+ RAWDCFDTRCLRRTSSET_DESCRIPTION,
+ RAWDCF_FORMAT,
+ DCF_TYPE,
+ RAWDCF_MAXUNSYNC,
+ RAWDCF_SPEED,
+ RAWDCF_CFLAG,
+ RAWDCF_IFLAG,
+ RAWDCF_OFLAG,
+ RAWDCF_LFLAG,
+ RAWDCF_SAMPLES,
+ RAWDCF_KEEP
+ },
+ { /* mode 17 */
VARITEXT_FLAGS,
NO_POLL,
NO_INIT,
@@ -1211,30 +1237,7 @@ static struct parse_clockinfo
VARITEXT_LFLAG,
VARITEXT_SAMPLES,
VARITEXT_KEEP
- },
- { /* mode 17 */
- RAWDCF_FLAGS,
- NO_POLL,
- RAWDCFRTS_INIT,
- NO_EVENT,
- NO_END,
- NO_MESSAGE,
- NO_DATA,
- RAWDCF_ROOTDELAY,
- RAWDCF_BASEDELAY,
- DCF_A_ID,
- RAWDCFRTS_DESCRIPTION,
- RAWDCF_FORMAT,
- DCF_TYPE,
- RAWDCF_MAXUNSYNC,
- RAWDCF_SPEED,
- RAWDCF_CFLAG,
- RAWDCF_IFLAG,
- RAWDCF_OFLAG,
- RAWDCF_LFLAG,
- RAWDCF_SAMPLES,
- RAWDCF_KEEP
- },
+ }
};
static int ncltypes = sizeof(parse_clockinfo) / sizeof(struct parse_clockinfo);
@@ -1554,9 +1557,9 @@ ppsclock_init(
ioctl(parse->generic->io.fd, I_PUSH, (caddr_t)m2) == -1)
{
if (errno != EINVAL)
- {
- msyslog(LOG_ERR, "PARSE receiver #%d: ppsclock_init: ioctl(fd, I_PUSH, \"ppsclock\"): %m",
- CLK_UNIT(parse->peer));
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: ppsclock_init: ioctl(fd, I_PUSH, \"ppsclock\"): %m",
+ CLK_UNIT(parse->peer));
}
return 0;
}
@@ -1586,8 +1589,8 @@ stream_init(
if (ioctl(parse->generic->io.fd, I_PUSH, (caddr_t)m1) == -1)
{
if (errno != EINVAL) /* accept non-existence */
- {
- msyslog(LOG_ERR, "PARSE receiver #%d: stream_init: ioctl(fd, I_PUSH, \"parse\"): %m", CLK_UNIT(parse->peer));
+ {
+ msyslog(LOG_ERR, "PARSE receiver #%d: stream_init: ioctl(fd, I_PUSH, \"parse\"): %m", CLK_UNIT(parse->peer));
}
return 0;
}
@@ -2032,10 +2035,10 @@ local_input(
}
else
{
- memmove((caddr_t)rbufp->recv_buffer,
- (caddr_t)&parse->parseio.parse_dtime,
- sizeof(parsetime_t));
- parse_iodone(&parse->parseio);
+ memmove((caddr_t)rbufp->recv_buffer,
+ (caddr_t)&parse->parseio.parse_dtime,
+ sizeof(parsetime_t));
+ parse_iodone(&parse->parseio);
rbufp->recv_length = sizeof(parsetime_t);
return 1; /* got something & in place return */
}
@@ -2132,18 +2135,18 @@ parsestate(
const char *name;
} flagstrings[] =
{
- { PARSEB_ANNOUNCE, "DST SWITCH WARNING" },
- { PARSEB_POWERUP, "NOT SYNCHRONIZED" },
- { PARSEB_NOSYNC, "TIME CODE NOT CONFIRMED" },
- { PARSEB_DST, "DST" },
- { PARSEB_UTC, "UTC DISPLAY" },
- { PARSEB_LEAPADD, "LEAP ADD WARNING" },
- { PARSEB_LEAPDEL, "LEAP DELETE WARNING" },
+ { PARSEB_ANNOUNCE, "DST SWITCH WARNING" },
+ { PARSEB_POWERUP, "NOT SYNCHRONIZED" },
+ { PARSEB_NOSYNC, "TIME CODE NOT CONFIRMED" },
+ { PARSEB_DST, "DST" },
+ { PARSEB_UTC, "UTC DISPLAY" },
+ { PARSEB_LEAPADD, "LEAP ADD WARNING" },
+ { PARSEB_LEAPDEL, "LEAP DELETE WARNING" },
{ PARSEB_LEAPSECOND, "LEAP SECOND" },
- { PARSEB_ALTERNATE,"ALTERNATE ANTENNA" },
- { PARSEB_TIMECODE, "TIME CODE" },
- { PARSEB_PPS, "PPS" },
- { PARSEB_POSITION, "POSITION" },
+ { PARSEB_ALTERNATE, "ALTERNATE ANTENNA" },
+ { PARSEB_TIMECODE, "TIME CODE" },
+ { PARSEB_PPS, "PPS" },
+ { PARSEB_POSITION, "POSITION" },
{ 0 }
};
@@ -2538,9 +2541,6 @@ parse_start(
peer->sstclktype = parse->parse_type->cl_type;
peer->precision = sys_precision;
- peer->burst = NTP_SHIFT;
- peer->flags |= FLAG_BURST;
-
peer->stratum = STRATUM_REFCLOCK;
if (peer->stratum <= 1)
memmove((char *)&parse->generic->refid, parse->parse_type->cl_id, 4);
@@ -2737,7 +2737,7 @@ parse_start(
}
#endif
#endif
-
+
/*
* try to do any special initializations
*/
@@ -2816,9 +2816,11 @@ parse_poll(
*/
parse->generic->polls++;
- if (parse->pollneeddata)
+ if (parse->pollneeddata &&
+ ((current_time - parse->pollneeddata) > (1<<(max(min(parse->peer->hpoll, parse->peer->ppoll), parse->peer->minpoll)))))
{
/*
+ * start worrying when exceeding a poll inteval
* bad news - didn't get a response last time
*/
parse->generic->noreply++;
@@ -2832,7 +2834,7 @@ parse_poll(
/*
* we just mark that we want the next sample for the clock filter
*/
- parse->pollneeddata = 1;
+ parse->pollneeddata = current_time;
if (parse->parse_type->cl_poll)
{
@@ -3380,7 +3382,7 @@ parse_process(
if (reftime.l_uf & (unsigned)0x80000000)
reftime.l_ui++;
reftime.l_uf = 0;
-
+
/*
* implied on second offset
@@ -3535,7 +3537,7 @@ parse_process(
refclock_receive(parse->peer);
}
-
+
/**===========================================================================
** special code for special clocks
**/
@@ -4149,7 +4151,7 @@ poll_init(
return 0;
}
-
+
/**===========================================================================
** Trimble support
**/
@@ -4260,7 +4262,7 @@ trimbletaip_event(
* of the PPS pulse for accurate timing. Where it is determined that
* the offset is way off, when first starting up ntpd for example,
* the timing of the data stream is used until the offset becomes low enough
- * (|offset| < clock_max), at which point the pps offset is used.
+ * (|offset| < CLOCK_MAX), at which point the pps offset is used.
*
* It can use either option for receiving PPS information - the 'ppsclock'
* stream pushed onto the serial data interface to timestamp the Carrier
@@ -4349,6 +4351,12 @@ struct txbuf
u_char *txt; /* pointer to actual data buffer */
};
+void sendcmd P((struct txbuf *buf, int c));
+void sendbyte P((struct txbuf *buf, int b));
+void sendetx P((struct txbuf *buf, struct parseunit *parse));
+void sendint P((struct txbuf *buf, int a));
+void sendflt P((struct txbuf *buf, double a));
+
void
sendcmd(
struct txbuf *buf,
@@ -4441,7 +4449,7 @@ static int
trimbletsip_setup(
struct parseunit *parse,
const char *reason
- )
+ )
{
u_char buffer[256];
struct txbuf buf;
@@ -4449,34 +4457,34 @@ trimbletsip_setup(
buf.txt = buffer;
sendcmd(&buf, CMD_CVERSION); /* request software versions */
- sendetx(&buf, parse);
-
+ sendetx(&buf, parse);
+
sendcmd(&buf, CMD_COPERPARAM); /* set operating parameters */
- sendbyte(&buf, 4); /* static */
- sendflt(&buf, 5.0*D2R); /* elevation angle mask = 10 deg XXX */
- sendflt(&buf, 4.0); /* s/n ratio mask = 6 XXX */
- sendflt(&buf, 12.0); /* PDOP mask = 12 */
- sendflt(&buf, 8.0); /* PDOP switch level = 8 */
- sendetx(&buf, parse);
-
+ sendbyte(&buf, 4); /* static */
+ sendflt(&buf, 5.0*D2R); /* elevation angle mask = 10 deg XXX */
+ sendflt(&buf, 4.0); /* s/n ratio mask = 6 XXX */
+ sendflt(&buf, 12.0); /* PDOP mask = 12 */
+ sendflt(&buf, 8.0); /* PDOP switch level = 8 */
+ sendetx(&buf, parse);
+
sendcmd(&buf, CMD_CMODESEL); /* fix mode select */
- sendbyte(&buf, 0); /* automatic */
- sendetx(&buf, parse);
-
+ sendbyte(&buf, 0); /* automatic */
+ sendetx(&buf, parse);
+
sendcmd(&buf, CMD_CMESSAGE); /* request system message */
- sendetx(&buf, parse);
-
+ sendetx(&buf, parse);
+
sendcmd(&buf, CMD_CSUPER); /* superpacket fix */
- sendbyte(&buf, 0x2); /* binary mode */
- sendetx(&buf, parse);
-
+ sendbyte(&buf, 0x2); /* binary mode */
+ sendetx(&buf, parse);
+
sendcmd(&buf, CMD_CIOOPTIONS); /* set I/O options */
sendbyte(&buf, TRIM_POS_OPT); /* position output */
sendbyte(&buf, 0x00); /* no velocity output */
sendbyte(&buf, TRIM_TIME_OPT); /* UTC, compute on seconds */
sendbyte(&buf, 0x00); /* no raw measurements */
- sendetx(&buf, parse);
-
+ sendetx(&buf, parse);
+
sendcmd(&buf, CMD_CUTCPARAM); /* request UTC correction data */
sendetx(&buf, parse);
@@ -4605,7 +4613,7 @@ trimbletsip_init(
#ifdef VEOL2
tio.c_cc[VEOL2] = DLE;
#endif
-}
+ }
if (TTY_SETATTR(parse->generic->io.fd, &tio) == -1)
{
@@ -5133,11 +5141,12 @@ trimbletsip_message(
**/
/*--------------------------------------------------
- * rawdcfdtr_init - set up modem lines for RAWDCF receivers
+ * rawdcf_init_1 - set up modem lines for RAWDCF receivers
+ * SET DTR line
*/
#if defined(TIOCMSET) && (defined(TIOCM_DTR) || defined(CIOCM_DTR))
static int
-rawdcfdtr_init(
+rawdcf_init_1(
struct parseunit *parse
)
{
@@ -5155,7 +5164,7 @@ rawdcfdtr_init(
if (ioctl(parse->generic->io.fd, TIOCMSET, (caddr_t)&sl232) == -1)
{
- msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init: WARNING: ioctl(fd, TIOCMSET, [C|T]IOCM_DTR): %m", CLK_UNIT(parse->peer));
+ msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_1: WARNING: ioctl(fd, TIOCMSET, [C|T]IOCM_DTR): %m", CLK_UNIT(parse->peer));
}
return 0;
}
@@ -5165,47 +5174,49 @@ rawdcfdtr_init(
struct parseunit *parse
)
{
- msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init: WARNING: OS interface incapable of setting DTR to power DCF modules", CLK_UNIT(parse->peer));
+ msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_1: WARNING: OS interface incapable of setting DTR to power DCF modules", CLK_UNIT(parse->peer));
return 0;
}
#endif /* DTR initialisation type */
/*--------------------------------------------------
- * rawdcfrts_init - set up modem lines for RAWDCF receivers
+ * rawdcf_init_2 - set up modem lines for RAWDCF receivers
+ * CLR DTR line, SET RTS line
*/
-#if defined(TIOCMSET) && (defined(TIOCM_RTS) || defined(CIOCM_RTS))
+#if defined(TIOCMSET) && (defined(TIOCM_RTS) || defined(CIOCM_RTS))
static int
-rawdcfrts_init(
+rawdcf_init_2(
struct parseunit *parse
)
{
/*
* You can use the RS232 to supply the power for a DCF77 receiver.
- * Here a voltage between the RTS and the DTR line is used.
+ * Here a voltage between the DTR and the RTS line is used. Unfortunately
+ * the name has changed from CIOCM_DTR to TIOCM_DTR recently.
*/
#ifdef TIOCM_RTS
- int sl232 = TIOCM_RTS; /* turn on RTS for power supply */
+ int sl232 = TIOCM_RTS; /* turn on RTS, clear DTR for power supply */
#else
- int sl232 = CIOCM_RTS; /* turn on RTS for power supply */
+ int sl232 = CIOCM_RTS; /* turn on DTR for power supply */
#endif
if (ioctl(parse->generic->io.fd, TIOCMSET, (caddr_t)&sl232) == -1)
{
- msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init: WARNING: ioctl(fd, TIOCMSET, [C|T]IOCM_RTS): %m", CLK_UNIT(parse->peer));
+ msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_2: WARNING: ioctl(fd, TIOCMSET, [C|T]IOCM_RTS): %m", CLK_UNIT(parse->peer));
}
return 0;
}
#else
static int
-rawdcfrts_init(
+rawdcf_init_2(
struct parseunit *parse
)
{
- msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init: WARNING: OS interface incapable of setting RTS to power DCF modules", CLK_UNIT(parse->peer));
+ msyslog(LOG_NOTICE, "PARSE receiver #%d: rawdcf_init_2: WARNING: OS interface incapable of setting RTS to power DCF modules", CLK_UNIT(parse->peer));
return 0;
}
-#endif /* RTS initialisation type */
+#endif /* DTR initialisation type */
#else /* defined(REFCLOCK) && defined(PARSE) */
int refclock_parse_bs;
@@ -5215,6 +5226,27 @@ int refclock_parse_bs;
* History:
*
* refclock_parse.c,v
+ * Revision 4.36 1999/11/28 17:18:20 kardel
+ * disabled burst mode
+ *
+ * Revision 4.35 1999/11/28 09:14:14 kardel
+ * RECON_4_0_98F
+ *
+ * Revision 4.34 1999/05/14 06:08:05 kardel
+ * store current_time in a suitable container (u_long)
+ *
+ * Revision 4.33 1999/05/13 21:48:38 kardel
+ * double the no response timeout interval
+ *
+ * Revision 4.32 1999/05/13 20:09:13 kardel
+ * complain only about missing polls after a full poll interval
+ *
+ * Revision 4.31 1999/05/13 19:59:32 kardel
+ * add clock type 16 for RTS set DTR clr in RAWDCF
+ *
+ * Revision 4.30 1999/02/28 20:36:43 kardel
+ * fixed printf fmt
+ *
* Revision 4.29 1999/02/28 19:58:23 kardel
* updated copyright information
*
diff --git a/contrib/ntp/ntpd/refclock_pcf.c b/contrib/ntp/ntpd/refclock_pcf.c
new file mode 100644
index 000000000000..c8824045527d
--- /dev/null
+++ b/contrib/ntp/ntpd/refclock_pcf.c
@@ -0,0 +1,215 @@
+/*
+ * refclock_pcf - clock driver for the Conrad parallel port radio clock
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_PCF)
+
+#include <time.h>
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+
+/*
+ * This driver supports the parallel port radio clocks sold by Conrad
+ * Electronic under order numbers 967602 and 642002.
+ *
+ * It requires that the local timezone be CET/CEST and that the pcfclock
+ * device driver be installed. A device driver for Linux 2.2 is available
+ * at http://home.pages.de/~voegele/pcf.html.
+ */
+
+/*
+ * Interface definitions
+ */
+#define DEVICE "/dev/pcfclock%d"
+#define PRECISION (-1) /* precision assumed (about 0.5 s) */
+#define REFID "PCF"
+#define DESCRIPTION "Conrad parallel port radio clock"
+
+#define LENPCF 18 /* timecode length */
+
+/*
+ * Function prototypes
+ */
+static int pcf_start P((int, struct peer *));
+static void pcf_shutdown P((int, struct peer *));
+static void pcf_poll P((int, struct peer *));
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_pcf = {
+ pcf_start, /* start up driver */
+ pcf_shutdown, /* shut down driver */
+ pcf_poll, /* transmit poll message */
+ noentry, /* not used */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * pcf_start - open the device and initialize data for processing
+ */
+static int
+pcf_start(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ int fd;
+ char device[20];
+
+ /*
+ * Open device file for reading.
+ */
+ (void)sprintf(device, DEVICE, unit);
+#ifdef DEBUG
+ if (debug)
+ printf ("starting PCF with device %s\n",device);
+#endif
+ if ((fd = open(device, O_RDONLY)) == -1) {
+ return (0);
+ }
+
+ pp = peer->procptr;
+ pp->io.clock_recv = noentry;
+ pp->io.srcclock = (caddr_t)peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 4);
+
+ return (1);
+}
+
+
+/*
+ * pcf_shutdown - shut down the clock
+ */
+static void
+pcf_shutdown(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+
+ pp = peer->procptr;
+ (void)close(pp->io.fd);
+}
+
+
+/*
+ * pcf_poll - called by the transmit procedure
+ */
+static void
+pcf_poll(
+ int unit,
+ struct peer *peer
+ )
+{
+ struct refclockproc *pp;
+ char buf[LENPCF];
+ struct tm tm, *tp;
+ time_t t;
+
+ pp = peer->procptr;
+
+ buf[0] = 0;
+ if (read(pp->io.fd, buf, sizeof(buf)) < sizeof(buf) || buf[0] != 9) {
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ }
+
+ tm.tm_mday = buf[11] * 10 + buf[10];
+ tm.tm_mon = buf[13] * 10 + buf[12] - 1;
+ tm.tm_year = buf[15] * 10 + buf[14];
+ tm.tm_hour = buf[7] * 10 + buf[6];
+ tm.tm_min = buf[5] * 10 + buf[4];
+ tm.tm_sec = buf[3] * 10 + buf[2];
+ tm.tm_isdst = -1;
+
+ /*
+ * Y2K convert the 2-digit year
+ */
+ if (tm.tm_year < 99)
+ tm.tm_year += 100;
+
+ t = mktime(&tm);
+ if (t == (time_t) -1) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+
+#if defined(__GLIBC__) && defined(_BSD_SOURCE)
+ if ((tm.tm_isdst > 0 && tm.tm_gmtoff != 7200)
+ || (tm.tm_isdst == 0 && tm.tm_gmtoff != 3600)
+ || tm.tm_isdst < 0) {
+#ifdef DEBUG
+ if (debug)
+ printf ("local time zone not set to CET/CEST\n");
+#endif
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+#endif
+
+ pp->lencode = strftime(pp->a_lastcode, BMAX, "%Y %m %d %H %M %S", &tm);
+
+#if defined(_REENTRANT) || defined(_THREAD_SAFE)
+ tp = gmtime_r(&t, &tm);
+#else
+ tp = gmtime(&t);
+#endif
+ if (!tp) {
+ refclock_report(peer, CEVNT_FAULT);
+ return;
+ }
+
+ get_systime(&pp->lastrec);
+ pp->polls++;
+ pp->year = tp->tm_year + 1900;
+ pp->day = tp->tm_yday + 1;
+ pp->hour = tp->tm_hour;
+ pp->minute = tp->tm_min;
+ pp->second = tp->tm_sec;
+ pp->usec = buf[16] * 31250;
+ if (buf[17] & 1)
+ pp->usec += 500000;
+
+#ifdef DEBUG
+ if (debug)
+ printf ("pcf%d: time is %04d/%02d/%02d %02d:%02d:%02d UTC\n",
+ unit, pp->year, tp->tm_mon + 1, tp->tm_mday, pp->hour,
+ pp->minute, pp->second);
+#endif
+
+ if (!refclock_process(pp)) {
+ refclock_report(peer, CEVNT_BADTIME);
+ return;
+ }
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+ if (buf[1] & 1)
+ pp->leap = LEAP_NOTINSYNC;
+ else
+ pp->leap = LEAP_NOWARNING;
+ refclock_receive(peer);
+}
+#else
+int refclock_pcf_bs;
+#endif /* REFCLOCK */
diff --git a/contrib/ntp/ntpd/refclock_shm.c b/contrib/ntp/ntpd/refclock_shm.c
index fe05b02f7137..a8094c86ec1e 100644
--- a/contrib/ntp/ntpd/refclock_shm.c
+++ b/contrib/ntp/ntpd/refclock_shm.c
@@ -264,7 +264,7 @@ shm_poll(
int ok=1;
switch (up->mode) {
case 0: {
- tvr.tv_sec=up->receiveTimeStampSec-172800;
+ tvr.tv_sec=up->receiveTimeStampSec;
tvr.tv_usec=up->receiveTimeStampUSec;
tvt.tv_sec=up->clockTimeStampSec;
tvt.tv_usec=up->clockTimeStampUSec;
@@ -272,7 +272,7 @@ shm_poll(
break;
case 1: {
int cnt=up->count;
- tvr.tv_sec=up->receiveTimeStampSec-172800;
+ tvr.tv_sec=up->receiveTimeStampSec;
tvr.tv_usec=up->receiveTimeStampUSec;
tvt.tv_sec=up->clockTimeStampSec;
tvt.tv_usec=up->clockTimeStampUSec;
@@ -282,17 +282,17 @@ shm_poll(
default:
msyslog (LOG_ERR, "SHM: bad mode found in shared memory: %d",up->mode);
}
- /*msyslog(LOG_NOTICE,"poll2a tvr.s %d tvr.u %d tvt.s %d tvt.u %d",tvr.tv_sec,tvr.tv_usec,tvt.tv_sec,tvt.tv_usec);*/
up->valid=0;
if (ok) {
TVTOTS(&tvr,&pp->lastrec);
/* pp->lasttime = current_time; */
pp->polls++;
t=gmtime (&tvt.tv_sec);
- pp->day=t->tm_yday;/*+2; */
+ pp->day=t->tm_yday+1;
pp->hour=t->tm_hour;
pp->minute=t->tm_min;
pp->second=t->tm_sec;
+ pp->msec=0;
pp->usec=tvt.tv_usec;
peer->precision=up->precision;
pp->leap=up->leap;
diff --git a/contrib/ntp/ntpd/refclock_wwv.c b/contrib/ntp/ntpd/refclock_wwv.c
new file mode 100644
index 000000000000..52e76e63ca99
--- /dev/null
+++ b/contrib/ntp/ntpd/refclock_wwv.c
@@ -0,0 +1,2754 @@
+/*
+ * refclock_wwv - clock driver for NIST WWV/H time/frequency station
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined(REFCLOCK) && defined(CLOCK_WWV)
+
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/time.h>
+#include <math.h>
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif /* HAVE_SYS_IOCTL_H */
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_refclock.h"
+#include "ntp_calendar.h"
+#include "ntp_stdlib.h"
+#include "audio.h"
+
+#define ICOM 1 /* undefine to suppress ICOM code */
+
+#ifdef ICOM
+#include "icom.h"
+#endif /* ICOM */
+
+/*
+ * Audio WWV/H demodulator/decoder
+ *
+ * This driver synchronizes the computer time using data encoded in
+ * radio transmissions from NIST time/frequency stations WWV in Boulder,
+ * CO, and WWVH in Kauai, HI. Transmikssions are made continuously on
+ * 2.5, 5, 10, 15 and 20 MHz in AM mode. An ordinary shortwave receiver
+ * can be tuned manually to one of these frequencies or, in the case of
+ * ICOM receivers, the receiver can be tuned automatically using this
+ * program as propagation conditions change throughout the day and
+ * night.
+ *
+ * The driver receives, demodulates and decodes the radio signals when
+ * connected to the audio codec of a Sun workstation running SunOS or
+ * Solaris, and with a little help, other workstations with similar
+ * codecs or sound cards. In this implementation, only one audio driver
+ * and codec can be supported on a single machine.
+ *
+ * The demodulation and decoding algorithms used in this driver are
+ * based on those developed for the TAPR DSP93 development board and the
+ * TI 320C25 digital signal processor described in: Mills, D.L. A
+ * precision radio clock for WWV transmissions. Electrical Engineering
+ * Report 97-8-1, University of Delaware, August 1997, 25 pp. Available
+ * from www.eecis.udel.edu/~mills/reports.htm. The algorithms described
+ * in this report have been modified somewhat to improve performance
+ * under weak signal conditions and to provide an automatic station
+ * identification feature.
+ *
+ * The ICOM code is normally compiled in the driver. It isn't used,
+ * unless the mode keyword on the server configuration command specifies
+ * a nonzero ICOM ID select code. The C-IV trace is turned on if the
+ * debug level is greater than one.
+ */
+/*
+ * Interface definitions
+ */
+#define PRECISION (-10) /* precision assumed (about 1 ms) */
+#define REFID "NONE" /* reference ID */
+#define DESCRIPTION "WWV/H Audio Demodulator/Decoder" /* WRU */
+#define SECOND 8000 /* second epoch (sample rate) (Hz) */
+#define MINUTE (SECOND * 60) /* minute epoch */
+#define OFFSET 128 /* companded sample offset */
+#define SIZE 256 /* decompanding table size */
+#define MAXSIG 6000. /* maximum signal level reference */
+#define MAXSNR 30. /* max SNR reference */
+#define DGAIN 20. /* data channel gain reference */
+#define SGAIN 10. /* sync channel gain reference */
+#define MAXFREQ (125e-6 * SECOND) /* freq tolerance (.0125%) */
+#define PI 3.1415926535 /* the real thing */
+#define DATSIZ (170 * MS) /* data matched filter size */
+#define SYNSIZ (800 * MS) /* minute sync matched filter size */
+#define UTCYEAR 72 /* the first UTC year */
+#define MAXERR 30 /* max data bit errors in minute */
+#define NCHAN 5 /* number of channels */
+
+/*
+ * Macroni
+ */
+#define MOD(x, y) ((x) < 0 ? -(-(x) % (y)) : (x) % (y))
+
+/*
+ * General purpose status bits (status)
+ *
+ * Notes: SELV and/or SELH are set when the minute sync pulse from
+ * either or both WWV and/or WWVH stations has been heard. MSYNC is set
+ * when the minute sync pulse has been acquired and never reset. SSYNC
+ * is set when the second sync pulse has been acquired and cleared by
+ * watchdog or signal loss. DSYNC is set when the minutes unit digit has
+ * reached the threshold and INSYNC is set when if all nine digits have
+ * reached the threshold and never cleared.
+ *
+ * DGATE is set if a data bit is invalid, BGATE is set if a BCD digit
+ * bit is invalid. SFLAG is set when during seconds 59, 0 and 1 while
+ * probing for alternate frequencies. LEPSEC is set when the SECWAR of
+ * the timecode is set on the last second of 30 June or 31 December. At
+ * the end of this minute both the receiver and transmitter insert
+ * second 60 in the minute and the minute sync slips a second.
+ */
+#define MSYNC 0x0001 /* minute epoch sync */
+#define SSYNC 0x0002 /* second epoch sync */
+#define DSYNC 0x0004 /* minute units sync */
+#define INSYNC 0x0008 /* clock synchronized */
+#define DGATE 0x0010 /* data bit error */
+#define BGATE 0x0020 /* BCD digit bit error */
+#define SFLAG 0x1000 /* probe flag */
+#define LEPSEC 0x2000 /* leap second in progress */
+
+/*
+ * Station scoreboard bits (select)
+ *
+ * These are used to establish the signal quality for each of the five
+ * frequencies and two stations.
+ */
+#define JITRNG 0x0001 /* jitter above threshold */
+#define SYNCNG 0x0002 /* sync below threshold or SNR */
+#define DATANG 0x0004 /* data below threshold or SNR */
+#define SELV 0x0100 /* WWV station select */
+#define SELH 0x0200 /* WWVH station select */
+
+/*
+ * Alarm status bits (alarm)
+ *
+ * These bits indicate various alarm conditions, which are decoded to
+ * form the quality character included in the timecode. There are four
+ * four-bit nibble fields in the word, each corresponding to a specific
+ * alarm condition. At the end of each second, the word is shifted left
+ * one position and the least significant bit of each nibble cleared.
+ * This bit can be set during the next minute if the associated alarm
+ * condition is raised. This provides a way to remember alarm conditions
+ * up to four minutes.
+ *
+ * If not tracking both minute sync and second sync, the SYNERR alarm is
+ * raised. The data error counter is incremented for each invalid data
+ * bit. If too many data bit errors are encountered in one minute, the
+ * MODERR alarm is raised. The DECERR alarm is raised if a maximum
+ * likelihood digit fails to compare with the current clock digit. If
+ * the probability of any miscellaneous bit or any digit falls below the
+ * threshold, the SYMERR alarm is raised.
+ */
+#define DECERR 0 /* BCD digit compare error */
+#define SYMERR 4 /* low bit or digit probability */
+#define MODERR 8 /* too many data bit errors */
+#define SYNERR 12 /* not synchronized to station */
+
+/*
+ * Watchdog timeouts (watch)
+ *
+ * If these timeouts expire, the status bits are mashed to zero and the
+ * driver starts from scratch. Suitably more refined procedures may be
+ * developed in future. All these are in minutes.
+ */
+#define ACQSN 5 /* acquisition timeout */
+#define HSPEC 15 /* second sync timeout */
+#define DIGIT 30 /* minute unit digit timeout */
+#define PANIC (4 * 1440) /* panic timeout */
+
+/*
+ * Thresholds. These establish the minimum signal level, minimum SNR and
+ * maximum jitter thresholds which establish the error and false alarm
+ * rates of the receiver. The values defined here may be on the
+ * adventurous side in the interest of the highest sensitivity.
+ */
+#define ATHR 2000 /* acquisition amplitude threshold */
+#define ASNR 6.0 /* acquisition SNR threshold (dB) */
+#define AWND 50 /* acquisition window threshold (ms) */
+#define AMIN 3 /* acquisition min compare count */
+#define AMAX 6 /* max compare count */
+#define QTHR 2000 /* QSY amplitude threshold */
+#define QSNR 20.0 /* QSY SNR threshold (dB) */
+#define STHR 500 /* second sync amplitude threshold */
+#define SCMP 10 /* second sync compare threshold */
+#define DTHR 1000 /* bit amplitude threshold */
+#define DSNR 10.0 /* bit SNR threshold (dB) */
+#define BTHR 1000 /* digit probability threshold */
+#define BSNR 3.0 /* digit likelihood threshold (dB) */
+#define BCMP 5 /* digit compare threshold (dB) */
+
+/*
+ * Tone frequency definitions.
+ */
+#define MS 8 /* samples per millisecond */
+#define IN100 1 /* 100 Hz 4.5-deg sin table */
+#define IN1000 10 /* 1000 Hz 4.5-deg sin table */
+#define IN1200 12 /* 1200 Hz 4.5-deg sin table */
+
+/*
+ * Acquisition and tracking time constants. Usually powers of 2.
+ */
+#define MINAVG 8 /* min time constant (s) */
+#define MAXAVG 7 /* max time constant (log2 s) */
+#define TCONST 16 /* minute time constant (s) */
+#define SYNCTC (1024 / (1 << MAXAVG)) /* FLL constant (s) */
+
+/*
+ * Miscellaneous status bits (misc)
+ *
+ * These bits correspond to designated bits in the WWV/H timecode. The
+ * bit probabilities are exponentially averaged over several minutes and
+ * processed by a integrator and threshold.
+ */
+#define DUT1 0x01 /* 56 DUT .1 */
+#define DUT2 0x02 /* 57 DUT .2 */
+#define DUT4 0x04 /* 58 DUT .4 */
+#define DUTS 0x08 /* 50 DUT sign */
+#define DST1 0x10 /* 55 DST1 DST in progress */
+#define DST2 0x20 /* 2 DST2 DST change warning */
+#define SECWAR 0x40 /* 3 leap second warning */
+
+/*
+ * The total system delay with the DSP93 program is at 22.5 ms,
+ * including the propagation delay from Ft. Collins, CO, to Newark, DE
+ * (8.9 ms), the communications receiver delay and the delay of the
+ * DSP93 program itself. The DSP93 program delay is due mainly to the
+ * 400-Hz FIR bandpass filter (5 ms) and second sync matched filter (5
+ * ms), leaving about 3.6 ms for the receiver delay and strays.
+ *
+ * The total system delay with this program is estimated at 27.1 ms by
+ * comparison with another PPS-synchronized NTP server over a 10-Mb/s
+ * Ethernet. The propagation and receiver delays are the same as with
+ * the DSP93 program. The program delay is due only to the 600-Hz
+ * IIR bandpass filter (1.1 ms), since other delays have been removed.
+ * Assuming 4.7 ms for the receiver, program and strays, this leaves
+ * 13.5 ms for the audio codec and operating system latencies for a
+ * total of 18.2 ms. as the systematic delay. The additional propagation
+ * delay specific to each receiver location can be programmed in the
+ * fudge time1 and time2 values for WWV and WWVH, respectively.
+ */
+#define PDELAY (.0036 + .0011 + .0135) /* net system delay (s) */
+
+/*
+ * Table of sine values at 4.5-degree increments. This is used by the
+ * synchronous matched filter demodulators. The integral of sine-squared
+ * over one complete cycle is PI, so the table is normallized by 1 / PI.
+ */
+double sintab[] = {
+ 0.000000e+00, 2.497431e-02, 4.979464e-02, 7.430797e-02, /* 0-3 */
+ 9.836316e-02, 1.218119e-01, 1.445097e-01, 1.663165e-01, /* 4-7 */
+ 1.870979e-01, 2.067257e-01, 2.250791e-01, 2.420447e-01, /* 8-11 */
+ 2.575181e-01, 2.714038e-01, 2.836162e-01, 2.940800e-01, /* 12-15 */
+ 3.027307e-01, 3.095150e-01, 3.143910e-01, 3.173286e-01, /* 16-19 */
+ 3.183099e-01, 3.173286e-01, 3.143910e-01, 3.095150e-01, /* 20-23 */
+ 3.027307e-01, 2.940800e-01, 2.836162e-01, 2.714038e-01, /* 24-27 */
+ 2.575181e-01, 2.420447e-01, 2.250791e-01, 2.067257e-01, /* 28-31 */
+ 1.870979e-01, 1.663165e-01, 1.445097e-01, 1.218119e-01, /* 32-35 */
+ 9.836316e-02, 7.430797e-02, 4.979464e-02, 2.497431e-02, /* 36-39 */
+-0.000000e+00, -2.497431e-02, -4.979464e-02, -7.430797e-02, /* 40-43 */
+-9.836316e-02, -1.218119e-01, -1.445097e-01, -1.663165e-01, /* 44-47 */
+-1.870979e-01, -2.067257e-01, -2.250791e-01, -2.420447e-01, /* 48-51 */
+-2.575181e-01, -2.714038e-01, -2.836162e-01, -2.940800e-01, /* 52-55 */
+-3.027307e-01, -3.095150e-01, -3.143910e-01, -3.173286e-01, /* 56-59 */
+-3.183099e-01, -3.173286e-01, -3.143910e-01, -3.095150e-01, /* 60-63 */
+-3.027307e-01, -2.940800e-01, -2.836162e-01, -2.714038e-01, /* 64-67 */
+-2.575181e-01, -2.420447e-01, -2.250791e-01, -2.067257e-01, /* 68-71 */
+-1.870979e-01, -1.663165e-01, -1.445097e-01, -1.218119e-01, /* 72-75 */
+-9.836316e-02, -7.430797e-02, -4.979464e-02, -2.497431e-02, /* 76-79 */
+ 0.000000e+00}; /* 80 */
+
+/*
+ * Decoder operations at the end of each second are driven by a state
+ * machine. The transition matrix consists of a dispatch table indexed
+ * by second number. Each entry in the table contains a case switch
+ * number and argument.
+ */
+struct progx {
+ int sw; /* case switch number */
+ int arg; /* argument */
+};
+
+/*
+ * Case switch numbers
+ */
+#define IDLE 0 /* no operation */
+#define COEF 1 /* BCD bit conditioned on DSYNC */
+#define COEF1 2 /* BCD bit */
+#define COEF2 3 /* BCD bit ignored */
+#define DECIM9 4 /* BCD digit 0-9 */
+#define DECIM6 5 /* BCD digit 0-6 */
+#define DECIM3 6 /* BCD digit 0-3 */
+#define DECIM2 7 /* BCD digit 0-2 */
+#define MSCBIT 8 /* miscellaneous bit */
+#define MSC20 9 /* miscellaneous bit */
+#define MSC21 10 /* QSY probe channel */
+#define MIN1 11 /* minute */
+#define MIN2 12 /* leap second */
+#define SYNC2 13 /* QSY data channel */
+#define SYNC3 14 /* QSY data channel */
+
+/*
+ * Offsets in decoding matrix
+ */
+#define MN 0 /* minute digits (2) */
+#define HR 2 /* hour digits (2) */
+#define DA 4 /* day digits (3) */
+#define YR 7 /* year digits (2) */
+
+struct progx progx[] = {
+ {SYNC2, 0}, /* 0 latch sync max */
+ {SYNC3, 0}, /* 1 QSY data channel */
+ {MSCBIT, DST2}, /* 2 dst2 */
+ {MSCBIT, SECWAR}, /* 3 lw */
+ {COEF, 0}, /* 4 1 year units */
+ {COEF, 1}, /* 5 2 */
+ {COEF, 2}, /* 6 4 */
+ {COEF, 3}, /* 7 8 */
+ {DECIM9, YR}, /* 8 */
+ {IDLE, 0}, /* 9 p1 */
+ {COEF1, 0}, /* 10 1 minute units */
+ {COEF1, 1}, /* 11 2 */
+ {COEF1, 2}, /* 12 4 */
+ {COEF1, 3}, /* 13 8 */
+ {DECIM9, MN}, /* 14 */
+ {COEF, 0}, /* 15 10 minute tens */
+ {COEF, 1}, /* 16 20 */
+ {COEF, 2}, /* 17 40 */
+ {COEF2, 3}, /* 18 80 (not used) */
+ {DECIM6, MN + 1}, /* 19 p2 */
+ {COEF, 0}, /* 20 1 hour units */
+ {COEF, 1}, /* 21 2 */
+ {COEF, 2}, /* 22 4 */
+ {COEF, 3}, /* 23 8 */
+ {DECIM9, HR}, /* 24 */
+ {COEF, 0}, /* 25 10 hour tens */
+ {COEF, 1}, /* 26 20 */
+ {COEF2, 2}, /* 27 40 (not used) */
+ {COEF2, 3}, /* 28 80 (not used) */
+ {DECIM2, HR + 1}, /* 29 p3 */
+ {COEF, 0}, /* 30 1 day units */
+ {COEF, 1}, /* 31 2 */
+ {COEF, 2}, /* 32 4 */
+ {COEF, 3}, /* 33 8 */
+ {DECIM9, DA}, /* 34 */
+ {COEF, 0}, /* 35 10 day tens */
+ {COEF, 1}, /* 36 20 */
+ {COEF, 2}, /* 37 40 */
+ {COEF, 3}, /* 38 80 */
+ {DECIM9, DA + 1}, /* 39 p4 */
+ {COEF, 0}, /* 40 100 day hundreds */
+ {COEF, 1}, /* 41 200 */
+ {COEF2, 2}, /* 42 400 (not used) */
+ {COEF2, 3}, /* 43 800 (not used) */
+ {DECIM3, DA + 2}, /* 44 */
+ {IDLE, 0}, /* 45 */
+ {IDLE, 0}, /* 46 */
+ {IDLE, 0}, /* 47 */
+ {IDLE, 0}, /* 48 */
+ {IDLE, 0}, /* 49 p5 */
+ {MSCBIT, DUTS}, /* 50 dut+- */
+ {COEF, 0}, /* 51 10 year tens */
+ {COEF, 1}, /* 52 20 */
+ {COEF, 2}, /* 53 40 */
+ {COEF, 3}, /* 54 80 */
+ {MSC20, DST1}, /* 55 dst1 */
+ {MSCBIT, DUT1}, /* 56 0.1 dut */
+ {MSCBIT, DUT2}, /* 57 0.2 */
+ {MSC21, DUT4}, /* 58 0.4 QSY probe channel */
+ {MIN1, 0}, /* 59 p6 latch sync min */
+ {MIN2, 0} /* 60 leap second */
+};
+
+/*
+ * BCD coefficients for maximum likelihood digit decode
+ */
+#define P15 1. /* max positive number */
+#define N15 -1. /* max negative number */
+
+/*
+ * Digits 0-9
+ */
+#define P9 (P15 / 4) /* mark (+1) */
+#define N9 (N15 / 4) /* space (-1) */
+
+double bcd9[][4] = {
+ {N9, N9, N9, N9}, /* 0 */
+ {P9, N9, N9, N9}, /* 1 */
+ {N9, P9, N9, N9}, /* 2 */
+ {P9, P9, N9, N9}, /* 3 */
+ {N9, N9, P9, N9}, /* 4 */
+ {P9, N9, P9, N9}, /* 5 */
+ {N9, P9, P9, N9}, /* 6 */
+ {P9, P9, P9, N9}, /* 7 */
+ {N9, N9, N9, P9}, /* 8 */
+ {P9, N9, N9, P9}, /* 9 */
+ {0, 0, 0, 0} /* backstop */
+};
+
+/*
+ * Digits 0-6 (minute tens)
+ */
+#define P6 (P15 / 3) /* mark (+1) */
+#define N6 (N15 / 3) /* space (-1) */
+
+double bcd6[][4] = {
+ {N6, N6, N6, 0}, /* 0 */
+ {P6, N6, N6, 0}, /* 1 */
+ {N6, P6, N6, 0}, /* 2 */
+ {P6, P6, N6, 0}, /* 3 */
+ {N6, N6, P6, 0}, /* 4 */
+ {P6, N6, P6, 0}, /* 5 */
+ {N6, P6, P6, 0}, /* 6 */
+ {0, 0, 0, 0} /* backstop */
+};
+
+/*
+ * Digits 0-3 (day hundreds)
+ */
+#define P3 (P15 / 2) /* mark (+1) */
+#define N3 (N15 / 2) /* space (-1) */
+
+double bcd3[][4] = {
+ {N3, N3, 0, 0}, /* 0 */
+ {P3, N3, 0, 0}, /* 1 */
+ {N3, P3, 0, 0}, /* 2 */
+ {P3, P3, 0, 0}, /* 3 */
+ {0, 0, 0, 0} /* backstop */
+};
+
+/*
+ * Digits 0-2 (hour tens)
+ */
+#define P2 (P15 / 2) /* mark (+1) */
+#define N2 (N15 / 2) /* space (-1) */
+
+double bcd2[][4] = {
+ {N2, N2, 0, 0}, /* 0 */
+ {P2, N2, 0, 0}, /* 1 */
+ {N2, P2, 0, 0}, /* 2 */
+ {0, 0, 0, 0} /* backstop */
+};
+
+/*
+ * DST decode (DST2 DST1) for prettyprint
+ */
+char dstcod[] = {
+ 'S', /* 00 standard time */
+ 'I', /* 01 daylight warning */
+ 'O', /* 10 standard warning */
+ 'D' /* 11 daylight time */
+};
+
+/*
+ * The decoding matrix consists of nine row vectors, one for each digit
+ * of the timecode. The digits are stored from least to most significant
+ * order. The maximum likelihood timecode is formed from the digits
+ * corresponding to the maximum likelihood values reading in the
+ * opposite order: yy ddd hh:mm.
+ */
+struct decvec {
+ int radix; /* radix (3, 4, 6, 10) */
+ int digit; /* current clock digit */
+ int mldigit; /* maximum likelihood digit */
+ int phase; /* maximum likelihood digit phase */
+ int count; /* match count */
+ double digprb; /* max digit probability */
+ double digsnr; /* likelihood function (dB) */
+ double like[10]; /* likelihood integrator 0-9 */
+};
+
+/*
+ * The station structure is used to acquire the minute pulse from WWV
+ * and/or WWVH. These stations are distinguished by the frequency used
+ * for the second and minute sync pulses, 1000 Hz for WWV and 1200 Hz
+ * for WWVH. Other than frequency, the format is the same.
+ */
+struct sync {
+ double amp; /* sync amplitude (I, Q square) */
+ double synamp; /* sync envelope at 800 ms */
+ double synmax; /* sync envelope at 0 s */
+ double synmin; /* avg sync envelope at 59 s, 1 s */
+ double synsnr; /* sync signal SNR */
+ double noise; /* max amplitude off pulse */
+ double sigmax; /* max amplitude on pulse */
+ double lastmax; /* last max amplitude on pulse */
+ long pos; /* position at maximum amplitude */
+ long lastpos; /* last position at maximum amplitude */
+ long jitter; /* shake, wiggle and waggle */
+ long mepoch; /* minute synch epoch */
+ int count; /* compare counter */
+ char refid[5]; /* reference identifier */
+ char ident[4]; /* station identifier */
+ int select; /* select bits */
+};
+
+/*
+ * The channel structure is used to mitigate between channels. At this
+ * point we have already decided which station to use.
+ */
+struct chan {
+ int gain; /* audio gain */
+ int errcnt; /* data bit error counter */
+ double noiamp; /* I-channel average noise amplitude */
+ struct sync wwv; /* wwv station */
+ struct sync wwvh; /* wwvh station */
+};
+
+/*
+ * WWV unit control structure
+ */
+struct wwvunit {
+ l_fp timestamp; /* audio sample timestamp */
+ l_fp tick; /* audio sample increment */
+ double comp[SIZE]; /* decompanding table */
+ double phase, freq; /* logical clock phase and frequency */
+ double monitor; /* audio monitor point */
+ int fd_icom; /* ICOM file descriptor */
+ int errflg; /* error flags */
+ int bufcnt; /* samples in buffer */
+ int bufptr; /* buffer index pointer */
+ int port; /* codec port */
+ int gain; /* codec gain */
+ int clipcnt; /* sample clipped count */
+ int seccnt; /* second countdown */
+ int minset; /* minutes since last clock set */
+ int watch; /* watchcat */
+ int swatch; /* second sync watchcat */
+
+ /*
+ * Variables used to establish basic system timing
+ */
+ int avgint; /* log2 master time constant (s) */
+ int epoch; /* second epoch ramp */
+ int repoch; /* receiver sync epoch */
+ int yepoch; /* transmitter sync epoch */
+ double epomax; /* second sync amplitude */
+ double irig; /* data I channel amplitude */
+ double qrig; /* data Q channel amplitude */
+ int datapt; /* 100 Hz ramp */
+ double datpha; /* 100 Hz VFO control */
+ int rphase; /* receiver sample counter */
+ int rsec; /* receiver seconds counter */
+ long mphase; /* minute sample counter */
+ long nepoch; /* minute epoch index */
+
+ /*
+ * Variables used to mitigate which channel to use
+ */
+ struct chan mitig[NCHAN]; /* channel data */
+ struct sync *sptr; /* station pointer */
+ int dchan; /* data channel */
+ int schan; /* probe channel */
+ int achan; /* active channel */
+
+ /*
+ * Variables used by the clock state machine
+ */
+ struct decvec decvec[9]; /* decoding matrix */
+ int cdelay; /* WWV propagation delay (samples) */
+ int hdelay; /* WVVH propagation delay (samples) */
+ int pdelay; /* propagation delay (samples) */
+ int tphase; /* transmitter sample counter */
+ int tsec; /* transmitter seconds counter */
+ int digcnt; /* count of digits synchronized */
+
+ /*
+ * Variables used to estimate signal levels and bit/digit
+ * probabilities
+ */
+ double sigamp; /* I-channel peak signal amplitude */
+ double noiamp; /* I-channel average noise amplitude */
+ double datsnr; /* data SNR (dB) */
+
+ /*
+ * Variables used to establish status and alarm conditions
+ */
+ int status; /* status bits */
+ int alarm; /* alarm flashers */
+ int misc; /* miscellaneous timecode bits */
+ int errcnt; /* data bit error counter */
+};
+
+/*
+ * Function prototypes
+ */
+static int wwv_start P((int, struct peer *));
+static void wwv_shutdown P((int, struct peer *));
+static void wwv_receive P((struct recvbuf *));
+static void wwv_poll P((int, struct peer *));
+
+/*
+ * More function prototypes
+ */
+static void wwv_epoch P((struct peer *));
+static void wwv_rf P((struct peer *, double));
+static void wwv_endpoc P((struct peer *, double, int));
+static void wwv_rsec P((struct peer *, double));
+static void wwv_qrz P((struct peer *, struct sync *,
+ double));
+static void wwv_corr4 P((struct peer *, struct decvec *,
+ double [], double [][4]));
+static void wwv_gain P((struct peer *));
+static void wwv_tsec P((struct wwvunit *));
+static double wwv_data P((struct wwvunit *, double));
+static int timecode P((struct wwvunit *, char *));
+static double wwv_snr P((double, double));
+static int carry P((struct decvec *));
+static void wwv_newchan P((struct peer *));
+static int wwv_qsy P((struct peer *, int));
+static double qsy[NCHAN] = {2.5, 5, 10, 15, 20}; /* frequencies (MHz) */
+
+/*
+ * Transfer vector
+ */
+struct refclock refclock_wwv = {
+ wwv_start, /* start up driver */
+ wwv_shutdown, /* shut down driver */
+ wwv_poll, /* transmit poll message */
+ noentry, /* not used (old wwv_control) */
+ noentry, /* initialize driver (not used) */
+ noentry, /* not used (old wwv_buginfo) */
+ NOFLAGS /* not used */
+};
+
+
+/*
+ * wwv_start - open the devices and initialize data for processing
+ */
+static int
+wwv_start(
+ int unit, /* instance number (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ struct chan *cp;
+#ifdef ICOM
+ int temp;
+#endif /* ICOM */
+
+ /*
+ * Local variables
+ */
+ int fd; /* file descriptor */
+ int i; /* index */
+ double step; /* codec adjustment */
+
+ /*
+ * Open audio device
+ */
+ fd = audio_init();
+ if (fd < 0)
+ return (0);
+#ifdef DEBUG
+ if (debug)
+ audio_show();
+#endif
+
+ /*
+ * Allocate and initialize unit structure
+ */
+ if (!(up = (struct wwvunit *)
+ emalloc(sizeof(struct wwvunit)))) {
+ (void) close(fd);
+ return (0);
+ }
+ memset((char *)up, 0, sizeof(struct wwvunit));
+ pp = peer->procptr;
+ pp->unitptr = (caddr_t)up;
+ pp->io.clock_recv = wwv_receive;
+ pp->io.srcclock = (caddr_t)peer;
+ pp->io.datalen = 0;
+ pp->io.fd = fd;
+ if (!io_addclock(&pp->io)) {
+ (void)close(fd);
+ free(up);
+ return (0);
+ }
+
+ /*
+ * Initialize miscellaneous variables
+ */
+ peer->precision = PRECISION;
+ pp->clockdesc = DESCRIPTION;
+ memcpy((char *)&pp->refid, REFID, 4);
+ DTOLFP(1. / SECOND, &up->tick);
+
+ /*
+ * The companded samples are encoded sign-magnitude. The table
+ * contains all the 256 values in the interest of speed.
+ */
+ up->comp[0] = up->comp[OFFSET] = 0.;
+ up->comp[1] = 1; up->comp[OFFSET + 1] = -1.;
+ up->comp[2] = 3; up->comp[OFFSET + 2] = -3.;
+ step = 2.;
+ for (i = 3; i < OFFSET; i++) {
+ up->comp[i] = up->comp[i - 1] + step;
+ up->comp[OFFSET + i] = -up->comp[i];
+ if (i % 16 == 0)
+ step *= 2.;
+ }
+
+ /*
+ * Initialize the decoding matrix with the radix for each digit
+ * position.
+ */
+ up->decvec[MN].radix = 10; /* minutes */
+ up->decvec[MN + 1].radix = 6;
+ up->decvec[HR].radix = 10; /* hours */
+ up->decvec[HR + 1].radix = 3;
+ up->decvec[DA].radix = 10; /* days */
+ up->decvec[DA + 1].radix = 10;
+ up->decvec[DA + 2].radix = 4;
+ up->decvec[YR].radix = 10; /* years */
+ up->decvec[YR + 1].radix = 10;
+
+ /*
+ * Initialize the station processes for audio gain, select bit,
+ * station/frequency identifier and reference identifier.
+ */
+ up->gain = 127;
+ for (i = 0; i < NCHAN; i++) {
+ cp = &up->mitig[i];
+ cp->gain = up->gain;
+ cp->wwv.select = SELV;
+ strcpy(cp->wwv.refid, "WWV ");
+ sprintf(cp->wwv.ident,"C%.0f", floor(qsy[i]));
+ cp->wwvh.select = SELH;
+ strcpy(cp->wwvh.refid, "WWVH");
+ sprintf(cp->wwvh.ident, "H%.0f", floor(qsy[i]));
+ }
+
+ /*
+ * Initialize autotune if available. Start out at 15 MHz. Note
+ * that the ICOM select code must be less than 128, so the high
+ * order bit can be used to select the line speed.
+ */
+#ifdef ICOM
+ temp = 0;
+#ifdef DEBUG
+ if (debug > 1)
+ temp = P_TRACE;
+#endif
+ if (peer->ttl != 0) {
+ if (peer->ttl & 0x80)
+ up->fd_icom = icom_init("/dev/icom", B1200,
+ temp);
+ else
+ up->fd_icom = icom_init("/dev/icom", B9600,
+ temp);
+ }
+ if (up->fd_icom > 0) {
+ up->schan = 3;
+ if ((temp = wwv_qsy(peer, up->schan)) < 0) {
+ NLOG(NLOG_SYNCEVENT | NLOG_SYSEVENT)
+ msyslog(LOG_ERR,
+ "ICOM bus error; autotune disabled");
+ up->errflg = CEVNT_FAULT;
+ close(up->fd_icom);
+ up->fd_icom = 0;
+ }
+ }
+#endif /* ICOM */
+ return (1);
+}
+
+
+/*
+ * wwv_shutdown - shut down the clock
+ */
+static void
+wwv_shutdown(
+ int unit, /* instance number (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+
+ pp = peer->procptr;
+ up = (struct wwvunit *)pp->unitptr;
+ io_closeclock(&pp->io);
+ if (up->fd_icom > 0)
+ close(up->fd_icom);
+ free(up);
+}
+
+
+/*
+ * wwv_receive - receive data from the audio device
+ *
+ * This routine reads input samples and adjusts the logical clock to
+ * track the A/D sample clock by dropping or duplicating codec samples.
+ * It also controls the A/D signal level with an AGC loop to mimimize
+ * quantization noise and avoid overload.
+ */
+static void
+wwv_receive(
+ struct recvbuf *rbufp /* receive buffer structure pointer */
+ )
+{
+ struct peer *peer;
+ struct refclockproc *pp;
+ struct wwvunit *up;
+
+ /*
+ * Local variables
+ */
+ double sample; /* codec sample */
+ u_char *dpt; /* buffer pointer */
+ l_fp ltemp;
+ int isneg;
+ double dtemp;
+ int i, j;
+
+ peer = (struct peer *)rbufp->recv_srcclock;
+ pp = peer->procptr;
+ up = (struct wwvunit *)pp->unitptr;
+
+ /*
+ * Main loop - read until there ain't no more. Note codec
+ * samples are bit-inverted.
+ */
+ up->timestamp = rbufp->recv_time;
+ up->bufcnt = rbufp->recv_length;
+ DTOLFP((double)up->bufcnt / SECOND, &ltemp);
+ L_SUB(&up->timestamp, &ltemp);
+ dpt = rbufp->recv_buffer;
+ for (up->bufptr = 0; up->bufptr < up->bufcnt; up->bufptr++) {
+ sample = up->comp[~*dpt & 0xff];
+
+ /*
+ * Clip noise spikes greater than MAXSIG. If no clips,
+ * increase the gain a tad; if the clips are too high,
+ * decrease a tad.
+ */
+ if (sample > MAXSIG) {
+ sample = MAXSIG;
+ up->clipcnt++;
+ } else if (sample < -MAXSIG) {
+ sample = -MAXSIG;
+ up->clipcnt++;
+ }
+
+ /*
+ * Variable frequency oscillator. A phase change of one
+ * unit produces a change of 360 degrees; a frequency
+ * change of one unit produces a change of 1 Hz.
+ */
+ up->phase += up->freq / SECOND;
+ if (up->phase >= .5) {
+ up->phase -= 1.;
+ } else if (up->phase < - .5) {
+ up->phase += 1.;
+ wwv_rf(peer, sample);
+ wwv_rf(peer, sample);
+ } else {
+ wwv_rf(peer, sample);
+ }
+ L_ADD(&up->timestamp, &up->tick);
+
+ /*
+ * Once each second adjust the codec port and gain.
+ * While at it, initialize the propagation delay for
+ * both WWV and WWVH. Don't forget to correct for the
+ * receiver phase delay, mostly due to the 600-Hz
+ * IIR bandpass filter used for the sync signals.
+ */
+ up->cdelay = (int)(SECOND * (pp->fudgetime1 + PDELAY));
+ up->hdelay = (int)(SECOND * (pp->fudgetime2 + PDELAY));
+ up->seccnt = (up->seccnt + 1) % SECOND;
+ if (up->seccnt == 0) {
+ if (pp->sloppyclockflag & CLK_FLAG2)
+ up->port = 2;
+ else
+ up->port = 1;
+ }
+
+ /*
+ * During development, it is handy to have an audio
+ * monitor that can be switched to various signals. This
+ * code converts the linear signal left in up->monitor
+ * to codec format.
+ */
+ isneg = 0;
+ dtemp = up->monitor;
+ if (sample < 0) {
+ isneg = 1;
+ dtemp -= dtemp;
+ }
+ i = 0;
+ j = OFFSET >> 1;
+ while (j != 0) {
+ if (dtemp > up->comp[i])
+ i += j;
+ else if (dtemp < up->comp[i])
+ i -= j;
+ else
+ break;
+ j >>= 1;
+ }
+ if (isneg)
+ *dpt = ~(i + OFFSET);
+ else
+ *dpt = ~i;
+ dpt++;
+ }
+
+ /*
+ * Squawk to the monitor speaker if enabled.
+ */
+ if (pp->sloppyclockflag & CLK_FLAG3)
+ if (write(pp->io.fd, (u_char *)&rbufp->recv_space,
+ (u_int)up->bufcnt) < 0)
+ perror("wwv:");
+}
+
+
+/*
+ * wwv_poll - called by the transmit procedure
+ *
+ * This routine keeps track of status. If nothing is heard for two
+ * successive poll intervals, a timeout event is declared and any
+ * orphaned timecode updates are sent to foster care. Once the clock is
+ * set, it always appears reachable, unless reset by watchdog timeout.
+ */
+static void
+wwv_poll(
+ int unit, /* instance number (not used) */
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+
+ pp = peer->procptr;
+ up = (struct wwvunit *)pp->unitptr;
+ if (pp->coderecv == pp->codeproc)
+ up->errflg = CEVNT_TIMEOUT;
+ else
+ pp->polls++;
+ if (up->status & INSYNC)
+ peer->reach |= 1;
+ if (up->errflg)
+ refclock_report(peer, up->errflg);
+ up->errflg = 0;
+}
+
+
+/*
+ * wwv_rf - process signals and demodulate to baseband
+ *
+ * This routine grooms and filters decompanded raw audio samples. The
+ * output signals include the 100-Hz baseband data signal in quadrature
+ * form, plus the epoch index of the second sync signal and the second
+ * index of the minute sync signal.
+ *
+ * There are three 1-s ramps used by this program, all spanning the
+ * range 0-7999 logical samples for exactly one second, as determined by
+ * the logical clock. The first drives the second epoch and runs
+ * continuously. The second determines the receiver phase and the third
+ * the transmitter phase within the second. The receiver second begins
+ * upon arrival of the 5-ms second sync pulse which begins the second;
+ * while the transmitter second begins before it by the specified
+ * propagation delay.
+ *
+ * There are three 1-m ramps spanning the range 0-59 seconds. The first
+ * drives the minute epoch in samples and runs continuously. The second
+ * determines the receiver second and the third the transmitter second.
+ * The receiver second begins upon arrival of the 800-ms sync pulse sent
+ * during the first second of the minute; while the transmitter second
+ * begins before it by the specified propagation delay.
+ *
+ * The output signals include the epoch maximum and phase and second
+ * maximum and index. The epoch phase provides the master reference for
+ * all signal and timing functions, while the second index identifies
+ * the first second of the minute. The epoch and second maxima are used
+ * to calculate SNR for gating functions.
+ *
+ * Demodulation operations are based on three synthesized quadrature
+ * sinusoids: 100 Hz for the data subcarrier, 1000 Hz for the WWV sync
+ * signals and 1200 Hz for the WWVH sync signal. These drive synchronous
+ * matched filters for the data subcarrier (170 ms at 100 Hz), WWV
+ * minute sync signal (800 ms at 1000 Hz) and WWVH minute sync signal
+ * (800 ms at 1200 Hz). Two additional matched filters are switched in
+ * as required for the WWV seconds sync signal (5 ms at 1000 Hz) and
+ * WWVH seconds sync signal (5 ms at 1200 Hz).
+ */
+static void
+wwv_rf(
+ struct peer *peer, /* peerstructure pointer */
+ double isig /* input signal */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+
+ static double lpf[5]; /* 150-Hz lpf delay line */
+ double data; /* lpf output */
+ static double bpf[9]; /* 1000/1200-Hz bpf delay line */
+ double syncx; /* bpf output */
+ static double mf[41]; /* 1000/1200-Hz mf delay line */
+ double mfsync; /* mf output */
+
+ static int iptr; /* data channel pointer */
+ static double ibuf[DATSIZ]; /* data I channel delay line */
+ static double qbuf[DATSIZ]; /* data Q channel delay line */
+
+ static int jptr; /* sync channel pointer */
+ static double cibuf[SYNSIZ]; /* wwv I channel delay line */
+ static double cqbuf[SYNSIZ]; /* wwv Q channel delay line */
+ static double ciamp; /* wwv I channel amplitude */
+ static double cqamp; /* wwv Q channel amplitude */
+ static int csinptr; /* wwv channel phase */
+ static double hibuf[SYNSIZ]; /* wwvh I channel delay line */
+ static double hqbuf[SYNSIZ]; /* wwvh Q channel delay line */
+ static double hiamp; /* wwvh I channel amplitude */
+ static double hqamp; /* wwvh Q channel amplitude */
+ static int hsinptr; /* wwvh channels phase */
+
+ static double epobuf[SECOND]; /* epoch sync comb filter */
+ static double epomax; /* epoch sync amplitude buffer */
+ static int epopos; /* epoch sync position buffer */
+
+ static int iniflg; /* initialization flag */
+ struct sync *sp;
+ double dtemp;
+ long ltemp;
+ int i;
+
+ pp = peer->procptr;
+ up = (struct wwvunit *)pp->unitptr;
+ if (!iniflg) {
+ iniflg = 1;
+ memset((char *)lpf, 0, sizeof(lpf));
+ memset((char *)bpf, 0, sizeof(bpf));
+ memset((char *)mf, 0, sizeof(mf));
+ memset((char *)ibuf, 0, sizeof(ibuf));
+ memset((char *)qbuf, 0, sizeof(qbuf));
+ memset((char *)cibuf, 0, sizeof(cibuf));
+ memset((char *)cqbuf, 0, sizeof(cqbuf));
+ memset((char *)hibuf, 0, sizeof(hibuf));
+ memset((char *)hqbuf, 0, sizeof(hqbuf));
+ memset((char *)epobuf, 0, sizeof(epobuf));
+ }
+ up->monitor = isig; /* change for debug */
+
+ /*
+ * Baseband data demodulation. The 100-Hz subcarrier is
+ * extracted using a 150-Hz IIR lowpass filter. This attenuates
+ * the 1000/1200-Hz sync signals, as well as the 440-Hz and
+ * 600-Hz tones and most of the noise and voice modulation
+ * components.
+ *
+ * Matlab IIR 4th-order IIR elliptic, 150 Hz lowpass, 0.2 dB
+ * passband ripple, -50 dB stopband ripple.
+ */
+ data = (lpf[4] = lpf[3]) * 8.360961e-01;
+ data += (lpf[3] = lpf[2]) * -3.481740e+00;
+ data += (lpf[2] = lpf[1]) * 5.452988e+00;
+ data += (lpf[1] = lpf[0]) * -3.807229e+00;
+ lpf[0] = isig - data;
+ data = lpf[0] * 3.281435e-03
+ + lpf[1] * -1.149947e-02
+ + lpf[2] * 1.654858e-02
+ + lpf[3] * -1.149947e-02
+ + lpf[4] * 3.281435e-03;
+
+ /*
+ * The I and Q quadrature data signals are produced by
+ * multiplying the filtered signal by 100-Hz sine and cosine
+ * signals, respectively. The data signals are demodulated by
+ * 170-ms synchronous matched filters to produce the amplitude
+ * and phase signals used by the decoder. Note the correction
+ * due to the propagation delay is necessary for seamless
+ * handover between WWV and WWVH.
+ */
+ i = up->datapt - up->pdelay % 80;
+ if (i < 0)
+ i += 80;
+ up->datapt = (up->datapt + IN100) % 80;
+ dtemp = sintab[i] * data / DATSIZ * DGAIN;
+ up->irig -= ibuf[iptr];
+ ibuf[iptr] = dtemp;
+ up->irig += dtemp;
+ i = (i + 20) % 80;
+ dtemp = sintab[i] * data / DATSIZ * DGAIN;
+ up->qrig -= qbuf[iptr];
+ qbuf[iptr] = dtemp;
+ up->qrig += dtemp;
+ iptr = (iptr + 1) % DATSIZ;
+
+ /*
+ * Baseband sync demodulation. The 1000/1200 sync signals are
+ * extracted using a 600-Hz IIR bandpass filter. This removes
+ * the 100-Hz data subcarrier, as well as the 440-Hz and 600-Hz
+ * tones and most of the noise and voice modulation components.
+ *
+ * Matlab 4th-order IIR elliptic, 800-1400 Hz bandpass, 0.2 dB
+ * passband ripple, -50 dB stopband ripple.
+ */
+ syncx = (bpf[8] = bpf[7]) * 4.897278e-01;
+ syncx += (bpf[7] = bpf[6]) * -2.765914e+00;
+ syncx += (bpf[6] = bpf[5]) * 8.110921e+00;
+ syncx += (bpf[5] = bpf[4]) * -1.517732e+01;
+ syncx += (bpf[4] = bpf[3]) * 1.975197e+01;
+ syncx += (bpf[3] = bpf[2]) * -1.814365e+01;
+ syncx += (bpf[2] = bpf[1]) * 1.159783e+01;
+ syncx += (bpf[1] = bpf[0]) * -4.735040e+00;
+ bpf[0] = isig - syncx;
+ syncx = bpf[0] * 8.203628e-03
+ + bpf[1] * -2.375732e-02
+ + bpf[2] * 3.353214e-02
+ + bpf[3] * -4.080258e-02
+ + bpf[4] * 4.605479e-02
+ + bpf[5] * -4.080258e-02
+ + bpf[6] * 3.353214e-02
+ + bpf[7] * -2.375732e-02
+ + bpf[8] * 8.203628e-03;
+
+ /*
+ * The I and Q quadrature minute sync signals are produced by
+ * multiplying the filtered signal by 1000-Hz (WWV) and 1200-Hz
+ * (WWVH) sine and cosine signals, respectively. The resulting
+ * signals are demodulated by 800-ms synchronous matched filters
+ * to synchronize the second and minute and to detect which one
+ * (or both) the WWV or WWVH signal is present.
+ */
+ up->mphase = (up->mphase + 1) % MINUTE;
+
+ i = csinptr;
+ csinptr = (csinptr + IN1000) % 80;
+ dtemp = sintab[i] * syncx / SYNSIZ * SGAIN;
+ ciamp = ciamp - cibuf[jptr] + dtemp;
+ cibuf[jptr] = dtemp;
+ i = (i + 20) % 80;
+ dtemp = sintab[i] * syncx / SYNSIZ * SGAIN;
+ cqamp = cqamp - cqbuf[jptr] + dtemp;
+ cqbuf[jptr] = dtemp;
+ dtemp = ciamp * ciamp + cqamp * cqamp;
+ wwv_qrz(peer, &up->mitig[up->schan].wwv, dtemp);
+
+ i = hsinptr;
+ hsinptr = (hsinptr + IN1200) % 80;
+ dtemp = sintab[i] * syncx / SYNSIZ * SGAIN;
+ hiamp = hiamp - hibuf[jptr] + dtemp;
+ hibuf[jptr] = dtemp;
+ i = (i + 20) % 80;
+ dtemp = sintab[i] * syncx / SYNSIZ * SGAIN;
+ hqamp = hqamp - hqbuf[jptr] + dtemp;
+ hqbuf[jptr] = dtemp;
+ dtemp = hiamp * hiamp + hqamp * hqamp;
+ wwv_qrz(peer, &up->mitig[up->schan].wwvh, dtemp);
+
+ jptr = (jptr + 1) % SYNSIZ;
+
+ if (up->mphase == 0) {
+
+ /*
+ * This section is called once per minute at the minute
+ * epoch independently of the transmitter or receiver
+ * minute. If the leap bit is set, set the minute epoch
+ * back one second so the station processes don't miss a
+ * beat. Then, increment the watchdog counter and test
+ * for two sets of conditions depending on whether
+ * minute sync has been acquired or not.
+ */
+ up->watch++;
+ if (up->rsec == 60) {
+ up->mphase -= SECOND;
+ if (up->mphase < 0)
+ up->mphase += MINUTE;
+ } else if (!(up->status & MSYNC)) {
+
+ /*
+ * If minute sync has not been acquired, the
+ * program listens for minute sync pulses from
+ * both WWV and WWVH. The station with the
+ * greater compare count is selected, with ties
+ * broken by WWV, but only if the count is at
+ * least three. Once a station has been
+ * acquired, it is initialized and begins
+ * tracking the signal.
+ */
+ if (up->mitig[up->achan].wwv.count >=
+ up->mitig[up->achan].wwvh.count)
+ sp = &up->mitig[up->achan].wwv;
+ else
+ sp = &up->mitig[up->achan].wwvh;
+ if (sp->count >= AMIN) {
+ up->watch = up->swatch = 0;
+ up->status |= MSYNC;
+ ltemp = sp->mepoch - SYNSIZ;
+ if (ltemp < 0)
+ ltemp += MINUTE;
+ up->rsec = (MINUTE - ltemp) / SECOND;
+ if (!(up->status & SSYNC)) {
+ up->repoch = ltemp % SECOND;
+ up->yepoch = up->repoch -
+ up->pdelay;
+ if (up->yepoch < 0)
+ up->yepoch += SECOND;
+ }
+ wwv_newchan(peer);
+ } else if (sp->count == 0 || up->watch >= ACQSN)
+ {
+ up->watch = sp->count = 0;
+ up->schan = (up->schan + 1) % NCHAN;
+ wwv_qsy(peer, up->schan);
+ }
+ } else {
+
+ /*
+ * If minute sync has been acquired, the program
+ * watches for timeout. The timeout is reset
+ * when the clock is set or verified. If a
+ * timeout occurs and the minute units digit has
+ * not synchronized, reset the program and start
+ * over.
+ */
+ if (up->watch > DIGIT && !(up->status & DSYNC))
+ up->watch = up->status = 0;
+
+ /*
+ * If the second sync times out, dim the sync
+ * lamp and raise an alarm.
+ */
+ up->swatch++;
+ if (up->swatch > HSPEC)
+ up->status &= ~SSYNC;
+ if (!(up->status & SSYNC))
+ up->alarm |= 1 << SYNERR;
+ }
+ }
+
+ /*
+ * The second sync pulse is extracted using 5-ms FIR matched
+ * filters at 1000 Hz for WWV or 1200 Hz for WWVH. This pulse is
+ * used for the most precise synchronization, since if provides
+ * a resolution of one sample (125 us).
+ */
+ if (up->status & SELV) {
+ up->pdelay = up->cdelay;
+
+ /*
+ * WWV FIR matched filter, five cycles of 1000-Hz
+ * sinewave.
+ */
+ mf[40] = mf[39];
+ mfsync = (mf[39] = mf[38]) * 4.224514e-02;
+ mfsync += (mf[38] = mf[37]) * 5.974365e-02;
+ mfsync += (mf[37] = mf[36]) * 4.224514e-02;
+ mf[36] = mf[35];
+ mfsync += (mf[35] = mf[34]) * -4.224514e-02;
+ mfsync += (mf[34] = mf[33]) * -5.974365e-02;
+ mfsync += (mf[33] = mf[32]) * -4.224514e-02;
+ mf[32] = mf[31];
+ mfsync += (mf[31] = mf[30]) * 4.224514e-02;
+ mfsync += (mf[30] = mf[29]) * 5.974365e-02;
+ mfsync += (mf[29] = mf[28]) * 4.224514e-02;
+ mf[28] = mf[27];
+ mfsync += (mf[27] = mf[26]) * -4.224514e-02;
+ mfsync += (mf[26] = mf[25]) * -5.974365e-02;
+ mfsync += (mf[25] = mf[24]) * -4.224514e-02;
+ mf[24] = mf[23];
+ mfsync += (mf[23] = mf[22]) * 4.224514e-02;
+ mfsync += (mf[22] = mf[21]) * 5.974365e-02;
+ mfsync += (mf[21] = mf[20]) * 4.224514e-02;
+ mf[20] = mf[19];
+ mfsync += (mf[19] = mf[18]) * -4.224514e-02;
+ mfsync += (mf[18] = mf[17]) * -5.974365e-02;
+ mfsync += (mf[17] = mf[16]) * -4.224514e-02;
+ mf[16] = mf[15];
+ mfsync += (mf[15] = mf[14]) * 4.224514e-02;
+ mfsync += (mf[14] = mf[13]) * 5.974365e-02;
+ mfsync += (mf[13] = mf[12]) * 4.224514e-02;
+ mf[12] = mf[11];
+ mfsync += (mf[11] = mf[10]) * -4.224514e-02;
+ mfsync += (mf[10] = mf[9]) * -5.974365e-02;
+ mfsync += (mf[9] = mf[8]) * -4.224514e-02;
+ mf[8] = mf[7];
+ mfsync += (mf[7] = mf[6]) * 4.224514e-02;
+ mfsync += (mf[6] = mf[5]) * 5.974365e-02;
+ mfsync += (mf[5] = mf[4]) * 4.224514e-02;
+ mf[4] = mf[3];
+ mfsync += (mf[3] = mf[2]) * -4.224514e-02;
+ mfsync += (mf[2] = mf[1]) * -5.974365e-02;
+ mfsync += (mf[1] = mf[0]) * -4.224514e-02;
+ mf[0] = syncx;
+ } else if (up->status & SELH) {
+ up->pdelay = up->hdelay;
+
+ /*
+ * WWVH FIR matched filter, six cycles of 1200-Hz
+ * sinewave.
+ */
+ mf[40] = mf[39];
+ mfsync = (mf[39] = mf[38]) * 4.833363e-02;
+ mfsync += (mf[38] = mf[37]) * 5.681959e-02;
+ mfsync += (mf[37] = mf[36]) * 1.846180e-02;
+ mfsync += (mf[36] = mf[35]) * -3.511644e-02;
+ mfsync += (mf[35] = mf[34]) * -5.974365e-02;
+ mfsync += (mf[34] = mf[33]) * -3.511644e-02;
+ mfsync += (mf[33] = mf[32]) * 1.846180e-02;
+ mfsync += (mf[32] = mf[31]) * 5.681959e-02;
+ mfsync += (mf[31] = mf[30]) * 4.833363e-02;
+ mf[30] = mf[29];
+ mfsync += (mf[29] = mf[28]) * -4.833363e-02;
+ mfsync += (mf[28] = mf[27]) * -5.681959e-02;
+ mfsync += (mf[27] = mf[26]) * -1.846180e-02;
+ mfsync += (mf[26] = mf[25]) * 3.511644e-02;
+ mfsync += (mf[25] = mf[24]) * 5.974365e-02;
+ mfsync += (mf[24] = mf[23]) * 3.511644e-02;
+ mfsync += (mf[23] = mf[22]) * -1.846180e-02;
+ mfsync += (mf[22] = mf[21]) * -5.681959e-02;
+ mfsync += (mf[21] = mf[20]) * -4.833363e-02;
+ mf[20] = mf[19];
+ mfsync += (mf[19] = mf[18]) * 4.833363e-02;
+ mfsync += (mf[18] = mf[17]) * 5.681959e-02;
+ mfsync += (mf[17] = mf[16]) * 1.846180e-02;
+ mfsync += (mf[16] = mf[15]) * -3.511644e-02;
+ mfsync += (mf[15] = mf[14]) * -5.974365e-02;
+ mfsync += (mf[14] = mf[13]) * -3.511644e-02;
+ mfsync += (mf[13] = mf[12]) * 1.846180e-02;
+ mfsync += (mf[12] = mf[11]) * 5.681959e-02;
+ mfsync += (mf[11] = mf[10]) * 4.833363e-02;
+ mf[10] = mf[9];
+ mfsync += (mf[9] = mf[8]) * -4.833363e-02;
+ mfsync += (mf[8] = mf[7]) * -5.681959e-02;
+ mfsync += (mf[7] = mf[6]) * -1.846180e-02;
+ mfsync += (mf[6] = mf[5]) * 3.511644e-02;
+ mfsync += (mf[5] = mf[4]) * 5.974365e-02;
+ mfsync += (mf[4] = mf[3]) * 3.511644e-02;
+ mfsync += (mf[3] = mf[2]) * -1.846180e-02;
+ mfsync += (mf[2] = mf[1]) * -5.681959e-02;
+ mfsync += (mf[1] = mf[0]) * -4.833363e-02;
+ mf[0] = syncx;
+ } else {
+ mfsync = 0;
+ }
+
+ /*
+ * Extract the seconds sync pulse using a 1-s comb filter at
+ * baseband. Correct for the FIR matched filter delay, which is
+ * 5 ms for both the WWV and WWVH filters. Blank the signal when
+ * probing.
+ */
+ up->epoch = (up->epoch + 1) % SECOND;
+ if (up->epoch == 0) {
+ wwv_endpoc(peer, epomax, epopos);
+ up->epomax = epomax;
+ epomax = 0;
+ if (!(up->status & MSYNC))
+ wwv_gain(peer);
+ }
+ dtemp = (epobuf[up->epoch] += (mfsync - epobuf[up->epoch]) /
+ (MINAVG << up->avgint));
+ if (dtemp > epomax) {
+ epomax = dtemp;
+ epopos = up->epoch - up->pdelay - 5 * MS;
+ if (epopos < 0)
+ epopos += SECOND;
+ }
+ if (up->status & MSYNC)
+ wwv_epoch(peer);
+}
+
+
+/*
+ * wwv_qrz - identify and acquire WWV/WWVH minute sync pulse
+ *
+ * This routine implements a virtual station process used to acquire
+ * minute sync and to mitigate among the ten frequency and station
+ * combinations. During minute sync acquisition, the process probes each
+ * frequency in turn for the minute pulse from either station, which
+ * involves searching through the entire epoch minute of samples. After
+ * minute sync acquisition, the process searches only during the probe
+ * window, which occupies seconds 59, 0 and 1, to construct a metric
+ * used to determine which frequency and station provides the best
+ * signal.
+ *
+ * The pulse discriminator requires that (a) the peak on-pulse sample
+ * amplitude must be above 2000, (b) the SNR relative to the peak
+ * off-pulse sample amplitude must be reduced 6 dB or more below the
+ * peak and (c) the maximum difference between the current and previous
+ * epoch indices must be less than 50 ms. A compare counter keeps track
+ * of the number of successive intervals which satisfy these criteria.
+ *
+ * Students of radar receiver technology will discover this algorithm
+ * amounts to a range gate discriminator. In practice, the performance
+ * of this gadget is amazing. Once setting teeth in a station, it hangs
+ * on until the minute beep can barely be heard and long after the
+ * second tick and comb filter have given up.
+ */
+static void
+wwv_qrz(
+ struct peer *peer, /* peerstructure pointer */
+ struct sync *sp, /* sync channel structure */
+ double syncx /* bandpass filtered sync signal */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ char tbuf[80]; /* monitor buffer */
+ double snr; /* on-pulse/off-pulse ratio (dB) */
+ long epoch;
+ int isgood;
+
+ pp = peer->procptr;
+ up = (struct wwvunit *)pp->unitptr;
+
+ /*
+ * Find the sample with peak energy, which defines the minute
+ * epoch. If minute sync has been acquired, search only the
+ * probe window; otherwise, search the entire minute. If a
+ * maximum has been found with good amplitude, search only the
+ * second before and after that position for the next maximum
+ * and the rest of the window for the noise.
+ */
+ if (!(up->status & MSYNC) || up->status & SFLAG) {
+ sp->amp = syncx;
+ if (up->status & MSYNC)
+ epoch = up->nepoch;
+ else if (sp->count > 1)
+ epoch = sp->mepoch;
+ else
+ epoch = sp->lastpos;
+ if (syncx > sp->sigmax) {
+ sp->sigmax = syncx;
+ sp->pos = up->mphase;
+ }
+ if (abs(MOD(up->mphase - epoch, MINUTE)) > SYNSIZ &&
+ syncx > sp->noise) {
+ sp->noise = syncx;
+ }
+ }
+ if (up->mphase == 0) {
+
+ /*
+ * At the end of the minute, determine the epoch of the
+ * sync pulse, as well as the SNR and difference between
+ * the current and previous epoch (jitter).
+ */
+ sp->jitter = MOD(sp->pos - sp->lastpos, MINUTE);
+ sp->select &= ~JITRNG;
+ if (abs(sp->jitter) > AWND * MS)
+ sp->select |= JITRNG;
+ sp->sigmax = sqrt(sp->sigmax);
+ sp->noise = sqrt(sp->noise);
+ if (up->status & MSYNC) {
+
+ /*
+ * If in minute sync, just count the runs up and
+ * down.
+ */
+ if (sp->select & (DATANG | SYNCNG | JITRNG)) {
+ if (sp->count > 0)
+ sp->count--;
+ } else {
+ if (sp->count < AMAX)
+ sp->count++;
+ }
+ } else {
+
+ /*
+ * If not yet in minute sync, we have to do a
+ * little dance to find a valid minute sync
+ * pulse, emphasis valid.
+ */
+ snr = wwv_snr(sp->sigmax, sp->noise);
+ isgood = sp->sigmax > ATHR && snr > ASNR &&
+ !(sp->select & JITRNG);
+ switch (sp->count) {
+
+ /*
+ * In state 0 the station was not heard during
+ * the previous probe. Look for the biggest blip
+ * greater than the amplitude threshold in the
+ * minute and assume that the minute sync pulse.
+ * If found, bump to state 1.
+ */
+ case 0:
+ if (sp->sigmax >= ATHR)
+ sp->count++;
+ break;
+
+ /*
+ * In state 1 a candidate blip has been found
+ * and the next minute has been searched for
+ * another blip. If none are found greater than
+ * the threshold, or if the biggest blip outside
+ * the candidate pulse is less than 6 dB below
+ * the biggest blip, drop back to state 0 and
+ * hunt some more. Otherwise, a legitimate
+ * minute pulse may have been found, so bump to
+ * state 2.
+ */
+ case 1:
+ if (sp->sigmax < ATHR) {
+ sp->count--;
+ break;
+ } else if (!isgood) {
+ break;
+ }
+ /* fall through */
+
+ /*
+ * In states 2 and above, continue to groom
+ * samples as before and drop back to the
+ * previous state if the groom fails. If it
+ * succeeds, bump to the next state until
+ * reaching the clamp, if ever.
+ */
+ default:
+ if (!isgood) {
+ sp->count--;
+ break;
+ }
+ sp->mepoch = sp->pos;
+ if (sp->count < AMAX)
+ sp->count++;
+ break;
+ }
+ sprintf(tbuf,
+ "wwv8 %d %3d %-3s %d %5.0f %5.1f %7ld %7ld %7ld",
+ up->port, up->gain, sp->ident, sp->count,
+ sp->sigmax, snr, sp->pos, sp->jitter,
+ MOD(sp->pos - up->nepoch - SYNSIZ, MINUTE));
+ if (pp->sloppyclockflag & CLK_FLAG4)
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif
+ }
+ sp->lastmax = sp->sigmax;
+ sp->lastpos = sp->pos;
+ sp->sigmax = sp->noise = 0;
+ }
+}
+
+
+/*
+ * wwv_endpoc - process receiver epoch
+ *
+ * This routine is called at the end of the receiver epoch. It
+ * determines the epoch position within the second and disciplines the
+ * sample clock using a frequency-lock loop (FLL).
+ *
+ * Seconds sync is determined in the RF input routine as the maximum
+ * over all 8000 samples in the second comb filter. To assure accurate
+ * and reliable time and frequency discipline, this routine performs a
+ * great deal of heavy-handed data filtering and grooming.
+ */
+static void
+wwv_endpoc(
+ struct peer *peer, /* peer structure pointer */
+ double epomax, /* epoch max */
+ int epopos /* epoch max position */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+
+ static int epoch_mf[3]; /* epoch median filter */
+ static int tepoch; /* median filter epoch */
+ static int tspan; /* median filter span */
+ static int xepoch; /* last second epoch */
+ static int zepoch; /* last averaging interval epoch */
+ static int syncnt; /* second epoch run length counter */
+ static int jitcnt; /* jitter holdoff counter */
+ static int avgcnt; /* averaging interval counter */
+ static int avginc; /* averaging ratchet */
+
+ static int iniflg; /* initialization flag */
+ char tbuf[80]; /* monitor buffer */
+ double dtemp;
+ int tmp2, tmp3;
+
+ pp = peer->procptr;
+ up = (struct wwvunit *)pp->unitptr;
+ if (!iniflg) {
+ iniflg = 1;
+ memset((char *)epoch_mf, 0, sizeof(epoch_mf));
+ }
+
+ /*
+ * A three-stage median filter is used to help denoise the
+ * seconds sync pulse. The median sample becomes the candidate
+ * epoch; the difference between the other two samples becomes
+ * the span, which is used currently only for debugging.
+ */
+ epoch_mf[2] = epoch_mf[1];
+ epoch_mf[1] = epoch_mf[0];
+ epoch_mf[0] = epopos;
+ if (epoch_mf[0] > epoch_mf[1]) {
+ if (epoch_mf[1] > epoch_mf[2]) {
+ tepoch = epoch_mf[1]; /* 0 1 2 */
+ tspan = epoch_mf[0] - epoch_mf[2];
+ } else if (epoch_mf[2] > epoch_mf[0]) {
+ tepoch = epoch_mf[0]; /* 2 0 1 */
+ tspan = epoch_mf[2] - epoch_mf[1];
+ } else {
+ tepoch = epoch_mf[2]; /* 0 2 1 */
+ tspan = epoch_mf[0] - epoch_mf[1];
+ }
+ } else {
+ if (epoch_mf[1] < epoch_mf[2]) {
+ tepoch = epoch_mf[1]; /* 2 1 0 */
+ tspan = epoch_mf[2] - epoch_mf[0];
+ } else if (epoch_mf[2] < epoch_mf[0]) {
+ tepoch = epoch_mf[0]; /* 1 0 2 */
+ tspan = epoch_mf[1] - epoch_mf[2];
+ } else {
+ tepoch = epoch_mf[2]; /* 1 2 0 */
+ tspan = epoch_mf[1] - epoch_mf[0];
+ }
+ }
+
+ /*
+ * If the epoch candidate is within 1 ms of the last one, the
+ * new candidate replaces the last one and the jitter counter is
+ * reset; otherwise, the candidate is ignored and the jitter
+ * counter is incremented. If the jitter counter exceeds the
+ * frequency averaging interval, the new candidate replaces the
+ * old one anyway. The compare counter is incremented if the new
+ * candidate is identical to the last one; otherwise, it is
+ * forced to zero. If the compare counter increments to 10, the
+ * epoch is reset and the receiver second epoch is set.
+ *
+ * Careful attention to detail here. If the signal amplitude
+ * falls below the threshold or if no stations are heard, we
+ * certainly cannot be in sync.
+ */
+ tmp2 = MOD(tepoch - xepoch, SECOND);
+ if (up->epomax < STHR || !(up->status & (SELV | SELH))) {
+ up->status &= ~SSYNC;
+ jitcnt = syncnt = avgcnt = 0;
+ } else if (abs(tmp2) <= MS || jitcnt >= (MINAVG << up->avgint))
+ {
+ jitcnt = 0;
+ if (tmp2 != 0) {
+ xepoch = tepoch;
+ syncnt = 0;
+ } else {
+ if (syncnt < SCMP) {
+ syncnt++;
+ } else {
+ up->status |= SSYNC;
+ up->swatch = 0;
+ up->repoch = tepoch;
+ up->yepoch = up->repoch;
+ if (up->yepoch < 0)
+ up->yepoch += SECOND;
+ }
+ }
+ avgcnt++;
+ } else {
+ jitcnt++;
+ syncnt = avgcnt = 0;
+ }
+ if (!(up->status & SSYNC) && 0) {
+ sprintf(tbuf,
+ "wwv1 %2d %04x %5.0f %2d %5.0f %5d %5d %5d %2d %4d",
+ up->rsec, up->status, up->epomax, avgcnt, epomax,
+ tepoch, tspan, tmp2, syncnt, jitcnt);
+ if (pp->sloppyclockflag & CLK_FLAG4)
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif /* DEBUG */
+ }
+
+ /*
+ * The sample clock frequency is disciplined using a first-order
+ * feedback loop with time constant consistent with the Allan
+ * intercept of typical computer clocks. The loop update is
+ * calculated each averaging interval from the epoch change in
+ * 125-us units and interval length in seconds. The interval is
+ * doubled after four intervals where epoch change is not more
+ * than one sample.
+ *
+ * The averaging interval affects other receiver functions,
+ * including the the 1000/1200-Hz comb filter and sample clock
+ * loop. It also affects the 100-Hz subcarrier loop and the bit
+ * and digit comparison counter thresholds.
+ */
+ tmp3 = MOD(tepoch - zepoch, SECOND);
+ if (avgcnt >= (MINAVG << up->avgint)) {
+ if (abs(tmp3) < MS) {
+ dtemp = (double)tmp3 / avgcnt;
+ up->freq += dtemp / SYNCTC;
+ if (up->freq > MAXFREQ)
+ up->freq = MAXFREQ;
+ else if (up->freq < -MAXFREQ)
+ up->freq = -MAXFREQ;
+ if (abs(tmp3) <= 1 && up->avgint < MAXAVG) {
+ if (avginc < 4) {
+ avginc++;
+ } else {
+ avginc = 0;
+ up->avgint++;
+ }
+ }
+ if (up->avgint < MAXAVG) {
+ sprintf(tbuf,
+ "wwv2 %2d %04x %5.0f %5d %5d %2d %2d %6.1f %6.1f",
+ up->rsec, up->status, up->epomax,
+ MINAVG << up->avgint, avgcnt,
+ avginc, tmp3, dtemp / SECOND * 1e6,
+ up->freq / SECOND * 1e6);
+ if (pp->sloppyclockflag & CLK_FLAG4)
+ record_clock_stats(
+ &peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif /* DEBUG */
+ }
+ }
+ zepoch = tepoch;
+ avgcnt = 0;
+ }
+}
+
+
+/*
+ * wwv_epoch - main loop
+ *
+ * This routine establishes receiver and transmitter epoch
+ * synchronization and determines the data subcarrier pulse length.
+ * Receiver synchronization is determined by the minute sync pulse
+ * detected in the wwv_rf() routine and the second sync pulse detected
+ * in the wwv_epoch() routine. This establishes when to sample the data
+ * subcarrier in-phase signal for the maximum level and noise level and
+ * when to determine the pulse length. The transmitter second leads the
+ * receiver second by the propagation delay, receiver delay and filter
+ * delay of this program. It establishes the clock time and implements
+ * the sometimes idiosyncratic conventional clock time and civil
+ * calendar.
+ *
+ * Most communications radios use a highpass filter in the audio stages,
+ * which can do nasty things to the subcarrier phase relative to the
+ * sync pulses. Therefore, the data subcarrier reference phase is
+ * disciplined using the hardlimited quadrature-phase signal sampled at
+ * the same time as the in-phase signal. The phase tracking loop uses
+ * phase adjustments of plus-minus one sample (125 us).
+ */
+static void
+wwv_epoch(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ static double dpulse; /* data pulse length */
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ struct chan *cp;
+ struct sync *sp;
+ l_fp offset; /* NTP format offset */
+ double dtemp;
+
+ pp = peer->procptr;
+ up = (struct wwvunit *)pp->unitptr;
+
+ /*
+ * Sample the minute sync pulse amplitude at epoch 800 for both
+ * the WWV and WWVH stations. This will be used later for
+ * channel mitigation.
+ */
+ cp = &up->mitig[up->achan];
+ if (up->rphase == 800 * MS) {
+ sp = &cp->wwv;
+ sp->synamp = sqrt(sp->amp);
+ sp = &cp->wwvh;
+ sp->synamp = sqrt(sp->amp);
+ }
+
+ if (up->rsec == 0) {
+ up->sigamp = up->datsnr = 0;
+ } else {
+
+ /*
+ * Estimate the noise level by integrating the I-channel
+ * energy at epoch 30 ms.
+ */
+ if (up->rphase == 30 * MS) {
+ if (!(up->status & SFLAG))
+ up->noiamp += (up->irig - up->noiamp) /
+ (MINAVG << up->avgint);
+ else
+ cp->noiamp += (sqrt(up->irig *
+ up->irig + up->qrig * up->qrig) -
+ cp->noiamp) / 8;
+
+ /*
+ * Strobe the peak I-channel data signal at epoch 200
+ * ms. Compute the SNR and adjust the 100-Hz reference
+ * oscillator phase using the Q-channel data signal at
+ * that epoch. Save the envelope amplitude for the probe
+ * channel.
+ */
+ } else if (up->rphase == 200 * MS) {
+ if (!(up->status & SFLAG)) {
+ up->sigamp = up->irig;
+ if (up->sigamp < 0)
+ up->sigamp = 0;
+ up->datsnr = wwv_snr(up->sigamp,
+ up->noiamp);
+ up->datpha = up->qrig / (MINAVG <<
+ up->avgint);
+ if (up->datpha >= 0) {
+ up->datapt++;
+ if (up->datapt >= 80)
+ up->datapt -= 80;
+ } else {
+ up->datapt--;
+ if (up->datapt < 0)
+ up->datapt += 80;
+ }
+ } else {
+ up->sigamp = sqrt(up->irig * up->irig +
+ up->qrig * up->qrig);
+ up->datsnr = wwv_snr(up->sigamp,
+ cp->noiamp);
+ }
+
+ /*
+ * The slice level is set half way between the peak
+ * signal and noise levels. Strobe the negative zero
+ * crossing after epoch 200 ms and record the epoch at
+ * that time. This defines the length of the data pulse,
+ * which will later be converted into scaled bit
+ * probabilities.
+ */
+ } else if (up->rphase > 200 * MS) {
+ dtemp = (up->sigamp + up->noiamp) / 2;
+ if (up->irig < dtemp && dpulse == 0)
+ dpulse = up->rphase;
+ }
+ }
+
+ /*
+ * At the end of the transmitter second, crank the clock state
+ * machine. Note we have to be careful to set the transmitter
+ * epoch at the same time as the receiver epoch to be sure the
+ * right propagation delay is used. We don't bother the heavy
+ * machinery unless the clock is set.
+ */
+ up->tphase++;
+ if (up->epoch == up->yepoch) {
+ wwv_tsec(up);
+ up->tphase = 0;
+
+ /*
+ * Determine the current offset from the time of century
+ * and the sample timestamp, but only if the SYNERR
+ * alarm has not been raised in the present or previous
+ * minute.
+ */
+ if (!(up->status & SFLAG) && up->status & INSYNC &&
+ (up->alarm & (3 << SYNERR)) == 0) {
+ pp->second = up->tsec;
+ pp->minute = up->decvec[MN].digit +
+ up->decvec[MN + 1].digit * 10;
+ pp->hour = up->decvec[HR].digit +
+ up->decvec[HR + 1].digit * 10;
+ pp->day = up->decvec[DA].digit + up->decvec[DA +
+ 1].digit * 10 + up->decvec[DA + 2].digit *
+ 100;
+ pp->year = up->decvec[YR].digit +
+ up->decvec[YR + 1].digit * 10;
+ if (pp->year < UTCYEAR)
+ pp->year += 2000;
+ else
+ pp->year += 1900;
+
+ /*
+ * We have to simulate refclock_process() here,
+ * since the fudgetime gets added much earlier
+ * than this.
+ */
+ pp->lastrec = up->timestamp;
+ L_CLR(&offset);
+ if (!clocktime(pp->day, pp->hour, pp->minute,
+ pp->second, GMT, pp->lastrec.l_ui,
+ &pp->yearstart, &offset.l_ui))
+ up->errflg = CEVNT_BADTIME;
+ else
+ refclock_process_offset(pp, offset,
+ pp->lastrec, 0.);
+ }
+ }
+
+ /*
+ * At the end of the receiver second, process the data bit and
+ * update the decoding matrix probabilities.
+ */
+ up->rphase++;
+ if (up->epoch == up->repoch) {
+ wwv_rsec(peer, dpulse);
+ wwv_gain(peer);
+ up->rphase = dpulse = 0;
+ }
+}
+
+
+/*
+ * wwv_rsec - process receiver second
+ *
+ * This routine is called at the end of each receiver second to
+ * implement the per-second state machine. The machine assembles BCD
+ * digit bits, decodes miscellaneous bits and dances the leap seconds.
+ *
+ * Normally, the minute has 60 seconds numbered 0-59. If the leap
+ * warning bit is set, the last minute (1439) of 30 June (day 181 or 182
+ * for leap years) or 31 December (day 365 or 366 for leap years) is
+ * augmented by one second numbered 60. This is accomplished by
+ * extending the minute interval by one second and teaching the state
+ * machine to ignore it. BTW, stations WWV/WWVH cowardly kill the
+ * transmitter carrier for a few seconds around the leap to avoid icky
+ * details of transmission format during the leap.
+ */
+static void
+wwv_rsec(
+ struct peer *peer, /* peer structure pointer */
+ double dpulse
+ )
+{
+ static int iniflg; /* initialization flag */
+ static double bcddld[4]; /* BCD data bits */
+ static double bitvec[61]; /* bit integrator for misc bits */
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ struct chan *cp;
+ struct sync *sp, *rp;
+ double bit; /* bit likelihood */
+ char tbuf[80]; /* monitor buffer */
+ int sw, arg, nsec;
+
+ pp = peer->procptr;
+ up = (struct wwvunit *)pp->unitptr;
+ if (!iniflg) {
+ iniflg = 1;
+ memset((char *)bitvec, 0, sizeof(bitvec));
+ }
+
+ /*
+ * The bit represents the probability of a hit on zero (negative
+ * values), a hit on one (positive values) or a miss (zero
+ * value). The likelihood vector is the exponential average of
+ * these probabilities. Only the bits of this vector
+ * corresponding to the miscellaneous bits of the timecode are
+ * used, but it's easier to do them all. After that, crank the
+ * seconds state machine.
+ */
+ nsec = up->rsec + 1;
+ bit = wwv_data(up, dpulse);
+ bitvec[up->rsec] += (bit - bitvec[up->rsec]) / TCONST;
+ sw = progx[up->rsec].sw;
+ arg = progx[up->rsec].arg;
+ switch (sw) {
+
+ /*
+ * Ignore this second.
+ */
+ case IDLE: /* 9, 45-49 */
+ break;
+
+ /*
+ * Probe channel stuff
+ *
+ * The WWV/H format contains data pulses in second 59 (position
+ * identifier) and second 1 (not used), and the minute sync
+ * pulse in second 0. At the end of second 58, we QSYed to the
+ * probe channel, which rotates over all WWV/H frequencies. At
+ * the end of second 59, we latched the sync noise and tested
+ * for data bit error. At the end of second 0, we now latch the
+ * sync peak.
+ */
+ case SYNC2: /* 0 */
+ cp = &up->mitig[up->achan];
+ sp = &cp->wwv;
+ sp->synmax = sp->synamp;
+ sp = &cp->wwvh;
+ sp->synmax = sp->synamp;
+ break;
+
+ /*
+ * At the end of second 1, latch and average the sync noise and
+ * test for data bit error. Set SYNCNG if the sync pulse
+ * amplitude and SNR are not above thresholds. Set DATANG if
+ * data error occured on both second 59 and second 1. Finally,
+ * QSY back to the data channel.
+ */
+ case SYNC3: /* 1 */
+ cp = &up->mitig[up->achan];
+ if (up->sigamp < DTHR || up->datsnr < DSNR)
+ cp->errcnt++;
+
+ sp = &cp->wwv;
+ sp->synmin = (sp->synmin + sp->synamp) / 2;
+ sp->synsnr = wwv_snr(sp->synmax, sp->synmin);
+ sp->select &= ~(DATANG | SYNCNG);
+ if (sp->synmax < QTHR || sp->synsnr < QSNR)
+ sp->select |= SYNCNG;
+ if (cp->errcnt > 1)
+ sp->select |= DATANG;
+
+ rp = &cp->wwvh;
+ rp->synmin = (rp->synmin + rp->synamp) / 2;
+ rp->synsnr = wwv_snr(rp->synmax, rp->synmin);
+ rp->select &= ~(DATANG | SYNCNG);
+ if (rp->synmax < QTHR || rp->synsnr < QSNR)
+ rp->select |= SYNCNG;
+ if (cp->errcnt > 1)
+ rp->select |= DATANG;
+
+ cp->errcnt = 0;
+ sprintf(tbuf,
+ "wwv5 %d %3d %-3s %04x %d %.0f/%.1f/%ld %s %04x %d %.0f/%.1f/%ld",
+ up->port, up->gain, sp->ident, sp->select,
+ sp->count, sp->synmax, sp->synsnr, sp->jitter,
+ rp->ident, rp->select, rp->count, rp->synmax,
+ rp->synsnr, rp->jitter);
+ if (pp->sloppyclockflag & CLK_FLAG4)
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif /* DEBUG */
+ up->status &= ~SFLAG;
+ wwv_newchan(peer);
+ break;
+
+ /*
+ * Save the bit probability in the BCD data vector at the index
+ * given by the argument. Note that all bits of the vector have
+ * to be above the data gate threshold for the digit to be
+ * considered valid. Bits not used in the digit are forced to
+ * zero and not checked for errors.
+ */
+ case COEF1: /* 10-13 */
+ if (up->status & DGATE)
+ up->status |= BGATE;
+ bcddld[arg] = bit;
+ break;
+
+ case COEF2: /* 18, 27-28, 42-43 */
+ bcddld[arg] = 0;
+ break;
+
+ case COEF: /* 4-7, 15-17, 20-23, 25-26,
+ 30-33, 35-38, 40-41, 51-54 */
+ if (up->status & DGATE || !(up->status & DSYNC))
+ up->status |= BGATE;
+ bcddld[arg] = bit;
+ break;
+
+ /*
+ * Correlate coefficient vector with each valid digit vector and
+ * save in decoding matrix. We step through the decoding matrix
+ * digits correlating each with the coefficients and saving the
+ * greatest and the next lower for later SNR calculation.
+ */
+ case DECIM2: /* 29 */
+ wwv_corr4(peer, &up->decvec[arg], bcddld, bcd2);
+ break;
+
+ case DECIM3: /* 44 */
+ wwv_corr4(peer, &up->decvec[arg], bcddld, bcd3);
+ break;
+
+ case DECIM6: /* 19 */
+ wwv_corr4(peer, &up->decvec[arg], bcddld, bcd6);
+ break;
+
+ case DECIM9: /* 8, 14, 24, 34, 39 */
+ wwv_corr4(peer, &up->decvec[arg], bcddld, bcd9);
+ break;
+
+ /*
+ * Miscellaneous bits. If above the positive threshold, declare
+ * 1; if below the negative threshold, declare 0; otherwise
+ * raise the SYMERR alarm. At the end of second 58, QSY to the
+ * probe channel.
+ */
+ case MSC20: /* 55 */
+ wwv_corr4(peer, &up->decvec[YR + 1], bcddld, bcd9);
+ /* fall through */
+
+ case MSCBIT: /* 2, 3, 50, 56-57 */
+ if (bitvec[up->rsec] > BTHR)
+ up->misc |= arg;
+ else if (bitvec[up->rsec] < -BTHR)
+ up->misc &= ~arg;
+ else
+ up->alarm |= 1 << SYMERR;
+ break;
+
+ case MSC21: /* 58 */
+ if (bitvec[up->rsec] > BTHR)
+ up->misc |= arg;
+ else if (bitvec[up->rsec] < -BTHR)
+ up->misc &= ~arg;
+ else
+ up->alarm |= 1 << SYMERR;
+ up->schan = (up->schan + 1) % NCHAN;
+ wwv_qsy(peer, up->schan);
+ up->status |= SFLAG;
+ break;
+
+ /*
+ * The endgames
+ *
+ * Second 59 contains the first data pulse of the probe
+ * sequence. Check it for validity and establish the noise floor
+ * for the minute sync SNR.
+ */
+ case MIN1: /* 59 */
+ cp = &up->mitig[up->achan];
+ if (up->sigamp < DTHR || up->datsnr < DSNR)
+ cp->errcnt++;
+ sp = &cp->wwv;
+ sp->synmin = sp->synamp;
+ sp = &cp->wwvh;
+ sp->synmin = sp->synamp;
+
+ /*
+ * If SECWARN is set on the last minute of 30 June or 31
+ * December, LEPSEC bit is set. At the end of the minute
+ * in which LEPSEC is set the transmitter and receiver
+ * insert an extra second (60) in the timescale and the
+ * minute sync skips a second. We only get to test this
+ * wrinkle at intervals of about 18 months, the actual
+ * mileage may vary.
+ */
+ if (up->tsec == 60) {
+ up->status &= ~LEPSEC;
+ break;
+ }
+ /* fall through */
+
+ /*
+ * If all nine clock digits are valid and the SYNERR alarm is
+ * not raised in the current or previous second, the clock is
+ * set or validated. If at least one digit is set, which by
+ * design must be the minute units digit, the clock state
+ * machine begins to count the minutes.
+ */
+ case MIN2: /* 59/60 */
+ up->minset = ((current_time - peer->update) + 30) / 60;
+ if (up->digcnt > 0)
+ up->status |= DSYNC;
+ if (up->digcnt >= 9 && (up->alarm & (3 << SYNERR)) == 0)
+ {
+ up->status |= INSYNC;
+ up->watch = 0;
+ }
+ pp->lencode = timecode(up, pp->a_lastcode);
+ if (up->misc & SECWAR)
+ pp->leap = LEAP_ADDSECOND;
+ else
+ pp->leap = LEAP_NOWARNING;
+ refclock_receive(peer);
+ record_clock_stats(&peer->srcadr, pp->a_lastcode);
+#ifdef DEBUG
+ if (debug)
+ printf("wwv: timecode %d %s\n", pp->lencode,
+ pp->a_lastcode);
+#endif /* DEBUG */
+
+ /*
+ * The ultimate watchdog is the interval since the
+ * reference clock interface code last received an
+ * update from this driver. If the interval is greater
+ * than a couple of days, manual intervention is
+ * probably required, so the program resets and tries to
+ * resynchronized from scratch.
+ */
+ if (up->minset > PANIC)
+ up->status = 0;
+ up->alarm = (up->alarm & ~0x8888) << 1;
+ up->nepoch = (up->mphase + SYNSIZ) % MINUTE;
+ up->errcnt = up->digcnt = nsec = 0;
+ break;
+ }
+ if (!(up->status & DSYNC)) {
+ sprintf(tbuf,
+ "wwv3 %2d %04x %5.0f %5.0f %5.0f %5.1f %5.0f %5.0f",
+ up->rsec, up->status, up->epomax, up->sigamp,
+ up->datpha, up->datsnr, bit, bitvec[up->rsec]);
+ if (pp->sloppyclockflag & CLK_FLAG4)
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif /* DEBUG */
+ }
+ up->rsec = up->tsec = nsec;
+ return;
+}
+
+
+/*
+ * wwv_data - calculate bit probability
+ *
+ * This routine is called at the end of the receiver second to calculate
+ * the probabilities that the previous second contained a zero (P0), one
+ * (P1) or position indicator (P2) pulse. If not in sync or if the data
+ * bit is bad, a bit error is declared and the probabilities are forced
+ * to zero. Otherwise, the data gate is enabled and the probabilities
+ * are calculated. Note that the data matched filter contributes half
+ * the pulse width, or 85 ms..
+ */
+static double
+wwv_data(
+ struct wwvunit *up, /* driver unit pointer */
+ double pulse /* pulse length (sample units) */
+ )
+{
+ double p0, p1, p2; /* probabilities */
+ double dpulse; /* pulse length in ms */
+
+ p0 = p1 = p2 = 0;
+ dpulse = pulse - DATSIZ / 2;
+
+ /*
+ * If the data amplitude or SNR are below threshold or if the
+ * pulse length is less than 170 ms, declare an erasure.
+ */
+ if (up->sigamp < DTHR || up->datsnr < DSNR || dpulse < DATSIZ) {
+ up->status |= DGATE;
+ up->errcnt++;
+ if (up->errcnt > MAXERR)
+ up->alarm |= 1 << MODERR;
+ return (0);
+ }
+
+ /*
+ * The probability of P0 is one below 200 ms falling to zero at
+ * 500 ms. The probability of P1 is zero below 200 ms rising to
+ * one at 500 ms and falling to zero at 800 ms. The probability
+ * of P2 is zero below 500 ms, rising to one above 800 ms.
+ */
+ up->status &= ~DGATE;
+ if (dpulse < (200 * MS)) {
+ p0 = 1;
+ } else if (dpulse < 500 * MS) {
+ dpulse -= 200 * MS;
+ p1 = dpulse / (300 * MS);
+ p0 = 1 - p1;
+ } else if (dpulse < 800 * MS) {
+ dpulse -= 500 * MS;
+ p2 = dpulse / (300 * MS);
+ p1 = 1 - p2;
+ } else {
+ p2 = 1;
+ }
+
+ /*
+ * The ouput is a metric that ranges from -1 (P0), to +1 (P1)
+ * scaled for convenience. An output of zero represents an
+ * erasure, either because of a data error or pulse length
+ * greater than 500 ms. At the moment, we don't use P2.
+ */
+ return ((p1 - p0) * MAXSIG);
+}
+
+
+/*
+ * wwv_corr4 - determine maximum likelihood digit
+ *
+ * This routine correlates the received digit vector with the BCD
+ * coefficient vectors corresponding to all valid digits at the given
+ * position in the decoding matrix. The maximum value corresponds to the
+ * maximum likelihood digit, while the ratio of this value to the next
+ * lower value determines the likelihood function. Note that, if the
+ * digit is invalid, the likelihood vector is averaged toward a miss.
+ */
+static void
+wwv_corr4(
+ struct peer *peer, /* peer unit pointer */
+ struct decvec *vp, /* decoding table pointer */
+ double data[], /* received data vector */
+ double tab[][4] /* correlation vector array */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+
+ double topmax, nxtmax; /* metrics */
+ double acc; /* accumulator */
+ char tbuf[80]; /* monitor buffer */
+ int mldigit; /* max likelihood digit */
+ int diff; /* decoding difference */
+ int i, j;
+
+ pp = peer->procptr;
+ up = (struct wwvunit *)pp->unitptr;
+
+ /*
+ * Correlate digit vector with each BCD coefficient vector. If
+ * any BCD digit bit is bad, consider all bits a miss.
+ */
+ mldigit = 0;
+ topmax = nxtmax = -MAXSIG;
+ for (i = 0; tab[i][0] != 0; i++) {
+ acc = 0;
+ for (j = 0; j < 4; j++) {
+ if (!(up->status & BGATE))
+ acc += data[j] * tab[i][j];
+ }
+ acc = (vp->like[i] += (acc - vp->like[i]) / TCONST);
+ if (acc > topmax) {
+ nxtmax = topmax;
+ topmax = acc;
+ mldigit = i;
+ } else if (acc > nxtmax) {
+ nxtmax = acc;
+ }
+ }
+ vp->mldigit = mldigit;
+ vp->digprb = topmax;
+ vp->digsnr = wwv_snr(topmax, nxtmax);
+
+ /*
+ * The maximum likelihood digit is compared with the current
+ * clock digit. The difference represents the decoding phase
+ * error. If the digit probability and likelihood are good and
+ * the difference stays the same for a number of comparisons,
+ * the clock digit is reset to the maximum likelihood digit.
+ */
+ diff = mldigit - vp->digit;
+ if (diff < 0)
+ diff += vp->radix;
+ if (diff != vp->phase) {
+ vp->phase = diff;
+ vp->count = 0;
+ }
+ if (vp->digprb < BTHR || vp->digsnr < BSNR) {
+ vp->count = 0;
+ up->alarm |= 1 << SYMERR;
+ } else if (vp->count < BCMP) {
+ if (!(up->status & INSYNC)) {
+ vp->phase = 0;
+ vp->digit = mldigit;
+ }
+ vp->count++;
+ } else {
+ vp->phase = 0;
+ vp->digit = mldigit;
+ up->digcnt++;
+ }
+ if (vp->digit != mldigit)
+ up->alarm |= 1 << DECERR;
+ if (!(up->status & INSYNC)) {
+ sprintf(tbuf,
+ "wwv4 %2d %04x %5.0f %2d %d %d %d %d %5.0f %5.1f",
+ up->rsec, up->status, up->epomax, vp->radix,
+ vp->digit, vp->mldigit, vp->phase, vp->count,
+ vp->digprb, vp->digsnr);
+ if (pp->sloppyclockflag & CLK_FLAG4)
+ record_clock_stats(&peer->srcadr, tbuf);
+#ifdef DEBUG
+ if (debug)
+ printf("%s\n", tbuf);
+#endif /* DEBUG */
+ }
+ up->status &= ~BGATE;
+}
+
+
+/*
+ * wwv_tsec - transmitter second processing
+ *
+ * This routine is called at the end of the transmitter second. It
+ * implements a state machine that advances the logical clock subject to
+ * the funny rules that govern the conventional clock and calendar. Note
+ * that carries from the least significant (minutes) digit are inhibited
+ * until that digit is synchronized.
+ */
+static void
+wwv_tsec(
+ struct wwvunit *up /* driver structure pointer */
+ )
+{
+ int minute, day, isleap;
+ int temp;
+
+ up->tsec++;
+ if (up->tsec < 60 || up->status & LEPSEC)
+ return;
+ up->tsec = 0;
+
+ /*
+ * Advance minute unit of the day. If the minute unit is not
+ * synchronized, go no further.
+ */
+ temp = carry(&up->decvec[MN]); /* minute units */
+ if (!(up->status & DSYNC))
+ return;
+
+ /*
+ * Propagate carries through the day.
+ */
+ if (temp == 0) /* carry minutes */
+ temp = carry(&up->decvec[MN + 1]);
+ if (temp == 0) /* carry hours */
+ temp = carry(&up->decvec[HR]);
+ if (temp == 0)
+ temp = carry(&up->decvec[HR + 1]);
+
+ /*
+ * Decode the current minute and day. Set the leap second enable
+ * bit on the last minute of 30 June and 31 December.
+ */
+ minute = up->decvec[MN].digit + up->decvec[MN + 1].digit *
+ 10 + up->decvec[HR].digit * 60 + up->decvec[HR +
+ 1].digit * 600;
+ day = up->decvec[DA].digit + up->decvec[DA + 1].digit * 10 +
+ up->decvec[DA + 2].digit * 100;
+ isleap = (up->decvec[YR].digit & 0x3) == 0;
+ if (minute == 1439 && (day == (isleap ? 182 : 183) || day ==
+ (isleap ? 365 : 366)) && up->misc & SECWAR)
+ up->status |= LEPSEC;
+
+ /*
+ * Roll the day if this the first minute and propagate carries
+ * through the year.
+ */
+ if (minute != 1440)
+ return;
+ minute = 0;
+ while (carry(&up->decvec[HR]) != 0); /* advance to minute 0 */
+ while (carry(&up->decvec[HR + 1]) != 0);
+ day++;
+ temp = carry(&up->decvec[DA]); /* carry days */
+ if (temp == 0)
+ temp = carry(&up->decvec[DA + 1]);
+ if (temp == 0)
+ temp = carry(&up->decvec[DA + 2]);
+
+ /*
+ * Roll the year if this the first day and propagate carries
+ * through the century.
+ */
+ if (day != (isleap ? 365 : 366))
+ return;
+ day = 1;
+ while (carry(&up->decvec[DA]) != 1); /* advance to day 1 */
+ while (carry(&up->decvec[DA + 1]) != 0);
+ while (carry(&up->decvec[DA + 2]) != 0);
+ temp = carry(&up->decvec[YR]); /* carry years */
+ if (temp)
+ carry(&up->decvec[YR + 1]);
+}
+
+
+/*
+ * carry - process digit
+ *
+ * This routine rotates a likelihood vector one position and increments
+ * the clock digit modulo the radix. It returns the new clock digit -
+ * zero if a carry occured. Once synchronized, the clock digit will
+ * match the maximum likelihood digit corresponding to that position.
+ */
+static int
+carry(
+ struct decvec *dp /* decoding table pointer */
+ )
+{
+ int temp;
+ int j;
+
+ dp->digit++; /* advance clock digit */
+ if (dp->digit == dp->radix) { /* modulo radix */
+ dp->digit = 0;
+ }
+ temp = dp->like[dp->radix - 1]; /* rotate likelihood vector */
+ for (j = dp->radix - 1; j > 0; j--)
+ dp->like[j] = dp->like[j - 1];
+ dp->like[0] = temp;
+ return (dp->digit);
+}
+
+
+/*
+ * wwv_snr - compute SNR or likelihood function
+ */
+static double
+wwv_snr(
+ double signal, /* signal */
+ double noise /* noise */
+ )
+{
+ double rval;
+
+ /*
+ * This is a little tricky. Due to the way things are measured,
+ * either or both the signal or noise amplitude can be negative
+ * or zero. The intent is that, if the signal is negative or
+ * zero, the SNR must always be zero. This can happen with the
+ * subcarrier SNR before the phase has been aligned. On the
+ * other hand, in the likelihood function the "noise" is the
+ * next maximum down from the peak and this could be negative.
+ * However, in this case the SNR is truly stupendous, so we
+ * simply cap at MAXSNR dB.
+ */
+ if (signal <= 0) {
+ rval = 0;
+ } else if (noise <= 0) {
+ rval = MAXSNR;
+ } else {
+ rval = 20 * log10(signal / noise);
+ if (rval > MAXSNR)
+ rval = MAXSNR;
+ }
+ return (rval);
+}
+
+/*
+ * wwv_newchan - change to new data channel
+ *
+ * Assuming the radio can be tuned by this program, it actually appears
+ * as a 10-channel receiver, one channel for each of WWV and WWVH on
+ * each of five frequencies. While the radio is tuned to the working
+ * data channel (frequency and station) for most of the minute, during
+ * seconds 59, 0 and 1 the radio is tuned to a probe channel, in order
+ * to pick up minute sync and data pulses. The search for WWV and WWVH
+ * stations operates simultaneously, with WWV on 1000 Hz and WWVH on
+ * 1200 Hz. The probe channel rotates for each minute over the five
+ * frequencies. At the end of each rotation, this routine mitigates over
+ * all channels and chooses the best frequency and station.
+ */
+static void
+wwv_newchan(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ struct chan *cp;
+ struct sync *sp, *rp;
+ int rank;
+ int i, j;
+
+ pp = peer->procptr;
+ up = (struct wwvunit *)pp->unitptr;
+
+ /*
+ * Reset the matched filter selector and station pointer to
+ * avoid fooling around should we lose this game.
+ */
+ up->sptr = 0;
+ up->status &= ~(SELV | SELH);
+
+ /*
+ * Search all five station pairs looking for the station with
+ * the maximum compare counter. Ties go to the highest frequency
+ * and then to WWV.
+ */
+ j = 0;
+ sp = (struct sync *)0;
+ rank = 0;
+ for (i = 0; i < NCHAN; i++) {
+ cp = &up->mitig[i];
+ rp = &cp->wwvh;
+ if (rp->count >= rank) {
+ sp = rp;
+ rank = rp->count;
+ j = i;
+ }
+ rp = &cp->wwv;
+ if (rp->count >= rank) {
+ sp = rp;
+ rank = rp->count;
+ j = i;
+ }
+ }
+
+ /*
+ * If we find a station, continue to track it. If not, X marks
+ * the spot and we wait for better ions.
+ */
+ if (rank > 0) {
+ up->dchan = j;
+ up->sptr = sp;
+ up->status |= sp->select & (SELV | SELH);
+ memcpy((char *)&pp->refid, sp->refid, 4);
+ memcpy((char *)&peer->refid, sp->refid, 4);
+ wwv_qsy(peer, up->dchan);
+ }
+}
+
+
+/*
+ * wwv_qsy - Tune ICOM receiver
+ *
+ * This routine saves the AGC for the current channel, switches to a new
+ * channel and restores the AGC for that channel. If a tunable receiver
+ * is not available, just fake it.
+ */
+static int
+wwv_qsy(
+ struct peer *peer, /* peer structure pointer */
+ int chan /* channel */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+ int rval = 0;
+
+ pp = peer->procptr;
+ up = (struct wwvunit *)pp->unitptr;
+ up->mitig[up->achan].gain = up->gain;
+#ifdef ICOM
+ if (up->fd_icom > 0)
+ rval = icom_freq(up->fd_icom, peer->ttl & 0x7f,
+ qsy[chan]);
+#endif /* ICOM */
+ up->achan = chan;
+ up->gain = up->mitig[up->achan].gain;
+ return (rval);
+}
+
+
+/*
+ * timecode - assemble timecode string and length
+ *
+ * Prettytime format - similar to Spectracom
+ *
+ * sq yy ddd hh:mm:ss.fff ld dut lset agc stn comp errs freq avgt
+ *
+ * s sync indicator ('?' or ' ')
+ * q quality character (hex 0-F)
+ * yyyy year of century
+ * ddd day of year
+ * hh hour of day
+ * mm minute of hour
+ * ss minute of hour
+ * fff millisecond of second
+ * l leap second warning ' ' or 'L'
+ * d DST state 'S', 'D', 'I', or 'O'
+ * dut DUT sign and magnitude in deciseconds
+ * lset minutes since last clock update
+ * agc audio gain (0-255)
+ * iden station identifier (station and frequency)
+ * comp minute sync compare counter
+ * errs bit errors in last minute * freq frequency offset (PPM) * avgt averaging time (s) */
+static int
+timecode(
+ struct wwvunit *up, /* driver structure pointer */
+ char *ptr /* target string */
+ )
+{
+ struct sync *sp;
+ int year, day, hour, minute, second, frac, dut;
+ char synchar, qual, leapchar, dst;
+ char cptr[50];
+
+
+ /*
+ * Common fixed-format fields
+ */
+ synchar = (up->status & INSYNC) ? ' ' : '?';
+ qual = 0;
+ if (up->alarm & (3 << DECERR))
+ qual |= 0x1;
+ if (up->alarm & (3 << SYMERR))
+ qual |= 0x2;
+ if (up->alarm & (3 << MODERR))
+ qual |= 0x4;
+ if (up->alarm & (3 << SYNERR))
+ qual |= 0x8;
+ year = up->decvec[7].digit + up->decvec[7].digit * 10;
+ if (year < UTCYEAR)
+ year += 2000;
+ else
+ year += 1900;
+ day = up->decvec[4].digit + up->decvec[5].digit * 10 +
+ up->decvec[6].digit * 100;
+ hour = up->decvec[2].digit + up->decvec[3].digit * 10;
+ minute = up->decvec[0].digit + up->decvec[1].digit * 10;
+ second = up->tsec;
+ frac = (up->tphase * 1000) / SECOND;
+ leapchar = (up->misc & SECWAR) ? 'L' : ' ';
+ dst = dstcod[(up->misc >> 4) & 0x3];
+ dut = up->misc & 0x7;
+ if (!(up->misc & DUTS))
+ dut = -dut;
+ sprintf(ptr, "%c%1X", synchar, qual);
+ sprintf(cptr, " %4d %03d %02d:%02d:%02d.%.03d %c%c %+d",
+ year, day, hour, minute, second, frac, leapchar, dst, dut);
+ strcat(ptr, cptr);
+
+ /*
+ * Specific variable-format fields
+ */
+ sp = up->sptr;
+ if (sp != 0)
+ sprintf(cptr, " %d %d %s %d %d %.1f %d", up->minset,
+ up->mitig[up->dchan].gain, sp->ident, sp->count,
+ up->errcnt, up->freq / SECOND * 1e6, MINAVG <<
+ up->avgint);
+ else
+ sprintf(cptr, " %d %d X 0 %d %.1f %d", up->minset,
+ up->mitig[up->dchan].gain, up->errcnt, up->freq /
+ SECOND * 1e6, MINAVG << up->avgint);
+ strcat(ptr, cptr);
+ return (strlen(ptr));
+}
+
+
+/*
+ * wwv_gain - adjust codec gain
+ *
+ * This routine is called once each second. If the signal envelope
+ * amplitude is too low, the codec gain is bumped up by four units; if
+ * too high, it is bumped down. The decoder is relatively insensitive to
+ * amplitude, so this crudity works just fine. The input port is set and
+ * the error flag is cleared, mostly to be ornery.
+ */
+static void
+wwv_gain(
+ struct peer *peer /* peer structure pointer */
+ )
+{
+ struct refclockproc *pp;
+ struct wwvunit *up;
+
+ pp = peer->procptr;
+ up = (struct wwvunit *)pp->unitptr;
+
+ /*
+ * Apparently, the codec uses only the high order bits of the
+ * gain control field. Thus, it may take awhile for changes to
+ * wiggle the hardware bits.
+ */
+ if (up->clipcnt == 0) {
+ up->gain += 4;
+ if (up->gain > 255)
+ up->gain = 255;
+ } else if (up->clipcnt > SECOND / 100) {
+ up->gain -= 4;
+ if (up->gain < 0)
+ up->gain = 0;
+ }
+ audio_gain(up->gain, up->port);
+ up->clipcnt = 0;
+}
+
+
+#else
+int refclock_wwv_bs;
+#endif /* REFCLOCK */
diff --git a/contrib/ntp/ntpd/refclock_wwvb.c b/contrib/ntp/ntpd/refclock_wwvb.c
index 9d3b3d6b358b..63d6e0b880fb 100644
--- a/contrib/ntp/ntpd/refclock_wwvb.c
+++ b/contrib/ntp/ntpd/refclock_wwvb.c
@@ -6,7 +6,7 @@
#include <config.h>
#endif
-#if defined(REFCLOCK) && defined(CLOCK_WWVB)
+#if defined(REFCLOCK) && defined(CLOCK_SPECTRACOM)
#include <stdio.h>
#include <ctype.h>
diff --git a/contrib/ntp/ntpdate/Makefile.in b/contrib/ntp/ntpdate/Makefile.in
index 80d02326f474..c9132354f052 100644
--- a/contrib/ntp/ntpdate/Makefile.in
+++ b/contrib/ntp/ntpdate/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
@@ -140,6 +144,9 @@ DIST_COMMON = README $(noinst_HEADERS) Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/ntpdate$U.Po \
+$(DEPDIR)/ntptime_config$U.Po $(DEPDIR)/ntptimeset$U.Po
SOURCES = ntpdate.c $(ntptimeset_SOURCES)
OBJECTS = ntpdate$U.o $(am_ntptimeset_OBJECTS)
@@ -147,9 +154,9 @@ all: all-redirect
.SUFFIXES:
.SUFFIXES: .c .o
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps ntpdate/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu ntpdate/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -182,9 +189,6 @@ uninstall-binPROGRAMS:
rm -f $(DESTDIR)$(bindir)/$$f; \
done
-.c.o:
- $(COMPILE) -c $<
-
mostlyclean-compile:
-rm -f *.o core *.core
@@ -209,13 +213,10 @@ clean-kr:
distclean-kr:
maintainer-clean-kr:
-ntpdate$U.o:
ntpdate: $(ntpdate_OBJECTS) $(ntpdate_DEPENDENCIES)
@rm -f ntpdate
$(LINK) $(ntpdate_LDFLAGS) $(ntpdate_OBJECTS) $(ntpdate_LDADD) $(LIBS)
-ntptimeset$U.o:
-ntptime_config$U.o:
ntptimeset: $(ntptimeset_OBJECTS) $(ntptimeset_DEPENDENCIES)
@rm -f ntptimeset
@@ -230,23 +231,27 @@ ntpdate_.o ntptime_config_.o ntptimeset_.o : $(ANSI2KNR)
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -263,35 +268,34 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
-ntpdate.o: ntpdate.c ../config.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ntpdate.h ../include/ntp_malloc.h \
- ../include/ntp_string.h ../include/ntp_syslog.h \
- ../include/ntp_select.h ../include/ntp_stdlib.h \
- ../include/l_stdlib.h ../include/recvbuff.h
-ntptime_config.o: ntptime_config.c ../config.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_io.h \
- ../include/ntp_unixtime.h ../include/ntp_filegen.h ntpdate.h \
- ../include/ntp_malloc.h ../include/ntp_syslog.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h \
- ../include/l_stdlib.h
-ntptimeset.o: ntptimeset.c ../config.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h ../include/ntp_io.h \
- ../include/iosignal.h ../include/ntp_refclock.h \
- ../include/recvbuff.h ../include/ntp_unixtime.h ntpdate.h \
- ../include/ntp_malloc.h ../include/ntp_string.h \
- ../include/ntp_syslog.h ../include/ntp_select.h \
- ../include/ntp_stdlib.h ../include/l_stdlib.h
+
+@AMDEP@include $(DEPDIR)/ntpdate$U.Po
+@AMDEP@include $(DEPDIR)/ntptime_config$U.Po
+@AMDEP@include $(DEPDIR)/ntptimeset$U.Po
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf $(DEPDIR)
+
+maintainer-clean-depend:
+
+@AMDEP@CCDEPMODE = @CCDEPMODE@
+
+.c.o:
+@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c -o $@ $<
info-am:
info: info-am
@@ -330,25 +334,28 @@ distclean-generic:
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
- mostlyclean-kr mostlyclean-tags mostlyclean-generic
+ mostlyclean-kr mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-binPROGRAMS clean-compile clean-kr clean-tags \
- clean-generic mostlyclean-am
+ clean-depend clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-binPROGRAMS distclean-compile distclean-kr \
- distclean-tags distclean-generic clean-am
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-binPROGRAMS \
maintainer-clean-compile maintainer-clean-kr \
- maintainer-clean-tags maintainer-clean-generic \
- distclean-am
+ maintainer-clean-tags maintainer-clean-depend \
+ maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -359,8 +366,9 @@ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \
-maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-exec-am install-exec \
+maintainer-clean-tags distdir mostlyclean-depend distclean-depend \
+clean-depend maintainer-clean-depend info-am info dvi-am dvi check \
+check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
diff --git a/contrib/ntp/ntpdate/ntpdate.c b/contrib/ntp/ntpdate/ntpdate.c
index 023b64981761..e79b73e312e1 100644
--- a/contrib/ntp/ntpdate/ntpdate.c
+++ b/contrib/ntp/ntpdate/ntpdate.c
@@ -142,9 +142,8 @@ char *progname;
*/
int sys_samples = DEFSAMPLES; /* number of samples/server */
u_long sys_timeout = DEFTIMEOUT; /* timeout time, in TIMER_HZ units */
-struct server **sys_servers; /* the server list */
+struct server *sys_servers; /* the server list */
int sys_numservers = 0; /* number of servers to poll */
-int sys_maxservers = 0; /* max number of servers to deal with */
int sys_authenticate = 0; /* true when authenticating */
u_int32 sys_authkey = 0; /* set to authentication key in use */
u_long sys_authdelay = 0; /* authentication delay */
@@ -256,7 +255,6 @@ void clear_globals()
* Systemwide parameters and flags
*/
sys_numservers = 0; /* number of servers to poll */
- sys_maxservers = 0; /* max number of servers to deal with */
sys_authenticate = 0; /* true when authenticating */
sys_authkey = 0; /* set to authentication key in use */
sys_authdelay = 0; /* authentication delay */
@@ -472,13 +470,9 @@ ntpdatemain (
/*
* Add servers we are going to be polling
*/
- sys_maxservers = argc - ntp_optind;
#ifdef HAVE_NETINFO
- if ((netinfoservers = getnetinfoservers()))
- sys_maxservers += netinfoservers->ni_namelist_len;
+ inetinfoservers = getnetinfoservers();
#endif
- sys_servers = (struct server **)
- emalloc(sys_maxservers * sizeof(struct server *));
for ( ; ntp_optind < argc; ntp_optind++)
addserver(argv[ntp_optind]);
@@ -1025,8 +1019,7 @@ clock_select(void)
* NTP_MAXLIST of them.
*/
nlist = 0; /* none yet */
- for (n = 0; n < sys_numservers; n++) {
- server = sys_servers[n];
+ for (server = sys_servers; server != NULL; server = server->next_server) {
if (server->delay == 0)
continue; /* no data */
if (server->stratum > NTP_INFIN)
@@ -1201,18 +1194,17 @@ clock_select(void)
static int
clock_adjust(void)
{
- register int i;
- register struct server *server;
+ register struct server *sp, *server;
s_fp absoffset;
int dostep;
- for (i = 0; i < sys_numservers; i++)
- clock_filter(sys_servers[i]);
+ for (sp = sys_servers; sp != NULL; sp = sp->next_server)
+ clock_filter(sp);
server = clock_select();
if (debug || simple_query) {
- for (i = 0; i < sys_numservers; i++)
- printserver(sys_servers[i], stdout);
+ for (sp = sys_servers; sp != NULL; sp = sp->next_server)
+ printserver(sp, stdout);
}
if (server == 0) {
@@ -1275,21 +1267,6 @@ addserver(
{
register struct server *server;
u_int32 netnum;
- static int toomany = 0;
-
- if (sys_numservers >= sys_maxservers) {
- if (!toomany) {
- /*
- * This is actually a `can't happen' now. Leave
- * the error message in anyway, though
- */
- toomany = 1;
- msyslog(LOG_ERR,
- "too many servers (> %d) specified, remainder not used",
- sys_maxservers);
- }
- return;
- }
if (!getnetnum(serv, &netnum)) {
msyslog(LOG_ERR, "can't find host %s\n", serv);
@@ -1303,8 +1280,16 @@ addserver(
server->srcadr.sin_addr.s_addr = netnum;
server->srcadr.sin_port = htons(NTP_PORT);
- sys_servers[sys_numservers++] = server;
- server->event_time = sys_numservers;
+ server->event_time = ++sys_numservers;
+ if (sys_servers == NULL)
+ sys_servers = server;
+ else {
+ struct server *sp;
+
+ for (sp = sys_servers; sp->next_server != NULL;
+ sp = sp->next_server) ;
+ sp->next_server = server;
+ }
}
@@ -1316,18 +1301,47 @@ findserver(
struct sockaddr_in *addr
)
{
- register int i;
register u_int32 netnum;
+ struct server *server;
+ struct server *mc_server;
+ mc_server = NULL;
if (htons(addr->sin_port) != NTP_PORT)
return 0;
netnum = addr->sin_addr.s_addr;
- for (i = 0; i < sys_numservers; i++) {
- if (netnum == sys_servers[i]->srcadr.sin_addr.s_addr)
- return sys_servers[i];
+ for (server = sys_servers; server != NULL;
+ server = server->next_server) {
+ register u_int32 servnum;
+
+ servnum = server->srcadr.sin_addr.s_addr;
+ if (netnum == servnum)
+ return server;
+ if (IN_MULTICAST(ntohl(servnum)))
+ mc_server = server;
+ }
+
+ if (mc_server != NULL) {
+ struct server *sp;
+
+ if (mc_server->event_time != 0) {
+ mc_server->event_time = 0;
+ complete_servers++;
+ }
+ server = (struct server *)emalloc(sizeof(struct server));
+ memset((char *)server, 0, sizeof(struct server));
+
+ server->srcadr.sin_family = AF_INET;
+ server->srcadr.sin_addr.s_addr = netnum;
+ server->srcadr.sin_port = htons(NTP_PORT);
+
+ server->event_time = ++sys_numservers;
+ for (sp = sys_servers; sp->next_server != NULL;
+ sp = sp->next_server) ;
+ sp->next_server = server;
+ transmit(server);
}
- return 0;
+ return NULL;
}
@@ -1337,7 +1351,7 @@ findserver(
void
timer(void)
{
- register int i;
+ struct server *server;
/*
* Bump the current idea of the time
@@ -1349,10 +1363,11 @@ timer(void)
* who's event timers have expired. Give these to
* the transmit routine.
*/
- for (i = 0; i < sys_numservers; i++) {
- if (sys_servers[i]->event_time != 0
- && sys_servers[i]->event_time <= current_time)
- transmit(sys_servers[i]);
+ for (server = sys_servers; server != NULL;
+ server = server->next_server) {
+ if (server->event_time != 0
+ && server->event_time <= current_time)
+ transmit(server);
}
}
@@ -1826,7 +1841,8 @@ l_step_systime(
isneg = 0;
if (ftmp.l_ui >= 3) { /* Step it and slew - we might win */
- n = step_systime(ts);
+ LFPTOD(ts, dtemp);
+ n = step_systime(dtemp);
if (!n)
return n;
if (isneg)
diff --git a/contrib/ntp/ntpdc/Makefile.in b/contrib/ntp/ntpdc/Makefile.in
index 6466661fe79e..a796bc4ded21 100644
--- a/contrib/ntp/ntpdc/Makefile.in
+++ b/contrib/ntp/ntpdc/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
@@ -136,6 +140,8 @@ DIST_COMMON = README $(noinst_HEADERS) Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/ntpdc$U.Po $(DEPDIR)/ntpdc_ops$U.Po
SOURCES = $(ntpdc_SOURCES)
OBJECTS = $(am_ntpdc_OBJECTS)
@@ -143,9 +149,9 @@ all: all-redirect
.SUFFIXES:
.SUFFIXES: .c .o
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps ntpdc/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu ntpdc/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -178,9 +184,6 @@ uninstall-binPROGRAMS:
rm -f $(DESTDIR)$(bindir)/$$f; \
done
-.c.o:
- $(COMPILE) -c $<
-
mostlyclean-compile:
-rm -f *.o core *.core
@@ -205,8 +208,6 @@ clean-kr:
distclean-kr:
maintainer-clean-kr:
-ntpdc$U.o:
-ntpdc_ops$U.o:
ntpdc: $(ntpdc_OBJECTS) $(ntpdc_DEPENDENCIES)
@rm -f ntpdc
@@ -219,23 +220,27 @@ ntpdc_.o ntpdc_ops_.o : $(ANSI2KNR)
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -252,26 +257,33 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
-ntpdc.o: ntpdc.c ntpdc.h ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp.h ../include/ntp_request.h \
- ../include/ntp_string.h ../include/ntp_malloc.h \
- ../include/ntp_select.h ../include/ntp_io.h \
- ../include/ntp_stdlib.h ../include/l_stdlib.h
-ntpdc_ops.o: ntpdc_ops.c ../config.h ntpdc.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp.h \
- ../include/ntp_request.h ../include/ntp_string.h \
- ../include/ntp_malloc.h ../include/ntp_control.h \
- ../include/ntp_refclock.h ../include/recvbuff.h \
- ../include/ntp_stdlib.h ../include/l_stdlib.h
+
+@AMDEP@include $(DEPDIR)/ntpdc$U.Po
+@AMDEP@include $(DEPDIR)/ntpdc_ops$U.Po
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf $(DEPDIR)
+
+maintainer-clean-depend:
+
+@AMDEP@CCDEPMODE = @CCDEPMODE@
+
+.c.o:
+@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c -o $@ $<
info-am:
info: info-am
@@ -310,25 +322,28 @@ distclean-generic:
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
- mostlyclean-kr mostlyclean-tags mostlyclean-generic
+ mostlyclean-kr mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-binPROGRAMS clean-compile clean-kr clean-tags \
- clean-generic mostlyclean-am
+ clean-depend clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-binPROGRAMS distclean-compile distclean-kr \
- distclean-tags distclean-generic clean-am
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-binPROGRAMS \
maintainer-clean-compile maintainer-clean-kr \
- maintainer-clean-tags maintainer-clean-generic \
- distclean-am
+ maintainer-clean-tags maintainer-clean-depend \
+ maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -339,8 +354,9 @@ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \
-maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-exec-am install-exec \
+maintainer-clean-tags distdir mostlyclean-depend distclean-depend \
+clean-depend maintainer-clean-depend info-am info dvi-am dvi check \
+check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
diff --git a/contrib/ntp/ntpq/Makefile.in b/contrib/ntp/ntpq/Makefile.in
index 549840aa47b4..d84dd6760369 100644
--- a/contrib/ntp/ntpq/Makefile.in
+++ b/contrib/ntp/ntpq/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
@@ -136,6 +140,8 @@ DIST_COMMON = README $(noinst_HEADERS) Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/ntpq$U.Po $(DEPDIR)/ntpq_ops$U.Po
SOURCES = $(ntpq_SOURCES)
OBJECTS = $(am_ntpq_OBJECTS)
@@ -143,9 +149,9 @@ all: all-redirect
.SUFFIXES:
.SUFFIXES: .c .o
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps ntpq/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu ntpq/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -178,9 +184,6 @@ uninstall-binPROGRAMS:
rm -f $(DESTDIR)$(bindir)/$$f; \
done
-.c.o:
- $(COMPILE) -c $<
-
mostlyclean-compile:
-rm -f *.o core *.core
@@ -205,8 +208,6 @@ clean-kr:
distclean-kr:
maintainer-clean-kr:
-ntpq$U.o:
-ntpq_ops$U.o:
ntpq: $(ntpq_OBJECTS) $(ntpq_DEPENDENCIES)
@rm -f ntpq
@@ -219,23 +220,27 @@ ntpq_.o ntpq_ops_.o : $(ANSI2KNR)
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -252,25 +257,33 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
-ntpq.o: ntpq.c ntpq.h ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp.h ../include/ntp_control.h \
- ../include/ntp_string.h ../include/ntp_malloc.h \
- ../include/ntp_unixtime.h ../include/ntp_calendar.h \
- ../include/ntp_io.h ../include/ntp_select.h \
- ../include/ntp_stdlib.h ../include/l_stdlib.h
-ntpq_ops.o: ntpq_ops.c ntpq.h ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp.h ../include/ntp_control.h \
- ../include/ntp_string.h ../include/ntp_malloc.h \
- ../include/ntp_stdlib.h ../include/l_stdlib.h
+
+@AMDEP@include $(DEPDIR)/ntpq$U.Po
+@AMDEP@include $(DEPDIR)/ntpq_ops$U.Po
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf $(DEPDIR)
+
+maintainer-clean-depend:
+
+@AMDEP@CCDEPMODE = @CCDEPMODE@
+
+.c.o:
+@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c -o $@ $<
info-am:
info: info-am
@@ -309,25 +322,28 @@ distclean-generic:
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
- mostlyclean-kr mostlyclean-tags mostlyclean-generic
+ mostlyclean-kr mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-binPROGRAMS clean-compile clean-kr clean-tags \
- clean-generic mostlyclean-am
+ clean-depend clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-binPROGRAMS distclean-compile distclean-kr \
- distclean-tags distclean-generic clean-am
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-binPROGRAMS \
maintainer-clean-compile maintainer-clean-kr \
- maintainer-clean-tags maintainer-clean-generic \
- distclean-am
+ maintainer-clean-tags maintainer-clean-depend \
+ maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -338,8 +354,9 @@ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \
-maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-exec-am install-exec \
+maintainer-clean-tags distdir mostlyclean-depend distclean-depend \
+clean-depend maintainer-clean-depend info-am info dvi-am dvi check \
+check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
diff --git a/contrib/ntp/ntpq/ntpq.c b/contrib/ntp/ntpq/ntpq.c
index 3361e2bc1fd7..4d8c4b867137 100644
--- a/contrib/ntp/ntpq/ntpq.c
+++ b/contrib/ntp/ntpq/ntpq.c
@@ -336,7 +336,7 @@ struct xcmd builtins[] = {
#define DEFTIMEOUT (5) /* 5 second time out */
#define DEFSTIMEOUT (2) /* 2 second time out after first */
#define DEFDELAY 0x51EB852 /* 20 milliseconds, l_fp fraction */
-#define DEFHOST "localhost" /* default host name */
+#define DEFHOST "127.0.0.1" /* default host name */
#define LENHOSTNAME 256 /* host name is 256 characters long */
#define MAXCMDS 100 /* maximum commands on cmd line */
#define MAXHOSTS 200 /* maximum hosts on cmd line */
diff --git a/contrib/ntp/ntpq/ntpq_ops.c b/contrib/ntp/ntpq/ntpq_ops.c
index d43d228230f2..8827a8436444 100644
--- a/contrib/ntp/ntpq/ntpq_ops.c
+++ b/contrib/ntp/ntpq/ntpq_ops.c
@@ -1319,7 +1319,7 @@ doprintpeers(
l_fp rec;
l_fp ts;
u_char havevar[MAXHAVE];
- u_long poll;
+ u_long poll_sec;
char type = '?';
char refid_string[10];
char whenbuf[8], pollbuf[8];
@@ -1442,7 +1442,7 @@ doprintpeers(
/*
* Got everything, format the line
*/
- poll = 1<<max(min3(ppoll, hpoll, NTP_MAXPOLL), NTP_MINPOLL);
+ poll_sec = 1<<max(min3(ppoll, hpoll, NTP_MAXPOLL), NTP_MINPOLL);
if (pktversion > NTP_OLDVERSION)
c = flash3[CTL_PEER_STATVAL(rstatus) & 0x7];
else
@@ -1453,7 +1453,7 @@ doprintpeers(
"%c%-15.15s %-15.15s %2ld %c %4.4s %4.4s %3lo %7.7s %8.7s %7.7s\n",
c, nntohost(srcadr), dstadr_refid, stratum, type,
prettyinterval(whenbuf, when(&ts, &rec, &reftime)),
- prettyinterval(pollbuf, (int)poll), reach,
+ prettyinterval(pollbuf, (int)poll_sec), reach,
lfptoms(&estdelay, 3), lfptoms(&estoffset, 3),
havevar[HAVE_JITTER] ? lfptoms(&estjitter, 3) :
lfptoms(&estdisp, 3));
@@ -1535,13 +1535,15 @@ dopeers(
if (!dogetassoc(fp))
return;
- for (i = 0; i < numhosts; ++i)
- { if(getnetnum(chosts[i],&netnum,fullname))
- if ((int)strlen(fullname) > maxhostlen)
- maxhostlen = strlen(fullname);
- }
- if (numhosts > 1)
+ maxhostlen = 0;
+ if (numhosts > 1) {
+ for (i = 0; i < numhosts; ++i)
+ { if(getnetnum(chosts[i],&netnum,fullname))
+ if ((int)strlen(fullname) > maxhostlen)
+ maxhostlen = strlen(fullname);
+ }
(void) fprintf(fp, "%-*.*s ", maxhostlen, maxhostlen, "host");
+ }
(void) fprintf(fp,
" remote refid st t when poll reach delay offset jitter\n");
if (numhosts > 1)
diff --git a/contrib/ntp/ntptrace/Makefile.in b/contrib/ntp/ntptrace/Makefile.in
index 70d151c7acc7..35078e92227f 100644
--- a/contrib/ntp/ntptrace/Makefile.in
+++ b/contrib/ntp/ntptrace/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
@@ -134,6 +138,8 @@ DIST_COMMON = README $(noinst_HEADERS) Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/ntptrace$U.Po
SOURCES = ntptrace.c
OBJECTS = ntptrace$U.o
@@ -141,9 +147,9 @@ all: all-redirect
.SUFFIXES:
.SUFFIXES: .c .o
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps ntptrace/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu ntptrace/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -176,9 +182,6 @@ uninstall-binPROGRAMS:
rm -f $(DESTDIR)$(bindir)/$$f; \
done
-.c.o:
- $(COMPILE) -c $<
-
mostlyclean-compile:
-rm -f *.o core *.core
@@ -203,7 +206,6 @@ clean-kr:
distclean-kr:
maintainer-clean-kr:
-ntptrace$U.o:
ntptrace: $(ntptrace_OBJECTS) $(ntptrace_DEPENDENCIES)
@rm -f ntptrace
@@ -214,23 +216,27 @@ ntptrace_.o : $(ANSI2KNR)
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -247,19 +253,32 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
-ntptrace.o: ntptrace.c ../include/ntp_fp.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../config.h ../include/ntp_proto.h \
- ../include/ntp.h ../include/ntp_io.h ../include/ntp_unixtime.h \
- ntptrace.h ../include/ntp_string.h ../include/ntp_syslog.h \
- ../include/ntp_select.h ../include/ntp_stdlib.h \
- ../include/l_stdlib.h ../include/recvbuff.h
+
+@AMDEP@include $(DEPDIR)/ntptrace$U.Po
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf $(DEPDIR)
+
+maintainer-clean-depend:
+
+@AMDEP@CCDEPMODE = @CCDEPMODE@
+
+.c.o:
+@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c -o $@ $<
info-am:
info: info-am
@@ -298,25 +317,28 @@ distclean-generic:
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
- mostlyclean-kr mostlyclean-tags mostlyclean-generic
+ mostlyclean-kr mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-binPROGRAMS clean-compile clean-kr clean-tags \
- clean-generic mostlyclean-am
+ clean-depend clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-binPROGRAMS distclean-compile distclean-kr \
- distclean-tags distclean-generic clean-am
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-binPROGRAMS \
maintainer-clean-compile maintainer-clean-kr \
- maintainer-clean-tags maintainer-clean-generic \
- distclean-am
+ maintainer-clean-tags maintainer-clean-depend \
+ maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -327,8 +349,9 @@ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \
-maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
-installcheck-am installcheck install-exec-am install-exec \
+maintainer-clean-tags distdir mostlyclean-depend distclean-depend \
+clean-depend maintainer-clean-depend info-am info dvi-am dvi check \
+check-am installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all install-strip installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
diff --git a/contrib/ntp/ntptrace/ntptrace.c b/contrib/ntp/ntptrace/ntptrace.c
index d7a4140c05a6..d69e2b008cc9 100644
--- a/contrib/ntp/ntptrace/ntptrace.c
+++ b/contrib/ntp/ntptrace/ntptrace.c
@@ -88,6 +88,7 @@ static int getipaddr P((const char *, u_int32 *));
static int decodeipaddr P((const char *, u_int32 *));
static void printserver P((struct server *, FILE *));
static void printrefid P((FILE *, struct server *));
+void input_handler P((l_fp * x));
#ifdef SYS_WINNT
int on = 1;
diff --git a/contrib/ntp/parseutil/Makefile.in b/contrib/ntp/parseutil/Makefile.in
index 50cbc7ddbe17..1ca4785bb749 100644
--- a/contrib/ntp/parseutil/Makefile.in
+++ b/contrib/ntp/parseutil/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
@@ -133,6 +137,8 @@ DIST_COMMON = README Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/dcfd$U.Po $(DEPDIR)/testdcf$U.Po
SOURCES = dcfd.c testdcf.c
OBJECTS = dcfd$U.o testdcf$U.o
@@ -140,9 +146,9 @@ all: all-redirect
.SUFFIXES:
.SUFFIXES: .c .o
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps parseutil/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu parseutil/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -156,9 +162,6 @@ distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS:
-.c.o:
- $(COMPILE) -c $<
-
mostlyclean-compile:
-rm -f *.o core *.core
@@ -183,12 +186,10 @@ clean-kr:
distclean-kr:
maintainer-clean-kr:
-dcfd$U.o:
dcfd: $(dcfd_OBJECTS) $(dcfd_DEPENDENCIES)
@rm -f dcfd
$(LINK) $(dcfd_LDFLAGS) $(dcfd_OBJECTS) $(dcfd_LDADD) $(LIBS)
-testdcf$U.o:
testdcf: $(testdcf_OBJECTS) $(testdcf_DEPENDENCIES)
@rm -f testdcf
@@ -201,23 +202,27 @@ dcfd_.o testdcf_.o : $(ANSI2KNR)
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -234,23 +239,33 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
-dcfd.o dcfd.lo: dcfd.c ../config.h ../include/ntp_stdlib.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp_string.h \
- ../include/l_stdlib.h ../include/ntpd.h ../include/ntp_syslog.h \
- ../include/ntp_fp.h ../include/ntp.h ../include/ntp_malloc.h \
- ../include/ntp_refclock.h ../include/recvbuff.h
-testdcf.o testdcf.lo: testdcf.c ../include/ntp_stdlib.h \
- ../include/ntp_types.h ../include/ntp_machine.h ../config.h \
- ../include/ntp_proto.h ../include/ntp_string.h \
- ../include/l_stdlib.h
+
+@AMDEP@include $(DEPDIR)/dcfd$U.Po
+@AMDEP@include $(DEPDIR)/testdcf$U.Po
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf $(DEPDIR)
+
+maintainer-clean-depend:
+
+@AMDEP@CCDEPMODE = @CCDEPMODE@
+
+.c.o:
+@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c -o $@ $<
info-am:
info: info-am
@@ -288,25 +303,28 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \
- mostlyclean-kr mostlyclean-tags mostlyclean-generic
+ mostlyclean-kr mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-noinstPROGRAMS clean-compile clean-kr clean-tags \
- clean-generic mostlyclean-am
+ clean-depend clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-kr \
- distclean-tags distclean-generic clean-am
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-noinstPROGRAMS \
maintainer-clean-compile maintainer-clean-kr \
- maintainer-clean-tags maintainer-clean-generic \
- distclean-am
+ maintainer-clean-tags maintainer-clean-depend \
+ maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -317,12 +335,13 @@ clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \
-maintainer-clean-tags distdir info-am info dvi-am dvi check-local check \
-check-am installcheck-am installcheck install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all install-strip installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+maintainer-clean-tags distdir mostlyclean-depend distclean-depend \
+clean-depend maintainer-clean-depend info-am info dvi-am dvi \
+check-local check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all install-strip \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
#EXTRA_DIST= TAGS
diff --git a/contrib/ntp/scripts/Makefile.in b/contrib/ntp/scripts/Makefile.in
index 008640b5d86e..bc662fbe053f 100644
--- a/contrib/ntp/scripts/Makefile.in
+++ b/contrib/ntp/scripts/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
noinst_SCRIPTS = mkver ntpver
@@ -129,15 +133,10 @@ TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
distdir: $(DISTFILES)
- here=`cd $(top_builddir) && pwd`; \
- top_distdir=`cd $(top_distdir) && pwd`; \
- distdir=`cd $(distdir) && pwd`; \
- cd $(top_srcdir) \
- && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu scripts/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
@@ -179,6 +178,7 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-generic
mostlyclean: mostlyclean-am
diff --git a/contrib/ntp/scripts/README b/contrib/ntp/scripts/README
index 37442f152998..9e2946748b45 100644
--- a/contrib/ntp/scripts/README
+++ b/contrib/ntp/scripts/README
@@ -6,6 +6,9 @@ files in the parent directory for directions on how to use these files.
calc_tickadj Calculates "optimal" value for tick given ntp.drift file
+freq_adj Calculates and optionally sets the clock frequency
+ based on ntp.drift . For FreeBSD systems.
+
mkver.in script to create new version numbers for all sources
monitoring directory containing perl scripts useful for monitoring
@@ -20,6 +23,10 @@ ntp-groper script useful for reaching out and rattling the cages of
ntp-restart script useful for killing and restarting the NTP daemon
+ntpsweep prints per host given in <file> the NTP stratum level, the
+ clock offset in seconds, the daemon version, the operating
+ system and the processor.
+
ntpver What version of the NTP daemon is running?
stats directory containing awk and shell scripts useful for
diff --git a/contrib/ntp/scripts/freq_adj b/contrib/ntp/scripts/freq_adj
new file mode 100755
index 000000000000..4af431663f66
--- /dev/null
+++ b/contrib/ntp/scripts/freq_adj
@@ -0,0 +1,97 @@
+#! /usr/bin/perl -w
+
+die "perl5 needed\n" unless ($] > 5);
+
+use Getopt::Std;
+use vars qw($opt_n);
+
+getopts('d:nt:');
+
+#chop($ncpu = `sysctl -n hw.ncpu`);
+#die "Found $ncpu CPUs; can only be run on systems with 1 CPU.\n" if ($ncpu > 1);
+
+$driftfile = "/etc/ntp.drift";
+$driftfile = $opt_d if defined($opt_d);
+
+chop($timer = `sysctl -n kern.timecounter.hardware 2> /dev/null`);
+
+$timer =~ tr/\U/\L/;
+
+if ($timer eq '') {
+ open(DM, "/var/run/dmesg.boot");
+ while(<DM>) {
+ # Timecounter "i8254" frequency 1193182 Hz
+ if (/^Timecounter "(\w+)"\s+/) {
+ $timer = $1;
+ last;
+ }
+ }
+ close(DM);
+}
+
+$opt_t = $timer if !defined($opt_t);
+
+if ($timer ne '') { # $timer found...
+ if ($opt_t ne '') { # - and $opt_t found
+ if ($timer ne $opt_t) { # - - and they differ
+ warn "You specified a $opt_t timer but I detected a $timer timer.\n";
+ usage();
+ exit 1;
+ } else { # - - and they are the same
+ ;
+ }
+ } else { # - but no $opt_t specified; this is OK
+ ;
+ }
+} else { # No $timer found...
+ if ($opt_t ne '') { # - but $opt_t was specified
+ $timer = $opt_t; # - - so use it.
+ } else { # - and neither was $opt_t
+ warn "I can't tell what timer you have. Please specify one.\n";
+ usage();
+ exit 1;
+ }
+}
+
+open(DF, $driftfile) || die "Can't open driftfile ($driftfile): $!\n";
+while(<DF>) {
+ chop;
+ if (/^(-?\d+\.\d+)(\s\d)?$/) {
+ $drift = $1;
+ } else {
+ die "Bogus value in driftfile $driftfile: <$_>\n";
+ }
+}
+close(DF);
+
+print "NTP drift is <$drift>\n";
+
+# Convert from NTP's idea of PPM to a decimal equivalent
+$freq_adj = int ( $drift * ( 10 ** 6 / 2 ** 20) );
+print "normalized freq_adj is <$freq_adj>\n";
+
+$freq_adj = int ( ( $freq_adj - 1 ) / 2 );
+print "Applying freq_adj of <".-$freq_adj.">\n";
+
+$sysctl = "machdep.".$timer."_freq";
+
+chop($mach_freq = `sysctl -n $sysctl`);
+
+print "$sysctl is <$mach_freq>\n";
+
+$n_mach_freq = $mach_freq - $freq_adj;
+
+if (defined($opt_n)) {
+ print "$sysctl $mach_freq -> $n_mach_freq\n";
+} else {
+ print "i8254: ".`sysctl -w $sysctl=$n_mach_freq`;
+}
+
+sub usage {
+ print STDERR <<EOUsage
+Usage: $0 [-d drift_file] [-n] [-t timer]
+where "drift_file" defaults to /etc/ntp.drift
+and "timer" is usually "tsc" or "i8254"
+and "-n" says "don't really change anything, just say what would happen".
+EOUsage
+}
diff --git a/contrib/ntp/scripts/ntp-status b/contrib/ntp/scripts/ntp-status
new file mode 100755
index 000000000000..4109124eedb6
--- /dev/null
+++ b/contrib/ntp/scripts/ntp-status
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# From: Marc Brett <Marc.Brett@westgeo.com>
+
+# Here's a quick hack which can give you the stratum, delay, offset
+# for any number of ntp servers.
+
+NTPDATE=/usr/local/bin/ntpdate
+NSLOOKUP=/usr/sbin/nslookup
+EGREP=/bin/egrep
+AWK=/bin/awk
+RM=/bin/rm
+FILE=/tmp/ntp.$$
+
+USAGE="Usage: $0 hostname [hostname ...]"
+
+if [ $# -le 0 ]
+then
+ echo $USAGE 2>&1
+ exit 1
+fi
+
+trap '$RM -f $FILE; exit' 1 2 3 4 13 15
+
+for HOST in $*
+do
+ HOSTNAME=`$NSLOOKUP $HOST | $EGREP "Name:" | $AWK '{print $2}'`
+ if [ -n "$HOSTNAME" ]
+ then
+ $NTPDATE -d $HOST 2>/dev/null | $EGREP '^stratum|^delay|^offset|^originate' > $FILE
+ STRATUM=`$EGREP '^stratum' $FILE | $AWK '{print $2}'`
+ OFFSET=`$EGREP '^offset' $FILE | $AWK '{print $2}'`
+ DELAY=`$EGREP '^delay' $FILE | $AWK '{print $2}'`
+ TIMESTAMP=`$EGREP '^originate' $FILE | $AWK '{print $4 " " $5 " " $6 " " $7 " " $8}'`
+ if [ "$STRATUM" -ne 0 ]
+ then
+ echo "$HOSTNAME: stratum:$STRATUM delay:$DELAY offset:$OFFSET $TIMESTAMP"
+ else
+ echo $HOSTNAME: Not running NTP
+ fi
+ fi
+
+done
+
+$RM -f $FILE
diff --git a/contrib/ntp/scripts/ntpsweep b/contrib/ntp/scripts/ntpsweep
new file mode 100755
index 000000000000..ab2e884cd5a0
--- /dev/null
+++ b/contrib/ntp/scripts/ntpsweep
@@ -0,0 +1,301 @@
+#!/usr/local/bin/perl -w
+#
+# $Id: ntpsweep,v 1.3 2000/01/15 07:37:52 stenn Exp $
+#
+# DISCLAIMER
+#
+# Copyright (C) 1999,2000 Hans Lambermont and Origin B.V.
+#
+# Permission to use, copy, modify and distribute this software and its
+# documentation for any purpose and without fee is hereby granted,
+# provided that the above copyright notice appears in all copies and
+# that both the copyright notice and this permission notice appear in
+# supporting documentation. This software is supported as is and without
+# any express or implied warranties, including, without limitation, the
+# implied warranties of merchantability and fitness for a particular
+# purpose. The name Origin B.V. must not be used to endorse or promote
+# products derived from this software without prior written permission.
+#
+# Hans Lambermont <Hans.Lambermont@nl.origin-it.com>/<H.Lambermont@chello.nl>
+# 14 Jan 2000
+
+require 5.0; # But actually tested on 5.004 ;)
+use Getopt::Long; # GetOptions()
+use strict;
+
+my $version = 1.3;
+(my $program = $0) =~ s%.*/(.+?)(.pl)?$%$1%;
+
+# Hardcoded paths/program names
+my $ntpdate = "ntpdate";
+my $ntpq = "ntpq";
+
+# no STDOUT buffering
+$| = 1;
+
+my ($help, $single_host, $showpeers, $maxlevel, $strip, $askversion);
+my $res = GetOptions("help!" => \$help,
+ "host=s" => \$single_host,
+ "peers!" => \$showpeers,
+ "maxlevel=s" => \$maxlevel,
+ "strip=s" => \$strip,
+ "version!" => \$askversion);
+
+if ($askversion) {
+ print("$version\n");
+ exit 0;
+}
+
+if ($help || ((@ARGV != 1) && !$single_host)) {
+ warn <<EOF;
+This is $program, version $version
+Copyright (C) 1999,2000 Hans Lambermont and Origin B.V. Disclaimer inside.
+
+Usage:
+ $program [--help|--peers|--strip <string>|--maxlevel <level>|--version] \\
+ <file>|[--host <hostname>]
+
+Description:
+ $program prints per host given in <file> the NTP stratum level, the
+ clock offset in seconds, the daemon version, the operating system and
+ the processor. Optionally recursing through all peers.
+
+Options:
+--help
+ Print this short help text and exit.
+--version
+ Print version ($version) and exit.
+<file>
+ Specify hosts file. File format is one hostname or ip number per line.
+ Lines beginning with # are considered as comment.
+--host <hostname>
+ Speficy a single host, bypassing the need for a hosts file.
+--peers
+ Recursively list all peers a host synchronizes to.
+ An '= ' before a peer means a loop. Recursion stops here.
+--maxlevel <level>
+ Traverse peers up to this level (4 is a reasonable number).
+--strip <string>
+ Strip <string> from hostnames.
+
+Examples:
+ $program myhosts.txt --strip .foo.com
+ $program --host some.host --peers --maxlevel 4
+EOF
+ exit 1;
+}
+
+my $hostsfile = shift;
+my (@hosts, @known_hosts);
+my (%known_host_info, %known_host_peers);
+
+sub read_hosts()
+{
+ local *HOSTS;
+ open (HOSTS, $hostsfile) ||
+ die "$program: FATAL: unable to read $hostsfile: $!\n";
+ while (<HOSTS>) {
+ next if /^\s*(#|$)/; # comment/empty
+ chomp;
+ push(@hosts, $_);
+ }
+ close(HOSTS);
+}
+
+# translate IP to hostname if possible
+sub ip2name {
+ my($ip) = @_;
+ my($addr, $name, $aliases, $addrtype, $length, @addrs);
+ $addr = pack('C4', split(/\./, $ip));
+ ($name, $aliases, $addrtype, $length, @addrs) = gethostbyaddr($addr, 2);
+ if ($name) {
+ # return lower case name
+ return("\L$name");
+ } else {
+ return($ip);
+ }
+}
+
+# item_in_list($item, @list): returns 1 if $item is in @list, 0 if not
+sub item_in_list {
+ my($item, @list) = @_;
+ my($i);
+ foreach $i (@list) {
+ return 1 if ($item eq $i);
+ }
+ return 0;
+}
+
+sub scan_host($;$;$) {
+ my($host, $level, @trace) = @_;
+ my $stratum = 0;
+ my $offset = 0;
+ my $daemonversion = "";
+ my $system = "";
+ my $processor = "";
+ my @peers;
+ my $known_host = 0;
+
+ if (&item_in_list($host, @known_hosts)) {
+ $known_host = 1;
+ } else {
+ # ntpdate part
+ open(NTPDATE, "$ntpdate -bd $host 2>/dev/null |") ||
+ die "Cannot open ntpdate pipe: $!\n";
+ while (<NTPDATE>) {
+ /^stratum\s+(\d+).*$/ && do {
+ $stratum = $1;
+ };
+ /^offset\s+([0-9.-]+)$/ && do {
+ $offset = $1;
+ };
+ }
+ close(NTPDATE);
+
+ # got answers ? If so, go on.
+ if ($stratum) {
+ # ntpq part
+ my $ntpqparams = "-c 'rv 0 processor,system,daemon_version'";
+ open(NTPQ, "$ntpq $ntpqparams $host 2>/dev/null |") ||
+ die "Cannot open ntpq pipe: $!\n";
+ while (<NTPQ>) {
+ /daemon_version="(.*)"/ && do {
+ $daemonversion = $1;
+ };
+ /system="([^"]*)"/ && do {
+ $system = $1;
+ };
+ /processor="([^"]*)"/ && do {
+ $processor = $1;
+ };
+ }
+ close(NTPQ);
+
+ # Shorten daemon_version string.
+ $daemonversion =~ s/(;|Mon|Tue|Wed|Thu|Fri|Sat|Sun).*$//;
+ $daemonversion =~ s/version=//;
+ $daemonversion =~ s/(x|)ntpd //;
+ $daemonversion =~ s/(\(|\))//g;
+ $daemonversion =~ s/beta/b/;
+ $daemonversion =~ s/multicast/mc/;
+
+ # Shorten system string
+ $system =~ s/UNIX\///;
+ $system =~ s/RELEASE/r/;
+ $system =~ s/CURRENT/c/;
+
+ # Shorten processor string
+ $processor =~ s/unknown//;
+ }
+
+ # got answers ? If so, go on.
+ if ($daemonversion) {
+ # ntpq again, find out the peers this time
+ if ($showpeers) {
+ my $ntpqparams = "-pn";
+ open(NTPQ, "$ntpq $ntpqparams $host 2>/dev/null |") ||
+ die "Cannot open ntpq pipe: $!\n";
+ while (<NTPQ>) {
+ /^No association ID's returned$/ && do {
+ last;
+ };
+ /^ remote/ && do {
+ next;
+ };
+ /^==/ && do {
+ next;
+ };
+ /^( |x|\.|-|\+|#|\*|o)([^ ]+)/ && do {
+ push(@peers, ip2name($2));
+ next;
+ };
+ print "ERROR: $_";
+ }
+ close(NTPQ);
+ }
+ }
+
+ # Add scanned host to known_hosts array
+ push(@known_hosts, $host);
+ if ($stratum) {
+ $known_host_info{$host} = sprintf("%2d %9.3f %-11s %-12s %s",
+ $stratum, $offset, substr($daemonversion,0,11),
+ substr($system,0,12), substr($processor,0,9));
+ } else {
+ # Stratum level 0 is consider invalid
+ $known_host_info{$host} = sprintf(" ?");
+ }
+ $known_host_peers{$host} = [@peers];
+ }
+
+ if ($stratum || $known_host) { # Valid or known host
+ my $printhost = ' ' x $level . $host;
+ # Shorten host string
+ if ($strip) {
+ $printhost =~ s/$strip//;
+ }
+ # append number of peers in brackets if requested and valid
+ if ($showpeers && ($known_host_info{$host} ne " ?")) {
+ $printhost .= " (" . @{$known_host_peers{$host}} . ")";
+ }
+ # Finally print complete host line
+ printf("%-32s %s\n",
+ substr($printhost,0,32), $known_host_info{$host});
+ if ($showpeers && (eval($maxlevel ? $level < $maxlevel : 1))) {
+ my $peer;
+ push(@trace, $host);
+ # Loop through peers
+ foreach $peer (@{$known_host_peers{$host}}) {
+ if (&item_in_list($peer, @trace)) {
+ # we've detected a loop !
+ $printhost = ' ' x ($level + 1) . "= " . $peer;
+ # Shorten host string
+ if ($strip) {
+ $printhost =~ s/$strip//;
+ }
+ printf("%-32s %s\n",
+ substr($printhost,0,32));
+ } else {
+ if (substr($peer,0,3) ne "127") {
+ &scan_host($peer, $level + 1, @trace);
+ }
+ }
+ }
+ }
+ } else { # We did not get answers from this host
+ my $printhost = ' ' x $level . $host;
+ # Shorten host string
+ if ($strip) {
+ $printhost =~ s/$strip//;
+ }
+ printf("%-32s ?\n", substr($printhost,0,32));
+ }
+}
+
+sub scan_hosts()
+{
+ my $host;
+ for $host (@hosts) {
+ my @trace;
+ push(@trace, $host);
+ scan_host($host, 0, @trace);
+ }
+}
+
+# Main program
+
+if ($single_host) {
+ push(@hosts, $single_host);
+} else {
+ &read_hosts($hostsfile);
+}
+
+# Print header
+print <<EOF;
+Host st offset(s) version system processor
+--------------------------------+--+---------+-----------+------------+---------
+EOF
+
+&scan_hosts();
+
+exit 0;
diff --git a/contrib/ntp/scripts/plot_summary.pl b/contrib/ntp/scripts/plot_summary.pl
index 5be018287911..b0e9a4a1ad7f 100755
--- a/contrib/ntp/scripts/plot_summary.pl
+++ b/contrib/ntp/scripts/plot_summary.pl
@@ -1,10 +1,10 @@
#!/usr/bin/perl -w
-# $Id: plot_summary.pl,v 1.1.1.1 1999/05/26 00:48:25 stenn Exp $
+# $Id: plot_summary.pl,v 1.2 1999/12/02 01:59:05 stenn Exp $
#
# Use Gnuplot to display data in summary files produced by summary.pl.
-# This script requires GNUPLOT 3.6 (pre 3.6 beta 319)!
+# This script requires GNUPLOT 3.7!
#
-# Copyright (c) 1997, Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+# Copyright (c) 1997, 1999 by Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
#
# 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
@@ -28,7 +28,7 @@ use Getopt::Long;
# parse command line
my $summary_dir = "/tmp";
-my $identifier = `hostname`; # origin of these data
+my $identifier = "host " . `hostname`; # origin of these data
chomp $identifier; # remove newline
my $offset_limit = 0.128; # limit of absolute offset
my $output_file = ""; # output file defaults to stdout
@@ -37,24 +37,27 @@ my $gnuplot_terminal = $ENV{DISPLAY} ? "x11" : "dumb";
my $wait_after_plot = 1;
my @peer_list = ();
-my %options = ("directory=s" => \$summary_dir,
+my %options = ("directory|input-directory=s" => \$summary_dir,
"identifier=s" => \$identifier,
"offset-limit=f" => \$offset_limit,
"output-file=s" => \$output_file,
"peer=s@" => \@peer_list,
- "plot-term=s" => \$gnuplot_terminal,
+ "plot-term|gnuplot-term=s" => \$gnuplot_terminal,
"wait-after-plot!" => \$wait_after_plot,
);
-if ( !GetOptions(%options) ) {
- print STDERR "usage: $0\n";
+
+if ( !GetOptions(%options) )
+{
+ print STDERR "valid options for $0 are:\n";
my $opt;
foreach $opt (sort(keys %options)) {
- print STDERR "\t--$opt ";
+ print STDERR "\t--$opt\t(default is ";
if ( ref($options{$opt}) eq "ARRAY" ) {
- print STDERR "(" . join (" ", @{$options{$opt}}) . ")\n";
+ print STDERR join(", ", map { "'$_'" } @{$options{$opt}});
} else {
- print STDERR "(${$options{$opt}})\n";
- }
+ print STDERR "'${$options{$opt}}'";
+ }
+ print STDERR ")\n";
}
print STDERR "\n";
die;
@@ -120,7 +123,7 @@ sub do_loop
# loops.19960405
$_ = $Fld[0]; s/.*([12]\d{3}[01]\d[0-3]\d)$/$1/;
m/(\d{4})(\d{2})(\d{2})/;
- $line = timegm (59, 59, 23, $3, $2 - 1, $1 - 1900, 0, 0, 0);
+ $line = timegm(59, 59, 23, $3, $2 - 1, $1 - 1900, 0, 0, 0);
$line = int $line / 86400; # days relative to 1970
$first_day = "$1-$2-$3 ($line)" unless $day_out;
next;
@@ -163,6 +166,7 @@ sub do_loop
} else {
$ylimit = "[] $ylimit]";
}
+# build command file for GNUplot
open OUTPUT, "> $cmd_file" or die "$cmd_file: $!";
my $oldfh = select OUTPUT;
print "set term $gnuplot_terminal\n";
@@ -199,7 +203,7 @@ sub do_loop
print "set nomultiplot\n";
maybe_add_pause;
- my $ylimit = "[";
+ $ylimit = "[";
if ($min_rms < -$offset_limit) {
$ylimit .= "-$offset_limit";
}
@@ -208,7 +212,7 @@ sub do_loop
$ylimit .= "$offset_limit";
}
if ( $ylimit eq "[:" ) {
- $ylimit = "";
+ $ylimit ="";
} else {
$ylimit = "[] $ylimit]";
}
@@ -261,7 +265,7 @@ sub do_peer
# peers.19960405
$_ = $Fld[0]; s/.*([12]\d{3}[01]\d[0-3]\d)$/$1/;
m/(\d{4})(\d{2})(\d{2})/ or next;
- $line = timegm (59, 59, 23, $3, $2 - 1, $1 - 1900, 0, 0, 0);
+ $line = timegm(59, 59, 23, $3, $2 - 1, $1 - 1900, 0, 0, 0);
$line = int $line / 86400; # days relative to 1970
$first_day = "$1-$2-$3 ($line)" unless $day_out;
next;
diff --git a/contrib/ntp/scripts/summary.pl b/contrib/ntp/scripts/summary.pl
index c9deda9f1373..7145579fdc8b 100644
--- a/contrib/ntp/scripts/summary.pl
+++ b/contrib/ntp/scripts/summary.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl -w
-# $Id: summary.pl,v 1.1.1.1 1999/05/26 00:48:25 stenn Exp $
+# $Id: summary.pl,v 1.2 1999/12/02 01:59:07 stenn Exp $
# Perl version of (summary.sh, loop.awk, peer.awk):
# Create summaries from xntpd's loop and peer statistics.
#
-# Copyright (c) 1997, Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
+# Copyright (c) 1997, 1999 by Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
#
# 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
@@ -24,13 +24,16 @@ use strict;
use Getopt::Long;
-my $statsdir = ".";
+my $log_date_pattern = '[12]\d{3}[01]\d[0-3]\d';
+my $statsdir = "/var/log/ntp"; # directory with input files
+my $outputdir = "/tmp"; # directory for output files
my $skip_time_steps = 3600.0; # ignore time offsets larger that this
-my $startdate = "19700101"; # first data file to use
+my $startdate = "19700101"; # first data file to use (YYYYMMDD)
my $enddate=`date -u +%Y%m%d`; chomp $enddate; --$enddate;
my $peer_dist_limit = 400.0;
-my %options = ("directory=s" => \$statsdir,
+my %options = ("directory|input-directory=s" => \$statsdir,
+ "output-directory=s" => \$outputdir,
"skip-time-steps:f" => \$skip_time_steps,
"start-date=s" => \$startdate,
"end-date=s" => \$enddate,
@@ -41,24 +44,27 @@ if ( !GetOptions(%options) )
print STDERR "valid options for $0 are:\n";
my $opt;
foreach $opt (sort(keys %options)) {
- print STDERR "\t--$opt ";
+ print STDERR "\t--$opt\t(default is ";
if ( ref($options{$opt}) eq "ARRAY" ) {
- print STDERR "(" . join (" ", @{$options{$opt}}) . ")\n";
+ print STDERR join(", ", map { "'$_'" } @{$options{$opt}});
} else {
- print STDERR "(${$options{$opt}})\n";
- }
+ print STDERR "'${$options{$opt}}'";
+ }
+ print STDERR ")\n";
}
print STDERR "\n";
die;
}
+# check possibly current values of options
die "$statsdir: no such directory" unless (-d $statsdir);
+die "$outputdir: no such directory" unless (-d $outputdir);
die "$skip_time_steps: skip-time-steps must be positive"
unless ($skip_time_steps >= 0.0);
-die "$startdate: invalid start date"
- unless ($startdate =~ m/.*([12]\d{3}[01]\d[0-3]\d)$/);
+die "$startdate: invalid start date|$`|$&|$'"
+ unless ($startdate =~ m/.*$log_date_pattern$/);
die "$enddate: invalid end date"
- unless ($enddate =~ m/.*([12]\d{3}[01]\d[0-3]\d)$/);
+ unless ($enddate =~ m/.*$log_date_pattern$/);
$skip_time_steps = 0.128 if ($skip_time_steps == 0);
@@ -81,7 +87,7 @@ sub do_loop
{
my ($directory, $fname, $out_file) = @_;
print "$directory/$fname\n";
- open INPUT, "$directory/$fname";
+ open INPUT, "$directory/$fname" or warn "can't open $directory/$fname: $!";
open OUTPUT, ">>$out_file" or die "can't open $out_file: $!";
print OUTPUT "$fname\n";
my ($loop_tmax, $loop_fmax) = (-1e9, -1e9);
@@ -96,7 +102,10 @@ sub do_loop
chop; # strip record separator
@Fld = split;
next if ($#Fld < 4);
-# 50529 74356.259 -0.000112 16.1230 8
+#NTPv3: 50529 74356.259 -0.000112 16.1230 8
+#NTPv3: day, sec.msec, offset, drift_comp, sys_poll
+#NTPv4: 51333 54734.582 0.000001648 16.981964 0.000001094 0.020938 6
+#NTPv4: day, sec.msec, offset, drift_comp, sys_error, clock_stabil, sys_poll
if ($Fld[2] > $skip_time_steps || $Fld[2] < -$skip_time_steps) {
warn "ignoring loop offset $Fld[2] (file $fname, line $.)\n";
next
@@ -147,7 +156,7 @@ sub do_peer
{
my ($directory, $fname, $out_file) = @_;
print "$directory/$fname\n";
- open INPUT, "$directory/$fname";
+ open INPUT, "$directory/$fname" or warn "can't open $directory/$fname: $!";
open OUTPUT, ">>$out_file" or die "can't open $out_file: $!";
print OUTPUT "$fname\n";
# we toss out all distances greater than one second on the assumption the
@@ -169,7 +178,11 @@ sub do_peer
chop; # strip record separator
@Fld = split;
next if ($#Fld < 6);
-# 50529 83316.249 127.127.8.1 9674 0.008628 0.00000 0.00700
+#NTPv3: 50529 83316.249 127.127.8.1 9674 0.008628 0.00000 0.00700
+#NTPv3: day, sec.msec, addr, status, offset, delay, dispersion
+#NTPv4: 51333 56042.037 127.127.8.1 94f5 -0.000014657 0.000000000 0.000000000 0.000013214
+#NTPv4: day, sec.msec, addr, status, offset, delay, dispersion, skew
+
$dist = $Fld[6] + $Fld[5] / 2;
next if ($dist > $MAXDISTANCE);
$offs = $Fld[4];
@@ -211,8 +224,9 @@ sub do_peer
for ($i = 0; $i < $n; $i++) {
next if $peer_count{$i} < 2;
$peer_time{$i} /= $peer_count{$i};
- $peer_time_rms{$i} = sqrt($peer_time_rms{$i} / $peer_count{$i} -
- $peer_time{$i} * $peer_time{$i});
+ eval { $peer_time_rms{$i} = sqrt($peer_time_rms{$i} / $peer_count{$i} -
+ $peer_time{$i} * $peer_time{$i}); };
+ $peer_time_rms{$i} = 0, warn $@ if $@;
$peer_delay{$i} /= $peer_count{$i};
$peer_disp{$i} /= $peer_count{$i};
$peer_tmax{$i} = $peer_tmax{$i} - $peer_time{$i};
@@ -303,8 +317,9 @@ sub peer_summary
for ($i = 0; $i < $n; $i++) {
next if ($peer_count{$i} < 2);
$peer_mean{$i} /= $peer_count{$i};
- $peer_var{$i} = sqrt($peer_var{$i} / $peer_count{$i} -
- $peer_mean{$i} * $peer_mean{$i});
+ eval { $peer_var{$i} = sqrt($peer_var{$i} / $peer_count{$i} -
+ $peer_mean{$i} * $peer_mean{$i}); };
+ $peer_var{$i} = 0, warn $@ if $@;
push @lines, sprintf
"%-15s %3d %9.3f% 9.3f %9.3f %3d %3d %3d %3d\n",
$peer_ident{$i}, $peer_count{$i}, $peer_mean{$i}, $peer_var{$i},
@@ -313,41 +328,42 @@ sub peer_summary
print sort @lines;
}
-my $loop_summary="/tmp/loop_summary";
-my $peer_summary="/tmp/peer_summary";
-my $clock_summary="/tmp/clock_summary";
+my $loop_summary="$outputdir/loop_summary";
+my $peer_summary="$outputdir/peer_summary";
+my $clock_summary="$outputdir/clock_summary";
my (@loopfiles, @peerfiles, @clockfiles);
print STDERR "Creating summaries from $statsdir ($startdate to $enddate)\n";
opendir SDIR, $statsdir or die "directory ${statsdir}: $!";
rewinddir SDIR;
-@loopfiles=sort grep /loop.*[12]\d{3}[01]\d[0-3]\d/, readdir SDIR;
+@loopfiles=sort grep /loop.*$log_date_pattern/, readdir SDIR;
rewinddir SDIR;
-@peerfiles=sort grep /peer.*[12]\d{3}[01]\d[0-3]\d/, readdir SDIR;
+@peerfiles=sort grep /peer.*$log_date_pattern/, readdir SDIR;
rewinddir SDIR;
-@clockfiles=sort grep /clock.*[12]\d{3}[01]\d[0-3]\d/, readdir SDIR;
+@clockfiles=sort grep /clock.*$log_date_pattern/, readdir SDIR;
closedir SDIR;
+# remove old summary files
map { unlink $_ if -f $_ } ($loop_summary, $peer_summary, $clock_summary);
my $date;
map {
- $date = $_; $date =~ s/.*([12]\d{3}[01]\d[0-3]\d)$/$1/;
+ $date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
if ($date ge $startdate && $date le $enddate) {
do_loop $statsdir, $_, $loop_summary;
}
} @loopfiles;
map {
- $date = $_; $date =~ s/.*([12]\d{3}[01]\d[0-3]\d)$/$1/;
+ $date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
if ($date ge $startdate && $date le $enddate) {
do_peer $statsdir, $_, $peer_summary;
}
} @peerfiles;
map {
- $date = $_; $date =~ s/.*([12]\d{3}[01]\d[0-3]\d)$/$1/;
+ $date = $_; $date =~ s/.*($log_date_pattern)$/$1/;
if ($date ge $startdate && $date le $enddate) {
do_clock $statsdir, $_, $clock_summary;
}
diff --git a/contrib/ntp/util/Makefile.in b/contrib/ntp/util/Makefile.in
index 6de4f225863a..bf37e56b2ae2 100644
--- a/contrib/ntp/util/Makefile.in
+++ b/contrib/ntp/util/Makefile.in
@@ -63,15 +63,18 @@ host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
+AMDEP = @AMDEP@
AMTAR = @AMTAR@
-AMTARFLAGS = @AMTARFLAGS@
AWK = @AWK@
CC = @CC@
CFLAGS = @CFLAGS@
CHUTEST = @CHUTEST@
CLKTEST = @CLKTEST@
CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
DCFD = @DCFD@
+DEPDIR = @DEPDIR@
LDFLAGS = @LDFLAGS@
LIBPARSE = @LIBPARSE@
LIBRSAREF = @LIBRSAREF@
@@ -93,6 +96,7 @@ RSAREF = @RSAREF@
TESTDCF = @TESTDCF@
U = @U@
VERSION = @VERSION@
+install_sh = @install_sh@
#AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies
@@ -186,6 +190,12 @@ DIST_COMMON = README Makefile.am Makefile.in ansi2knr.1 ansi2knr.c
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
GZIP_ENV = --best
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+DEP_FILES = @AMDEP@ $(DEPDIR)/byteorder$U.Po $(DEPDIR)/hist$U.Po \
+$(DEPDIR)/jitter$U.Po $(DEPDIR)/kern$U.Po $(DEPDIR)/longsize$U.Po \
+$(DEPDIR)/ntptime$U.Po $(DEPDIR)/precision$U.Po $(DEPDIR)/sht$U.Po \
+$(DEPDIR)/testrs6000$U.Po $(DEPDIR)/tickadj$U.Po \
+$(DEPDIR)/timetrim$U.Po
SOURCES = byteorder.c hist.c jitter.c kern.c longsize.c ntptime.c precision.c sht.c testrs6000.c tickadj.c timetrim.c
OBJECTS = byteorder$U.o hist$U.o jitter$U.o kern$U.o longsize$U.o ntptime$U.o precision$U.o sht$U.o testrs6000$U.o tickadj$U.o timetrim$U.o
@@ -193,9 +203,9 @@ all: all-redirect
.SUFFIXES:
.SUFFIXES: .c .o
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps util/Makefile
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu util/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -228,9 +238,6 @@ uninstall-binPROGRAMS:
rm -f $(DESTDIR)$(bindir)/$$f; \
done
-.c.o:
- $(COMPILE) -c $<
-
mostlyclean-compile:
-rm -f *.o core *.core
@@ -262,57 +269,46 @@ clean-kr:
distclean-kr:
maintainer-clean-kr:
-byteorder$U.o:
byteorder: $(byteorder_OBJECTS) $(byteorder_DEPENDENCIES)
@rm -f byteorder
$(LINK) $(byteorder_LDFLAGS) $(byteorder_OBJECTS) $(byteorder_LDADD) $(LIBS)
-hist$U.o:
hist: $(hist_OBJECTS) $(hist_DEPENDENCIES)
@rm -f hist
$(LINK) $(hist_LDFLAGS) $(hist_OBJECTS) $(hist_LDADD) $(LIBS)
-jitter$U.o:
jitter: $(jitter_OBJECTS) $(jitter_DEPENDENCIES)
@rm -f jitter
$(LINK) $(jitter_LDFLAGS) $(jitter_OBJECTS) $(jitter_LDADD) $(LIBS)
-kern$U.o:
kern: $(kern_OBJECTS) $(kern_DEPENDENCIES)
@rm -f kern
$(LINK) $(kern_LDFLAGS) $(kern_OBJECTS) $(kern_LDADD) $(LIBS)
-longsize$U.o:
longsize: $(longsize_OBJECTS) $(longsize_DEPENDENCIES)
@rm -f longsize
$(LINK) $(longsize_LDFLAGS) $(longsize_OBJECTS) $(longsize_LDADD) $(LIBS)
-ntptime$U.o:
ntptime: $(ntptime_OBJECTS) $(ntptime_DEPENDENCIES)
@rm -f ntptime
$(LINK) $(ntptime_LDFLAGS) $(ntptime_OBJECTS) $(ntptime_LDADD) $(LIBS)
-precision$U.o:
precision: $(precision_OBJECTS) $(precision_DEPENDENCIES)
@rm -f precision
$(LINK) $(precision_LDFLAGS) $(precision_OBJECTS) $(precision_LDADD) $(LIBS)
-sht$U.o:
sht: $(sht_OBJECTS) $(sht_DEPENDENCIES)
@rm -f sht
$(LINK) $(sht_LDFLAGS) $(sht_OBJECTS) $(sht_LDADD) $(LIBS)
-testrs6000$U.o:
testrs6000: $(testrs6000_OBJECTS) $(testrs6000_DEPENDENCIES)
@rm -f testrs6000
$(LINK) $(testrs6000_LDFLAGS) $(testrs6000_OBJECTS) $(testrs6000_LDADD) $(LIBS)
-tickadj$U.o:
tickadj: $(tickadj_OBJECTS) $(tickadj_DEPENDENCIES)
@rm -f tickadj
$(LINK) $(tickadj_LDFLAGS) $(tickadj_OBJECTS) $(tickadj_LDADD) $(LIBS)
-timetrim$U.o:
timetrim: $(timetrim_OBJECTS) $(timetrim_DEPENDENCIES)
@rm -f timetrim
@@ -344,23 +340,27 @@ precision_.o sht_.o testrs6000_.o tickadj_.o timetrim_.o : $(ANSI2KNR)
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -f$$here/ID $$unique $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- ${AWK:-awk} ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
mostlyclean-tags:
@@ -377,34 +377,42 @@ distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir); \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
-byteorder.o byteorder.lo: byteorder.c
-hist.o hist.lo: hist.c ../config.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../include/ntp_proto.h
-jitter.o jitter.lo: jitter.c
-kern.o kern.lo: kern.c ../config.h
-longsize.o longsize.lo: longsize.c
-ntptime.o: ntptime.c ../config.h ../include/ntp_fp.h \
- ../include/ntp_types.h ../include/ntp_machine.h \
- ../include/ntp_proto.h ../include/ntp_unixtime.h \
- ../include/ntp_syscall.h ../include/ntp_stdlib.h \
- ../include/ntp_string.h ../include/l_stdlib.h
-precision.o precision.lo: precision.c ../include/ntp_unixtime.h \
- ../include/ntp_types.h ../include/ntp_machine.h ../config.h \
- ../include/ntp_proto.h
-sht.o sht.lo: sht.c
-testrs6000.o testrs6000.lo: testrs6000.c
-tickadj.o: tickadj.c ../config.h ../include/ntp_types.h \
- ../include/ntp_machine.h ../include/ntp_proto.h \
- ../include/l_stdlib.h ../include/ntp_io.h \
- ../include/ntp_stdlib.h ../include/ntp_string.h
-timetrim.o timetrim.lo: timetrim.c
+
+@AMDEP@include $(DEPDIR)/byteorder$U.Po
+@AMDEP@include $(DEPDIR)/hist$U.Po
+@AMDEP@include $(DEPDIR)/jitter$U.Po
+@AMDEP@include $(DEPDIR)/kern$U.Po
+@AMDEP@include $(DEPDIR)/longsize$U.Po
+@AMDEP@include $(DEPDIR)/ntptime$U.Po
+@AMDEP@include $(DEPDIR)/precision$U.Po
+@AMDEP@include $(DEPDIR)/sht$U.Po
+@AMDEP@include $(DEPDIR)/testrs6000$U.Po
+@AMDEP@include $(DEPDIR)/tickadj$U.Po
+@AMDEP@include $(DEPDIR)/timetrim$U.Po
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf $(DEPDIR)
+
+maintainer-clean-depend:
+
+@AMDEP@CCDEPMODE = @CCDEPMODE@
+
+.c.o:
+@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c -o $@ $<
info-am:
info: info-am
@@ -442,26 +450,29 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
+ -rm -f Makefile.in
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
mostlyclean-krextra mostlyclean-kr mostlyclean-tags \
- mostlyclean-generic
+ mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-binPROGRAMS clean-compile clean-krextra clean-kr \
- clean-tags clean-generic mostlyclean-am
+ clean-tags clean-depend clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-binPROGRAMS distclean-compile distclean-krextra \
- distclean-kr distclean-tags distclean-generic clean-am
+ distclean-kr distclean-tags distclean-depend \
+ distclean-generic clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-binPROGRAMS \
maintainer-clean-compile maintainer-clean-krextra \
maintainer-clean-kr maintainer-clean-tags \
- maintainer-clean-generic distclean-am
+ maintainer-clean-depend maintainer-clean-generic \
+ distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
@@ -473,12 +484,13 @@ mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-krextra distclean-krextra \
clean-krextra maintainer-clean-krextra mostlyclean-kr distclean-kr \
clean-kr maintainer-clean-kr tags mostlyclean-tags distclean-tags \
-clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
-check-am installcheck-am installcheck install-exec-am install-exec \
-install-data-am install-data install-am install uninstall-am uninstall \
-all-redirect all-am all install-strip installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+clean-tags maintainer-clean-tags distdir mostlyclean-depend \
+distclean-depend clean-depend maintainer-clean-depend info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all install-strip \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
../libntp/libntp.a: