]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #15819: additional fixes for out-of-tree builds from read-only src.
authorTrent Nelson <trent@trent.me>
Tue, 16 Oct 2012 13:42:45 +0000 (09:42 -0400)
committerTrent Nelson <trent@trent.me>
Tue, 16 Oct 2012 13:42:45 +0000 (09:42 -0400)
Unlike 3.2, 3.3 and 3.x, which add "-IObjects -IPython -IInclude" to
BASECPPFLAGS when building out-of-tree, 2.7 only needs to add -IInclude
(for Python-ast.h and graminit.h).

Makefile.pre.in
configure
configure.ac

index 2bb68447ad2c8125b045afe34298f93c7b25da53..91b2b5aebfe75b3e3a5710292e588e148fda3d98 100644 (file)
@@ -27,6 +27,7 @@ MODLIBS=        _MODLIBS_
 VERSION=       @VERSION@
 srcdir=                @srcdir@
 VPATH=         @srcdir@
+BUILDDIR=      @BUILDDIR@
 
 CC=            @CC@
 CXX=           @CXX@
index bced44196c30756c8853bad6c477e39f2342eb4d..f2304f6db70574336c2d4811c43bc19cd5dd41d7 100755 (executable)
--- 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
+
 
 
 
index ec7538c1970705e35405bfa2cea0dab482fec883..094e5a4b2cd74c30ac098498791799897af368c6 100644 (file)
@@ -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)