File: tarch

package info (click to toggle)
mpich 1.1.0-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 22,116 kB
  • ctags: 27,349
  • sloc: ansic: 193,435; sh: 11,172; fortran: 6,545; makefile: 5,801; cpp: 5,020; tcl: 3,548; asm: 3,536; csh: 1,079; java: 614; perl: 183; awk: 168; sed: 70; f90: 62
file content (99 lines) | stat: -rwxr-xr-x 2,520 bytes parent folder | download | duplicates (4)
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
#! /bin/sh
# set -x
#
#  Returns the arch of the machine
#
# First, try some special cases:
if [ -d "/dev/elan" ] ; then
  FARCH="meiko"
elif [ -f /usr/bin/uxpm ] && /usr/bin/uxpm ; then
  FARCH="UXPM"
elif [ -f /usr/bin/uxpv ] && /usr/bin/uxpv ; then
  FARCH="uxpv"
fi
if [ -n "$FARCH" ] ; then
    echo $FARCH
    exit 0
fi
#
# Try to find uname
for dir in /bin /usr/bin /usr/local/bin ; do
    if [ -x $dir/uname ] ; then
	UNAME="$dir/uname"
        break
    fi
done
#
# Get uname -s, uname -m, and arch values
#
if [ -n "$UNAME" ] ; then
    ARCHLIST="`uname -s`"
    ARCHLIST="$ARCHLIST `uname -m`"
fi
#
# Get ARCH variable name
if [ -n "$ARCH" ] ; then
    ARCHLIST="$ARCHLIST $ARCH"
fi
#
# Get arch command
if [ -x /bin/arch ] ; then
    ARCHLIST="$ARCHLIST `/bin/arch`"
elif [ -x /usr/local/bin/arch ] ; then
    ARCHLIST="$ARCHLIST `/usr/local/bin/arch`"
fi
#
# GARCH is a guess if we don't find something better
GARCH=
# Now, weed through all of these values until we find something useful.
for LARCH in $ARCHLIST ; do
   # Remove blanks
   LARCH=`echo $LARCH | sed 's/ //g'`
   # Get the first 4 characters (you'd be surprised)
   #   LARCH4=`expr "$LARCH" : "\(....\)"`
   #   LARCH6=`expr "$LARCH" : "\(......\)"`
   case $LARCH in
	AIX|RIOS) FARCH=rs6000; break ;;
	HP-UX) FARCH=hpux ; break ;;
	IRIX64|IRIX) FARCH=$LARCH ; break ;;
	Linux)  FARCH=LINUX ; break ;;
	i586|i486|i86pc)
	    GARCH=$LARCH ;;
	sun4*)
	Version=`$UNAME -r`
        # In "improving" SunOS, the useful feature of "substr" was withdrawn 
        # from expr.  Can't let the users have life too easy, can we?  This 
        # means that we can't just use 
        #   set MajorVersion = `expr substr $Version 1 1`
        # because it won't work on Solaris systems.  The following should work
        # on both:
        MajorVersion=`expr "$Version" : "\(.\)"`
        if [ "$MajorVersion" -ge 5 ] ; then
            FARCH=solaris
	else
	    FARCH=sun4
	fi
	break ;;
	hp9000*|hp7000*) FARCH=hpux ; break ;;
	mips|dec-5000)   FARCH=dec5000 ; break ;;
        IP12|iris-4d)    GARCH=IRIX ;;
        cray|CRAY*)      GARCH=CRAY ;;
        next)            FARCH=NeXT ; break ;;	
	KSR1|KSR2)       FARCH=ksr ; break ;;	
        FreeBSD)         FARCH=freebsd ; break ;;
	i386)            GARCH=ipsc2 ;;
	ULTRIX|RISC)     GARCH=dec5000 ;;
   esac
   LLARCH=$LARCH
done
if [ -z "$FARCH" ] ; then
    FARCH=$GARCH
    if [ -z "$FARCH" ] ; then
	FARCH=$LLARCH
    fi
    if [ -z "$FARCH" ] ; then
	FARCH=unknown
    fi
fi
echo $FARCH
exit 0