* Autokey documentation cleanup from Dave Mills.
-* do not clear config.cache when it is already empty
+* Fix problem linking msntp on Solaris when sntp subdir is configured
+ before parent caused by different gethostent library search order.
+* Do not clear config.cache when it is already empty.
(4.2.5p170) 2009/05/02 Released by Harlan Stenn <stenn@ntp.org>
* [Bug 1152] adjust PARSE to new refclock_pps logic
* Include (4.2.4p7-RC5)
# configure.ac at the same time, as the cache is shared.
# Previously used values should never be used again.
-ntp_configure_cache_version=0
+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)
# configure.ac at the same time, as the cache is shared.
# Previously used values should never be used again.
-sntp_configure_cache_version=0
+sntp_configure_cache_version=20090503
# When the version of config.cache and configure do not
# match, NTP_CACHEVERSION will flush the cache.
# -D_XOPEN_SOURCE=600 seems OK for c99
#CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
+ libxnet=-lxnet
;;
esac
# Checks for libraries.
-AC_CHECK_FUNC(gethostent, ,
+AC_CHECK_FUNC([gethostent], ,
[AC_SEARCH_LIBS([gethostent], [nsl], , , [$libxnet -lsocket])])
-AC_CHECK_FUNC(openlog, ,
+AC_CHECK_FUNC([openlog], ,
[AC_SEARCH_LIBS([openlog], [gen], ,
[AC_SEARCH_LIBS([openlog], [syslog], , , [$libxnet -lsocket])])])
-AC_CHECK_FUNC(setsockopt, ,
+AC_CHECK_FUNC([setsockopt], ,
[AC_SEARCH_LIBS([setsockopt], [socket xnet])])
# Checks for header files.
AC_BEFORE([$0], [AM_CONFIG_HEADER])dnl
AC_BEFORE([$0], [AC_PROG_CC])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
[$2])
# same version, good
ntp_cache_flush=0
;;
*)
- # 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
- ;;
- *)
- ntp_top_configure=1
- esac
- ;;
- *)
- ntp_top_configure=0;
- esac
case "$ntp_top_configure" in
1)
# Do not clear the cache immediately after it is created
# 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
- $as_unset ntp_top_configure
esac
;;
*)
esac
case "$ntp_cache_flush" in
1)
- # Clear all *_cv_* variables except our various components'
- # ntp_cv_*_cache_version vars.
+ # Do we flush all variables or exclude others' version stamps?
+
+ case "$ntp_top_configure" in
+ 1)
+ # Clear all *_cv_* variables including our child subdirs'
+ # ntp_cv_*_cache_version variables. This prevents subdir
+ # configure scripts from noticing a version mismatch just
+ # after the top configure in the invocation cleared and
+ # recreated the cache.
- c_varname_list=`set |
- sed -n -e 's/=.*$//' \
- -e '/ntp_cv_.*_cache_version/d' \
- -e '/_cv_/p'
- `
+ c_varname_list=`set |
+ sed -n -e 's/=.*$//' \
+ -e '/_cv_/p'
+ `
+ ;;
+ *)
+ # This is not the top configure this particular invocation.
+ # Clear all *_cv_* variables sparing the version stamps
+ # of other configure scripts, so we don't trigger
+ # useless repeated clearings.
+
+ c_varname_list=`set |
+ sed -n -e 's/=.*$//' \
+ -e '/ntp_cv_.*_cache_version/d' \
+ -e '/_cv_/p'
+ `
+ esac
for c_varname in $c_varname_list
do
dnl use AS_UNSET([$c_varname]) eventually
# save configure version in config.cache for next time
ntp_cv_[$1]_cache_version="[$2]"
- $as_unset ntp_cache_flush
+ $as_unset ntp_cache_flush ntp_top_configure
+
])dnl
# configure.ac at the same time, as the cache is shared.
# Previously used values should never be used again.
-msntp_configure_cache_version=0
+msntp_configure_cache_version=20090503
# When the version of config.cache and configure do not
# match, NTP_CACHEVERSION will flush the cache.
AC_SUBST(HAVE_INLINE)
esac
+# HMS: These need to be moved to AM_CPPFLAGS and/or AM_CFLAGS
+case "$host" in
+ *-*-solaris*)
+ # see "man standards".
+ # -D_XOPEN_SOURCE=500 is probably OK for c89 and before
+ # -D_XOPEN_SOURCE=600 seems OK for c99
+ #CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"
+ CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
+ libxnet=-lxnet
+ ;;
+esac
+
# Checks for libraries.
esac
# Checks for library functions.
+AC_CHECK_FUNC([gethostent], ,
+ [AC_SEARCH_LIBS([gethostent], [nsl], , , [$libxnet -lsocket])])
#AC_FUNC_MEMCMP dnl HMS: we don't have a memcmp.c to use here, so why bother?
AC_FUNC_SETVBUF_REVERSED
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([alarm])
-AC_CHECK_FUNC([gethostent], , AC_SEARCH_LIBS([gethostent], [nsl], , , [-lsocket]))
AC_CHECK_FUNCS([gettimeofday inet_ntoa memset])
AC_CHECK_FUNCS([socket], , AC_SEARCH_LIBS([socket], [socket]))
AC_CHECK_FUNCS([sqrt], , AC_SEARCH_LIBS([sqrt], [m]))