-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfarch
More file actions
executable file
·130 lines (128 loc) · 2.45 KB
/
farch
File metadata and controls
executable file
·130 lines (128 loc) · 2.45 KB
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
#!/bin/csh -fb
#
# Tweaked to tell the difference between a Convex C2 and a C1. A kludge,
# but so is most of this file. DSB 25-Jan-93
# Further modified to use the arch command (if available) RGM 27-Jan-1993
#
# set verbose
set IARCH=UNKNOWN
set uname=UNKNOWN
set arch=UNKNOWN
set iarch=UNKNOWN
#
# Find where uname or arch or iarch is
#
set tdir = ( /bin /usr/bin /usr/ucb /usr/convex /usr/local/bin . )
foreach dir ($tdir)
if (-x ${dir}/uname) set uname = ${dir}/uname
if (-x ${dir}/arch) set arch = ${dir}/arch
if (-x ${dir}/IARCH) set iarch = ${dir}/IARCH
end
# echo uname = $uname
# echo arch = $arch
# echo iarch = $iarch
#
if (-x $uname) then
set os="`$uname -s`"
set ht="`$uname -m`"
set ro="`$uname -r`"
set osht="$os,$ht"
switch ("$osht")
case SunOS,sun3*:
set IARCH=SUN3
breaksw
case SunOS,sun4*:
switch ("$ro")
case 5*
set IARCH=SUN5
breaksw
case 4*
set IARCH=SUN4
breaksw
endsw
breaksw
case Darwin,*:
set IARCH=DARWIN
breaksw
case Linux,*:
set IARCH=LINUX
breaksw
case ULTRIX,RISC:
set IARCH=PMAX
breaksw
case OSF1,alpha:
set IARCH=ALPHA
breaksw
case AIX,*:
set IARCH=RIOS
breaksw
case *,9000/*:
set IARCH=HP9K
breaksw
case IRIX,*:
set IARCH=irix
breaksw
case IRIX64,*:
set IARCH=irix64
breaksw
endsw
#
# Otherwise try and use the arch command to get the machine type
# Note at CSIRO arch only exists for the convex and suns but our sysadmin
# has written 1 line shells scripts for the other machines we have
# Please add stuff here as you try new machines
#
else if (-x $arch) then
switch (`$arch`)
case c1:
set IARCH=c1
breaksw
case c2mp:
set IARCH=c2
breaksw
case sun3:
set IARCH=SUN3
breaksw
case sun4:
set IARCH=SUN4
breaksw
case dec-mips:
set IARCH=PMAX
breaksw
case ibmrs:
set IARCH=RIOS
breaksw
endsw
#
# This clause doesn't make much sense to me -- DSB (or me -- RGM)
#
else if (-x $iarch) then
switch (`$iarch`)
case sun3:
set IARCH=SUN3
breaksw
case sun4:
set IARCH=SUN4
default:
breaksw
endsw
endif
#
# A kludge for a few special machines
#
if ($IARCH == SUN4 && -e /dev/cm) set IARCH=cm2
if ($IARCH == SUN4 && -e /dev/cmni) set IARCH=cm5
if (-e /usr/bin/getcube) set IARCH=i860
#
# A last gasp attempt to guess the machine
#
if ($IARCH == UNKNOWN) then
if (-e /hp-ux) set IARCH=HP300
if (-e /etc/vg) set IARCH=RIOS
if (-e /unicos) set IARCH=cray
if (-e /usr/alliant) set IARCH=alliant
endif
#
# ugh, done.
#
echo $IARCH