File: arch.dist

package info (click to toggle)
gridengine 6.2-4
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 51,532 kB
  • ctags: 51,172
  • sloc: ansic: 418,155; java: 37,080; sh: 22,593; jsp: 7,699; makefile: 5,292; csh: 4,244; xml: 2,901; cpp: 2,086; perl: 1,895; tcl: 1,188; lisp: 669; ruby: 642; yacc: 393; lex: 266
file content (416 lines) | stat: -rwxr-xr-x 9,308 bytes parent folder | download
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
#!/bin/sh
#
#  arch
#
#___INFO__MARK_BEGIN__
##########################################################################
#
#  The Contents of this file are made available subject to the terms of
#  the Sun Industry Standards Source License Version 1.2
#
#  Sun Microsystems Inc., March, 2001
#
#
#  Sun Industry Standards Source License Version 1.2
#  =================================================
#  The contents of this file are subject to the Sun Industry Standards
#  Source License Version 1.2 (the "License"); You may not use this file
#  except in compliance with the License. You may obtain a copy of the
#  License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
#
#  Software provided under this License is provided on an "AS IS" basis,
#  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
#  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
#  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
#  See the License for the specific provisions governing your rights and
#  obligations concerning the Software.
#
#  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
#  Copyright: 2001 by Sun Microsystems, Inc.
#
#  All Rights Reserved.
#
##########################################################################
#___INFO__MARK_END__
#
#  The original idea of "aimk" where this script is based on came from the
#  PVM 3.x distribution, 22 Jul 1991 Robert Manchek manchek@CS.UTK.EDU. 
#
#  call:   arch       (print SGEEE architecture string)
#          arch -m    (print default MANPATH of system)
#          arch -mt   (print either "man" or "catman")
#          arch -lib  (print name of variable to extend shared library path)

# On some architectures, it is necessary to run the manpath(1) command
# with the user's path instead of our "safe" one.  Thus we need to
# save the old value of PATH for later restoration.
#
SAFE_PATH=/bin:/usr/bin:/usr/sbin
OLD_PATH=$PATH
PATH=$SAFE_PATH

ARCH=UNKNOWN

if [ -x /bin/uname ]; then
   UNAME=/bin/uname
elif [ -x /usr/bin/uname ]; then
   UNAME=/usr/bin/uname
else
   echo ERROR: \"uname\" command not found
   exit 1
fi

ossysname="`$UNAME -s`"
osmachine="`$UNAME -m`"
osrelease="`$UNAME -r`"

case $ossysname in
AIX)
   osversion=`$UNAME -v`
   case $osversion in
   3)
      ARCH=UNSUPPORTED-rs6000
      ;;
   4)
      case $osrelease in
      1)
         ARCH=UNSUPPORTED-aix41
         ;;
      2)
         ARCH=UNSUPPORTED-aix42
         ;;
      3)
         ARCH=aix43
         ;;
      esac
      ;;
   5)
      case $osrelease in
      1)
         ARCH=aix51
         ;;
      *)
         ARCH=UNSUPPORTED-aix-5-$osrelease
         ;;
      esac
      ;;
   esac
   ;;
CRSOS)
   if [ $osmachine = smp ]; then
      ARCH=craysmp
   fi
   ;;
Darwin)
   case $osmachine in
      i386)
         darwin_machine=x86
         ;;
      Power*)
         darwin_machine=ppc
         ;;
      *)
         darwin_machine=unsupported
         ;;
   esac
   ARCH=darwin-$darwin_machine
   ;;
FreeBSD|DragonFly)
   ARCH=fbsd-$osmachine
   ;;
NetBSD)
    osprocessor="`$UNAME -p`"
    ARCH=nbsd-$osprocessor
    ;;
IRIX*)
   case $osrelease in
   4*)
      ARCH=UNSUPPORTED-irix4
      ;;
   5*)
      ARCH=UNSUPPORTED-irix5
      ;;
   6.5)
      ARCH=irix65
      ;;
   6.*)
      ARCH=UNSUPPORTED-irix-$osrelease
      ;;
   esac
   ;;
