From e9321444404a14201be9401bcfc421ce46d78da5 Mon Sep 17 00:00:00 2001 From: dockes Date: Mon, 7 Dec 2009 13:24:18 +0000 Subject: [PATCH] Israel G. Lugo: make sure that only one of inotify or FAM gets enabled, giving priority to inotify. --- src/configure.ac | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/src/configure.ac b/src/configure.ac index 9b7d3d69..eb8a1393 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -80,11 +80,36 @@ if test X$withAspell != Xno ; then fi fi +if test -f /usr/include/sys/inotify.h ; then + inot_default=yes +else + inot_default=no +fi + +# Real time monitoring with inotify +AC_ARG_WITH(inotify, + AC_HELP_STRING([--with-inotify], + [Use inotify for almost real time indexing of modified files.]), + withInotify=$withval, withInotify=$inot_default) + +if test X$withInotify != Xno ; then + AC_MSG_NOTICE([enabled support for inotify monitoring]) + AC_DEFINE(RCL_MONITOR, 1, [Real time monitoring option]) + AC_DEFINE(RCL_USE_INOTIFY, 1, [Compile the inotify interface]) +else + AC_MSG_NOTICE([inotify monitoring disabled]) +fi + # Real time monitoring with FAM AC_ARG_WITH(fam, AC_HELP_STRING([--with-fam], [Use File Alteration Monitor for almost real time indexing of modified files. Give the fam/gamin library as argument (ie: /usr/lib/libfam.so) if configure does not find the right one.]), withFam=$withval, withFam=no) +if test X$withFam != Xno -a X$withInotify != Xno ; then + AC_MSG_NOTICE([FAM support enabled but inotify support also enabled. Disabling FAM support and using inotify]) + withFam=no +fi + case $withFam in no);; yes) @@ -116,26 +141,6 @@ if test X$withFam != Xno ; then fi fi -if test -f /usr/include/sys/inotify.h -a X$withFam = Xno ; then - inot_default=yes -else - inot_default=no -fi - -# Real time monitoring with inotify -AC_ARG_WITH(inotify, - AC_HELP_STRING([--with-inotify], - [Use inotify for almost real time indexing of modified files.]), - withInotify=$withval, withInotify=$inot_default) - -if test X$withInotify != Xno ; then - AC_MSG_NOTICE([enabled support for inotify monitoring]) - AC_DEFINE(RCL_MONITOR, 1, [Real time monitoring option]) - AC_DEFINE(RCL_USE_INOTIFY, 1, [Compile the inotify interface]) -else - AC_MSG_NOTICE([inotify monitoring disabled]) -fi - # Enable use of file extended attributes. # Not by default as these are little used for now. AC_ARG_ENABLE(xattr,