diff --git a/configure b/configure
index 896b781473..a86a31fb42 100755
--- a/configure
+++ b/configure
@@ -19411,7 +19411,17 @@ fi
 #
 if test "$enable_tap_tests" = yes; then
   # Make sure we know where prove is.
+  # Prefer a prove located in the same directory as $PERL,
+  # otherwise search $PATH.
   if test -z "$PROVE"; then
+    if test -x "`dirname "$PERL"`/prove"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for prove" >&5
+$as_echo_n "checking for prove... " >&6; }
+      PROVE="`dirname "$PERL"`/prove"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROVE" >&5
+$as_echo "$PROVE" >&6; }
+    else
+      if test -z "$PROVE"; then
   for ac_prog in prove
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -19465,8 +19475,10 @@ $as_echo_n "checking for PROVE... " >&6; }
 $as_echo "$PROVE" >&6; }
 fi
 
-  if test -z "$PROVE"; then
-    as_fn_error $? "prove not found" "$LINENO" 5
+      if test -z "$PROVE"; then
+        as_fn_error $? "prove not found" "$LINENO" 5
+      fi
+    fi
   fi
   # Check for necessary Perl modules.  You might think we should use
   # AX_PROG_PERL_MODULES here, but prove might be part of a different Perl
diff --git a/configure.ac b/configure.ac
index b50130b323..98cd5ae12e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2378,9 +2378,19 @@ PGAC_PATH_PROGS(DBTOEPUB, dbtoepub)
 #
 if test "$enable_tap_tests" = yes; then
   # Make sure we know where prove is.
-  PGAC_PATH_PROGS(PROVE, prove)
+  # Prefer a prove located in the same directory as $PERL,
+  # otherwise search $PATH.
   if test -z "$PROVE"; then
-    AC_MSG_ERROR([prove not found])
+    if test -x "`dirname "$PERL"`/prove"; then
+      AC_MSG_CHECKING(for prove)
+      PROVE="`dirname "$PERL"`/prove"
+      AC_MSG_RESULT([$PROVE])
+    else
+      PGAC_PATH_PROGS(PROVE, prove)
+      if test -z "$PROVE"; then
+        AC_MSG_ERROR([prove not found])
+      fi
+    fi
   fi
   # Check for necessary Perl modules.  You might think we should use
   # AX_PROG_PERL_MODULES here, but prove might be part of a different Perl
