1#! /bin/sh 2# 3# $Id: arch,v 5.2 90/06/23 22:21:22 jsp Rel $ 4# 5# Copyright (c) 1989 Jan-Simon Pendry 6# Copyright (c) 1989 Imperial College of Science, Technology & Medicine 7# Copyright (c) 1989 The Regents of the University of California. 8# All rights reserved. 9# 10# This code is derived from software contributed to Berkeley by 11# Jan-Simon Pendry at Imperial College, London. 12# 13# %sccs.include.redist.sh% 14# 15# @(#)arch 5.1 (Berkeley) 06/29/90 16# 17# Figure out machine architecture 18# 19 20PATH=/bin:/usr/bin:/usr/ucb:/etc:/usr/local/bin:${PATH} export PATH 21 22# 23# First try to find a standard command 24# 25a=arch # Sun compat 26m=machine # BSD compat 27u=uname # Sys5 compat 28 29if [ -f /etc/$a -o -f /bin/$a -o -f /usr/bin/$a -o -f /usr/local/bin/$a ] 30then 31 exec $a 32elif [ -f /etc/$m -o -f /bin/$m -o -f /usr/bin/$m -o -f /usr/ucb/$m -o -f /usr/local/bin/$m ] 33then 34 exec $m 35elif [ -f /etc/$u -o -f /bin/$u -o -f /usr/bin/$u -o -f /usr/local/bin/$u ] 36then 37 ARCH="`uname`" 38 case "$ARCH" in 39 "HP-UX") echo hp9000; exit 0;; 40 AIX*) MACH="`uname -m`" 41 case "$MACH" in 42 00*) echo ibm6000; exit 0;; 43 10*) echo ibm032; exit 0;; 44 20*) echo ibm032; exit 0;; 45 esac 46 ;; 47 A/UX) echo macII ; exit 0 ;; 48 *) ;; 49 esac 50fi 51 52# 53# Take a pot-shot at your machine architecture 54# 55echo " ... No ARCH= option specified; dynamically determining architecture" >&2 56 57case "`exec 2>/dev/null; head -2 /etc/motd`" in 58*"HP-UX"*) ARCH=hp9000;; 59*"Ultrix"*) ARCH=vax;; 60*"RISC iX"*) ARCH=arm;; 61*"Umax 4.2"*) ARCH=encore;; 62*"Alliant Concentrix"*) ARCH=alliant;; 63*"FPS Model 500"*) ARCH=fps500;; 64*) ARCH=unknown; 65 if [ -d /usr/include/caif ]; then 66 ARCH=ibm032 67 elif [ -f /bin/pyr ]; then 68 if /bin/pyr; then 69 echo pyr; exit 0 70 fi 71 fi 72 ;; 73fi 74 75esac 76 77echo " ... architecture appears to be \"${ARCH}\"" >&2 78echo $ARCH 79 80case "$ARCH" in 81unknown) exit 1 82esac 83 84exit 0 85