equal
deleted
inserted
replaced
|
1 #!/usr/bin/env bash |
|
2 # |
|
3 # $Id$ |
|
4 # |
|
5 # polyml-platform --- determine Poly/ML's idea of current hardware and |
|
6 # operating system type |
|
7 # |
|
8 # NOTE: platform identifiers should be kept as generic as possible, |
|
9 # i.e. shared by compatible environments. |
|
10 |
|
11 PLATFORM="unknown-platform" |
|
12 |
|
13 case $(uname -s) in |
|
14 SunOS) |
|
15 case $(uname -r) in |
|
16 5.*) |
|
17 case $(uname -p) in |
|
18 sparc) |
|
19 PLATFORM=sparc-solaris |
|
20 ;; |
|
21 esac |
|
22 ;; |
|
23 esac |
|
24 ;; |
|
25 Linux) |
|
26 case $(uname -m) in |
|
27 i?86 | x86_64) |
|
28 PLATFORM=x86-linux |
|
29 ;; |
|
30 Power* | power* | ppc) |
|
31 PLATFORM=ppc-linux |
|
32 ;; |
|
33 esac |
|
34 ;; |
|
35 FreeBSD|NetBSD) |
|
36 case $(uname -m) in |
|
37 i?86) |
|
38 PLATFORM=x86-bsd |
|
39 ;; |
|
40 esac |
|
41 ;; |
|
42 Darwin) |
|
43 case $(uname -m) in |
|
44 Power* | power* | ppc) |
|
45 PLATFORM=ppc-darwin |
|
46 ;; |
|
47 esac |
|
48 ;; |
|
49 Windows_NT) |
|
50 case $(uname -m) in |
|
51 ?86) |
|
52 PLATFORM=x86-win32 |
|
53 ;; |
|
54 esac |
|
55 ;; |
|
56 esac |
|
57 |
|
58 echo "$PLATFORM" |