summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorTrent Nelson <trent@trent.me>2012-10-16 12:41:32 (GMT)
committerTrent Nelson <trent@trent.me>2012-10-16 12:41:32 (GMT)
commit9effe699b7858a4a654b34915bc0e2cbec0de1f3 (patch)
tree7993dee344d0cfd7d6c6c2f5067fdd3d82748f6d /configure.ac
parentee892b9226be97a159823866463fb39474f55835 (diff)
downloadcpython-9effe699b7858a4a654b34915bc0e2cbec0de1f3.zip
cpython-9effe699b7858a4a654b34915bc0e2cbec0de1f3.tar.gz
cpython-9effe699b7858a4a654b34915bc0e2cbec0de1f3.tar.bz2
Issue #15819: additional fixes for out-of-tree builds from read-only src.
Specifically, make sure the 'Object', 'Python' and 'Include' directories in the build directory take precedence over the source directory if we're an out-of-tree build. Fix typeslots.inc so that it gets generated into the build directory.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 84d723a..9222c88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -830,6 +830,24 @@ else
SVNVERSION="echo Unversioned directory"
fi
+BUILDDIR="`pwd`"
+AC_SUBST(BUILDDIR)
+AC_SUBST(BASECPPFLAGS)
+if test "$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
+ # Include/ -> Python-ast.h, graminit.h
+ # Python/ -> importlib.h
+ # (A side effect of this is that these resources will automatically be
+ # regenerated when building out-of-tree, regardless of whether or not
+ # the $srcdir counterpart is up-to-date. This is an acceptable trade
+ # off.)
+ BASECPPFLAGS="-IObjects -IInclude -IPython"
+else
+ BASECPPFLAGS=""
+fi
+
AC_SUBST(HGVERSION)
AC_SUBST(HGTAG)
AC_SUBST(HGBRANCH)