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

📄 mm_unix.pm

📁 UNIX下perl实现代码
💻 PM
📖 第 1 页 / 共 5 页
字号:
	cd ..EOT	}	else {	    push @m, <<EOT;	-cd $dir && \$(TEST_F) $self->{MAKEFILE} && \$(MAKE) cleanEOT	}    }    my(@otherfiles) = values %{$self->{XS}}; # .c files from *.xs files    push(@otherfiles, $attribs{FILES}) if $attribs{FILES};    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			 $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def			 $(BASEEXT).exp			]);    push @m, "\t-$self->{RM_RF} @otherfiles\n";    # See realclean and ext/utils/make_ext for usage of Makefile.old    push(@m,	 "\t-$self->{MV} $self->{MAKEFILE} $self->{MAKEFILE}.old \$(DEV_NULL)\n");    push(@m,	 "\t$attribs{POSTOP}\n")   if $attribs{POSTOP};    join("", @m);}=item const_cccmd (o)Returns the full compiler call for C programs and stores thedefinition in CONST_CCCMD.=cutsub const_cccmd {    my($self,$libperl)=@_;    return $self->{CONST_CCCMD} if $self->{CONST_CCCMD};    return '' unless $self->needs_linking();    return $self->{CONST_CCCMD} =	q{CCCMD = $(CC) -c $(INC) $(CCFLAGS) $(OPTIMIZE) \\	$(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \\	$(XS_DEFINE_VERSION)};}=item const_config (o)Defines a couple of constants in the Makefile that are imported from%Config.=cutsub 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(%once_only);    foreach $m (@{$self->{CONFIG}}){	# SITE*EXP macros are defined in &constants; avoid duplicates here	next if $once_only{$m} or $m eq 'sitelibexp' or $m eq 'sitearchexp';	push @m, "\U$m\E = ".$self->{uc $m}."\n";	$once_only{$m} = 1;    }    join('', @m);}=item const_loadlibs (o)Defines EXTRALIBS, LDLOADLIBS, BSLOADLIBS, LD_RUN_PATH. SeeL<ExtUtils::Liblist> for details.=cutsub const_loadlibs {    my($self) = shift;    return "" unless $self->needs_linking;    my @m;    push @m, qq{# $self->{NAME} might depend on some other libraries:# See ExtUtils::Liblist for details#};    my($tmp);    for $tmp (qw/	 EXTRALIBS LDLOADLIBS BSLOADLIBS LD_RUN_PATH	 /) {	next unless defined $self->{$tmp};	push @m, "$tmp = $self->{$tmp}\n";    }    return join "", @m;}=item constants (o)Initializes lots of constants and .SUFFIXES and .PHONY=cutsub constants {    my($self) = @_;    my(@m,$tmp);    for $tmp (qw/	      AR_STATIC_ARGS NAME DISTNAME NAME_SYM VERSION	      VERSION_SYM XS_VERSION INST_BIN INST_EXE INST_LIB	      INST_ARCHLIB INST_SCRIPT PREFIX  INSTALLDIRS	      INSTALLPRIVLIB INSTALLARCHLIB INSTALLSITELIB	      INSTALLSITEARCH INSTALLBIN INSTALLSCRIPT PERL_LIB	      PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB	      FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC	      PERL_INC PERL FULLPERL FULL_AR	      / ) {	next unless defined $self->{$tmp};	push @m, "$tmp = $self->{$tmp}\n";    }    push @m, qq{VERSION_MACRO = VERSIONDEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\"XS_VERSION_MACRO = XS_VERSIONXS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\"PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc};    push @m, qq{MAKEMAKER = $INC{'ExtUtils/MakeMaker.pm'}MM_VERSION = $ExtUtils::MakeMaker::VERSION};    push @m, q{# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)# ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD)  !!! Deprecated from MM 5.32  !!!# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)# DLBASE  = Basename part of dynamic library. May be just equal BASEEXT.};    for $tmp (qw/	      FULLEXT BASEEXT PARENT_NAME DLBASE VERSION_FROM INC DEFINE OBJECT	      LDFROM LINKTYPE PM_FILTER	      /	) {	next unless defined $self->{$tmp};	push @m, "$tmp = $self->{$tmp}\n";    }    push @m, "# Handy lists of source code files:XS_FILES= ".join(" \\\n\t", sort keys %{$self->{XS}})."C_FILES = ".join(" \\\n\t", @{$self->{C}})."O_FILES = ".join(" \\\n\t", @{$self->{O_FILES}})."H_FILES = ".join(" \\\n\t", @{$self->{H}})."HTMLLIBPODS    = ".join(" \\\n\t", sort keys %{$self->{HTMLLIBPODS}})."HTMLSCRIPTPODS = ".join(" \\\n\t", sort keys %{$self->{HTMLSCRIPTPODS}})."MAN1PODS = ".join(" \\\n\t", sort keys %{$self->{MAN1PODS}})."MAN3PODS = ".join(" \\\n\t", sort keys %{$self->{MAN3PODS}})."";    for $tmp (qw/	      INST_HTMLPRIVLIBDIR INSTALLHTMLPRIVLIBDIR	      INST_HTMLSITELIBDIR INSTALLHTMLSITELIBDIR	      INST_HTMLSCRIPTDIR  INSTALLHTMLSCRIPTDIR	      INST_HTMLLIBDIR                    HTMLEXT	      INST_MAN1DIR        INSTALLMAN1DIR MAN1EXT	      INST_MAN3DIR        INSTALLMAN3DIR MAN3EXT	      /) {	next unless defined $self->{$tmp};	push @m, "$tmp = $self->{$tmp}\n";    }    for $tmp (qw(		PERM_RW PERM_RWX		)	     ) {        my $method = lc($tmp);	# warn "self[$self] method[$method]";        push @m, "$tmp = ", $self->$method(), "\n";    }    push @m, q{.NO_CONFIG_REC: Makefile} if $ENV{CLEARCASE_ROOT};    # why not q{} ? -- emacs    push @m, qq{# work around a famous dec-osf make(1) feature(?):makemakerdflt: all.SUFFIXES: .xs .c .C .cpp .cxx .cc \$(OBJ_EXT)# Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that# some make implementations will delete the Makefile when we rebuild it. Because# we call false(1) when we rebuild it. So make(1) is not completely wrong when it# does so. Our milage may vary.# .PRECIOUS: Makefile    # seems to be not necessary anymore.PHONY: all config static dynamic test linkext manifest# Where is the Config information that we are using/depend onCONFIGDEP = \$(PERL_ARCHLIB)/Config.pm \$(PERL_INC)/config.h};    my @parentdir = split(/::/, $self->{PARENT_NAME});    push @m, q{# Where to put things:INST_LIBDIR      = }. $self->catdir('$(INST_LIB)',@parentdir)        .q{INST_ARCHLIBDIR  = }. $self->catdir('$(INST_ARCHLIB)',@parentdir)    .q{INST_AUTODIR     = }. $self->catdir('$(INST_LIB)','auto','$(FULLEXT)')       .q{INST_ARCHAUTODIR = }. $self->catdir('$(INST_ARCHLIB)','auto','$(FULLEXT)')   .q{};    if ($self->has_link_code()) {	push @m, 'INST_STATIC  = $(INST_ARCHAUTODIR)/$(BASEEXT)$(LIB_EXT)INST_DYNAMIC = $(INST_ARCHAUTODIR)/$(DLBASE).$(DLEXT)INST_BOOT    = $(INST_ARCHAUTODIR)/$(BASEEXT).bs';    } else {	push @m, 'INST_STATIC  =INST_DYNAMIC =INST_BOOT    =';    }    $tmp = $self->export_list;    push @m, "EXPORT_LIST = $tmp";    $tmp = $self->perl_archive;    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{##PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{#};    push @m, q{TO_INST_PM = }.join(" \\\n\t", sort keys %{$self->{PM}}).q{PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{};    join('',@m);}=item depend (o)Same as macro for the depend attribute.=cutsub depend {    my($self,%attribs) = @_;    my(@m,$key,$val);    while (($key,$val) = each %attribs){	last unless defined $key;	push @m, "$key: $val\n";    }    join "", @m;}=item dir_target (o)Takes an array of directories that need to exist and returns aMakefile entry for a .exists file in these directories. Returnsnothing, if the entry has already been processed. We're helplessthough, if the same directory comes as $(FOO) _and_ as "bar". Both ofthem get an entry, that's why we use "::".=cutsub dir_target {# --- Make-Directories section (internal method) ---# dir_target(@array) returns a Makefile entry for the file .exists in each# named directory. Returns nothing, if the entry has already been processed.# We're helpless though, if the same directory comes as $(FOO) _and_ as "bar".# Both of them get an entry, that's why we use "::". I chose '$(PERL)' as the# prerequisite, because there has to be one, something that doesn't change# too often :)    my($self,@dirs) = @_;    my(@m,$dir,$targdir);    foreach $dir (@dirs) {	my($src) = $self->catfile($self->{PERL_INC},'perl.h');	my($targ) = $self->catfile($dir,'.exists');	# catfile may have adapted syntax of $dir to target OS, so...	if ($Is_VMS) { # Just remove file name; dirspec is often in macro	    ($targdir = $targ) =~ s:/?\.exists\z::;	}	else { # while elsewhere we expect to see the dir separator in $targ	    $targdir = dirname($targ);	}	next if $self->{DIR_TARGET}{$self}{$targdir}++;	push @m, qq{$targ :: $src	$self->{NOECHO}\$(MKPATH) $targdir	$self->{NOECHO}\$(EQUALIZE_TIMESTAMP) $src $targ};	push(@m, qq{	-$self->{NOECHO}\$(CHMOD) \$(PERM_RWX) $targdir}) unless $Is_VMS;    }    join "", @m;}=item dist (o)Defines a lot of macros for distribution support.=cutsub dist {    my($self, %attribs) = @_;    my(@m);    # VERSION should be sanitised before use as a file name    my($version)  = $attribs{VERSION}  || '$(VERSION)';    my($name)     = $attribs{NAME}     || '$(DISTNAME)';    my($tar)      = $attribs{TAR}      || 'tar';        # eg /usr/bin/gnutar    my($tarflags) = $attribs{TARFLAGS} || 'cvf';    my($zip)      = $attribs{ZIP}      || 'zip';        # eg pkzip Yuck!    my($zipflags) = $attribs{ZIPFLAGS} || '-r';    my($compress) = $attribs{COMPRESS} || 'gzip --best';    my($suffix)   = $attribs{SUFFIX}   || '.gz';          # eg .gz    my($shar)     = $attribs{SHAR}     || 'shar';       # eg "shar --gzip"    my($preop)    = $attribs{PREOP}    || "$self->{NOECHO}\$(NOOP)"; # eg update MANIFEST    my($postop)   = $attribs{POSTOP}   || "$self->{NOECHO}\$(NOOP)"; # eg remove the distdir    my($to_unix)  = $attribs{TO_UNIX} || ($Is_OS2					  ? "$self->{NOECHO}"					  . '$(TEST_F) tmp.zip && $(RM) tmp.zip;'					  . ' $(ZIP) -ll -mr tmp.zip $(DISTVNAME) && unzip -o tmp.zip && $(RM) tmp.zip'					  : "$self->{NOECHO}\$(NOOP)");    my($ci)       = $attribs{CI}       || 'ci -u';    my($rcs_label)= $attribs{RCS_LABEL}|| 'rcs -Nv$(VERSION_SYM): -q';    my($dist_cp)  = $attribs{DIST_CP}  || 'best';    my($dist_default) = $attribs{DIST_DEFAULT} || 'tardist';    push @m, "DISTVNAME = ${name}-$versionTAR  = $tarTARFLAGS = $tarflagsZIP  = $zipZIPFLAGS = $zipflagsCOMPRESS = $compressSUFFIX = $suffixSHAR = $sharPREOP = $preopPOSTOP = $postopTO_UNIX = $to_unixCI = $ciRCS_LABEL = $rcs_labelDIST_CP = $dist_cpDIST_DEFAULT = $dist_default";    join "", @m;}=item dist_basics (o)Defines the targets distclean, distcheck, skipcheck, manifest, veryclean.=cutsub dist_basics {    my($self) = shift;    my @m;    push @m, q{distclean :: realclean distcheck};    push @m, q{distcheck :	$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=fullcheck \\		-e fullcheck};    push @m, q{skipcheck :	$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=skipcheck \\		-e skipcheck};    push @m, q{manifest :	$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=mkmanifest \\		-e mkmanifest};    push @m, q{veryclean : realclean	$(RM_F) *~ *.orig */*~ */*.orig};    join "", @m;}=item dist_ci (o)Defines a check in target for RCS.=cutsub dist_ci {    my($self) = shift;    my @m;    push @m, q{ci :	$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=maniread \\		-e "@all = keys %{ maniread() };" \\		-e 'print("Executing $(CI) @all\n"); system("$(CI) @all");' \\		-e 'print("Executing $(RCS_LABEL) ...\n"); system("$(RCS_LABEL) @all");'};    join "", @m;}=item dist_core (o)Defines the targets dist, tardist, zipdist, uutardist, shdist=cutsub dist_core {    my($self) = shift;    my @m;    push @m, q{

⌨️ 快捷键说明

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