changeset: 79755:e0a2b14a3cf9 branch: 2.7 parent: 79738:c1f27cf0cc9d user: Trent Nelson date: Tue Oct 16 09:42:45 2012 -0400 files: Makefile.pre.in configure configure.ac description: 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 -r c1f27cf0cc9d -r e0a2b14a3cf9 Makefile.pre.in --- a/Makefile.pre.in Tue Oct 16 13:51:26 2012 +0300 +++ b/Makefile.pre.in Tue Oct 16 09:42:45 2012 -0400 @@ -27,6 +27,7 @@ VERSION= @VERSION@ srcdir= @srcdir@ VPATH= @srcdir@ +BUILDDIR= @BUILDDIR@ CC= @CC@ CXX= @CXX@ diff -r c1f27cf0cc9d -r e0a2b14a3cf9 configure --- a/configure Tue Oct 16 13:51:26 2012 +0300 +++ b/configure Tue Oct 16 09:42:45 2012 -0400 @@ -648,6 +648,8 @@ HGBRANCH HGTAG HGVERSION +BASECPPFLAGS +BUILDDIR SVNVERSION ARFLAGS AR @@ -5175,6 +5177,22 @@ 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 -r c1f27cf0cc9d -r e0a2b14a3cf9 configure.ac --- a/configure.ac Tue Oct 16 13:51:26 2012 +0300 +++ b/configure.ac Tue Oct 16 09:42:45 2012 -0400 @@ -854,6 +854,22 @@ 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)