forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nsarch
executable file
·138 lines (122 loc) · 3.83 KB
/
nsarch
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
#!/bin/sh
# The contents of this file are subject to the Netscape 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 http://www.mozilla.org/NPL/
#
# 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 Netscape Mailstone utility,
# released March 17, 2000.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1999-2000 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Dan Christian <[email protected]>
# Marcel DePaolis <[email protected]>
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU Public License (the "GPL"), in which case the
# provisions of the GPL are applicable instead of those above.
# If you wish to allow use of your version of this file only
# under the terms of the GPL and not to allow others to use your
# version of this file under the NPL, indicate your decision by
# deleting the provisions above and replace them with the notice
# and other provisions required by the GPL. If you do not delete
# the provisions above, a recipient may use your version of this
# file under either the NPL or the GPL.
#####################################################
# Figure out standard system names
UNAME_REPORTS=`uname`
UNAME_OS_ARCH=`uname -s`
UNAME_OS_RELEASE=`uname -r`
OS_ARCH=$UNAME_OS_ARCH
OS_RELEASE=$UNAME_OS_RELEASE
OS_CONFIG=${OS_ARCH}${OS_RELEASE}
if [ "$UNAME_OS_ARCH" = "SunOS" ]; then
PROCESSOR=`uname -p`
if [ "$PROCESSOR" = "i386" ]; then
BUILD_ARCH=x86
else
BUILD_ARCH=SPARC
fi
BUILD_OS=SOLARIS
if [ "$UNAME_OS_RELEASE" = "5.5" ]; then
BUILD_VER=2.5
elif [ "$UNAME_OS_RELEASE" = "5.5.1" ]; then
BUILD_VER=2.5
elif [ "$UNAME_OS_RELEASE" = "5.6" ]; then
BUILD_VER=2.6
elif [ "$UNAME_OS_RELEASE" = "5.7" ]; then
BUILD_VER=7
elif [ "$UNAME_OS_RELEASE" = "5.8" ]; then
BUILD_VER=8
fi
elif [ "$UNAME_OS_ARCH" = "HP-UX" ]; then
BUILD_ARCH=HPPA
BUILD_OS=$UNAME_OS_ARCH
BUILD_VER=$OS_RELEASE
elif [ "$UNAME_OS_ARCH" = "AIX" ]; then
BUILD_ARCH=POWER
BUILD_OS=$UNAME_OS_ARCH
BUILD_VER=`uname -v`.`uname -r`
OS_CONFIG=${BUILD_OS}${BUILD_VER}
elif [ "$UNAME_OS_ARCH" = "OSF1" ]; then
BUILD_ARCH=ALPHA
BUILD_OS=$UNAME_OS_ARCH
BUILD_VER=$OS_RELEASE
elif [ "$UNAME_OS_ARCH" = "IRIX64" -o "$UNAME_OS_ARCH" = "IRIX" ]; then
BUILD_ARCH=MIPS
BUILD_OS=IRIX
BUILD_VER=$OS_RELEASE
OS_CONFIG=${BUILD_OS}${OS_RELEASE}
elif [ "$UNAME_OS_ARCH" = "BSD/386" ]; then
BUILD_ARCH=x86
BUILD_OS=BSDI
BUILD_VER=$OS_RELEASE
elif [ "$UNAME_OS_ARCH" = "SCO_SV" ]; then
BUILD_ARCH=x86
BUILD_OS=SCO
BUILD_VER=$OS_RELEASE
elif [ "$UNAME_OS_ARCH" = "UNIX_SV" ]; then
# Check for braindamage
grep NCR /etc/bcheckrc > /dev/null 2>&1
BUILD_ARCH=x86
if [ $? = 0 ]; then
BUILD_OS=NCR
else
BUILD_OS=UNIXWARE
fi
BUILD_VER=$OS_RELEASE
elif [ "$UNAME_OS_ARCH" = "NEWS-OS" ]; then
BUILD_ARCH=`uname -p`
BUILD_OS=SONY
BUILD_VER=$OS_RELEASE
elif [ "$UNAME_OS_ARCH" = "UNIX_System_V" ]; then
BUILD_ARCH=`uname -p`
BUILD_OS=NEC
BUILD_VER=$OS_RELEASE
elif [ $UNAME_OS_ARCH = Linux ]; then
BUILD_ARCH=`uname -m`
if [ -n "`echo $BUILD_ARCH | grep -e '86$'`" ] ; then
BUILD_ARCH=x86
fi
BUILD_OS=$UNAME_OS_ARCH
BUILD_VER=`echo $OS_RELEASE | cut -f1,2 -d.`
OS_CONFIG=${BUILD_OS}${BUILD_VER}_${BUILD_ARCH}
fi
case "$UNAME_OS_ARCH" in
SINIX*|ReliantUNIX*)
BUILD_ARCH=`uname -p`
BUILD_OS="ReliantUNIX"
BUILD_VER=$OS_RELEASE
;;
esac
#PLATFORM=${BUILD_ARCH}_${BUILD_OS}_${BUILD_VER}
#echo $PLATFORM
echo $OS_CONFIG