ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Utilities/setarchitecture.pm
Revision: 1.5.2.2
Committed: Mon Mar 20 13:30:26 2000 UTC (25 years, 1 month ago) by williamc
Content type: text/plain
Branch: V0_9branch
CVS Tags: BuildSystemProto1, V0_18_0, V0_18_0model, V0_17_1, V0_18_0alpha, V0_17_0, V0_16_4, V0_16_3, V0_16_2, V0_16_1, V0_16_0, V0_15_1, V0_15_0, V0_15_0beta, V0_14_0, V0_12_12_4, V0_12_12_3, V0_13_3, V0_13_2, V0_12_12_2, V0_12_12_1, V0_12_12_0, PlayGround_0, V0_13_1, V0_13_0, V0_12_12, V0_12_11, V0_12_9b, V0_12_10, V0_12_9, V0_12_8, V0_12_7, V0_12_6, V0_12_5, V0_12_4, V0_12_3, V0_12_2, V0_12_1, V0_12_0, V0_11_4, V0_11_3, V0_11_2, V0_11_1, V0_11_0, V0_10_19, V0_10_18, V0_10_17
Branch point for: V0_17branch, V0_16branch, V0_15branch, HPWbranch
Changes since 1.5.2.1: +2 -0 lines
Log Message:
Conditional SCRAM_ARCH assignement

File Contents

# Content
1 # simply set the architecture variable based on uname
2 #
3
4 package setarchitecture;
5 require 5.001;
6 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 #
15 # SunOS -
16 #
17 if ( $OSname=~SunOS ) {
18 $OSversion=~s/^(.\..)\..*/\1/; #Retain only the first two version digits
19 }
20 #
21 # Linux -
22 #
23 if ( $OSname=~Linux ) {
24 $OSversion=~s/^(.\..)\..*/\1/; #Retain only the first two version digits
25 }
26
27 # simply set to OS type and version
28 if ( ! defined $ENV{SCRAM_ARCH} ) {
29 $ENV{SCRAM_ARCH}="${OSname}__${OSversion}";
30 }
31 #print "Setting Architecture to $ENV{SCRAM_ARCH}\n";
32 }