use ExtUtils::MakeMaker qw($Verbose neatvalue);
-$VERSION = '1.51_01';
+$VERSION = '1.54_02';
require ExtUtils::MM_Any;
@ISA = qw(ExtUtils::MM_Any);
$Is_SunOS4 = $^O eq 'sunos';
$Is_Solaris = $^O eq 'solaris';
$Is_SunOS = $Is_SunOS4 || $Is_Solaris;
- $Is_BSD = $^O =~ /^(?:free|net|open)bsd$/ or
- $^O eq 'bsdos' or $^O eq 'interix';
+ $Is_BSD = $^O =~ /^(?:(?:free|net|open)bsd|bsdos|interix|dragonfly)$/;
}
BEGIN {
$(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest
veryclean : realclean
- $(RM_F) *~ *.orig */*~ */*.orig
+ $(RM_F) *~ */*~ *.orig */*.orig *.bak */*.bak *.old */*.old
MAKE_FRAG
my $libs = '$(LDLOADLIBS)';
- if (($Is_NetBSD || $Is_Interix) && $Config{'useshrplib'}) {
+ if (($Is_NetBSD || $Is_Interix) && $Config{'useshrplib'} eq 'true') {
# Use nothing on static perl platforms, and to the flags needed
# to link against the shared libperl library on shared perl
# platforms. We peek at lddlflags to see if we need -Wl,-R
print "Executing $abs\n" if ($trace >= 2);
my $version_check = qq{$abs -le "require $ver; print qq{VER_OK}"};
+ $version_check = "$Config{run} $version_check"
+ if defined $Config{run} and length $Config{run};
+
# To avoid using the unportable 2>&1 to suppress STDERR,
# we close it before running the command.
# However, thanks to a thread library bug in many BSDs
open STDERR, '>&STDERR_COPY' if $stderr_duped;
}
- if ($val =~ /^VER_OK/) {
+ if ($val =~ /^VER_OK/m) {
print "Using PERL=$abs\n" if $trace;
return $abs;
} elsif ($trace >= 2) {
=cut
-sub fixin { # stolen from the pink Camel book, more or less
- my($self, @files) = @_;
+sub fixin { # stolen from the pink Camel book, more or less
+ my ( $self, @files ) = @_;
- my($does_shbang) = $Config{'sharpbang'} =~ /^\s*\#\!/;
+ my ($does_shbang) = $Config{'sharpbang'} =~ /^\s*\#\!/;
for my $file (@files) {
my $file_new = "$file.new";
my $file_bak = "$file.bak";
- local(*FIXIN);
- local(*FIXOUT);
- open(FIXIN, $file) or croak "Can't process '$file': $!";
- local $/ = "\n";
- chomp(my $line = <FIXIN>);
- next unless $line =~ s/^\s*\#!\s*//; # Not a shbang file.
- # Now figure out the interpreter name.
- my($cmd,$arg) = split ' ', $line, 2;
- $cmd =~ s!^.*/!!;
-
- # Now look (in reverse) for interpreter in absolute PATH (unless perl).
+ local (*FIXIN);
+ local (*FIXOUT);
+ open( FIXIN, $file ) or croak "Can't process '$file': $!";
+ local $/ = "\n";
+ chomp( my $line = <FIXIN> );
+ next unless $line =~ s/^\s*\#!\s*//; # Not a shbang file.
+ # Now figure out the interpreter name.
+ my ( $cmd, $arg ) = split ' ', $line, 2;
+ $cmd =~ s!^.*/!!;
+
+ # Now look (in reverse) for interpreter in absolute PATH (unless perl).
my $interpreter;
- if ($cmd eq "perl") {
- if ($Config{startperl} =~ m,^\#!.*/perl,) {
+ if ( $cmd eq "perl" ) {
+ if ( $Config{startperl} =~ m,^\#!.*/perl, ) {
$interpreter = $Config{startperl};
$interpreter =~ s,^\#!,,;
- } else {
+ }
+ else {
$interpreter = $Config{perlpath};
}
- } else {
- my(@absdirs) = reverse grep {$self->file_name_is_absolute} $self->path;
- $interpreter = '';
- my($dir);
- foreach $dir (@absdirs) {
- if ($self->maybe_command($cmd)) {
- warn "Ignoring $interpreter in $file\n" if $Verbose && $interpreter;
- $interpreter = $self->catfile($dir,$cmd);
- }
- }
- }
- # Figure out how to invoke interpreter on this machine.
-
- my($shb) = "";
- if ($interpreter) {
- print STDOUT "Changing sharpbang in $file to $interpreter" if $Verbose;
- # this is probably value-free on DOSISH platforms
- if ($does_shbang) {
- $shb .= "$Config{'sharpbang'}$interpreter";
- $shb .= ' ' . $arg if defined $arg;
- $shb .= "\n";
- }
- $shb .= qq{
+ }
+ else {
+ my (@absdirs)
+ = reverse grep { $self->file_name_is_absolute } $self->path;
+ $interpreter = '';
+ my ($dir);
+ foreach $dir (@absdirs) {
+ if ( $self->maybe_command($cmd) ) {
+ warn "Ignoring $interpreter in $file\n"
+ if $Verbose && $interpreter;
+ $interpreter = $self->catfile( $dir, $cmd );
+ }
+ }
+ }
+
+ # Figure out how to invoke interpreter on this machine.
+
+ my ($shb) = "";
+ if ($interpreter) {
+ print STDOUT "Changing sharpbang in $file to $interpreter"
+ if $Verbose;
+
+ # this is probably value-free on DOSISH platforms
+ if ($does_shbang) {
+ $shb .= "$Config{'sharpbang'}$interpreter";
+ $shb .= ' ' . $arg if defined $arg;
+ $shb .= "\n";
+ }
+ $shb .= qq{
eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}'
if 0; # not running under some shell
-} unless $Is_Win32; # this won't work on win32, so don't
- } else {
- warn "Can't find $cmd in PATH, $file unchanged"
- if $Verbose;
- next;
- }
+} unless $Is_Win32; # this won't work on win32, so don't
+ }
+ else {
+ warn "Can't find $cmd in PATH, $file unchanged"
+ if $Verbose;
+ next;
+ }
- unless ( open(FIXOUT,">$file_new") ) {
- warn "Can't create new $file: $!\n";
- next;
- }
-
- # Print out the new #! line (or equivalent).
- local $\;
- undef $/;
- print FIXOUT $shb, <FIXIN>;
- close FIXIN;
- close FIXOUT;
+ unless ( open( FIXOUT, ">$file_new" ) ) {
+ warn "Can't create new $file: $!\n";
+ next;
+ }
+
+ # Print out the new #! line (or equivalent).
+ local $\;
+ local $/;
+ print FIXOUT $shb, <FIXIN>;
+ close FIXIN;
+ close FIXOUT;
chmod 0666, $file_bak;
unlink $file_bak;
- unless ( _rename($file, $file_bak) ) {
- warn "Can't rename $file to $file_bak: $!";
- next;
- }
- unless ( _rename($file_new, $file) ) {
- warn "Can't rename $file_new to $file: $!";
- unless ( _rename($file_bak, $file) ) {
- warn "Can't rename $file_bak back to $file either: $!";
- warn "Leaving $file renamed as $file_bak\n";
- }
- next;
- }
- unlink $file_bak;
- } continue {
- close(FIXIN) if fileno(FIXIN);
- system("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';;
+ unless ( _rename( $file, $file_bak ) ) {
+ warn "Can't rename $file to $file_bak: $!";
+ next;
+ }
+ unless ( _rename( $file_new, $file ) ) {
+ warn "Can't rename $file_new to $file: $!";
+ unless ( _rename( $file_bak, $file ) ) {
+ warn "Can't rename $file_bak back to $file either: $!";
+ warn "Leaving $file renamed as $file_bak\n";
+ }
+ next;
+ }
+ unlink $file_bak;
+ }
+ continue {
+ close(FIXIN) if fileno(FIXIN);
+ system("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
}
}
my $inc_carp_dir = dirname($INC{'Carp.pm'});
unless ($self->{PERL_SRC}){
- my($dir);
- foreach $dir ($Updir,
- $self->catdir($Updir,$Updir),
- $self->catdir($Updir,$Updir,$Updir),
- $self->catdir($Updir,$Updir,$Updir,$Updir),
- $self->catdir($Updir,$Updir,$Updir,$Updir,$Updir))
- {
- if (
- -f $self->catfile($dir,"config_h.SH")
- &&
- -f $self->catfile($dir,"perl.h")
- &&
- -f $self->catfile($dir,"lib","Exporter.pm")
- ) {
- $self->{PERL_SRC}=$dir ;
- last;
- }
- }
+ foreach my $dir_count (1..8) { # 8 is the VMS limit for nesting
+ my $dir = $self->catdir(($Updir) x $dir_count);
+
+ if (-f $self->catfile($dir,"config_h.SH") &&
+ -f $self->catfile($dir,"perl.h") &&
+ -f $self->catfile($dir,"lib","Exporter.pm")
+ ) {
+ $self->{PERL_SRC}=$dir ;
+ last;
+ }
+ }
}
warn "PERL_CORE is set but I can't find your PERL_SRC!\n" if
MAP_LIBPERL "$(MAP_LIBPERL)" \
>> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{
-} if -f 'Makefile.PL';
+};
push @m, q{
inst_perl: pure_inst_perl doc_inst_perl
=item parse_version
-parse a file and return what you think is $VERSION in this file set to.
+ my $version = MM->parse_version($file);
+
+Parse a $file and return what $VERSION is set to by the first assignment.
It will return the string "undef" if it can't figure out what $VERSION
-is. $VERSION should be for all to see, so our $VERSION or plain $VERSION
-are okay, but my $VERSION is not.
+is. $VERSION should be for all to see, so C<our $VERSION> or plain $VERSION
+are okay, but C<my $VERSION> is not.
+
+parse_version() will try to C<use version> before checking for C<$VERSION> so the following will work.
+
+ $VERSION = qv(1.2.3);
=cut
my $eval = qq{
package ExtUtils::MakeMaker::_version;
no strict;
+ BEGIN { eval {
+ require version;
+ "version"->import;
+ } }
local $1$2;
\$$2=undef; do {
$(PERL_INC)/regnodes.h \
$(PERL_INC)/scope.h \
$(PERL_INC)/sv.h \
- $(PERL_INC)/thrdvar.h \
$(PERL_INC)/thread.h \
$(PERL_INC)/unixish.h \
$(PERL_INC)/util.h
}
# note: 'test.pl' name is also hardcoded in init_dirscan()
my(@m);
- my $subdirs_test = ($self->{DIR} && @{$self->{DIR}} ? 'subdirs-test' : '');
push(@m,"
TEST_VERBOSE=0
TEST_TYPE=test_\$(LINKTYPE)
testdb :: testdb_\$(LINKTYPE)
-test :: \$(TEST_TYPE) $subdirs_test
+test :: \$(TEST_TYPE) subdirs-test
+
+subdirs-test ::
+ \$(NOECHO) \$(NOOP)
+
");
foreach my $dir (@{ $self->{DIR} }) {
- my $test = $self->oneliner(sprintf <<'CODE', $dir);
-chdir '%s';
-system '$(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) test $(PASTHRU)'
- if -f '$(FIRST_MAKEFILE)';
-CODE
+ my $test = $self->cd($dir, '$(MAKE) test $(PASTHRU)');
+
+ push @m, <<END
+subdirs-test ::
+ \$(NOECHO) $test
- push(@m, "\nsubdirs-test ::\n\t\$(NOECHO) $test\n");
+END
}
push(@m, "\t\$(NOECHO) \$(ECHO) 'No tests defined for \$(NAME) extension.'\n")