Issue #15819: use standard autoconf preset output variables.

Reported by: Roumen Petrov
diff --git a/configure.ac b/configure.ac
index 116e03e..f2951a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -830,10 +830,8 @@
 	SVNVERSION="echo Unversioned directory"
 fi
 
-BUILDDIR="`pwd`"
-AC_SUBST(BUILDDIR)
 AC_SUBST(BASECPPFLAGS)
-if test "$srcdir" != "." -a "$srcdir" != "$BUILDDIR"; then
+if test "$abs_srcdir" != "$abs_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