From: Dave Hart Date: Tue, 28 Mar 2023 18:17:07 +0000 (+0000) Subject: Consolidate and correct check-scm-rev invocations. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e68328bfc3e6366ca4947a67d3f1954838c0e466;p=thirdparty%2Fntp.git Consolidate and correct check-scm-rev invocations. Quiet -Wunused-function warnings in ntp_config.c building ntpdsim. Quiet -Warray-bounds warning in ntpdc.c. Fix make distcheck failure due to leftover version.Po files. Use silent rules for Autogen invocations. Remove other write permissions, e.g. chmod o-w Add missing comma in configure.ac syscall() test. Remove remnant of the no-longer-used Google Test framework. bk: 64232f23qxznx2T5WGUGfpYTDa90jw --- diff --git a/check-scm-rev.mf b/check-scm-rev.mf new file mode 100644 index 000000000..e2abbf0e4 --- /dev/null +++ b/check-scm-rev.mf @@ -0,0 +1,8 @@ +$(top_srcdir)/sntp/scm-rev: FRC.scm-rev + $(AM_V_GEN)cd $(top_builddir)/sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev + +FRC.scm-rev: + @: FRC.scm-rev "force" depends on nothing and is not a file, so is \ + always out-of-date causing targets which depend on it to also \ + be outdated so their rules to fire each time they are built. + diff --git a/configure.ac b/configure.ac index 6784b1429..4bdda1da6 100644 --- a/configure.ac +++ b/configure.ac @@ -35,7 +35,7 @@ AC_PRESERVE_HELP_ORDER # the date YYYYMMDD optionally with -HHMM if there is more than one # bump in a day. -ntp_configure_cache_version=20230313 +ntp_configure_cache_version=20230326 # When the cache version of config.cache and configure do not # match, NTP_CACHEVERSION will flush the cache. @@ -64,8 +64,6 @@ ntp_jupiter_ok=${ntp_jupiter_ok=no} NTP_PROG_CC NTP_COMPILER -dnl # Do we need CXX for anything besides google test? -dnl AC_PROG_CXX AC_PROG_YACC dnl AC_PROG_CC_C_O # called by NTP_COMPILER AX_C99_STRUCT_INIT @@ -1108,7 +1106,7 @@ AC_CACHE_CHECK( [[ extern int syscall (int, ...); ]] - )] + )], [ntp_cv_decl_syscall=yes], [ntp_cv_decl_syscall=no] )] @@ -4418,11 +4416,6 @@ AC_MSG_RESULT([$ntp_ok]) NTP_UNITYBUILD -dnl gtest is needed for our tests subdirs. It would be nice if we could -dnl require a C++ compiler only if we will use gtest, but AC_PROG_CXX -dnl can't be conditionalized. -NTP_GOOGLETEST - NTP_PROBLEM_TESTS ### diff --git a/depsver.mf b/depsver.mf index 39a287b6b..62c59c4f1 100644 --- a/depsver.mf +++ b/depsver.mf @@ -22,7 +22,7 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver echo -n "Cleaned $(subdir)/$(DEPDIR) version " && \ cat $(top_srcdir)/deps-ver \ ) - cp $(top_srcdir)/deps-ver $@ + $(AM_V_at)cp $(top_srcdir)/deps-ver $@ .deps-ver: $(top_srcdir)/deps-ver @[ ! -d $(DEPDIR) ] || $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/deps-ver @@ -56,6 +56,6 @@ DISTCLEANFILES += $(DEPDIR)/deps-ver # If you modify depsver.mf, please make the changes to the master # copy, the one in sntp is copied by the bootstrap script from it. # -# This comment block follows rather than leads the related code so that +# This comment block follows rather than leads the related rules so that # it stays with it in the generated Makefile.in and Makefile. # diff --git a/libparse/Makefile.am b/libparse/Makefile.am index b5dbbcaae..a4a3ed264 100644 --- a/libparse/Makefile.am +++ b/libparse/Makefile.am @@ -28,10 +28,10 @@ VPHACK_AFTER= endif vphack: - test -e info_trimble.c || ln -s $(srcdir)/info_trimble.c . + $(AM_V_at)test -e info_trimble.c || ln -s $(srcdir)/info_trimble.c . vphack_after: - test -L info_trimble.c || ( \ + $(AM_V_at)test -L info_trimble.c || ( \ mv info_trimble.c $(srcdir)/info_trimble.c && \ ln -s $(srcdir)/info_trimble.c . \ ) diff --git a/ntpd/Makefile.am b/ntpd/Makefile.am index 9eeb971ac..103303d3e 100644 --- a/ntpd/Makefile.am +++ b/ntpd/Makefile.am @@ -18,7 +18,7 @@ AM_LDFLAGS = $(LDFLAGS_NTP) AM_LDFLAGS += $(NTP_HARD_LDFLAGS) # LDADD might need RESLIB and ADJLIB. -LDADD = version.o libntpd.a $(LIBPARSE) +LDADD = libntpd.a $(LIBPARSE) AM_YFLAGS = -d -t -r all if SAVECONFIG_ENABLED @@ -51,8 +51,8 @@ VPHACK_AFTER= endif vphack: - test -e ntp_parser.c || ln -s $(srcdir)/ntp_parser.c . - test -e ntp_parser.h || ln -s $(srcdir)/ntp_parser.h . + $(AM_V_at)test -e ntp_parser.c || ln -s $(srcdir)/ntp_parser.c . + $(AM_V_at)test -e ntp_parser.h || ln -s $(srcdir)/ntp_parser.h . # # ylwrap script which invokes Bison replaces ntp_parser.h @@ -62,7 +62,7 @@ vphack: # vphack_after: - test -L ntp_parser.h || ( \ + $(AM_V_at)test -L ntp_parser.h || ( \ mv ntp_parser.h $(srcdir)/ntp_parser.h && \ ln -s $(srcdir)/ntp_parser.h . \ ) @@ -87,10 +87,6 @@ man5_MANS= ntp.conf.5 ntp.keys.5 man8_MANS= man_MANS= ntpd.$(NTPD_MS) -# ntpdsim.1 is a remnant along with all the ntpdsim-opts.* files, the -# simulator currently uses ntpd-opts.[ch]. This also means there is no -# longer a reason to have ntpdbase-opts.def split off of ntpd-opts.def. - LDADD_NTPD_COMMON = $(LDADD_LIBNTP) $(LIBOPTS_LDADD) $(PTHREAD_LIBS) LDADD_NTPD_COMMON += $(LIBM) $(LDADD_NTP) $(LSCF) ntpd_LDADD = $(LDADD) ../libntp/libntp.a $(LDADD_NTPD_COMMON) $(LDADD_LIBUTIL) @@ -102,8 +98,6 @@ keyword_gen_LDADD = ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) DISTCLEANFILES = \ keyword-gen \ - .version \ - version.c \ config.log \ $(man5_MANS) \ $(man_MANS) \ @@ -124,6 +118,10 @@ CLEANFILES = \ psl1save.conf+ \ psl2save.conf \ psl2save.conf+ \ + .version \ + version.c \ + ntpd-version.c \ + sim-version.c \ $(EXTRA_PROGRAMS) \ $(NULL) @@ -213,7 +211,9 @@ std_def_list = \ check-local: $(MAKE_CHECK_Y2K) $(CHECK_SAVECONFIG) test -z "$(MAKE_CHECK_Y2K)" || ./$(MAKE_CHECK_Y2K) -ntpd_SOURCES = \ +# ntpd_ntpdsim_SRCS use #ifdef SIM and are included in both + +ntpd_ntpdsim_SRCS = \ ntp_config.c \ ntp_keyword.h \ ntp_io.c \ @@ -225,12 +225,24 @@ ntpd_SOURCES = \ ntpd-opts.h \ $(NULL) +ntpd_SOURCES = \ + $(ntpd_ntpdsim_SRCS) \ + $(NULL) + +nodist_ntpd_SOURCES = \ + ntpd-version.c \ + $(NULL) + ntpdsim_SOURCES = \ - $(ntpd_SOURCES) \ + $(ntpd_ntpdsim_SRCS) \ ntp_prio_q.c \ ntpsim.c \ $(NULL) +nodist_ntpdsim_SOURCES = \ + sim-version.c \ + $(NULL) + # libntpd_a_SOURCES do not use #ifdef SIM libntpd_a_SOURCES = \ @@ -299,21 +311,21 @@ libntpd_a_SOURCES = \ $(NULL) k-g-u-submake: keyword-gen - ./keyword-gen $(srcdir)/ntp_parser.h > k-g.out - @grep -v diff_ignore_line < k-g.out > cmp1 - @grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp2 - @cmp cmp1 cmp2 > /dev/null || \ + $(AM_V_at)./keyword-gen $(srcdir)/ntp_parser.h > k-g.out + $(AM_V_at)grep -v diff_ignore_line < k-g.out > cmp1 + $(AM_V_at)grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp2 + $(AM_V_at)cmp cmp1 cmp2 > /dev/null || \ { mv -f k-g.out $(srcdir)/ntp_keyword.h && \ echo 'Generated changed ntp_keyword.h.' ;} - @[ ! -f k-g.out ] || \ + $(AM_V_at)[ ! -f k-g.out ] || \ { rm k-g.out && echo 'ntp_keyword.h is up to date.' ;} @rm cmp1 cmp2 @echo 'keyword-gen and ntp_keyword.h are up to date.' > $@ $(srcdir)/keyword-gen-utd: $(srcdir)/keyword-gen.c $(srcdir)/ntp_parser.h - $(MAKE) $(AM_MAKEFLAGS) k-g-u-submake # avoid explicit dependency - grep diff_ignore_line $(srcdir)/ntp_keyword.h > k-g-u - mv -f k-g-u $@ + $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) k-g-u-submake # avoid explicit dependency + $(AM_V_at)grep diff_ignore_line $(srcdir)/ntp_keyword.h > k-g-u + $(AM_V_at)mv -f k-g-u $@ $(srcdir)/ntp_keyword.h: $(srcdir)/keyword-gen-utd @: do-nothing action to avoid default SCCS get @@ -323,12 +335,12 @@ $(srcdir)/ntpd-opts.h: $(srcdir)/ntpd-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/ntpd-opts.c: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list) - $(run_ag) ntpd-opts.def + $(AM_V_GEN)$(run_ag) ntpd-opts.def ### $(srcdir)/ntpd.1ntpdman: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntpdman -Tagman-cmd.tpl ntpd-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpdman -Tagman-cmd.tpl ntpd-opts.def $(srcdir)/ntpd.man.in: $(srcdir)/ntpd.1ntpdman $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpd.1ntpdman > $(srcdir)/ntpd.man.in+ @@ -337,7 +349,7 @@ $(srcdir)/ntpd.man.in: $(srcdir)/ntpd.1ntpdman $(top_srcdir)/sntp/scripts/mansec ### $(srcdir)/ntpd.1ntpdmdoc: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntpdmdoc -Tagmdoc-cmd.tpl ntpd-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpdmdoc -Tagmdoc-cmd.tpl ntpd-opts.def $(srcdir)/ntpd.mdoc.in: $(srcdir)/ntpd.1ntpdmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpd.1ntpdmdoc > $(srcdir)/ntpd.mdoc.in+ @@ -355,13 +367,13 @@ $(srcdir)/invoke-ntp.conf.menu: $(srcdir)/invoke-ntp.conf.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntp.conf.texi: $(srcdir)/ntp.conf.def $(std_def_list) - $(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.conf.def + $(AM_V_GEN)$(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.conf.def $(srcdir)/invoke-ntp.keys.menu: $(srcdir)/invoke-ntp.keys.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntp.keys.texi: $(srcdir)/ntp.keys.def $(std_def_list) - $(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.keys.def + $(AM_V_GEN)$(run_ag) -Tagtexi-file.tpl -DLEVEL=section ntp.keys.def $(srcdir)/ntp.conf.html: $(srcdir)/ntp.conf.texi $(srcdir)/invoke-ntp.conf.texi $(top_srcdir)/sntp/include/version.texi cd $(srcdir) && ( makeinfo --force --html --no-split -o ntp.conf.html ntp.conf.texi || true ) @@ -375,7 +387,7 @@ $(srcdir)/ntpd.html: $(srcdir)/ntpd.texi $(srcdir)/invoke-ntpd.texi $(top_srcdir ### $(srcdir)/ntp.conf.5man: $(srcdir)/ntp.conf.def $(std_def_list) - $(run_ag) -DMAN_SECTION=5man -Tagman-cmd.tpl ntp.conf.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=5man -Tagman-cmd.tpl ntp.conf.def $(srcdir)/ntp.conf.man.in: $(srcdir)/ntp.conf.5man $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.conf.5man > $(srcdir)/ntp.conf.man.in+ @@ -384,7 +396,7 @@ $(srcdir)/ntp.conf.man.in: $(srcdir)/ntp.conf.5man $(top_srcdir)/sntp/scripts/ma ### $(srcdir)/ntp.conf.5mdoc: $(srcdir)/ntp.conf.def $(std_def_list) - $(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-cmd.tpl ntp.conf.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-cmd.tpl ntp.conf.def $(srcdir)/ntp.conf.mdoc.in: $(srcdir)/ntp.conf.5mdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.conf.5mdoc > $(srcdir)/ntp.conf.mdoc.in+ @@ -399,7 +411,7 @@ ntp.conf.5: $(srcdir)/ntp.conf.$(MANTAGFMT).in $(top_builddir)/config.status ### $(srcdir)/ntp.keys.5man: $(srcdir)/ntp.keys.def $(std_def_list) - $(run_ag) -DMAN_SECTION=5man -Tagman-file.tpl ntp.keys.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=5man -Tagman-file.tpl ntp.keys.def $(srcdir)/ntp.keys.man.in: $(srcdir)/ntp.keys.5man $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.keys.5man > $(srcdir)/ntp.keys.man.in+ @@ -408,7 +420,7 @@ $(srcdir)/ntp.keys.man.in: $(srcdir)/ntp.keys.5man $(top_srcdir)/sntp/scripts/ma ### $(srcdir)/ntp.keys.5mdoc: $(srcdir)/ntp.keys.def $(std_def_list) - $(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-file.tpl ntp.keys.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=5mdoc -Tagmdoc-file.tpl ntp.keys.def $(srcdir)/ntp.keys.mdoc.in: $(srcdir)/ntp.keys.5mdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp.keys.5mdoc > $(srcdir)/ntp.keys.mdoc.in+ @@ -426,11 +438,9 @@ $(srcdir)/invoke-ntpd.menu: $(srcdir)/invoke-ntpd.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntpd.texi: $(srcdir)/ntpd-opts.def $(srcdir)/ntpdbase-opts.def $(std_def_list) - $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpd-opts.def + $(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpd-opts.def $(top_srcdir)/scripts/build/check--help $@ -$(PROGRAMS): $(LDADD) - check-saveconfig: complete.conf compsave.conf -diff -u complete.conf compsave.conf cmp complete.conf compsave.conf && echo stamp > $@ @@ -472,11 +482,13 @@ psl2save.conf: psl2.conf ntpd ../libparse/libparse.a: cd ../libparse && $(MAKE) $(AM_MAKEFLAGS) check-libparse -$(top_srcdir)/sntp/scm-rev: - cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev +ntpd-version.c: Makefile $(top_srcdir)/sntp/scm-rev + $(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpd + $(AM_V_at)mv -f version.c $@ -version.c: $(ntpd_OBJECTS) ../libntp/libntp.a @LIBPARSE@ Makefile $(top_srcdir)/sntp/scm-rev - env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpd +sim-version.c: Makefile $(top_srcdir)/sntp/scm-rev + $(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdsim + $(AM_V_at)@mv -f version.c $@ $(srcdir)/Makefile.am: @: do-nothing @@ -484,5 +496,6 @@ $(srcdir)/Makefile.am: include $(top_srcdir)/bincheck.mf include $(top_srcdir)/check-libopts.mf include $(top_srcdir)/check-libntp.mf +include $(top_srcdir)/check-scm-rev.mf include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index 18da1f083..96e0c5dda 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -248,7 +248,6 @@ static void free_config_logconfig(config_tree *); static void free_config_monitor(config_tree *); static void free_config_nic_rules(config_tree *); static void free_config_other_modes(config_tree *); -static void free_config_peers(config_tree *); static void free_config_phone(config_tree *); static void free_config_reset_counters(config_tree *); static void free_config_rlimit(config_tree *); @@ -258,12 +257,15 @@ static void free_config_tinker(config_tree *); static void free_config_tos(config_tree *); static void free_config_trap(config_tree *); static void free_config_ttl(config_tree *); -static void free_config_unpeers(config_tree *); static void free_config_vars(config_tree *); #ifdef SIM static void free_config_sim(config_tree *); -#endif +#else /* !SIM follows */ +static void free_config_peers(config_tree *); +static void free_config_unpeers(config_tree *); +static int is_sane_resolved_address(sockaddr_u *peeraddr, int hmode); +#endif /* !SIM */ static void destroy_address_fifo(address_fifo *); #define FREE_ADDRESS_FIFO(pf) \ do { \ @@ -275,7 +277,6 @@ static void free_config_tree(config_tree *ptree); #endif /* FREE_CFG_T */ static void destroy_restrict_node(restrict_node *my_node); -static int is_sane_resolved_address(sockaddr_u *peeraddr, int hmode); static void save_and_apply_config_tree(int/*BOOL*/ from_file); static void destroy_int_fifo(int_fifo *); #define FREE_INT_FIFO(pf) \ @@ -325,7 +326,6 @@ static void config_monitor(config_tree *); static void config_rlimit(config_tree *); static void config_system_opts(config_tree *); static void config_tinker(config_tree *); -static int config_tos_clock(config_tree *); static void config_tos(config_tree *); static void config_vars(config_tree *); @@ -342,6 +342,7 @@ static void config_access(config_tree *); static void config_mdnstries(config_tree *); static void config_phone(config_tree *); static void config_setvar(config_tree *); +static int config_tos_clock(config_tree *); static void config_ttl(config_tree *); static void config_trap(config_tree *); static void config_fudge(config_tree *); @@ -352,7 +353,6 @@ static void config_nic_rules(config_tree *, int/*BOOL*/ input_from_file); static void config_reset_counters(config_tree *); static u_char get_correct_host_mode(int token); static int peerflag_bits(peer_node *); -#endif /* !SIM */ #ifdef WORKER static void peer_name_resolved(int, int, void *, const char *, const char *, @@ -364,7 +364,8 @@ static void unpeer_name_resolved(int, int, void *, const char *, const char *, static void trap_name_resolved(int, int, void *, const char *, const char *, const struct addrinfo *, const struct addrinfo *); -#endif +#endif /* WORKER */ +#endif /* !SIM */ enum gnn_type { t_UNK, /* Unknown */ @@ -488,13 +489,14 @@ free_config_tree( free_config_fudge(ptree); free_config_device(ptree); free_config_vars(ptree); - free_config_peers(ptree); - free_config_unpeers(ptree); free_config_nic_rules(ptree); free_config_reset_counters(ptree); #ifdef SIM free_config_sim(ptree); -#endif +#else /* !SIM follows */ + free_config_peers(ptree); + free_config_unpeers(ptree); +#endif /* !SIM */ free_auth_node(ptree); free(ptree); @@ -2190,7 +2192,7 @@ free_config_auth( } #endif /* FREE_CFG_T */ - +#ifndef SIM /* Configure low-level clock-related parameters. Return TRUE if the * clock might need adjustment like era-checking after the call, FALSE * otherwise. @@ -2223,6 +2225,7 @@ config_tos_clock( return ret; } +#endif /* SIM */ static void config_tos( @@ -3585,7 +3588,6 @@ config_phone( } } } -#endif /* !SIM */ static void config_mdnstries( @@ -3597,6 +3599,7 @@ config_mdnstries( mdnstries = ptree->mdnstries; #endif /* HAVE_DNSREGISTRATION */ } +#endif /* !SIM */ #ifdef FREE_CFG_T static void @@ -3885,6 +3888,7 @@ config_fudge( sockaddr_u addr_sock; address_node *addr_node; struct refclockstat clock_stat; + char refid_str[5]; int err_flag; curr_fudge = HEAD_PFIFO(ptree->fudge); @@ -3940,8 +3944,10 @@ config_fudge( case T_Refid: clock_stat.haveflags |= CLK_HAVEVAL2; /* strncpy() does exactly what we want here: */ - strncpy((char*)&clock_stat.fudgeval2, - curr_opt->value.s, 4); + strncpy(refid_str, curr_opt->value.s, + sizeof refid_str - 1); + memcpy(&clock_stat.fudgeval2, refid_str, + sizeof clock_stat.fudgeval2); break; case T_Flag1: @@ -4195,6 +4201,7 @@ free_config_vars( #endif /* FREE_CFG_T */ +#ifndef SIM /* Define a function to check if a resolved address is sane. * If yes, return 1, else return 0; */ @@ -4237,7 +4244,6 @@ is_sane_resolved_address( } -#ifndef SIM static u_char get_correct_host_mode( int token @@ -4482,7 +4488,7 @@ config_peers( } } } -#endif /* !SIM */ + /* * peer_name_resolved() @@ -4582,7 +4588,6 @@ free_config_peers( #endif /* FREE_CFG_T */ -#ifndef SIM static void config_unpeers( config_tree *ptree @@ -4658,7 +4663,6 @@ config_unpeers( # endif } } -#endif /* !SIM */ /* @@ -4738,6 +4742,7 @@ free_config_unpeers( } } #endif /* FREE_CFG_T */ +#endif /* !SIM */ #ifndef SIM diff --git a/ntpdate/Makefile.am b/ntpdate/Makefile.am index 80b59d9e4..61180e07f 100644 --- a/ntpdate/Makefile.am +++ b/ntpdate/Makefile.am @@ -1,7 +1,7 @@ NULL = BUILT_SOURCES = -CLEANFILES = +DISTCLEANFILES = bin_PROGRAMS = $(NTPDATE_DB) libexec_PROGRAMS = $(NTPDATE_DL) @@ -20,21 +20,20 @@ AM_LDFLAGS = $(LDFLAGS_NTP) AM_LDFLAGS += $(NTP_HARD_LDFLAGS) # LDADD might need RESLIB and ADJLIB -LDADD = version.o ../libntp/libntp.a +LDADD = ../libntp/libntp.a ntpdate_LDADD = $(LDADD) $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LIBOPTS_LDADD) ntpdate_LDADD += $(LIBM) $(LDADD_NTP) -DISTCLEANFILES= .version version.c stamp-v +CLEANFILES = .version version.c noinst_HEADERS= ntpdate.h -$(PROGRAMS): $(LDADD) +ntpdate_SOURCES = ntpdate.c +nodist_ntpdate_SOURCES = version.c -$(top_srcdir)/sntp/scm-rev: - cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev - -version.c: $(ntpdate_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev - env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdate +version.c: Makefile $(top_srcdir)/sntp/scm-rev + $(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdate include $(top_srcdir)/bincheck.mf include $(top_srcdir)/check-libntp.mf +include $(top_srcdir)/check-scm-rev.mf include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/ntpdc/Makefile.am b/ntpdc/Makefile.am index dcad9b480..8e0739dab 100644 --- a/ntpdc/Makefile.am +++ b/ntpdc/Makefile.am @@ -20,15 +20,27 @@ AM_LDFLAGS = $(LDFLAGS_NTP) AM_LDFLAGS += $(NTP_HARD_LDFLAGS) # LDADD might need RESLIB and ADJLIB -ntpdc_LDADD = version.o $(LIBOPTS_LDADD) +ntpdc_LDADD = $(LIBOPTS_LDADD) ntpdc_LDADD += ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) ntpdc_LDADD += $(PTHREAD_LIBS) $(EDITLINE_LIBS) ntpdc_LDADD += $(LDADD_NTP) # ntpdc-layout doesn't need any additional libraries at all ntpdc_layout_LDADD= -DISTCLEANFILES= .version version.c config.log $(man_MANS) -CLEANFILES= check-layout layout.here nl.c ntpdc-layout +DISTCLEANFILES = \ + $(man_MANS) \ + config.log \ + $(NULL) + +CLEANFILES = \ + check-layout \ + layout.here \ + nl.c \ + ntpdc-layout \ + .version \ + version.c \ + $(NULL) + noinst_HEADERS= ntpdc.h ETAGS_ARGS= Makefile.am EXTRA_DIST= \ @@ -83,12 +95,12 @@ $(srcdir)/ntpdc-opts.h: $(srcdir)/ntpdc-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/ntpdc-opts.c: $(srcdir)/ntpdc-opts.def $(std_def_list) - $(run_ag) ntpdc-opts.def + $(AM_V_GEN)$(run_ag) ntpdc-opts.def ### $(srcdir)/ntpdc.1ntpdcman: $(srcdir)/ntpdc-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntpdcman -Tagman-cmd.tpl ntpdc-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpdcman -Tagman-cmd.tpl ntpdc-opts.def $(srcdir)/ntpdc.man.in: $(srcdir)/ntpdc.1ntpdcman $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpdc.1ntpdcman > $(srcdir)/ntpdc.man.in+ @@ -97,7 +109,7 @@ $(srcdir)/ntpdc.man.in: $(srcdir)/ntpdc.1ntpdcman $(top_srcdir)/sntp/scripts/man ### $(srcdir)/ntpdc.1ntpdcmdoc: $(srcdir)/ntpdc-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntpdcmdoc -Tagmdoc-cmd.tpl ntpdc-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpdcmdoc -Tagmdoc-cmd.tpl ntpdc-opts.def $(srcdir)/ntpdc.mdoc.in: $(srcdir)/ntpdc.1ntpdcmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpdc.1ntpdcmdoc > $(srcdir)/ntpdc.mdoc.in+ @@ -115,37 +127,36 @@ $(srcdir)/invoke-ntpdc.menu: $(srcdir)/invoke-ntpdc.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntpdc.texi: $(srcdir)/ntpdc-opts.def $(std_def_list) - $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpdc-opts.def + $(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpdc-opts.def $(top_srcdir)/scripts/build/check--help $@ $(srcdir)/ntpdc.html: $(srcdir)/invoke-ntpdc.texi $(srcdir)/ntpdc.texi $(top_srcdir)/sntp/include/version.texi cd $(srcdir) && ( makeinfo --force --html --no-split -I ../sntp -o ntpdc.html ntpdc.texi || true ) ntpdc_SOURCES = ntpdc.c ntpdc_ops.c ntpdc-opts.c ntpdc-opts.h +nodist_ntpdc_SOURCES = version.c ntpdc-layout.o: nl.c layout.here: ntpdc-layout - ./ntpdc-layout > $@ + $(AM_V_at)./ntpdc-layout > $@ check-layout: ntpdc-layout $(srcdir)/layout.std layout.here - cmp $(srcdir)/layout.std layout.here && echo stamp > $@ + $(AM_V_at)cmp $(srcdir)/layout.std layout.here && echo stamp > $@ -$(PROGRAMS): version.o - -$(top_srcdir)/sntp/scm-rev: - cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev - -version.c: $(ntpdc_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev - env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdc +version.c: Makefile $(top_srcdir)/sntp/scm-rev + $(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpdc # I ran nl_in.c (attached, to be installed into ntpdc) through # $(CC) -E nl_in.c | nl.pl > nl.c nl.c: nl_in.c nl.pl Makefile.am ../config.h ../include/ntp_request.h ntpdc.h - $(CC) -E $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(srcdir)/nl_in.c | ./nl.pl > nl.c + $(AM_V_GEN)$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(srcdir)/nl_in.c | ./nl.pl > $@ + include $(top_srcdir)/bincheck.mf include $(top_srcdir)/check-libopts.mf include $(top_srcdir)/check-libntp.mf +include $(top_srcdir)/check-scm-rev.mf include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/ntpdc/ntpdc.c b/ntpdc/ntpdc.c index 62fcc4806..e39ddfea1 100644 --- a/ntpdc/ntpdc.c +++ b/ntpdc/ntpdc.c @@ -961,8 +961,7 @@ sendrequest( reqsize = (reqsize + 3) & ~3; } else reqsize = req_pkt_size; - ptstamp = (void *)((char *)&qpkt + reqsize); - ptstamp--; + ptstamp = (void *)((char *)&qpkt + reqsize - sizeof *ptstamp); get_systime(&ts); L_ADD(&ts, &delay_time); HTONL_FP(&ts, ptstamp); diff --git a/ntpq/Makefile.am b/ntpq/Makefile.am index 2bdd7dbee..97645c03b 100644 --- a/ntpq/Makefile.am +++ b/ntpq/Makefile.am @@ -17,7 +17,7 @@ AM_LDFLAGS = $(LDFLAGS_NTP) AM_LDFLAGS += $(NTP_HARD_LDFLAGS) # LDADD might need RESLIB and ADJLIB -ntpq_LDADD = version.o $(LIBOPTS_LDADD) +ntpq_LDADD = $(LIBOPTS_LDADD) ntpq_LDADD += ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) ntpq_LDADD += $(PTHREAD_LIBS) $(EDITLINE_LIBS) ntpq_LDADD += $(LDADD_NTP) @@ -30,9 +30,10 @@ libntpq_a_CFLAGS = $(AM_CFLAGS) libntpq_a_CFLAGS += -DNO_MAIN_ALLOWED -DBUILD_AS_LIB libntpq_a_CPPFLAGS = $(AM_CPPFLAGS) -CLEANFILES = -DISTCLEANFILES = .version version.c config.log $(man_MANS) -ETAGS_ARGS = Makefile.am +CLEANFILES = .version version.c +DISTCLEANFILES = config.log $(man_MANS) +ETAGS_ARGS = Makefile.am + EXTRA_DIST = \ invoke-ntpq.menu \ invoke-ntpq.texi \ @@ -74,7 +75,9 @@ std_def_list = \ $(top_srcdir)/sntp/include/ntp.lic \ $(top_srcdir)/sntp/include/version.def \ $(NULL) -ntpq_SOURCES= ntpq.c ntpq-subs.c ntpq-opts.c ntpq-opts.h + +ntpq_SOURCES = ntpq.c ntpq-subs.c ntpq-opts.c ntpq-opts.h +nodist_ntpq_SOURCES = version.c libntpq_a_SOURCES = libntpq.c libntpq.h libntpq_subs.c @@ -82,12 +85,12 @@ $(srcdir)/ntpq-opts.h: $(srcdir)/ntpq-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/ntpq-opts.c: $(srcdir)/ntpq-opts.def $(std_def_list) - $(run_ag) ntpq-opts.def + $(AM_V_GEN)$(run_ag) ntpq-opts.def ### $(srcdir)/ntpq.1ntpqman: $(srcdir)/ntpq-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntpqman -Tagman-cmd.tpl ntpq-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpqman -Tagman-cmd.tpl ntpq-opts.def $(srcdir)/ntpq.man.in: $(srcdir)/ntpq.1ntpqman $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpq.1ntpqman > $(srcdir)/ntpq.man.in+ @@ -96,7 +99,7 @@ $(srcdir)/ntpq.man.in: $(srcdir)/ntpq.1ntpqman $(top_srcdir)/sntp/scripts/mansec ### $(srcdir)/ntpq.1ntpqmdoc: $(srcdir)/ntpq-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntpqmdoc -Tagmdoc-cmd.tpl ntpq-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpqmdoc -Tagmdoc-cmd.tpl ntpq-opts.def $(srcdir)/ntpq.mdoc.in: $(srcdir)/ntpq.1ntpqmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpq.1ntpqmdoc > $(srcdir)/ntpq.mdoc.in+ @@ -114,7 +117,7 @@ $(srcdir)/invoke-ntpq.menu: $(srcdir)/invoke-ntpq.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntpq.texi: $(srcdir)/ntpq-opts.def $(std_def_list) - $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpq-opts.def + $(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpq-opts.def $(top_srcdir)/scripts/build/check--help $@ $(srcdir)/ntpq.html: $(srcdir)/invoke-ntpq.texi $(srcdir)/ntpq.texi $(top_srcdir)/sntp/include/version.texi @@ -122,16 +125,12 @@ $(srcdir)/ntpq.html: $(srcdir)/invoke-ntpq.texi $(srcdir)/ntpq.texi $(top_srcdir ### -$(PROGRAMS): version.o - -$(top_srcdir)/sntp/scm-rev: - cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev - -version.c: $(ntpq_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev - env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpq +version.c: Makefile $(top_srcdir)/sntp/scm-rev + $(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntpq include $(top_srcdir)/bincheck.mf include $(top_srcdir)/check-libopts.mf include $(top_srcdir)/check-libntp.mf +include $(top_srcdir)/check-scm-rev.mf include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf diff --git a/ntpsnmpd/Makefile.am b/ntpsnmpd/Makefile.am index 7066c6b61..5729bb85c 100644 --- a/ntpsnmpd/Makefile.am +++ b/ntpsnmpd/Makefile.am @@ -75,12 +75,12 @@ $(srcdir)/ntpsnmpd-opts.h: $(srcdir)/ntpsnmpd-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/ntpsnmpd-opts.c: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) - $(run_ag) ntpsnmpd-opts.def + $(AM_V_GEN)$(run_ag) ntpsnmpd-opts.def ### $(srcdir)/ntpsnmpd.1ntpsnmpdman: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntpsnmpdman -Tagman-cmd.tpl ntpsnmpd-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpsnmpdman -Tagman-cmd.tpl ntpsnmpd-opts.def $(srcdir)/ntpsnmpd.man.in: $(srcdir)/ntpsnmpd.1ntpsnmpdman $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsnmpd.1ntpsnmpdman > $(srcdir)/ntpsnmpd.man.in+ @@ -89,7 +89,7 @@ $(srcdir)/ntpsnmpd.man.in: $(srcdir)/ntpsnmpd.1ntpsnmpdman $(top_srcdir)/sntp/sc ### $(srcdir)/ntpsnmpd.1ntpsnmpdmdoc: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntpsnmpdmdoc -Tagmdoc-cmd.tpl ntpsnmpd-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpsnmpdmdoc -Tagmdoc-cmd.tpl ntpsnmpd-opts.def $(srcdir)/ntpsnmpd.mdoc.in: $(srcdir)/ntpsnmpd.1ntpsnmpdmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsnmpd.1ntpsnmpdmdoc > $(srcdir)/ntpsnmpd.mdoc.in+ @@ -107,7 +107,7 @@ $(srcdir)/invoke-ntpsnmpd.menu: $(srcdir)/invoke-ntpsnmpd.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntpsnmpd.texi: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) - $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsnmpd-opts.def + $(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsnmpd-opts.def $(top_srcdir)/scripts/build/check--help $@ $(srcdir)/ntpsnmpd.html: $(srcdir)/invoke-ntpsnmpd.texi $(srcdir)/ntpsnmpd.texi $(top_srcdir)/sntp/include/version.texi diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 4a85bff58..b74c8916e 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -87,12 +87,12 @@ OPTTPL = $(std_def_list) plot_summary: $(srcdir)/plot_summary-opts $(srcdir)/plot_summary-opts: plot_summary-opts.def $(OPTTPL) - $(run_ag) plot_summary-opts.def + $(AM_V_GEN)$(run_ag) plot_summary-opts.def ### Nroff $(srcdir)/plot_summary.1plot_summaryman: $(srcdir)/plot_summary-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1plot_summaryman -Tagman-cmd.tpl plot_summary-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1plot_summaryman -Tagman-cmd.tpl plot_summary-opts.def $(srcdir)/plot_summary.man.in: $(srcdir)/plot_summary.1plot_summaryman $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/plot_summary.1plot_summaryman > $(srcdir)/plot_summary.man.in+ @@ -101,7 +101,7 @@ $(srcdir)/plot_summary.man.in: $(srcdir)/plot_summary.1plot_summaryman $(top_src ### Mdoc $(srcdir)/plot_summary.1plot_summarymdoc: $(srcdir)/plot_summary-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1plot_summarymdoc -Tagmdoc-cmd.tpl plot_summary-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1plot_summarymdoc -Tagmdoc-cmd.tpl plot_summary-opts.def $(srcdir)/plot_summary.mdoc.in: $(srcdir)/plot_summary.1plot_summarymdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/plot_summary.1plot_summarymdoc > $(srcdir)/plot_summary.mdoc.in+ @@ -119,7 +119,7 @@ $(srcdir)/invoke-plot_summary.menu: $(srcdir)/invoke-plot_summary.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-plot_summary.texi: plot_summary-opts $(srcdir)/plot_summary-opts.def $(std_def_list) - $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section plot_summary-opts.def + $(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section plot_summary-opts.def $(top_srcdir)/scripts/build/check--help $@ ### HTML @@ -133,12 +133,12 @@ $(srcdir)/plot_summary.html: $(srcdir)/invoke-plot_summary.menu $(srcdir)/invoke summary: $(srcdir)/summary-opts $(srcdir)/summary-opts: summary-opts.def $(OPTTPL) - $(run_ag) summary-opts.def + $(AM_V_GEN)$(run_ag) summary-opts.def ### Nroff $(srcdir)/summary.1summaryman: $(srcdir)/summary-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1summaryman -Tagman-cmd.tpl summary-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1summaryman -Tagman-cmd.tpl summary-opts.def $(srcdir)/summary.man.in: $(srcdir)/summary.1summaryman $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/summary.1summaryman > $(srcdir)/summary.man.in+ @@ -147,7 +147,7 @@ $(srcdir)/summary.man.in: $(srcdir)/summary.1summaryman $(top_srcdir)/sntp/scrip ### Mdoc $(srcdir)/summary.1summarymdoc: $(srcdir)/summary-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1summarymdoc -Tagmdoc-cmd.tpl summary-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1summarymdoc -Tagmdoc-cmd.tpl summary-opts.def $(srcdir)/summary.mdoc.in: $(srcdir)/summary.1summarymdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/summary.1summarymdoc > $(srcdir)/summary.mdoc.in+ @@ -165,7 +165,7 @@ $(srcdir)/invoke-summary.menu: $(srcdir)/invoke-summary.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-summary.texi: summary-opts $(srcdir)/summary-opts.def $(std_def_list) - $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section summary-opts.def + $(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section summary-opts.def $(top_srcdir)/scripts/build/check--help $@ ### HTML diff --git a/scripts/calc_tickadj/Makefile.am b/scripts/calc_tickadj/Makefile.am index cf14be64a..a89cf21f1 100644 --- a/scripts/calc_tickadj/Makefile.am +++ b/scripts/calc_tickadj/Makefile.am @@ -65,12 +65,12 @@ BUILT_SOURCES = $(noinst_DATA) calc_tickadj: $(srcdir)/calc_tickadj-opts $(srcdir)/calc_tickadj-opts: $(srcdir)/calc_tickadj-opts.def - $(run_ag) calc_tickadj-opts.def + $(AM_V_GEN)$(run_ag) calc_tickadj-opts.def ### Nroff $(srcdir)/calc_tickadj.1calc_tickadjman: $(srcdir)/calc_tickadj-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1calc_tickadjman -Tagman-cmd.tpl calc_tickadj-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1calc_tickadjman -Tagman-cmd.tpl calc_tickadj-opts.def $(srcdir)/calc_tickadj.man.in: $(srcdir)/calc_tickadj.1calc_tickadjman $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/calc_tickadj.1calc_tickadjman > $(srcdir)/calc_tickadj.man.in+ @@ -79,7 +79,7 @@ $(srcdir)/calc_tickadj.man.in: $(srcdir)/calc_tickadj.1calc_tickadjman $(top_src ### Mdoc $(srcdir)/calc_tickadj.1calc_tickadjmdoc: $(srcdir)/calc_tickadj-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1calc_tickadjmdoc -Tagmdoc-cmd.tpl calc_tickadj-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1calc_tickadjmdoc -Tagmdoc-cmd.tpl calc_tickadj-opts.def $(srcdir)/calc_tickadj.mdoc.in: $(srcdir)/calc_tickadj.1calc_tickadjmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/calc_tickadj.1calc_tickadjmdoc > $(srcdir)/calc_tickadj.mdoc.in+ @@ -97,7 +97,7 @@ $(srcdir)/invoke-calc_tickadj.menu: $(srcdir)/invoke-calc_tickadj.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-calc_tickadj.texi: $(srcdir)/calc_tickadj-opts $(srcdir)/calc_tickadj-opts.def $(std_def_list) - $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section calc_tickadj-opts.def + $(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section calc_tickadj-opts.def $(top_srcdir)/scripts/build/check--help $@ ### HTML diff --git a/scripts/ntp-wait/Makefile.am b/scripts/ntp-wait/Makefile.am index a3a48fb99..d1814e20c 100644 --- a/scripts/ntp-wait/Makefile.am +++ b/scripts/ntp-wait/Makefile.am @@ -55,12 +55,12 @@ noinst_DATA = \ ntp-wait: $(srcdir)/ntp-wait-opts $(srcdir)/ntp-wait-opts: $(srcdir)/ntp-wait-opts.def $(std_def_list) - $(run_ag) ntp-wait-opts.def + $(AM_V_GEN)$(run_ag) ntp-wait-opts.def ### Nroff $(srcdir)/ntp-wait.1ntp-waitman: $(srcdir)/ntp-wait-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntp-waitman -Tagman-cmd.tpl ntp-wait-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntp-waitman -Tagman-cmd.tpl ntp-wait-opts.def $(srcdir)/ntp-wait.man.in: $(srcdir)/ntp-wait.1ntp-waitman $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-wait.1ntp-waitman > $(srcdir)/ntp-wait.man.in+ @@ -69,7 +69,7 @@ $(srcdir)/ntp-wait.man.in: $(srcdir)/ntp-wait.1ntp-waitman $(top_srcdir)/sntp/sc ### Mdoc $(srcdir)/ntp-wait.1ntp-waitmdoc: $(srcdir)/ntp-wait-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntp-waitmdoc -Tagmdoc-cmd.tpl ntp-wait-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntp-waitmdoc -Tagmdoc-cmd.tpl ntp-wait-opts.def $(srcdir)/ntp-wait.mdoc.in: $(srcdir)/ntp-wait.1ntp-waitmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntp-wait.1ntp-waitmdoc > $(srcdir)/ntp-wait.mdoc.in+ @@ -87,7 +87,7 @@ $(srcdir)/invoke-ntp-wait.menu: $(srcdir)/invoke-ntp-wait.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntp-wait.texi: ntp-wait-opts $(srcdir)/ntp-wait-opts.def $(std_def_list) - $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntp-wait-opts.def + $(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntp-wait-opts.def $(top_srcdir)/scripts/build/check--help $@ ### HTML diff --git a/scripts/ntpsweep/Makefile.am b/scripts/ntpsweep/Makefile.am index 04b29a1b6..69231d9a4 100644 --- a/scripts/ntpsweep/Makefile.am +++ b/scripts/ntpsweep/Makefile.am @@ -61,12 +61,12 @@ noinst_DATA = \ ntpsweep: $(srcdir)/ntpsweep-opts $(srcdir)/ntpsweep-opts: ntpsweep-opts.def $(std_def_list) - $(run_ag) ntpsweep-opts.def + $(AM_V_GEN)$(run_ag) ntpsweep-opts.def ### Nroff $(srcdir)/ntpsweep.1ntpsweepman: ntpsweep-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntpsweepman -Tagman-cmd.tpl ntpsweep-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpsweepman -Tagman-cmd.tpl ntpsweep-opts.def $(srcdir)/ntpsweep.man.in: ntpsweep.1ntpsweepman $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsweep.1ntpsweepman > $(srcdir)/ntpsweep.man.in+ @@ -75,7 +75,7 @@ $(srcdir)/ntpsweep.man.in: ntpsweep.1ntpsweepman $(top_srcdir)/sntp/scripts/mans ### Mdoc $(srcdir)/ntpsweep.1ntpsweepmdoc: ntpsweep-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntpsweepmdoc -Tagmdoc-cmd.tpl ntpsweep-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntpsweepmdoc -Tagmdoc-cmd.tpl ntpsweep-opts.def $(srcdir)/ntpsweep.mdoc.in: ntpsweep.1ntpsweepmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntpsweep.1ntpsweepmdoc > $(srcdir)/ntpsweep.mdoc.in+ @@ -93,7 +93,7 @@ $(srcdir)/invoke-ntpsweep.menu: invoke-ntpsweep.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntpsweep.texi: ntpsweep-opts ntpsweep-opts.def $(std_def_list) - $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsweep-opts.def + $(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntpsweep-opts.def $(top_srcdir)/scripts/build/check--help $@ ### HTML diff --git a/scripts/ntptrace/Makefile.am b/scripts/ntptrace/Makefile.am index d5faee280..be9ef5726 100644 --- a/scripts/ntptrace/Makefile.am +++ b/scripts/ntptrace/Makefile.am @@ -54,12 +54,12 @@ noinst_DATA = \ ntptrace: $(srcdir)/ntptrace-opts $(srcdir)/ntptrace-opts: $(srcdir)/ntptrace-opts.def $(std_def_list) - $(run_ag) ntptrace-opts.def + $(AM_V_GEN)$(run_ag) ntptrace-opts.def ### Nroff $(srcdir)/ntptrace.1ntptraceman: $(srcdir)/ntptrace-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntptraceman -Tagman-cmd.tpl ntptrace-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntptraceman -Tagman-cmd.tpl ntptrace-opts.def $(srcdir)/ntptrace.man.in: $(srcdir)/ntptrace.1ntptraceman $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntptrace.1ntptraceman > $(srcdir)/ntptrace.man.in+ @@ -68,7 +68,7 @@ $(srcdir)/ntptrace.man.in: $(srcdir)/ntptrace.1ntptraceman $(top_srcdir)/sntp/sc ### Mdoc $(srcdir)/ntptrace.1ntptracemdoc: $(srcdir)/ntptrace-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1ntptracemdoc -Tagmdoc-cmd.tpl ntptrace-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1ntptracemdoc -Tagmdoc-cmd.tpl ntptrace-opts.def $(srcdir)/ntptrace.mdoc.in: $(srcdir)/ntptrace.1ntptracemdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/ntptrace.1ntptracemdoc > $(srcdir)/ntptrace.mdoc.in+ @@ -86,7 +86,7 @@ $(srcdir)/invoke-ntptrace.menu: $(srcdir)/invoke-ntptrace.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-ntptrace.texi: ntptrace-opts $(srcdir)/ntptrace-opts.def $(std_def_list) - $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntptrace-opts.def + $(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section ntptrace-opts.def $(top_srcdir)/scripts/build/check--help $@ ### HTML diff --git a/scripts/update-leap/Makefile.am b/scripts/update-leap/Makefile.am index 29c8220a3..8c21a75bd 100644 --- a/scripts/update-leap/Makefile.am +++ b/scripts/update-leap/Makefile.am @@ -57,12 +57,12 @@ $(srcdir)/update-leap: $(srcdir)/update-leap-opts @: do-nothing action to avoid default SCCS get $(srcdir)/update-leap-opts: update-leap-opts.def $(std_def_list) - $(run_ag) update-leap-opts.def + $(AM_V_GEN)$(run_ag) update-leap-opts.def ### Man $(srcdir)/update-leap.1update-leapman: $(srcdir)/update-leap-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1update-leapman -Tagman-cmd.tpl update-leap-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1update-leapman -Tagman-cmd.tpl update-leap-opts.def $(srcdir)/update-leap.man.in: $(srcdir)/update-leap.1update-leapman $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/update-leap.1update-leapman > $(srcdir)/update-leap.man.in+ @@ -71,7 +71,7 @@ $(srcdir)/update-leap.man.in: $(srcdir)/update-leap.1update-leapman $(top_srcdir ### Mdoc $(srcdir)/update-leap.1update-leapmdoc: $(srcdir)/update-leap-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1update-leapmdoc -Tagmdoc-cmd.tpl update-leap-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1update-leapmdoc -Tagmdoc-cmd.tpl update-leap-opts.def $(srcdir)/update-leap.mdoc.in: $(srcdir)/update-leap.1update-leapmdoc $(top_srcdir)/sntp/scripts/mansec2subst.sed sed -f $(top_srcdir)/sntp/scripts/mansec2subst.sed $(srcdir)/update-leap.1update-leapmdoc > $(srcdir)/update-leap.mdoc.in+ @@ -89,7 +89,7 @@ $(srcdir)/invoke-update-leap.menu: $(srcdir)/invoke-update-leap.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-update-leap.texi: $(srcdir)/update-leap-opts.def $(std_def_list) - $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section update-leap-opts.def + $(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section update-leap-opts.def $(top_srcdir)/scripts/build/check--help $@ ### HTML diff --git a/sntp/Makefile.am b/sntp/Makefile.am index bd0d71d68..8f9d1f612 100644 --- a/sntp/Makefile.am +++ b/sntp/Makefile.am @@ -16,8 +16,7 @@ AM_CPPFLAGS += $(NTP_HARD_CPPFLAGS) AM_LDFLAGS = $(LDFLAGS_NTP) AM_LDFLAGS += $(NTP_HARD_LDFLAGS) -LDADD = version.o -LDADD += libsntp.a +LDADD = libsntp.a LDADD += $(LIBOPTS_LDADD) LDADD += $(LDADD_LIBEVENT) LDADD += ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) @@ -69,8 +68,12 @@ libsntp_a_SOURCES = \ utilities.c \ $(NULL) -sntp_SOURCES = \ - sntp.c \ +sntp_SOURCES = \ + sntp.c \ + $(NULL) + +nodist_sntp_SOURCES = \ + version.c \ $(NULL) noinst_HEADERS = \ @@ -85,8 +88,6 @@ noinst_HEADERS = \ $(NULL) DISTCLEANFILES = \ - .version \ - version.c \ config.log \ $(man_MANS) \ $(NULL) @@ -118,15 +119,15 @@ BUILT_SOURCES = \ libtool \ $(srcdir)/sntp-opts.c \ $(srcdir)/sntp-opts.h \ - check-scm-rev \ $(srcdir)/include/version.def \ $(srcdir)/m4/version.m4 \ $(srcdir)/include/version.texi \ $(NULL) CLEANFILES = \ - built-sources-only \ check-COPYRIGHT-submake \ + .version \ + version.c \ $(NULL) man1_MANS= @@ -151,20 +152,16 @@ noinst_DATA= \ install-data-local: install-html FRC: - @: do-nothing action to prevent default SCCS get - @: FRC "force" depends on nothing and is not a file, so is - @: always out-of-date causing targets which depend on it to - @: similarly always be outdated causing their rules to fire - @: each time they or a dependent is built. - -$(PROGRAMS): version.o + @: FRC "force" depends on nothing and is not a file, so is always + @: out-of-date causing targets which depend on it to also be + @: outdated so their rules to fire each time they are built. ## We probably need something about libevent, too ## That is probably not possible since LDADD_LIBEVENT may be ## non-file "-levent_core". -version.c: $(sntp_OBJECTS) ../libntp/libntp.a Makefile $(srcdir)/scm-rev - env CSET=`cat $(srcdir)/scm-rev` $(top_builddir)/../scripts/build/mkver sntp +version.c: Makefile $(srcdir)/scm-rev + $(AM_V_GEN)env CSET=`cat $(srcdir)/scm-rev` $(top_builddir)/../scripts/build/mkver sntp check-autogen-version.def: FRC @cd $(srcdir) \ @@ -187,11 +184,11 @@ built-sources-only: $(BUILT_SOURCES) check-scm-rev: $(srcdir)/scm-rev @: do-nothing -$(srcdir)/scm-rev: - -bk root $(srcdir) >/dev/null 2>&1 && \ - cd $(srcdir)/.. && \ - x=`bk -R prs -hr+ -nd:I: ChangeSet` && \ - y=`cat sntp/scm-rev 2>/dev/null` || true && \ +$(srcdir)/scm-rev: FRC + $(AM_V_at)-bk root $(srcdir) >/dev/null 2>&1 && \ + cd $(srcdir)/.. && \ + x=`bk -R prs -hr+ -nd:I: ChangeSet` && \ + y=`cat sntp/scm-rev 2>/dev/null` || true && \ case "$$x" in ''|$$y) ;; *) echo $$x > sntp/scm-rev ;; esac $(srcdir)/m4/version.m4: $(srcdir)/../packageinfo.sh @@ -227,12 +224,12 @@ $(srcdir)/sntp-opts.h: $(srcdir)/sntp-opts.c @: do-nothing action to avoid default SCCS get, .h built with .c $(srcdir)/sntp-opts.c: $(srcdir)/sntp-opts.def $(std_def_list) - $(run_ag) sntp-opts.def + $(AM_V_GEN)$(run_ag) sntp-opts.def ### $(srcdir)/sntp.1sntpman: $(srcdir)/sntp-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1sntpman -Tagman-cmd.tpl sntp-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1sntpman -Tagman-cmd.tpl sntp-opts.def $(srcdir)/sntp.man.in: $(srcdir)/sntp.1sntpman $(srcdir)/scripts/mansec2subst.sed sed -f $(srcdir)/scripts/mansec2subst.sed $(srcdir)/sntp.1sntpman > $(srcdir)/sntp.man.in+ @@ -241,7 +238,7 @@ $(srcdir)/sntp.man.in: $(srcdir)/sntp.1sntpman $(srcdir)/scripts/mansec2subst.se ### $(srcdir)/sntp.1sntpmdoc: $(srcdir)/sntp-opts.def $(std_def_list) - $(run_ag) -DMAN_SECTION=1sntpmdoc -Tagmdoc-cmd.tpl sntp-opts.def + $(AM_V_GEN)$(run_ag) -DMAN_SECTION=1sntpmdoc -Tagmdoc-cmd.tpl sntp-opts.def $(srcdir)/sntp.mdoc.in: $(srcdir)/sntp.1sntpmdoc $(srcdir)/scripts/mansec2subst.sed sed -f $(srcdir)/scripts/mansec2subst.sed $(srcdir)/sntp.1sntpmdoc > $(srcdir)/sntp.mdoc.in+ @@ -259,7 +256,7 @@ $(srcdir)/invoke-sntp.menu: $(srcdir)/invoke-sntp.texi @: do-nothing action to avoid default SCCS get, .menu built with .texi $(srcdir)/invoke-sntp.texi: $(srcdir)/sntp-opts.def $(std_def_list) - $(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section sntp-opts.def + $(AM_V_GEN)$(run_ag) -Tagtexi-cmd.tpl -DLEVEL=section sntp-opts.def $(top_srcdir)/../scripts/build/check--help $@ $(srcdir)/sntp.html: $(srcdir)/invoke-sntp.texi $(srcdir)/sntp.texi $(srcdir)/include/version.texi diff --git a/sntp/configure.ac b/sntp/configure.ac index 8fa76537d..43c2ad6c5 100644 --- a/sntp/configure.ac +++ b/sntp/configure.ac @@ -135,9 +135,6 @@ AC_DEFINE([HAVE_TERMIOS], 1, [sntp does not care about TTY stuff]) AC_CHECK_FUNCS([socket]) NTP_UNITYBUILD -## HMS: if we don't find c++ we should not look for gtest. -#AC_PROG_CXX -#NTP_GOOGLETEST SNTP_PROBLEM_TESTS diff --git a/sntp/m4/ntp_cacheversion.m4 b/sntp/m4/ntp_cacheversion.m4 index 3619a603f..0ec1f0d8d 100644 --- a/sntp/m4/ntp_cacheversion.m4 +++ b/sntp/m4/ntp_cacheversion.m4 @@ -14,7 +14,7 @@ # while children do not. This comes into play only when introducing # NTP_CACHEVERSION where it had not been previously used: Previous # cached results are presumed incompatible and not used. The reason -# children do not flush the cached is it is shared with the parent and +# children do not flush the cache is it is shared with the parent and # the children can rely on the parent having cleared any cache variables # predating this mechanism. Therefore the child can rely on the # config.cache generated by the parent on the first run despite not @@ -102,12 +102,7 @@ AC_DEFUN_ONCE([NTP_CACHEVERSION], [ for c_varname in $c_varname_list do - dnl AS_UNSET([$c_varname]) - dnl With Autoconf 2.61 and automake 1.10.3, using AS_UNSET - dnl here triggers generation of a syntax error in configure. - dnl Once we require a newer Autoconf we can revert to the - dnl AS_UNSET code. - { eval $c_varname=; unset $c_varname; } + AS_UNSET([$c_varname]) done AC_MSG_NOTICE([[$cache_file saved by another version, ignored.]]) diff --git a/sntp/m4/ntp_googletest.m4 b/sntp/m4/ntp_googletest.m4 deleted file mode 100644 index 4aa740f13..000000000 --- a/sntp/m4/ntp_googletest.m4 +++ /dev/null @@ -1,53 +0,0 @@ -dnl ###################################################################### -dnl NTP_GOOGLETEST gtest support shared by top-level and sntp/configure.ac -AC_DEFUN([NTP_GOOGLETEST], [ -gta=false -AC_ARG_WITH( - [gtest], - [AS_HELP_STRING( - [--with-gtest], - [Use the gtest framework (Default: if it's available)] - )], - [try_gtest=$withval], - [try_gtest=yes] -) -case "$try_gtest" in - yes) - AC_PATH_PROG([GTEST_CONFIG], [gtest-config]) - AS_UNSET([ac_cv_path_GTEST_CONFIG]) - case x${GTEST_CONFIG} in - x) ;; - *) - AC_MSG_CHECKING([gtest version]) - gtest_version_test=`$GTEST_CONFIG --min-version=1.5 || echo toolow` - case "$gtest_version_test" in - toolow*) - ;; - *) - GTEST_LDFLAGS=`$GTEST_CONFIG --ldflags` - GTEST_LIBS=`$GTEST_CONFIG --libs` - GTEST_CXXFLAGS=`$GTEST_CONFIG --cxxflags` - GTEST_CPPFLAGS=`$GTEST_CONFIG --cppflags` - AC_SUBST([GTEST_LDFLAGS]) - AC_SUBST([GTEST_LIBS]) - AC_SUBST([GTEST_CXXFLAGS]) - AC_SUBST([GTEST_CPPFLAGS]) - gta=true - ;; - esac - gtest_version=`$GTEST_CONFIG --version` - case "$gta" in - true) - AC_MSG_RESULT([($gtest_version) ok]) - ;; - *) AC_MSG_RESULT([($gtest_version) not ok]) - ;; - esac - AS_UNSET([gtest_version_test]) - AS_UNSET([gtest_version]) - esac -esac -AM_CONDITIONAL([GTEST_AVAILABLE], [$gta]) - -]) -dnl ====================================================================== diff --git a/sntp/tests/Makefile.am b/sntp/tests/Makefile.am index e1f82f22c..00202f583 100644 --- a/sntp/tests/Makefile.am +++ b/sntp/tests/Makefile.am @@ -2,6 +2,8 @@ NULL = BUILT_SOURCES = EXTRA_PROGRAMS = +# data CLEANFILES down below + CLEANFILES = \ debug-output-lfp-bin \ debug-output-lfp-dec \ @@ -11,11 +13,11 @@ CLEANFILES = \ kod-output-single \ testLogfile.log \ testLogfile2.log \ + .version \ + version.c \ $(NULL) DISTCLEANFILES = \ - .version \ - version.c kod-output-blank \ kod-output-single \ kod-output-multiple \ @@ -130,47 +132,56 @@ BUILT_SOURCES += \ test_networking_SOURCES = \ networking.c \ run-networking.c \ - version.c \ $(NULL) +nodist_test_networking_SOURCES = version.c + test_packetHandling_SOURCES = \ packetHandling.c \ run-packetHandling.c \ - version.c \ $(NULL) +nodist_test_packetHandling_SOURCES = version.c + test_kodDatabase_SOURCES = \ kodDatabase.c \ run-kodDatabase.c \ - version.c \ $(NULL) +nodist_test_kodDatabase_SOURCES = version.c + test_keyFile_SOURCES = \ fileHandlingTest.c \ keyFile.c \ run-keyFile.c \ - version.c \ $(NULL) +nodist_test_keyFile_SOURCES = version.c + test_kodFile_SOURCES = \ fileHandlingTest.c \ kodFile.c \ run-kodFile.c \ - version.c \ $(NULL) +nodist_test_kodFile_SOURCES = version.c + test_packetProcessing_SOURCES = \ packetProcessing.c \ run-packetProcessing.c \ sntptest.c \ $(NULL) +nodist_test_packetProcessing_SOURCES = version.c + test_utilities_SOURCES = \ fileHandlingTest.c \ utilities.c \ run-utilities.c \ $(NULL) +nodist_test_utilities_SOURCES = version.c + test_crypto_CFLAGS = \ $(CFLAGS_LIBEVENT) \ $(AM_CFLAGS) \ @@ -179,15 +190,17 @@ test_crypto_CFLAGS = \ test_crypto_SOURCES = \ crypto.c \ run-crypto.c \ - version.c \ $(NULL) +nodist_test_crypto_SOURCES = version.c + test_log_SOURCES = \ t-log.c \ run-t-log.c \ - version.c \ $(NULL) +nodist_test_log_SOURCES = version.c + $(srcdir)/run-kodFile.c: $(srcdir)/kodFile.c $(std_unity_list) $(run_unity) $< $@ @@ -225,14 +238,16 @@ endif #TESTS += tests-runner #endif -version.c: ../../libntp/libntp.a ../unity/libunity.a Makefile $(top_srcdir)/scm-rev - env CSET=`cat $(srcdir)/../scm-rev` $(top_builddir)/../scripts/build/mkver sntp-tests +version.c: Makefile $(top_srcdir)/scm-rev + $(AM_V_GEN)env CSET=`cat $(srcdir)/../scm-rev` $(top_builddir)/../scripts/build/mkver sntp-tests -version.o: version.c - env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o +$(top_srcdir)/scm-rev: FRC.scm-rev + $(AM_V_GEN)cd .. && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev -$(top_srcdir)/scm-rev: - cd .. && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev +FRC.scm-rev: + @: FRC.scm-rev "force" depends on nothing and is not a file, so is \ + always out-of-date causing targets which depend on it to also \ + be outdated so their rules to fire each time they are built. include $(top_srcdir)/check-libntp.mf include $(top_srcdir)/check-libsntp.mf diff --git a/sntp/tests/packetProcessing.c b/sntp/tests/packetProcessing.c index 9c9f061c4..53c454a9f 100644 --- a/sntp/tests/packetProcessing.c +++ b/sntp/tests/packetProcessing.c @@ -9,8 +9,6 @@ #define CMAC_LENGTH 16 -const char * Version = "stub unit test Version string"; - /* Hacks into the key database. */ extern struct key* key_ptr; extern int key_cnt; diff --git a/sntp/tests/sntptest.c b/sntp/tests/sntptest.c index 73c1ad26f..cb08d371a 100644 --- a/sntp/tests/sntptest.c +++ b/sntp/tests/sntptest.c @@ -1,7 +1,5 @@ #include "config.h" -#include "ntp_stdlib.h" -#include "sntp-opts.h" #include "sntptest.h" void @@ -28,6 +26,6 @@ ActivateOption(const char* option, const char* argument) { opts[2] = estrdup(argument); opts[3] = estrdup("127.0.0.1"); - optionProcess(&sntpOptions, ARGV_SIZE, opts); + optionProcess(&sntpOptions, COUNTOF(opts), opts); } diff --git a/sntp/tests/sntptest.h b/sntp/tests/sntptest.h index 82e2562dd..05a6d5db4 100644 --- a/sntp/tests/sntptest.h +++ b/sntp/tests/sntptest.h @@ -2,6 +2,7 @@ #define SNTPTEST_H #include "ntp_stdlib.h" +#include "ntp_types.h" #include "sntp-opts.h" void sntptest(void); diff --git a/sntp/tests/utilities.c b/sntp/tests/utilities.c index a68aaacae..aeeee4b2c 100644 --- a/sntp/tests/utilities.c +++ b/sntp/tests/utilities.c @@ -22,9 +22,6 @@ void test_LfpOutputBinaryFormat(void); void test_LfpOutputDecimalFormat(void); -const char * Version = "stub unit test Version string"; - - sockaddr_u CreateSockaddr4(const char* address) { sockaddr_u s; diff --git a/sntp/unity/auto/parseOutput.rb b/sntp/unity/auto/parseOutput.rb old mode 100755 new mode 100644 diff --git a/sntp/unity/auto/type_sanitizer.rb b/sntp/unity/auto/type_sanitizer.rb old mode 100755 new mode 100644 diff --git a/sntp/unity/auto/unity_test_summary.py b/sntp/unity/auto/unity_test_summary.py old mode 100755 new mode 100644 diff --git a/util/Makefile.am b/util/Makefile.am index 10a7d802e..cef623c59 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -21,10 +21,11 @@ AM_LDFLAGS += $(NTP_HARD_LDFLAGS) # LDADD might need RESLIB and ADJLIB LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) tg2_LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) -ntp_keygen_LDADD = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a +ntp_keygen_LDADD = $(LIBOPTS_LDADD) ../libntp/libntp.a ntp_keygen_LDADD += $(LDADD_LIBEVENT) ntp_keygen_LDADD += $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LDADD_NTP) $(LIBM) ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h +nodist_ntp_keygen_SOURCES = version.c tickadj_LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS) $(LDADD_NLIST) @@ -42,8 +43,8 @@ EXTRA_DIST= \ $(NULL) BUILT_SOURCES= ntp-keygen-opts.c ntp-keygen-opts.h -CLEANFILES= -DISTCLEANFILES= .version version.c config.log $(man_MANS) +CLEANFILES = .version version.c +DISTCLEANFILES= config.log $(man_MANS) html_DATA= \ $(srcdir)/ntp-keygen.html \ @@ -121,16 +122,12 @@ jitter_LDADD= kern.o: kern.c $(COMPILE) -DHAVE_TIMEX_H -c kern.c -$(PROGRAMS): version.o - -$(top_srcdir)/sntp/scm-rev: - cd ../sntp && $(MAKE) $(AM_MAKEFLAGS) check-scm-rev - -version.c: $(ntp_keygen_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev - env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntp-keygen +version.c: Makefile $(top_srcdir)/sntp/scm-rev + $(AM_V_GEN)env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/build/mkver ntp-keygen include $(top_srcdir)/bincheck.mf include $(top_srcdir)/check-libntp.mf include $(top_srcdir)/check-libopts.mf +include $(top_srcdir)/check-scm-rev.mf include $(top_srcdir)/depsver.mf include $(top_srcdir)/includes.mf