From: Dave Hart Date: Thu, 16 Sep 2010 19:32:11 +0000 (+0000) Subject: [Bug 1629] 4.2.7p50 configure.ac changes invalidate config.cache. X-Git-Tag: NTP_4_2_7P51~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15c69bf1df9a56897aefa7618020a6bef82eb4a0;p=thirdparty%2Fntp.git [Bug 1629] 4.2.7p50 configure.ac changes invalidate config.cache. [Bug 1630] 4.2.7p50 cannot bootstrap on Autoconf 2.61. bk: 4c9270bbxL7RrPK1vT3k2CIn0elTpA --- diff --git a/ChangeLog b/ChangeLog index 2eafc1c22..c0e6eca95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +* [Bug 1629] 4.2.7p50 configure.ac changes invalidate config.cache. +* [Bug 1630] 4.2.7p50 cannot bootstrap on Autoconf 2.61. (4.2.7p50) 2010/09/16 Released by Harlan Stenn * Cleanup NTP_LIB_M. * [Bug 1628] Clean up -lxnet/-lsocket usage for (open)solaris. diff --git a/configure.ac b/configure.ac index 4e5c8526a..83fe9f82c 100644 --- a/configure.ac +++ b/configure.ac @@ -6,9 +6,9 @@ AC_INIT([ntp], [VERSION_NUMBER]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([.]) -# Increment ntp_configure_cache_version by one for each change to -# configure.ac or .m4 files which invalidates cached values from -# previous versions. +# Bump ntp_configure_cache_version for each change to configure.ac or +# .m4 files which invalidates cached values from previous configure +# runs. # # If the change affects cache variables used only by the main NTP # configure.ac, then only its version number should be bumped, while @@ -18,15 +18,15 @@ AC_CONFIG_AUX_DIR([.]) # 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. +# please bump the version numbers of each. If you are not sure, the +# safe choice is to bump all 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=20091117 +ntp_configure_cache_version=20100916 # When the cache version of config.cache and configure do not # match, NTP_CACHEVERSION will flush the cache. @@ -104,7 +104,6 @@ case "$host" in # -D_XOPEN_SOURCE=600 seems OK for c99 #CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__" CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" - libxnet=-lxnet ;; esac @@ -367,22 +366,34 @@ esac AC_PROG_INSTALL -case "$host" in - *-pc-cygwin*) - AC_CHECK_LIB(advapi32, main) - ;; +# Checks for libraries. +NTP_LINEEDITLIBS +NTP_LIB_M + +# [Bug 1628] On Solaris, we need -lxnet -lsocket. Generalize this to +# avoid keying on the OS name: If we find socket functions in +# libsocket, next try for them in libxnet without libsocket, if found, +# list both. If we simply tested libxnet first, we would find the +# functions there and never add libsocket. See also [Bug 660] +# http://bugs.ntp.org/show_bug.cgi?id=660#c9 +saved_LIBS=$LIBS +AC_SEARCH_LIBS([setsockopt], [socket]) +case "$ac_cv_search_setsockopt" in + -lsocket) + LIBS="$saved_LIBS" + AC_SEARCH_LIBS([getsockopt], [xnet]) + case "$ac_cv_search_getsockopt" in + -lxnet) + LIBS="-lxnet -lsocket $saved_LIBS" + esac esac +$as_unset saved_LIBS -AC_CHECK_FUNC([gethostent], , - AC_SEARCH_LIBS([gethostent], [nsl], , , [$libxnet -lsocket])) -AC_CHECK_FUNC([openlog], , - AC_SEARCH_LIBS([openlog], [gen], , - AC_SEARCH_LIBS([openlog], [syslog], , , [$libxnet -lsocket]))) +AC_SEARCH_LIBS([inet_pton], [nsl]) +AC_SEARCH_LIBS([openlog], [gen syslog]) AC_SEARCH_LIBS([MD5Init], [md5 md]) AC_CHECK_FUNCS([MD5Init]) -NTP_LINEEDITLIBS -NTP_LIB_M dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt, @@ -403,26 +414,13 @@ case "$host" in ;; esac -# On Solaris, we need -lxnet before -lsocket: -AC_SEARCH_LIBS([setsockopt], [socket]) -case "$LIBS" in - -lsocket*) - _libs=$LIBS - LIBS= - AC_SEARCH_LIBS([getsockopt], [xnet]) - LIBS="$LIBS $_libs" - ;; -esac - -# res_init needs -lsocket, but we have that already. -AC_SEARCH_LIBS([res_init], [resolv], , , [-lnsl]) -case "$host" in - *-*-darwin*) - AC_CHECK_LIB([resolv],[res_9_init]) - ;; +AC_SEARCH_LIBS([res_init], [resolv]) +case "$ac_search_func_res_init:$host" in + no:*-*-darwin*) + AC_SEARCH_LIBS([res_9_init], [resolv]) esac AC_HEADER_RESOLV -AC_CHECK_FUNCS([res_init], , AC_CHECK_FUNCS([__res_init])) +AC_CHECK_FUNCS([res_init], , [AC_CHECK_FUNCS([__res_init])]) AC_HEADER_STDC AC_CHECK_HEADERS(bstring.h) diff --git a/sntp/configure.ac b/sntp/configure.ac index 05d50798d..b38416f1e 100644 --- a/sntp/configure.ac +++ b/sntp/configure.ac @@ -6,9 +6,9 @@ AC_INIT([sntp], [VERSION_NUMBER]) AC_CONFIG_MACRO_DIR([../m4]) AC_CONFIG_AUX_DIR([.]) -# Increment sntp_configure_cache_version by one for each change to -# configure.ac or .m4 files which invalidates cached values from -# previous versions. +# Bump sntp_configure_cache_version for each change to configure.ac or +# .m4 files which invalidates cached values from previous configure +# runs. # # If the change affects cache variables used only by the main NTP # configure.ac, then only its version number should be bumped, while @@ -18,15 +18,15 @@ AC_CONFIG_AUX_DIR([.]) # 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. +# please bump the version numbers of each. If you are not sure, the +# safe choice is to bump all 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=20091117 +sntp_configure_cache_version=20100916 # When the version of config.cache and configure do not # match, NTP_CACHEVERSION will flush the cache. @@ -106,7 +106,6 @@ case "$host" in # -D_XOPEN_SOURCE=600 seems OK for c99 #CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500 -D__EXTENSIONS__" CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" - libxnet=-lxnet ;; esac @@ -135,13 +134,28 @@ NTP_DIR_SEP # Checks for libraries. NTP_LIB_M -AC_CHECK_FUNC([gethostent], , - [AC_SEARCH_LIBS([gethostent], [nsl], , , [$libxnet -lsocket])]) -AC_CHECK_FUNC([openlog], , - [AC_SEARCH_LIBS([openlog], [gen], , - [AC_SEARCH_LIBS([openlog], [syslog], , , [$libxnet -lsocket])])]) -AC_SEARCH_LIBS([setsockopt], [socket xnet]) +# [Bug 1628] On Solaris, we need -lxnet -lsocket. Generalize this to +# avoid keying on the OS name: If we find socket functions in +# libsocket, next try for them in libxnet without libsocket, if found, +# list both. If we simply tested libxnet first, we would find the +# functions there and never add libsocket. See also [Bug 660] +# http://bugs.ntp.org/show_bug.cgi?id=660#c9 +saved_LIBS=$LIBS +AC_SEARCH_LIBS([setsockopt], [socket]) +case "$ac_cv_search_setsockopt" in + -lsocket) + LIBS="$saved_LIBS" + AC_SEARCH_LIBS([getsockopt], [xnet]) + case "$ac_cv_search_getsockopt" in + -lxnet) + LIBS="-lxnet -lsocket $saved_LIBS" + esac +esac +$as_unset saved_LIBS + +AC_SEARCH_LIBS([inet_pton], [nsl]) +AC_SEARCH_LIBS([openlog], [gen syslog]) # Checks for header files. AC_HEADER_STDC