author  wenzelm 
Fri, 16 Apr 2010 10:52:10 +0200  
changeset 36162  0bd034a80a9a 
parent 29145  b1c6f4563df7 
child 36201  07d4f74abd12 
permissions  rwxrxrx 
16994
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

1 
#!/usr/bin/env bash 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

2 
# 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

3 
# polymlplatform  determine Poly/ML's idea of current hardware and 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

4 
# operating system type 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

5 
# 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

6 
# NOTE: platform identifiers should be kept as generic as possible, 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

7 
# i.e. shared by compatible environments. 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

8 

a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

9 
PLATFORM="unknownplatform" 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

10 

a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

11 
case $(uname s) in 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

12 
SunOS) 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

13 
case $(uname r) in 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

14 
5.*) 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

15 
case $(uname p) in 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

16 
sparc) 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

17 
PLATFORM=sparcsolaris 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

18 
;; 
24474  19 
i?86) 
20 
PLATFORM=x86solaris 

21 
;; 

16994
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

22 
esac 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

23 
;; 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

24 
esac 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

25 
;; 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

26 
Linux) 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

27 
case $(uname m) in 
25348  28 
i?86  x86_64) 
16994
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

29 
PLATFORM=x86linux 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

30 
;; 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

31 
Power*  power*  ppc) 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

32 
PLATFORM=ppclinux 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

33 
;; 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

34 
esac 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

35 
;; 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

36 
FreeBSDNetBSD) 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

37 
case $(uname m) in 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

38 
i?86) 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

39 
PLATFORM=x86bsd 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

40 
;; 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

41 
esac 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

42 
;; 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

43 
Darwin) 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

44 
case $(uname m) in 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

45 
Power*  power*  ppc) 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

46 
PLATFORM=ppcdarwin 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

47 
;; 
20991  48 
i?86) 
49 
PLATFORM=x86darwin 

50 
;; 

16994
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

51 
esac 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

52 
;; 
21279  53 
CYGWIN_NT*) 
54 
case $(uname m) in 

55 
i?86) 

56 
PLATFORM=x86cygwin 

57 
;; 

58 
esac 

59 
;; 

16994
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

60 
Windows_NT) 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

61 
case $(uname m) in 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

62 
?86) 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

63 
PLATFORM=x86win32 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

64 
;; 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

65 
esac 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

66 
;; 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

67 
esac 
a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

68 

a69d0496a724
determine Poly/ML's idea of current hardware and operating system type;
wenzelm
parents:
diff
changeset

69 
echo "$PLATFORM" 