merge in new release
[unix-history] / usr / src / usr.sbin / amd / config / arch
CommitLineData
e1a31032
KM
1#! /bin/sh
2#
e1a31032
KM
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#
332f0791 13# @(#)arch 5.4 (Berkeley) %G%
8d2991d5 14#
332f0791 15# $Id: arch,v 5.2.2.1 1992/02/09 15:11:21 jsp beta $
e1a31032
KM
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 ;;
2f619045
JSP
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 ;;
e1a31032
KM
59 esac
60fi
61
62#
63# Take a pot-shot at your machine architecture
64#
2f619045 65echo "# ... No ARCH= option specified; dynamically determining architecture" >&2
e1a31032
KM
66
67case "`exec 2>/dev/null; head -2 /etc/motd`" in
68*"HP-UX"*) ARCH=hp9000;;
2f619045 69*"Iris"*) ARCH=iris4d;;
e1a31032
KM
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;;
2f619045 75*"HCX/UX"*) ARCH=harris;;
e1a31032
KM
76*) ARCH=unknown;
77 if [ -d /usr/include/caif ]; then
78 ARCH=ibm032
79 elif [ -f /bin/pyr ]; then
80 if /bin/pyr; then
2f619045 81 ARCH=pyr
e1a31032 82 fi
2f619045
JSP
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
e1a31032
KM
88 fi
89 ;;
e1a31032
KM
90esac
91
2f619045 92echo "# ... architecture appears to be \"${ARCH}\"" >&2
e1a31032
KM
93echo $ARCH
94
95case "$ARCH" in
96unknown) exit 1
97esac
98
99exit 0