diff --git a/Makefile.am b/Makefile.am
index f8f836b244dbe5d597cc57f55e3bae48a9cc6dac..20f82939d6aa0e24d56b94e4bc20c71aa3a8670e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -665,7 +665,7 @@ dist_TESTS = \
 	$(python_tests)
 
 nodist_TESTS =
-if WANT_HTOOLS
+if WANT_HTOOLSTESTS
 nodist_TESTS += $(haskell_tests)
 endif
 
diff --git a/configure.ac b/configure.ac
index a10146133c921c50306e60d28935d3c4f9c7455a..1886facd72a9c3f440181b9c5ee687c8752da98e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -431,6 +431,7 @@ AC_SUBST(HTOOLS_APIDOC)
 fi # end if enable_htools, define automake conditions
 
 AM_CONDITIONAL([WANT_HTOOLS], [test x$HTOOLS = xyes])
+AM_CONDITIONAL([WANT_HTOOLSTESTS], [test x$GHC_PKG_QUICKCHECK != x])
 AM_CONDITIONAL([WANT_HTOOLSAPIDOC], [test x$HTOOLS_APIDOC = xyes])
 
 SOCAT_USE_ESCAPE=