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

Comparing COMP/SCRAM/src/BuildSystem/ToolManager.pm (file contents):
Revision 1.2 by sashby, Fri Dec 10 13:41:37 2004 UTC vs.
Revision 1.8 by sashby, Wed Apr 13 16:45:36 2005 UTC

# Line 69 | Line 69 | sub clone()
69     {
70     my $self=shift;
71     my $projectarea=shift;
72 <  
72 >
73     # Change cache settings to reflect the new location:
74     $self->{topdir}=$projectarea->location();
75  
# Line 227 | Line 227 | sub coresetup()
227     # Make sure that we have this tool in the list of selected tools (just in case this tool was
228     # set up by hand afterwards):
229     $self->addtoselected($toolname);
230 +
231 +   # Check to see if this tool is a compiler. If so, store it.
232 +   # Also store the language that this compiler supprots, and a
233 +   # compiler name (e.g. gcc323) which, in conjunction with a stem
234 +   # architecture name like slc3_ia32_, can be used to build a complete arch string:
235 +   if ($store->scram_compiler() == 1)
236 +      {
237 +      my @supported_language = $store->flags("SCRAM_LANGUAGE_TYPE");
238 +      my @compilername = $store->flags("SCRAM_COMPILER_NAME");
239 +      $self->scram_compiler($supported_language[0],$toolname,$compilername[0]);
240 +      }
241 +  
242     # Store the ToolData object in the cache:
243     $self->storeincache($toolparser->toolname(),$store);
244     return $self;
# Line 248 | Line 260 | sub toolsetup()
260        {
261        $self->{urlhandler}=URL::URLhandler->new($urlcache);
262        }
263 <  
263 >
264     $url = $self->toolurls()->{$toolname};
265     $filename = $self->{toolfiledir}."/".$toolname;
266    
267 +   # If .SCRAM/InstalledTools doesn't exist, create it:
268 +   if (! -d $self->{toolfiledir})
269 +      {
270 +      AddDir::adddir($self->{toolfiledir});
271 +      }
272 +  
273     # First, check to see if there was a tool URL given. If so, we might need to read
274     # from http or from a file: type URL:
275     if (my ($proto, $urlv) = ($toolurl =~ /(.*):(.*)/))
# Line 266 | Line 284 | sub toolsetup()
284              {
285              use File::Copy;
286              copy($urlv, $filename);
287 +            my $mode = 0644; chmod $mode, $filename;
288              $toolfile=$filename;
289              }
290           else
# Line 313 | Line 332 | sub toolsetup()
332        # Copy the downloaded tool file to InstalledTools directory:
333        if ( ! -f $filename )
334           {
335 <         $self->verbose("Attempting Download of $url");
336 <         # Get file from download cache:
337 <         ($url,$filename)=$self->{urlhandler}->get($url);
338 <         use File::Copy;
339 <         $tfname=$self->{toolfiledir}."/".$toolname;
340 <         copy($filename, $tfname);
341 <         $toolfile=$tfname;
335 >         # If the URL is empty, the chances are that this tool was not downloaded to .SCRAM/InstalledTools.
336 >         # We signal an error and exit:
337 >         if ($url eq '')
338 >            {
339 >            $::scram->scramerror("$toolname was selected in project requirements but is not in the configuration!");
340 >            }
341 >         else
342 >            {
343 >            # Otherwise, we try to download it:
344 >            $self->verbose("Attempting Download of $url");
345 >            # Get file from download cache:
346 >            ($url,$filename)=$self->{urlhandler}->get($url);                
347 >            use File::Copy;
348 >            $tfname=$self->{toolfiledir}."/".$toolname;  
349 >            copy($filename, $tfname);
350 >            my $mode = 0644; chmod $mode, $tfname;
351 >            $toolfile=$tfname;
352 >            }
353           }
354        else
355           {
# Line 508 | Line 538 | sub scram_projects()
538     return $scram_projects;
539     }
540  
541 + sub scram_compiler()
542 +   {
543 +   my $self=shift;
544 +   my ($langtype, $toolname, $compilername)=@_;
545 +
546 +   if ($langtype)
547 +      {
548 +      # Store the compiler info according to supported
549 +      # language types.
550 +      #
551 +      # ---------------------- e.g C++      cxxcompiler    gcc323
552 +      $self->{SCRAM_COMPILER}->{$langtype}=[ $toolname, $compilername ];
553 +      }
554 +   else
555 +      {
556 +      return $self->{SCRAM_COMPILER};
557 +      }
558 +   }
559 +
560   1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines