diff options
Diffstat (limited to 'contrib/perl5/lib/ExtUtils/MM_Unix.pm')
-rw-r--r-- | contrib/perl5/lib/ExtUtils/MM_Unix.pm | 144 |
1 files changed, 54 insertions, 90 deletions
diff --git a/contrib/perl5/lib/ExtUtils/MM_Unix.pm b/contrib/perl5/lib/ExtUtils/MM_Unix.pm index c11333d..891c533 100644 --- a/contrib/perl5/lib/ExtUtils/MM_Unix.pm +++ b/contrib/perl5/lib/ExtUtils/MM_Unix.pm @@ -1,3 +1,4 @@ +# $FreeBSD$ package ExtUtils::MM_Unix; use Exporter (); @@ -208,7 +209,6 @@ sub ExtUtils::MM_Unix::parse_version ; sub ExtUtils::MM_Unix::pasthru ; sub ExtUtils::MM_Unix::path ; sub ExtUtils::MM_Unix::perl_archive; -sub ExtUtils::MM_Unix::perl_archive_after; sub ExtUtils::MM_Unix::perl_script ; sub ExtUtils::MM_Unix::perldepend ; sub ExtUtils::MM_Unix::pm_to_blib ; @@ -306,8 +306,8 @@ sub cflags { $libperl ||= $self->{LIBPERL_A} || "libperl$self->{LIB_EXT}" ; $libperl =~ s/\.\$\(A\)$/$self->{LIB_EXT}/; - @cflags{qw(cc ccflags optimize shellflags)} - = @Config{qw(cc ccflags optimize shellflags)}; + @cflags{qw(cc ccflags optimize large split shellflags)} + = @Config{qw(cc ccflags optimize large split shellflags)}; my($optdebug) = ""; $cflags{shellflags} ||= ''; @@ -342,12 +342,16 @@ sub cflags { optimize=\"$cflags{optimize}\" perltype=\"$cflags{perltype}\" optdebug=\"$cflags{optdebug}\" + large=\"$cflags{large}\" + split=\"$cflags{'split'}\" eval '$prog' echo cc=\$cc echo ccflags=\$ccflags echo optimize=\$optimize echo perltype=\$perltype echo optdebug=\$optdebug + echo large=\$large + echo split=\$split `; my($line); foreach $line (@o){ @@ -365,7 +369,7 @@ sub cflags { $cflags{optimize} = $optdebug; } - for (qw(ccflags optimize perltype)) { + for (qw(ccflags optimize perltype large split)) { $cflags{$_} =~ s/^\s+//; $cflags{$_} =~ s/\s+/ /g; $cflags{$_} =~ s/\s+$//; @@ -408,6 +412,8 @@ sub cflags { CCFLAGS = $self->{CCFLAGS} OPTIMIZE = $self->{OPTIMIZE} PERLTYPE = $self->{PERLTYPE} +LARGE = $self->{LARGE} +SPLIT = $self->{SPLIT} MPOLLUTE = $pollute }; @@ -452,7 +458,7 @@ EOT push(@otherfiles, qw[./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all perlmain.c mon.out core core.*perl.*.? *perl.core so_locations pm_to_blib - *$(OBJ_EXT) *$(LIB_EXT) perl.exe + *~ */*~ */*/*~ *$(OBJ_EXT) *$(LIB_EXT) perl.exe $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def $(BASEEXT).exp ]); @@ -478,7 +484,7 @@ sub const_cccmd { return '' unless $self->needs_linking(); return $self->{CONST_CCCMD} = q{CCCMD = $(CC) -c $(INC) $(CCFLAGS) $(OPTIMIZE) \\ - $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \\ + $(PERLTYPE) $(LARGE) $(SPLIT) $(MPOLLUTE) $(DEFINE_VERSION) \\ $(XS_DEFINE_VERSION)}; } @@ -581,7 +587,7 @@ MM_VERSION = $ExtUtils::MakeMaker::VERSION for $tmp (qw/ FULLEXT BASEEXT PARENT_NAME DLBASE VERSION_FROM INC DEFINE OBJECT - LDFROM LINKTYPE PM_FILTER + LDFROM LINKTYPE / ) { next unless defined $self->{$tmp}; push @m, "$tmp = $self->{$tmp}\n"; @@ -675,10 +681,6 @@ EXPORT_LIST = $tmp push @m, " PERL_ARCHIVE = $tmp "; - $tmp = $self->perl_archive_after; - push @m, " -PERL_ARCHIVE_AFTER = $tmp -"; # push @m, q{ #INST_PM = }.join(" \\\n\t", sort values %{$self->{PM}}).q{ @@ -811,7 +813,7 @@ DIST_DEFAULT = $dist_default =item dist_basics (o) -Defines the targets distclean, distcheck, skipcheck, manifest, veryclean. +Defines the targets distclean, distcheck, skipcheck, manifest. =cut @@ -839,11 +841,6 @@ manifest : $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=mkmanifest \\ -e mkmanifest }; - - push @m, q{ -veryclean : realclean - $(RM_F) *~ *.orig */*~ */*.orig -}; join "", @m; } @@ -1066,7 +1063,7 @@ ARMAYBE = '.$armaybe.' OTHERLDFLAGS = '.$otherldflags.' INST_DYNAMIC_DEP = '.$inst_dynamic_dep.' -$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP) +$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP) '); if ($armaybe ne ':'){ $ldfrom = 'tmp$(LIB_EXT)'; @@ -1075,20 +1072,18 @@ $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists } $ldfrom = "-all $ldfrom -none" if ($^O eq 'dec_osf'); - # The IRIX linker doesn't use LD_RUN_PATH - my $ldrun = qq{-rpath "$self->{LD_RUN_PATH}"} - if ($^O eq 'irix' && $self->{LD_RUN_PATH}); + # Brain dead solaris linker does not use LD_RUN_PATH? + # This fixes dynamic extensions which need shared libs + my $ldrun = ''; + $ldrun = join ' ', map "-R$_", split /:/, $self->{LD_RUN_PATH} + if ($^O eq 'solaris'); - # For example in AIX the shared objects/libraries from previous builds - # linger quite a while in the shared dynalinker cache even when nobody - # is using them. This is painful if one for instance tries to restart - # a failed build because the link command will fail unnecessarily 'cos - # the shared object/library is 'busy'. - push(@m,' $(RM_F) $@ -'); + # The IRIX linker also doesn't use LD_RUN_PATH + $ldrun = qq{-rpath "$self->{LD_RUN_PATH}"} + if ($^O eq 'irix' && $self->{LD_RUN_PATH}); - push(@m,' LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) '.$ldrun.' $(LDDLFLAGS) '.$ldfrom. - ' $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST)'); + push(@m,' $(LD) -o $@ '.$ldrun.' $(LDDLFLAGS) '.$ldfrom. + ' $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) $(EXPORT_LIST)'); push @m, ' $(CHMOD) $(PERM_RWX) $@ '; @@ -1153,9 +1148,9 @@ in these dirs: @$dirs "; } - foreach $name (@$names){ - foreach $dir (@$dirs){ - next unless defined $dir; # $self->{PERL_SRC} may be undefined + foreach $dir (@$dirs){ + next unless defined $dir; # $self->{PERL_SRC} may be undefined + foreach $name (@$names){ my ($abs, $val); if ($self->file_name_is_absolute($name)) { # /foo/bar $abs = $name; @@ -1255,6 +1250,11 @@ eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}' next; } my($dev,$ino,$mode) = stat FIXIN; + # If they override perm_rwx, we won't notice it during fixin, + # because fixin is run through a new instance of MakeMaker. + # That is why we must run another CHMOD later. + $mode = oct($self->perm_rwx) unless $dev; + chmod $mode, $file; # Print out the new #! line (or equivalent). local $\; @@ -1262,15 +1262,7 @@ eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}' print FIXOUT $shb, <FIXIN>; close FIXIN; close FIXOUT; - - # can't rename/chmod open files on some DOSISH platforms - - # If they override perm_rwx, we won't notice it during fixin, - # because fixin is run through a new instance of MakeMaker. - # That is why we must run another CHMOD later. - $mode = oct($self->perm_rwx) unless $dev; - chmod $mode, $file; - + # can't rename open files on some DOSISH platforms unless ( rename($file, "$file.bak") ) { warn "Can't rename $file to $file.bak: $!"; next; @@ -1285,7 +1277,6 @@ eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}' } unlink "$file.bak"; } continue { - close(FIXIN) if fileno(FIXIN); chmod oct($self->perm_rwx), $file or die "Can't reset permissions for $file: $!\n"; system("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';; @@ -1362,7 +1353,7 @@ sub htmlifypods { if (defined $self->{PERL_SRC}) { $pod2html_exe = $self->catfile($self->{PERL_SRC},'pod','pod2html'); } else { - $pod2html_exe = $self->catfile($Config{scriptdirexp},'pod2html'); + $pod2html_exe = $self->catfile($Config{bin},'pod2html'); } unless ($pod2html_exe = $self->perl_script($pod2html_exe)) { # No pod2html but some HTMLxxxPODS to be installed @@ -1663,7 +1654,7 @@ sub init_main { unless ($self->{PERL_SRC}){ my($dir); - foreach $dir ($self->updir(),$self->catdir($self->updir(),$self->updir()),$self->catdir($self->updir(),$self->updir(),$self->updir()),$self->catdir($self->updir(),$self->updir(),$self->updir(),$self->updir())){ + foreach $dir ($self->updir(),$self->catdir($self->updir(),$self->updir()),$self->catdir($self->updir(),$self->updir(),$self->updir())){ if ( -f $self->catfile($dir,"config.sh") && @@ -1846,11 +1837,12 @@ usually solves this kind of problem. # of /prefix/{lib,man} $replace_prefix = qq[\$\(PREFIX\)]; + $search_prefix = $self->catdir($configure_prefix,"local"); for $install_variable (qw/ INSTALLBIN INSTALLSCRIPT /) { - $self->prefixify($install_variable,$configure_prefix,$replace_prefix); + $self->prefixify($install_variable,$search_prefix,$replace_prefix); } my $funkylibdir = $self->catdir($configure_prefix,"lib","perl5"); $funkylibdir = '' unless -d $funkylibdir; @@ -2377,7 +2369,7 @@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) # The front matter of the linkcommand... $linkcmd = join ' ', "\$(CC)", - grep($_, @Config{qw(ldflags ccdlflags)}); + grep($_, @Config{qw(large split ldflags ccdlflags)}); $linkcmd =~ s/\s+/ /g; $linkcmd =~ s,(perl\.exp),\$(PERL_INC)/$1,; @@ -2460,7 +2452,7 @@ MAP_PERLINC = @{$perlinc || []} MAP_STATIC = ", join(" \\\n\t", reverse sort keys %static), " -MAP_PRELIBS = $Config::Config{perllibs} $Config::Config{cryptlib} +MAP_PRELIBS = $Config::Config{libs} $Config::Config{cryptlib} "; if (defined $libperl) { @@ -2468,7 +2460,6 @@ MAP_PRELIBS = $Config::Config{perllibs} $Config::Config{cryptlib} } unless ($libperl && -f $lperl) { # Ilya's code... my $dir = $self->{PERL_SRC} || "$self->{PERL_ARCHLIB}/CORE"; - $dir = "$self->{PERL_ARCHLIB}/.." if $self->{UNINSTALLED_PERL}; $libperl ||= "libperl$self->{LIB_EXT}"; $libperl = "$dir/$libperl"; $lperl ||= "libperl$self->{LIB_EXT}"; @@ -2506,9 +2497,14 @@ MAP_LIBPERL = $libperl # SUNOS ld does not take the full path to a shared library my $llibperl = ($libperl)?'$(MAP_LIBPERL)':'-lperl'; + # Brain dead solaris linker does not use LD_RUN_PATH? + # This fixes dynamic extensions which need shared libs + my $ldfrom = ($^O eq 'solaris')? + join(' ', map "-R$_", split /:/, $self->{LD_RUN_PATH}):''; + push @m, " \$(MAP_TARGET) :: $tmp/perlmain\$(OBJ_EXT) \$(MAP_LIBPERL) \$(MAP_STATIC) \$(INST_ARCHAUTODIR)/extralibs.all - \$(MAP_LINKCMD) -o \$\@ \$(OPTIMIZE) $tmp/perlmain\$(OBJ_EXT) \$(LDFROM) \$(MAP_STATIC) $llibperl `cat \$(INST_ARCHAUTODIR)/extralibs.all` \$(MAP_PRELIBS) + \$(MAP_LINKCMD) -o \$\@ \$(OPTIMIZE) $tmp/perlmain\$(OBJ_EXT) $ldfrom \$(MAP_STATIC) $llibperl `cat \$(INST_ARCHAUTODIR)/extralibs.all` \$(MAP_PRELIBS) $self->{NOECHO}echo 'To install the new \"\$(MAP_TARGET)\" binary, call' $self->{NOECHO}echo ' make -f $makefilename inst_perl MAP_TARGET=\$(MAP_TARGET)' $self->{NOECHO}echo 'To remove the intermediate files say' @@ -2612,7 +2608,7 @@ sub manifypods { if (defined $self->{PERL_SRC}) { $pod2man_exe = $self->catfile($self->{PERL_SRC},'pod','pod2man'); } else { - $pod2man_exe = $self->catfile($Config{scriptdirexp},'pod2man'); + $pod2man_exe = $self->catfile($Config{bin},'pod2man'); } unless ($pod2man_exe = $self->perl_script($pod2man_exe)) { # Maybe a build by uninstalled Perl? @@ -3044,7 +3040,7 @@ sub pm_to_blib { pm_to_blib: $(TO_INST_PM) }.$self->{NOECHO}.q{$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \ "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \ - -e "pm_to_blib({qw{$(PM_TO_BLIB)}},'}.$autodir.q{','$(PM_FILTER)')" + -e "pm_to_blib({qw{$(PM_TO_BLIB)}},'}.$autodir.q{')" }.$self->{NOECHO}.q{$(TOUCH) $@ }; } @@ -3116,7 +3112,6 @@ sub processPL { my $list = ref($self->{PL_FILES}->{$plfile}) ? $self->{PL_FILES}->{$plfile} : [$self->{PL_FILES}->{$plfile}]; - my $target; foreach $target (@$list) { push @m, " all :: $target @@ -3156,22 +3151,8 @@ realclean purge :: clean push(@m, " $self->{RM_F} \$(INST_DYNAMIC) \$(INST_BOOT)\n"); push(@m, " $self->{RM_F} \$(INST_STATIC)\n"); } - # Issue a several little RM_F commands rather than risk creating a - # very long command line (useful for extensions such as Encode - # that have many files). - if (keys %{$self->{PM}}) { - my $line = ""; - foreach (values %{$self->{PM}}) { - if (length($line) + length($_) > 80) { - push @m, "\t$self->{RM_F} $line\n"; - $line = $_; - } - else { - $line .= " $_"; - } - } - push @m, "\t$self->{RM_F} $line\n" if $line; - } + push(@m, " $self->{RM_F} " . join(" ", values %{$self->{PM}}) . "\n") + if keys %{$self->{PM}}; my(@otherfiles) = ($self->{MAKEFILE}, "$self->{MAKEFILE}.old"); # Makefiles last push(@otherfiles, $attribs{FILES}) if $attribs{FILES}; @@ -3190,11 +3171,9 @@ form Foo/Bar and replaces the slash with C<::>. Returns the replacement. sub replace_manpage_separator { my($self,$man) = @_; if ($^O eq 'uwin') { - $man =~ s,/+,.,g; - } elsif ($Is_Dos) { - $man =~ s,/+,__,g; + $man =~ s,/+,.,g; } else { - $man =~ s,/+,::,g; + $man =~ s,/+,::,g; } $man; } @@ -3513,13 +3492,13 @@ WARN_IF_OLD_PACKLIST = $(PERL) -we 'exit unless -f $$ARGV[0];' \\ -e 'print "Please make sure the two installations are not conflicting\n";' UNINST=0 -VERBINST=0 +VERBINST=1 MOD_INSTALL = $(PERL) -I$(INST_LIB) -I$(PERL_LIB) -MExtUtils::Install \ -e "install({@ARGV},'$(VERBINST)',0,'$(UNINST)');" DOC_INSTALL = $(PERL) -e '$$\="\n\n";' \ --e 'print "=head2 ", scalar(localtime), ": C<", shift, ">", " L<", $$arg=shift, "|", $$arg, ">";' \ +-e 'print "=head2 ", scalar(localtime), ": C<", shift, ">", " L<", shift, ">";' \ -e 'print "=over 4";' \ -e 'while (defined($$key = shift) and defined($$val = shift)){print "=item *";print "C<$$key: $$val>";}' \ -e 'print "=back";' @@ -3814,21 +3793,6 @@ sub perl_archive return ""; } -=item perl_archive_after - -This is an internal method that returns path to a library which -should be put on the linker command line I<after> the external libraries -to be linked to dynamic extensions. This may be needed if the linker -is one-pass, and Perl includes some overrides for C RTL functions, -such as malloc(). - -=cut - -sub perl_archive_after -{ - return ""; -} - =item export_list This is internal method that returns name of a file that is |