Merge issue #15819: tweak logic in previous commit.
diff --git a/configure b/configure
index 843b141..a619bb3 100755
--- a/configure
+++ b/configure
@@ -2724,7 +2724,7 @@
 BUILDDIR="`pwd`"
 
 
-if test "$srcdir" != "$BUILDDIR"; then
+if test "$srcdir" != "." -a "$srcdir" != "$BUILDDIR"; then
     # If we're building out-of-tree, we need to make sure the following
     # resources get picked up before their $srcdir counterparts.
     #   Objects/ -> typeslots.inc
diff --git a/configure.ac b/configure.ac
index 0633a97..04413e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,7 +12,7 @@
 BUILDDIR="`pwd`"
 AC_SUBST(BUILDDIR)
 AC_SUBST(BASECPPFLAGS)
-if test "$srcdir" != "$BUILDDIR"; then
+if test "$srcdir" != "." -a "$srcdir" != "$BUILDDIR"; then
     # If we're building out-of-tree, we need to make sure the following
     # resources get picked up before their $srcdir counterparts.
     #   Objects/ -> typeslots.inc