Re: Suggestion for new directory layout for Python lib-dir.

Martin Green (martin.a.green@HYDRO.ON.CA)
Thu, 18 Aug 1994 17:20:51 -0400

On August 18 at 11:06:15 Guido van Rossum wrote:
>
> 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.
[...]
>
> 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

'uname -p' is not valid on all systems. The following 'platform'
command works on our Sun, SGI, and HP systems, but minor adjustments
may be required for some machines:

#!/bin/sh
PATH=/usr/5bin:/bin:/usr/bin:/usr/bsd
LD_LIBRARY_PATH=/lib:/usr/lib:/usr/5lib
export PATH LD_LIBRARY_PATH
OS=`uname -s`
REL=`uname -r`
MACH=`uname -m`
[ $MACH = "IP6" -o $MACH = "IP7" ] && OS=IRIX
[ $MACH = "sun" ] && MACH=sun386
platform=${OS}-${REL}-${MACH}
platform=`echo $platform | sed -e "s#/#_#" `
echo "$platform"

Martin A. Green Net : green@rd.hydro.on.ca
Ontario Hydro Technologies Tel : (416) 207-5745
800 Kipling Ave, KR260 FAX : (416) 207-5622
Toronto, Ontario, CANADA, M8Z5S4