File: platform

package info (click to toggle)
mlton 20061107-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 27,828 kB
  • ctags: 61,118
  • sloc: ansic: 11,446; makefile: 1,339; sh: 1,160; lisp: 900; pascal: 256; asm: 97
file content (124 lines) | stat: -rwxr-xr-x 1,458 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
#!/usr/bin/env bash

set -e

name=`basename $0`
dir=`dirname $0`
bin=`cd $dir && pwd`

die () {
        echo >&2 "$1"
        exit 1
}

usage () {
        die "usage: $name"
}

case "$#" in
0)
;;
*)
        usage
;;
esac

uname=`uname`
arch_flag=-m

case "$uname" in
AIX)
        HOST_OS='aix'
        arch_flag=-p
;;
CYGWIN*)
        HOST_OS='cygwin'
;;
Darwin)
        HOST_OS='darwin'
;;
FreeBSD*)
        HOST_OS='freebsd'
;;
HP-UX)
	HOST_OS='hpux'
;;
Linux)
        HOST_OS='linux'
;;
MINGW*)
        HOST_OS='mingw'
;;
NetBSD*)
        HOST_OS='netbsd'
;;
OpenBSD*)
        HOST_OS='openbsd'
;;
SunOS)
        HOST_OS='solaris'
;;
*)
        die "Unknown OS $uname."
;;
esac

arch=`uname $arch_flag`

case "$arch" in
alpha*)
# not certain about this one; no alpha access
        HOST_ARCH=alpha
;;
x86_64*)
        HOST_ARCH=amd64
;;
i?86_64)
        HOST_ARCH=amd64
;;
arm*)
        HOST_ARCH=arm
;;
parisc*)
        HOST_ARCH=hppa
;;
9000/*)
        HOST_ARCH=hppa
;;
ia64*)
        HOST_ARCH=ia64
;;
m68k*)
        HOST_ARCH=m68k
;;
mips*)
# big-endian and little-endian detect via headers
        HOST_ARCH=mips
;;
powerpc)
        HOST_ARCH=powerpc
;;
ppc*)
        HOST_ARCH=powerpc
;;
Power*)
        HOST_ARCH=powerpc
;;
s390*)
        HOST_ARCH=s390
;;
sparc*)
        HOST_ARCH=sparc
;;
sun*)
        HOST_ARCH=sparc
;;
i?86)
        HOST_ARCH=x86
;;
*)
        die "Unknown arch $arch."
;;
esac

echo "HOST_OS=$HOST_OS HOST_ARCH=$HOST_ARCH"