- $self->{PARENT} = $Parent[-2];
- my $key;
- for $key (keys %Prepend_dot_dot) {
- next unless defined $self->{PARENT}{$key};
- $self->{$key} = $self->{PARENT}{$key};
- # PERL and FULLPERL may be command verbs instead of full
- # file specifications under VMS. If so, don't turn them
- # into a filespec.
- $self->{$key} = $self->catdir("..",$self->{$key})
- unless $self->file_name_is_absolute($self->{$key})
- || ($^O eq 'VMS' and ($key =~ /PERL$/ && $self->{$key} =~ /^[\w\-\$]+$/));
- }
- if ($self->{PARENT}) {
- $self->{PARENT}->{CHILDREN}->{$newclass} = $self;
- foreach my $opt (qw(CAPI POLLUTE)) {
- if (exists $self->{PARENT}->{$opt}
- and not exists $self->{$opt})
- {
- # inherit, but only if already unspecified
- $self->{$opt} = $self->{PARENT}->{$opt};
- }
- }
- }
+ $self->{PARENT} = $Parent[-2];
+ my $key;
+ for $key (@Prepend_parent) {
+ next unless defined $self->{PARENT}{$key};
+
+ # Don't stomp on WriteMakefile() args.
+ next if defined $self->{ARGS}{$key} and
+ $self->{ARGS}{$key} eq $self->{$key};
+
+ $self->{$key} = $self->{PARENT}{$key};
+
+ unless ($Is_VMS && $key =~ /PERL$/) {
+ $self->{$key} = $self->catdir("..",$self->{$key})
+ unless $self->file_name_is_absolute($self->{$key});
+ } else {
+ # PERL or FULLPERL will be a command verb or even a
+ # command with an argument instead of a full file
+ # specification under VMS. So, don't turn the command
+ # into a filespec, but do add a level to the path of
+ # the argument if not already absolute.
+ my @cmd = split /\s+/, $self->{$key};
+ $cmd[1] = $self->catfile('[-]',$cmd[1])
+ unless (@cmd < 2) || $self->file_name_is_absolute($cmd[1]);
+ $self->{$key} = join(' ', @cmd);
+ }
+ }
+ if ($self->{PARENT}) {
+ $self->{PARENT}->{CHILDREN}->{$newclass} = $self;
+ foreach my $opt (qw(POLLUTE PERL_CORE)) {
+ if (exists $self->{PARENT}->{$opt}
+ and not exists $self->{$opt})
+ {
+ # inherit, but only if already unspecified
+ $self->{$opt} = $self->{PARENT}->{$opt};
+ }
+ }
+ }
+ my @fm = grep /^FIRST_MAKEFILE=/, @ARGV;
+ parse_args($self,@fm) if @fm;