Issue #15819: use standard autoconf preset output variables.

Reported by: Roumen Petrov
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 4ff801b..9c83248 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -27,7 +27,8 @@
 VERSION=	@VERSION@
 srcdir=		@srcdir@
 VPATH=		@srcdir@
-BUILDDIR=	@BUILDDIR@
+abs_srcdir=	@abs_srcdir@
+abs_builddir=	@abs_builddir@
 
 
 CC=		@CC@
diff --git a/configure b/configure
index a619bb3..6e1825f 100755
--- a/configure
+++ b/configure
@@ -715,7 +715,6 @@
 HGTAG
 HGVERSION
 BASECPPFLAGS
-BUILDDIR
 target_alias
 host_alias
 build_alias
@@ -2721,10 +2720,8 @@
 
 
 
-BUILDDIR="`pwd`"
 
-
-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
diff --git a/configure.ac b/configure.ac
index 04413e9..4eb6c43 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,10 +9,8 @@
 
 AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/)
 
-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