<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 1 Oct 2009, at 20:19, Allan Clark wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Thu, Oct 1, 2009 at 09:02, Ton Voon <span dir="ltr"><<a href="mailto:ton.voon@opsera.com">ton.voon@opsera.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; "> <div style="word-wrap:break-word"><div><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></div></blockquote></div></blockquote><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; "><div style="word-wrap:break-word"><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 class="im"><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><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 class="im"><div> AC_CHECK_FUNCS(initgroups setenv strdup strstr strtoul unsetenv)</div></div></div><br></div><div>Comments?</div></div></blockquote><div><br></div><div>Makes sense... still accomplishes the objective of my suggestion :)</div> <div><br></div><div>(my vote: go for it)</div></div></blockquote><div><br></div></div>The patch as above breaks on systems where getservbyname is in libc, which was contrary to my understanding of AC_SEARCH_LIBS.<div><br></div><div>Fortunately, I cribbed the idea off gnulib's macro for getaddrinfo.m4 to find the missing logic. I think the latest commits now work as expected.</div><div><br></div><div>Ton</div><div><br></div></body></html>