From: Dave Hart Date: Sat, 14 Nov 2009 02:20:06 +0000 (+0000) Subject: [Bug 1381] Version .deps generated include file dependencies to allow X-Git-Tag: NTP_4_2_5P245_RC~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b965ad4629d7bf0942326a3db08af08518435fcc;p=thirdparty%2Fntp.git [Bug 1381] Version .deps generated include file dependencies to allow known dependecy-breaking changes to force .deps to be cleaned, triggered by changing the contents of deps-ver and/or sntp/deps-ver. bk: 4afe13d6s5TQi_J1YvlfiZ8HoHzHZQ --- diff --git a/ChangeLog b/ChangeLog index 36d4c785f..c7541023e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +* [Bug 1381] Version .deps generated include file dependencies to allow + known dependecy-breaking changes to force .deps to be cleaned, + triggered by changing the contents of deps-ver and/or sntp/deps-ver. (4.2.5p244-RC) 2009/11/12 Released by Harlan Stenn * keygen.html updates from Dave Mills. * [Bug 1003] ntpdc unconfig command doesn't prompt for keyid. diff --git a/Makefile.am b/Makefile.am index c8d92246d..f90234f22 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,10 +5,10 @@ ACLOCAL_AMFLAGS= -I m4 -I libopts/m4 NULL= SUBDIRS= -SUBDIRS+= \ - scripts \ - include \ - ElectricFence \ +SUBDIRS+= \ + scripts \ + include \ + ElectricFence \ $(NULL) if NEED_LIBOPTS SUBDIRS+= libopts @@ -53,47 +53,48 @@ DIST_SUBDIRS= \ DISTCHECK_CONFIGURE_FLAGS= -C --with-arlib --enable-local-libopts -EXTRA_DIST = \ - COPYRIGHT \ - ChangeLog \ - CommitLog \ - CommitLog-4.1.0 \ - NEWS \ - NOTES.y2kfixes \ - README.bk \ - README.hackers \ - README.patches \ - README.refclocks \ - README.versions \ - TODO \ - WHERE-TO-START \ - bootstrap \ - build \ - config.guess \ - config.h.in \ - config.sub \ - dot.emacs \ - excludes \ - flock-build \ - install-sh \ - packageinfo.sh \ - readme.y2kfixes \ +EXTRA_DIST = \ + COPYRIGHT \ + ChangeLog \ + CommitLog \ + CommitLog-4.1.0 \ + NEWS \ + NOTES.y2kfixes \ + README.bk \ + README.hackers \ + README.patches \ + README.refclocks \ + README.versions \ + TODO \ + WHERE-TO-START \ + bootstrap \ + build \ + config.guess \ + config.h.in \ + config.sub \ + dot.emacs \ + excludes \ + flock-build \ + install-sh \ + packageinfo.sh \ + readme.y2kfixes \ results.y2kfixes \ \ - conf \ - html \ - lib/isc \ - ports \ + conf \ + html \ + lib/isc \ + ports \ \ - bincheck.mf \ - version \ - version.m4 \ + bincheck.mf \ + depsver.mf \ + deps-ver \ + version \ + version.m4 \ \ $(NULL) DISTCLEANFILES = .gcc-warning -#ETAGS_ARGS = $(srcdir)/Makefile.am $(srcdir)/configure.ac ETAGS_ARGS = Makefile.am configure.ac # HMS: make ports be the last directory... @@ -120,7 +121,7 @@ $(srcdir)/COPYRIGHT: $(srcdir)/html/copyright.html $(srcdir)/version: FRC.version -(bk version) >/dev/null 2>&1 && \ cd $(srcdir) && \ - x=`bk -R prs -hr+ -nd:I: ChangeSet` && \ + x=`bk -R prs -hr+ -nd:I: ChangeSet` && \ y=`cat version 2>/dev/null` || true && \ case "$$x" in ''|$$y) ;; *) echo $$x > version ;; esac @@ -136,7 +137,6 @@ libtool: $(LIBTOOL_DEPS) ./config.status --recheck dist-hook: - @find $(distdir) -type d -name CVS -print | xargs rm -rf @find $(distdir) -type d -name SCCS -print | xargs rm -rf @chmod u+w $(distdir)/ports/winnt diff --git a/adjtimed/Makefile.am b/adjtimed/Makefile.am index b2bf581e5..613359057 100644 --- a/adjtimed/Makefile.am +++ b/adjtimed/Makefile.am @@ -2,9 +2,11 @@ AUTOMAKE_OPTIONS= bindir= ${exec_prefix}/${BINSUBDIR} bin_PROGRAMS= @MAKE_ADJTIMED@ +BUILT_SOURCES= EXTRA_PROGRAMS= adjtimed AM_CPPFLAGS= -I$(top_srcdir)/include LDADD= ../libntp/libntp.a ETAGS_ARGS= Makefile.am -include ../bincheck.mf +include $(top_srcdir)/bincheck.mf +include $(top_srcdir)/depsver.mf diff --git a/arlib/configure.in b/arlib/configure.in index 6fd54e114..5335bb84f 100644 --- a/arlib/configure.in +++ b/arlib/configure.in @@ -9,9 +9,12 @@ AC_PROG_CC AC_PROG_RANLIB # Checks for libraries. -AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent, , , -lsocket)) -AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) -AC_CHECK_FUNC(res_init, , AC_CHECK_LIB(resolv, res_init)) +AC_CHECK_FUNC([gethostent], , + [AC_SEARCH_LIBS([gethostent], [nsl], , , [-lsocket])]) +AC_SEARCH_LIBS([setsockopt], [socket xnet]) +AC_SEARCH_LIBS([res_init], [resolv], , , [-lsocket -lnsl]) +AC_CHECK_FUNCS(res_init __res_init) + # Checks for header files. dnl AC_CHECK_HEADERS([errno.h fcntl.h netdb.h netinet/in.h strings.h sys/socket.h sys/time.h]) diff --git a/bootstrap b/bootstrap index f5a14533d..f641f1bf5 100755 --- a/bootstrap +++ b/bootstrap @@ -114,24 +114,8 @@ touch ntpd/ntp_parser.[ch] touch ntpd/ntp_keyword.h -## HMS: Danger, Will Robinson. -# If we remove files that used to be there, the old .Po files will bite us. -# If we remove the .deps file, we *must* run config.status to generate new -# dummy .Po files. The problem with this is that we then lose the -# dependency chain and for an exisint build tree that means we may not -# rebuild things that need to be rebuilt. -# -# regenerate dummy .Po files, which are included -# in Makefiles - -#for i in `find . -name '*.Po' | grep /.deps/` -#do -# echo '# dummy' > $i -#done - -## - cp bincheck.mf sntp/ +cp depsver.mf sntp/ ${AUTORECONF} -i -v diff --git a/clockstuff/Makefile.am b/clockstuff/Makefile.am index f2a065f5b..f2e31798e 100644 --- a/clockstuff/Makefile.am +++ b/clockstuff/Makefile.am @@ -10,9 +10,12 @@ chutest_LDADD = ../libntp/libntp.a clktest_LDADD = ../libntp/libntp.a ETAGS_ARGS = Makefile.am #EXTRA_DIST = TAGS +BUILT_SOURCES = # clktest-opts.def wants ../include/copyright.def ../include/homerc.def chutest$(EXEEXT): ../libntp/libntp.a clktest$(EXEEXT): ../libntp/libntp.a + +include $(top_srcdir)/depsver.mf diff --git a/configure.ac b/configure.ac index eafde1240..fa956cfb2 100644 --- a/configure.ac +++ b/configure.ac @@ -453,9 +453,6 @@ case "$host" in ;; esac -AC_CHECK_FUNC(setsockopt, , - [AC_SEARCH_LIBS([setsockopt], [socket xnet])]) - AC_SEARCH_LIBS([setsockopt], [socket xnet]) AC_SEARCH_LIBS([res_init], [resolv], , , [-lsocket -lnsl]) AC_CHECK_FUNCS(res_init __res_init) diff --git a/deps-ver b/deps-ver new file mode 100644 index 000000000..dd28e403a --- /dev/null +++ b/deps-ver @@ -0,0 +1 @@ +Fri Nov 13 17:21:31 UTC 2009 diff --git a/depsver.mf b/depsver.mf new file mode 100644 index 000000000..4b51a92e0 --- /dev/null +++ b/depsver.mf @@ -0,0 +1,43 @@ +$(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver + @[ -f $@ ] || \ + cp $(top_srcdir)/deps-ver $@ + @[ -w $@ ] || \ + chmod ug+w $@ + @cmp $(top_srcdir)/deps-ver $@ > /dev/null || ( \ + $(MAKE) clean && \ + echo -n "Prior $(abs_builddir)/$(DEPDIR) version " && \ + cat $@ && \ + rm -rf $(DEPDIR) && \ + mkdir $(DEPDIR) && ( \ + cd $(top_builddir) && \ + ./config.status \ + ) && \ + echo -n "Cleaned $(abs_builddir)/$(DEPDIR) version " && \ + cat $(top_srcdir)/deps-ver \ + ) + cp $(top_srcdir)/deps-ver $@ + +BUILT_SOURCES += $(DEPDIR)/deps-ver + +# +# depsver.mf included in Makefile.am for directories with .deps +# +# When building in the same directory with sources that change over +# time, such as when tracking using bk, the .deps files can become +# stale with respect to moved, deleted, or superceded headers. Most +# commonly, this would exhibit as make reporting a failure to make a +# header file which is no longer in the location given. To address +# this issue, we use a deps-ver file which is updated with each change +# that breaks old .deps files. A copy of deps-ver is made into +# $(DEPDIR) if not already present. If $(DEPDIR)/deps-ver is present +# with different contents than deps-ver, we make clean to ensure all +# .o files built before the incompatible change are rebuilt along with +# their updated .deps files, then remove $(DEPDIR) and recreate it as +# empty stubs. +# +# 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 +# it stays with it in the generated Makefile.in and Makefile. +# diff --git a/libntp/Makefile.am b/libntp/Makefile.am index acffa6637..c40b7d904 100644 --- a/libntp/Makefile.am +++ b/libntp/Makefile.am @@ -1,6 +1,7 @@ NULL= #AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies AUTOMAKE_OPTIONS = +BUILT_SOURCES = noinst_LIBRARIES = libntp.a @MAKE_LIBNTPSIM@ EXTRA_LIBRARIES = libntpsim.a libntp_a_SRCS = \ @@ -105,8 +106,6 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/lib/isc/include \ -I$(top_srcdir)/lib/isc/unix/include ETAGS_ARGS = Makefile.am -../include/des.h: - touch ../include/des.h - EXTRA_DIST = README +include $(top_srcdir)/depsver.mf diff --git a/libparse/Makefile.am b/libparse/Makefile.am index 20ea25356..b288a35f9 100644 --- a/libparse/Makefile.am +++ b/libparse/Makefile.am @@ -1,6 +1,7 @@ NULL= #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies AUTOMAKE_OPTIONS = +BUILT_SOURCES = noinst_LIBRARIES = @MAKE_LIBPARSE@ @MAKE_LIBPARSE_KERNEL@ EXTRA_LIBRARIES = libparse.a libparse_kernel.a EXTRA_PROGRAMS = parsestreams parsesolaris @@ -172,3 +173,5 @@ parsesolaris.o: sys/systm.h sys/systm.h: mkdir sys && \ sed -e '/ffs(.*)/d' < /usr/include/sys/systm.h > sys/systm.h + +include $(top_srcdir)/depsver.mf diff --git a/ntpd/Makefile.am b/ntpd/Makefile.am index cc80d61f1..22d9b3515 100644 --- a/ntpd/Makefile.am +++ b/ntpd/Makefile.am @@ -234,4 +234,5 @@ version.o: $(ntpd_OBJECTS) ../libntp/libntp.a @LIBPARSE@ Makefile $(top_srcdir)/ env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpd $(COMPILE) -c version.c -include ../bincheck.mf +include $(top_srcdir)/bincheck.mf +include $(top_srcdir)/depsver.mf diff --git a/ntpd/ntp_peer.c b/ntpd/ntp_peer.c index 78d58ca65..e951a62d0 100644 --- a/ntpd/ntp_peer.c +++ b/ntpd/ntp_peer.c @@ -571,7 +571,6 @@ peer_refresh_interface( "fd=%d, bfd=%d, name=%.16s, flags=0x%x, scope=%d, ", niface->fd, niface->bfd, niface->name, niface->flags, niface->scopeid); - /* Leave these as three printf calls. */ printf(", sin=%s", stoa((&niface->sin))); if (niface->flags & INT_BROADCAST) printf(", bcast=%s,", diff --git a/ntpdate/Makefile.am b/ntpdate/Makefile.am index 53eecb087..665ebfc53 100644 --- a/ntpdate/Makefile.am +++ b/ntpdate/Makefile.am @@ -1,6 +1,7 @@ NULL= -AUTOMAKE_OPTIONS= +AUTOMAKE_OPTIONS= +BUILT_SOURCES= bindir= ${exec_prefix}/${BINSUBDIR} #bin_PROGRAMS= ntpdate ntptimeset bin_PROGRAMS= ntpdate @@ -31,4 +32,5 @@ version.o: $(ntpdate_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpdate $(COMPILE) -c version.c -include ../bincheck.mf +include $(top_srcdir)/bincheck.mf +include $(top_srcdir)/depsver.mf diff --git a/ntpdc/Makefile.am b/ntpdc/Makefile.am index a1e5b858c..3ddfadf1c 100644 --- a/ntpdc/Makefile.am +++ b/ntpdc/Makefile.am @@ -67,4 +67,5 @@ version.o: $(ntpdc_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version 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 -include ../bincheck.mf +include $(top_srcdir)/bincheck.mf +include $(top_srcdir)/depsver.mf diff --git a/ntpq/Makefile.am b/ntpq/Makefile.am index 8bf4f0961..6d618a278 100644 --- a/ntpq/Makefile.am +++ b/ntpq/Makefile.am @@ -51,3 +51,6 @@ $(top_srcdir)/version : version.o: $(ntpq_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/version env CSET=`cat $(top_srcdir)/version` $(top_builddir)/scripts/mkver ntpq $(COMPILE) -c version.c + +include $(top_srcdir)/bincheck.mf +include $(top_srcdir)/depsver.mf diff --git a/ntpsnmpd/Makefile.am b/ntpsnmpd/Makefile.am index 5cd5360d8..4cdd342e7 100644 --- a/ntpsnmpd/Makefile.am +++ b/ntpsnmpd/Makefile.am @@ -37,3 +37,5 @@ $(srcdir)/ntpsnmpd.1: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) $(srcdir)/ntpsnmpd-opts.texi $(srcdir)/ntpsnmpd-opts.menu: $(srcdir)/ntpsnmpd-opts.def $(std_def_list) $(run_ag) -Taginfo.tpl -DLEVEL=section ntpsnmpd-opts.def +include $(top_srcdir)/bincheck.mf +include $(top_srcdir)/depsver.mf diff --git a/parseutil/Makefile.am b/parseutil/Makefile.am index 8f959aa98..1f4bf9072 100644 --- a/parseutil/Makefile.am +++ b/parseutil/Makefile.am @@ -1,6 +1,7 @@ NULL= #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies AUTOMAKE_OPTIONS = +BUILT_SOURCES = noinst_PROGRAMS = @TESTDCF@ @DCFD@ EXTRA_PROGRAMS = testdcf dcfd @@ -16,3 +17,5 @@ check-local: @DCFD@ case "$(noinst_PROGRAMS)" in \ *dcfd*) ./dcfd -Y ;; \ esac + +include $(top_srcdir)/depsver.mf diff --git a/sntp/Makefile.am b/sntp/Makefile.am index 36ff1642c..eac175ea1 100644 --- a/sntp/Makefile.am +++ b/sntp/Makefile.am @@ -45,6 +45,8 @@ sntp_SOURCES = \ #dist_man_MANS= sntp.1 EXTRA_DIST= bincheck.mf \ + depsver.mf \ + deps-ver \ COPYRIGHT \ sntp-opts.def sntp.1 sntp-opts.texi sntp-opts.menu \ $(NULL) @@ -115,4 +117,5 @@ $(srcdir)/sntp-opts.texi $(srcdir)/sntp-opts.menu: $(srcdir)/sntp-opts.def $(src libtool: $(LIBTOOL_DEPS) ./config.status --recheck -include bincheck.mf +include $(top_srcdir)/bincheck.mf +include $(top_srcdir)/depsver.mf diff --git a/sntp/configure.ac b/sntp/configure.ac index e8b21af9a..ad8c68116 100644 --- a/sntp/configure.ac +++ b/sntp/configure.ac @@ -139,8 +139,7 @@ AC_CHECK_FUNC([openlog], , [AC_SEARCH_LIBS([openlog], [gen], , [AC_SEARCH_LIBS([openlog], [syslog], , , [$libxnet -lsocket])])]) -AC_CHECK_FUNC([setsockopt], , - [AC_SEARCH_LIBS([setsockopt], [socket xnet])]) +AC_SEARCH_LIBS([setsockopt], [socket xnet]) # Checks for header files. AC_HEADER_STDC diff --git a/sntp/deps-ver b/sntp/deps-ver new file mode 100644 index 000000000..dd28e403a --- /dev/null +++ b/sntp/deps-ver @@ -0,0 +1 @@ +Fri Nov 13 17:21:31 UTC 2009 diff --git a/util/Makefile.am b/util/Makefile.am index 4117beabd..aa2d09591 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -48,3 +48,6 @@ jitter_LDADD= kern.o: kern.c $(COMPILE) -DHAVE_TIMEX_H -c kern.c + +include $(top_srcdir)/bincheck.mf +include $(top_srcdir)/depsver.mf