diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-10-16 10:16:07 (GMT) |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2002-10-16 10:16:07 (GMT) |
commit | d9188e538d16048047997a74af405cbb2871f353 (patch) | |
tree | e385eaf488648afc34d524b76020a5480cd89a42 /configure.in | |
parent | defaea533516de75e361227996be5fc8de134306 (diff) | |
download | monitoring-plugins-d9188e538d16048047997a74af405cbb2871f353.tar.gz |
use asprintf
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@119 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 82 |
1 files changed, 67 insertions, 15 deletions
diff --git a/configure.in b/configure.in index ca890f7..6c98fe9 100644 --- a/configure.in +++ b/configure.in | |||
@@ -17,6 +17,13 @@ dnl Figure out how to invoke "install" and what install options to use. | |||
17 | AC_PROG_INSTALL | 17 | AC_PROG_INSTALL |
18 | AC_SUBST(INSTALL) | 18 | AC_SUBST(INSTALL) |
19 | 19 | ||
20 | AC_PROG_CC | ||
21 | AC_PROG_MAKE_SET | ||
22 | AC_PROG_AWK | ||
23 | |||
24 | AC_FUNC_GETLOADAVG | ||
25 | AM_FUNC_STRTOD | ||
26 | AM_WITH_REGEX | ||
20 | AC_PROG_RANLIB | 27 | AC_PROG_RANLIB |
21 | 28 | ||
22 | AC_PATH_PROG(ACLOCAL,aclocal) | 29 | AC_PATH_PROG(ACLOCAL,aclocal) |
@@ -61,10 +68,6 @@ dnl PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/etc:/usr/local/bin:/usr/local/sbin:$ | |||
61 | LDFLAGS="$LDFLAGS -L." | 68 | LDFLAGS="$LDFLAGS -L." |
62 | 69 | ||
63 | dnl Checks for programs. | 70 | dnl Checks for programs. |
64 | AC_PROG_CC | ||
65 | AC_PROG_MAKE_SET | ||
66 | AC_PROG_AWK | ||
67 | |||
68 | AC_PATH_PROG(PYTHON,python) | 71 | AC_PATH_PROG(PYTHON,python) |
69 | AC_PATH_PROG(PERL,perl) | 72 | AC_PATH_PROG(PERL,perl) |
70 | AC_PATH_PROG(SH,sh) | 73 | AC_PATH_PROG(SH,sh) |
@@ -261,6 +264,7 @@ AC_HEADER_STDC | |||
261 | AC_HEADER_TIME | 264 | AC_HEADER_TIME |
262 | AC_HEADER_SYS_WAIT | 265 | AC_HEADER_SYS_WAIT |
263 | AC_CHECK_HEADERS(signal.h strings.h string.h syslog.h unistd.h uio.h errno.h regex.h sys/types.h sys/time.h sys/socket.h sys/loadavg.h) | 266 | AC_CHECK_HEADERS(signal.h strings.h string.h syslog.h unistd.h uio.h errno.h regex.h sys/types.h sys/time.h sys/socket.h sys/loadavg.h) |
267 | AC_CHECK_HEADERS(stdarg.h sys/unistd.h unistd.h ctype.h sys/wait.h stdlib.h) | ||
264 | 268 | ||
265 | dnl Checks for typedefs, structures, and compiler characteristics. | 269 | dnl Checks for typedefs, structures, and compiler characteristics. |
266 | AC_C_CONST | 270 | AC_C_CONST |
@@ -269,17 +273,65 @@ AC_TYPE_PID_T | |||
269 | AC_TYPE_SIZE_T | 273 | AC_TYPE_SIZE_T |
270 | AC_TYPE_SIGNAL | 274 | AC_TYPE_SIGNAL |
271 | 275 | ||
272 | dnl AC_CHECK_MEMBER(struct timeb.millitm,[AC_DEFINE(HAVE_STRUCT_TIMEB_MILLITM)],,[#include <sys/timeb.h>]) | 276 | AC_CHECK_SIZEOF(int,cross) |
277 | AC_CHECK_SIZEOF(long,cross) | ||
278 | AC_CHECK_SIZEOF(short,cross) | ||
273 | 279 | ||
274 | dnl EXTRA_LIBRARIES="libgetopt.a libsnprintf.a" | 280 | AC_CACHE_CHECK([for long long],ac_cv_have_longlong,[ |
275 | dnl noinst_LIBRARIES="libgetopt.a libsnprintf.a" | 281 | AC_TRY_RUN([#include <stdio.h> |
276 | dnl libgetopt_a_SOURCES="getopt.c getopt1.c" | 282 | main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }], |
277 | dnl libgetopt_a_DEPENDENCIES=getopt.h | 283 | ac_cv_have_longlong=yes,ac_cv_have_longlong=no,ac_cv_have_longlong=cross)]) |
278 | dnl libsnprintf_a_SOURCES=snprintf.c | 284 | if test x"$ac_cv_have_longlong" = x"yes"; then |
279 | dnl AC_SUBST(noinst_LIBRARIES) | 285 | AC_DEFINE(HAVE_LONGLONG) |
280 | dnl AC_SUBST(libgetopt_a_SOURCES) | 286 | fi |
281 | dnl AC_SUBST(libgetopt_a_DEPENDENCIES) | 287 | |
282 | dnl AC_SUBST(libsnprintf_a_SOURCES) | 288 | # |
289 | # Check if the compiler supports the LL prefix on long long integers. | ||
290 | # AIX needs this. | ||
291 | |||
292 | AC_CACHE_CHECK([for LL suffix on long long integers],ac_cv_compiler_supports_ll, [ | ||
293 | AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL], | ||
294 | ac_cv_compiler_supports_ll=yes,ac_cv_compiler_supports_ll=no)]) | ||
295 | if test x"$ac_cv_compiler_supports_ll" = x"yes"; then | ||
296 | AC_DEFINE(COMPILER_SUPPORTS_LL) | ||
297 | fi | ||
298 | AC_CACHE_CHECK([for __va_copy],ac_cv_HAVE_VA_COPY,[ | ||
299 | AC_TRY_LINK([#include <stdarg.h> | ||
300 | va_list ap1,ap2;], [__va_copy(ap1,ap2);], | ||
301 | ac_cv_HAVE_VA_COPY=yes,ac_cv_HAVE_VA_COPY=no)]) | ||
302 | if test x"$ac_cv_HAVE_VA_COPY" = x"yes"; then | ||
303 | AC_DEFINE(HAVE_VA_COPY) | ||
304 | fi | ||
305 | |||
306 | AC_CACHE_CHECK([for C99 vsnprintf],ac_cv_HAVE_C99_VSNPRINTF,[ | ||
307 | AC_TRY_RUN([ | ||
308 | #include <sys/types.h> | ||
309 | #include <stdarg.h> | ||
310 | void foo(const char *format, ...) { | ||
311 | va_list ap; | ||
312 | int len; | ||
313 | char buf[5]; | ||
314 | |||
315 | va_start(ap, format); | ||
316 | len = vsnprintf(buf, 0, format, ap); | ||
317 | va_end(ap); | ||
318 | if (len != 5) exit(1); | ||
319 | |||
320 | va_start(ap, format); | ||
321 | len = vsnprintf(0, 0, format, ap); | ||
322 | va_end(ap); | ||
323 | if (len != 5) exit(1); | ||
324 | |||
325 | if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1); | ||
326 | |||
327 | exit(0); | ||
328 | } | ||
329 | main() { foo("hello"); } | ||
330 | ], | ||
331 | ac_cv_HAVE_C99_VSNPRINTF=yes,ac_cv_HAVE_C99_VSNPRINTF=no,ac_cv_HAVE_C99_VSNPRINTF=cross)]) | ||
332 | if test x"$ac_cv_HAVE_C99_VSNPRINTF" = x"yes"; then | ||
333 | AC_DEFINE(HAVE_C99_VSNPRINTF) | ||
334 | fi | ||
283 | 335 | ||
284 | dnl We used to not do long options unless a compatible lib was found | 336 | dnl We used to not do long options unless a compatible lib was found |
285 | dnl Now we provide code and make libgetopt if native is not suitable | 337 | dnl Now we provide code and make libgetopt if native is not suitable |
@@ -302,7 +354,7 @@ AC_CHECK_FUNCS(getopt_long_only,,LIBS="$LIBS -lgetopt" DEPLIBS="$DEPLIBS libgeto | |||
302 | AC_CHECK_FUNC(asprintf,,LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a") | 354 | AC_CHECK_FUNC(asprintf,,LIBS="$LIBS -lsnprintf" DEPLIBS="$DEPLIBS libsnprintf.a") |
303 | 355 | ||
304 | dnl Checks for library functions. | 356 | dnl Checks for library functions. |
305 | AC_CHECK_FUNCS(select socket strdup strstr strtod strtol strtoul gettimeofday) | 357 | AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul gettimeofday) |
306 | 358 | ||
307 | AC_MSG_CHECKING(for type of socket size) | 359 | AC_MSG_CHECKING(for type of socket size) |
308 | AC_TRY_COMPILE([#include <stdlib.h> | 360 | AC_TRY_COMPILE([#include <stdlib.h> |