1#! /bin/sh 2# 3# Copyright (c) 1989 Jan-Simon Pendry 4# Copyright (c) 1989 Imperial College of Science, Technology & Medicine 5# Copyright (c) 1989 The Regents of the University of California. 6# All rights reserved. 7# 8# This code is derived from software contributed to Berkeley by 9# Jan-Simon Pendry at Imperial College, London. 10# 11# %sccs.include.redist.sh% 12# 13# @(#)arch 5.3 (Berkeley) 05/12/91 14# 15# $Id: arch,v 5.2.1.4 91/05/07 22:20:31 jsp Alpha $ 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 dgux) MACH="`uname -m`" 49 case "$MACH" in 50 AViiON) echo aviion; exit 0;; 51 esac 52 ;; 53 *) MACH="`uname -m`" 54 case "$MACH" in 55 IP6) echo mips; exit 0;; 56 *) ;; 57 esac 58 ;; 59 esac 60fi 61 62# 63# Take a pot-shot at your machine architecture 64# 65echo "# ... No ARCH= option specified; dynamically determining architecture" >&2 66 67case "`exec 2>/dev/null; head -2 /etc/motd`" in 68*"HP-UX"*) ARCH=hp9000;; 69*"Iris"*) ARCH=iris4d;; 70*"Ultrix"*) ARCH=vax;; 71*"RISC iX"*) ARCH=arm;; 72*"Umax 4.2"*) ARCH=encore;; 73*"Alliant Concentrix"*) ARCH=alliant;; 74*"FPS Model 500"*) ARCH=fps500;; 75*"HCX/UX"*) ARCH=harris;; 76*) ARCH=unknown; 77 if [ -d /usr/include/caif ]; then 78 ARCH=ibm032 79 elif [ -f /bin/pyr ]; then 80 if /bin/pyr; then 81 ARCH=pyr 82 fi 83 elif [ -d /NextApps ]; then 84 ARCH=next 85 elif [ -f /etc/comply ]; then 86 # Tex 4300 is essentially a sun 3. 87 ARCH=sun3 88 fi 89 ;; 90esac 91 92echo "# ... architecture appears to be \"${ARCH}\"" >&2 93echo $ARCH 94 95case "$ARCH" in 96unknown) exit 1 97esac 98 99exit 0 100