… | |
… | |
113 | %kv, |
113 | %kv, |
114 | set => {}, |
114 | set => {}, |
115 | }, $class; |
115 | }, $class; |
116 | |
116 | |
117 | my %inc_seen; |
117 | my %inc_seen; |
118 | my @inc = grep !$inc_seen{$_}++, @{ $self->{inc} }; |
118 | my @inc = grep !$inc_seen{$_}++ && -d "$_/.", @{ $self->{inc} }; |
119 | $self->{inc} = \@inc; |
119 | $self->{inc} = \@inc; |
120 | |
120 | |
121 | $self->_set_inc; |
121 | $self->_set_inc; |
122 | |
122 | |
123 | $self |
123 | $self |
|
|
124 | } |
|
|
125 | |
|
|
126 | sub _perl_path() { |
|
|
127 | my $secure_perl_path = $Config{perlpath}; |
|
|
128 | |
|
|
129 | if ($^O ne 'VMS') { |
|
|
130 | $secure_perl_path .= $Config{_exe} |
|
|
131 | unless $secure_perl_path =~ m/$Config{_exe}$/i; |
|
|
132 | } |
|
|
133 | |
|
|
134 | $secure_perl_path |
124 | } |
135 | } |
125 | |
136 | |
126 | sub _set_inc { |
137 | sub _set_inc { |
127 | my ($self) = @_; |
138 | my ($self) = @_; |
128 | |
139 | |
… | |
… | |
304 | . 'open STDERR, ">stderr";' # suppress "syntax OK" message from perl |
315 | . 'open STDERR, ">stderr";' # suppress "syntax OK" message from perl |
305 | . "}\n" |
316 | . "}\n" |
306 | . (delete $self->{trace_check}); |
317 | . (delete $self->{trace_check}); |
307 | close $fh; |
318 | close $fh; |
308 | |
319 | |
309 | my $secure_perl_path = $Config{perlpath}; |
|
|
310 | |
|
|
311 | if ($^O ne 'VMS') { |
|
|
312 | $secure_perl_path .= $Config{_exe} |
|
|
313 | unless $secure_perl_path =~ m/$Config{_exe}$/i; |
|
|
314 | } |
|
|
315 | |
|
|
316 | system $secure_perl_path, "-c", "$dir/eval" |
320 | system _perl_path, "-c", "$dir/eval" |
317 | and croak "trace failure, check trace process output - caught"; |
321 | and croak "trace failure, check trace process output - caught"; |
318 | |
322 | |
319 | my @inc = split /\x00/, do { |
323 | my @inc = split /\x00/, do { |
320 | open my $fh, "<:perlio", "$dir/out" |
324 | open my $fh, "<:perlio", "$dir/out" |
321 | or croak "$dir/out: $!"; |
325 | or croak "$dir/out: $!"; |
… | |
… | |
419 | =item $extractor->add_perl |
423 | =item $extractor->add_perl |
420 | |
424 | |
421 | Adds the perl binary itself to the file set, including the libperl dll, if |
425 | Adds the perl binary itself to the file set, including the libperl dll, if |
422 | needed. |
426 | needed. |
423 | |
427 | |
424 | #TODO# |
428 | =cut |
|
|
429 | |
|
|
430 | sub add_perl { |
|
|
431 | my ($self) = @_; |
|
|
432 | |
|
|
433 | $self->{set}{"$self->{bindir}/perl$Config{_exe}"} = [_perl_path]; |
|
|
434 | |
|
|
435 | # on debian, we have the special case of a perl binary linked against |
|
|
436 | # a static libperl.a (which is not available), but the Config says to use |
|
|
437 | # a shared library, which is in the wrong directory, too (which breaks |
|
|
438 | # every other perl installation on the system - they are so stupid). |
|
|
439 | |
|
|
440 | # that means we can't find the libperl.so, because dbeian actively breaks |
|
|
441 | # their perl install, and we don't need it. we work around this by silently |
|
|
442 | # not including the libperl if we cannot find it. |
|
|
443 | |
|
|
444 | if ($Config{useshrplib} eq "true") { |
|
|
445 | if (my $libperl = $self->{lib}{"CORE/$Config{libperl}"}) { |
|
|
446 | $self->{set}{"$self->{dlldir}/$Config{libperl}"} = $libperl; |
|
|
447 | } |
|
|
448 | } |
|
|
449 | } |
425 | |
450 | |
426 | =item $extractor->add_core_support |
451 | =item $extractor->add_core_support |
427 | |
452 | |
428 | Try to add modules and files needed to support commonly-used builtin |
453 | Try to add modules and files needed to support commonly-used builtin |
429 | language features. For example to open a scalar for I/O you need the |
454 | language features. For example to open a scalar for I/O you need the |