ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildSystem/ToolData.pm
(Generate patch)

Comparing COMP/SCRAM/src/BuildSystem/ToolData.pm (file contents):
Revision 1.2 by sashby, Fri Dec 10 13:41:37 2004 UTC vs.
Revision 1.8 by sashby, Mon Sep 11 14:53:39 2006 UTC

# Line 118 | Line 118 | sub flags()
118        }
119     }
120  
121 + sub updateflags()
122 +   {
123 +   my $self=shift;
124 +   my ($flag,$flagvalue) = @_;
125 +   # Reset:
126 +   if (exists $self->{FLAGS}->{$flag})
127 +      {
128 +      delete $self->{FLAGS}->{$flag};
129 +      }
130 +   # Reinsert:
131 +   $self->flags($flag,$flagvalue);
132 +   }
133 +
134   sub allflags()
135     {
136     my $self=shift;
# Line 131 | Line 144 | sub scram_project()
144        : $self->{SCRAM_PROJECT};
145     }
146  
147 + sub scram_compiler()
148 +   {
149 +   my $self=shift;
150 +   @_ ? $self->{SCRAM_COMPILER} = shift
151 +      : $self->{SCRAM_COMPILER};
152 +   }
153 +
154   sub variable_data()
155     {
156     my $self=shift;
# Line 234 | Line 254 | sub summarize_features()
254     ($self->scram_project() == 1) ? print "yes" : print "no";
255     print "\n";
256  
257 +   # A compiler tool?
258 +   if ($self->scram_compiler() == 1)
259 +      {
260 +      print "SCRAM_COMPILER=yes\n";
261 +      }
262 +
263     # Print out any variables:
264     foreach my $var (@variables)
265        {
# Line 267 | Line 293 | sub summarize_features()
293     # Finally, look for runtime vars:
294     if (exists($self->{'RUNTIME'}) && (my ($nkeys) = scalar(keys %{$self->{'RUNTIME'}}) > 0 ))
295        {
296 <      while (my ($rt,$val) = each %{$self->{$feature}})
296 >      while (my ($rt,$val) = each %{$self->{'RUNTIME'}})
297           {
298           if ($rt =~ /:/)
299              {
# Line 298 | Line 324 | sub addreleasetoself()
324    
325     foreach my $libdir (@locallibdirs)
326        {
327 <      # Convert LOCAL to RELEASE top:
328 <      $libdir =~ s/$ENV{LOCALTOP}/$ENV{RELEASETOP}/g;
327 >      # Convert LOCAL to RELEASE top, quoting the LOCALTOP
328 >      # value in case funny characters have been used (e.g. ++):
329 >      $libdir =~ s/\Q$ENV{LOCALTOP}\E/$ENV{RELEASETOP}/g;
330        push(@$relldir, $libdir);
331        }
332    
# Line 308 | Line 335 | sub addreleasetoself()
335    
336     foreach my $incdir (@localincdirs)
337        {
338 <      # Convert LOCAL to RELEASE top:
339 <      $incdir =~ s/$ENV{LOCALTOP}/$ENV{RELEASETOP}/g;
338 >      # Convert LOCAL to RELEASE top, quoting the LOCALTOP
339 >      # value in case funny characters have been used (e.g. ++):
340 >      $incdir =~ s/\Q$ENV{LOCALTOP}\E/$ENV{RELEASETOP}/g;
341        push(@$relinc, $incdir);
342        }
343    
# Line 334 | Line 362 | sub addreleasetoself()
362              # Process the values for this path:
363              foreach my $rtpath (@PATHS)
364                 {
365 <               $rtpath =~ s/$ENV{LOCALTOP}/$ENV{RELEASETOP}/g;
365 >               $rtpath =~ s/\Q$ENV{LOCALTOP}\E/$ENV{RELEASETOP}/g;
366                 push(@$RELPATHS,$rtpath);
367                 }
368              
# Line 346 | Line 374 | sub addreleasetoself()
374    
375     }
376  
377 + sub allfeatures()
378 +   {
379 +   my $self=shift;
380 +   my @feature_vars=$self->list_variables();
381 +   my @features;
382 +   push (@features, @feature_vars, qw(LIB LIBDIR INCLUDE USE));  
383 +
384 +   # Make sure feature name is uppercase:
385 +   $feature =~ tr/a-z/A-Z/;
386 +   $feature_data={};
387 +   map
388 +      {
389 +      if (exists ($self->{$_}))
390 +         {
391 +         if (ref($self->{$_}) eq 'ARRAY')
392 +            {
393 +            $feature_data->{$_} = join(" ",@{$self->{$_}});
394 +            }
395 +         else
396 +            {
397 +            $feature_data->{$_} = $self->{$_}; # A string
398 +            }
399 +         }
400 +      } @features;
401 +   return $feature_data;
402 +   }
403 +
404 + sub reset()
405 +   {
406 +   my $self=shift;
407 +   my ($entryname)=@_;
408 +
409 +   if (exists($self->{$entryname}))
410 +      {
411 +      $self->{$entryname} = undef;
412 +      }  
413 +   }
414 +
415   1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines