[Python-Dev] PEP 229: setup.py revised

Guido van Rossum guido@python.org
Fri, 12 Jan 2001 08:51:51 -0500


> >Good work -- but I still can't run this inside a platform-specific
> >subdirectory.  Are you planning on supporting this?
> 
> I didn't really understand this when you pointed it out, but forgot to
> ask for clarification.  What does your directory layout look like?

Ah.  It's very simple.  I create a directory "linux" as a subdirectory
of the Python source tree (i.e. at the same level as Lib, Objects,
etc.).  Then I chdir into that directory, and I say "../configure".
The configure script creates subdirectories to hold the object files
for me: Grammar, Parser, Objects, Python, Modules, and sticks
Makefiles in them.  The "srcdir" variable in the Makefiles is set to
"..".  Then I say "make" and it builds Python.  The source directories
are used but no files are created or modified there: all files are
created in the "linux" directory.  This lets me have several separate
configurations: the feature used to be intended for sharing a source
tree between multiple platforms, but now I use it to have threaded,
nonthreaded, debugging, and regular builds under a single source tree.

This also works where the build directory is completely outside the
source tree (some people apparently mount the source tree read-only).

--Guido van Rossum (home page: http://www.python.org/~guido/)