+* Clean up configure.ac NTP_CACHEVERSION interface, display cache
+ version when clearing. Fixes a regression.
(4.2.5p172) 2009/05/06 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 1175] Instability in PLL daemon mode.
* [Bug 1176] refclock_parse.c does not compile without PPSAPI.
# Increment ntp_configure_cache_version by one for each change to
# configure.ac or .m4 files which invalidates cached values from
# previous versions.
-
-# It is not necessary to bump the version in more than one
-# configure.ac at the same time, as the cache is shared.
-# Previously used values should never be used again.
+#
+# If the change affects cache variables used only by the main NTP
+# configure.ac, then only its version number should be bumped, while
+# the subdir configure.ac version numbers should be unchanged. The
+# same is true for a test/variable that is used only by one subdir
+# being changed incompatibly; only that subdir's cache version needs
+# bumping.
+#
+# If a change affects variables shared by all NTP configure scripts,
+# please bump the version numbers of all three. If you are not sure,
+# the safe choice is to bump all three on any cache-invalidating change.
+#
+# In order to avoid the risk of version stamp collision between -stable
+# and -dev branches, do not simply increment the version, instead use
+# the date YYYYMMDD optionally with -HHMM if there is more than one
+# bump in a day.
ntp_configure_cache_version=20090503
# When the cache version of config.cache and configure do not
# match, NTP_CACHEVERSION will flush the cache.
-# $NTP_CONFIGURE_PARENT is used to detect the top-level configure in
-# NTP_CACHEVERSION. It is set to an empty string to indicate "known to
-# have no parent" while unset indicates no knowledge. Just before
-# AC_CONFIG_SUBDIRS in NTP's main configure.ac, NTP_CONFIGURE_PARENT
-# is set to top. In all NTP configure.ac files, we set it to NULL
-# if it is unset, so NTP_CACHE_VERSION does not rely on a heuristic.
-# It may seem tempting to set it to '' unilaterally in this main
-# NTP configure.ac, but that would preclude someone packaging NTP
-# as part of a parent package with configure, as NTP_CACHEVERSION
-# requires parents of its users to use it as well. When invoked by a
-# parent configure script, it would be wrong to assume we are the top
-# level configure invocation. We must respect NTP_CONFIGURE_PARENT.
-
-case "${NTP_CONFIGURE_PARENT=}" in
-esac
-
NTP_CACHEVERSION([main], [$ntp_configure_cache_version])
AM_INIT_AUTOMAKE
AC_CONFIG_FILES(scripts/summary, [chmod +x scripts/summary])
AC_CONFIG_FILES(util/Makefile)
-# $NTP_CONFIGURE_PARENT is used to detect the top-level configure in
-# NTP_CACHEVERSION (m4/ntp_cacheversion.m4)
-
-NTP_CONFIGURE_PARENT='top' ; export NTP_CONFIGURE_PARENT
-
AC_CONFIG_SUBDIRS(sntp)
AC_CONFIG_SUBDIRS(gsoc_sntp)
# Increment sntp_configure_cache_version by one for each change to
# configure.ac or .m4 files which invalidates cached values from
# previous versions.
-
-# It is not necessary to bump the version in more than one
-# configure.ac at the same time, as the cache is shared.
-# Previously used values should never be used again.
+#
+# If the change affects cache variables used only by the main NTP
+# configure.ac, then only its version number should be bumped, while
+# the subdir configure.ac version numbers should be unchanged. The
+# same is true for a test/variable that is used only by one subdir
+# being changed incompatibly; only that subdir's cache version needs
+# bumping.
+#
+# If a change affects variables shared by all NTP configure scripts,
+# please bump the version numbers of all three. If you are not sure,
+# the safe choice is to bump all three on any cache-invalidating change.
+#
+# In order to avoid the risk of version stamp collision between -stable
+# and -dev branches, do not simply increment the version, instead use
+# the date YYYYMMDD optionally with -HHMM if there is more than one
+# bump in a day.
sntp_configure_cache_version=20090503
# When the version of config.cache and configure do not
# match, NTP_CACHEVERSION will flush the cache.
-# $NTP_CONFIGURE_PARENT is used to detect the top-level configure in
-# NTP_CACHEVERSION. It is set to an empty string to indicate "known to
-# have no parent" while unset indicates no knowledge. Just before
-# AC_CONFIG_SUBDIRS in NTP's main configure.ac, NTP_CONFIGURE_PARENT
-# is set to top. In all NTP configure.ac files, we set it to NULL
-# if it is unset, so NTP_CACHE_VERSION does not rely on a heuristic.
-
-case "${NTP_CONFIGURE_PARENT=}" in
-esac
-
NTP_CACHEVERSION([sntp], [$sntp_configure_cache_version])
AM_INIT_AUTOMAKE
# 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 finding its version stamp
-# previously saved.
+# previously saved. In this case top-level means a configure script
+# not invoked by another configure script in its parent directory.
AC_DEFUN_ONCE([NTP_CACHEVERSION], [
AC_BEFORE([$0], [AM_INIT_AUTOMAKE])dnl
AC_BEFORE([$0], [AM_CONFIG_HEADER])dnl
AC_BEFORE([$0], [AC_PROG_CC])dnl
+ AC_BEFORE([$0], [AC_CONFIG_SUBDIRS])dnl
- # Is this the top-level configure, or a child invoked
- # by a parent via AC_CONFIG_SUBDIRS? There is no
- # reliable general way to say, so we use a variable
- # NTP_CONFIGURE_PARENT set to an empty string early
- # in our top-level configure.ac and then set to the
- # simple flag value 'top' before AC_CONFIG_SUBDIRS.
- # Assuming only two levels of configure.ac files,
- # only the parent has to manage AC_CONFIG_PARENT.
- case "${NTP_CONFIGURE_PARENT-varnotset}" in
- '')
- ntp_top_configure=1
- ;;
- varnotset)
- # without a clear indication from NTP_CONFIGURE_PARENT
- # heuristically assume we are a child configure if our
- # cache file path begins with ../
- case "$cache_file" in
- ../*)
- ntp_top_configure=0
- AC_MSG_WARN([[ Using heuristic, guessing this configure is ]])
- AC_MSG_WARN([[ a child of another configure script based ]])
- AC_MSG_WARN([[ on cache file name starting with ../ ]])
- ;;
- *)
- ntp_top_configure=1
- AC_MSG_WARN([[ Using heuristic, guessing this configure is ]])
- AC_MSG_WARN([[ _not_ a child of another configure script ]])
- AC_MSG_WARN([[ based on cache file name not starting ]])
- AC_MSG_WARN([[ with ../ ]])
- esac
- ;;
- *)
- ntp_top_configure=0;
- esac
-
ntp_cache_flush=1
case "$ntp_cv_[$1]_cache_version" in
ntp_cache_flush=0
;;
*)
- case "$ntp_top_configure" in
- 1)
+ case "$NTP_CACHEVERSION_PARENT" in
+ '')
# Do not clear the cache immediately after it is created
# empty as it is noisy. Differentiate a newly-created
# config.cache from one predating the cache version
ntp_cache_flush=0
esac
;;
- 0)
+ *)
# Parent configure just created cache from empty,
# flushing would be counterproductive.
ntp_cache_flush=0;
- ;;
- *)
- AC_MSG_ERROR([[NTP_CACHEVERSION var ntp_top_configure misset]])
esac
esac
;;
*)
# configure cache version mismatches config.cache version
esac
+
case "$ntp_cache_flush" in
1)
- # Do we flush all variables or exclude others' version stamps?
-
- case "$ntp_top_configure" in
- 1)
+ c_version="${ntp_cv_[$1]_cache_version:-(no version found)}"
+
+ # Do we flush all variables or exclude others' version stamps?
+
+ case "$NTP_CACHEVERSION_PARENT" in
+ '')
# Clear all *_cv_* variables including our child subdirs'
# ntp_cv_*_cache_version variables. This prevents subdir
# configure scripts from noticing a version mismatch just
-e '/_cv_/p'
`
esac
+
for c_varname in $c_varname_list
do
dnl use AS_UNSET([$c_varname]) eventually
AC_MSG_NOTICE([[$cache_file saved by another version, ignored.]])
AC_MSG_NOTICE([[configure script cache version: ]][$2])
- c_version="${ntp_cv_[$1]_cache_version:-(no version found)}"
AC_MSG_NOTICE([[$cache_file version: $c_version]])
$as_unset c_version
esac
# save configure version in config.cache for next time
ntp_cv_[$1]_cache_version="[$2]"
- $as_unset ntp_cache_flush ntp_top_configure
+ $as_unset ntp_cache_flush
+ # let any subdir configure.ac NTP_CACHEVERSION invocations
+ # know they are not the top level.
+ NTP_CACHEVERSION_PARENT='[$1]' ; export NTP_CACHEVERSION_PARENT
])dnl
# Process this file with autoconf to produce a configure script.
AC_INIT([msntp])
-# Increment msntp_configure_version by one for each
-# change to configure.ac or .m4 files which invalidates
-# cached values from previous versions.
-
-# It is not necessary to bump the version in more than one
-# configure.ac at the same time, as the cache is shared.
-# Previously used values should never be used again.
+# Increment msntp_configure_cache_version by one for each change to
+# configure.ac or .m4 files which invalidates cached values from
+# previous versions.
+#
+# If the change affects cache variables used only by the main NTP
+# configure.ac, then only its version number should be bumped, while
+# the subdir configure.ac version numbers should be unchanged. The
+# same is true for a test/variable that is used only by one subdir
+# being changed incompatibly; only that subdir's cache version needs
+# bumping.
+#
+# If a change affects variables shared by all NTP configure scripts,
+# please bump the version numbers of all three. If you are not sure,
+# the safe choice is to bump all three on any cache-invalidating change.
+#
+# In order to avoid the risk of version stamp collision between -stable
+# and -dev branches, do not simply increment the version, instead use
+# the date YYYYMMDD optionally with -HHMM if there is more than one
+# bump in a day.
msntp_configure_cache_version=20090503
# When the version of config.cache and configure do not
# match, NTP_CACHEVERSION will flush the cache.
-# $NTP_CONFIGURE_PARENT is used to detect the top-level configure in
-# NTP_CACHEVERSION. It is set to an empty string to indicate "known to
-# have no parent" while unset indicates no knowledge. Just before
-# AC_CONFIG_SUBDIRS in NTP's main configure.ac, NTP_CONFIGURE_PARENT
-# is set to top. In all NTP configure.ac files, we set it to NULL
-# if it is unset, so NTP_CACHE_VERSION does not rely on a heuristic.
-
-case "${NTP_CONFIGURE_PARENT=}" in
-esac
-
NTP_CACHEVERSION([msntp], [$msntp_configure_cache_version])
AM_INIT_AUTOMAKE([msntp],[1.6])