ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Tool.pm
Revision: 1.3
Committed: Fri Dec 17 11:04:23 1999 UTC (25 years, 4 months ago) by williamc
Content type: text/plain
Branch: MAIN
CVS Tags: V1_pre0, ProtoEnd, HEAD
Branch point for: SCRAM_V1_BRANCH
Changes since 1.2: +0 -0 lines
State: FILE REMOVED
Log Message:
removed

File Contents

# Content
1 # Tool Class: Tool Environmnet and functinality
2 #
3 #
4
5 package Tool;
6 require 5.001;
7 require Exporter;
8 @ISA=qw(Exporter);
9 use Carp;
10 use Utilities::SCRAMUtils;
11
12 # A new tool object
13 sub new {
14 $self = {};
15 bless $self;
16 $self->{toolname}=shift;
17 $self->{toolversion}=shift;
18 $self->{TEnv}={};
19 return $self;
20 }
21
22 # Add to a tool Env Variable
23 sub addenv {
24 my $self=shift;
25 my $name=shift;
26 my $value=shift;
27 ${$self->{TEnv}}{$name}=${$self->{TEnv}}{$name}." ".$value;
28 }
29
30 # Set a tool Env variable
31 sub env {
32 my $self=shift;
33 my $name=shift;
34 my $value=shift;
35 ${$self->{TEnv}}{$name}=$value;
36 }
37
38 #
39 # Write out the environment as a makefile
40 # --- Pass FILEHANDLE reference of open makefile
41 #
42 sub envtomake {
43 my $self=shift;
44 my $FILEHANDLE=shift;
45 foreach $i ( keys %{$self->{TEnv}} ) {
46 print $FILEHANDLE "$i+=${$self->{TEnv}}{$i}\n";
47 }
48 }