diff options
author | roberto <roberto@FreeBSD.org> | 2008-08-22 15:58:00 +0000 |
---|---|---|
committer | roberto <roberto@FreeBSD.org> | 2008-08-22 15:58:00 +0000 |
commit | b85c7169a740b2edf0106ad59fdaa1b0160f823c (patch) | |
tree | 2b9fb7f64eacb322e95695e412c923e97ba33e88 /contrib/ntp/clockstuff | |
parent | 1d197cfe9feac6bc29537d8e53c30b6435937b95 (diff) | |
parent | 7a6072eb585696f8856cd498c3fd194cf49f14c6 (diff) | |
download | FreeBSD-src-b85c7169a740b2edf0106ad59fdaa1b0160f823c.zip FreeBSD-src-b85c7169a740b2edf0106ad59fdaa1b0160f823c.tar.gz |
Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit
will update usr.sbin/ntp to match this.
MFC after: 2 weeks
Diffstat (limited to 'contrib/ntp/clockstuff')
-rw-r--r-- | contrib/ntp/clockstuff/Makefile.am | 4 | ||||
-rw-r--r-- | contrib/ntp/clockstuff/Makefile.in | 268 | ||||
-rw-r--r-- | contrib/ntp/clockstuff/clktest.c | 179 | ||||
-rw-r--r-- | contrib/ntp/clockstuff/propdelay.c | 12 |
4 files changed, 199 insertions, 264 deletions
diff --git a/contrib/ntp/clockstuff/Makefile.am b/contrib/ntp/clockstuff/Makefile.am index ebfd74e..2a2ec4e 100644 --- a/contrib/ntp/clockstuff/Makefile.am +++ b/contrib/ntp/clockstuff/Makefile.am @@ -5,12 +5,14 @@ EXTRA_PROGRAMS = propdelay chutest clktest INCLUDES = -I$(top_srcdir)/include # We need -lm (and perhaps $(COMPAT) for propdelay, -lntp for {chu,clk}test -propdelay_LDADD = -lm +propdelay_LDADD = -lm ../libntp/libntp.a chutest_LDADD = ../libntp/libntp.a clktest_LDADD = ../libntp/libntp.a ETAGS_ARGS = Makefile.am #EXTRA_DIST = TAGS +# clktest-opts.def wants ../include/copyright.def ../include/homerc.def + chutest$(EXEEXT): ../libntp/libntp.a clktest$(EXEEXT): ../libntp/libntp.a diff --git a/contrib/ntp/clockstuff/Makefile.in b/contrib/ntp/clockstuff/Makefile.in index d02dbd4..4ee3a5b 100644 --- a/contrib/ntp/clockstuff/Makefile.in +++ b/contrib/ntp/clockstuff/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.7.7 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -21,7 +21,6 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -37,16 +36,59 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ +ANSI2KNR = ../util/ansi2knr +noinst_PROGRAMS = @PROPDELAY@ @CHUTEST@ @CLKTEST@ +EXTRA_PROGRAMS = propdelay$(EXEEXT) chutest$(EXEEXT) clktest$(EXEEXT) +subdir = clockstuff +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/libopts/m4/libopts.m4 \ + $(top_srcdir)/m4/define_dir.m4 \ + $(top_srcdir)/m4/hs_ulong_const.m4 \ + $(top_srcdir)/m4/os_cflags.m4 $(top_srcdir)/version.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(noinst_PROGRAMS) +chutest_SOURCES = chutest.c +chutest_OBJECTS = chutest$U.$(OBJEXT) +chutest_DEPENDENCIES = ../libntp/libntp.a +clktest_SOURCES = clktest.c +clktest_OBJECTS = clktest$U.$(OBJEXT) +clktest_DEPENDENCIES = ../libntp/libntp.a +propdelay_SOURCES = propdelay.c +propdelay_OBJECTS = propdelay$U.$(OBJEXT) +propdelay_DEPENDENCIES = ../libntp/libntp.a +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = chutest.c clktest.c propdelay.c +DIST_SOURCES = chutest.c clktest.c propdelay.c +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AR = @AR@ ARLIB_DIR = @ARLIB_DIR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BINSUBDIR = @BINSUBDIR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -54,10 +96,15 @@ CHUTEST = @CHUTEST@ CLKTEST = @CLKTEST@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DCFD = @DCFD@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ @@ -65,30 +112,39 @@ EF_LIBS = @EF_LIBS@ EF_PROGS = @EF_PROGS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ +INSTALL_LIBOPTS_FALSE = @INSTALL_LIBOPTS_FALSE@ +INSTALL_LIBOPTS_TRUE = @INSTALL_LIBOPTS_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCRYPTO = @LCRYPTO@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBOPTS_CFLAGS = @LIBOPTS_CFLAGS@ +LIBOPTS_DIR = @LIBOPTS_DIR@ +LIBOPTS_LDADD = @LIBOPTS_LDADD@ LIBPARSE = @LIBPARSE@ LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MAKE_ADJTIMED = @MAKE_ADJTIMED@ +MAKE_CHECK_LAYOUT = @MAKE_CHECK_LAYOUT@ MAKE_CHECK_Y2K = @MAKE_CHECK_Y2K@ MAKE_LIBNTPSIM = @MAKE_LIBNTPSIM@ MAKE_LIBPARSE = @MAKE_LIBPARSE@ MAKE_LIBPARSE_KERNEL = @MAKE_LIBPARSE_KERNEL@ MAKE_NTPDSIM = @MAKE_NTPDSIM@ MAKE_NTPTIME = @MAKE_NTPTIME@ -MAKE_NTP_KEYGEN = @MAKE_NTP_KEYGEN@ MAKE_PARSEKMODULE = @MAKE_PARSEKMODULE@ -MAKE_SNTP = @MAKE_SNTP@ MAKE_TICKADJ = @MAKE_TICKADJ@ MAKE_TIMETRIM = @MAKE_TIMETRIM@ +NEED_LIBOPTS_FALSE = @NEED_LIBOPTS_FALSE@ +NEED_LIBOPTS_TRUE = @NEED_LIBOPTS_TRUE@ OBJEXT = @OBJEXT@ OPENSSL = @OPENSSL@ OPENSSL_INC = @OPENSSL_INC@ @@ -111,14 +167,21 @@ STRIP = @STRIP@ TESTDCF = @TESTDCF@ U = @U@ VERSION = @VERSION@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -139,6 +202,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ +mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ @@ -146,81 +210,65 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ subdirs = @subdirs@ sysconfdir = @sysconfdir@ -target = @target@ target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ #AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies AUTOMAKE_OPTIONS = ../util/ansi2knr -noinst_PROGRAMS = @PROPDELAY@ @CHUTEST@ @CLKTEST@ -EXTRA_PROGRAMS = propdelay chutest clktest - INCLUDES = -I$(top_srcdir)/include # We need -lm (and perhaps $(COMPAT) for propdelay, -lntp for {chu,clk}test -propdelay_LDADD = -lm +propdelay_LDADD = -lm ../libntp/libntp.a chutest_LDADD = ../libntp/libntp.a clktest_LDADD = ../libntp/libntp.a ETAGS_ARGS = Makefile.am -subdir = clockstuff -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -EXTRA_PROGRAMS = propdelay$(EXEEXT) chutest$(EXEEXT) clktest$(EXEEXT) -noinst_PROGRAMS = @PROPDELAY@ @CHUTEST@ @CLKTEST@ -PROGRAMS = $(noinst_PROGRAMS) - -chutest_SOURCES = chutest.c -chutest_OBJECTS = chutest$U.$(OBJEXT) -chutest_DEPENDENCIES = ../libntp/libntp.a -chutest_LDFLAGS = -clktest_SOURCES = clktest.c -clktest_OBJECTS = clktest$U.$(OBJEXT) -clktest_DEPENDENCIES = ../libntp/libntp.a -clktest_LDFLAGS = -propdelay_SOURCES = propdelay.c -propdelay_OBJECTS = propdelay$U.$(OBJEXT) -propdelay_DEPENDENCIES = -propdelay_LDFLAGS = - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/chutest$U.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/clktest$U.Po ./$(DEPDIR)/propdelay$U.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = chutest.c clktest.c propdelay.c -DIST_COMMON = README $(srcdir)/Makefile.in Makefile.am -SOURCES = chutest.c clktest.c propdelay.c - all: all-am .SUFFIXES: -.SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clockstuff/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu clockstuff/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + $(AUTOMAKE) --foreign clockstuff/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstPROGRAMS: - -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done propdelay$(EXEEXT): $(propdelay_OBJECTS) $(propdelay_DEPENDENCIES) @rm -f propdelay$(EXEEXT) $(LINK) $(propdelay_LDFLAGS) $(propdelay_OBJECTS) $(propdelay_LDADD) $(LIBS) mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c - -ANSI2KNR = ../util/ansi2knr ../util/ansi2knr: cd ../util && $(MAKE) $(AM_MAKEFLAGS) ansi2knr @@ -232,43 +280,43 @@ mostlyclean-kr: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propdelay$U.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< chutest_.c: chutest.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/chutest.c; then echo $(srcdir)/chutest.c; else echo chutest.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ clktest_.c: clktest.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/clktest.c; then echo $(srcdir)/clktest.c; else echo clktest.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ propdelay_.c: propdelay.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/propdelay.c; then echo $(srcdir)/propdelay.c; else echo propdelay.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -chutest_.$(OBJEXT) clktest_.$(OBJEXT) propdelay_.$(OBJEXT) : \ -$(ANSI2KNR) -uninstall-info-am: +chutest_.$(OBJEXT) chutest_.lo clktest_.$(OBJEXT) clktest_.lo \ +propdelay_.$(OBJEXT) propdelay_.lo : $(ANSI2KNR) -ETAGS = etags -ETAGSFLAGS = +mostlyclean-libtool: + -rm -f *.lo -CTAGS = ctags -CTAGSFLAGS = +clean-libtool: + -rm -rf .libs _libs -tags: TAGS +distclean-libtool: + -rm -f libtool +uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -278,6 +326,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -289,10 +338,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -315,10 +365,6 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -332,7 +378,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -350,7 +396,6 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) - installdirs: install: install-am install-exec: install-exec-am @@ -363,7 +408,7 @@ install-am: all-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - INSTALL_STRIP_FLAG=-s \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: @@ -371,26 +416,28 @@ mostlyclean-generic: clean-generic: distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile - distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags + distclean-libtool distclean-tags dvi: dvi-am dvi-am: +html: html-am + info: info-am info-am: @@ -408,12 +455,12 @@ installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile - maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr +mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr \ + mostlyclean-libtool pdf: pdf-am @@ -426,18 +473,21 @@ ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-noinstPROGRAMS ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am info \ - info-am install install-am install-data install-data-am \ - install-exec install-exec-am install-info install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-kr pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-info-am + clean-libtool clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-kr \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-info-am #EXTRA_DIST = TAGS +# clktest-opts.def wants ../include/copyright.def ../include/homerc.def + chutest$(EXEEXT): ../libntp/libntp.a clktest$(EXEEXT): ../libntp/libntp.a diff --git a/contrib/ntp/clockstuff/clktest.c b/contrib/ntp/clockstuff/clktest.c index 86edf59d..04df4b9 100644 --- a/contrib/ntp/clockstuff/clktest.c +++ b/contrib/ntp/clockstuff/clktest.c @@ -4,20 +4,7 @@ * usage: clktest -b bps -f -t timeo -s cmd -c char1 -a char2 /dev/whatever */ -#include <stdio.h> -#include <ctype.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <signal.h> -#include <netinet/in.h> -#include <sys/ioctl.h> -#include <sys/time.h> -#include <sys/file.h> -#include <sgtty.h> - -#include "../include/ntp_fp.h" -#include "../include/ntp.h" -#include "../include/ntp_unixtime.h" +#include "clktest-opts.h" #define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0) @@ -28,9 +15,13 @@ #endif #ifndef STREAM -#ifndef CLKLDISC -CLOCK_LINE_DISCIPLINE_NEEDED_BY_THIS_PROGRAM; -#endif +# ifndef CLKLDISC + CLOCK_LINE_DISCIPLINE_NEEDED_BY_THIS_PROGRAM; +# endif +#else +# ifdef CLKLDISC + ONLY_ONE_CLOCK_LINE_DISCIPLINE_FOR_THIS_PROGRAM; +# endif #endif /* @@ -38,51 +29,17 @@ CLOCK_LINE_DISCIPLINE_NEEDED_BY_THIS_PROGRAM; */ #define BLOCKSIGMASK (sigmask(SIGIO)|sigmask(SIGALRM)) -/* - * speed table - */ -struct speeds { - int bps; - int rate; -} speedtab[] = { - { 300, B300 }, - { 1200, B1200 }, - { 2400, B2400 }, - { 4800, B4800 }, - { 9600, B9600 }, - { 19200, EXTA }, - { 38400, EXTB }, - { 0, 0 } -}; - -char *progname; -int debug; - -#ifdef CLKLDISC -#define DEFMAGIC '\r' -#endif +#define progname clktestOptions.pzProgName -#ifdef CLKLDISC -# ifdef STREAM -# include <stropts.h> -# ifdef HAVE_SYS_CLKDEFS_H -# include <sys/clkdefs.h> -# endif -# define DEFMAGIC "\r" -# endif -#endif - struct timeval timeout = { 0 }; char *cmd = NULL; int cmdlen; -int docmd = 0; + #ifdef CLKLDISC u_long magic1 = DEFMAGIC; u_long magic2 = DEFMAGIC; #endif -#ifdef STREAM -char magic[32]; -#endif + int speed = B9600; int ttflags = RAW|EVENP|ODDP; @@ -95,6 +52,9 @@ extern u_long ustotslo[]; extern u_long ustotsmid[]; extern u_long ustotshi[]; +int alarming(); +int ioready(); + /* * main - parse arguments and handle options */ @@ -104,113 +64,35 @@ main( char *argv[] ) { - int c; - int errflg = 0; - struct speeds *spd; - u_long tmp; int fd; struct sgttyb ttyb; struct itimerval itimer; - extern int ntp_optind; - extern char *ntp_optarg; - int alarming(); - int ioready(); - progname = argv[0]; #ifdef STREAM magic[0] = 0; #endif - while ((c = ntp_getopt(argc, argv, "a:b:c:dfs:t:")) != EOF) - switch (c) { -#ifdef CLKLDISC - case 'a': -#endif - case 'c': - if (!atouint(ntp_optarg, &tmp)) { - (void) fprintf(stderr, - "%s: argument for -%c must be integer\n", - progname, c); - errflg++; - break; - } -#ifdef CLKLDISC - if (c == 'c') - magic1 = tmp; - else - magic2 = tmp; -#endif -#ifdef STREAM - magic[strlen(magic)+1] = '\0'; - magic[strlen(magic)] = tmp; -#endif - break; - case 'b': - if (!atouint(ntp_optarg, &tmp)) { - errflg++; - break; - } - spd = speedtab; - while (spd->bps != 0) - if ((int)tmp == spd->bps) - break; - if (spd->bps == 0) { - (void) fprintf(stderr, - "%s: speed %lu is unsupported\n", - progname, tmp); - errflg++; - } else { - speed = spd->rate; - } - break; - case 'd': - ++debug; - break; - case 'f': - ttflags |= CRMOD; - break; - case 's': - cmdlen = strlen(ntp_optarg); - if (cmdlen == 0) - errflg++; - else - cmd = ntp_optarg; - break; - case 't': - if (!atouint(ntp_optarg, &tmp)) - errflg++; - else { - timeout.tv_sec = (long)tmp; - docmd = 1; - } - break; - default: - errflg++; - break; + + { + int ct = optionProcess( &clktestOptions, argc, argv ); + if (HAVE_OPT(COMMAND) && (strlen(OPT_ARG(COMMAND)) == 0)) { + fputs( "The command option string must not be empty\n", stderr ); + USAGE( EXIT_FAILURE ); } - if (errflg || ntp_optind+1 != argc) { - (void) fprintf(stderr, -#ifdef CLKLDISC - "usage: %s [-b bps] [-c magic1] [-a magic2] [-f] [-s cmd] [-t timeo] tty_device\n", -#endif -#ifdef STREAM - "usage: %s [-b bps] [-c magic1] [-c magic2]... [-f] [-s cmd] [-t timeo] tty_device\n", -#endif - progname); - exit(2); - } + if ((argc -= ct) != 1) { + fputs( "Missing tty device name\n", stderr ); + USAGE( EXIT_FAILURE ); + } + argv += ct; + } #ifdef STREAM if (!strlen(magic)) strcpy(magic,DEFMAGIC); #endif - if (docmd) - fd = open(argv[ntp_optind], O_RDWR, 0777); - else - fd = open(argv[ntp_optind], O_RDONLY, 0777); + fd = open(*argv, HAVE_OPT(TIMEOUT) ? O_RDWR : O_RDONLY, 0777); if (fd == -1) { - (void) fprintf(stderr, "%s: open(%s): ", progname, - argv[ntp_optind]); + fprintf(stderr, "%s: open(%s): ", progname, *argv); perror(""); exit(1); } @@ -270,7 +152,7 @@ main( (void) gettimeofday(&lasttv, (struct timezone *)0); - if (docmd) { + if (HAVE_OPT(TIMEOUT)) { /* * set non-blocking, async I/O on the descriptor */ @@ -288,6 +170,7 @@ main( */ wasalarmed = 0; (void) signal(SIGALRM, alarming); + timeout.tv_sec = OPT_VALUE_TIMEOUT; itimer.it_interval = itimer.it_value = timeout; setitimer(ITIMER_REAL, &itimer, (struct itimerval *)0); doboth(fd); @@ -495,7 +378,7 @@ doalarm( { int n; - if (cmd == NULL || cmdlen <= 0) + if (! HAVE_OPT(COMMAND)) return; n = write(fd, cmd, cmdlen); diff --git a/contrib/ntp/clockstuff/propdelay.c b/contrib/ntp/clockstuff/propdelay.c index 3ce571c..c8df686 100644 --- a/contrib/ntp/clockstuff/propdelay.c +++ b/contrib/ntp/clockstuff/propdelay.c @@ -115,7 +115,7 @@ int Gflag = 0; int height; char *progname; -int debug; +volatile int debug; static void doit (double, double, double, double, double, char *); static double latlong (char *, int); @@ -298,7 +298,7 @@ latlong( register char *cp; register char *bp; double arg; - double div; + double divby; int isneg; char buf[32]; char *colon; @@ -340,7 +340,7 @@ latlong( *bp = '\0'; cp++; arg = atof(buf); - div = 60.0; + divby = 60.0; colon = strchr(cp, ':'); if (colon != NULL) { bp = buf; @@ -348,11 +348,11 @@ latlong( *bp++ = *cp++; *bp = '\0'; cp++; - arg += atof(buf) / div; - div = 3600.0; + arg += atof(buf) / divby; + divby = 3600.0; } if (*cp != '\0') - arg += atof(cp) / div; + arg += atof(cp) / divby; } else { arg = atof(str); } |