added msync before unmap
[rrdtool.git] / configure.ac
index e88f287..a889daa 100644 (file)
@@ -8,13 +8,13 @@ dnl Inspiration from http://autoconf-archive.cryp.to
 dnl tell automake the this script is for rrdtool
 dnl the official version number is
 dnl a.b.c
-AC_INIT([rrdtool],[1.2.99907052400])
+AC_INIT([rrdtool],[1.2.99907080300])
 dnl for testing a numberical version number comes handy
 dnl the released version are
 dnl a.bccc
 dnl the devel versions will be something like
 dnl a.b999yymmddhh 
-NUMVERS=1.299907061100
+NUMVERS=1.299907080300
 AC_SUBST(NUMVERS)
 AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE
@@ -289,7 +289,7 @@ AC_ARG_WITH(rrd-default-font,
   if test -d ${WINDIR:-nodir}/cour.ttf ; then
        RRD_DEFAULT_FONT=`cd $WINDIR;pwd`/cour.ttf
   else
-       RRD_DEFAULT_FONT='"DejaVu Sans Mono,Bitstream Vera Sans Mono,Mono"'
+       RRD_DEFAULT_FONT='"DejaVu Sans Mono,Bitstream Vera Sans Mono,monospace,Courier"'
   fi
 ])
 
@@ -299,12 +299,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])
 
@@ -331,7 +325,7 @@ CFLAGS="$CFLAGS -D_GNU_SOURCE"
 
 dnl which flags does the compiler support?
 if test "x$GCC" = "xyes"; then
-  for flag in -fno-strict-aliasing -Wall -std=c99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -W; do
+  for flag in -fno-strict-aliasing -Wall -std=c99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wc++-compat -Wold-style-definition -W; do
     oCFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS $flag"
     cachename=rd_cv_gcc_flag_`echo $flag|sed 's/[[^A-Za-z]]/_/g'`
@@ -354,26 +348,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 <unistd.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#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
@@ -415,7 +389,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 <sys/mman.h>
                                     #endif])
@@ -437,12 +411,11 @@ dnl enable_mmap="no"
   fi
 fi
 
-dnl use FD based I/O ?
-if test "x$enable_mmap" = "xno";then
-    AC_CHECK_DECLS(posix_fadvise, [], [], [#define _XOPEN_SOURCE 600
+dnl can we use posix_fadvise
+AC_CHECK_DECLS(posix_fadvise, [], [], [#define _XOPEN_SOURCE 600
 #include <fcntl.h>])
-    AC_CHECK_FUNCS(posix_fadvise)
-fi
+AC_CHECK_FUNCS(posix_fadvise)
+
 
 
 CONFIGURE_PART(IEEE Math Checks)
@@ -762,7 +735,7 @@ if test  "$enable_tcl" = "yes"; then
   withval=""
   AC_ARG_WITH(tcllib,[  --with-tcllib=DIR       location of the tclConfig.sh])
   enable_tcl=no
-  for dir in $withval /usr/lib /usr/local/lib; do
+  for dir in $withval /usr/lib /usr/local/lib /usr/lib/tcl8.4 /usr/lib/tcl8.3 ; do
     AC_MSG_CHECKING(for tclConfig.sh in $dir)
     if test -f "$dir/tclConfig.sh" ; then
        tcl_config=$dir/tclConfig.sh
@@ -797,6 +770,7 @@ AC_SUBST(TCL_LD_SEARCH_FLAGS)
 AC_SUBST(TCL_STUB_LIB_SPEC)
 AC_SUBST(TCL_VERSION)
 AC_SUBST(TCL_PACKAGE_DIR)
+AC_SUBST(TCL_INC_DIR)
 
 AC_ARG_ENABLE(python,[  --disable-python        do not build the python modules],
 [],[enable_python=yes])
@@ -863,7 +837,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"