X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FExtUtils%2FMM_Unix.pm;h=88240764d43d9cedbd0ea9acadf567e7f6b83ce3;hb=a689d17c141724192b54fa97a3c59fafae045cf3;hp=7c9657a127491021f9e70e3f4820604b248ca7e9;hpb=ee13e1759c1f1465f271937096a419896357e4d0;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index 7c9657a..8824076 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -377,7 +377,7 @@ sub cflags { if ($Is_PERL_OBJECT) { $self->{CCFLAGS} =~ s/-DPERL_OBJECT(\b|$)/-DPERL_CAPI/g; - if ($Is_Win32 && $Config{'cc'} =~ /^cl.exe/i) { + if ($Is_Win32 && $Config{'cc'} =~ /^cl/i) { # Turn off C++ mode of the MSC compiler $self->{CCFLAGS} =~ s/-TP(\s|$)//; $self->{OPTIMIZE} =~ s/-TP(\s|$)//; @@ -1391,9 +1391,9 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc) $h{$name} = 1; } elsif ($name =~ /\.PL$/) { ($pl_files{$name} = $name) =~ s/\.PL$// ; - } elsif ($Is_VMS && $name =~ /[._]pl$/i) { + } elsif (($Is_VMS || $Is_Dos) && $name =~ /[._]pl$/i) { # case-insensitive filesystem, one dot per name, so foo.h.PL - # under Unix appears as foo.h_pl under VMS + # under Unix appears as foo.h_pl under VMS or fooh.pl on Dos local($/); open(PL,$name); my $txt = ; close PL; if ($txt =~ /Extracting \S+ \(with variable substitutions/) { ($pl_files{$name} = $name) =~ s/[._]pl$//i ; @@ -1674,10 +1674,34 @@ from the perl source tree. } } 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 <catfile($self->{PERL_INC},"perl.h"))){ die qq{ Error: Unable to locate installed Perl libraries or Perl source code. @@ -2556,6 +2580,10 @@ sub manifypods { $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 <