=== modified file 'Makefile.am'
--- Makefile.am	2009-08-25 13:17:46 +0000
+++ Makefile.am	2011-11-27 02:18:24 +0000
@@ -1,9 +1,13 @@
 EXTRA_DIST = icons
 
-SUBDIRS = src tests data examples
+SUBDIRS = src data examples
+
+if BUILD_TESTS
+SUBDIRS += tests
 
 test:		check
 tests:		check
 test-report:	check
 check-valgrind: all
 	cd tests && $(MAKE) $(AM_MAKEFLAGS) check-valgrind
+endif

=== modified file 'configure.in'
--- configure.in	2011-11-01 12:45:48 +0000
+++ configure.in	2011-11-27 02:18:24 +0000
@@ -39,11 +39,6 @@
 PKG_CHECK_MODULES([WNCK], [libwnck-3.0])
 
 #
-# libnotify, used unit-tests 
-#
-PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= 0.4.5])
-
-#
 # dbus
 #
 PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= 0.76])
@@ -76,6 +71,25 @@
 AC_SUBST(LIBM)
 
 #
+# checks for building unit-tests
+#
+AC_ARG_ENABLE([tests],
+            AS_HELP_STRING([--enable-tests], [enable building tests]),,
+            enable_tests=auto)
+
+if test x"$enable_tests" != x"no" ; then
+PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= 0.4.5],
+                               [have_tests=yes],
+                               [have_tests=no])
+   if test x${enable_tests} = xyes && test x${have_tests} = xno; then
+     AC_MSG_ERROR([Tests configured but libnotify not found])
+   fi
+else
+   have_tests=no
+fi
+AM_CONDITIONAL(BUILD_TESTS, test x${have_tests} = xyes)
+
+#
 # checks for building C- or C#-examples
 #
 AC_DEFUN([CHECK_FOR_MONO_STUFF],
@@ -118,6 +132,7 @@
 c_examples=no
 csharp_examples=no
 if test "x$with_examples" = "xc"; then
+        PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= 0.4.5])
         c_examples=yes
         AC_MSG_NOTICE([Build with ANSI-C examples])
 fi
@@ -127,6 +142,7 @@
         AC_MSG_NOTICE([Build with C-sharp examples])
 fi
 if test "x$with_examples" = "xall"; then
+        PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= 0.4.5])
         CHECK_FOR_MONO_STUFF
         c_examples=yes
         csharp_examples=yes
@@ -165,6 +181,8 @@
 echo ""
 echo "                   prefix:   ${prefix}"
 echo ""
+echo "         Build Unit Tests:   ${have_tests}"
+echo ""
 echo "         Build C Examples:   ${c_examples}"
 echo ""
 echo "        Build C# Examples:   ${csharp_examples}"

