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

Comparing COMP/SCRAM/src/BuildSystem/BuildFile.pm (file contents):
Revision 1.18 by sashby, Tue May 14 14:27:13 2002 UTC vs.
Revision 1.23 by sashby, Wed Oct 23 07:35:39 2002 UTC

# Line 89 | Line 89 | sub _initswitcher {
89          return $switch;
90   }
91  
92 < sub _commontags {
93 <        my $self=shift;
94 <        my $switch=shift;
95 <        my $parse=shift;
96 <        
97 <        $self->verbose(">> _commontags: SW ".$switch." PARSE ".$parse." <<");
98 <        
99 <        $switch->grouptag("Export",$parse);
100 <        $switch->addtag($parse,"Use",\&Use_start,$self,
101 <                                               \&OutToMakefile, $self,
102 <                                                "", $self);
103 <        $switch->addtag($parse,"Group",\&Group_start,$self,
104 <                                               \&OutToMakefile, $self,
105 <                                                "", $self);
106 <        $switch->grouptag("Group",$parse);
107 <        $switch->addtag($parse,"External",
108 <                                        \&External_StartTag,$self,
109 <                                        \&OutToMakefile, $self,
110 <                                        "", $self);
111 <        $switch->addtag($parse,"lib",
112 <                                        \&lib_start,$self,
113 <                                        \&OutToMakefile, $self,
114 <                                        "", $self);
115 <        $switch->addtag($parse,"Architecture",
116 <                                        \&Arch_Start,$self,
117 <                                        \&OutToMakefile, $self,
118 <                                        \&Arch_End,$self);
119 <        $switch->addtag($parse,"INCLUDE_PATH",
120 <                                        \&IncludePath_Start,$self,
121 <                                        \&OutToMakefile, $self,
122 <                                        "",$self);
123 <        return $switch;
124 < }
92 > sub _commontags
93 >   {
94 >   my $self=shift;
95 >   my $switch=shift;
96 >   my $parse=shift;
97 >  
98 >   $self->verbose(">> _commontags: SW ".$switch." PARSE ".$parse." <<");
99 >  
100 >   $switch->grouptag("Export",$parse);
101 >   $switch->addtag($parse,"Use",
102 >                   \&Use_start,$self,
103 >                   \&OutToMakefile, $self,
104 >                   "", $self);
105 >   $switch->addtag($parse,"Group",
106 >                   \&Group_start,$self,
107 >                   \&OutToMakefile, $self,
108 >                   "", $self);
109 >   $switch->grouptag("Group",$parse);
110 >   $switch->addtag($parse,"External",
111 >                   \&External_StartTag,$self,
112 >                   \&OutToMakefile, $self,
113 >                   "", $self);
114 >   $switch->addtag($parse,"lib",
115 >                   \&lib_start,$self,
116 >                   \&OutToMakefile, $self,"", $self);
117 >   $switch->addtag($parse,"debuglib",
118 >                   \&debuglib_start,$self,
119 >                   \&OutToMakefile, $self,
120 >                   "", $self);
121 >   $switch->addtag($parse,"Architecture",
122 >                   \&Arch_Start,$self,
123 >                   \&OutToMakefile, $self,
124 >                   \&Arch_End,$self);
125 >   $switch->addtag($parse,"INCLUDE_PATH",
126 >                   \&IncludePath_Start,$self,
127 >                   \&OutToMakefile, $self,
128 >                   "",$self);
129 >   $switch->addtag($parse,"CompilerMap",
130 >                   \&CompilerMap_Start,$self,
131 >                   \&OutToMakefile, $self,
132 >                   "",$self);
133 >   return $switch;
134 >   }
135  
136   sub ParseBuildFile {
137          my $self=shift;
# Line 288 | Line 298 | sub IncludePath_Start
298     $self->{switch}->checktag( $name, $hashref, 'path');
299     if ( $self->{Arch} )
300        {
291      print GNUmakefile "INCLUDE:=\$(filter-out ".$self->_location()."/".$$hashref{'path'}.",\$(INCLUDE))","\n";
301        print GNUmakefile "INCLUDE+=".$self->_location()."/".$$hashref{'path'}."\n";
302        }
303     }
# Line 853 | Line 862 | sub Use_start
862        else
863           {
864           $filename=$self->{remoteproject}."/$$hashref{name}/BuildFile";
865 <         print "Trying $filename\n";
865 >         # Not sure how useful this statement is, so I'll remove it for now:
866 >         # print STDERR "Trying $filename\n";
867           if ( ! -f $filename ) { $filename=""; };
868           }
869        if ( $filename ne "" )
# Line 907 | Line 917 | sub AssociateGroup {
917          }
918   }
919  
920 < sub Arch_Start {
921 <        my $self=shift;
922 <        my $name=shift;
923 <        my $hashref=shift;
924 <
925 <        $self->verbose(">> Arch_Start: NM ".$name." <<");
926 <        
927 <        $self->{switch}->checktag($name, $hashref,'name');
928 <        ( ($ENV{SCRAM_ARCH}=~/$$hashref{name}.*/) )? ($self->{Arch}=1)
929 <                                                : ($self->{Arch}=0);
930 <        push @{$self->{ARCHBLOCK}}, $self->{Arch};
931 < }
920 > sub Arch_Start
921 >   {
922 >   my $self=shift;
923 >   my $name=shift;
924 >   my $hashref=shift;
925 >  
926 >   $self->verbose(">> Arch_Start: NM ".$name." <<");
927 >  
928 >   $self->{switch}->checktag($name, $hashref,'name');
929 >  
930 > #   if ($ENV{SCRAM_ARCH} =~ /$$hashref{name}$/)
931 >   if ( $$hashref{name} eq $ENV{SCRAM_ARCH} )
932 >      {
933 > #      print "HASHREFNAME= ",$$hashref{name},"\n";     # The tag read from BuildFile
934 > #      print "Scram arch()? ",$ENV{SCRAM_ARCH},"\n";   # Also SCRAM_ARCH
935 >      $self->{Arch}=1;
936 >      }
937 >   else
938 >      {
939 >      $self->{Arch}=0;
940 >      }
941 > #   ( ($ENV{SCRAM_ARCH}=~/$$hashref{name}.*/) )? ($self->{Arch}=1)
942 > #      : ($self->{Arch}=0);
943 >  
944 >   $self->verbose(($self->{Arch}?"OK":"skipping")." ".$$hashref{name});
945 >   push @{$self->{ARCHBLOCK}}, $self->{Arch};
946 >   }
947  
948   sub Arch_End {
949          my $self=shift;
# Line 1044 | Line 1069 | sub lib_start
1069        }
1070     }
1071  
1072 + # Standard debug lib tag
1073 + #
1074 + sub debuglib_start
1075 +   {
1076 +   my $self=shift;
1077 +   my $name=shift;
1078 +   my $hashref=shift;
1079 +  
1080 +   $self->verbose(">> debuglib_start: NM ".$name." <<");
1081 +   $self->{switch}->checktag($name, $hashref, 'name');
1082 +
1083 +   if ( $self->{Arch} )
1084 +      {
1085 +      print GNUmakefile "debuglib+=$$hashref{name}\n";
1086 +      }
1087 +   }
1088 +
1089   #
1090   # libtype specification
1091   #
# Line 1200 | Line 1242 | sub Store_start {
1242                          ."/".$dir.":".$ENV{RELEASETOP}."/".$dir."\n";
1243          }
1244   }
1245 +
1246 + sub CompilerMap_Start
1247 +   {
1248 +   ###############################################################
1249 +   # CompilerMap_Start                                           #
1250 +   ###############################################################
1251 +   # modified : Fri Oct  4 15:08:39 2002 / SFA                   #
1252 +   # params   :                                                  #
1253 +   #          :                                                  #
1254 +   #          :                                                  #
1255 +   #          :                                                  #
1256 +   # function : Create a map between a SUBARCH and specific      #
1257 +   #          : compiler and version.                            #
1258 +   #          :                                                  #
1259 +   #          :                                                  #
1260 +   ###############################################################
1261 +   my $self=shift;
1262 +   my $name=shift;
1263 +   my $hashref=shift;
1264 +
1265 +   $self->verbose(">> CompilerMap_Start: NM ".$name." <<");
1266 +   print "compiler check....",$self->{Arch},"\n";
1267 +   print "ARCH: ",$self->{ArchStack},"\n";
1268 +   # We can only map compilers to already-defined architectures, so
1269 +   # we check for 'Arch':
1270 +   if ( $self->{Arch} )
1271 +      {
1272 +      my @tagnames=keys %{$hashref};
1273 +      my @tagvalues=values %{$hashref};
1274 +      
1275 +      foreach my $tag ( @tagnames )
1276 +         {
1277 +         $self->{switch}->checktag($name,$hashref,$tag);
1278 +         print GNUmakefile $tag."=".$$hashref{$tag}."\n";
1279 + #       if ( defined $$hashref{'version'} ) {
1280 + #               print GNUmakefile "_V_".$$hashref{'version'};
1281 + #       }
1282 + #       print GNUmakefile "=true\n";
1283 +
1284 +         }
1285 + #        $self->{switch}->checktag($name,$hashref,'ref');
1286 +
1287 + #       # -- oo toolbox stuff
1288 + #       # - get the appropriate tool object
1289 + #       $$hashref{'ref'}=~tr[A-Z][a-z];
1290 + #       if ( ! exists $$hashref{'version'} ) {
1291 + #        $tool=$self->{toolbox}->gettool($$hashref{'ref'});
1292 + #       }
1293 + #       else {
1294 + #        $tool=$self->{toolbox}->gettool($$hashref{'ref'},$$hashref{'version'});
1295 + #       }
1296 + #       if ( ! defined $tool ) {
1297 + #         $self->{switch}->parseerror("Unknown Tool Specified ("
1298 + #                                                       .$$hashref{'ref'}.")");
1299 + #       }
1300 +
1301 + #       # -- old fashioned GNUmakefile stuff
1302 + #       print GNUmakefile $$hashref{'ref'};
1303 + #       if ( defined $$hashref{'version'} ) {
1304 + #               print GNUmakefile "_V_".$$hashref{'version'};
1305 + #       }
1306 + #       print GNUmakefile "=true\n";
1307 +        
1308 + #       # -- Sub system also specified?
1309 + #       if ( exists $$hashref{'use'} ) {
1310 + #          # -- look for a buildfile
1311 + #          my @paths=$tool->getfeature("INCLUDE");
1312 + #          my $file="";
1313 + #          my ($path,$testfile);
1314 + #          foreach $path ( @paths ) {
1315 + #            $testfile=$path."/".$$hashref{'use'}."/BuildFile" ;
1316 + #            if ( -f $testfile ) {
1317 + #               $file=$testfile;
1318 + #               $self->_pushremoteproject($path);
1319 + #            }
1320 + #          }
1321 + #          if ( $file eq "" ) {
1322 + #            $self->{switch}->parseerror("Unable to find SubSystem $testfile");
1323 + #          }
1324 + #          $self->ParseBuildFile_Export($file);
1325 + #          $self->_popremoteproject();
1326 + #        }
1327 +      }
1328 +   else
1329 +      {
1330 +      print "No architecture defined: not possible to define a compiler-to-subarch mapping.","\n";
1331 +      }
1332 +   }
1333 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines