diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-12-22 21:39:23 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-12-22 21:54:43 +0200 |
commit | 67a64a6a7809c183516740696e15ab88f82d7ef0 (patch) | |
tree | b58f30a8cee98bac7c9f4bc8236c86eefdadb4ef /configure.ac | |
parent | 2c28190e77ce38b6437a2be8337680f77f58d37a (diff) | |
download | wydawca-67a64a6a7809c183516740696e15ab88f82d7ef0.tar.gz wydawca-67a64a6a7809c183516740696e15ab88f82d7ef0.tar.bz2 |
Implement inotify support.
* configure.ac: New option --with-inotify.
Bye default, use inotify if it is present.
* src/watcher.c: New file. Implements inotify watcher.
* src/Makefile.am [COND_INOTIFY] (wydawca_SOURCES): Add watcher.c
* src/diskio.c (dir_get_path): New function.
* src/job.c (job) <spool>: Remove const qualifier. All uses changed.
(inotify_spool): New pseudo-spool.
(fake_spool): Remove static qualifier.
(wydawca_scanner): Support for inotify spools.
* src/net.c (open_listener): Don't exit if the listener
address is not set.
(wydawca_listener): Listen on the listener socket and
on the inotify descriptor. If none is set, bail out.
* src/process.c (for_each_spool)
(file_info_cleanup)
(spool_cwd_add_new_file,spool_add_new_file): New functions.
(scan_spool_unlocked): Use spool_cwd_add_new_file.
Don't initialize dictionaries here: it will be done in
spool_commit_triplets.
(spool_open_dictionaries): New function.
(close_dictionaries): Rename to spool_close_dictionaries.
Clear dict_inited.
* src/triplet.c (hash_triplet_compare): Compare spools as well.
(register_file): Likewise.
(triplet_lookup): New function.
(check_triplet_state): New argument: noauth. All uses updated.
(enumerate_triplets): Rename to spool_commit_triplets.
Call spool_open_dictionaries.
(count_processable_triplets,triplet_remove_file): New functions.
* src/verify.c (verify_directive_file): New argument: noauth.
All uses updated.
* src/vtab.c (reg): Initialize get_path member.
(get_path): New function.
* src/wydawca.c (main): Set print_version_hook.
* src/wydawca.h (virt_tab) <get_path>: New method.
(spool) <dict_inited>: New member.
(fake_spool, inotify_spool): New externs.
(spool_add_new_file, spool_cwd_add_new_file)
(spool_open_dictionaries, spool_close_dictionaries)
(for_each_spool, count_processable_triplets)
(triplet_remove_file, get_path): New protos.
(enumerate_triplets): Rename to spool_commit_triplets.
(verify_directive_file): Take two arguments.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index a503cc7..2683b9b 100644 --- a/configure.ac +++ b/configure.ac @@ -12,13 +12,14 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with wydawca. If not, see <http://www.gnu.org/licenses/>. AC_PREREQ(2.63) -AC_INIT([wydawca], 2.1.90, [bug-wydawca@gnu.org.ua]) +AC_INIT([wydawca], 2.1.90, [bug-wydawca@gnu.org.ua], [wydawca], + [http://www.gnu.org.ua/software/wydawca]) AC_CONFIG_SRCDIR([src/wydawca.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE([1.11 gnits tar-ustar dist-bzip2 dist-xz std-options silent-rules]) # Enable silent rules by default: @@ -30,13 +31,13 @@ AC_PROG_RANLIB # Checks for libraries. # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([stdlib.h string.h sys/file.h unistd.h]) +AC_CHECK_HEADERS([stdlib.h string.h sys/file.h unistd.h sys/inotify.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIGNAL AC_TYPE_UID_T AC_TYPE_PID_T @@ -47,13 +48,15 @@ AC_SYS_LARGEFILE # Checks for library functions. AC_FUNC_FORK AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_STAT AC_FUNC_VPRINTF -AC_CHECK_FUNCS([fchdir memset strchr strdup strerror strrchr setegid setregid setresgid setresuid seteuid setreuid vsyslog sysconf getdtablesize]) +AC_CHECK_FUNCS([fchdir memset strchr strdup strerror strrchr setegid setregid\ + setresgid setresuid seteuid setreuid vsyslog sysconf getdtablesize\ + inotify_init]) # ********************** # Mailutils # ********************** AM_GNU_MAILUTILS(2.0, [mailer], [:]) @@ -104,12 +107,35 @@ if test "$status_tcpwrap" = yes; then fi fi if test "$status_tcpwrap" = yes; then AC_DEFINE_UNQUOTED([WITH_LIBWRAP],1,[Defined if compiling with libwrap]) fi +# ********************** +# TCP wrappers +# ********************** +AC_ARG_WITH(inotify, + AC_HELP_STRING([--with-inotify], + [compile with inotify(7) support (Linux-specific)]), + [status_inotify=${withval}], + [status_inotify=probe]) +if test $status_inotify != no; then + if test "$ac_cv_header_sys_inotify_h" = yes && + test "$ac_cv_func_inotify_init" = yes; then + status_inotify=yes + elif test $status_inotify = probe; then + status_inotify=no + else + AC_MSG_FAILURE([Requested inotify(7) support is not available]) + fi +fi +if test $status_inotify = yes; then + AC_DEFINE([WITH_INOTIFY],1,[Set to 1 if inotify(7) is to be used]) +fi +AM_CONDITIONAL([COND_INOTIFY],[test $status_inotify = yes]) + # Grecs subsystem GRECS_SETUP([grecs],[git2chg getopt tests]) AH_BOTTOM([ #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __attribute__(x) |