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

Comparing COMP/SCRAM/src/BuildSystem/BuildSetup.pm (file contents):
Revision 1.16 by sashby, Mon Oct 1 16:11:07 2001 UTC vs.
Revision 1.24 by sashby, Tue May 14 10:21:19 2002 UTC

# Line 40 | Line 40 | sub _generateexternals
40     {
41     my $self=shift;
42     my $outfile=shift;
43 <
43 >  
44     # -- specifiy these files for dependency information
45     # NB: This file is never used!
46    
# Line 66 | Line 66 | sub _generateexternals
66        my $fout=FileHandle->new();
67        $fout->open(">".$outfile) or die "Unable to open $outfile for output".
68           $!."\n";
69 <
69 >      
70        # -- print out tool/ version info
71        my ($tool,$toolobj,$f,$val,$version);
72 <          
72 >      
73        foreach $tool ( $self->{toolbox}->tools() )
74           {
75           $version=$self->{toolbox}->defaultversion($tool);
76          
77           # default versions
78           print $fout "ifdef $tool\n".$tool."_V_".$version."=true\nendif\n";
79 <
79 >        
80           # -- set up the different version  -- externals
81           foreach $version ( $self->{toolbox}->versions($tool) )
82              {
# Line 95 | Line 95 | sub _generateexternals
95                 {
96                 foreach $val ( $toolobj->getfeature($f) )
97                    {
98 <                  print $fout "\t".$f." += ".$val."\n";
98 >                  if ( $f eq 'LIBDIR'  ||  $f eq 'INCLUDE' )
99 >                     {
100 >                     # Remove duplications:
101 >                     print $fout "\t".$f." := \$(filter-out ".$val.",\$(".$f."))","\n";
102 >                     print $fout "\t".$f." += ".$val."\n";
103 >                     }
104 >                  else
105 >                     {
106 >                     print $fout "\t".$f." += ".$val."\n";
107 >                     }
108                    }
109                 }
110              # -- include any makefiles associated with the tool
# Line 112 | Line 121 | sub _generateexternals
121        print $fout 'LDFLAGS+=$(addprefix -L,$(LIBDIR))'."\n";
122        print $fout 'CPPFLAGS+=$(addprefix -D,$(CPPDEFINES))'."\n";
123        print $fout 'lib+=$(extralib)'."\n";
124 <      print $fout 'LDLIBS+=$(addprefix -l,$(lib))'."\n";
124 >      # Hack to parse the lib list and remove duplicates:
125 >      print $fout 'ORDEREDLIB=$(shell $(SCRAMPERL) $(TOOL_HOME)/ProcessLibs $(lib))',"\n";
126 >      print $fout 'LDLIBS+=$(addprefix -l,$(ORDEREDLIB))'."\n";
127        print $fout 'LDLIBS+=$(addprefix -l,$(REQUIRES))'."\n";
128        print $fout 'LD_LIBRARY_PATH:=$(subst $(space),:,$(LD_LIBRARY_PATH))'."\n";
129 <      
129 >
130        undef $fout;
131        }
132     }
# Line 248 | Line 259 | sub BuildSetup
259     # Do a datestamp check so that make will build files that have changed
260     # rather than just those which are older than their dependencies
261     # The main build here
262 +
263     $rv=system("gmake","--no-print-directory","-r","-k","-f","$ENV{DefaultMakefile}","-I$ENV{TOOL_HOME}",datestamp_config);
264  
265 <   my $gmakejobsflag = "-j";
266 <   chomp(my $currentOS = `uname`);
265 >   # Be verbose:
266 >   $self->verbose(">> Going to use ".$ENV{DefaultMakefile}." as the default makefile");
267    
268 <   # Only use -j option if there are more then 1 cpu's.....
257 <   if ( $currentOS eq "Linux" )
258 <      {
259 <      chomp($ncpu=`cat /proc/cpuinfo | grep -c processor`);
260 <      }
261 <   elsif ( $currentOS eq "SunOS" )
262 <      {
263 <      ($ncpu) = (`/usr/sbin/psrinfo | wc -l` =~ /\s+(\d+)/);
264 <      }
265 <   else
266 <      # Who knows what the OS is? Leave as default:
267 <      {
268 <      $ncpu = 1;
269 <      }
270 <
271 <   # Print a little debug message:
272 <   print "\n","scram BUILDSYSTEM(v1.0) >> Scram has determined that your system has ",$ncpu," CPU(s).","\n";
268 >   my $gmakejobsflag = "-j";
269     # Temporarily hard-code ncpu as 1:
270 < #   $ncpu = 1;
271 <   print "                        >> Multi-CPU builds not supported yet.","\n\n";
276 <  
277 <   # Modify: try to force make to spawn more than one job (option: -j ).
270 >   my $ncpu = 1;
271 >
272     $rv=system("gmake","--no-print-directory","$gmakejobsflag","$ncpu","-r","-k","-f","$ENV{DefaultMakefile}","-I$ENV{TOOL_HOME}",datestamp, @Targets);
273  
274     return $rv/256; # return the exit status of gmake

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines