]> git.saurik.com Git - wxWidgets.git/commitdiff
Disable wxUSE_FSWATCHER under Unix if neither inotify nor kqueue is available.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 29 Jan 2010 13:07:26 +0000 (13:07 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 29 Jan 2010 13:07:26 +0000 (13:07 +0000)
Don't define wxUSE_FSWATCHER as 1 in configure if we can't implement it.

Also add a check to wx/unix/chkconf.h to verify that we didn't end up with an
inconsistent configuration somehow.

Closes #11670.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

configure
configure.in
include/wx/unix/chkconf.h

index dd303cc125a7d909dd987c1f498e6baf5d83721a..14b609c3fe8d1ad11b0ea6c2c6d0ec27184d9b14 100755 (executable)
--- a/configure
+++ b/configure
 
 
 if test "$wxUSE_FSWATCHER" = "yes"; then
-    cat >>confdefs.h <<\_ACEOF
-#define wxUSE_FSWATCHER 1
-_ACEOF
-
-    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS fswatcher"
-
-    if test "$wxUSE_UNIX" = "yes"; then
+                if test "$wxUSE_MSW" != "1"; then
+        if test "$wxUSE_UNIX" = "yes"; then
 
 for ac_header in sys/inotify.h
 do
 
 done
 
-        if test "$ac_cv_header_sys_inotify_h" = "yes"; then
-            cat >>confdefs.h <<\_ACEOF
+            if test "$ac_cv_header_sys_inotify_h" = "yes"; then
+                cat >>confdefs.h <<\_ACEOF
 #define wxHAS_INOTIFY 1
 _ACEOF
 
-        else
+            else
 
 for ac_header in sys/event.h
 do
 
 done
 
-            if test "$ac_cv_header_sys_event_h" = "yes"; then
-                cat >>confdefs.h <<\_ACEOF
+                if test "$ac_cv_header_sys_event_h" = "yes"; then
+                    cat >>confdefs.h <<\_ACEOF
 #define wxHAS_KQUEUE 1
 _ACEOF
 
-            else
-                { echo "$as_me:$LINENO: WARNING: No native wxFileSystemWatcher implementation available for on this platform" >&5
-echo "$as_me: WARNING: No native wxFileSystemWatcher implementation available for on this platform" >&2;}
+                else
+                    wxUSE_FSWATCHER=no
+                fi
             fi
+        else
+            wxUSE_FSWATCHER=no
         fi
     fi
+
+    if test "$wxUSE_FSWATCHER" = "yes"; then
+        cat >>confdefs.h <<\_ACEOF
+#define wxUSE_FSWATCHER 1
+_ACEOF
+
+        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS fswatcher"
+    else
+        { echo "$as_me:$LINENO: WARNING: wxFileSystemWatcher won't be available on this platform" >&5
+echo "$as_me: WARNING: wxFileSystemWatcher won't be available on this platform" >&2;}
+    fi
 fi
 
 
index bec42d48ff0139ac5b656d7ee8c28e4a949d8573..8e2b6bd584d57c6263b3a817c8f1c7c59d85597b 100644 (file)
@@ -5562,22 +5562,33 @@ dnl File system watcher checks
 dnl ---------------------------------------------------------------------------
 
 if test "$wxUSE_FSWATCHER" = "yes"; then
-    AC_DEFINE(wxUSE_FSWATCHER)
-    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS fswatcher"
-
-    if test "$wxUSE_UNIX" = "yes"; then
-        AC_CHECK_HEADERS(sys/inotify.h,,, [AC_INCLUDES_DEFAULT()])
-        if test "$ac_cv_header_sys_inotify_h" = "yes"; then
-            AC_DEFINE(wxHAS_INOTIFY)
-        else
-            AC_CHECK_HEADERS(sys/event.h,,, [AC_INCLUDES_DEFAULT()])
-            if test "$ac_cv_header_sys_event_h" = "yes"; then
-                AC_DEFINE(wxHAS_KQUEUE)
+    dnl wxFileSystemWatcher is always available under MSW but we need either
+    dnl inotify or kqueue support in the system for it under Unix (this
+    dnl includes OS X which does have kqueue but no other platforms)
+    if test "$wxUSE_MSW" != "1"; then
+        if test "$wxUSE_UNIX" = "yes"; then
+            AC_CHECK_HEADERS(sys/inotify.h,,, [AC_INCLUDES_DEFAULT()])
+            if test "$ac_cv_header_sys_inotify_h" = "yes"; then
+                AC_DEFINE(wxHAS_INOTIFY)
             else
-                AC_MSG_WARN([No native wxFileSystemWatcher implementation available for on this platform])
+                AC_CHECK_HEADERS(sys/event.h,,, [AC_INCLUDES_DEFAULT()])
+                if test "$ac_cv_header_sys_event_h" = "yes"; then
+                    AC_DEFINE(wxHAS_KQUEUE)
+                else
+                    wxUSE_FSWATCHER=no
+                fi
             fi
+        else
+            wxUSE_FSWATCHER=no
         fi
     fi
+
+    if test "$wxUSE_FSWATCHER" = "yes"; then
+        AC_DEFINE(wxUSE_FSWATCHER)
+        SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS fswatcher"
+    else
+        AC_MSG_WARN([wxFileSystemWatcher won't be available on this platform])
+    fi
 fi
 
 dnl ---------------------------------------------------------------------------
index f1cff704d9965103fd4282cbc9ee6f01010074a1..50e56d271c0c11e71337ebd2c67130152c1ef636 100644 (file)
 #   endif
 #endif /* wxUSE_CONSOLE_EVENTLOOP */
 
+#if wxUSE_FSWATCHER
+#   if !defined(wxHAS_INOTIFY) && !defined(wxHAS_KQUEUE)
+#       ifdef wxABORT_ON_CONFIG_ERROR
+#           error "wxFileSystemWatcher requires either inotify() or kqueue()"
+#       else
+#           undef wxUSE_FSWATCHER
+#           define wxUSE_FSWATCHER 0
+#       endif
+#   endif
+#endif /* wxUSE_FSWATCHER */
+
 #if wxUSE_GSTREAMER
 #   if !wxUSE_THREADS
 #       ifdef wxABORT_ON_CONFIG_ERROR