summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorJeremy T. Bouse <undrgrid@users.sourceforge.net>2003-03-06 06:40:46 (GMT)
committerJeremy T. Bouse <undrgrid@users.sourceforge.net>2003-03-06 06:40:46 (GMT)
commit2e641a086800444de7f80ed6cb973290d6b84ec0 (patch)
treebe9dcb76e9238142c914e92592389678b35d0151 /configure.in
parent1fdb0658c8c5637c0b6eb2c6847eb2fcb2e5650a (diff)
downloadmonitoring-plugins-2e641a086800444de7f80ed6cb973290d6b84ec0.tar.gz
Adds --with-lwres and --enable-emulate-getaddrinfo but are not used in any of
the code at this time. Has a check for IPv6 support but only runs if using the emulate-getaddrinfo routines, this needs to be modified. !!! I need input from results of this run on various platforms to see what results are seen in plugins/config.h so please help test !!! git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@371 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in115
1 files changed, 115 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 08996c9..ef0d06b 100644
--- a/configure.in
+++ b/configure.in
@@ -231,6 +231,121 @@ elif test "$OPENSSL" = "/usr/local/ssl/bin/openssl"; then
231fi 231fi
232AC_ARG_WITH(openssl,--with-openssl=<dir> sets path to openssl installation,[OPENSSL=$withval]) 232AC_ARG_WITH(openssl,--with-openssl=<dir> sets path to openssl installation,[OPENSSL=$withval])
233 233
234dnl #########################################################################
235dnl Check if Posix getaddrinfo() is available. It is also possible to use
236dnl the version from the lwres library distributed with BIND.
237dnl #########################################################################
238AC_ARG_ENABLE([emulate-getaddrinfo],
239 ACX_HELP_STRING([--enable-emulate-getaddrinfo],
240 [enable getaddrinfo emulation (default=no)]),
241 ,
242 enable_emulate_getaddrinfo=no)
243AC_ARG_WITH(lwres,
244 ACX_HELP_STRING([--with-lwres=DIR],
245 [use lwres library for getaddrinfo (default=no)]),
246 ,
247 with_lwres=no)
248
249dnl ## enable force to test getaddrinfo.c
250if test x$enable_emulate_getaddrinfo = xforce ; then
251 enable_emulate_getaddrinfo=yes
252 have_getaddrinfo=no
253else
254
255have_getaddrinfo=no
256if test x$with_lwres != xno ; then
257 if test "$with_lwres" != yes ; then
258 CPPFLAGS="-I${with_lwres}/include $CPPFLAGS"
259 LDFLAGS="-L${with_lwres}/lib $LDFLAGS"
260 fi
261 AC_CHECK_HEADERS(lwres/netdb.h, ,
262 [AC_MSG_ERROR([cannot find <lwres/netdb.h>])])
263 AC_CHECK_LIB(lwres, lwres_getaddrinfo, ,
264 [AC_MSG_ERROR([cannot find the lwres library])],
265 -lnsl -lpthread)
266 have_getaddrinfo=yes
267fi
268
269if test x$have_getaddrinfo != xyes ; then
270 AC_SEARCH_LIBS(getaddrinfo, socket resolv bind nsl c_r cr, have_getaddrinfo=yes)
271fi
272
273dnl # Special nonsense for systems that actually have getaddrinfo but
274dnl # redefine the name to something else, e.g. OSF
275if test x$have_getaddrinfo != xyes ; then
276 AC_MSG_CHECKING(if getaddrinfo is redefined in netdb.h)
277 AC_TRY_LINK([
278# include <netdb.h>
279 ], [
280 struct addrinfo hints, *res;
281 int err;
282
283 err = getaddrinfo ("host", "service", &hints, &res);
284 ], [
285 have_getaddrinfo=yes
286 AC_MSG_RESULT(yes)
287 ], [AC_MSG_RESULT(no)])
288fi
289
290fi
291
292if test x$have_getaddrinfo != xno ; then
293 if test x$enable_emulate_getaddrinfo != xno ; then
294 AC_MSG_ERROR([getaddrinfo found but emulate-getaddrinfo was enabled])
295 fi
296 AC_DEFINE(HAVE_GETADDRINFO, 1,
297 [Does system provide RFC 2553/Posix getaddrinfo?])
298else
299 if test x$enable_emulate_getaddrinfo != xyes ; then
300 AC_MSG_ERROR([getaddrinfo not found: try --with-lwres or --enable-emulate-getaddrinfo])
301 fi
302 LIBOBJS="$LIBOBJS getaddrinfo.o"
303fi
304
305if test x"$enable_emulate_getaddrinfo" != xno ; then
306 have_resolver=no
307
308 dnl Try for getipnodebyname
309 AC_SEARCH_LIBS(getipnodebyname, resolv bind nsl c_r cr, have_resolver=yes)
310 if test x"$have_resolver" != xno ; then
311 AC_DEFINE(HAVE_GETIPNODEBYNAME, 1,
312 [Set when getipnodebyname is available])
313 fi
314
315 dnl Try for gethostbyname_r
316 if test x"$have_resolver" = xno ; then
317 AC_SEARCH_LIBS(gethostbyname_r, resolv bind nsl c_r cr,
318 [have_resolver=yes
319 ACX_WHICH_GETHOSTBYNAME_R])
320 fi
321
322 dnl Try for gethostbyname
323 if test x"$have_resolver" = xno ; then
324 if test x"$enable_pthreads" != xno ; then
325 AC_MSG_WARN([using threads but cannot find gethostbyname_r or getipnodebyname])
326 fi
327 AC_SEARCH_LIBS(gethostbyname, resolv bind nsl, ,
328 [AC_MSG_ERROR([cannot find gethostbyname])])
329 fi
330 LIBOBJS="$LIBOBJS gethostbyname.o"
331
332 AC_CACHE_CHECK([for IPv6 support], acx_cv_sys_use_ipv6, [
333 AC_TRY_COMPILE([
334# include <netinet/in.h>
335 ], [
336 struct sockaddr_in6 sin6;
337 void *p;
338
339 sin6.sin6_family = AF_INET6;
340 sin6.sin6_port = 587;
341 p = &sin6.sin6_addr;
342 ], [acx_cv_sys_use_ipv6=yes], [acx_cv_sys_use_ipv6=no])
343 ])
344 if test x"$acx_cv_sys_use_ipv6" != xno ; then
345 AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
346 fi
347fi
348
234AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no) 349AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no)
235if test "$FOUNDINCLUDE" = "no"; then 350if test "$FOUNDINCLUDE" = "no"; then
236 _SAVEDCPPFLAGS="$CPPFLAGS" 351 _SAVEDCPPFLAGS="$CPPFLAGS"