--- configure.orig	2012-05-04 00:47:40.000000000 +0300
+++ configure	2012-12-06 04:26:37.000000000 +0200
@@ -895,6 +895,7 @@
 enable_xft
 enable_nvidia
 enable_alsa
+enable_inotify
 enable_debug
 enable_testing
 enable_profiling
@@ -1620,6 +1621,7 @@
   --enable-nvidia         enable if you want nvidia support [default=no]
   --disable-alsa          disable if you do not want ALSA support
                           [default=yes]
+  --enable-inotify        enable if you want inotify support [default=no]
   --enable-debug          compile with debug symbols [default=no]
   --enable-testing        use strict compiler flags for testing [default=no]
   --enable-profiling      specify compiler flags for use with gprof and gcov
@@ -11930,7 +11932,11 @@
   Linux*)
     WANT_SYSINFO=yes
     ;;
-  FreeBSD*|GNU/kFreeBSD*)
+  FreeBSD*)
+    WANT_KVM=yes
+    WANT_DEVSTAT=yes
+    ;;
+  GNU/kFreeBSD*)
     WANT_KVM=yes
     WANT_DEVSTAT=yes
     WANT_OPTRESET=yes
@@ -16998,18 +17004,63 @@
 
 done
 
-# check if we have inotify support
-for ac_header in sys/inotify.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default"
+
+# Check whether --enable-inotify was given.
+if test "${enable_inotify+set}" = set; then :
+  enableval=$enable_inotify; want_inotify="$enableval"
+else
+  want_inotify=no
+fi
+
+if test x$want_inotify = xyes; then
+    ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default"
 if test "x$ac_cv_header_sys_inotify_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_INOTIFY_H 1
-_ACEOF
+ 
+else
+  want_inotify=no
+fi
 
 fi
+if test x$want_inotify = xyes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inotify_init in -linotify" >&5
+$as_echo_n "checking for inotify_init in -linotify... " >&6; }
+if ${ac_cv_lib_inotify_inotify_init+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-linotify  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-done
+#include <sys/inotify.h>
+
+char inotify_init ();
+int
+main ()
+{
+return inotify_init ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_inotify_inotify_init=yes
+else
+  ac_cv_lib_inotify_inotify_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inotify_inotify_init" >&5
+$as_echo "$ac_cv_lib_inotify_inotify_init" >&6; }
+if test "x$ac_cv_lib_inotify_inotify_init" = xyes; then :
+  conky_LIBS="$conky_LIBS -linotify"
+else
+  want_inotify=yes
+fi
+
+fi
 
 
 
