summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in26
1 files changed, 25 insertions, 1 deletions
diff --git a/configure.in b/configure.in
index aa68894..d759405 100644
--- a/configure.in
+++ b/configure.in
@@ -12,6 +12,17 @@ AM_CONFIG_HEADER(plugins/config.h plugins/common.h plugins/version.h plugins/net
12 12
13AC_PREFIX_DEFAULT(/usr/local/nagios) 13AC_PREFIX_DEFAULT(/usr/local/nagios)
14 14
15#AC_DEFUN(AC_HAVE_DECL,
16#[
17# AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[
18# AC_TRY_COMPILE([$2],[int i = (int)$1],
19# ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)])
20# if test x"$ac_cv_have_$1_decl" = x"yes"; then
21# AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL],1,[Whether $1() is available])
22# fi
23#])
24
25
15dnl Figure out how to invoke "install" and what install options to use. 26dnl Figure out how to invoke "install" and what install options to use.
16 27
17AC_PROG_INSTALL 28AC_PROG_INSTALL
@@ -345,7 +356,20 @@ AC_TRY_COMPILE([#include <getopt.h>
345 356
346AC_CHECK_FUNCS(getopt_long_only,,LIBS="$LIBS -lgetopt" DEPLIBS="$DEPLIBS libgetopt.a") 357AC_CHECK_FUNCS(getopt_long_only,,LIBS="$LIBS -lgetopt" DEPLIBS="$DEPLIBS libgetopt.a")
347 358
348AC_CHECK_FUNC(asprintf,,LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a") 359#AC_HAVE_DECL(asprintf, [#include <stdio.h>])
360#AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
361#AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
362#AC_HAVE_DECL(snprintf, [#include <stdio.h>])
363
364AC_CHECK_FUNC(snprintf,AC_DEFINE(HAVE_SNPRINTF,1,[Define if snprintf is present]))
365AC_CHECK_FUNC(vsnprintf,AC_DEFINE(HAVE_VSNPRINTF,1,[Define if vsnprintf is present]))
366AC_CHECK_FUNC(vasprintf,AC_DEFINE(HAVE_VASPRINTF,1,[Define if vasprintf is present]))
367AC_CHECK_FUNC(asprintf,AC_DEFINE(HAVE_ASPRINTF,1,[Define if asprintf is present]))
368
369if test x"$ac_cv_HAVE_SNPRINTF" = x"no" -o x"$ac_cv_HAVE_VSNPRINTF" = x"no" -o x"$ac_cv_HAVE_VASPRINTF" = x"no" -o x"$ac_cv_HAVE_ASPRINTF" = x"no"; then
370 LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a"
371fi
372
349 373
350dnl Checks for library functions. 374dnl Checks for library functions.
351AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul gettimeofday) 375AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul gettimeofday)