emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r113404: * configure.ac: Simplify --with-file-notifi


From: Paul Eggert
Subject: [Emacs-diffs] trunk r113404: * configure.ac: Simplify --with-file-notification handling.
Date: Sat, 13 Jul 2013 00:01:46 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113404
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Fri 2013-07-12 17:01:43 -0700
message:
  * configure.ac: Simplify --with-file-notification handling.
modified:
  ChangeLog                      changelog-20091113204419-o5vbwnq5f7feedwu-1538
  configure.ac                   
configure.in-20091113204419-o5vbwnq5f7feedwu-783
=== modified file 'ChangeLog'
--- a/ChangeLog 2013-07-12 17:36:42 +0000
+++ b/ChangeLog 2013-07-13 00:01:43 +0000
@@ -1,3 +1,7 @@
+2013-07-13  Paul Eggert  <address@hidden>
+
+       * configure.ac: Simplify --with-file-notification handling.
+
 2013-07-12  Glenn Morris  <address@hidden>
 
        * configure.ac: If with-file-notification=yes, if gfile not found,

=== modified file 'configure.ac'
--- a/configure.ac      2013-07-12 23:15:20 +0000
+++ b/configure.ac      2013-07-13 00:01:43 +0000
@@ -2319,63 +2319,50 @@
   with_file_notification=no
 fi
 
-if test "${with_file_notification}" != "no"; then
-
-  dnl MS Windows native file monitor is available for mingw32 only.
-  if test "${with_file_notification}" = "w32" || \
-     ( test "${opsys}" = "mingw32" && \
-       test "${with_file_notification}" = "yes" ); 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)"
-        with_file_notification=w32
-     elif test "${with_file_notification}" = "w32"; then
-       AC_MSG_ERROR([File notification `w32' requested but requirements not 
found.])
-     elif test "${opsys}" = "mingw32"; then
-       dnl Do not try any further.
-       with_file_notification=no
-     fi
-  fi
-  
-  dnl g_file_monitor exists since glib 2.18.  G_FILE_MONITOR_EVENT_MOVED
-  dnl has been added in glib 2.24.  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" || \
-    test "${with_file_notification}" = "yes"; then
-     PKG_CHECK_MODULES(GFILENOTIFY, gio-2.0 >= 2.24, HAVE_GFILENOTIFY=yes, 
HAVE_GFILENOTIFY=no)
-     if test "$HAVE_GFILENOTIFY" = "yes"; then
-        AC_DEFINE(HAVE_GFILENOTIFY, 1, [Define to 1 if using GFile.])
-        NOTIFY_OBJ=gfilenotify.o
-        NOTIFY_SUMMARY="yes -lgio (gfile)"
-        with_file_notification=gfile
-     elif test "${with_file_notification}" = "gfile"; then
-        AC_MSG_ERROR([File notification `gfile' requested but requirements not 
found.])
-     fi
-  fi
-
-  dnl inotify is only available on GNU/Linux.
-  if test "${with_file_notification}" = "inotify" || \
-    test "${with_file_notification}" = "yes"; then
-     AC_CHECK_HEADER(sys/inotify.h)
-     if test "$ac_cv_header_sys_inotify_h" = yes ; then
-         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)"
-          with_file_notification=inotify
-        fi
-     fi
-     if test "${with_file_notification}" = "inotify" && \
-       test -z "${NOTIFY_OBJ}"; then
-        AC_MSG_ERROR([File notification `inotify' requested but requirements 
not found.])
-     fi
-  fi
-fi                              dnl ${with_file_notification} != no
+dnl MS Windows native file monitor is available for mingw32 only.
+case $with_file_notification,$opsys in
+  w32,* | yes,mingw32)
+    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 ;;
+esac
+
+dnl g_file_monitor exists since glib 2.18.  G_FILE_MONITOR_EVENT_MOVED
+dnl has been added in glib 2.24.  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?
+case $with_file_notification,$NOTIFY_OBJ in
+  gfile, | yes,)
+    PKG_CHECK_MODULES(GFILENOTIFY, gio-2.0 >= 2.24, HAVE_GFILENOTIFY=yes, 
HAVE_GFILENOTIFY=no)
+    if test "$HAVE_GFILENOTIFY" = "yes"; then
+       AC_DEFINE(HAVE_GFILENOTIFY, 1, [Define to 1 if using GFile.])
+       NOTIFY_OBJ=gfilenotify.o
+       NOTIFY_SUMMARY="yes -lgio (gfile)"
+    fi ;;
+esac
+
+dnl inotify is only available on GNU/Linux.
+case $with_file_notification,$NOTIFY_OBJ in
+  inotify, | yes,)
+    AC_CHECK_HEADER(sys/inotify.h)
+    if test "$ac_cv_header_sys_inotify_h" = yes ; then
+       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 ;;
+esac
+
+case $with_file_notification,$NOTIFY_OBJ in
+  yes,* | no,* | *,?*) ;;
+  *) AC_MSG_ERROR([File notification `$with_file_notification' requested but 
requirements not found.]) ;;
+esac
 
 if test -n "$NOTIFY_OBJ"; then
    AC_DEFINE(USE_FILE_NOTIFY, 1, [Define to 1 if using file notifications.])


reply via email to

[Prev in Thread] Current Thread [Next in Thread]