This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ARCH
executable file
·160 lines (155 loc) · 3.52 KB
/
ARCH
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#! /bin/sh
# BEGIN LICENSE BLOCK
# Version: CMPL 1.1
#
# The contents of this file are subject to the Cisco-style Mozilla Public
# License Version 1.1 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License
# at www.eclipse-clp.org/license.
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is The ECLiPSe Constraint Logic Programming System.
# The Initial Developer of the Original Code is Cisco Systems, Inc.
# Portions created by the Initial Developer are
# Copyright (C) 1989-2006 Cisco Systems, Inc. All Rights Reserved.
#
# Contributor(s): ECRC GmbH
# Contributor(s): IC-Parc, Imperial College London
#
# END LICENSE BLOCK
#
# Used to create a unique name for current HW/OS configuration.
# This name is used to create the machine/OS dependent subdirectories
# of the ECLiPSe installation.
# IC-Parc, $Id: ARCH,v 1.7 2015/05/02 17:22:34 jschimpf Exp $
OPSYS=`(uname -s) 2>/dev/null` || OPSYS=unknown
VERSION=`(uname -r) 2>/dev/null` || VERSION=unknown
MODEL=`(uname -m) 2>/dev/null` || MODEL=unknown
case $OPSYS in
SunOS)
case $VERSION in
4.*)
if test $MODEL != sun3; then
ARCH=`arch`
else
ARCH=sun3
fi
;;
5.*)
case $MODEL in
sun4H)
ARCH=sparcV9_sunos5;;
i86pc)
case `isainfo -b` in
32)
ARCH=i386_sunos5;;
64)
# can be either, return a list
ARCH="i386_sunos5 x86_64_sunos5";;
esac;;
*)
ARCH=`uname -p`_sunos5;;
esac
;;
*) ARCH=unknown;;
esac;;
unix)
case $VERSION in
4.*) ARCH=`uname -p`_svr4;;
*) ARCH=unknown;;
esac;;
ULTRIX)
ARCH=mips_ul43;;
AIX)
VERSION=`(uname -v) 2>/dev/null` || VERSION=unknown
RELEASE=`(uname -r) 2>/dev/null` || RELEASE=unknown
case $VERSION in
3) ARCH=rs_aix32;;
4) ARCH=rs_aix41;;
*) ARCH=unknown;;
esac;;
BOSX)
ARCH=rs_bosx23;;
OSF1)
case $VERSION in
V1.3) ARCH=${MODEL}_osf13;;
V3.2) ARCH=${MODEL}_osf32;;
*) ARCH=unknown;;
esac;;
IRIX)
ARCH=sgi_irix52;;
Linux)
case $MODEL in
alpha) ARCH=alpha_linux;;
x86_64) ARCH="i386_linux x86_64_linux";;
i?86) ARCH=i386_linux;;
armv7*) ARCH=armv7_linux;;
*) ARCH=unknown;;
esac;;
HP-UX)
case $VERSION in
*A.09.*) SYS=ux90;;
*) SYS=unknown;;
esac
case $MODEL in
9000/3*) ARCH=hp300_$SYS;;
9000/4*) ARCH=hp300_$SYS;;
9000/7*) ARCH=hp700_$SYS;;
9000/8*) ARCH=hp800_$SYS;;
*) ARCH=unknown;;
esac
;;
UNIX_System_V)
case $MODEL in
m88k) ARCH=m88k_svr4;;
*) ARCH=unknown;;
esac
;;
Windows_NT)
export ARCH=i386_nt;;
CYGWIN*WOW64)
export ARCH=x86_64_nt;;
CYGWIN*)
export ARCH=i386_nt;;
Darwin)
case $MODEL in
"Power Macintosh")
MACHINE=`machine`
if test $MACHINE != ppc970; then
ARCH=ppc_macosx
else
ARCH=ppc64_macosx
fi
;;
i386)
# returned for both i386 and x86-64 running 32 bit kernel
# adapted from config.guess to determine which
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= gcc -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
ARCH=x86_64_macosx
else
ARCH=i386_macosx
fi
;;
x86_64)
# x86-64 running 64 bit kernel
ARCH=x86_64_macosx
;;
*) ARCH=unknown;;
esac
;;
unknown)
SYSARCH=`arch`
case $SYSARCH in
symmetry) ARCH=i386_dynix3;;
m68k) ARCH=next_mach;;
*) ARCH=unknown;;
esac;;
esac
echo $ARCH