diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2013-06-03 15:03:05 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2013-06-03 15:03:05 +0200 |
commit | c9628c79bba5ec1e55c31512b5c32371ff034b1f (patch) | |
tree | 9da42ec29de5da50cbe76bd73ccc382c265aa1af /configure.ac | |
parent | 2041ae1fa791f61bf9f4a154de29a7bc167481d6 (diff) | |
download | emacs-c9628c79bba5ec1e55c31512b5c32371ff034b1f.tar.gz emacs-c9628c79bba5ec1e55c31512b5c32371ff034b1f.tar.bz2 emacs-c9628c79bba5ec1e55c31512b5c32371ff034b1f.zip |
* configure.ac (file-notification): New option, replaces inotify option.
(HAVE_W32): Remove w32notify.o.
(with_file_notification): Add checks for glib and w32. Adapt check
for inotify.
(Summary): Add entry for file notification.
* autogen/config.in: Add entries for HAVE_GFILENOTIFY,
HAVE_W32NOTIFY and USE_FILE_NOTIFY.
* lisp/autorevert.el (auto-revert-notify-enabled)
(auto-revert-notify-rm-watch, auto-revert-notify-add-watch)
(auto-revert-notify-event-p, auto-revert-notify-event-file-name)
(auto-revert-notify-handler): Handle also gfilenotify.
* lisp/subr.el: (file-notify-handle-event): New defun. Replacing ...
(inotify-event-p, inotify-handle-event, w32notify-handle-event):
Removed.
* src/Makefile.in (NOTIFY_OBJ): New variable.
(base_obj): Replace inotify.o by $(NOTIFY_OBJ).
* src/emacs.c (main): Use HAVE_W32NOTIFY to wrap respective code.
Call syms_of_gfilenotify.
* src/gfilenotify.c: New file.
* src/keyboard.c (Qfile_notify): New variable. Replaces Qfile_inotify
and Qfile_w32notify.
(top): Wrap respective code by HAVE_GFILENOTIFY, HAVE_INOTIFY,
HAVE_W32NOTIFY and USE_FILE_NOTIFY.
* src/lisp.h: Declare syms_of_gfilenotify.
* src/termhooks.h (e): Wrap enum by USE_FILE_NOTIFY.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 70 |
1 files changed, 63 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index c0aa8e78715..b0859ca8dec 100644 --- a/configure.ac +++ b/configure.ac @@ -200,7 +200,23 @@ OPTION_DEFAULT_ON([gconf],[don't compile with GConf support]) OPTION_DEFAULT_ON([gsettings],[don't compile with GSettings support]) OPTION_DEFAULT_ON([selinux],[don't compile with SELinux support]) OPTION_DEFAULT_ON([gnutls],[don't use -lgnutls for SSL/TLS support]) -OPTION_DEFAULT_ON([inotify],[don't compile with inotify (file-watch) support]) + +AC_ARG_WITH([file-notification],[AS_HELP_STRING([--with-file-notification=LIB], + [use a file notification library (LIB one of: yes, gfile, inotify, w32, no)])], + [ case "${withval}" in + y | ye | yes ) val=yes ;; + n | no ) val=no ;; + g | gf | gfi | gfil | gfile ) val=gfile ;; + i | in | ino | inot | inoti | inotif | inotify ) val=inotify ;; + w | w3 | w32 ) val=w32 ;; + * ) AC_MSG_ERROR([`--with-file-notification=$withval' is invalid; +this option's value should be `yes', `no', `gfile', `inotify' or `w32'. +`yes' is a synonym for `w32' on MS-Windows, and for `gfile' otherwise.]) + ;; + esac + with_file_notification=$val + ], + [with_file_notification=yes]) ## For the times when you want to build Emacs but don't have ## a suitable makeinfo, and can live without the manuals. @@ -1668,7 +1684,6 @@ if test "${HAVE_W32}" = "yes"; then W32_RES_LINK="-Wl,emacs.res" else W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o" - W32_OBJ="$W32_OBJ w32notify.o" W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32" W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32 -lusp10" W32_RES_LINK="\$(EMACSRES)" @@ -2294,16 +2309,56 @@ fi AC_SUBST(LIBGNUTLS_LIBS) AC_SUBST(LIBGNUTLS_CFLAGS) +NOTIFY_OBJ= +NOTIFY_SUMMARY=no + +dnl Set defaults of $with_file_notification. +if test "${with_file_notification}" = "yes"; then + if test "${opsys}" = "mingw32"; then + with_file_notification=w32 + else + with_file_notification=gfile + fi +fi + +dnl g_file_monitor exists since glib 2.18. It has been tested under +dnl GNU/Linux only. We take precedence over inotify, but this makes +dnl only sense when glib has been compiled with inotify support. How +dnl to check? +if test "${with_file_notification}" = "gfile"; then + PKG_CHECK_MODULES(GFILENOTIFY, gio-2.0 >= 2.18, HAVE_GFILENOTIFY=yes, HAVE_GFILENOTIFY=no) + if test "$HAVE_GFILENOTIFY" = "yes"; then + AC_DEFINE(HAVE_GFILENOTIFY, 1, [Define to 1 if using GFile.]) + LIBS="$LIBS $GFILENOTIFY_LIBS" + NOTIFY_OBJ=gfilenotify.o + NOTIFY_SUMMARY="yes -lgio (gfile)" + fi +fi dnl inotify is only available on GNU/Linux. -if test "${with_inotify}" = "yes"; then - AC_CHECK_HEADERS(sys/inotify.h) +if test "${with_file_notification}" = "inotify"; then + AC_CHECK_HEADER(sys/inotify.h) if test "$ac_cv_header_sys_inotify_h" = yes ; then - AC_CHECK_FUNC(inotify_init1) + AC_CHECK_FUNC(inotify_init1) + if test "$ac_cv_func_inotify_init1" = yes; then + AC_DEFINE(HAVE_INOTIFY, 1, [Define to 1 to use inotify.]) + NOTIFY_OBJ=inotify.o + NOTIFY_SUMMARY="yes -lglibc (inotify)" + fi + fi +fi +dnl MS Windows native file monitor is available for mingw32 only. +if test "${with_file_notification}" = "w32"; then + AC_CHECK_HEADER(windows.h) + if test "$ac_cv_header_windows_h" = yes ; then + AC_DEFINE(HAVE_W32NOTIFY, 1, [Define to 1 to use w32notify.]) + NOTIFY_OBJ=w32notify.o + NOTIFY_SUMMARY="yes (w32)" fi fi -if test "$ac_cv_func_inotify_init1" = yes; then - AC_DEFINE(HAVE_INOTIFY, 1, [Define to 1 to use inotify.]) +if test -n "$NOTIFY_OBJ"; then + AC_DEFINE(USE_FILE_NOTIFY, 1, [Define to 1 if using file notifications.]) fi +AC_SUBST(NOTIFY_OBJ) dnl Do not put whitespace before the #include statements below. dnl Older compilers (eg sunos4 cc) choke on it. @@ -4682,6 +4737,7 @@ echo " Does Emacs use -lgpm? ${HAVE_GPM}" echo " Does Emacs use -ldbus? ${HAVE_DBUS}" echo " Does Emacs use -lgconf? ${HAVE_GCONF}" echo " Does Emacs use GSettings? ${HAVE_GSETTINGS}" +echo " Does Emacs use a file notification library? ${NOTIFY_SUMMARY}" echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" |