From: Trent Nelson Date: Tue, 16 Oct 2012 13:42:45 +0000 (-0400) Subject: Issue #15819: additional fixes for out-of-tree builds from read-only src. X-Git-Tag: v2.7.4rc1~480 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d86ceecf2141e684364d31c28941c6aacfbba47a;p=thirdparty%2FPython%2Fcpython.git Issue #15819: additional fixes for out-of-tree builds from read-only src. 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). --- diff --git a/Makefile.pre.in b/Makefile.pre.in index 2bb68447ad2c..91b2b5aebfe7 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 bced44196c30..f2304f6db705 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 ec7538c19707..094e5a4b2cd7 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)