From: Perl 5 Porters Date: Wed, 7 Feb 1996 21:55:01 +0000 (+0000) Subject: Updated for MakeMaker 5.21. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c2e89b3d4c42bd78ac97ca0d6583127ee34942db;p=p5sagit%2Fp5-mst-13.2.git Updated for MakeMaker 5.21. --- diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm index 94d343b..ebc5018 100644 --- a/lib/ExtUtils/Liblist.pm +++ b/lib/ExtUtils/Liblist.pm @@ -9,8 +9,8 @@ use File::Basename; my $Config_libext = $Config{lib_ext} || ".a"; sub ext { - my($potential_libs, $Verbose) = @_; - if ($Config{'osname'} eq 'os2' and $Config{libs}) { + my($self,$potential_libs, $Verbose) = @_; + if ($Config{osname} =~ m|^os/?2$|i and $Config{libs}) { # Dynamic libraries are not transitive, so we may need including # the libraries linked against perl.dll again. @@ -70,7 +70,7 @@ sub ext { # For gcc-2.6.2 on linux (March 1995), DLD can not load # .sa libraries, with the exception of libm.sa, so we # deliberately skip them. - if (@fullname = lsdir($thispth,"^lib$thislib\.$so\.[0-9]+")){ + if (@fullname = $self->lsdir($thispth,"^lib$thislib\.$so\.[0-9]+")){ # Take care that libfoo.so.10 wins against libfoo.so.9. # Compare two libraries to find the most recent version # number. E.g. if you have libfoo.so.9.0.7 and @@ -169,18 +169,8 @@ sub ext { ("@extralibs", "@bsloadlibs", "@ldloadlibs",join(":",@ld_run_path)); } -sub lsdir { #yes, duplicate code seems less hassle than having an - #extra file with only lsdir - my($dir, $regex) = @_; - local(*DIR, @ls); - opendir(DIR, $dir || ".") or return (); - @ls = readdir(DIR); - closedir(DIR); - @ls = grep(/$regex/, @ls) if $regex; - @ls; -} - 1; + __END__ =head1 NAME diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm index fde022c..8b6625e 100644 --- a/lib/ExtUtils/MM_VMS.pm +++ b/lib/ExtUtils/MM_VMS.pm @@ -15,6 +15,7 @@ use VMS::Filespec; use File::Basename; Exporter::import('ExtUtils::MakeMaker', '$Verbose', '&neatvalue'); +unshift @MM::ISA, 'ExtUtils::MM_VMS'; sub eliminate_macros { @@ -98,7 +99,7 @@ sub catdir { $rslt = vmspath($self->eliminate_macros($spath)."/$sdir"); } else { $rslt = vmspath($dir); } - print "catdir(",join(',',@_[1..$#_]),") = |$rslt|\n" if $Verbose >= 3; + print "catdir($path,$dir) = |$rslt|\n" if $Verbose >= 3; $rslt; } @@ -116,13 +117,10 @@ sub catfile { my($spath) = $path; $spath =~ s/.dir$//; if ( $spath =~ /^[^\)\]\/:>]+\)$/ && basename($file) eq $file) { $rslt = "$spath$file"; } - else { - $rslt = $self->eliminate_macros($spath); - $rslt = vmsify($rslt.($rslt ? '/' : '').unixify($file)); - } + else { $rslt = vmsify($self->eliminate_macros($spath).'/'.unixify($file)); } } else { $rslt = vmsify($file); } - print "catfile(",join(',',@_[1..$#_]),") = |$rslt|\n" if $Verbose >= 3; + print "catfile($path,$file) = |$rslt|\n" if $Verbose >= 3; $rslt; } @@ -277,7 +275,7 @@ sub init_others { $self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE}; $self->{NOECHO} ||= '@ '; $self->{RM_F} = '$(PERL) -e "foreach (@ARGV) { 1 while ( -d $_ ? rmdir $_ : unlink $_)}"'; - $self->{RM_RF} = '$(PERL) "-I$(INST_LIB)" -e "use File::Path; @dirs = map(VMS::Filespec::unixify($_),@ARGV); rmtree(\@dirs,0,0)"'; + $self->{RM_RF} = '$(PERL) -e "use File::Path; @dirs = map(VMS::Filespec::unixify($_),@ARGV); rmtree(\@dirs,0,0)"'; $self->{TOUCH} = '$(PERL) -e "$t=time; foreach (@ARGV) { -e $_ ? utime($t,$t,@ARGV) : (open(F,qq(>$_)),close F)}"'; $self->{CHMOD} = '$(PERL) -e "chmod @ARGV"'; # expect Unix syntax from MakeMaker $self->{CP} = 'Copy/NoConfirm'; @@ -698,7 +696,7 @@ sub tools_other { ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]); $self = $ExtUtils::MakeMaker::Parent[-1]; } - qq! + " # Assumes \$(MMS) invokes MMS or MMK # (It is assumed in some cases later that the default makefile name # (Descrip.MMS for MM[SK]) is used.) @@ -715,8 +713,7 @@ RM_F = $self->{RM_F} RM_RF = $self->{RM_RF} UMASK_NULL = $self->{UMASK_NULL} MKPATH = Create/Directory -EQUALIZE_TIMESTAMP = \$(PERL) -we "open F,"">\$ARGV[1]"";close F;utime((stat(""\$ARGV[0]""))[8,9],\$ARGV[1])" -!; +"; } @@ -874,30 +871,17 @@ sub dlsyms { return '' unless $self->needs_linking(); my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {}; - my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || []; - my($srcdir)= $attribs{PERL_SRC} || $self->{PERL_SRC} || ''; + my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || []; my(@m); - unless ($self->{SKIPHASH}{'dynamic'}) { - push(@m,' + push(@m,' dynamic :: rtls.opt $(INST_ARCHAUTODIR)$(BASEEXT).opt $(NOOP) -'); - if ($srcdir) { - my($opt) = $self->catfile($srcdir,'perlshr.opt'); - push(@m,"# Depend on $(BASEEXT).opt to insure we copy here *after* autogenerating (wrong) rtls.opt in Mksymlists -rtls.opt : $opt \$(BASEEXT).opt - Copy/Log $opt Sys\$Disk:[]rtls.opt -"); - } - else { - push(@m,' + # rtls.opt is built in the same step as $(BASEEXT).opt rtls.opt : $(BASEEXT).opt $(TOUCH) $(MMS$TARGET) -'); - } - } +') unless $self->{SKIPHASH}{'dynamic'}; push(@m,' static :: $(INST_ARCHAUTODIR)$(BASEEXT).opt @@ -1131,8 +1115,8 @@ sub installbin { for $from (@{$self->{EXE_FILES}}) { my($path) = '$(INST_EXE)' . basename($from); local($_) = $path; # backward compatibility - $to = $self->exescan($path); - print "exescan($from) => '$to'\n" if ($Verbose >=2); + $to = $self->libscan($path); + print "libscan($from) => '$to'\n" if ($Verbose >=2); $fromto{$from}=$to; } @to = values %fromto; @@ -1181,8 +1165,7 @@ sub pasthru { my(@pasthru); foreach $key (qw(INSTALLPRIVLIB INSTALLARCHLIB INSTALLBIN - INSTALLMAN1DIR INSTALLMAN3DIR LIBPERL_A - LINKTYPE PREFIX)){ + INSTALLMAN1DIR INSTALLMAN3DIR LIBPERL_A LINKTYPE)){ push @pasthru, "$key=\"$self->{$key}\""; } @@ -1408,17 +1391,14 @@ sub install { $self = $ExtUtils::MakeMaker::Parent[-1]; } my(@m); - push @m, q[ + push @m, q{ doc_install :: - ],$self->{NOECHO},q[Write Sys$Output "Appending installation info to $(INST_ARCHLIB)perllocal.pod" - ],$self->{NOECHO},q[$(PERL) -e "print q{use ExtUtils::MakeMaker; }" >.MM_tmp - ],$self->{NOECHO},q[$(PERL) -e "print q{MY->new({})->writedoc(}" >>.MM_tmp - ],$self->{NOECHO},q[$(PERL) -e "print q{'Module','$(NAME)','LINKTYPE=$(LINKTYPE)',}" >>.MM_tmp - ],$self->{NOECHO},q[$(PERL) -e "print q{'VERSION=$(VERSION)','XS_VERSION=$(XS_VERSION)',}" >>.MM_tmp - ],$self->{NOECHO},q[$(PERL) -e "print q{'EXE_FILES=$(EXE_FILES)')}" >>.MM_tmp - ],$self->{NOECHO},q[$(PERL) "-I$(PERL_LIB)" "-I$(PERL_ARCHLIB)" .MM_tmp >>$(INSTALLARCHLIB)perllocal.pod - ],$self->{NOECHO},q[If F$Search(".MM_tmp") .nes. "" then Delete/NoLog .MM_tmp; -]; + },$self->{NOECHO},q{Write Sys$Output "Appending installation info to $(INST_ARCHLIB)perllocal.pod" + },$self->{NOECHO},q{$(PERL) "-I$(PERL_LIB)" "-I$(PERL_ARCHLIB)" \\ + -e "use ExtUtils::MakeMaker; MY->new({})->writedoc('Module', '$(NAME)', \\ + 'LINKTYPE=$(LINKTYPE)', 'VERSION=$(VERSION)', 'XS_VERSION=$(XS_VERSION)', 'EXE_FILES=$(EXE_FILES)')" \\ + >>$(INSTALLARCHLIB)perllocal.pod +}; push(@m, " install :: pure_install doc_install @@ -1582,14 +1562,13 @@ test : \$(TEST_TYPE) push(@m, ' If F$Search("',$vmsdir,'$(MAKEFILE)").nes."" Then $(PERL) -e "chdir ',"'$vmsdir'", '; print `$(MMS) $(PASTHRU2) test`'."\n"); } - push(@m, "\t$self->{NOECHO}Write Sys\$Output \"No tests defined for \$(NAME) extension.\"\n") + push(@m, "\t$self->{NOECHO}Write Sys\$Output 'No tests defined for \$(NAME) extension.'\n") unless $tests or -f "test.pl" or @{$self->{DIR}}; push(@m, "\n"); push(@m, "test_dynamic :: all\n"); push(@m, $self->test_via_harness('$(FULLPERL)', $tests)) if $tests; push(@m, $self->test_via_script('$(FULLPERL)', 'test.pl')) if -f "test.pl"; - push(@m, " \$(NOOP)\n") if (!$tests && ! -f "test.pl"); push(@m, "\n"); # Occasionally we may face this degenerate target: @@ -1599,11 +1578,10 @@ test : \$(TEST_TYPE) push(@m, "test_static :: all \$(MAP_TARGET)\n"); push(@m, $self->test_via_harness('$(MAP_TARGET)', $tests)) if $tests; push(@m, $self->test_via_script('$(MAP_TARGET)', 'test.pl')) if -f "test.pl"; - push(@m, "\t$self->{NOECHO}\$(NOOP)\n") if (!$tests && ! -f "test.pl"); push(@m, "\n"); } else { - push @m, "test_static :: test_dynamic\n\t$self->{NOECHO}\$(NOOP)\n"; + push @m, "test_static :: test_dynamic\n"; } join('',@m); @@ -1834,7 +1812,7 @@ sub dir_target { push @m, " ${vmsdir}.exists :: \$(PERL_INC)perl.h $self->{NOECHO}\$(MKPATH) $vmsdir - $self->{NOECHO}\$(EQUALIZE_TIMESTAMP) \$(MMS\$SOURCE) \$(MMS\$TARGET) + $self->{NOECHO}\$(TOUCH) ${vmsdir}.exists "; } join "", @m; @@ -1861,3 +1839,14 @@ sub nicetext { 1; __END__ + +=head1 NAME + +ExtUtils::MM_VMS - methods to override UN*X behaviour in ExtUtils::MakeMaker + +=head1 DESCRIPTION + +See ExtUtils::MM_Unix for a documentation of the methods provided +there. This package overrides the implementation of these methods, not +the semantics. + diff --git a/lib/ExtUtils/Mksymlists.pm b/lib/ExtUtils/Mksymlists.pm index cc4aca1..aa21f43 100644 --- a/lib/ExtUtils/Mksymlists.pm +++ b/lib/ExtUtils/Mksymlists.pm @@ -42,13 +42,13 @@ sub Mksymlists { # We'll need this if we ever add any OS which uses mod2fname # require DynaLoader; -# if (defined &DynaLoader::mod2fname and not $spec{DLBASE}) { -# $spec{DLBASE} = DynaLoader::mod2fname([ split(/::/,$spec{NAME}) ]); -# } + if (defined &DynaLoader::mod2fname and not $spec{DLBASE}) { + $spec{DLBASE} = DynaLoader::mod2fname([ split(/::/,$spec{NAME}) ]); + } if ($osname eq 'aix') { _write_aix(\%spec); } elsif ($osname eq 'VMS') { _write_vms(\%spec) } - elsif ($osname eq 'OS2') { _write_os2(\%spec) } + elsif ($osname =~ m|^os/?2$|i) { _write_os2(\%spec) } else { croak("Don't know how to create linker option file for $osname\n"); } } @@ -80,9 +80,16 @@ sub _write_os2 { print DEF "LIBRARY '$data->{DLBASE}' INITINSTANCE TERMINSTANCE\n"; print DEF "CODE LOADONCALL\n"; print DEF "DATA LOADONCALL NONSHARED MULTIPLE\n"; - print DEF "EXPORTS\n"; - print DEF join("\n",@{$data->{DL_VARS}}, "\n") if @{$data->{DL_VARS}}; - print DEF join("\n",@{$data->{FUNCLIST}}, "\n") if @{$data->{FUNCLIST}}; + print DEF "EXPORTS\n "; + print DEF join("\n ",@{$data->{DL_VARS}}, "\n") if @{$data->{DL_VARS}}; + print DEF join("\n ",@{$data->{FUNCLIST}}, "\n") if @{$data->{FUNCLIST}}; + if (%{$data->{IMPORTS}}) { + print DEF "IMPORTS\n"; +my ($name, $exp); +while (($name, $exp)= each %{$data->{IMPORTS}}) { + print DEF " $name=$exp\n"; +} + } close DEF; } @@ -162,8 +169,8 @@ from which it is usually taken. Its value is a reference to an associative array, in which each key is the name of a package, and each value is an a reference to an array of function names which should be exported by the extension. For instance, one might say -C { Homer::Iliad =E [ qw(trojans greeks) ], -Homer::Odyssey =E [ qw(travellers family suitors) ] }>. The +C { Homer::Iliad => [ qw(trojans greeks) ], +Homer::Odyssey => [ qw(travellers family suitors) ] }>. The function names should be identical to those in the XSUB code; C will alter the names written to the linker option file to match the changes made by F. In addition, if