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.1.2.2 by williamc, Wed Apr 19 14:14:32 2000 UTC vs.
Revision 1.1.2.7.2.2.2.1.2.3 by williamc, Tue Oct 31 13:26:29 2000 UTC

# Line 2 | Line 2
2   #
3   # Interface
4   # ---------
5 < # new() : A new BuildSetup
5 > # new(toolbox) : A new BuildSetup
6   # BuildSetup(directory,targets) : prepare the ground for a build and build
7   # getclass(directory) : return (Class, ClassDir, BuildFileobject)
8   #                       associated with directory
# Line 20 | Line 20 | sub new {
20          my $class=shift;
21          my $self={};
22          bless $self,$class;
23 <        $self->init();
23 >        $self->{toolbox}=shift;
24          return $self;
25   }
26  
27 sub init {
28        my $self=shift;
29        $self->{toolbox}=BuildSystem::ToolBox->new();
30 }
31
27   sub _generateexternals {
28          my $self=shift;
29          my $outfile=shift;
30  
31          # -- specifiy these files for dependency information
32          my $depfile=$ENV{projconfigdir}."/External_Dependencies";
33 <        my $clientfile="$ENV{LOCALTOP}/.SCRAM/$ENV{SCRAM_ARCH}/clientsettings";
34 <        my $clientreq="$ENV{LOCALTOP}/.SCRAM/$ENV{SCRAM_ARCH}/".
35 <                        "clientsettings_reqs";
33 >
34 >        # -- get list of dependent files
35 >        my $datadir=$ENV{LOCALTOP}."/.SCRAM/".$ENV{SCRAM_ARCH};
36 >        $fdir=FileHandle->new();
37 >        opendir $fdir, $datadir;
38 >        my @depfiles=grep !/^\.\.?$/, readdir $fdir;
39 >        undef $fdir;
40 >        for (my $i=0; $i<=$#depfiles; $i++ ) {
41 >           $depfiles[$i]=$datadir."/".$depfiles[$i];
42 >        }
43 >
44          # -- do we need to rebuild?
45 <        if ( SCRAMUtils::dated($outfile,$depfile, $clientfile,$clientreq) ) {
45 >        if ( SCRAMUtils::dated($outfile,@depfiles) ) {
46            print "Configuring Local Area\n";
47            # -- open output file
48            my $fout=FileHandle->new();
# Line 48 | Line 51 | sub _generateexternals {
51  
52            # -- print out tool/ version info
53            my ($tool,$toolobj,$f,$val,$version);
54 <          foreach $toolpair ( $self->{toolbox}->tools() ) {
55 <            $tool=$$toolpair[0];
53 <            $version=$$toolpair[1];
54 >          foreach $tool ( $self->{toolbox}->tools() ) {
55 >            $version=$self->{toolbox}->defaultversion($tool);
56              # default versions
57              print $fout "ifdef $tool\n".$tool."_V_".$version."=true\nendif\n";
58 <            $toolobj=$self->{toolbox}->gettool($tool,$version);
59 <            # -- externals
60 <            @deps=$toolobj->getfeature("_externals");
61 <            foreach $d ( @deps ) {
58 >            # -- set up the different version  -- externals
59 >            foreach $version ( $self->{toolbox}->versions($tool) ) {
60 >             $toolobj=$self->{toolbox}->gettool($tool,$version);
61 >             @deps=$toolobj->getfeature("_externals");
62 >             foreach $d ( @deps ) {
63 >              $d=~tr[A-Z][a-z];
64                print $fout "ifdef ".$tool."_V_".$version."\n $d=true\nendif\n";
65 <            }
66 <            # -- tool info
67 <            print $fout "ifdef ".$tool."_V_".$version."\n";
68 <            foreach $f ( $toolobj->features() ) {
65 >             }
66 >             # -- tool info
67 >             print $fout "ifdef ".$tool."_V_".$version."\n";
68 >             foreach $f ( $toolobj->features() ) {
69                foreach $val ( $toolobj->getfeature($f) ) {
70                  print $fout "\t".$f." += ".$val."\n";
71                }
72 +             }
73 +             print $fout "endif\n";
74              }
69            print $fout "endif\n";
75            }
76            # some addittional processing of specific vars
77            print $fout 'INCLUDEPATH+=$(addprefix -I,$(INCLUDE))'."\n";
# Line 75 | Line 80 | sub _generateexternals {
80            print $fout 'lib+=$(extralib)'."\n";
81            print $fout 'LDLIBS+=$(addprefix -l,$(lib))'."\n";
82            print $fout 'LDLIBS+=$(addprefix -l,$(REQUIRES))'."\n";
83 +          print $fout 'LD_LIBRARY_PATH:=$(subst $(space),:,$(LD_LIBRARY_PATH))'."\n";
84  
85            undef $fout;
86          }
# Line 114 | Line 120 | sub BuildSetup {
120      elsif ( -e $ENV{RELEASETOP}."/".$projectfile ) {
121        $ENV{projectfile}=$ENV{RELEASETOP}."/".$projectfile;
122      }
117    else {
118        print "Warning : Unable to find $projectfile\n";
119    }
123      if ( $DefaultBuildFile eq "" ) {
124        # Map Relevant makefile classmakefile directory
125        my $classmakefile=$ENV{projconfigdir}."/".$Class."_makefile.mk";
# Line 158 | Line 161 | sub BuildSetup {
161        if ( $word=~/.*=.*/ ) { # if we have an assignment it cant be a target
162           $targetnumber--;
163        }
164 +      elsif ( $word=~/^-/ ) {
165 +         $targetnumber--;
166 +      }
167        else {
168          $ENV{"MAKETARGET_".$word}=$word;
169        }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines