diff --git a/configure.in b/configure.in
index b053c74..1406cfb 100644
--- a/configure.in
+++ b/configure.in
@@ -514,7 +514,11 @@ fi
 AC_SUBST(EXTRA_LIBS)
 AC_SUBST(EXTRA_INCLUDES)
 
-PKG_CHECK_MODULES(CUTTER, cutter) 
+dnl Check for unit test
+cutter_exists=no
+PKG_CHECK_MODULES(CUTTER, cutter,
+		  [cutter_exists=yes], [cutter_exists=no])
+AM_CONDITIONAL([HAVE_CUTTER], [test "x$cutter_exists" = "xyes"])
 
 dnl ******************
 dnl * Config defaults
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 73e2fcc..472feb2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -7,6 +7,7 @@ AM_CFLAGS = $(GOFFICE_CFLAGS)
 pie_demo_LDADD = $(GOFFICE_PLUGIN_LIBADD)
 pie_demo_SOURCES = pie-demo.c
 
+if HAVE_CUTTER
 INCLUDES = $(CUTTER_CFLAGS)
 
 noinst_LTLIBRARIES = 			\
@@ -18,7 +19,7 @@ test_regex_with_cutter_la_LDFLAGS =			\
 				-rpath $(libdir)	\
 				-module			\
 				-avoid-version
+endif
 
 test_regex_with_gtester_LDADD = $(top_builddir)/goffice/libgoffice-@GOFFICE_API_VER@.la
 test_regex_with_gtester_SOURCES = test-regex-with-gtester.c
-
