]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Simplify configure.ac NTP_CACHEVERSION interface, update comments
authorDave Hart <hart@ntp.org>
Wed, 6 May 2009 17:29:45 +0000 (17:29 +0000)
committerDave Hart <hart@ntp.org>
Wed, 6 May 2009 17:29:45 +0000 (17:29 +0000)
bk: 4a01c909CF3Apb32QPduN7Fznt2h6w

ChangeLog
configure.ac
gsoc_sntp/configure.ac
m4/ntp_cacheversion.m4
sntp/configure.ac

index 4f32581319612ab29b13ed14d93c954ee45cb83c..d37c6cae2d65e1ef3e4be9becdf287d2b50f3790 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+* 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.
index 8457774bb1d54059ef2270d1f2e1bcbec3568561..d6a157d04fb40d8f1e3b5093e0f398f9b2338ada 100644 (file)
@@ -6,32 +6,28 @@ AC_INIT([ntp], [VERSION_NUMBER])
 # 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
@@ -4737,11 +4733,6 @@ AC_CONFIG_FILES(scripts/plot_summary,    [chmod +x scripts/plot_summary])
 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)
 
index 1136f86d9c10e307a80cc0a8982eb3d19222808e..aba6f52d0d8961a802ca85cc7fe45a591eba8c02 100644 (file)
@@ -6,26 +6,28 @@ AC_INIT([sntp], [VERSION_NUMBER])
 # 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
index 2e3647d8a56e79354b7c57248a4653c616d6d6c6..6de6765a224a219f3d49d26707a37833f8eb498c 100644 (file)
 # 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
@@ -73,8 +40,8 @@ AC_DEFUN_ONCE([NTP_CACHEVERSION], [
            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 
@@ -86,25 +53,25 @@ AC_DEFUN_ONCE([NTP_CACHEVERSION], [
                    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
@@ -128,6 +95,7 @@ AC_DEFUN_ONCE([NTP_CACHEVERSION], [
                                   -e '/_cv_/p'
                           `
        esac
+       
        for c_varname in $c_varname_list
        do
            dnl use AS_UNSET([$c_varname]) eventually
@@ -139,7 +107,6 @@ AC_DEFUN_ONCE([NTP_CACHEVERSION], [
        
        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
@@ -147,6 +114,9 @@ AC_DEFUN_ONCE([NTP_CACHEVERSION], [
     # 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
index 9123fa889c1f1d2d1aab56c85dbc7062808e0793..f244ce17c7f9eb104acbd2ab7a61ea300dd749df 100644 (file)
@@ -1,29 +1,31 @@
 # 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])