dnl tell automake the this script is for rrdtool
dnl Minimum Autoconf version required.
-AC_PREREQ(2.59)
+AC_PREREQ([2.69])
dnl the official version number is
dnl a.b.c
AC_PROG_CPP
AC_PROG_CC
AM_PROG_CC_C_O
-AC_PROG_LIBTOOL
+LT_INIT
dnl Try to detect/use GNU features
CFLAGS="$CFLAGS -D_GNU_SOURCE"
CONFIGURE_PART(Checking for Header Files)
dnl Checks for header files.
-AC_HEADER_STDC
AC_HEADER_DIRENT
-AC_CHECK_HEADERS(langinfo.h stdint.h inttypes.h libgen.h features.h sys/stat.h sys/types.h fcntl.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h grp.h pwd.h glob.h)
+AC_CHECK_HEADERS(langinfo.h stdint.h inttypes.h libgen.h features.h sys/stat.h sys/types.h fcntl.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/time.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h grp.h pwd.h glob.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
-AC_HEADER_TIME
AC_STRUCT_TM
dnl figure out 'stuff' about
dnl finite is BSD, isfinite is C99, so prefer the latter
AC_CACHE_CHECK([whether isfinite is broken],[ac_cv_have_broken_isfinite],[
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#ifdef HAVE_MATH_H
#include <math.h>
#endif
#endif
#endif
return 0;
-}],[ac_cv_have_broken_isfinite=no],[ac_cv_have_broken_isfinite=yes],[
+}]])],[ac_cv_have_broken_isfinite=no],[ac_cv_have_broken_isfinite=yes],[
case "${target}" in
hppa*-*-hpux*) ac_cv_have_broken_isfinite=yes ;;
*-solaris2.8) ac_cv_have_broken_isfinite=yes ;;
AC_CACHE_CHECK(whether sigwait has 2 arguments,
ac_cv_libc_sigwait,
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _POSIX_PTHREAD_SEMANTICS
#include <stdio.h>
- #include <signal.h>],
- [sigset_t sigs; int signo; sigwait(&sigs, &signo);],
- AC_DEFINE(HAVE_SIGWAIT,1,[have two argument posix sigwait])
- AC_MSG_RESULT(yes)
- ,
- AC_MSG_RESULT(no)
+ #include <signal.h>]],
+ [[sigset_t sigs; int signo; sigwait(&sigs, &signo);]])],
+ [AC_DEFINE(HAVE_SIGWAIT,1,[have two argument posix sigwait])
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)]
)
)
AC_CACHE_CHECK([whether we need to include gthreads for g_thread_init],
[ac_cv_glibc_g_thread_init],
- [AC_TRY_COMPILE([#include <glib.h>],
- [#if !GLIB_CHECK_VERSION(2, 32, 0)
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <glib.h>]],
+ [[#if !GLIB_CHECK_VERSION(2, 32, 0)
# error "glib needs g_thread_init"
- #endif],
+ #endif]])],
[AC_MSG_RESULT(no)],
[EX_CHECK_ALL(gthread-2.0, g_thread_init, glib.h, gthread-2.0, x.x.x, "", "")
AC_MSG_RESULT(yes)])])
#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
#endif
-#ifdef TIME_WITH_SYS_TIME
+#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
-# include <time.h>
-#else
-# ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
#endif
+#include <time.h>
#ifdef HAVE_SYS_TIMES_H
# include <sys/times.h>
#endif
-/* define strrchr, strchr and memcpy, memmove in terms of bsd funcs
- make sure you are NOT using bcopy, index or rindex in the code */
-
-#ifdef STDC_HEADERS
-# include <string.h>
-#else
-# ifndef HAVE_STRCHR
-# define strchr index
-# define strrchr rindex
-# endif
-char *strchr (), *strrchr ();
-# ifndef HAVE_MEMMOVE
-# define memcpy(d, s, n) bcopy ((s), (d), (n))
-# define memmove(d, s, n) bcopy ((s), (d), (n))
-# endif
-#endif
+#include <string.h>
#ifdef NO_NULL_REALLOC
# define rrd_realloc(a,b) ( (a) == NULL ? malloc( (b) ) : realloc( (a) , (b) ))