I thought so too but it turns out that 'arch' is not enough. E.g. for
SGI, 'arch' returns 'sgi', but for many reasons you need different
subdirectories for IRIX 4 and IRIX 5. Similar for the 'sun4'
architecture (Sparc) where SunOS 4.x and Solaris 2.x are vastly
different. Part of this is an incompatible .o file format; another
problem is that many OS dependent constants (e.g. the file IN.py,
derived from <netinet/in.h>) have different values.
I could be tempted to use just the OS name+version, making
subdirectories irix4, irix5, sunos4, solaris2 (or sunos5? That's what
"uname -a" says), but some OS'es (e.g. NextStep) are supported for
multiple architectures...
It would still be a single path component for $PYTHONPATH, just
more structured, e.g. .../lib/python/sparc-sunos-5 or
.../lib/python/mips-irix-5. In general the minor OS version doesn't
make a difference here (that's why it's a minor version :-).
Assuming uname exists (the configure script can figure that out), this
can be computed as follows:
PROCESSOR=`uname -p`
SYSTEM=`uname -s | tr '[A-Z]' '[a-z]'`
RELEASE=`uname -r | sed 's/\..*//'`
SUBDIRNAME=$PROCESSOR-$SYSTEM-$RELEASE
--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
<URL:http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>