1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
|
#!/bin/sh
#
# $Id: pvmgetarch,v 1.14 1998/02/23 21:07:15 pvmsrc Exp $
#
# pvmgetarch.sh
#
# Generate PVM architecture string.
#
# This is a heuristic thing that may need to be tuned from time
# to time. I don't know of a real solution to determining the
# machine type.
#
# Notes:
# 1. Local people mess with things.
# 2. It's good to try a few things for robustness.
# 3. Don't use test -x
#
# 08 Apr 1993 Robert Manchek manchek@CS.UTK.EDU.
# 24 Aug 1994 last revision
# 28 Jul 1995 release 3.3.8
#
#
# begin section that may need to be tuned.
#
ARCH=UNKNOWN
#
# determine the machine type from scratch
#
if [ -f /bin/uname -o -f /usr/bin/uname \
-o -f /bin/uname.exe -o -f /usr/bin/uname.exe ]; then
if [ -f /bin/uname ]; then
os="`/bin/uname -s`"
ht="`/bin/uname -m`"
ov="`/bin/uname -v`"
elif [ -f /usr/bin/uname ]; then
os="`/usr/bin/uname -s`"
ht="`/usr/bin/uname -m`"
ov="`/usr/bin/uname -v`"
elif [ -f /bin/uname.exe ]; then
os="`/bin/uname.exe -s`"
ht="`/bin/uname.exe -m`"
ov="`/bin/uname.exe -v`"
else
os="`/usr/bin/uname.exe -s`"
ht="`/usr/bin/uname.exe -m`"
ov="`/usr/bin/uname.exe -v`"
fi
case "$os,$ht" in
SunOS,sun3* ) ARCH=SUN3 ;;
SunOS,sun4* ) ARCH=SUN4 ;;
SunOS,i86pc ) ARCH=X86SOL2 ;;
ULTRIX,RISC ) ARCH=PMAX ;;
ULTRIX,VAX ) ARCH=UVAX ;;
AIX*,* ) ARCH=RS6K ;;
*HP*,9000/[2345]* ) ARCH=HP300 ;;
*HP*,9000/[78]* ) ARCH=HPPA ;;
IRIX,* ) ARCH=SGI ;;
IRIX64,* ) ARCH=SGI64 ;;
*OSF*,alpha ) ARCH=ALPHA ;;
CRSOS,smp ) ARCH=CRAYSMP ;;
*,paragon ) ARCH=PGON ;;
dgux,AViiON ) ARCH=DGAV ;;
*,88k ) ARCH=E88K ;;
*,mips ) ARCH=MIPS ;;
*,CRAY-2 ) ARCH=CRAY2 ;;
Linux,i[3456]86 ) ARCH=LINUX ;;
Linux,m68k ) ARCH=LINUXM68K ;;
Linux,alpha ) ARCH=LINUXALPHA ;;
Linux,sparc ) ARCH=LINUXSPARC ;;
Linux,hp_pa ) ARCH=LINUXHPPA ;;
Linux,ppc ) ARCH=LINUXPPC ;;
BSD/OS,i[3456]86 ) ARCH=BSD386 ;;
FreeBSD,i386 ) ARCH=FREEBSD ;;
SUPER-UX,SX-3 ) ARCH=SX3 ;;
uts,* ) ARCH=UTS2 ;;
realix,M88* ) ARCH=M88K ;;
DomainOS,DN* ) ARCH=APOLLO ;;
OS/2,i[3456]86 ) ARCH=OS2 ;;
esac
fi
if [ "$ARCH" = UNKNOWN ]; then
if [ -f /bin/arch ]; then
case "`/bin/arch`" in
ksr1 ) ARCH=KSR1 ;;
sun2 ) ARCH=SUN2 ;;
sun3 ) ARCH=SUN3 ;;
sun4 ) ARCH=SUN4 ;;
esac
fi
fi
if [ "$ARCH" = UNKNOWN ]; then
if [ -f /usr/etc/RELDEF ]; then ARCH=ATT; fi
if [ -f /ultrixboot ]; then
if [ -f /pcs750.bin ]; then
ARCH=UVAX
else
ARCH=PMAX
fi
else
if [ -f /pcs750.bin ]; then ARCH=VAX; fi
fi
if [ -d /usr/alliant ]; then ARCH=AFX8; fi
if [ -f /usr/bin/cluster ]; then ARCH=BFLY; fi
if [ -d /usr/convex ]; then ARCH=CNVX; fi
if [ -f /unicos ]; then ARCH=CRAY; fi
if [ -f /hp-ux ]; then ARCH=HP300; fi
if [ -f /usr/bin/getcube ]; then ARCH=I860; fi
if [ -f /usr/bin/asm56000 ]; then ARCH=NEXT; fi
if [ -f /etc/vg ]; then ARCH=RS6K; fi
if [ -d /usr/include/caif ]; then ARCH=RT; fi
if [ -f /bin/4d ]; then ARCH=SGI; fi
if [ -f /dynix ]; then ARCH=SYMM; fi
if [ -f /bin/titan ]; then ARCH=TITN; fi
if [ -f /netbsd ]; then
case "`/usr/bin/machine`" in
i386) ARCH=NETBSDI386 ;;
amiga) ARCH=NETBSDAMIGA ;;
hp300) ARCH=NETBSDHP300 ;;
mac68k) ARCH=NETBSDMAC68K ;;
pmax) ARCH=NETBSDPMAX ;;
sparc) ARCH=NETBSDSPARC ;;
sun3) ARCH=NETBSDSUN3 ;;
esac
elif [ -f /usr/bin/machine ]; then
case "`/usr/bin/machine`" in
i386 ) ARCH=BSD386 ;;
esac
fi
if [ -f /usr/bin/uxpm ] && /usr/bin/uxpm ; then
ARCH=UXPM
fi
if [ -f /usr/bin/uxpv ] && /usr/bin/uxpv ; then
ARCH=UXPV
fi
fi
if [ "$ARCH" = UNKNOWN ]; then
if [ -f /bin/uname -o -f /usr/bin/uname ]; then
if [ -f /bin/uname ]; then
os="`/bin/uname -s`"
ht="`/bin/uname -m`"
rv="`/bin/uname -r`"
else
os="`/usr/bin/uname -s`"
ht="`/usr/bin/uname -m`"
rv="`/usr/bin/uname -r`"
fi
case "$os,$ht" in
*,i[3456]86 ) case "$rv" in
4.*) ARCH=UWARE ;;
*) ARCH=SCO ;;
esac
esac
fi
fi
#
# update the machine type to derive subclasses
#
if [ "$ARCH" = SUN4 ]; then
rel="`/bin/uname -r`"
case "$rel" in
5.* ) ARCH=SUN4SOL2 ;;
esac
fi
if [ "$ARCH" = SUN4SOL2 ]; then
nproc="`/bin/mpstat | wc -l`"
if [ $nproc -gt 2 -a "$PVM_SHMEM" = ON ];
then ARCH=SUNMP;
fi
fi
if [ "$ARCH" = ALPHA ]; then
rel="`/usr/bin/uname -r`"
case "$rel" in
*[34].*)
nproc="`/usr/sbin/sizer -p`"
if [ $nproc -gt 1 -a "$PVM_SHMEM" = ON ];
then ARCH=ALPHAMP;
fi ;;
esac
fi
if [ "$ARCH" = SGI ]; then
rel="`/bin/uname -r`"
case "$rel" in
5.* ) ARCH=SGI5 ;;
6.* ) ARCH=SGI6 ;;
esac
fi
if [ "$ARCH" = SGI64 ]; then
nproc="`/usr/sbin/mpadmin -n | wc -w`"
if [ $nproc -gt 1 -a "$PVM_SHMEM" = ON ];
then ARCH=SGIMP64;
fi
fi
if [ "$ARCH" = SGI5 ]; then
nproc="`/usr/sbin/mpadmin -n | wc -w`"
if [ $nproc -gt 1 -a "$PVM_SHMEM" = ON ];
then ARCH=SGIMP;
fi
fi
if [ "$ARCH" = SGI6 ]; then
nproc="`/usr/sbin/mpadmin -n | wc -w`"
if [ $nproc -gt 1 -a "$PVM_SHMEM" = ON ];
then ARCH=SGIMP6;
fi
fi
if [ "$ARCH" = SUN4 -a -f /dev/cm ]; then ARCH=CM2; fi
if [ "$ARCH" = SUN4 -a -f /dev/cmni ]; then ARCH=CM5; fi
if [ "$ARCH" = CNVX ]; then
if /usr/convex/getsysinfo -f native_default; then
ARCH=CNVXN
fi
fi
if [ "$ARCH" = PMAX -a -d /usr/maspar ]; then ARCH=MASPAR; fi
if [ "$ARCH" = RS6K ]; then
case "$os,$ov" in
AIX*,4 ) nproc="`/usr/sbin/lsdev -C -c processor | wc -l`"
if [ $nproc -gt 1 -a "$PVM_SHMEM" = ON ]; then
ARCH=AIX4MP;
else
ARCH=AIX46K;
fi ;;
esac
fi
if [ "$ARCH" = HPPA -a -f /bin/sysinfo ]; then ARCH=CSPP; fi
if [ "$ARCH" = HPPA ]; then
nproc="`/usr/bin/vmstat -n | wc -l`"
if [ $nproc -gt 8 -a "$PVM_SHMEM" = ON ];
then ARCH=HPPAMP;
fi
fi
#
# ugh, done.
#
echo $ARCH
exit
|