1 |
williamc |
1.1 |
# simply set the architecture variable based on uname
|
2 |
|
|
#
|
3 |
|
|
|
4 |
|
|
package setarchitecture;
|
5 |
williamc |
1.2 |
require 5.001;
|
6 |
williamc |
1.1 |
require Exporter;
|
7 |
|
|
@ISA = qw(Exporter);
|
8 |
|
|
@EXPORT = qw(setarch);
|
9 |
|
|
|
10 |
|
|
# unix systems
|
11 |
|
|
sub setarch {
|
12 |
|
|
$uname=`uname -a`;
|
13 |
|
|
($OSname, $hostname, $OSversion, @rest) = split / /, $uname;
|
14 |
williamc |
1.3 |
#
|
15 |
|
|
# SunOS -
|
16 |
|
|
#
|
17 |
|
|
if ( $OSname=~SunOS ) {
|
18 |
|
|
$OSversion=~s/^(.\..)\.*/\1/; #Retain only the first two version digits
|
19 |
|
|
}
|
20 |
williamc |
1.1 |
# simply set to OS type and version
|
21 |
|
|
$ENV{SCRAM_ARCH}="${OSname}__${OSversion}";
|
22 |
williamc |
1.4 |
#print "Setting Architecture to $ENV{SCRAM_ARCH}\n";
|
23 |
williamc |
1.1 |
}
|