[Distutils] (final?) automake related questions
Wed, 7 Apr 1999 14:34:14 -0400
Quoth Andrew Dalke, on 07 April 1999:
> Here are the names for which I am uncertain:
> o PYTHON_SITE
> This is the value
> sys.prefix + "/python" + sys.version[:3] + "/site-packages"
> o PYTHON_SITE_EXEC
> This is the value
> sys.exec_prefix + "/python" + sys.version[:3] + "/site-packages"
In the Distutils 'install' command (probably the part that's most
analogous to what you're doing), I called these
I don't claim Automake and Distutils should use identical terms, but we
should settle on one or the other of "exec" and "plat". I like exec
because most (all?) of the Python stuff under exec_prefix isn't
executable, but it is platform-specific (shared objects for the most
part). Also, I like having "lib" in the name just to be explicit about
what's getting installed there. (You might have a different
installation directory for scripts.)
So I think I would rename your PYTHON_SITE and PYTHON_SITE_EXEC to
PYTHON_SITE_LIB and PYTHON_SITE_PLATLIB, give or take a few
underscores. And I think you would rename my install_site_lib and
install_site_platlib to install_site and install_site_exec.
I notice that both schemes have no notion of /usr/local/lib/site-python
-- this is a feature, right? (Ie. has that directory been replaced by
/usr/local/lib/python1.5/site-packages? or does it still live on?)
> o PYTHON_SITE_PACKAGE
> automake defines the variable PACKAGE, which I am taking also
> as the module name (nothing unusual about that, I hope).
Umm, are you talking about "package" in the Python sense of a special
directory full of modules, or in the general sense of a discrete chunk
of software to distribute? (The latter is called a "distribution" in
the Distutils lexicon, because of the conflict. This seems to be common
usage in the Perl world as well, since there's also an existing meaning
for "package" over there.)
Anyways, whichever it is, it's not necessarily the same as the "module
name". Both packages (Python meaning) and packages (general meaning)
may have many modules! In Distutils, the Python package may be implied
by the layout of files in the source distribution, or explicitly
specified in setup.py. The name of the distribution must be specified
> *** question 3: Can distutils provide this sort of service?
I assume you mean the one-line compilation business. I would argue
against Distutils providing a one-line compiler for use in Makefiles: if
you have Distutils, you don't *need* a Makefile! (At least not for your
> Here's the list of other definitions created by configure.in.
> I cannot see how there's any real problem with these names, but
> who knows ....
> pythondir = sys.prefix + "/python" + sys.version[:3]
Again, my inclination would be to make explicit the fact that this is
the library directory, eg. "pythonlibdir".
P.S. Regarding your snippet of Perl:
> (It really is the documentation. The code is:
> "\$(PYTHON) \$(PYTHON_COMPILE_CMD)");
> "\$(PYTHON) -O \$(PYTHON_COMPILE_CMD)")
You can singly-quote those strings, and thus not have to escape the
dollar signs. I tend to reserve double-quotes for when I need them,
ie. when I actually want to interpolate Perl variables into a string.
Greg Ward - software developer firstname.lastname@example.org
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-262-5376
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913