28 |
|
bless $self, $class; |
29 |
|
$self->{cache}=shift; |
30 |
|
$self->{mydoctype}="BuildSystem::ToolDoc"; |
31 |
< |
$self->{mydocversion}="1.0"; |
31 |
> |
$self->{mydocversion}="1.1"; |
32 |
|
$self->init(); |
33 |
|
return $self; |
34 |
|
} |
48 |
|
\&Environment_init, $self, |
49 |
|
"", $self, |
50 |
|
"", $self); |
51 |
+ |
$self->{switch}->grouptag("Tool","setupinit"); |
52 |
+ |
|
53 |
|
$self->{switch}->newparse("setup"); |
54 |
|
$self->{switch}->addtag("setup","Tool",\&Tool_Start, $self, |
55 |
|
"", $self, |
67 |
|
\&Environment_Start, $self, |
68 |
|
\&Env_text, $self, |
69 |
|
\&Environment_End, $self); |
70 |
+ |
$self->{switch}->addtag("setup","Makefile", |
71 |
+ |
\&Makefile_Start, $self, |
72 |
+ |
\&Makefile_text, $self, |
73 |
+ |
\&Makefile_end, $self); |
74 |
|
$self->{switch}->grouptag("Tool","setup"); |
75 |
|
$self->{switch}->addtag("setup","Architecture", |
76 |
|
\&Arch_Start,$self, |
111 |
|
my $file=shift; |
112 |
|
my $name=shift; |
113 |
|
my $version=shift; |
114 |
+ |
my $toolbox=shift; |
115 |
|
|
116 |
|
$self->{ToolEnv}{'SCRAMtoolname'}=$name; |
117 |
|
$self->{ToolEnv}{'SCRAMtoolversion'}=$version; |
124 |
|
$self->{toolfound}=1; |
125 |
|
# -- check the type of document - can we parse it? |
126 |
|
my($doctype,$docversion)=$self->{switch}->doctype(); |
127 |
< |
if ( ($doctype ne $self->{mydoctype}) || |
128 |
< |
($self->{mydocversion} ne $docversion) ) { |
127 |
> |
if (($doctype ne $self->{mydoctype}) || |
128 |
> |
(($self->{mydocversion} ne $docversion) && ($docversion ne "1.0")) ) { |
129 |
|
$self->error("Unable to Parse Document of type $doctype $docversion". |
130 |
|
"\n(Only ".$self->{mydoctype}." ". $self->{mydocversion}.")"); |
131 |
|
} |
132 |
|
delete $self->{envcount}; |
133 |
+ |
$self->verbose("Pre-Parse"); |
134 |
|
$self->{switch}->parse("setupinit"); |
135 |
+ |
$self->{toolmakefile}=$toolbox->toolmakefile($name,$version); |
136 |
+ |
$self->verbose("Setup Parse"); |
137 |
|
$self->{switch}->parse("setup"); |
138 |
+ |
undef $self->{toolmakefilefh}; |
139 |
|
return $self->{toolfound}; |
140 |
|
} |
141 |
|
|
201 |
|
} |
202 |
|
} |
203 |
|
if ( $OK eq 'true' ) { |
204 |
< |
print "Directory Check Complete\n"; |
204 |
> |
print "Existence Check Complete\n"; |
205 |
|
return 1 |
206 |
|
} |
207 |
|
return 0 |
451 |
|
$self->{switch}->closegroup("Toolactive"); |
452 |
|
} |
453 |
|
|
454 |
+ |
sub Makefile_Start { |
455 |
+ |
my $self=shift; |
456 |
+ |
my $name=shift; |
457 |
+ |
my $hashref=shift; |
458 |
+ |
|
459 |
+ |
if ( $self->{Arch} ) { |
460 |
+ |
if ( ! defined $self->{toolmakefilefh} ) { |
461 |
+ |
$self->{toolmakefilefh}=FileHandle->new(); |
462 |
+ |
$self->{toolmakefilefh}->open(">".$self->{toolmakefile}); |
463 |
+ |
} |
464 |
+ |
} |
465 |
+ |
} |
466 |
+ |
|
467 |
+ |
sub Makefile_text { |
468 |
+ |
my $self=shift; |
469 |
+ |
my $name=shift; |
470 |
+ |
my $string=shift; |
471 |
+ |
|
472 |
+ |
if ( $self->{Arch} ) { |
473 |
+ |
print {$self->{toolmakefilefh}} $string; |
474 |
+ |
} |
475 |
+ |
} |
476 |
+ |
|
477 |
+ |
sub Makefile_end { |
478 |
+ |
my $self=shift; |
479 |
+ |
my $name=shift; |
480 |
+ |
my $hashref=shift; |
481 |
+ |
|
482 |
+ |
if ( $self->{Arch} ) { |
483 |
+ |
print {$self->{toolmakefilefh}} "\n"; |
484 |
+ |
} |
485 |
+ |
} |
486 |
+ |
|
487 |
|
# -- collect number of variables of the same name - need to know how many |
488 |
|
# before main setup processing |
489 |
|
sub Environment_init { |