summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2002-11-08 07:20:05 +0000
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2002-11-08 07:20:05 +0000
commit1c4dd10d70ba9ed6dead6cc56cd0f572627cf619 (patch)
tree62485f23a5478eb8a6ad6b2de1eac322bf195662 /configure.in
parent34ba941736b434a6c1453feec35d04ed7b0a59e5 (diff)
downloadmonitoring-plugins-1c4dd10d70ba9ed6dead6cc56cd0f572627cf619.tar.gz
patches required to build on solaris with asprintf and gettimeofday
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@174 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in54
1 files changed, 29 insertions, 25 deletions
diff --git a/configure.in b/configure.in
index d7594057..bdd4013e 100644
--- a/configure.in
+++ b/configure.in
@@ -12,17 +12,6 @@ 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
26dnl Figure out how to invoke "install" and what install options to use. 15dnl Figure out how to invoke "install" and what install options to use.
27 16
28AC_PROG_INSTALL 17AC_PROG_INSTALL
@@ -338,6 +327,28 @@ if test x"$ac_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
338 AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Define if system has C99 compatible vsnprintf]) 327 AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Define if system has C99 compatible vsnprintf])
339fi 328fi
340 329
330#AC_HAVE_DECL(asprintf, [#include <stdio.h>])
331#AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
332#AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
333#AC_HAVE_DECL(snprintf, [#include <stdio.h>])
334
335AC_CHECK_FUNC(snprintf,
336 AC_DEFINE(HAVE_SNPRINTF,1,[Define if snprintf is present]),
337 LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a")
338AC_CHECK_FUNC(vsnprintf,
339 AC_DEFINE(HAVE_VSNPRINTF,1,[Define if vsnprintf is present]),
340 LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a")
341AC_CHECK_FUNC(vasprintf,
342 AC_DEFINE(HAVE_VASPRINTF,1,[Define if vasprintf is present]),
343 LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a")
344AC_CHECK_FUNC(asprintf,
345 AC_DEFINE(HAVE_ASPRINTF,1,[Define if asprintf is present]),
346 LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a")
347
348if 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
349 LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a"
350fi
351
341dnl We used to not do long options unless a compatible lib was found 352dnl We used to not do long options unless a compatible lib was found
342dnl Now we provide code and make libgetopt if native is not suitable 353dnl Now we provide code and make libgetopt if native is not suitable
343AC_MSG_CHECKING(for getopt_long) 354AC_MSG_CHECKING(for getopt_long)
@@ -356,23 +367,16 @@ AC_TRY_COMPILE([#include <getopt.h>
356 367
357AC_CHECK_FUNCS(getopt_long_only,,LIBS="$LIBS -lgetopt" DEPLIBS="$DEPLIBS libgetopt.a") 368AC_CHECK_FUNCS(getopt_long_only,,LIBS="$LIBS -lgetopt" DEPLIBS="$DEPLIBS libgetopt.a")
358 369
359#AC_HAVE_DECL(asprintf, [#include <stdio.h>]) 370AC_TRY_COMPILE([#include <sys/time.h>],
360#AC_HAVE_DECL(vasprintf, [#include <stdio.h>]) 371 [struct timeval *foo;],
361#AC_HAVE_DECL(vsnprintf, [#include <stdio.h>]) 372 [AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])])
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 373
374AC_TRY_COMPILE([#include <sys/time.h>],
375 [gettimeofday(NULL, NULL);],
376 AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]))
373 377
374dnl Checks for library functions. 378dnl Checks for library functions.
375AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul gettimeofday) 379AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul)
376 380
377AC_MSG_CHECKING(for type of socket size) 381AC_MSG_CHECKING(for type of socket size)
378AC_TRY_COMPILE([#include <stdlib.h> 382AC_TRY_COMPILE([#include <stdlib.h>