6
##########################################################################
8
# The Contents of this file are made available subject to the terms of
9
# the Sun Industry Standards Source License Version 1.2
11
# Sun Microsystems Inc., March, 2001
14
# Sun Industry Standards Source License Version 1.2
15
# =================================================
16
# The contents of this file are subject to the Sun Industry Standards
17
# Source License Version 1.2 (the "License"); You may not use this file
18
# except in compliance with the License. You may obtain a copy of the
19
# License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
21
# Software provided under this License is provided on an "AS IS" basis,
22
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
23
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
24
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
25
# See the License for the specific provisions governing your rights and
26
# obligations concerning the Software.
28
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
30
# Copyright: 2001 by Sun Microsystems, Inc.
32
# All Rights Reserved.
34
##########################################################################
37
# The original idea of "aimk" where this script is based on came from the
38
# PVM 3.x distribution, 22 Jul 1991 Robert Manchek manchek@CS.UTK.EDU.
40
# call: arch (print SGEEE architecture string)
41
# arch -m (print default MANPATH of system)
42
# arch -mt (print either "man" or "catman")
43
# arch -lib (print name of variable to extend shared library path)
45
# On some architectures, it is necessary to run the manpath(1) command
46
# with the user's path instead of our "safe" one. Thus we need to
47
# save the old value of PATH for later restoration.
49
SAFE_PATH=/bin:/usr/bin:/usr/sbin
55
if [ -x /bin/uname ]; then
57
elif [ -x /usr/bin/uname ]; then
60
echo ERROR: \"uname\" command not found
64
ossysname="`$UNAME -s`"
65
osmachine="`$UNAME -m`"
66
osrelease="`$UNAME -r`"
73
ARCH=UNSUPPORTED-rs6000
78
ARCH=UNSUPPORTED-aix41
81
ARCH=UNSUPPORTED-aix42
94
ARCH=UNSUPPORTED-aix-5-$osrelease
101
if [ $osmachine = smp ]; then
114
darwin_machine=unsupported
117
ARCH=darwin-$darwin_machine
123
osprocessor="`$UNAME -p`"
124
ARCH=nbsd-$osprocessor
129
ARCH=UNSUPPORTED-irix4
132
ARCH=UNSUPPORTED-irix5
138
ARCH=UNSUPPORTED-irix-$osrelease
153
ARCH=UNSUPPORTED-hp1010
159
if [ -x /usr/bin/getconf ]; then
160
bits="`/usr/bin/getconf KERNEL_BITS`"
161
if [ $bits -eq 64 ]; then
202
unsupported="UNSUPPORTED-"
210
# verify the GNU C lib version
211
# For an alternative means to determine GNU C lib version see
212
# http://www.gnu.org/software/libc/FAQ.html#s-4.9
215
libc_string=`strings /lib64/libc.so.6 | grep "GNU C Library"`
218
libc_string=`strings /lib/libc.so.6.1 | grep "GNU C Library"`
221
libc_string=`strings /lib/libc.so.6 | grep "GNU C Library"`
225
# retrieving libc version failed
226
if [ $? -ne 0 ]; then
227
unsupported="UNSUPPORTED-"
230
libc_version=`echo $libc_string | tr ' ,' '\n' | grep "2\." | cut -f 2 -d "."`
231
if [ $libc_version -lt 2 ]; then
232
unsupported="UNSUPPORTED-"
233
lxrelease=24-GLIBC-2.${libc_version}
235
if [ $libc_version -eq 2 ]; then
245
unsupported="UNSUPPORTED-"
248
ARCH=${unsupported}lx${lxrelease}-${lxmachine}
259
ARCH=UNSUPPORTED-osf1-$osrelease
266
ARCH=UNSUPPORTED-sun4
275
if [ `isainfo -b` = 64 ]; then
282
ARCH=UNSUPPORTED-SunOS-$osrelease
289
if [ `isainfo -b` = 64 ]; then
296
if [ `isainfo -b` = 64 ]; then
303
ARCH=UNSUPPORTED-SunOS-$osrelease
312
ARCH=UNSUPPORTED-necsx4
318
ARCH=UNSUPPORTED-SUPER-UX-$osmachine
323
ARCH=win32-$osmachine
326
if [ -f /unicos ]; then
327
if [ "`$UNAME -m`" = "CRAY TS" ]; then
328
if [ `/bin/target|/bin/grep ieee` = noieee ]; then
337
ARCH=UNSUPPORTED-${ossysname}-${osmachine}-${osrelease}
342
if [ "$1" = "-m" -o "$1" = "-mt" -o "$1" = "-lib" ]; then
344
SHARED_LIBRARY_PATH="LD_LIBRARY_PATH"
345
DEFAULTMANPATH=/usr/man
348
DEFAULTMANPATH=/usr/man
349
SHARED_LIBRARY_PATH="LIBPATH"
352
DEFAULTMANPATH=`/usr/bin/manpath -q`
353
SHARED_LIBRARY_PATH="DYLD_LIBRARY_PATH"
357
DEFAULTMANPATH=`/usr/bin/manpath -q`
362
DEFAULTMANPATH=/usr/pkg/man:/usr/local/man:/usr/X11R6/man:/usr/share/man
366
DEFAULTMANPATH=/usr/man:/usr/contrib/man:/usr/local/man
367
SHARED_LIBRARY_PATH="SHLIB_PATH"
370
DEFAULTMANPATH=/usr/share/catman:/usr/share/man:/usr/catman:/usr/man
374
if [ "`which manpath 2>/dev/null`" != "" ]; then
375
DEFAULTMANPATH=`manpath 2>/dev/null`
377
DEFAULTMANPATH=/usr/local/man:/usr/share/man:/usr/man:/usr/X11R6/man
381
DEFAULTMANPATH=/usr/share/man
382
# if bit-specific variable already set, use this variable!
383
SHARED_LIBRARY_PATH_BITS="LD_LIBRARY_PATH_`isainfo -b`"
384
if eval [ x\$$SHARED_LIBRARY_PATH_BITS != x ]; then
385
SHARED_LIBRARY_PATH=$SHARED_LIBRARY_PATH_BITS
389
DEFAULTMANPATH=/usr/share/man:/usr/dt/share/man:/usr/local/man
392
DEFAULTMANPATH=/usr/share/man
397
if [ "$1" = "-m" ]; then
399
elif [ "$1" = "-lib" ]; then
400
echo $SHARED_LIBRARY_PATH