]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1629] 4.2.7p50 configure.ac changes invalidate config.cache.
authorDave Hart <hart@ntp.org>
Thu, 16 Sep 2010 19:32:11 +0000 (19:32 +0000)
committerDave Hart <hart@ntp.org>
Thu, 16 Sep 2010 19:32:11 +0000 (19:32 +0000)
[Bug 1630] 4.2.7p50 cannot bootstrap on Autoconf 2.61.

bk: 4c9270bbxL7RrPK1vT3k2CIn0elTpA

ChangeLog
configure.ac
sntp/configure.ac

index 2eafc1c22711a6f29f940eb5b9b16391bee65528..c0e6eca95a127c475add282b797215a64e63df3a 100644 (file)
--- 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 <stenn@ntp.org>
 * Cleanup NTP_LIB_M.
 * [Bug 1628] Clean up -lxnet/-lsocket usage for (open)solaris.
index 4e5c8526a6528520d96ecaf8ace21c6a1eb46b27..83fe9f82c5aff1d8c47374f0fa3bb7e3db930269 100644 (file)
@@ -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)
index 05d50798d6f36f430df5bce60bc2d13f9f963137..b38416f1e92fcbf6fd565abb2f98028d56a1504f 100644 (file)
@@ -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