<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Allan,<div><br><div><div>On 30 Sep 2009, at 00:58, Allan Clark wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>CVS delta 1.147 -> 1.148 includes un-dnl-ing some AC_CHECK_LIBS for USL/SVR4 -derivative Unix environments.</div><div><br></div><div>Note that the act of CHECK_LIBS (main) -- which is used to avoid having to give an entry point/label -- is also replaced by the actual name of an entry point.</div> <div><br></div><div>For details, see also:</div><div><br></div><div><a href="http://www.gnu.org/software/autoconf/manual/html_node/Libraries.html">http://www.gnu.org/software/autoconf/manual/html_node/Libraries.html</a></div> <div><br></div><div><br></div><div>The following change converts this Solaris edit to a SEARCH rather than a CHECK, which works on all platforms, and only adds additional librarires if the mentioned linker entry points are not already valid in the current list of libraries:</div> <div><br></div><div><br></div><div><div>--- configure.in.solaris<span class="Apple-tab-span" style="white-space:pre"> </span>2009-09-30 00:48:17.000000000 +0100</div><div>+++ <a href="http://configure.in">configure.in</a><span class="Apple-tab-span" style="white-space:pre"> </span>2009-09-30 00:51:37.000000000 +0100</div> <div>@@ -101,9 +101,8 @@</div><div> </div><div> </div><div> dnl Checks for library functions.</div><div>-AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")</div><div>-AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")</div> <div>-AC_SUBST(SOCKETLIBS)</div><div>+AC_SEARCH_LIBS([getservbyname],[nsl])</div><div>+AC_SEARCH_LIBS([connect],[socket])</div><div> AC_CHECK_FUNCS(initgroups setenv strdup strstr strtoul unsetenv)</div><div> </div><div> AC_MSG_CHECKING(for type of socket size)</div> <div><br></div><div><br></div><div><br></div><div>Note: this also drops the need for "SOCKETLIBS" tracking. Libs add the nsl (NameServices lib) and socket (yeah, socket) libraries only if the pre-existing libraries (libc, libC, et al) don't already provde the lib.</div> <div><br></div><div>This check is really intended for the merge-point where sockets moved from being environmental things to in-kernel things, and not all executables wanted to link with sockets included by default.</div></div></blockquote><div><br></div></div>Good point re: AC_SEARCH_LIBS rather than AC_CHECK_LIB, and good point re: checking for actual functions.</div><div><br></div><div>However, I would still want SOCKETLIBS to be set otherwise the libraries will get linked to other parts of Nagios that do not need it, like CGIs and nagiostats. So I propose: </div><div><br></div><div><div><div> dnl Checks for library functions.</div><div>-AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")</div><div>-AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")</div><div>+AC_SEARCH_LIBS([getservbyname],[nsl],[SOCKETLIBS="$SOCKETLIBS -lnsl"])</div><div>+AC_SEARCH_LIBS([connect],[socket],[SOCKETLIBS="$SOCKETLIBS -lsocket"])</div><div> AC_SUBST(SOCKETLIBS)</div><div> AC_CHECK_FUNCS(initgroups setenv strdup strstr strtoul unsetenv)</div></div><br></div><div>Comments?</div><div><br></div><div>Ton</div><div><br></div></body></html>