summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-10-16 13:52:02 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-10-16 13:52:02 (GMT)
commitba6a6cfbbc7359a871ef090f06ffeef1fb53e092 (patch)
tree758dd05d0e28b41c9eabbca39d8a855722d21da7
parentbf67ba8f84f3e771193b44b25526d0258826052e (diff)
parentd86ceecf2141e684364d31c28941c6aacfbba47a (diff)
downloadcpython-ba6a6cfbbc7359a871ef090f06ffeef1fb53e092.zip
cpython-ba6a6cfbbc7359a871ef090f06ffeef1fb53e092.tar.gz
cpython-ba6a6cfbbc7359a871ef090f06ffeef1fb53e092.tar.bz2
merge heads
-rw-r--r--Makefile.pre.in1
-rwxr-xr-xconfigure18
-rw-r--r--configure.ac16
3 files changed, 35 insertions, 0 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 2bb6844..91b2b5a 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -27,6 +27,7 @@ MODLIBS= _MODLIBS_
VERSION= @VERSION@
srcdir= @srcdir@
VPATH= @srcdir@
+BUILDDIR= @BUILDDIR@
CC= @CC@
CXX= @CXX@
diff --git a/configure b/configure
index bced441..f2304f6 100755
--- a/configure
+++ b/configure
@@ -648,6 +648,8 @@ HAS_HG
HGBRANCH
HGTAG
HGVERSION
+BASECPPFLAGS
+BUILDDIR
SVNVERSION
ARFLAGS
AR
@@ -5175,6 +5177,22 @@ else
SVNVERSION="echo Unversioned directory"
fi
+BUILDDIR="`pwd`"
+
+
+if test "$srcdir" != "$BUILDDIR"; then
+ # If we're building out-of-tree make sure Include (in the current dir)
+ # gets picked up before its $srcdir counterpart in order for Python-ast.h
+ # and graminit.h to get picked up from the correct directory.
+ # (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="-IInclude"
+else
+ BASECPPFLAGS=""
+fi
+
diff --git a/configure.ac b/configure.ac
index ec7538c..094e5a4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -854,6 +854,22 @@ 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 make sure Include (in the current dir)
+ # gets picked up before its $srcdir counterpart in order for Python-ast.h
+ # and graminit.h to get picked up from the correct directory.
+ # (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="-IInclude"
+else
+ BASECPPFLAGS=""
+fi
+
AC_SUBST(HGVERSION)
AC_SUBST(HGTAG)
AC_SUBST(HGBRANCH)