diff --git a/configure.ac b/configure.ac
index 2b201e4aead63a61bcc052c18fbe00625ceb946f..52587437ac64ea05a6dbf9fe6fc26b5e2dc6fa08 100644
--- a/configure.ac
+++ b/configure.ac
@@ -450,7 +450,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_HTOOLSTESTS], [test "x$GHC_PKG_QUICKCHECK" != x])
 AM_CONDITIONAL([WANT_HTOOLSAPIDOC], [test x$HTOOLS_APIDOC = xyes])
 
 SOCAT_USE_ESCAPE=