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, 1993 6# The Regents of the University of California. 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 8.1 (Berkeley) 06/06/93 14# 15# $Id: arch,v 5.2.2.2 1992/05/31 16:45:35 jsp Exp $ 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 IP7) echo mips; exit 0;; 57 *) ;; 58 esac 59 ;; 60 esac 61fi 62 63# 64# Take a pot-shot at your machine architecture 65# 66echo "# ... No ARCH= option specified; dynamically determining architecture" >&2 67 68case "`exec 2>/dev/null; head -2 /etc/motd`" in 69*"HP-UX"*) ARCH=hp9000;; 70*"Iris"*) ARCH=iris4d;; 71*"Ultrix"*) ARCH=vax;; 72*"RISC iX"*) ARCH=arm;; 73*"Umax 4.2"*) ARCH=encore;; 74*"Alliant Concentrix"*) ARCH=alliant;; 75*"FPS Model 500"*) ARCH=fps500;; 76*"HCX/UX"*) ARCH=harris;; 77*) ARCH=unknown; 78 if [ -d /usr/include/caif ]; then 79 ARCH=ibm032 80 elif [ -f /bin/pyr ]; then 81 if /bin/pyr; then 82 ARCH=pyr 83 fi 84 elif [ -d /NextApps ]; then 85 ARCH=next 86 elif [ -f /etc/comply ]; then 87 # Tex 4300 is essentially a sun 3. 88 ARCH=sun3 89 fi 90 ;; 91esac 92 93echo "# ... architecture appears to be \"${ARCH}\"" >&2 94echo $ARCH 95 96case "$ARCH" in 97unknown) exit 1 98esac 99 100exit 0 101