}
} else {
# we should also consider $ENV{PERL5LIB} here
+ my $old = $self->{PERL_LIB} || $self->{PERL_ARCHLIB} || $self->{PERL_INC};
$self->{PERL_LIB} ||= $Config::Config{privlibexp};
$self->{PERL_ARCHLIB} ||= $Config::Config{archlibexp};
$self->{PERL_INC} = $self->catdir("$self->{PERL_ARCHLIB}","CORE"); # wild guess for now
my $perl_h;
+
+ if (not -f ($perl_h = $self->catfile($self->{PERL_INC},"perl.h"))
+ and not $old){
+ # Maybe somebody tries to build an extension with an
+ # uninstalled Perl outside of Perl build tree
+ my $found;
+ for my $dir (@INC) {
+ $found = $dir, last if -e $self->catdir($dir, "Config.pm");
+ }
+ if ($found) {
+ my $inc = dirname $found;
+ if (-e $self->catdir($inc, "perl.h")) {
+ $self->{PERL_LIB} = $found;
+ $self->{PERL_ARCHLIB} = $found;
+ $self->{PERL_INC} = $inc;
+ $self->{UNINSTALLED_PERL} = 1;
+ print STDOUT <<EOP;
+... Detected uninstalled Perl. Trying to continue.
+EOP
+ }
+ }
+ }
+
unless (-f ($perl_h = $self->catfile($self->{PERL_INC},"perl.h"))){
die qq{
Error: Unable to locate installed Perl libraries or Perl source code.
$pod2man_exe = $self->catfile($Config{scriptdirexp},'pod2man');
}
unless ($pod2man_exe = $self->perl_script($pod2man_exe)) {
+ # Maybe a build by uninstalled Perl?
+ $pod2man_exe = $self->catfile($self->{PERL_INC}, "pod", "pod2man");
+ }
+ unless ($pod2man_exe = $self->perl_script($pod2man_exe)) {
# No pod2man but some MAN3PODS to be installed
print <<END;