update dev300-m58
[ooovba.git] / solenv / bin / modules / osarch.pm
blobf6b3bc9d97df7e3151f99968ae6ef7d8487f4149
1 #!/usr/bin/perl -w
3 # ***********************************************************************
4 # Description:
5 # Filename: osarch.pm
6 # Autor: EG
7 # Date: 28.10.96
8 # $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/solenv/bin/modules/osarch.pm,v 1.3 2008-08-18 13:11:04 vg Exp $
9 # Copyright: STAR DIVISION
10 # **********************************************************************/
12 package osarch;
14 $m_str = `uname -m`;
15 $s_str = `uname -s`;
16 chop( $m_str, $s_str );
18 %osTable = ("SunOS", "solaris",
19 "HP-UX", "hpux",
20 "AIX", "aix",
21 "OS/390", "s390",
22 "Linux", "linux",
23 "FreeBSD", "freebsd",
24 "NetBSD", "netbsd",
25 "OSF1", "decunix",
26 "SCO_SV", "scoosr5",
27 # "SCO_SV", "scouw21",
28 "Darwin", "macosxp",
29 "Mac OS", "macosxp",
30 "SINIX-N", "sinix",
31 "IRIX", "irix"
34 %osDefTable = ("SunOS", "-DSYSV -DSOLARIS",
35 "HP-UX", "-DSYSV -DHPUX",
36 "AIX", "-DSYSV -DAIX",
37 "Linux", "-DLINUX",
38 "FreeBSD", "-DFREEBSD",
39 "NetBSD", "-DNETBSD",
40 "OSF1", "-DSYSV -DDECUNIX",
41 "SCO_SV", "-DSYSV -DSCO -DSCO_OSR5",
42 # "SCO_SV", "-DSYSV -DSCO -DSCO_UW21",
43 "Darwin", "-DBSD -DMACOSX",
44 "Mac OS", "-DBSD -DMACOSX",
45 "SINIX-N", "-DSYSV -DSINIX",
46 "IRIX", "-DSYSV -DIRIX"
49 %osDosTable = ("SunOS", "sol",
50 "HP-UX", "hpx",
51 "AIX", "aix",
52 "OS/390", "mvs",
53 "Linux", "lng",
54 "FreeBSD", "fbsd",
55 "NetBSD", "bsd",
56 "SCO_SV", "sco",
57 "Darwin", "macx",
58 "Mac OS", "macx",
59 "SINIX-N", "sni",
60 "IRIX", "irx"
63 %archTable = ("sun4c", "sparc",
64 "sun4m", "sparc",
65 "sun4u", "sparc",
66 "9000/712", "hp9000",
67 "9000/715", "hp9000",
68 "9000/778", "hp9000",
69 "000029484600", "rs6000", # salsa
70 "000328144600", "rs6000", # lambada
71 "00245D29E000", "rs6000", # segv
72 "00245C46E000", "rs6000", # bus
73 "002012974600", "rs6000", # tango
74 "0006404C4C00", "rs6000", # jive
75 "2003", "g3", # ezopen4
76 "i86pc", "x86", # blauwal
77 "i386", "x86", # SCO_SV, NetBSD, FreeBSD
78 "i486", "x86", # tiger
79 "i586", "x86", # blauwal
80 "i686", "x86",
81 "prep", "ppc", # hooge
82 "ppc", "ppc", # ppc-linux
83 "alpha", "alpha",
84 "RM400", "rm400", # garbo
85 "IP22", "mips", # voyager
86 "IP32", "mips", # giotto
87 "Power Macintosh", "ppc", # NetBSD/arm32
88 "arm32", "arm32" # NetBSD/arm32
91 %archDefTable=("sun4c", "-DSPARC -DSUN -DSUN4", # hawai
92 "sun4m", "-DSPARC -DSUN -DSUN4", # broccoli
93 "sun4u", "-DSPARC -DSUN -DSUN4", # broccoli
94 "9000/712", "-DHP9000", # tuborg
95 "9000/715", "-DHP9000", # koepi
96 "9000/778", "-DHP9000", # jever, flens
97 "000029484600", "-DRS6000", # salsa
98 "000328144600", "-DRS6000", # lambada
99 "00245D29E000", "-DRS6000", # segv
100 "00245C46E000", "-DRS6000", # segv
101 "002012974600", "-DRS6000", # tango
102 "0006404C4C00", "-DRS6000", # jive
103 "2003", "-DG3", # ezopen4
104 "i86pc", "-DX86 -DINTEL",# gepard
105 "i386", "-DX86", # SCO_SV, NetBSD, FreeBSD
106 "i486", "-DX86", # tiger
107 "i586", "-DX86", # blauwal
108 "i686", "-DX86", #
109 "prep", "-DPPC", # hooge
110 "ppc", "-DPPC", # ppc-linux
111 "alpha", "-DALPHA", # mars
112 "RM400", "-DMIPS -DRM400", # ekberg, garbo
113 "IP22", "-DMIPS", # voyager
114 "IP32", "-DMIPS", # giotto
115 "Power Macintosh", "-DPPC", # NetBSD/arm32
116 "arm32", "-DARM32" # NetBSD/arm32
119 %archDosTable=("sun4c", "s", # hawai
120 "sun4m", "s", # broccoli
121 "sun4u", "s", # broccoli
122 "9000/712", "r", # tuborg
123 "9000/715", "r", # koepi
124 "9000/778", "r", # jever, flens
125 "000029484600", "p", # salsa
126 "000328144600", "p", # lambada
127 "00245D29E000", "p", # segv
128 "00245C46E000", "p", # segv
129 "002012974600", "p", # tango
130 "0006404C4C00", "p", # jive
131 "2003", "g", # ezopen4
132 "i86pc", "i", # gepard
133 "i386", "i", # SCO_SV, NetBSD, FreeBSD
134 "i486", "i", # tiger
135 "i586", "i", # blauwal
136 "i686", "i",
137 "prep", "p", # hooge
138 "ppc", "p", # ppc-linux
139 "alpha", "a", # mars
140 "RM400", "m", # ekberg, garbo
141 "IP22", "m", # voyager
142 "IP32", "m", # giotto
143 "Power Macintosh", "p", # NetBSD/arm32
144 "arm32", "a" # NetBSD/arm32
147 $main::solarDef = $osDefTable{ $s_str }.' '.$archDefTable{ $m_str };
149 $main::solarOS = $osTable{ $s_str };
150 $main::solarMT = $archTable{ $m_str };
152 $main::solarArch = $main::solarOS.$main::solarMT;
153 $main::solarOldArch = $main::solarArch; # for compatibility
155 $main::solarDOS = 'unx'.$osDosTable{ $s_str }. $archDosTable{ $m_str };
157 sub main::osarch
159 local ( $flag ) = @_;
161 $perlFlag = $flag eq 'perl';
162 $defFlag = $flag eq 'def';
163 $oldFlag = $flag eq 'old';
164 $dirFlag = $flag eq 'dir';
165 $dosFlag = $flag eq 'dos';
167 local( $result ) = ( '' );
169 if ( $perlFlag )
171 $result .= '$solarDef = '."'$main::solarDef';\n";
172 $result .= '$solarArch = '."'$main::solarArch';\n";
173 $result .= '$solarOldArch = '."'$main::solarOldArch';\n";
174 $result .= '$solarOS = '."'$main::solarOS';\n";
175 $result .= '$solarMT = '."'$main::solarMT';\n";
176 $result .= '$solarDOS = '."'$main::solarDOS';";
178 elsif ( $defFlag )
180 $result = $main::solarDef;
182 elsif ( $dirFlag )
184 $result = "$main::solarOS-$main::solarMT";
186 elsif ( $dosFlag )
188 $result = $main::solarDOS;
190 else
192 $result = $oldFlag ? $main::solarOldArch : $main::solarArch;
195 return $result;