⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mm_vms.pm

📁 UNIX下perl实现代码
💻 PM
📖 第 1 页 / 共 5 页
字号:
	-e "manicopy(maniread(),'$(DISTVNAME)','$(DIST_CP)');"};}=item dist_test (override)Use VMS commands to change default directory, and use VMS-stylequoting on command line.=cutsub dist_test {    my($self) = @_;q{disttest : distdir	startdir = F$Environment("Default")	Set Default [.$(DISTVNAME)]	$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" Makefile.PL	$(MMS)$(MMSQUALIFIERS)	$(MMS)$(MMSQUALIFIERS) test	Set Default 'startdir'};}# --- Test and Installation Sections ---=item install (override)Work around DCL's 255 character limit several times,and useVMS-style command line quoting in a few cases.=cutsub install {    my($self, %attribs) = @_;    my(@m,@docfiles);    if ($self->{EXE_FILES}) {	my($line,$file) = ('','');	foreach $file (@{$self->{EXE_FILES}}) {	    $line .= "$file ";	    if (length($line) > 128) {		push(@docfiles,qq[\t\$(PERL) -e "print '$line'" >>.MM_tmp\n]);		$line = '';	    }	}	push(@docfiles,qq[\t\$(PERL) -e "print '$line'" >>.MM_tmp\n]) if $line;    }    push @m, q[install :: all pure_install doc_install	$(NOECHO) $(NOOP)install_perl :: all pure_perl_install doc_perl_install	$(NOECHO) $(NOOP)install_site :: all pure_site_install doc_site_install	$(NOECHO) $(NOOP)install_ :: install_site	$(NOECHO) $(SAY) "INSTALLDIRS not defined, defaulting to INSTALLDIRS=site"pure_install :: pure_$(INSTALLDIRS)_install	$(NOECHO) $(NOOP)doc_install :: doc_$(INSTALLDIRS)_install	$(NOECHO) $(SAY) "Appending installation info to $(INSTALLARCHLIB)perllocal.pod"pure__install : pure_site_install	$(NOECHO) $(SAY) "INSTALLDIRS not defined, defaulting to INSTALLDIRS=site"doc__install : doc_site_install	$(NOECHO) $(SAY) "INSTALLDIRS not defined, defaulting to INSTALLDIRS=site"# This hack brought to you by DCL's 255-character command line limitpure_perl_install ::	$(NOECHO) $(PERL) -e "print 'read ].$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q[ '" >.MM_tmp	$(NOECHO) $(PERL) -e "print 'write ].$self->catfile('$(INSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q[ '" >>.MM_tmp	$(NOECHO) $(PERL) -e "print '$(INST_LIB) $(INSTALLPRIVLIB) '" >>.MM_tmp	$(NOECHO) $(PERL) -e "print '$(INST_ARCHLIB) $(INSTALLARCHLIB) '" >>.MM_tmp	$(NOECHO) $(PERL) -e "print '$(INST_BIN) $(INSTALLBIN) '" >>.MM_tmp	$(NOECHO) $(PERL) -e "print '$(INST_SCRIPT) $(INSTALLSCRIPT) '" >>.MM_tmp	$(NOECHO) $(PERL) -e "print '$(INST_MAN1DIR) $(INSTALLMAN1DIR) '" >>.MM_tmp	$(NOECHO) $(PERL) -e "print '$(INST_MAN3DIR) $(INSTALLMAN3DIR) '" >>.MM_tmp	$(MOD_INSTALL) <.MM_tmp	$(NOECHO) Delete/NoLog/NoConfirm .MM_tmp;	$(NOECHO) $(WARN_IF_OLD_PACKLIST) ].$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q[# Likewisepure_site_install ::	$(NOECHO) $(PERL) -e "print 'read ].$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q[ '" >.MM_tmp	$(NOECHO) $(PERL) -e "print 'write ].$self->catfile('$(INSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q[ '" >>.MM_tmp	$(NOECHO) $(PERL) -e "print '$(INST_LIB) $(INSTALLSITELIB) '" >>.MM_tmp	$(NOECHO) $(PERL) -e "print '$(INST_ARCHLIB) $(INSTALLSITEARCH) '" >>.MM_tmp	$(NOECHO) $(PERL) -e "print '$(INST_BIN) $(INSTALLBIN) '" >>.MM_tmp	$(NOECHO) $(PERL) -e "print '$(INST_SCRIPT) $(INSTALLSCRIPT) '" >>.MM_tmp	$(NOECHO) $(PERL) -e "print '$(INST_MAN1DIR) $(INSTALLMAN1DIR) '" >>.MM_tmp	$(NOECHO) $(PERL) -e "print '$(INST_MAN3DIR) $(INSTALLMAN3DIR) '" >>.MM_tmp	$(MOD_INSTALL) <.MM_tmp	$(NOECHO) Delete/NoLog/NoConfirm .MM_tmp;	$(NOECHO) $(WARN_IF_OLD_PACKLIST) ].$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q[# Dittodoc_perl_install ::	$(NOECHO) $(PERL) -e "print 'Module $(NAME)|installed into|$(INSTALLPRIVLIB)|'" >.MM_tmp	$(NOECHO) $(PERL) -e "print 'LINKTYPE|$(LINKTYPE)|VERSION|$(VERSION)|EXE_FILES|$(EXE_FILES)|'" >>.MM_tmp],@docfiles,q%	$(NOECHO) $(PERL) -e "print q[@ARGV=split(/\\|/,<STDIN>);]" >.MM2_tmp	$(NOECHO) $(PERL) -e "print q[print '=head2 ',scalar(localtime),': C<',shift,qq[>\\n\\n=over 4\\n\\n];]" >>.MM2_tmp	$(NOECHO) $(PERL) -e "print q[while(($key=shift) && ($val=shift)) ]" >>.MM2_tmp	$(NOECHO) $(PERL) -e "print q[{print qq[=item *\\n\\nC<$key: $val>\\n\\n];}print qq[=back\\n\\n];]" >>.MM2_tmp	$(NOECHO) $(PERL) .MM2_tmp <.MM_tmp >>%.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q[	$(NOECHO) Delete/NoLog/NoConfirm .MM_tmp;,.MM2_tmp;# And againdoc_site_install ::	$(NOECHO) $(PERL) -e "print 'Module $(NAME)|installed into|$(INSTALLSITELIB)|'" >.MM_tmp	$(NOECHO) $(PERL) -e "print 'LINKTYPE|$(LINKTYPE)|VERSION|$(VERSION)|EXE_FILES|$(EXE_FILES)|'" >>.MM_tmp],@docfiles,q%	$(NOECHO) $(PERL) -e "print q[@ARGV=split(/\\|/,<STDIN>);]" >.MM2_tmp	$(NOECHO) $(PERL) -e "print q[print '=head2 ',scalar(localtime),': C<',shift,qq[>\\n\\n=over 4\\n\\n];]" >>.MM2_tmp	$(NOECHO) $(PERL) -e "print q[while(($key=shift) && ($val=shift)) ]" >>.MM2_tmp	$(NOECHO) $(PERL) -e "print q[{print qq[=item *\\n\\nC<$key: $val>\\n\\n];}print qq[=back\\n\\n];]" >>.MM2_tmp	$(NOECHO) $(PERL) .MM2_tmp <.MM_tmp >>%.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q[	$(NOECHO) Delete/NoLog/NoConfirm .MM_tmp;,.MM2_tmp;];    push @m, q[uninstall :: uninstall_from_$(INSTALLDIRS)dirs	$(NOECHO) $(NOOP)uninstall_from_perldirs ::	$(NOECHO) $(UNINSTALL) ].$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q[	$(NOECHO) $(SAY) "Uninstall is now deprecated and makes no actual changes."	$(NOECHO) $(SAY) "Please check the list above carefully for errors, and manually remove"	$(NOECHO) $(SAY) "the appropriate files.  Sorry for the inconvenience."uninstall_from_sitedirs ::	$(NOECHO) $(UNINSTALL) ],$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist'),"\n",q[	$(NOECHO) $(SAY) "Uninstall is now deprecated and makes no actual changes."	$(NOECHO) $(SAY) "Please check the list above carefully for errors, and manually remove"	$(NOECHO) $(SAY) "the appropriate files.  Sorry for the inconvenience."];    join('',@m);}=item perldepend (override)Use VMS-style syntax for files; it's cheaper to just do it directly herethan to have the MM_Unix method call C<catfile> repeatedly.  Also, ifwe have to rebuild Config.pm, use MM[SK] to do it.=cutsub perldepend {    my($self) = @_;    my(@m);    push @m, '$(OBJECT) : $(PERL_INC)EXTERN.h, $(PERL_INC)INTERN.h, $(PERL_INC)XSUB.h, $(PERL_INC)av.h$(OBJECT) : $(PERL_INC)cop.h, $(PERL_INC)cv.h, $(PERL_INC)embed.h, $(PERL_INC)form.h$(OBJECT) : $(PERL_INC)gv.h, $(PERL_INC)handy.h, $(PERL_INC)hv.h, $(PERL_INC)keywords.h$(OBJECT) : $(PERL_INC)mg.h, $(PERL_INC)op.h, $(PERL_INC)opcode.h, $(PERL_INC)patchlevel.h$(OBJECT) : $(PERL_INC)perl.h, $(PERL_INC)perly.h, $(PERL_INC)pp.h, $(PERL_INC)proto.h$(OBJECT) : $(PERL_INC)regcomp.h, $(PERL_INC)regexp.h, $(PERL_INC)scope.h, $(PERL_INC)sv.h$(OBJECT) : $(PERL_INC)vmsish.h, $(PERL_INC)util.h, $(PERL_INC)config.h$(OBJECT) : $(PERL_INC)iperlsys.h' if $self->{OBJECT};     if ($self->{PERL_SRC}) {	my(@macros);	my($mmsquals) = '$(USEMAKEFILE)[.vms]$(MAKEFILE)';	push(@macros,'__AXP__=1') if $Config{'arch'} eq 'VMS_AXP';	push(@macros,'DECC=1')    if $Config{'vms_cc_type'} eq 'decc';	push(@macros,'GNUC=1')    if $Config{'vms_cc_type'} eq 'gcc';	push(@macros,'SOCKET=1')  if $Config{'d_has_sockets'};	push(@macros,qq["CC=$Config{'cc'}"])  if $Config{'cc'} =~ m!/!;	$mmsquals .= '$(USEMACROS)' . join(',',@macros) . '$(MACROEND)' if @macros;	push(@m,q[# Check for unpropagated config.sh changes. Should never happen.# 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	$(NOOP)$(PERL_ARCHLIB)Config.pm : $(PERL_SRC)config.sh	$(NOECHO) Write Sys$Error "$(PERL_ARCHLIB)Config.pm may be out of date with config.h or genconfig.pl"	olddef = F$Environment("Default")	Set Default $(PERL_SRC)	$(MMS)],$mmsquals,);	if ($self->{PERL_ARCHLIB} =~ m|\[-| && $self->{PERL_SRC} =~ m|(\[-+)|) {	    my($prefix,$target) = ($1,$self->fixpath('$(PERL_ARCHLIB)Config.pm',0));	    $target =~ s/\Q$prefix/[/;	    push(@m," $target");	}	else { push(@m,' $(MMS$TARGET)'); }	push(@m,q[	Set Default 'olddef']);    }    push(@m, join(" ", map($self->fixpath($_,0),values %{$self->{XS}}))." : \$(XSUBPPDEPS)\n")      if %{$self->{XS}};    join('',@m);}=item makefile (override)Use VMS commands and quoting.=cutsub makefile {    my($self) = @_;    my(@m,@cmd);    # We do not know what target was originally specified so we    # must force a manual rerun to be sure. But as it should only    # happen very rarely it is not a significant problem.    push @m, q[$(OBJECT) : $(FIRST_MAKEFILE)] if $self->{OBJECT};    push @m,q[# We take a very conservative approach here, but it\'s worth it.# We move $(MAKEFILE) to $(MAKEFILE)_old here to avoid gnu make looping.$(MAKEFILE) : Makefile.PL $(CONFIGDEP)	$(NOECHO) $(SAY) "$(MAKEFILE) out-of-date with respect to $(MMS$SOURCE_LIST)"	$(NOECHO) $(SAY) "Cleaning current config before rebuilding $(MAKEFILE) ..."	- $(MV) $(MAKEFILE) $(MAKEFILE)_old	- $(MMS)$(MMSQUALIFIERS) $(USEMAKEFILE)$(MAKEFILE)_old clean	$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" Makefile.PL ],join(' ',map(qq["$_"],@ARGV)),q[	$(NOECHO) $(SAY) "$(MAKEFILE) has been rebuilt."	$(NOECHO) $(SAY) "Please run $(MMS) to build the extension."];    join('',@m);}=item test (override)Use VMS commands for handling subdirectories.=cutsub test {    my($self, %attribs) = @_;    my($tests) = $attribs{TESTS} || ( -d 't' ? 't/*.t' : '');    my(@m);    push @m,"TEST_VERBOSE = 0TEST_TYPE = test_\$(LINKTYPE)TEST_FILE = test.plTESTDB_SW = -dtest :: \$(TEST_TYPE)	\$(NOECHO) \$(NOOP)testdb :: testdb_\$(LINKTYPE)	\$(NOECHO) \$(NOOP)";    foreach(@{$self->{DIR}}){      my($vmsdir) = $self->fixpath($_,1);      push(@m, '	If F$Search("',$vmsdir,'$(MAKEFILE)").nes."" Then $(PERL) -e "chdir ',"'$vmsdir'",           '; print `$(MMS)$(MMSQUALIFIERS) $(PASTHRU2) test`'."\n");    }    push(@m, "\t\$(NOECHO) \$(SAY) \"No tests defined for \$(NAME) extension.\"\n")        unless $tests or -f "test.pl" or @{$self->{DIR}};    push(@m, "\n");    push(@m, "test_dynamic :: pure_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, "\t\$(NOECHO) \$(NOOP)\n") if (!$tests && ! -f "test.pl");    push(@m, "\n");    push(@m, "testdb_dynamic :: pure_all\n");    push(@m, $self->test_via_script('$(FULLPERL) "$(TESTDB_SW)"', '$(TEST_FILE)'));    push(@m, "\n");    # Occasionally we may face this degenerate target:    push @m, "test_ : test_dynamic\n\n";     if ($self->needs_linking()) {	push(@m, "test_static :: pure_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, "\n");	push(@m, "testdb_static :: pure_all \$(MAP_TARGET)\n");	push(@m, $self->test_via_script('$(MAP_TARGET) $(TESTDB_SW)', '$(TEST_FILE)'));	push(@m, "\n");    }    else {	push @m, "test_static :: test_dynamic\n\t\$(NOECHO) \$(NOOP)\n\n";	push @m, "testdb_static :: testdb_dynamic\n\t\$(NOECHO) \$(NOOP)\n";    }    join('',@m);}=item test_via_harness (override)Use VMS-style quoting on command line.=cutsub test_via_harness {    my($self,$perl,$tests) = @_;    "	$perl".' "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" "-I$(PERL_LIB)" "-I$(PERL_ARCHLIB)" \\'."\n\t".    '-e "use Test::Harness qw(&runtests $verbose); $verbose=$(TEST_VERBOSE); runtests @ARGV;" \\'."\n\t$tests\n";}=item test_via_script (override)Use VMS-style quoting on command line.=cutsub test_via_script {    my($self,$perl,$script) = @_;    "	$perl".' "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" '.$script.'';}=item makeaperl (override)Undertake to build a new set of Perl images using VMS commands.  SinceVMS does dynamic loading, it's not necessary to statically link eachextension into the Perl image, so this isn't the normal build path.Consequently, it hasn't really been tested, and may well be incomplete.=cutsub makeaperl {    my($self, %attribs) = @_;    my($makefilename, $searchdirs, $static, $extra, $perlinc, $target, $tmp, $libperl) =       @attribs{qw(MAKE DIRS STAT EXTRA INCL TARGET TMP LIBPERL)};    my(@m);    push @m, "# --- MakeMaker makeaperl section ---MAP_TARGET    = $target";    return join '', @m if $self->{PARENT};    my($dir) = join ":", @{$self->{DIR}};    unless ($self->{MAKEAPERL}) {	push @m, q{$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE)	$(NOECHO) $(SAY) "Writing ""$(MMS$TARGET)"" for this $(MAP_TARGET)"	$(NOECHO) $(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \		Makefile.PL DIR=}, $dir, q{ \		MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \		MAKEAPERL=1 NORECURS=1 };	push @m, map(q[ \\\n\t\t"$_"], @ARGV),q{$(MAP_TARGET) :: $(MAKE_APERL_FILE)	$(MMS)$(MMSQUALIFIERS)$(USEMAKEFILE)$(MAKE_APERL_FILE) static $(MMS$TARGET)};	push @m, "\n";	return join '', @m;    }    my($linkcmd,@optlibs,@staticpkgs,$extralist,$targdir,$libperldir,%libseen);    local($_);    # The front matter of the linkcommand...    $linkcmd = join ' ', $Config{'ld'},	    grep($_, @Config{qw(large split ldflags ccdlflags)});    $linkcmd =~ s/\s+/ /g;    # Which *.olb files could we make use of...    local(%olbs);    $olbs{$self->{INST_ARCHAUTODIR}} = "$self->{BASEEXT}\$(LIB_EXT)";    require File::Find;    File::Find::find(sub {	return unless m/\Q$self->{LIB_EXT}\E$/;	return if m/^libperl/;	if( exists $self->{INCLUDE_EXT} ){		my $found = 0;		my $incl;		my $xx;		($xx = $File::Find::name) =~ s,.*?/auto/,,;		$xx =~ s,/?$_,,;		$xx =~ s,/,::,g;		# Throw away anything not explicitly marked for inclusion.		# DynaLoader is implied.		foreach $incl ((@{$self->{INCLUDE_EXT}},'DynaLoader')){			if( $xx eq $incl ){				$found++;				last;			}		}		return unless $found;	}	elsif( exists $self->{EXCLUDE_EXT} ){		my $excl;		my $xx;		($xx = $File::Find::name) =~ s,.*?/auto/,,;		$xx =~ s,/?$_,,;		$xx =~ s,/,::,g;		# Throw away anything explicitly marked for exclusion		foreach $excl (@{$self->{EXCLUDE_EXT}}){			return if( $xx eq $excl );		}	}	$olbs{$ENV{DEFAULT}} = $_;    }, grep( -d $_, @{$searchdirs || []}));    # We trust that what has been handed in as argument will be buildable    $static = [] unless $static;    @olbs{@{$static}} = (1) x @{$static};     $extra = [] unless $extra && ref $extra eq 'ARRAY';    # Sort the ob

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -