summaryrefslogtreecommitdiff
path: root/solenv/bin/modules/osarch.pm
blob: 205e4c933193cf30f93b4f6f52f221955d76ce49 (plain)
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#!/usr/bin/perl -w

# ***********************************************************************
# Description:
# Filename:    osarch.pm
# Autor:       EG
# Date:        28.10.96
# $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 $
# Copyright:   STAR DIVISION
# **********************************************************************/

package osarch;

$m_str = `uname -m`;
$s_str = `uname -s`;
chop( $m_str, $s_str );

%osTable    = ("SunOS",     "solaris",
               "HP-UX",     "hpux",
               "AIX",       "aix",
               "OS/390",    "s390",
               "Linux",     "linux",
               "FreeBSD",   "freebsd",
               "NetBSD",    "netbsd",
               "OSF1",      "decunix",
               "SCO_SV",    "scoosr5",
#              "SCO_SV",    "scouw21",
               "Darwin",    "macosxp",
               "Mac OS",    "macosxp",
               "SINIX-N",   "sinix"
               );

%osDefTable = ("SunOS",     "-DSYSV -DSOLARIS",
               "HP-UX",     "-DSYSV -DHPUX",
               "AIX",       "-DSYSV -DAIX",
               "Linux",     "-DLINUX",
               "FreeBSD",   "-DFREEBSD",
               "NetBSD",    "-DNETBSD",
               "OSF1",      "-DSYSV -DDECUNIX",
               "SCO_SV",    "-DSYSV -DSCO -DSCO_OSR5",
#              "SCO_SV",    "-DSYSV -DSCO -DSCO_UW21",
               "Darwin",    "-DBSD -DMACOSX",
               "Mac OS",    "-DBSD -DMACOSX",
               "SINIX-N",   "-DSYSV -DSINIX"
               );

%osDosTable = ("SunOS",     "sol",
               "HP-UX", "hpx",
               "AIX",   "aix",
               "OS/390",    "mvs",
               "Linux", "lng",
               "FreeBSD",   "fbsd",
               "NetBSD",    "bsd",
               "SCO_SV",    "sco",
               "Darwin",    "macx",
               "Mac OS",    "macx",
               "SINIX-N",   "sni"
               );

%archTable  = ("sun4c",         "sparc",
               "sun4m",         "sparc",
               "sun4u",         "sparc",
               "9000/712",      "hp9000",
               "9000/715",      "hp9000",
               "9000/778",      "hp9000",
               "000029484600",  "rs6000",       # salsa
               "000328144600",  "rs6000",       # lambada
               "00245D29E000",  "rs6000",       # segv
               "00245C46E000",  "rs6000",       # bus
               "002012974600",  "rs6000",       # tango
               "0006404C4C00",  "rs6000",       # jive
               "2003",          "g3",           # ezopen4
               "i86pc",         "x86",          # blauwal
               "i386",          "x86",          # SCO_SV, NetBSD, FreeBSD
               "i486",          "x86",          # tiger
               "i586",          "x86",          # blauwal
               "i686",          "x86",
               "prep",          "ppc",          # hooge
               "ppc",           "ppc",          # ppc-linux
               "alpha",         "alpha",
               "RM400",         "rm400",        # garbo
               "IP22",          "mips",         # voyager
               "IP32",          "mips",         # giotto
               "Power Macintosh",           "ppc",          # NetBSD/arm32
               "arm32",         "arm32"         # NetBSD/arm32
               );

%archDefTable=("sun4c",         "-DSPARC -DSUN -DSUN4", # hawai
               "sun4m",         "-DSPARC -DSUN -DSUN4", # broccoli
               "sun4u",         "-DSPARC -DSUN -DSUN4", # broccoli
               "9000/712",      "-DHP9000",     # tuborg
               "9000/715",      "-DHP9000",     # koepi
               "9000/778",      "-DHP9000",     # jever, flens
               "000029484600",  "-DRS6000",     # salsa
               "000328144600",  "-DRS6000",     # lambada
               "00245D29E000",  "-DRS6000",     # segv
               "00245C46E000",  "-DRS6000",     # segv
               "002012974600",  "-DRS6000",     # tango
               "0006404C4C00",  "-DRS6000",     # jive
               "2003",          "-DG3",         # ezopen4
               "i86pc",         "-DX86 -DINTEL",# gepard
               "i386",          "-DX86",        # SCO_SV, NetBSD, FreeBSD
               "i486",          "-DX86",        # tiger
               "i586",          "-DX86",        # blauwal
               "i686",          "-DX86",        #
               "prep",          "-DPPC",        # hooge
               "ppc",           "-DPPC",        # ppc-linux
               "alpha",         "-DALPHA",      # mars
               "RM400",         "-DMIPS -DRM400",   # ekberg, garbo
               "IP22",          "-DMIPS",           # voyager
               "IP32",          "-DMIPS",           # giotto
               "Power Macintosh",       "-DPPC",        # NetBSD/arm32
               "arm32",         "-DARM32"       # NetBSD/arm32
               );

%archDosTable=("sun4c",         "s",        # hawai
               "sun4m",         "s",        # broccoli
               "sun4u",         "s",        # broccoli
               "9000/712",      "r",        # tuborg
               "9000/715",      "r",        # koepi
               "9000/778",      "r",        # jever, flens
               "000029484600",  "p",        # salsa
               "000328144600",  "p",        # lambada
               "00245D29E000",  "p",        # segv
               "00245C46E000",  "p",        # segv
               "002012974600",  "p",        # tango
               "0006404C4C00",  "p",        # jive
               "2003",          "g",        # ezopen4
               "i86pc",         "i",        # gepard
               "i386",          "i",        # SCO_SV, NetBSD, FreeBSD
               "i486",          "i",        # tiger
               "i586",          "i",        # blauwal
               "i686",          "i",
               "prep",          "p",        # hooge
               "ppc",           "p",        # ppc-linux
               "alpha",         "a",        # mars
               "RM400",         "m",        # ekberg, garbo
               "IP22",          "m",        # voyager
               "IP32",          "m",        # giotto
               "Power Macintosh",           "p",            # NetBSD/arm32
               "arm32",         "a"         # NetBSD/arm32
               );

$main::solarDef     = $osDefTable{ $s_str }.' '.$archDefTable{ $m_str };

$main::solarOS      = $osTable{ $s_str };
$main::solarMT      = $archTable{ $m_str };

$main::solarArch    = $main::solarOS.$main::solarMT;
$main::solarOldArch = $main::solarArch; # for compatibility

$main::solarDOS     = 'unx'.$osDosTable{ $s_str }. $archDosTable{ $m_str };

sub main::osarch
{
    local ( $flag ) = @_;

    $perlFlag   = $flag eq 'perl';
    $defFlag    = $flag eq 'def';
    $oldFlag    = $flag eq 'old';
    $dirFlag    = $flag eq 'dir';
    $dosFlag    = $flag eq 'dos';

    local( $result ) = ( '' );

    if ( $perlFlag )
    {
        $result .= '$solarDef     = '."'$main::solarDef';\n";
        $result .= '$solarArch    = '."'$main::solarArch';\n";
        $result .= '$solarOldArch = '."'$main::solarOldArch';\n";
        $result .= '$solarOS      = '."'$main::solarOS';\n";
        $result .= '$solarMT      = '."'$main::solarMT';\n";
        $result .= '$solarDOS     = '."'$main::solarDOS';";
    }
    elsif ( $defFlag )
    {
        $result = $main::solarDef;
    }
    elsif ( $dirFlag )
    {
        $result = "$main::solarOS-$main::solarMT";
    }
    elsif ( $dosFlag )
    {
        $result = $main::solarDOS;
    }
    else
    {
        $result = $oldFlag ? $main::solarOldArch : $main::solarArch;
    }

    return $result;
}

1;