HP-UX)
   case $osmachine in
   ia64)
      ARCH=hp11
      ;;
   9000/*)
      case $osrelease in
      *.09.*)
         ARCH=UNSUPPORTED-hp
         ;;
      *.10.10)
         ARCH=UNSUPPORTED-hp1010
         ;;
      *.10.*)
         ARCH=hp10
         ;;
      *.11.*)
      if [ -x /usr/bin/getconf ]; then
         bits="`/usr/bin/getconf KERNEL_BITS`"
         if [ $bits -eq 64 ]; then
            ARCH=hp11-64
         else
            ARCH=hp11
         fi
      else
         ARCH=hp11
      fi
      ;;
      esac
   esac
   ;;
Linux)
   unsupported=""

   case $osmachine in
   i*86)
      lxmachine=x86
      ;;
   alpha)
      lxmachine=alpha
      ;;
   sparc)
      lxmachine=sparc
      ;;
   sparc64)
      lxmachine=sparc
      ;;
   x86_64)
      lxmachine=amd64
      ;;
   ia64)
      lxmachine=ia64
      ;;
   ppc*)
      lxmachine=ppc
      ;;
   *)
      unsupported="UNSUPPORTED-"
      lxmachine=$osmachine
   esac

   case $osrelease in
   2.[46].*)
      # retrieve os release. We use 2.4 on kernel 2.6 machines, unless
      # we have binaries installed that have been built for 2.6
      case $osrelease in
      2.4.*) 
         lxrelease=24
         ;;
      2.6.*) 
         ROOT_DIR=`dirname $0`/..
         if [ "$SGE_ROOT" != "" -a -d "$SGE_ROOT/bin/lx26-${lxmachine}" ] ; then
            lxrelease=26
         elif [ "$SGE_ROOT" = "" -a -d "$ROOT_DIR/bin/lx26-${lxmachine}" ] ; then
            lxrelease=26
         else
            lxrelease=24
         fi
         ;;
      esac

      # verify the GNU C lib version
      # For an alternative means to determine GNU C lib version see
      # http://www.gnu.org/software/libc/FAQ.html#s-4.9
      case $lxmachine in
      amd64)
         libc_string=`strings /lib64/libc.so.6 | grep "GNU C Library"`
         ;;
      ia64)
         libc_string=`strings /lib/libc.so.6.1 | grep "GNU C Library"`
         ;;
      *)
         libc_string=`strings /lib/libc.so.6 | grep "GNU C Library"`
         ;;
      esac

      # retrieving libc version failed
      if [ $? -ne 0 ]; then
         unsupported="UNSUPPORTED-"
         lxrelease="${lxrelease}-GLIBC"
      else
         libc_version=`echo $libc_string | tr ' ,' '\n' | grep "2\." | cut -f 2 -d "."`
         if [ $libc_version -lt 2 ]; then
            unsupported="UNSUPPORTED-"
            lxrelease=24-GLIBC-2.${libc_version}
         else
            if [ $libc_version -eq 2 ]; then
               unsupported="u"
            fi
         fi
      fi
      ;;
   *)
      unsupported="UNSUPPORTED-"
      lxrelease=$osrelease
   esac
   ARCH=${unsupported}lx${lxrelease}-${lxmachine}
   ;;
OSF1)
   case $osrelease in
   V4*)
      ARCH=osf4
      ;;
    V5*|T5*)
       ARCH=tru64
       ;;
    *)
       ARCH=UNSUPPORTED-osf1-$osrelease
       ;;
    esac
    ;;
SunOS)
   case $osmachine in
   sun4)
      ARCH=UNSUPPORTED-sun4
      ;;
   i86*)
      ARCH=sol-x86
      case $osrelease in
      5.[8]*)
         ARCH=usol-x86
         ;;
      5.[91]*)
         if [ `isainfo -b` = 64 ]; then
            ARCH=sol-amd64
         else
            ARCH=sol-x86
         fi
         ;;
      *)
         ARCH=UNSUPPORTED-SunOS-$osrelease
         ;;
      esac
      ;;
   *)
      case $osrelease in
      5.[7]*)
         if [ `isainfo -b` = 64 ]; then
            ARCH=usol-sparc64
         else
            ARCH=usol-sparc
         fi
         ;;
      5.[891]*)
         if [ `isainfo -b` = 64 ]; then
            ARCH=sol-sparc64
         else
            ARCH=sol-sparc
         fi
         ;;
      *)
         ARCH=UNSUPPORTED-SunOS-$osrelease
         ;;
      esac
      ;;
   esac
   ;;
SUPER-UX)
   case $osmachine in
   SX-4*)
      ARCH=UNSUPPORTED-necsx4
      ;;
   SX-[56]*)
      ARCH=sx
      ;;
   *)
      ARCH=UNSUPPORTED-SUPER-UX-$osmachine
      ;;
   esac
   ;;
Interix)
   ARCH=win32-$osmachine
   ;;
*)
   if [ -f /unicos ]; then
      if [ "`$UNAME -m`" = "CRAY TS" ]; then
         if [ `/bin/target|/bin/grep ieee` = noieee ]; then
            ARCH=crayts
         else
            ARCH=craytsieee
         fi
      else
         ARCH=cray
      fi
   else
      ARCH=UNSUPPORTED-${ossysname}-${osmachine}-${osrelease}
   fi
   ;;
esac

if [ "$1" = "-m" -o "$1" = "-mt" -o "$1" = "-lib" ]; then
   MANTYPE=man
   SHARED_LIBRARY_PATH="LD_LIBRARY_PATH"
   DEFAULTMANPATH=/usr/man
   case $ARCH in
   aix*)
      DEFAULTMANPATH=/usr/man
      SHARED_LIBRARY_PATH="LIBPATH"
      ;;
   darwin-*)
      DEFAULTMANPATH=`/usr/bin/manpath -q`
      SHARED_LIBRARY_PATH="DYLD_LIBRARY_PATH"
      ;;
   fbsd-*)
      PATH=$OLD_PATH
      DEFAULTMANPATH=`/usr/bin/manpath -q`
      PATH=$SAFE_PATH
      ;;
   nbsd-*)
      PATH=$OLD_PATH
      DEFAULTMANPATH=/usr/pkg/man:/usr/local/man:/usr/X11R6/man:/usr/share/man
      PATH=$SAFE_PATH
      ;;
   hp*)
      DEFAULTMANPATH=/usr/man:/usr/contrib/man:/usr/local/man
      SHARED_LIBRARY_PATH="SHLIB_PATH"
      ;;
   irix65)
      DEFAULTMANPATH=/usr/share/catman:/usr/share/man:/usr/catman:/usr/man
      MANTYPE=catman
      ;;
   lx*)
      if [ "`which manpath 2>/dev/null`" != "" ]; then
         DEFAULTMANPATH=`manpath 2>/dev/null`
      else
         DEFAULTMANPATH=/usr/local/man:/usr/share/man:/usr/man:/usr/X11R6/man
      fi
      ;;
   sol-*)
      DEFAULTMANPATH=/usr/share/man
      # if bit-specific variable already set, use this variable!
      SHARED_LIBRARY_PATH_BITS="LD_LIBRARY_PATH_`isainfo -b`"
      if eval [ x\$$SHARED_LIBRARY_PATH_BITS != x ]; then
	      SHARED_LIBRARY_PATH=$SHARED_LIBRARY_PATH_BITS
      fi
      ;;
   tru64)
      DEFAULTMANPATH=/usr/share/man:/usr/dt/share/man:/usr/local/man
      ;;
   win32*)
      DEFAULTMANPATH=/usr/share/man
      MANTYPE=catman/cat
      ;;
   esac

   if [ "$1" = "-m" ]; then
      echo $DEFAULTMANPATH
   elif [ "$1" = "-lib" ]; then
      echo $SHARED_LIBRARY_PATH
   else
      echo $MANTYPE
   fi
else
   echo $ARCH
fi