X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=configure.ac;h=101520f5d05d1fd5a8f77f3be9a66231c9fb9b94;hb=c1a96caa82a48ed49a02c92e9d79e93b95ef3b06;hp=b22a80fecd7d89f63e9bc96a89d175bf93642658;hpb=66fd2a1b23caeed5691c44ab2727f27addf5b153;p=rrdtool.git diff --git a/configure.ac b/configure.ac index b22a80f..101520f 100644 --- a/configure.ac +++ b/configure.ac @@ -49,12 +49,20 @@ AH_TOP([ /* realloc does not support NULL as argument */ #undef NO_NULL_REALLOC +/* lets enable madvise defines in NetBSD */ +#if defined(__NetBSD__) +# if !defined(_NETBSD_SOURCE) +# define _NETBSD_SOURCE +# endif +#endif + ]) AH_BOTTOM([ /* make sure that we pickup the correct stuff from all headers */ -#define _XOPEN_SOURCE 600 #ifdef HAVE_FEATURES_H +#define _XOPEN_SOURCE 600 +#define _BSD_SOURCE 1 # include #endif @@ -84,6 +92,7 @@ AH_BOTTOM([ #ifdef HAVE_SYS_MMAN_H # include #endif + #if !defined HAVE_MADVISE && defined HAVE_POSIX_MADVISE /* use posix_madvise family */ # define madvise posix_madvise @@ -218,12 +227,15 @@ char *strchr (), *strrchr (); /* for Solaris */ #if (! defined(HAVE_ISINF) && defined(HAVE_FPCLASS)) # define HAVE_ISINF 1 +# ifdef isinf +# undef isinf /* confuse autoconf */ +# endif # define isinf(a) (fpclass(a) == FP_NINF || fpclass(a) == FP_PINF) #endif /* solaris 10 it defines isnan such that only forte can compile it ... bad bad */ #if (defined(HAVE_ISNAN) && defined(isnan) && defined(HAVE_FPCLASS)) -# undef isnan +# undef isnan /* confuse autoconf to NOT remove this */ # define isnan(a) (fpclass(a) == FP_SNAN || fpclass(a) == FP_QNAN) #endif @@ -299,12 +311,6 @@ AC_ARG_ENABLE([mmap], [], [enable_mmap=yes]) -dnl will most likely not work on compressed filesystems, i think.. *shrug* -AC_ARG_ENABLE([direct-io], -[ --enable-direct-io enable O_DIRECT if available], -[enable_direct_io=yes], -[]) - AC_ARG_ENABLE(pthread,[ --disable-pthread disable multithread support], [],[enable_pthread=yes]) @@ -354,26 +360,6 @@ AC_HEADER_STDC AC_HEADER_DIRENT AC_CHECK_HEADERS(features.h sys/stat.h sys/types.h fcntl.h locale.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) -if test "x$enable_direct_io" = "xyes"; then -AC_CACHE_CHECK([for O_DIRECT flag to open(2)],rrd_cv_HAVE_OPEN_O_DIRECT,[ -AC_TRY_COMPILE([ -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif], -[int fd = open("/dev/null", O_DIRECT);], -rrd_cv_HAVE_OPEN_O_DIRECT=yes,rrd_cv_HAVE_OPEN_O_DIRECT=no)]) - if test "x$rrd_cv_HAVE_OPEN_O_DIRECT" = "xyes"; then - AC_DEFINE(USE_DIRECT_IO,1,[Whether the open(2) accepts O_DIRECT]) - else - enable_direct_io="no" - fi -else - enable_direct_io="no" -fi - dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_HEADER_TIME @@ -382,6 +368,7 @@ AC_STRUCT_TM dnl Checks for libraries. AC_CHECK_FUNC(acos, , AC_CHECK_LIB(m, acos)) + dnl add pic flag in any case this makes sure all our code is relocatable eval `./libtool --config | grep pic_flag` CFLAGS="$CFLAGS $pic_flag" @@ -399,8 +386,6 @@ dnl of the form HAVE_FUNCTION AC_CHECK_FUNCS(tzset mbstowcs opendir readdir chdir chroot getuid setlocale strerror strerror_r snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday) -dnl Could use these to know if we need to provide a prototype -dnl AC_CHECK_DECLS(fdatasync, [], [], [#include ]) dnl XXX: dunno about windows.. add AC_CHECK_FUNCS(munmap) there too? if test "x$enable_mmap" = "xyes"; then @@ -415,7 +400,7 @@ if test "x$enable_mmap" = "xyes"; then *) AC_CHECK_HEADERS(sys/mman.h) AC_FUNC_MMAP - AC_CHECK_FUNCS(mmap munmap) + AC_CHECK_FUNCS(mmap munmap msync) AC_CHECK_DECLS(madvise, [], [], [#ifdef HAVE_SYS_MMAN_H # include #endif]) @@ -593,6 +578,14 @@ AC_LINK_IFELSE( ) AC_LANG_POP(C) +dnl Could use these to know if we need to provide a prototype +dnl AC_CHECK_DECLS(fdatasync, [], [], [#include ]) + +dnl solaris has fdatasync in the librt + +AC_CHECK_FUNC(fdatasync, [], AC_CHECK_LIB(rt, fdatasync, [LIBS="${LIBS} -lrt"],[])) + + CONFIGURE_PART(Find 3rd-Party Libraries) @@ -863,7 +856,6 @@ echo "----------------------------------------------------------------" echo "Config is DONE!" echo echo " With MMAP IO: $enable_mmap" -echo " Use O_DIRECT: $enable_direct_io" echo " Static programs: $staticprogs" echo " Perl Modules: $COMP_PERL" echo " Perl Binary: $PERL"