diff options
author | 2009-10-12 18:24:18 +0000 | |
---|---|---|
committer | 2009-10-12 18:24:18 +0000 | |
commit | df042708019d82f10a844f81545b8510eb33a43b (patch) | |
tree | f1aa8a2977492c1084da8a9a42ad99fe382fba66 /gnu/usr.bin/perl/lib/ExtUtils/MM_Unix.pm | |
parent | to support virtual domains properly, smtpd needed to have the domain stored (diff) | |
download | wireguard-openbsd-df042708019d82f10a844f81545b8510eb33a43b.tar.xz wireguard-openbsd-df042708019d82f10a844f81545b8510eb33a43b.zip |
Merge in perl 5.10.1
Diffstat (limited to 'gnu/usr.bin/perl/lib/ExtUtils/MM_Unix.pm')
-rw-r--r-- | gnu/usr.bin/perl/lib/ExtUtils/MM_Unix.pm | 584 |
1 files changed, 235 insertions, 349 deletions
diff --git a/gnu/usr.bin/perl/lib/ExtUtils/MM_Unix.pm b/gnu/usr.bin/perl/lib/ExtUtils/MM_Unix.pm index 691a890eb36..ad28b22b823 100644 --- a/gnu/usr.bin/perl/lib/ExtUtils/MM_Unix.pm +++ b/gnu/usr.bin/perl/lib/ExtUtils/MM_Unix.pm @@ -1,6 +1,6 @@ package ExtUtils::MM_Unix; -require 5.005_03; # Maybe further back, dunno +require 5.006; use strict; @@ -9,39 +9,37 @@ use ExtUtils::MakeMaker::Config; use File::Basename qw(basename dirname); use DirHandle; -use vars qw($VERSION @ISA - $Is_OS2 $Is_VMS $Is_Win32 $Is_Dos - $Is_OSF $Is_IRIX $Is_NetBSD $Is_BSD - $Is_SunOS4 $Is_Solaris $Is_SunOS $Is_Interix - %Config_Override - ); +our %Config_Override; use ExtUtils::MakeMaker qw($Verbose neatvalue); -$VERSION = '6.42'; +# If we make $VERSION an our variable parse_version() breaks +use vars qw($VERSION); +$VERSION = '6.55_02'; require ExtUtils::MM_Any; -@ISA = qw(ExtUtils::MM_Any); +our @ISA = qw(ExtUtils::MM_Any); +my %Is; BEGIN { - $Is_OS2 = $^O eq 'os2'; - $Is_Win32 = $^O eq 'MSWin32' || $Config{osname} eq 'NetWare'; - $Is_Dos = $^O eq 'dos'; - $Is_VMS = $^O eq 'VMS'; - $Is_OSF = $^O eq 'dec_osf'; - $Is_IRIX = $^O eq 'irix'; - $Is_NetBSD = $^O eq 'netbsd'; - $Is_Interix = $^O eq 'interix'; - $Is_SunOS4 = $^O eq 'sunos'; - $Is_Solaris = $^O eq 'solaris'; - $Is_SunOS = $Is_SunOS4 || $Is_Solaris; - $Is_BSD = ($^O =~ /^(?:free|net|open)bsd$/ or + $Is{OS2} = $^O eq 'os2'; + $Is{Win32} = $^O eq 'MSWin32' || $Config{osname} eq 'NetWare'; + $Is{Dos} = $^O eq 'dos'; + $Is{VMS} = $^O eq 'VMS'; + $Is{OSF} = $^O eq 'dec_osf'; + $Is{IRIX} = $^O eq 'irix'; + $Is{NetBSD} = $^O eq 'netbsd'; + $Is{Interix} = $^O eq 'interix'; + $Is{SunOS4} = $^O eq 'sunos'; + $Is{Solaris} = $^O eq 'solaris'; + $Is{SunOS} = $Is{SunOS4} || $Is{Solaris}; + $Is{BSD} = ($^O =~ /^(?:free|net|open)bsd$/ or grep( $^O eq $_, qw(bsdos interix dragonfly) ) ); } BEGIN { - if( $Is_VMS ) { + if( $Is{VMS} ) { # For things like vmsify() require VMS::Filespec; VMS::Filespec->import; @@ -162,8 +160,8 @@ sub c_o { push @m, qq{ .C\$(OBJ_EXT): - $command \$*.C -} if !$Is_OS2 and !$Is_Win32 and !$Is_Dos; #Case-specific + $command $flags \$*.C +} if !$Is{OS2} and !$Is{Win32} and !$Is{Dos}; #Case-specific return join "", @m; } @@ -231,8 +229,7 @@ sub cflags { echo perltype=\$perltype echo optdebug=\$optdebug `; - my($line); - foreach $line (@o){ + foreach my $line (@o){ chomp $line; if ($line =~ /(.*?)=\s*(.*)\s*$/){ $cflags{$1} = $2; @@ -292,7 +289,7 @@ sub const_cccmd { return '' unless $self->needs_linking(); return $self->{CONST_CCCMD} = q{CCCMD = $(CC) -c $(PASTHRU_INC) $(INC) \\ - $(CCFLAGS) $(OPTIMIZE) $(COPTS) \\ + $(CCFLAGS) $(OPTIMIZE) \\ $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \\ $(XS_DEFINE_VERSION)}; } @@ -308,16 +305,19 @@ sub const_config { # --- Constants Sections --- my($self) = shift; - my(@m,$m); - push(@m,"\n# These definitions are from config.sh (via $INC{'Config.pm'})\n"); - push(@m,"\n# They may have been overridden via Makefile.PL or on the command line\n"); + my @m = <<"END"; + +# These definitions are from config.sh (via $INC{'Config.pm'}). +# They may have been overridden via Makefile.PL or on the command line. +END + my(%once_only); - foreach $m (@{$self->{CONFIG}}){ - # SITE*EXP macros are defined in &constants; avoid duplicates here - next if $once_only{$m}; - $self->{uc $m} = quote_paren($self->{uc $m}); - push @m, uc($m) , ' = ' , $self->{uc $m}, "\n"; - $once_only{$m} = 1; + foreach my $key (@{$self->{CONFIG}}){ + # SITE*EXP macros are defined in &constants; avoid duplicates here + next if $once_only{$key}; + $self->{uc $key} = quote_paren($self->{uc $key}); + push @m, uc($key) , ' = ' , $self->{uc $key}, "\n"; + $once_only{$key} = 1; } join('', @m); } @@ -338,19 +338,18 @@ sub const_loadlibs { # See ExtUtils::Liblist for details # }; - my($tmp); - for $tmp (qw/ - EXTRALIBS LDLOADLIBS BSLOADLIBS - /) { - next unless defined $self->{$tmp}; - push @m, "$tmp = $self->{$tmp}\n"; + for my $tmp (qw/ + EXTRALIBS LDLOADLIBS BSLOADLIBS + /) { + next unless defined $self->{$tmp}; + push @m, "$tmp = $self->{$tmp}\n"; } # don't set LD_RUN_PATH if empty - for $tmp (qw/ - LD_RUN_PATH - /) { - next unless $self->{$tmp}; - push @m, "$tmp = $self->{$tmp}\n"; + for my $tmp (qw/ + LD_RUN_PATH + /) { + next unless $self->{$tmp}; + push @m, "$tmp = $self->{$tmp}\n"; } return join "", @m; } @@ -394,7 +393,7 @@ sub constants { PERLRUN FULLPERLRUN ABSPERLRUN PERLRUNINST FULLPERLRUNINST ABSPERLRUNINST PERL_CORE - PERM_RW PERM_RWX + PERM_DIR PERM_RW PERM_RWX ) ) { @@ -858,7 +857,7 @@ sub dynamic_bs { BOOTSTRAP = ' unless $self->has_link_code(); - my $target = $Is_VMS ? '$(MMS$TARGET)' : '$@'; + my $target = $Is{VMS} ? '$(MMS$TARGET)' : '$@'; return sprintf <<'MAKE_FRAG', ($target) x 5; BOOTSTRAP = $(BASEEXT).bs @@ -897,10 +896,10 @@ sub dynamic_lib { my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || ""; my($armaybe) = $attribs{ARMAYBE} || $self->{ARMAYBE} || ":"; my($ldfrom) = '$(LDFROM)'; - $armaybe = 'ar' if ($Is_OSF and $armaybe eq ':'); + $armaybe = 'ar' if ($Is{OSF} and $armaybe eq ':'); my(@m); - my $ld_opt = $Is_OS2 ? '$(OPTIMIZE) ' : ''; # Useful on other systems too? - my $ld_fix = $Is_OS2 ? '|| ( $(RM_F) $@ && sh -c false )' : ''; + my $ld_opt = $Is{OS2} ? '$(OPTIMIZE) ' : ''; # Useful on other systems too? + my $ld_fix = $Is{OS2} ? '|| ( $(RM_F) $@ && sh -c false )' : ''; push(@m,' # This section creates the dynamically loadable $(INST_DYNAMIC) # from $(OBJECT) and possibly $(MYEXTLIB). @@ -916,10 +915,10 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP). push(@m,' $(ARMAYBE) cr '.$ldfrom.' $(OBJECT)'."\n"); push(@m,' $(RANLIB) '."$ldfrom\n"); } - $ldfrom = "-all $ldfrom -none" if $Is_OSF; + $ldfrom = "-all $ldfrom -none" if $Is{OSF}; # The IRIX linker doesn't use LD_RUN_PATH - my $ldrun = $Is_IRIX && $self->{LD_RUN_PATH} ? + my $ldrun = $Is{IRIX} && $self->{LD_RUN_PATH} ? qq{-rpath "$self->{LD_RUN_PATH}"} : ''; # For example in AIX the shared objects/libraries from previous builds @@ -932,7 +931,7 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP). my $libs = '$(LDLOADLIBS)'; - if (($Is_NetBSD || $Is_Interix) && $Config{'useshrplib'} eq 'true') { + 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 @@ -994,7 +993,7 @@ Finds the executables PERL and FULLPERL sub find_perl { my($self, $ver, $names, $dirs, $trace) = @_; - my($name, $dir); + if ($trace >= 2){ print "Looking for perl $ver by these names: @$names @@ -1005,8 +1004,10 @@ in these dirs: my $stderr_duped = 0; local *STDERR_COPY; - unless ($Is_BSD) { - if( open(STDERR_COPY, '>&STDERR') ) { + + unless ($Is{BSD}) { + # >& and lexical filehandles together give 5.6.2 indigestion + if( open(STDERR_COPY, '>&STDERR') ) { ## no critic $stderr_duped = 1; } else { @@ -1017,8 +1018,8 @@ WARNING } } - foreach $name (@$names){ - foreach $dir (@$dirs){ + foreach my $name (@$names){ + foreach my $dir (@$dirs){ next unless defined $dir; # $self->{PERL_SRC} may be undefined my ($abs, $val); if ($self->file_name_is_absolute($name)) { # /foo/bar @@ -1043,12 +1044,15 @@ WARNING # ( http://www.freebsd.org/cgi/query-pr.cgi?pr=51535 ) # we cannot use the fancier more portable way in here # but instead need to use the traditional 2>&1 construct. - if ($Is_BSD) { + if ($Is{BSD}) { $val = `$version_check 2>&1`; } else { close STDERR if $stderr_duped; $val = `$version_check`; - open STDERR, '>&STDERR_COPY' if $stderr_duped; + + # 5.6.2's 3-arg open doesn't work with >& + open STDERR, ">&STDERR_COPY" ## no critic + if $stderr_duped; } if ($val =~ /^VER_OK/m) { @@ -1080,11 +1084,9 @@ sub fixin { # stolen from the pink Camel book, more or less my $file_new = "$file.new"; my $file_bak = "$file.bak"; - local (*FIXIN); - local (*FIXOUT); - open( FIXIN, $file ) or croak "Can't process '$file': $!"; + open( my $fixin, '<', $file ) or croak "Can't process '$file': $!"; local $/ = "\n"; - chomp( my $line = <FIXIN> ); + 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; @@ -1092,7 +1094,7 @@ sub fixin { # stolen from the pink Camel book, more or less # Now look (in reverse) for interpreter in absolute PATH (unless perl). my $interpreter; - if ( $cmd eq "perl" ) { + if ( $cmd =~ m{^perl(?:\z|[^a-z])} ) { if ( $Config{startperl} =~ m,^\#!.*/perl, ) { $interpreter = $Config{startperl}; $interpreter =~ s,^\#!,,; @@ -1103,10 +1105,10 @@ sub fixin { # stolen from the pink Camel book, more or less } else { my (@absdirs) - = reverse grep { $self->file_name_is_absolute } $self->path; + = reverse grep { $self->file_name_is_absolute($_) } $self->path; $interpreter = ''; - my ($dir); - foreach $dir (@absdirs) { + + foreach my $dir (@absdirs) { if ( $self->maybe_command($cmd) ) { warn "Ignoring $interpreter in $file\n" if $Verbose && $interpreter; @@ -1131,7 +1133,7 @@ sub fixin { # stolen from the pink Camel book, more or less $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 +} unless $Is{Win32}; # this won't work on win32, so don't } else { warn "Can't find $cmd in PATH, $file unchanged" @@ -1139,17 +1141,17 @@ eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}' next; } - unless ( open( FIXOUT, ">$file_new" ) ) { + open( my $fixout, ">", "$file_new" ) or do { 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; + print $fixout $shb, <$fixin>; + close $fixin; + close $fixout; chmod 0666, $file_bak; unlink $file_bak; @@ -1168,7 +1170,6 @@ eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}' unlink $file_bak; } continue { - close(FIXIN) if fileno(FIXIN); system("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':'; } } @@ -1178,7 +1179,7 @@ sub _rename { my($old, $new) = @_; foreach my $file ($old, $new) { - if( $Is_VMS and basename($file) !~ /\./ ) { + if( $Is{VMS} and basename($file) !~ /\./ ) { # rename() in 5.8.0 on VMS will not rename a file if it # does not contain a dot yet it returns success. $file = "$file."; @@ -1254,17 +1255,17 @@ Called by init_main. sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc) my($self) = @_; - my($name, %dir, %xs, %c, %h, %pl_files, %pm); + my(%dir, %xs, %c, %h, %pl_files, %pm); my %ignore = map {( $_ => 1 )} qw(Makefile.PL Build.PL test.pl t); # ignore the distdir - $Is_VMS ? $ignore{"$self->{DISTVNAME}.dir"} = 1 + $Is{VMS} ? $ignore{"$self->{DISTVNAME}.dir"} = 1 : $ignore{$self->{DISTVNAME}} = 1; - @ignore{map lc, keys %ignore} = values %ignore if $Is_VMS; + @ignore{map lc, keys %ignore} = values %ignore if $Is{VMS}; - foreach $name ($self->lsdir($Curdir)){ + foreach my $name ($self->lsdir($Curdir)){ next if $name =~ /\#/; next if $name eq $Curdir or $name eq $Updir or $ignore{$name}; next unless $self->libscan($name); @@ -1283,14 +1284,14 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc) $h{$name} = 1; } elsif ($name =~ /\.PL\z/) { ($pl_files{$name} = $name) =~ s/\.PL\z// ; - } elsif (($Is_VMS || $Is_Dos) && $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 or fooh.pl on Dos - local($/); open(PL,$name); my $txt = <PL>; close PL; + local($/); open(my $pl, '<', $name); my $txt = <$pl>; close $pl; if ($txt =~ /Extracting \S+ \(with variable substitutions/) { ($pl_files{$name} = $name) =~ s/[._]pl\z//i ; } - else { + else { $pm{$name} = $self->catfile($self->{INST_LIBDIR},$name); } } elsif ($name =~ /\.(p[ml]|pod)\z/){ @@ -1322,7 +1323,7 @@ sub init_MANPODS { # Set up names of manual pages to generate from pods foreach my $man (qw(MAN1 MAN3)) { - if ( $self->{"${man}PODS"} + if ( $self->{"${man}PODS"} or $self->{"INSTALL${man}DIR"} =~ /^(none|\s*)$/ ) { $self->{"${man}PODS"} ||= {}; @@ -1330,7 +1331,7 @@ sub init_MANPODS { else { my $init_method = "init_${man}PODS"; $self->$init_method(); - } + } } } @@ -1338,19 +1339,18 @@ sub init_MANPODS { sub _has_pod { my($self, $file) = @_; - local *FH; my($ispod)=0; - if (open(FH,"<$file")) { - while (<FH>) { - if (/^=(?:head\d+|item|pod)\b/) { - $ispod=1; - last; - } - } - close FH; + if (open( my $fh, '<', $file )) { + while (<$fh>) { + if (/^=(?:head\d+|item|pod)\b/) { + $ispod=1; + last; + } + } + close $fh; } else { - # If it doesn't exist yet, we assume, it has pods in it - $ispod = 1; + # If it doesn't exist yet, we assume, it has pods in it + $ispod = 1; } return $ispod; @@ -1461,7 +1461,7 @@ sub init_PM { # that's important for nested modules. unless( $self->{PMLIBDIRS} ) { - if( $Is_VMS ) { + if( $Is{VMS} ) { # Avoid logical name vs directory collisions $self->{PMLIBDIRS} = ['./lib', "./$self->{BASEEXT}"]; } @@ -1499,8 +1499,9 @@ sub init_PM { return; } return if /\#/; - return if /~$/; # emacs temp files - return if /,v$/; # RCS files + return if /~$/; # emacs temp files + return if /,v$/; # RCS files + return if m{\.swp$}; # vim swap files my $path = $File::Find::name; my $prefix = $self->{INST_LIBDIR}; @@ -1596,7 +1597,7 @@ sub init_main { if (-f $self->catfile($dir,"config_h.SH") && -f $self->catfile($dir,"perl.h") && - -f $self->catfile($dir,"lib","Exporter.pm") + -f $self->catfile($dir,"lib","strict.pm") ) { $self->{PERL_SRC}=$dir ; last; @@ -1615,11 +1616,11 @@ sub init_main { $self->catdir("$self->{PERL_SRC}","xlib",$Cross::platform); $self->{PERL_INC} = $self->catdir("$self->{PERL_SRC}","xlib",$Cross::platform, - $Is_Win32?("CORE"):()); + $Is{Win32}?("CORE"):()); } else { $self->{PERL_ARCHLIB} = $self->{PERL_LIB}; - $self->{PERL_INC} = ($Is_Win32) ? + $self->{PERL_INC} = ($Is{Win32}) ? $self->catdir($self->{PERL_LIB},"CORE") : $self->{PERL_SRC}; } @@ -1627,11 +1628,11 @@ sub init_main { unless ( -s $self->catfile($self->{PERL_SRC},'cflags') or - $Is_VMS + $Is{VMS} && -s $self->catfile($self->{PERL_SRC},'perlshr_attr.opt') or - $Is_Win32 + $Is{Win32} ){ warn qq{ You cannot build extensions below the perl source tree after executing @@ -1661,14 +1662,14 @@ from the perl source tree. # uninstalled Perl outside of Perl build tree my $lib; for my $dir (@INC) { - $lib = $dir, last if -e $self->catdir($dir, "Config.pm"); + $lib = $dir, last if -e $self->catfile($dir, "Config.pm"); } if ($lib) { # Win32 puts its header files in /perl/src/lib/CORE. # Unix leaves them in /perl/src. - my $inc = $Is_Win32 ? $self->catdir($lib, "CORE" ) + my $inc = $Is{Win32} ? $self->catdir($lib, "CORE" ) : dirname $lib; - if (-e $self->catdir($inc, "perl.h")) { + if (-e $self->catfile($inc, "perl.h")) { $self->{PERL_LIB} = $lib; $self->{PERL_ARCHLIB} = $lib; $self->{PERL_INC} = $inc; @@ -1693,17 +1694,17 @@ EOP # Get some stuff out of %Config if we haven't yet done so print STDOUT "CONFIG must be an array ref\n" - if ($self->{CONFIG} and ref $self->{CONFIG} ne 'ARRAY'); + if ($self->{CONFIG} and ref $self->{CONFIG} ne 'ARRAY'); $self->{CONFIG} = [] unless (ref $self->{CONFIG}); push(@{$self->{CONFIG}}, @ExtUtils::MakeMaker::Get_from_Config); push(@{$self->{CONFIG}}, 'shellflags') if $Config{shellflags}; my(%once_only); foreach my $m (@{$self->{CONFIG}}){ - next if $once_only{$m}; - print STDOUT "CONFIG key '$m' does not exist in Config.pm\n" - unless exists $Config{$m}; - $self->{uc $m} ||= $Config{$m}; - $once_only{$m} = 1; + next if $once_only{$m}; + print STDOUT "CONFIG key '$m' does not exist in Config.pm\n" + unless exists $Config{$m}; + $self->{uc $m} ||= $Config{$m}; + $once_only{$m} = 1; } # This is too dangerous: @@ -1723,11 +1724,11 @@ EOP $self->{LIBPERL_A} ||= "libperl$self->{LIB_EXT}"; - # make a simple check if we find Exporter + # make a simple check if we find strict warn "Warning: PERL_LIB ($self->{PERL_LIB}) seems not to be a perl library directory - (Exporter.pm not found)" - unless -f $self->catfile("$self->{PERL_LIB}","Exporter.pm") || - $self->{NAME} eq "ExtUtils::MakeMaker"; + (strict.pm not found)" + unless -f $self->catfile("$self->{PERL_LIB}","strict.pm") || + $self->{NAME} eq "ExtUtils::MakeMaker"; } =item init_others @@ -1742,69 +1743,6 @@ TOUCH, CP, MV, CHMOD, UMASK_NULL, ECHO, ECHO_N sub init_others { # --- Initialize Other Attributes my($self) = shift; - $self->{LD} ||= 'ld'; - - # Compute EXTRALIBS, BSLOADLIBS and LDLOADLIBS from $self->{LIBS} - # Lets look at $self->{LIBS} carefully: It may be an anon array, a string or - # undefined. In any case we turn it into an anon array: - - # May check $Config{libs} too, thus not empty. - $self->{LIBS} = [$self->{LIBS}] unless ref $self->{LIBS}; - - $self->{LIBS} = [''] unless @{$self->{LIBS}} && defined $self->{LIBS}[0]; - $self->{LD_RUN_PATH} = ""; - my($libs); - foreach $libs ( @{$self->{LIBS}} ){ - $libs =~ s/^\s*(.*\S)\s*$/$1/; # remove leading and trailing whitespace - my(@libs) = $self->extliblist($libs); - if ($libs[0] or $libs[1] or $libs[2]){ - # LD_RUN_PATH now computed by ExtUtils::Liblist - ($self->{EXTRALIBS}, $self->{BSLOADLIBS}, - $self->{LDLOADLIBS}, $self->{LD_RUN_PATH}) = @libs; - last; - } - } - - if ( $self->{OBJECT} ) { - $self->{OBJECT} =~ s!\.o(bj)?\b!\$(OBJ_EXT)!g; - } else { - # init_dirscan should have found out, if we have C files - $self->{OBJECT} = ""; - $self->{OBJECT} = '$(BASEEXT)$(OBJ_EXT)' if @{$self->{C}||[]}; - } - $self->{OBJECT} =~ s/\n+/ \\\n\t/g; - $self->{BOOTDEP} = (-f "$self->{BASEEXT}_BS") ? "$self->{BASEEXT}_BS" : ""; - $self->{PERLMAINCC} ||= '$(CC)'; - $self->{LDFROM} = '$(OBJECT)' unless $self->{LDFROM}; - - # Sanity check: don't define LINKTYPE = dynamic if we're skipping - # the 'dynamic' section of MM. We don't have this problem with - # 'static', since we either must use it (%Config says we can't - # use dynamic loading) or the caller asked for it explicitly. - if (!$self->{LINKTYPE}) { - $self->{LINKTYPE} = $self->{SKIPHASH}{'dynamic'} - ? 'static' - : ($Config{usedl} ? 'dynamic' : 'static'); - }; - - $self->{NOOP} ||= '$(SHELL) -c true'; - $self->{NOECHO} = '@' unless defined $self->{NOECHO}; - - $self->{FIRST_MAKEFILE} ||= $self->{MAKEFILE} || 'Makefile'; - $self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE}; - $self->{MAKEFILE_OLD} ||= $self->{MAKEFILE}.'.old'; - $self->{MAKE_APERL_FILE} ||= $self->{MAKEFILE}.'.aperl'; - - # Some makes require a wrapper around macros passed in on the command - # line. - $self->{MACROSTART} ||= ''; - $self->{MACROEND} ||= ''; - - # Not everybody uses -f to indicate "use this Makefile instead" - $self->{USEMAKEFILE} ||= '-f'; - - $self->{SHELL} ||= $Config{sh} || '/bin/sh'; - $self->{ECHO} ||= 'echo'; $self->{ECHO_N} ||= 'echo -n'; $self->{RM_F} ||= "rm -f"; @@ -1814,27 +1752,16 @@ sub init_others { # --- Initialize Other Attributes $self->{CP} ||= "cp"; $self->{MV} ||= "mv"; $self->{CHMOD} ||= "chmod"; - $self->{MKPATH} ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e mkpath'; - $self->{EQUALIZE_TIMESTAMP} ||= - '$(ABSPERLRUN) "-MExtUtils::Command" -e eqtime'; - - $self->{UNINST} ||= 0; - $self->{VERBINST} ||= 0; - $self->{MOD_INSTALL} ||= - $self->oneliner(<<'CODE', ['-MExtUtils::Install']); -install({@ARGV}, '$(VERBINST)', 0, '$(UNINST)'); -CODE - $self->{DOC_INSTALL} ||= - '$(ABSPERLRUN) "-MExtUtils::Command::MM" -e perllocal_install'; - $self->{UNINSTALL} ||= - '$(ABSPERLRUN) "-MExtUtils::Command::MM" -e uninstall'; - $self->{WARN_IF_OLD_PACKLIST} ||= - '$(ABSPERLRUN) "-MExtUtils::Command::MM" -e warn_if_old_packlist'; - $self->{FIXIN} ||= - q{$(PERLRUN) "-MExtUtils::MY" -e "MY->fixin(shift)"}; - - $self->{UMASK_NULL} ||= "umask 0"; - $self->{DEV_NULL} ||= "> /dev/null 2>&1"; + $self->{FALSE} ||= 'false'; + $self->{TRUE} ||= 'true'; + + $self->{LD} ||= 'ld'; + + $self->SUPER::init_others(@_); + + # After SUPER::init_others so $Config{shell} has a + # chance to get set. + $self->{SHELL} ||= '/bin/sh'; return 1; } @@ -1931,7 +1858,7 @@ sub init_PERL { my $thisperl = $self->canonpath($^X); $thisperl .= $Config{exe_ext} unless # VMS might have a file version # at the end - $Is_VMS ? $thisperl =~ m/$Config{exe_ext}(;\d+)?$/i + $Is{VMS} ? $thisperl =~ m/$Config{exe_ext}(;\d+)?$/i : $thisperl =~ m/$Config{exe_ext}$/i; # We need a relative path to perl when in the core. @@ -1958,7 +1885,7 @@ sub init_PERL { # When built for debugging, VMS doesn't create perl.exe but ndbgperl.exe. my $perl_name = 'perl'; - $perl_name = 'ndbgperl' if $Is_VMS && + $perl_name = 'ndbgperl' if $Is{VMS} && defined $Config{usevmsdebug} && $Config{usevmsdebug} eq 'define'; # XXX This logic is flawed. If "miniperl" is anywhere in the path @@ -1976,6 +1903,11 @@ sub init_PERL { } else { $self->{ABSPERL} = $self->rel2abs($self->{ABSPERL}); + + # Quote the perl command if it contains whitespace + $self->{ABSPERL} = $self->quote_literal($self->{ABSPERL}) + if $self->{ABSPERL} =~ /\s/; + $self->{ABSPERL} = 'MCR '.$self->{ABSPERL} if $has_mcr; } @@ -2044,6 +1976,7 @@ Called by init_main. Initializes PERL_* sub init_PERM { my($self) = shift; + $self->{PERM_DIR} = 755 unless defined $self->{PERM_DIR}; $self->{PERM_RW} = 644 unless defined $self->{PERM_RW}; $self->{PERM_RWX} = 755 unless defined $self->{PERM_RWX}; @@ -2088,16 +2021,16 @@ sub install { my(@m); push @m, q{ -install :: all pure_install doc_install +install :: pure_install doc_install $(NOECHO) $(NOOP) -install_perl :: all pure_perl_install doc_perl_install +install_perl :: pure_perl_install doc_perl_install $(NOECHO) $(NOOP) -install_site :: all pure_site_install doc_site_install +install_site :: pure_site_install doc_site_install $(NOECHO) $(NOOP) -install_vendor :: all pure_vendor_install doc_vendor_install +install_vendor :: pure_vendor_install doc_vendor_install $(NOECHO) $(NOOP) pure_install :: pure_$(INSTALLDIRS)_install @@ -2112,7 +2045,7 @@ pure__install : pure_site_install doc__install : doc_site_install $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site -pure_perl_install :: +pure_perl_install :: all $(NOECHO) $(MOD_INSTALL) \ read }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \ write }.$self->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \ @@ -2126,7 +2059,7 @@ pure_perl_install :: }.$self->catdir('$(SITEARCHEXP)','auto','$(FULLEXT)').q{ -pure_site_install :: +pure_site_install :: all $(NOECHO) $(MOD_INSTALL) \ read }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \ write }.$self->catfile('$(DESTINSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q{ \ @@ -2139,7 +2072,7 @@ pure_site_install :: $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ }.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{ -pure_vendor_install :: +pure_vendor_install :: all $(NOECHO) $(MOD_INSTALL) \ read }.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \ write }.$self->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{ \ @@ -2150,7 +2083,7 @@ pure_vendor_install :: $(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \ $(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR) -doc_perl_install :: +doc_perl_install :: all $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) -$(NOECHO) $(DOC_INSTALL) \ @@ -2161,7 +2094,7 @@ doc_perl_install :: EXE_FILES "$(EXE_FILES)" \ >> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{ -doc_site_install :: +doc_site_install :: all $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) -$(NOECHO) $(DOC_INSTALL) \ @@ -2172,7 +2105,7 @@ doc_site_install :: EXE_FILES "$(EXE_FILES)" \ >> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{ -doc_vendor_install :: +doc_vendor_install :: all $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod -$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB) -$(NOECHO) $(DOC_INSTALL) \ @@ -2215,7 +2148,7 @@ sub installbin { my @exefiles = @{$self->{EXE_FILES}}; return "" unless @exefiles; - @exefiles = map vmsify($_), @exefiles if $Is_VMS; + @exefiles = map vmsify($_), @exefiles if $Is{VMS}; my %fromto; for my $from (@exefiles) { @@ -2225,7 +2158,7 @@ sub installbin { my $to = $self->libscan($path); print "libscan($from) => '$to'\n" if ($Verbose >=2); - $to = vmsify($to) if $Is_VMS; + $to = vmsify($to) if $Is{VMS}; $fromto{$from} = $to; } my @to = values %fromto; @@ -2399,16 +2332,14 @@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib if( exists $self->{INCLUDE_EXT} ){ my $found = 0; - my $incl; - my $xx; - ($xx = $File::Find::name) =~ s,.*?/auto/,,s; + (my $xx = $File::Find::name) =~ s,.*?/auto/,,s; $xx =~ s,/?$_,,; $xx =~ s,/,::,g; # Throw away anything not explicitly marked for inclusion. # DynaLoader is implied. - foreach $incl ((@{$self->{INCLUDE_EXT}},'DynaLoader')){ + foreach my $incl ((@{$self->{INCLUDE_EXT}},'DynaLoader')){ if( $xx eq $incl ){ $found++; last; @@ -2417,15 +2348,12 @@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib return unless $found; } elsif( exists $self->{EXCLUDE_EXT} ){ - my $excl; - my $xx; - - ($xx = $File::Find::name) =~ s,.*?/auto/,,s; + (my $xx = $File::Find::name) =~ s,.*?/auto/,,s; $xx =~ s,/?$_,,; $xx =~ s,/,::,g; # Throw away anything explicitly marked for exclusion - foreach $excl (@{$self->{EXCLUDE_EXT}}){ + foreach my $excl (@{$self->{EXCLUDE_EXT}}){ return if( $xx eq $excl ); } } @@ -2453,7 +2381,7 @@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib push @$extra, $_; } - grep(s/^(.*)/"-I$1"/, @{$perlinc || []}); + s/^(.*)/"-I$1"/ for @{$perlinc || []}; $target ||= "perl"; $tmp ||= "."; @@ -2483,10 +2411,10 @@ MAP_PRELIBS = $Config{perllibs} $Config{cryptlib} if (! -f $libperl and ! -f $lperl) { # We did not find a static libperl. Maybe there is a shared one? - if ($Is_SunOS) { + if ($Is{SunOS}) { $lperl = $libperl = "$dir/$Config{libperl}"; # SUNOS ld does not take the full path to a shared library - $libperl = '' if $Is_SunOS4; + $libperl = '' if $Is{SunOS4}; } } @@ -2510,8 +2438,7 @@ $(INST_ARCHAUTODIR)/extralibs.all : $(INST_ARCHAUTODIR)$(DFSEP).exists '.join(" $(NOECHO) $(TOUCH) $@ '; - my $catfile; - foreach $catfile (@$extra){ + foreach my $catfile (@$extra){ push @m, "\tcat $catfile >> \$\@\n"; } @@ -2583,7 +2510,7 @@ $(OBJECT) : $(FIRST_MAKEFILE) ' if $self->{OBJECT}; - my $newer_than_target = $Is_VMS ? '$(MMS$SOURCE_LIST)' : '$?'; + my $newer_than_target = $Is{VMS} ? '$(MMS$SOURCE_LIST)' : '$?'; my $mpl_args = join " ", map qq["$_"], @ARGV; $m .= sprintf <<'MAKE_FRAG', $newer_than_target, $mpl_args; @@ -2598,7 +2525,7 @@ $(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) $(PERLRUN) Makefile.PL %s $(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <==" $(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <==" - false + $(FALSE) MAKE_FRAG @@ -2628,8 +2555,8 @@ also has_link_code()) sub needs_linking { my($self) = shift; - my($child,$caller); - $caller = (caller(0))[3]; + + my $caller = (caller(0))[3]; confess("needs_linking called too early") if $caller =~ /^ExtUtils::MakeMaker::/; return $self->{NEEDS_LINKING} if defined $self->{NEEDS_LINKING}; @@ -2637,7 +2564,7 @@ sub needs_linking { $self->{NEEDS_LINKING} = 1; return 1; } - foreach $child (keys %{$self->{CHILDREN}}) { + foreach my $child (keys %{$self->{CHILDREN}}) { if ($self->{CHILDREN}->{$child}->needs_linking) { $self->{NEEDS_LINKING} = 1; return 1; @@ -2656,13 +2583,13 @@ parse a file and return what you think is the ABSTRACT sub parse_abstract { my($self,$parsefile) = @_; my $result; - local *FH; + local $/ = "\n"; - open(FH,$parsefile) or die "Could not open '$parsefile': $!"; + open(my $fh, '<', $parsefile) or die "Could not open '$parsefile': $!"; my $inpod = 0; my $package = $self->{DISTNAME}; $package =~ s/-/::/g; - while (<FH>) { + while (<$fh>) { $inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod; next if !$inpod; chop; @@ -2670,7 +2597,8 @@ sub parse_abstract { $result = $2; last; } - close FH; + close $fh; + return $result; } @@ -2683,7 +2611,8 @@ It will return the string "undef" if it can't figure out what $VERSION 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. +parse_version() will try to C<use version> before checking for +C<$VERSION> so the following will work. $VERSION = qv(1.2.3); @@ -2692,16 +2621,17 @@ parse_version() will try to C<use version> before checking for C<$VERSION> so th sub parse_version { my($self,$parsefile) = @_; my $result; - local *FH; + local $/ = "\n"; local $_; - open(FH,$parsefile) or die "Could not open '$parsefile': $!"; + open(my $fh, '<', $parsefile) or die "Could not open '$parsefile': $!"; my $inpod = 0; - while (<FH>) { + while (<$fh>) { $inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod; next if $inpod || /^\s*#/; chop; - next unless /(?<!\\)([\$*])(([\w\:\']*)\bVERSION)\b.*\=/; + next if /^\s*(if|unless)/; + next unless m{(?<!\\) ([\$*]) (([\w\:\']*) \bVERSION)\b .* =}x; my $eval = qq{ package ExtUtils::MakeMaker::_version; no strict; @@ -2718,14 +2648,15 @@ sub parse_version { \$$2=undef; do { $_ - }; \$$2 + }; + \$$2; }; local $^W = 0; - $result = eval($eval); + $result = eval($eval); ## no critic warn "Could not eval '$eval' in $parsefile: $@" if $@; - last; + last if defined $result; } - close FH; + close $fh; $result = "undef" unless defined $result; return $result; @@ -2741,13 +2672,13 @@ subdirectories. sub pasthru { my($self) = shift; - my(@m,$key); + my(@m); my(@pasthru); - my($sep) = $Is_VMS ? ',' : ''; + my($sep) = $Is{VMS} ? ',' : ''; $sep .= "\\\n\t"; - foreach $key (qw(LIB LIBPERL_A LINKTYPE OPTIMIZE + foreach my $key (qw(LIB LIBPERL_A LINKTYPE OPTIMIZE PREFIX INSTALL_BASE) ) { @@ -2755,7 +2686,7 @@ sub pasthru { push @pasthru, "$key=\"\$($key)\""; } - foreach $key (qw(DEFINE INC)) { + foreach my $key (qw(DEFINE INC)) { next unless defined $self->{$key}; push @pasthru, "PASTHRU_$key=\"\$(PASTHRU_$key)\""; } @@ -2796,7 +2727,7 @@ sub perldepend { # We do NOT just update config.h because that is not sufficient. # An out of date config.h is not fatal but complains loudly! $(PERL_INC)/config.h: $(PERL_SRC)/config.sh - -$(NOECHO) $(ECHO) "Warning: $(PERL_INC)/config.h out of date with $(PERL_SRC)/config.sh"; false + -$(NOECHO) $(ECHO) "Warning: $(PERL_INC)/config.h out of date with $(PERL_SRC)/config.sh"; $(FALSE) $(PERL_ARCHLIB)/Config.pm: $(PERL_SRC)/config.sh $(NOECHO) $(ECHO) "Warning: $(PERL_ARCHLIB)/Config.pm may be out of date with $(PERL_SRC)/config.sh" @@ -2858,35 +2789,6 @@ $(OBJECT) : $(PERL_HDRS) } -=item perm_rw (o) - -Returns the attribute C<PERM_RW> or the string C<644>. -Used as the string that is passed -to the C<chmod> command to set the permissions for read/writeable files. -MakeMaker chooses C<644> because it has turned out in the past that -relying on the umask provokes hard-to-track bug reports. -When the return value is used by the perl function C<chmod>, it is -interpreted as an octal value. - -=cut - -sub perm_rw { - return shift->{PERM_RW}; -} - -=item perm_rwx (o) - -Returns the attribute C<PERM_RWX> or the string C<755>, -i.e. the string that is passed -to the C<chmod> command to set the permissions for executable files. -See also perl_rw. - -=cut - -sub perm_rwx { - return shift->{PERM_RWX}; -} - =item pm_to_blib Defines target that copies all files in the hash PM to their @@ -2898,11 +2800,12 @@ sub pm_to_blib { my $self = shift; my($autodir) = $self->catdir('$(INST_LIB)','auto'); my $r = q{ -pm_to_blib : $(TO_INST_PM) +pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM) }; + # VMS will swallow '' and PM_FILTER is often empty. So use q[] my $pm_to_blib = $self->oneliner(<<CODE, ['-MExtUtils::Install']); -pm_to_blib({\@ARGV}, '$autodir', '\$(PM_FILTER)') +pm_to_blib({\@ARGV}, '$autodir', q[\$(PM_FILTER)], '\$(PERM_DIR)') CODE my @cmds = $self->split_command($pm_to_blib, %{$self->{PM}}); @@ -2946,6 +2849,14 @@ sub postamble { ""; } +# transform dot-separated version string into comma-separated quadruple +# examples: '1.2.3.4.5' => '1,2,3,4' +# '1.2.3' => '1,2,3,0' +sub _ppd_version { + my ($self, $string) = @_; + return join ',', ((split /\./, $string), (0) x 4)[0..3]; +} + =item ppd Defines target that creates a PPD (Perl Package Description) file @@ -2956,8 +2867,6 @@ for a binary distribution. sub ppd { my($self) = @_; - my ($pack_ver) = join ",", (split (/\./, $self->{VERSION}), (0)x4)[0..3]; - my $abstract = $self->{ABSTRACT} || ''; $abstract =~ s/\n/\\n/sg; $abstract =~ s/</</g; @@ -2967,23 +2876,36 @@ sub ppd { $author =~ s/</</g; $author =~ s/>/>/g; - my $ppd_xml = sprintf <<'PPD_HTML', $pack_ver, $abstract, $author; + my $ppd_xml = sprintf <<'PPD_HTML', $self->{VERSION}, $abstract, $author; <SOFTPKG NAME="$(DISTNAME)" VERSION="%s"> - <TITLE>$(DISTNAME)</TITLE> <ABSTRACT>%s</ABSTRACT> <AUTHOR>%s</AUTHOR> PPD_HTML $ppd_xml .= " <IMPLEMENTATION>\n"; - foreach my $prereq (sort keys %{$self->{PREREQ_PM}}) { - my $pre_req = $prereq; - $pre_req =~ s/::/-/g; - my ($dep_ver) = join ",", (split (/\./, $self->{PREREQ_PM}{$prereq}), - (0) x 4) [0 .. 3]; - $ppd_xml .= sprintf <<'PPD_OUT', $pre_req, $dep_ver; - <DEPENDENCY NAME="%s" VERSION="%s" /> -PPD_OUT + if ( $self->{MIN_PERL_VERSION} ) { + my $min_perl_version = $self->_ppd_version($self->{MIN_PERL_VERSION}); + $ppd_xml .= sprintf <<'PPD_PERLVERS', $min_perl_version; + <PERLCORE VERSION="%s" /> +PPD_PERLVERS + + } + + # Don't add "perl" to requires. perl dependencies are + # handles by ARCHITECTURE. + my %prereqs = %{$self->{PREREQ_PM}}; + delete $prereqs{perl}; + # Build up REQUIRE + foreach my $prereq (sort keys %prereqs) { + my $name = $prereq; + $name .= '::' unless $name =~ /::/; + my $version = $prereqs{$prereq}+0; # force numification + + my %attrs = ( NAME => $name ); + $attrs{VERSION} = $version if $version; + my $attrs = join " ", map { qq[$_="$attrs{$_}"] } keys %attrs; + $ppd_xml .= qq( <REQUIRE $attrs />\n); } my $archname = $Config{archname}; @@ -2991,10 +2913,9 @@ PPD_OUT # archname did not change from 5.6 to 5.8, but those versions may # not be not binary compatible so now we append the part of the # version that changes when binary compatibility may change - $archname .= "-". substr($Config{version},0,3); + $archname .= "-$Config{PERL_REVISION}.$Config{PERL_VERSION}"; } $ppd_xml .= sprintf <<'PPD_OUT', $archname; - <OS NAME="$(OSNAME)" /> <ARCHITECTURE NAME="%s" /> PPD_OUT @@ -3065,7 +2986,7 @@ sub prefixify { print STDERR " prefixify $var => $path\n" if $Verbose >= 2; print STDERR " from $sprefix to $rprefix\n" if $Verbose >= 2; - if( $self->{ARGS}{PREFIX} && $self->file_name_is_absolute($path) && + if( $self->{ARGS}{PREFIX} && $path !~ s{^\Q$sprefix\E\b}{$rprefix}s ) { @@ -3099,7 +3020,7 @@ sub processPL { : [$pl_files->{$plfile}]; foreach my $target (@$list) { - if( $Is_VMS ) { + if( $Is{VMS} ) { $plfile = vmsify($self->eliminate_macros($plfile)); $target = vmsify($self->eliminate_macros($target)); } @@ -3388,11 +3309,11 @@ Defines targets to process subdirectories. sub subdirs { # --- Sub-directory Sections --- my($self) = shift; - my(@m,$dir); + my(@m); # This method provides a mechanism to automatically deal with # subdirectories containing further Makefile.PL scripts. # It calls the subdir_x() method for each subdirectory. - foreach $dir (@{$self->{DIR}}){ + foreach my $dir (@{$self->{DIR}}){ push(@m, $self->subdir_x($dir)); #### print "Including $dir subdirectory\n"; } @@ -3508,40 +3429,6 @@ sub test_via_script { } -=item tools_other (o) - - my $make_frag = $MM->tools_other; - -Returns a make fragment containing definitions for the macros init_others() -initializes. - -=cut - -sub tools_other { - my($self) = shift; - my @m; - - # We set PM_FILTER as late as possible so it can see all the earlier - # on macro-order sensitive makes such as nmake. - for my $tool (qw{ SHELL CHMOD CP MV NOOP NOECHO RM_F RM_RF TEST_F TOUCH - UMASK_NULL DEV_NULL MKPATH EQUALIZE_TIMESTAMP - ECHO ECHO_N - UNINST VERBINST - MOD_INSTALL DOC_INSTALL UNINSTALL - WARN_IF_OLD_PACKLIST - MACROSTART MACROEND - USEMAKEFILE - PM_FILTER - FIXIN - } ) - { - next unless defined $self->{$tool}; - push @m, "$tool = $self->{$tool}\n"; - } - - return join "", @m; -} - =item tool_xsubpp (o) Determines typemaps, xsubpp version, prototype behaviour. @@ -3568,23 +3455,22 @@ sub tool_xsubpp { my $tmdir = File::Spec->catdir($self->{PERL_LIB},"ExtUtils"); my(@tmdeps) = $self->catfile($tmdir,'typemap'); if( $self->{TYPEMAPS} ){ - my $typemap; - foreach $typemap (@{$self->{TYPEMAPS}}){ - if( ! -f $typemap ){ - warn "Typemap $typemap not found.\n"; - } - else{ - push(@tmdeps, $typemap); - } - } + foreach my $typemap (@{$self->{TYPEMAPS}}){ + if( ! -f $typemap ) { + warn "Typemap $typemap not found.\n"; + } + else { + push(@tmdeps, $typemap); + } + } } push(@tmdeps, "typemap") if -f "typemap"; my(@tmargs) = map("-typemap $_", @tmdeps); if( exists $self->{XSOPT} ){ - unshift( @tmargs, $self->{XSOPT} ); + unshift( @tmargs, $self->{XSOPT} ); } - if ($Is_VMS && + if ($Is{VMS} && $Config{'ldflags'} && $Config{'ldflags'} =~ m!/Debug!i && (!exists($self->{XSOPT}) || $self->{XSOPT} !~ /linenumbers/) @@ -3641,7 +3527,7 @@ sub top_targets { pure_all :: config pm_to_blib subdirs linkext $(NOECHO) $(NOOP) -subdirs :: +subdirs :: $(MYEXTLIB) $(NOECHO) $(NOOP) config :: $(FIRST_MAKEFILE) blibdirs |