From 7f203aa1fde2bc9ec43aa05a939525cdab149832 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 3 Jun 2013 21:06:09 +0200 Subject: [PATCH] * configure.ac (HAVE_GFILENOTIFY): Do not change $LIBS. (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): Substitute. * nt/config.nt: Add HAVE_GFILENOTIFY, HAVE_W32NOTIFY and USE_FILE_NOTIFY. * src/Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables. (ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS). (LIBES): Add $(GFILENOTIFY_LIBS). * src/w32inevt.c (handle_file_notifications): Add dummy implementation for !HAVE_W32NOTIFY. * src/w32term.c: Wrap code with HAVE_W32NOTIFY. --- ChangeLog | 5 +++++ configure.ac | 3 ++- nt/ChangeLog | 4 ++++ nt/config.nt | 9 +++++++++ src/ChangeLog | 11 +++++++++++ src/Makefile.in | 6 ++++-- src/w32inevt.c | 8 ++++++++ src/w32term.c | 7 +++++-- 8 files changed, 48 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8474483f1..d8c1ee2881 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-06-03 Eli Zaretskii + + * configure.ac (HAVE_GFILENOTIFY): Do not change $LIBS. + (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): Substitute. + 2013-06-03 Jan Djärv * configure.ac (HAVE_GLIB): Add GLib check. Set XGSELOBJ if GLib is diff --git a/configure.ac b/configure.ac index c13f9d977e..4e58cddf59 100644 --- a/configure.ac +++ b/configure.ac @@ -2329,7 +2329,6 @@ 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 @@ -2359,6 +2358,8 @@ if test -n "$NOTIFY_OBJ"; then AC_DEFINE(USE_FILE_NOTIFY, 1, [Define to 1 if using file notifications.]) fi AC_SUBST(NOTIFY_OBJ) +AC_SUBST(GFILENOTIFY_CFLAGS) +AC_SUBST(GFILENOTIFY_LIBS) dnl Do not put whitespace before the #include statements below. dnl Older compilers (eg sunos4 cc) choke on it. diff --git a/nt/ChangeLog b/nt/ChangeLog index b5322f5103..41f6d81d59 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2013-06-03 Eli Zaretskii + + * config.nt: Add HAVE_GFILENOTIFY, HAVE_W32NOTIFY and USE_FILE_NOTIFY. + 2013-06-03 Eli Zaretskii * inc/sys/time.h (struct timeval): Remove the _W64 guards. diff --git a/nt/config.nt b/nt/config.nt index 4380f2b86c..95b56f2dc6 100644 --- a/nt/config.nt +++ b/nt/config.nt @@ -547,6 +547,9 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 +/* Define to 1 if using GFile. */ +#undef HAVE_GFILENOTIFY + /* Define to 1 if you have the `get_current_dir_name' function. */ #undef HAVE_GET_CURRENT_DIR_NAME @@ -1141,6 +1144,9 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H +/* Define to 1 to use w32notify. */ +#define HAVE_W32NOTIFY 1 + /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H @@ -1497,6 +1503,9 @@ along with GNU Emacs. If not, see . */ /* Define to nonzero if you want access control list support. */ #undef USE_ACL +/* Define to 1 if using file notifications. */ +#define USE_FILE_NOTIFY 1 + /* Define to 1 if using GTK. */ #undef USE_GTK diff --git a/src/ChangeLog b/src/ChangeLog index aeca77b2ba..491e5c3861 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2013-06-03 Eli Zaretskii + + * Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables. + (ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS). + (LIBES): Add $(GFILENOTIFY_LIBS). + + * w32inevt.c (handle_file_notifications): Add dummy implementation + for !HAVE_W32NOTIFY. + + * w32term.c: Wrap code with HAVE_W32NOTIFY. + 2013-06-03 Jan Djärv * xgselect.c: Replace #if defined ... with #ifdef HAVE_GLIB. diff --git a/src/Makefile.in b/src/Makefile.in index 0e42f0ee6a..9d7857e4ca 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -160,6 +160,8 @@ GTK_OBJ=@GTK_OBJ@ ## inotify.o if HAVE_INOTIFY. ## w32notify.o if HAVE_W32NOTIFY. NOTIFY_OBJ = @NOTIFY_OBJ@ +GFILENOTIFY_CFLAGS = @GFILENOTIFY_CFLAGS@ +GFILENOTIFY_LIBS = @GFILENOTIFY_LIBS@ ## -ltermcap, or -lncurses, or -lcurses, or "". LIBS_TERMCAP=@LIBS_TERMCAP@ @@ -345,7 +347,7 @@ ALL_CFLAGS=-Demacs $(MYCPPFLAGS) -I. -I$(srcdir) \ $(LIBXML2_CFLAGS) $(DBUS_CFLAGS) $(XRANDR_CFLAGS) $(XINERAMA_CFLAGS) \ $(SETTINGS_CFLAGS) $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS) \ $(LIBOTF_CFLAGS) $(M17N_FLT_CFLAGS) $(DEPFLAGS) \ - $(LIBGNUTLS_CFLAGS) \ + $(LIBGNUTLS_CFLAGS) $(GFILENOTIFY_CFLAGS) \ $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS) ALL_OBJC_CFLAGS=$(ALL_CFLAGS) $(GNU_OBJC_CFLAGS) @@ -427,7 +429,7 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \ $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \ - $(LIB_MATH) + $(GFILENOTIFY_LIBS) $(LIB_MATH) all: emacs$(EXEEXT) $(OTHER_FILES) .PHONY: all diff --git a/src/w32inevt.c b/src/w32inevt.c index 3c38cf806e..88a3f9739c 100644 --- a/src/w32inevt.c +++ b/src/w32inevt.c @@ -577,6 +577,7 @@ maybe_generate_resize_event (void) 0, 0, 0); } +#if HAVE_W32NOTIFY static int handle_file_notifications (struct input_event *hold_quit) { @@ -644,6 +645,13 @@ handle_file_notifications (struct input_event *hold_quit) leave_crit (); return nevents; } +#else /* !HAVE_W32NOTIFY */ +static int +handle_file_notifications (struct input_event *hold_quit) +{ + return 0; +} +#endif /* !HAVE_W32NOTIFY */ /* Here's an overview of how Emacs input works in non-GUI sessions on MS-Windows. (For description of the GUI input, see the commentary diff --git a/src/w32term.c b/src/w32term.c index 58b1d3ca30..617492e189 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -3210,6 +3210,8 @@ construct_drag_n_drop (struct input_event *result, W32Msg *msg, struct frame *f) } +#if HAVE_W32NOTIFY + /* File event notifications (see w32notify.c). */ Lisp_Object @@ -3325,7 +3327,8 @@ queue_notifications (struct input_event *event, W32Msg *msg, struct frame *f, /* We've stuffed all the events ourselves, so w32_read_socket shouldn't. */ event->kind = NO_EVENT; } -#endif +#endif /* WINDOWSNT */ +#endif /* HAVE_W32NOTIFY */ /* Function to report a mouse movement to the mainstream Emacs code. @@ -4968,7 +4971,7 @@ w32_read_socket (struct terminal *terminal, check_visibility = 1; break; -#ifdef WINDOWSNT +#if HAVE_W32NOTIFY case WM_EMACS_FILENOTIFY: f = x_window_to_frame (dpyinfo, msg.msg.hwnd); if (f) -- 2.20.1