--Apple-Mail-554--858366796
Content-Type: text/plain;
charset=US-ASCII;
format=flowed;
delsp=yes
Content-Transfer-Encoding: 7bit
On 1 Oct 2009, at 20:19, Allan Clark wrote:
> On Thu, Oct 1, 2009 at 09:02, Ton Voon wrote:
>
> 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:
>
> dnl Checks for library functions.
> -AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
> -AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
> +AC_SEARCH_LIBS([getservbyname],[nsl],[SOCKETLIBS="$SOCKETLIBS -
> lnsl"])
> +AC_SEARCH_LIBS([connect],[socket],[SOCKETLIBS="$SOCKETLIBS -
> lsocket"])
> AC_SUBST(SOCKETLIBS)
> AC_CHECK_FUNCS(initgroups setenv strdup strstr strtoul unsetenv)
>
> Comments?
>
> Makes sense... still accomplishes the objective of my suggestion
>
> (my vote: go for it)
The patch as above breaks on systems where getservbyname is in libc,
which was contrary to my understanding of AC_SEARCH_LIBS.
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.
Ton
--Apple-Mail-554--858366796
Content-Type: text/html;
charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
On 1 Oct 2009, at =
20:19, Allan Clark wrote:On Thu, Oct 1, 2009 at 09:02, Ton Voon <[email protected]> =
wrote: 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: dnl Checks for library =
functions.-AC_CHECK_LIB(nsl,main,SOCKETLIBS=3D"$SOCKETLIBS =
-lnsl")-AC_CHECK_LIB(socket,socket,SOCKETLIBS=3D"$SOCKETLIBS =
-lsocket") =
+AC_SEARCH_LIBS([getservbyname],[nsl],[SOCKETLIBS=3D"$SOCKETLIB=
S =
-lnsl"])+AC_SEARCH_LIBS([connect],[socket],[SOCKETLIBS=3D"$SOCK=
ETLIBS -lsocket"]) AC_SUBST(SOCKETLIBS) AC_CHECK_FUNCS(initgroups setenv strdup strstr =
strtoul =
unsetenv)Comments?Makes sense... still accomplishes the objective of =
my suggestion
it)The patch as above =
breaks on systems where getservbyname is in libc, which was contrary to =
my understanding of AC_SEARCH_LIBS.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.Ton=
--Apple-Mail-554--858366796--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]