diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1996-02-02 18:52:27 -0800 |
---|---|---|
committer | Larry Wall <lwall@sems.com> | 1996-02-02 18:52:27 -0800 |
commit | c07a80fdfe3926b5eb0585b674aa5d1f57b32ade (patch) | |
tree | 6d56135571eb9ea6635748469bdaf72ad481247a /lib/ExtUtils | |
parent | 91b7def858c29dac014df40946a128c06b3aa2ed (diff) | |
download | perl-c07a80fdfe3926b5eb0585b674aa5d1f57b32ade.tar.gz |
perl5.002beta3
[editor's note: no patch file was found for this release, so no
fine-grained changes]
I can't find the password for our ftp server, so I had to drop it into
ftp://ftp.sems.com/pub/incoming/perl5.002b3.tar.gz, which is a drop
directory you can't ls.
The current plan is that Andy is gonna whack on this a little more, and
then release a gamma in a few days when he's happy with it. So don't get
carried away. This is now *late* beta.
In other words, have less than the appropriate amount of fun. :-)
Larry
Diffstat (limited to 'lib/ExtUtils')
-rw-r--r-- | lib/ExtUtils/Liblist.pm | 11 | ||||
-rw-r--r-- | lib/ExtUtils/MM_VMS.pm | 299 | ||||
-rw-r--r-- | lib/ExtUtils/MakeMaker.pm | 133 | ||||
-rw-r--r-- | lib/ExtUtils/Mksymlists.pm | 217 | ||||
-rw-r--r-- | lib/ExtUtils/typemap | 6 | ||||
-rwxr-xr-x | lib/ExtUtils/xsubpp | 50 |
6 files changed, 473 insertions, 243 deletions
diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm index ebb2536382..94d343bbf4 100644 --- a/lib/ExtUtils/Liblist.pm +++ b/lib/ExtUtils/Liblist.pm @@ -104,6 +104,17 @@ sub ext { } elsif (-f ($fullname="$thispth/lib$thislib$Config_libext")){ } elsif (-f ($fullname="$thispth/$thislib$Config_libext")){ } elsif (-f ($fullname="$thispth/Slib$thislib$Config_libext")){ + } elsif ($Config{'osname'} eq 'dgux' + && -l ($fullname="$thispth/lib$thislib$Config_libext") + && readlink($fullname) =~ /^elink:/) { + # Some of DG's libraries look like misconnected symbolic + # links, but development tools can follow them. (They + # look like this: + # + # libm.a -> elink:${SDE_PATH:-/usr}/sde/\ + # ${TARGET_BINARY_INTERFACE:-m88kdgux}/usr/lib/libm.a + # + # , the compilation tools expand the environment variables.) } else { print STDOUT "$thislib not found in $thispth\n" if $Verbose; next; diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm index 158c55a508..fde022ca06 100644 --- a/lib/ExtUtils/MM_VMS.pm +++ b/lib/ExtUtils/MM_VMS.pm @@ -1,11 +1,11 @@ # MM_VMS.pm # MakeMaker default methods for VMS # This package is inserted into @ISA of MakeMaker's MM before the -# built-in MM_Unix methods if MakeMaker.pm is run under VMS. +# built-in ExtUtils::MM_Unix methods if MakeMaker.pm is run under VMS. # -# Version: 5.16 +# Version: 5.17 # Author: Charles Bailey bailey@genetics.upenn.edu -# Revised: 03-Jan-1996 +# Revised: 14-Jan-1996 package ExtUtils::MM_VMS; @@ -88,14 +88,17 @@ sub catdir { $self = $ExtUtils::MakeMaker::Parent[-1]; } my($dir) = pop @dirs; - my($path) = (@dirs == 1 ? $dirs[0] : $self->catdir(@dirs)); - my($spath,$sdir) = ($path,$dir); - $spath =~ s/.dir$//; $sdir =~ s/.dir$//; - $sdir = $self->eliminate_macros($sdir) unless $sdir =~ /^[\w\-]+$/; + @dirs = grep($_,@dirs); my($rslt); - - $rslt = vmspath($self->eliminate_macros($spath)."/$sdir"); - print "catdir($path,$dir) = |$rslt|\n" if $Verbose >= 3; + if (@dirs) { + my($path) = (@dirs == 1 ? $dirs[0] : $self->catdir(@dirs)); + my($spath,$sdir) = ($path,$dir); + $spath =~ s/.dir$//; $sdir =~ s/.dir$//; + $sdir = $self->eliminate_macros($sdir) unless $sdir =~ /^[\w\-]+$/; + $rslt = vmspath($self->eliminate_macros($spath)."/$sdir"); + } + else { $rslt = vmspath($dir); } + print "catdir(",join(',',@_[1..$#_]),") = |$rslt|\n" if $Verbose >= 3; $rslt; } @@ -106,13 +109,20 @@ sub catfile { $self = $ExtUtils::MakeMaker::Parent[-1]; } my($file) = pop @files; - my($path) = (@files == 1 ? $files[0] : $self->catdir(@files)); - my($spath) = $path; - $spath =~ s/.dir$//; + @files = grep($_,@files); my($rslt); - if ( $spath =~ /^[^\)\]\/:>]+\)$/ && basename($file) eq $file) { $rslt = "$spath$file"; } - else { $rslt = vmsify($self->eliminate_macros($spath).'/'.unixify($file)); } - print "catfile($path,$file) = |$rslt|\n" if $Verbose >= 3; + if (@files) { + my($path) = (@files == 1 ? $files[0] : $self->catdir(@files)); + 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($file); } + print "catfile(",join(',',@_[1..$#_]),") = |$rslt|\n" if $Verbose >= 3; $rslt; } @@ -263,15 +273,17 @@ sub init_others { $self->{NOOP} = "\t@ Continue"; $self->{FIRST_MAKEFILE} ||= 'Descrip.MMS'; + $self->{MAKE_APERL_FILE} ||= 'Makeaperl.MMS'; $self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE}; + $self->{NOECHO} ||= '@ '; $self->{RM_F} = '$(PERL) -e "foreach (@ARGV) { 1 while ( -d $_ ? rmdir $_ : unlink $_)}"'; - $self->{RM_RF} = '$(PERL) -e "use File::Path; @dirs = map(VMS::Filespec::unixify($_),@ARGV); rmtree(\@dirs,0,0)"'; + $self->{RM_RF} = '$(PERL) "-I$(INST_LIB)" -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'; $self->{MV} = 'Rename/NoConfirm'; $self->{UMASK_NULL} = "\t!"; - &MM_Unix::init_others; + &ExtUtils::MM_Unix::init_others; } sub constants { @@ -343,7 +355,14 @@ FULLEXT = ",$self->fixpath($self->{FULLEXT},1)," BASEEXT = $self->{BASEEXT} ROOTEXT = ",($self->{ROOTEXT} eq '') ? '[]' : $self->fixpath($self->{ROOTEXT},1)," DLBASE = $self->{DLBASE} -INC = "; +"; + + push @m, " +VERSION_FROM = $self->{VERSION_FROM} +" if defined $self->{VERSION_FROM}; + + push @m,' +INC = '; if ($self->{'INC'}) { push @m,'/Include=('; @@ -404,7 +423,7 @@ MAN3EXT = $self->{MAN3EXT} MYEXTLIB = ",$self->fixpath($self->{MYEXTLIB})," # Here is the Config.pm that we are using/depend on -CONFIGDEP = \$(PERL_ARCHLIB)Config.pm, \$(PERL_INC)config.h +CONFIGDEP = \$(PERL_ARCHLIB)Config.pm, \$(PERL_INC)config.h \$(VERSION_FROM) # Where to put things: INST_LIBDIR = ",($self->{'INST_LIBDIR'} = $self->catdir($self->{INST_LIB},$self->{ROOTEXT}))," @@ -425,6 +444,8 @@ INST_BOOT = $(INST_ARCHAUTODIR)$(BASEEXT).bs INST_STATIC = INST_DYNAMIC = INST_BOOT = +EXPORT_LIST = $(BASEEXT).opt +PERL_ARCHIVE = ',($ENV{'PERLSHR'} ? $ENV{'PERLSHR'} : 'Sys$Share:PerlShr.Exe'),' '; } @@ -537,7 +558,7 @@ sub const_cccmd { if ($Config{'vms_cc_type'} ne 'decc') { push @m,' .FIRST - @ If F$TrnLnm("Sys").eqs."" Then Define/NoLog SYS ', + ',$self->{NOECHO},'If F$TrnLnm("Sys").eqs."" Then Define/NoLog SYS ', ($Config{'vms_cc_type'} eq 'gcc' ? 'GNU_CC_Include:[VMS]' : 'Sys$Library'),' @@ -677,7 +698,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.) @@ -694,7 +715,8 @@ 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])" +!; } @@ -789,7 +811,7 @@ sub top_targets { } my(@m); push @m, ' -all :: config $(INST_PM) subdirs linkext manifypods +all :: config $(INST_PM) subdirs linkext manifypods reorg_packlist $(NOOP) subdirs :: $(MYEXTLIB) @@ -809,7 +831,7 @@ config :: $(INST_AUTODIR).exists push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]); if (%{$self->{MAN1PODS}}) { push @m, q[ -config :: $(INST_MAN1DIR)/.exists +config :: $(INST_MAN1DIR).exists $(NOOP) ]; push @m, $self->dir_target(qw[$(INST_MAN1DIR)]); @@ -833,9 +855,9 @@ help : push @m, q{ Version_check : - @ $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" - - -e "use ExtUtils::MakeMaker qw($Version &Version_check);" - - -e "&Version_check('$(MM_VERSION)')" + },$self->{NOECHO},q{$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" - + -e "use ExtUtils::MakeMaker qw($Version &Version_check);" - + -e "&Version_check('$(MM_VERSION)')" }; join('',@m); @@ -852,17 +874,30 @@ sub dlsyms { return '' unless $self->needs_linking(); my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {}; - my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || []; + my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || []; + my($srcdir)= $attribs{PERL_SRC} || $self->{PERL_SRC} || ''; my(@m); - push(@m,' + unless ($self->{SKIPHASH}{'dynamic'}) { + 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 @@ -872,12 +907,13 @@ static :: $(INST_ARCHAUTODIR)$(BASEEXT).opt push(@m,' $(INST_ARCHAUTODIR)$(BASEEXT).opt : $(BASEEXT).opt $(CP) $(MMS$SOURCE) $(MMS$TARGET) - @ $(PERL) -e "open F,\'>>$(INST_ARCHAUTODIR).packlist\';print F qq[$(MMS$TARGET)\n];close F;" + ',$self->{NOECHO},'$(PERL) -e "open F,\'>>$(INST_ARCHAUTODIR).packlist\';print F qq[$(MMS$TARGET)\n];close F;" -$(BASEEXT).opt : makefile.PL - $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e "use ExtUtils::MakeMaker qw(&mksymlists);" - - -e "MM->new({NAME => \'',$self->{NAME},'\'})->mksymlists({DL_FUNCS => ',neatvalue($self->{DL_FUNCS}),', DL_VARS => ',neatvalue($self->{DL_VARS}),'})" - $(PERL) -e "open OPT,\'>>$(MMS$TARGET)\'; print OPT ""$(INST_STATIC)/Include=$(BASEEXT)\n$(INST_STATIC)/Library\n"";close OPT" +$(BASEEXT).opt : Makefile.PL + $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e "use ExtUtils::Mksymlists;" - + ',qq[-e "Mksymlists('NAME' => '$self->{NAME}', 'DL_FUNCS' => ], + neatvalue($funcs),q[, 'DL_VARS' => ],neatvalue($vars),')" + $(PERL) -e "print ""$(INST_STATIC)/Include=$(BASEEXT)\n$(INST_STATIC)/Library\n"";" >>$(MMS$TARGET) '); join('',@m); @@ -896,18 +932,20 @@ sub dynamic_lib { return '' unless $self->has_link_code(); - ($otherldflags) = $attribs{OTHERLDFLAGS} || ""; + my($otherldflags) = $attribs{OTHERLDFLAGS} || ""; + my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || ""; my(@m); push @m," OTHERLDFLAGS = $otherldflags +INST_DYNAMIC_DEP = $inst_dynamic_dep "; push @m, ' -$(INST_DYNAMIC) : $(INST_STATIC) $(PERL_INC)perlshr_attr.opt rtls.opt $(BASEEXT).opt $(INST_ARCHAUTODIR).exists - @ $(MKPATH) $(INST_ARCHAUTODIR) +$(INST_DYNAMIC) : $(INST_STATIC) $(PERL_INC)perlshr_attr.opt rtls.opt $(INST_ARCHAUTODIR).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP) + ',$self->{NOECHO},'$(MKPATH) $(INST_ARCHAUTODIR) Link $(LDFLAGS) /Shareable=$(MMS$TARGET)$(OTHERLDFLAGS) $(BASEEXT).opt/Option,rtls.opt/Option,$(PERL_INC)perlshr_attr.opt/Option - @ $(PERL) -e "open F,\'>>$(INST_ARCHAUTODIR).packlist\';print F qq[$(MMS$TARGET)\n];close F;" + ',$self->{NOECHO},'$(PERL) -e "open F,\'>>$(INST_ARCHAUTODIR).packlist\';print F qq[$(MMS$TARGET)\n];close F;" '; push @m, $self->dir_target('$(INST_ARCHAUTODIR)'); @@ -930,16 +968,16 @@ BOOTSTRAP = '."$self->{BASEEXT}.bs".' # we use touch to prevent make continually trying to remake it. # The DynaLoader only reads a non-empty file. $(BOOTSTRAP) : $(MAKEFILE) '."$self->{BOOTDEP}".' $(INST_ARCHAUTODIR).exists - @ Write Sys$Output "Running mkbootstrap for $(NAME) ($(BSLOADLIBS))" - @ $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" - + '.$self->{NOECHO}.'Write Sys$Output "Running mkbootstrap for $(NAME) ($(BSLOADLIBS))" + '.$self->{NOECHO}.'$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" - -e "use ExtUtils::Mkbootstrap; Mkbootstrap(\'$(BASEEXT)\',\'$(BSLOADLIBS)\');" - @ $(TOUCH) $(MMS$TARGET) - @ $(PERL) -e "open F,\'>>$(INST_ARCHAUTODIR).packlist\';print F qq[$(MMS$TARGET)\n];close F;" + '.$self->{NOECHO}.' $(TOUCH) $(MMS$TARGET) + '.$self->{NOECHO}.'$(PERL) -e "open F,\'>>$(INST_ARCHAUTODIR).packlist\';print F qq[$(MMS$TARGET)\n];close F;" $(INST_BOOT) : $(BOOTSTRAP) $(INST_ARCHAUTODIR).exists - @ $(RM_RF) $(INST_BOOT) + '.$self->{NOECHO}.'$(RM_RF) $(INST_BOOT) - $(CP) $(BOOTSTRAP) $(INST_BOOT) - @ $(PERL) -e "open F,\'>>$(INST_ARCHAUTODIR).packlist\';print F qq[$(MMS$TARGET)\n];close F;" + '.$self->{NOECHO}.'$(PERL) -e "open F,\'>>$(INST_ARCHAUTODIR).packlist\';print F qq[$(MMS$TARGET)\n];close F;" '; } # --- Static Loading Sections --- @@ -971,8 +1009,8 @@ $(INST_STATIC) : $(OBJECT) $(MYEXTLIB) push(@m,' If F$Search("$(MMS$TARGET)").eqs."" Then Library/Object/Create $(MMS$TARGET) Library/Object/Replace $(MMS$TARGET) $(MMS$SOURCE_LIST) - @ $(PERL) -e "open F,\'>>$(INST_ARCHAUTODIR)extralibs.ld\';print F qq[$(EXTRALIBS)\n];close F;" - @ $(PERL) -e "open F,\'>>$(INST_ARCHAUTODIR).packlist\';print F qq[$(MMS$TARGET)\n];close F;" + ',$self->{NOECHO},'$(PERL) -e "open F,\'>>$(INST_ARCHAUTODIR)extralibs.ld\';print F qq[$(EXTRALIBS)\n];close F;" + ',$self->{NOECHO},'$(PERL) -e "open F,\'>>$(INST_ARCHAUTODIR).packlist\';print F qq[$(MMS$TARGET)\n];close F;" '); push @m, $self->dir_target('$(INST_ARCHAUTODIR)'); join('',@m); @@ -985,8 +1023,10 @@ sub installpm_x { # called by installpm perl file ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]); $self = $ExtUtils::MakeMaker::Parent[-1]; } - warn "Warning: Most probably 'make' will have problems processing this file: $inst\n" - if $inst =~ m!#!; + if ($inst =~ m!#!) { + warn "Warning: MM[SK] would have problems processing this file: $inst, SKIPPED\n"; + return ''; + } $inst = $self->fixpath($inst); $dist = $self->fixpath($dist); my($instdir) = $inst =~ /([^\)]+\))[^\)]*$/ ? $1 : dirname($inst); @@ -994,10 +1034,10 @@ sub installpm_x { # called by installpm perl file push(@m, " $inst : $dist \$(MAKEFILE) ${instdir}.exists \$(INST_ARCHAUTODIR).exists -",' @ $(RM_F) $(MMS$TARGET) - @ $(CP) ',"$dist $inst",' +",' ',$self->{NOECHO},'$(RM_F) $(MMS$TARGET) + ',$self->{NOECHO},'$(CP) ',"$dist $inst",' $(CHMOD) 644 $(MMS$TARGET) - @ $(PERL) -e "open F,\'>>$(INST_ARCHAUTODIR).packlist\';print F qq[$(MMS$TARGET)\n];close F;" + ',$self->{NOECHO},'$(PERL) -e "open F,\'>>$(INST_ARCHAUTODIR).packlist\';print F qq[$(MMS$TARGET)\n];close F;" '); push(@m, ' $(AUTOSPLITFILE) $(MMS$TARGET) ', $self->catdir($splitlib,'auto')."\n\n") @@ -1038,7 +1078,7 @@ END push @m, qq[POD2MAN_EXE = $pod2man_exe\n], q[POD2MAN = $(PERL) -we "%m=@ARGV;for (keys %m){" - --e "system(""$^X $(POD2MAN_EXE) $_ >$m{$_}"");}" +-e "system(""MCR $^X $(POD2MAN_EXE) $_ >$m{$_}"");}" ]; push @m, "\nmanifypods : "; push @m, join " ", keys %{$self->{MAN1PODS}}, keys %{$self->{MAN3PODS}}; @@ -1141,7 +1181,8 @@ sub pasthru { my(@pasthru); foreach $key (qw(INSTALLPRIVLIB INSTALLARCHLIB INSTALLBIN - INSTALLMAN1DIR INSTALLMAN3DIR LIBPERL_A LINKTYPE)){ + INSTALLMAN1DIR INSTALLMAN3DIR LIBPERL_A + LINKTYPE PREFIX)){ push @pasthru, "$key=\"$self->{$key}\""; } @@ -1194,7 +1235,7 @@ clean :: my(@otherfiles) = values %{$self->{XS}}; # .c files from *.xs files push(@otherfiles, $attribs{FILES}) if $attribs{FILES}; - push(@otherfiles, 'blib.dir', 'Makeaperl.MMS', 'extralibs.ld', 'perlmain.c'); + push(@otherfiles, 'blib.dir', '$(MAKE_APERL_FILE)', 'extralibs.ld', 'perlmain.c'); push(@otherfiles,$self->catfile('$(INST_ARCHAUTODIR)','extralibs.all')); my($file,$line); $line = ''; #avoid unitialized var warning @@ -1367,14 +1408,17 @@ sub install { $self = $ExtUtils::MakeMaker::Parent[-1]; } my(@m); - push @m, q{ + push @m, q[ doc_install :: - @ Write Sys$Output "Appending installation info to $(INST_ARCHLIB)perllocal.pod" - @ $(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 -}; + ],$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; +]; push(@m, " install :: pure_install doc_install @@ -1392,12 +1436,12 @@ pure_install :: all # '; print `$(MMS) install`"'."\n"); # } # -# push(@m, ' @ $(PERL) "-I$(PERL_LIB)" -e "use File::Path; mkpath(\@ARGV)" $(INSTALLPRIVLIB) $(INSTALLARCHLIB) -# @ $(PERL) -e "die qq{You do not have permissions to install into $ARGV[0]\n} unless -w VMS::Filespec::fileify($ARGV[0])" $(INSTALLPRIVLIB) -# @ $(PERL) -e "die qq{You do not have permissions to install into $ARGV[0]\n} unless -w VMS::Filespec::fileify($ARGV[0])" $(INSTALLARCHLIB)'," +# push(@m, ' ',$self->{NOECHO},'$(PERL) "-I$(PERL_LIB)" -e "use File::Path; mkpath(\@ARGV)" $(INSTALLPRIVLIB) $(INSTALLARCHLIB) +# ',$self->{NOECHO},'$(PERL) -e "die qq{You do not have permissions to install into $ARGV[0]\n} unless -w VMS::Filespec::fileify($ARGV[0])" $(INSTALLPRIVLIB) +# ',$self->{NOECHO},'$(PERL) -e "die qq{You do not have permissions to install into $ARGV[0]\n} unless -w VMS::Filespec::fileify($ARGV[0])" $(INSTALLARCHLIB)'," # # Can't install manpages here -- INST_MAN%DIR macros make line >255 chars # \$(MMS) \$(USEMACROS)INST_LIB=$self->{INSTALLPRIVLIB},INST_ARCHLIB=$self->{INSTALLARCHLIB},INST_EXE=$self->{INSTALLBIN}\$(MACROEND)",' -# @ $(PERL) -i_bak -lne "print unless $seen{$_}++" $(INST_ARCHAUTODIR).packlist +# ',$self->{NOECHO},'$(PERL) -i_bak -lne "print unless $seen{$_}++" $(INST_ARCHAUTODIR).packlist #'); my($curtop,$insttop); @@ -1405,6 +1449,30 @@ pure_install :: all ($insttop = $self->fixpath($self->{INSTALLPRIVLIB},1)) =~ s/]$//; push(@m," Backup/Log ${curtop}...]*.*; ${insttop}...]/New_Version/By_Owner=Parent\n"); + my($oldpacklist) = $self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist'); + push @m,' +# This song and dance brought to you by DCL\'s 255 char limit +reorg_packlist : +'; + my($oldpacklist) = $self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist'); + if ("\L$oldpacklist" ne "\L$self->{INST_ARCHAUTODIR}.packlist") { + push(@m,' If F$Search("',$oldpacklist,'").nes."" Then Append/New ',$oldpacklist,' $(INST_ARCHAUTODIR).packlist'); + } + push @m,' + $(PERL) -ne "BEGIN{exit unless -e $ARGV[0];}print unless $s{$_}++;" $(INST_ARCHAUTODIR).packlist >.MM_tmp + If F$Search(".MM_tmp").nes."" Then Copy/NoConfirm .MM_tmp $(INST_ARCHAUTODIR).packlist + If F$Search(".MM_tmp").nes."" Then Delete/NoConfirm .MM_tmp; +'; + +# From MM 5.16: + + push @m, q[ +# Comment on .packlist rewrite above: +# Read both .packlist files: the old one in PERL_ARCHLIB/auto/FULLEXT, and the new one +# in INSTARCHAUTODIR. Don't croak if they are missing. Write to the one +# in INSTARCHAUTODIR. +]; + push @m, ' ##### UNINSTALL IS STILL EXPERIMENTAL #### uninstall :: @@ -1446,11 +1514,11 @@ $(OBJECT) : $(PERL_INC)vmsish.h, $(PERL_INC)util.h, $(PERL_INC)config.h # An out of date config.h is not fatal but complains loudly! #$(PERL_INC)config.h : $(PERL_SRC)config.sh $(PERL_INC)config.h : $(PERL_VMS)config.vms - @ Write Sys$Error "Warning: $(PERL_INC)config.h out of date with $(PERL_VMS)config.vms" + ',$self->{NOECHO},'Write Sys$Error "Warning: $(PERL_INC)config.h out of date with $(PERL_VMS)config.vms" #$(PERL_ARCHLIB)Config.pm : $(PERL_SRC)config.sh $(PERL_ARCHLIB)Config.pm : $(PERL_VMS)config.vms $(PERL_VMS)genconfig.pl - @ Write Sys$Error "$(PERL_ARCHLIB)Config.pm may be out of date with config.vms or genconfig.pl" + ',$self->{NOECHO},'Write Sys$Error "$(PERL_ARCHLIB)Config.pm may be out of date with config.vms or genconfig.pl" olddef = F$Environment("Default") Set Default $(PERL_SRC) $(MMS) $(USEMAKEFILE)[.VMS]$(MAKEFILE) [.lib.',$Config{'arch'},']config.pm @@ -1481,13 +1549,13 @@ $(OBJECT) : $(FIRST_MAKEFILE) # 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) - @ Write Sys$Output "$(MAKEFILE) out-of-date with respect to $(MMS$SOURCE_LIST)" - @ Write Sys$Output "Cleaning current config before rebuilding $(MAKEFILE) ..." + ',$self->{NOECHO},'Write Sys$Output "$(MAKEFILE) out-of-date with respect to $(MMS$SOURCE_LIST)" + ',$self->{NOECHO},'Write Sys$Output "Cleaning current config before rebuilding $(MAKEFILE) ..." - $(MV) $(MAKEFILE) $(MAKEFILE)_old - $(MMS) $(USEMAKEFILE)$(MAKEFILE)_old clean $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" Makefile.PL ',join(' ',@ARGV),' - @ Write Sys$Output "$(MAKEFILE) has been rebuilt." - @ Write Sys$Output "Please run $(MMS) to build the extension." + ',$self->{NOECHO},'Write Sys$Output "$(MAKEFILE) has been rebuilt." + ',$self->{NOECHO},'Write Sys$Output "Please run $(MMS) to build the extension." '; join('',@m); @@ -1514,13 +1582,14 @@ test : \$(TEST_TYPE) push(@m, ' If F$Search("',$vmsdir,'$(MAKEFILE)").nes."" Then $(PERL) -e "chdir ',"'$vmsdir'", '; print `$(MMS) $(PASTHRU2) test`'."\n"); } - push(@m, "\t\@ 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: @@ -1530,10 +1599,11 @@ 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"; + push @m, "test_static :: test_dynamic\n\t$self->{NOECHO}\$(NOOP)\n"; } join('',@m); @@ -1582,8 +1652,8 @@ MAP_TARGET = $target unless ($self->{MAKEAPERL}) { push @m, q{ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) - @ Write Sys$Output "Writing ""$(MMS$TARGET)"" for this $(MAP_TARGET)" - @ $(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \ + },$self->{NOECHO},q{Write Sys$Output "Writing ""$(MMS$TARGET)"" for this $(MAP_TARGET)" + },$self->{NOECHO},q{$(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 @@ -1699,19 +1769,19 @@ $(MAP_SHRTARGET) : $(MAP_LIBPERL) $(MAP_STATIC) ',"${libperldir}Perlshr_Attr.Opt $(MAP_LINKCMD)/Shareable=$(MMS$TARGET) $(MAP_OPTS), $(MAP_EXTRA), $(MAP_LIBPERL) ',"${libperldir}Perlshr_Attr.Opt",' $(MAP_TARGET) : $(MAP_SHRTARGET) ',"${tmp}perlmain\$(OBJ_EXT) ${tmp}PerlShr.Opt",' $(MAP_LINKCMD) ',"${tmp}perlmain\$(OBJ_EXT)",', PerlShr.Opt/Option - @ Write Sys$Output "To install the new ""$(MAP_TARGET)"" binary, say" - @ Write Sys$Output " $(MMS)$(USEMAKEFILE)$(MAKEFILE) inst_perl $(USEMACROS)MAP_TARGET=$(MAP_TARGET)$(ENDMACRO)" - @ Write Sys$Output "To remove the intermediate files, say - @ Write Sys$Output " $(MMS)$(USEMAKEFILE)$(MAKEFILE) map_clean" + ',$self->{NOECHO},'Write Sys$Output "To install the new ""$(MAP_TARGET)"" binary, say" + ',$self->{NOECHO},'Write Sys$Output " $(MMS)$(USEMAKEFILE)$(MAKEFILE) inst_perl $(USEMACROS)MAP_TARGET=$(MAP_TARGET)$(ENDMACRO)" + ',$self->{NOECHO},'Write Sys$Output "To remove the intermediate files, say + ',$self->{NOECHO},'Write Sys$Output " $(MMS)$(USEMAKEFILE)$(MAKEFILE) map_clean" '; push @m,' ',"${tmp}perlmain.c",' : $(MAKEFILE) - @ $(PERL) $(MAP_PERLINC) -e "use ExtUtils::Miniperl; writemain(qw|',@staticpkgs,'|)" >$(MMS$TARGET) + ',$self->{NOECHO},'$(PERL) $(MAP_PERLINC) -e "use ExtUtils::Miniperl; writemain(qw|',@staticpkgs,'|)" >$(MMS$TARGET) '; push @m, q{ doc_inst_perl : - @ $(PERL) -e "use ExtUtils::MakeMaker; MY->new()->writedoc('Perl binary','$(MAP_TARGET)','MAP_STATIC=$(MAP_STATIC)','MAP_EXTRA=$(MAP_EXTRA)','MAP_LIBPERL=$(MAP_LIBPERL)')" + },$self->{NOECHO},q{$(PERL) -e "use ExtUtils::MakeMaker; MY->new()->writedoc('Perl binary','$(MAP_TARGET)','MAP_STATIC=$(MAP_STATIC)','MAP_EXTRA=$(MAP_EXTRA)','MAP_LIBPERL=$(MAP_LIBPERL)')" }; push @m, " @@ -1743,63 +1813,6 @@ sub extliblist { } -sub mksymlists { - my($self,%attribs) = @_; - unless (ref $self){ - ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]); - $self = $ExtUtils::MakeMaker::Parent[-1]; - } - - my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || []; - my($procs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS}; - my($package,$packprefix,$sym,$optname); - local(*OPT); - - if (!$procs) { - $package = $self->{NAME}; - $package =~ s/\W/_/g; - $procs = { $package => ["boot_$package"] }; - } - my($isvax) = $Config{'arch'} =~ /VAX/i; - - # Options file declaring universal symbols - # Used when linking shareable image for dynamic extension, - # or when linking PerlShr into which we've added this package - # as a static extension - # We don't do anything to preserve order, so we won't relax - # the GSMATCH criteria for a dynamic extension - - # BASEEXT is not available when mksymlists is run, so we - # create the options file name directly from NAME - # May cause trouble if Makefile.PL author specifies NAME - # and BASEEXT directly as unrelated strings. - ($optname = $self->{NAME}) =~ s/.*:://; - open OPT, ">$optname.opt"; - foreach $package (keys %$procs) { - ($packprefix = $package) =~ s/\W/_/g; - foreach $sym (@{$$procs{$package}}) { - $sym = "XS_${packprefix}_$sym" unless $sym =~ /^boot_/; - if ($isvax) { print OPT "UNIVERSAL=$sym\n" } - else { print OPT "SYMBOL_VECTOR=($sym=PROCEDURE)\n"; } - } - } - foreach $sym (@$vars) { - print OPT "PSECT_ATTR=${sym},PIC,OVR,RD,NOEXE,WRT,NOSHR\n"; - if ($isvax) { print OPT "UNIVERSAL=$sym\n" } - else { print OPT "SYMBOL_VECTOR=($sym=DATA)\n"; } - } - close OPT; - - # Options file specifying RTLs to which this extension must be linked. - # Eventually, the list of libraries will be supplied by a working - # extliblist routine. - open OPT,'>rtls.opt'; - print OPT "PerlShr/Share\n"; - foreach $rtl (split(/\s+/,$Config{'libs'})) { print OPT "$rtl\n"; } - close OPT; -} - - # --- 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. @@ -1820,8 +1833,8 @@ sub dir_target { my($vmsdir) = $self->fixpath($dir,1); push @m, " ${vmsdir}.exists :: \$(PERL_INC)perl.h - \@ \$(MKPATH) $vmsdir - \@ \$(TOUCH) ${vmsdir}.exists + $self->{NOECHO}\$(MKPATH) $vmsdir + $self->{NOECHO}\$(EQUALIZE_TIMESTAMP) \$(MMS\$SOURCE) \$(MMS\$TARGET) "; } join "", @m; diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index a8b0fa173d..b66a91ba42 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -56,12 +56,12 @@ sub warndirectuse { package ExtUtils::MakeMaker; -# Last edited $Date: 1996/01/05 20:40:47 $ by Andreas Koenig -# $Id: MakeMaker.pm,v 1.135 1996/01/05 20:40:47 k Exp $ +# Last edited $Date: 1996/01/28 11:33:38 $ by Andreas Koenig +# $Id: MakeMaker.pm,v 1.141 1996/01/28 11:33:38 k Exp $ -$Version = $VERSION = "5.16"; +$Version = $VERSION = "5.18"; -$ExtUtils::MakeMaker::Version_OK = 4.13; # Makefiles older than $Version_OK will die +$ExtUtils::MakeMaker::Version_OK = "5.05"; # Makefiles older than $Version_OK will die # (Will be checked from MakeMaker version 4.13 onwards) use Config; @@ -116,7 +116,7 @@ unshift(@MY::ISA, qw(MM)); # default routine without having to know under what OS # it's running. -@MM::ISA = qw[MM_Unix ExtUtils::MakeMaker]; +@MM::ISA = qw[ExtUtils::MM_Unix ExtUtils::MakeMaker]; unshift @MM::ISA, 'ExtUtils::MM_VMS' if $Is_VMS; unshift @MM::ISA, 'ExtUtils::MM_OS2' if $Is_OS2; @@ -132,6 +132,7 @@ unshift @MM::ISA, 'ExtUtils::MM_OS2' if $Is_OS2; tools_other => {}, dist => {}, macro => {}, + depend => {}, post_constants => {}, pasthru => {}, c_o => {}, @@ -633,21 +634,12 @@ sub Version_check { Current Version is $ExtUtils::MakeMaker::VERSION. There have been considerable changes in the meantime. Please rerun 'perl Makefile.PL' to regenerate the Makefile.\n" - if $checkversion < $ExtUtils::MakeMaker::Version_OK; + if $checkversion lt $ExtUtils::MakeMaker::Version_OK; printf STDOUT "%s %s %s %s.\n", "Makefile built with ExtUtils::MakeMaker v", $checkversion, "Current Version is", $ExtUtils::MakeMaker::VERSION unless $checkversion == $ExtUtils::MakeMaker::VERSION; } -sub mksymlists { - my $class = shift; - my $self = shift; - bless $self, $class; - tie %att, ExtUtils::MakeMaker::TieAtt, $self; - $self->parse_args(@ARGV); - $self->mksymlists(@_); -} - # The following mkbootstrap() is only for installations that are calling # the pre-4.1 mkbootstrap() from their old Makefiles. This MakeMaker # writes Makefiles, that use ExtUtils::Mkbootstrap directly. @@ -659,6 +651,15 @@ sub mkbootstrap { END } +# Ditto for mksymlists() as of MakeMaker 5.17 +sub mksymlists { + die <<END; +!!! Your Makefile has been built such a long time ago, !!! +!!! that is unlikely to work with current MakeMaker. !!! +!!! Please rebuild your Makefile !!! +END +} + sub neatvalue { my($v) = @_; return "undef" unless defined $v; @@ -705,7 +706,7 @@ sub selfdocument { # # # # # # # ## # # # # # # # ####### ##### # # # # # -package MM_Unix; +package ExtUtils::MM_Unix; use Config; use Cwd; @@ -713,7 +714,7 @@ use File::Basename; require Exporter; Exporter::import('ExtUtils::MakeMaker', - qw( $Verbose)); + qw( $Verbose &neatvalue)); # These attributes cannot be overridden externally @Other_Att_Keys{qw(EXTRALIBS BSLOADLIBS LDLOADLIBS)} = (1) x 3; @@ -1026,8 +1027,6 @@ EOM close PM; } $self->{VERSION} = "0.10" unless $self->{VERSION}; - $self->{VERSION} = sprintf("%.10g",$self->{VERSION}) - if ($self->{VERSION} =~ /^[\d.]{9,}$/); ($self->{VERSION_SYM} = $self->{VERSION}) =~ s/\W/_/g; # Graham Barr and Paul Marquess had some ideas how to ensure @@ -1089,7 +1088,7 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc) } elsif ($name =~ /\.h$/i){ $h{$name} = 1; } elsif ($name =~ /\.(p[ml]|pod)$/){ - $pm{$name} = $self->catfile('$(INST_LIBDIR)',"$name"); + $pm{$name} = $self->catfile('$(INST_LIBDIR)',$name); } elsif ($name =~ /\.PL$/ && $name ne "Makefile.PL") { ($pl_files{$name} = $name) =~ s/\.PL$// ; } elsif ($Is_VMS && $name =~ /\.pl$/ && $name ne 'makefile.pl' && @@ -1153,7 +1152,7 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc) my($striplibpath,$striplibname); $prefix = '$(INST_LIB)' if (($striplibpath = $path) =~ s:^(\W*)lib\W:$1:); ($striplibname,$striplibpath) = fileparse($striplibpath); - my($inst) = $self->catfile($self->catdir($prefix,$striplibpath),$striplibname); + my($inst) = $self->catfile($prefix,$striplibpath,$striplibname); local($_) = $inst; # for backwards compatibility $inst = $self->libscan($inst); print "libscan($path) => '$inst'\n" if ($ExtUtils::MakeMaker::Verbose >= 2); @@ -1901,6 +1900,13 @@ MKPATH = $(PERL) -wle '$$"="/"; foreach $$p (@ARGV){' \\ -e 'next if -d $$p; my(@p); foreach(split(/\//,$$p)){' \\ -e 'push(@p,$$_); next if -d "@p/"; print "mkdir @p" if 0;' \\ -e 'mkdir("@p",0777)||die $$! } } exit 0;' + +# This helps us to minimize the effect of the .exists files A yet +# better solution would be to have a stable file in the perl +# distribution with a timestamp of zero. But this solution doesn't +# need any changes to the core distribution and works with older perls +EQUALIZE_TIMESTAMP = $(PERL) -we 'open F, ">$$ARGV[1]"; close F;' \\ +-e 'utime ((stat("$$ARGV[0]"))[8,9], $$ARGV[1])' }; } @@ -1955,6 +1961,19 @@ sub macro { join "", @m; } +sub depend { + my($self,%attribs) = @_; + unless (ref $self){ + ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]); + $self = $ExtUtils::MakeMaker::Parent[-1]; + } + my(@m,$key,$val); + while (($key,$val) = each %attribs){ + push @m, "$key: $val\n"; + } + join "", @m; +} + sub post_constants{ my($self) = shift; unless (ref $self){ @@ -1976,7 +1995,7 @@ sub pasthru { foreach $key (qw(INSTALLPRIVLIB INSTALLARCHLIB INSTALLBIN INSTALLMAN1DIR INSTALLMAN3DIR LIBPERL_A - LINKTYPE)){ + LINKTYPE PREFIX)){ push @pasthru, "$key=\"\$($key)\""; } @@ -2130,11 +2149,10 @@ static :: $self->{BASEEXT}.exp push(@m," $self->{BASEEXT}.exp: Makefile.PL -",' $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e \'use ExtUtils::MakeMaker qw(&mksymlists); \\ - MM->new({NAME => "'.$self->{NAME}.'"})->mksymlists({DL_FUNCS => ', - %$funcs ? neatvalue($funcs) : '""',', DL_VARS => ', - @$vars ? neatvalue($vars) : '""', ", NAME => \"$self->{NAME}\"})' -"); +",' $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e \'use ExtUtils::Mksymlists; \\ + Mksymlists("NAME" => "',$self->{NAME},'", "DL_FUNCS" => ', + neatvalue($funcs),', "DL_VARS" => ', neatvalue($vars), ');\' +'); join('',@m); } @@ -3101,39 +3119,6 @@ sub extliblist { ExtUtils::Liblist::ext($libs, $ExtUtils::MakeMaker::Verbose); } -sub mksymlists { - my($self) = shift; - unless (ref $self){ - ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]); - $self = $ExtUtils::MakeMaker::Parent[-1]; - } - my($pkg); - - # only AIX requires a symbol list at this point - # (so does VMS, but that's handled by the MM_VMS package) - return '' unless $Config::Config{osname} eq 'aix'; - - $self->init_main(@ARGV) unless defined $self->{BASEEXT}; - if (! $self->{DL_FUNCS}) { - my($bootfunc); - ($bootfunc = $self->{NAME}) =~ s/\W/_/g; - $self->{DL_FUNCS} = {$self->{BASEEXT} => ["boot_$bootfunc"]}; - } - rename "$self->{BASEEXT}.exp", "$self->{BASEEXT}.exp_old"; - - open(EXP,">$self->{BASEEXT}.exp") or die $!; - print EXP join("\n",@{$self->{DL_VARS}}, "\n") if $self->{DL_VARS}; - foreach $pkg (keys %{$self->{DL_FUNCS}}) { - (my($prefix) = $pkg) =~ s/\W/_/g; - my $func; - foreach $func (@{$self->{DL_FUNCS}->{$pkg}}) { - $func = "XS_${prefix}_$func" unless $func =~ /^boot_/; - print EXP "$func\n"; - } - } - close EXP; -} - # --- 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. @@ -3154,7 +3139,7 @@ sub dir_target { push @m, " $dir/.exists :: \$(PERL) $self->{NOECHO}\$(MKPATH) $dir - $self->{NOECHO}\$(TOUCH) $dir/.exists + $self->{NOECHO}\$(EQUALIZE_TIMESTAMP) \$(PERL) $dir/.exists $self->{NOECHO}-\$(CHMOD) 755 $dir "; } @@ -3233,7 +3218,7 @@ package ExtUtils::MM_OS2; require Exporter; Exporter::import('ExtUtils::MakeMaker', - qw( $Verbose)); + qw( $Verbose &neatvalue)); sub dlsyms { my($self,%attribs) = @_; @@ -3245,20 +3230,12 @@ sub dlsyms { if (not $self->{SKIPHASH}{'dynamic'}) { push(@m," -$self->{BASEEXT}.def: Makefile.PL" - . ' - echo "LIBRARY ' . "'$self->{DLBASE}'" . ' INITINSTANCE TERMINSTANCE" > $@ ; \\ - echo "CODE LOADONCALL" >> $@ ; \\ - echo "DATA LOADONCALL NONSHARED MULTIPLE" >> $@ ; \\ - echo "EXPORTS" >> $@ ; \\ - echo " ' . "boot_$boot" . '" >> $@'); - foreach $sym (keys %$funcs, @$vars) { - push(@m, " ; \\ - echo \" $sym\" >> \$@"); - } - push(@m,"\n"); +$self->{BASEEXT}.def: Makefile.PL +",' $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e \'use ExtUtils::Mksymlists; \\ + Mksymlists("NAME" => "',$self->{NAME},'", "DLBASE" => "',$self->{DLBASE}, + '", "DL_FUNCS" => ',neatvalue($funcs),', "DL_VARS" => ', neatvalue($vars), ');\' +'); } - join('',@m); } @@ -3979,7 +3956,7 @@ B<after> the eval() will be assigned to the VERSION attribute of the MakeMaker object. The following lines will be parsed o.k.: $VERSION = '1.00'; - ( $VERSION ) = '$Revision: 1.135 $ ' =~ /\$Revision:\s+([^\s]+)/; + ( $VERSION ) = '$Revision: 1.141 $ ' =~ /\$Revision:\s+([^\s]+)/; $FOO::VERSION = '1.10'; but these will fail: @@ -4031,6 +4008,10 @@ part of the Makefile. These are not normally required: {FILES => "*.xyz foo"} +=item depend + + {ANY_TARGET => ANY_DEPENDECY, ...} + =item dist {TARFLAGS => 'cvfF', COMPRESS => 'gzip', SUFFIX => 'gz', diff --git a/lib/ExtUtils/Mksymlists.pm b/lib/ExtUtils/Mksymlists.pm new file mode 100644 index 0000000000..cc4aca1c82 --- /dev/null +++ b/lib/ExtUtils/Mksymlists.pm @@ -0,0 +1,217 @@ +package ExtUtils::Mksymlists; +use strict qw[ subs refs ]; +# no strict 'vars'; # until filehandles are exempted + +use Carp; +use Config; +use Exporter; +# mention vars twice to prevent single-use warnings +@ExtUtils::Mksymlists::ISA = @ExtUtils::Mksymlists::ISA = 'Exporter'; +@ExtUtils::Mksymlists::EXPORT = @ExtUtils::Mksymlists::EXPORT = '&Mksymlists'; +$ExtUtils::Mksymlists::VERSION = $ExtUtils::Mksymlists::VERSION = '1.00'; + +sub Mksymlists { + my(%spec) = @_; + my($osname) = $Config{'osname'}; + + croak("Insufficient information specified to Mksymlists") + unless ( $spec{NAME} or + ($spec{FILE} and ($spec{DL_FUNCS} or $spec{FUNCLIST})) ); + + $spec{DL_VARS} = [] unless $spec{DL_VARS}; + ($spec{FILE} = $spec{NAME}) =~ s/.*::// unless $spec{FILE}; + $spec{DL_FUNCS} = { $spec{NAME} => [] } + unless ( ($spec{DL_FUNCS} and keys %{$spec{DL_FUNCS}}) or + $spec{FUNCLIST}); + $spec{FUNCLIST} = [] unless $spec{FUNCLIST}; + if (defined $spec{DL_FUNCS}) { + my($package); + foreach $package (keys %{$spec{DL_FUNCS}}) { + my($packprefix,$sym,$bootseen); + ($packprefix = $package) =~ s/\W/_/g; + foreach $sym (@{$spec{DL_FUNCS}->{$package}}) { + if ($sym =~ /^boot_/) { + push(@{$spec{FUNCLIST}},$sym); + $bootseen++; + } + else { push(@{$spec{FUNCLIST}},"XS_${packprefix}_$sym"); } + } + push(@{$spec{FUNCLIST}},"boot_$packprefix") unless $bootseen; + } + } + +# 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 ($osname eq 'aix') { _write_aix(\%spec); } + elsif ($osname eq 'VMS') { _write_vms(\%spec) } + elsif ($osname eq 'OS2') { _write_os2(\%spec) } + else { croak("Don't know how to create linker option file for $osname\n"); } +} + + +sub _write_aix { + my($data) = @_; + + rename "$data->{FILE}.exp", "$data->{FILE}.exp_old"; + + open(EXP,">$data->{FILE}.exp") + or croak("Can't create $data->{FILE}.exp: $!\n"); + print EXP join("\n",@{$data->{DL_VARS}}, "\n") if @{$data->{DL_VARS}}; + print EXP join("\n",@{$data->{FUNCLIST}}, "\n") if @{$data->{FUNCLIST}}; + close EXP; +} + + +sub _write_os2 { + my($data) = @_; + + if (not $data->{DLBASE}) { + ($data->{DLBASE} = $data->{NAME}) =~ s/.*:://; + $data->{DLBASE} = substr($data->{DLBASE},0,7) . '_'; + } + rename "$data->{FILE}.def", "$data->{FILE}_def.old"; + + open(DEF,">$data->{FILE}.def") + or croak("Can't create $data->{FILE}.def: $!\n"); + 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}}; + close DEF; +} + + +sub _write_vms { + my($data) = @_; + my($isvax) = $Config{'arch'} =~ /VAX/i; + my($sym); + + rename "$data->{FILE}.opt", "$data->{FILE}.opt_old"; + + open(OPT,">$data->{FILE}.opt") + or croak("Can't create $data->{FILE}.opt: $!\n"); + + # Options file declaring universal symbols + # Used when linking shareable image for dynamic extension, + # or when linking PerlShr into which we've added this package + # as a static extension + # We don't do anything to preserve order, so we won't relax + # the GSMATCH criteria for a dynamic extension + + foreach $sym (@{$data->{FUNCLIST}}) { + if ($isvax) { print OPT "UNIVERSAL=$sym\n" } + else { print OPT "SYMBOL_VECTOR=($sym=PROCEDURE)\n"; } + } + foreach $sym (@{$data->{DL_VARS}}) { + print OPT "PSECT_ATTR=${sym},PIC,OVR,RD,NOEXE,WRT,NOSHR\n"; + if ($isvax) { print OPT "UNIVERSAL=$sym\n" } + else { print OPT "SYMBOL_VECTOR=($sym=DATA)\n"; } + } + close OPT; + + # Options file specifying RTLs to which this extension must be linked. + # Eventually, the list of libraries will be supplied by a working + # extliblist routine. + open OPT,'>rtls.opt'; + print OPT "PerlShr/Share\n"; + foreach $rtl (split(/\s+/,$Config{'libs'})) { print OPT "$rtl\n"; } + close OPT; +} + +1; + +__END__ + +=head1 NAME + +ExtUtils::Mksymlists - write linker options files for dynamic extension + +=head1 SYNOPSIS + + use ExtUtils::Mksymlists; + Mksymlists({ NAME => $name , + DL_VARS => [ $var1, $var2, $var3 ], + DL_FUNCS => { $pkg1 => [ $func1, $func2 ], + $pkg2 => [ $func3 ] }); + +=head1 DESCRIPTION + +C<ExtUtils::Mksymlists> produces files used by the linker under some OSs +during the creation of shared libraries for synamic extensions. It is +normally called from a MakeMaker-generated Makefile when the extension +is built. The linker option file is generated by calling the function +C<Mksymlists>, which is exported by default from C<ExtUtils::Mksymlists>. +It takes one argument, a list of key-value pairs, in which the following +keys are recognized: + +=item NAME + +This gives the name of the extension (I<e.g.> Tk::Canvas) for which +the linker option file will be produced. + +=item DL_FUNCS + +This is identical to the DL_FUNCS attribute available via MakeMaker, +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<DL_FUNCS =E<gt> { Homer::Iliad =E<gt> [ qw(trojans greeks) ], +Homer::Odyssey =E<gt> [ qw(travellers family suitors) ] }>. The +function names should be identical to those in the XSUB code; +C<Mksymlists> will alter the names written to the linker option +file to match the changes made by F<xsubpp>. In addition, if +none of the functions in a list begin with the string B<boot_>, +C<Mksymlists> will add a bootstrap function for that package, +just as xsubpp does. (If a B<boot_E<lt>pkgE<gt>> function is +present in the list, it is passed through unchanged.) If +DL_FUNCS is not specified, it defaults to the bootstrap +function for the extension specified in NAME. + +=item DL_VARS + +This is identical to the DL_VARS attribute available via MakeMaker, +and, like DL_FUNCS, it is usually specified via MakeMaker. Its +value is a reference to an array of variable names which should +be exported by the extension. + +=item FILE + +This key can be used to specify the name of the linker option file +(minus the OS-specific extension), if for some reason you do not +want to use the default value, which is the last word of the NAME +attribute (I<e.g.> for Tk::Canvas, FILE defaults to 'Canvas'). + +=item FUNCLIST + +This provides an alternate means to specify function names to be +exported from the extension. Its value is a reference to an +array of function names to be exported by the extension. These +names are passed through unaltered to the linker options file. + +=item DLBASE + +This item specifies the name by which the linker knows the +extension, which may be different from the name of the +extension itself (for instance, some linkers add an '_' to the +name of the extension). If it is not specified, it is derived +from the NAME attribute. It is presently used only by OS2. + +When calling C<Mksymlists>, one should always specify the NAME +attribute. In most cases, this is all that's necessary. In +the case of unusual extensions, however, the other attributes +can be used to provide additional information to the linker. + +=head1 AUTHOR + +Charles Bailey I<E<lt>bailey@genetics.upenn.eduE<gt>> + +=head1 REVISION + +Last revised 14-Jan-1996, for Perl 5.002. diff --git a/lib/ExtUtils/typemap b/lib/ExtUtils/typemap index 98493e7c04..a9733d0f49 100644 --- a/lib/ExtUtils/typemap +++ b/lib/ExtUtils/typemap @@ -261,7 +261,7 @@ T_ARRAY T_IN { GV *gv = newGVgen("$Package"); - if ( do_open(gv, "<&", 2, $var) ) + if ( do_open(gv, "<&", 2, FALSE, 0, 0, $var) ) sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1))); else $arg = &sv_undef; @@ -269,7 +269,7 @@ T_IN T_INOUT { GV *gv = newGVgen("$Package"); - if ( do_open(gv, "+<&", 3, $var) ) + if ( do_open(gv, "+<&", 3, FALSE, 0, 0, $var) ) sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1))); else $arg = &sv_undef; @@ -277,7 +277,7 @@ T_INOUT T_OUT { GV *gv = newGVgen("$Package"); - if ( do_open(gv, "+>&", 3, $var) ) + if ( do_open(gv, "+>&", 3, FALSE, 0, 0, $var) ) sv_setsv($arg, sv_bless(newRV((SV*)gv), gv_stashpv("$Package",1))); else $arg = &sv_undef; diff --git a/lib/ExtUtils/xsubpp b/lib/ExtUtils/xsubpp index 3113c62ed9..0d9c816abc 100755 --- a/lib/ExtUtils/xsubpp +++ b/lib/ExtUtils/xsubpp @@ -76,13 +76,12 @@ perl(1), perlxs(1), perlxstut(1), perlapi(1) =cut # Global Constants -$XSUBPP_version = "1.929"; +$XSUBPP_version = "1.932"; require 5.002; sub Q ; -$FH_string = 'File0000' ; -*FH = $FH_string ; +$FH = 'File0000' ; $usage = "Usage: xsubpp [-v] [-C++] [-except] [-prototypes] [-noversioncheck] [-s pattern] [-typemap typemap]... file.xs\n"; @@ -405,6 +404,9 @@ sub VERSIONCHECK_handler () sub PROTOTYPE_handler () { + death("Error: Only 1 PROTOTYPE definition allowed per xsub") + if $proto_in_this_xsub ++ ; + for (; !/^$BLOCK_re/o; $_ = shift(@line)) { next unless /\S/; TrimWhitespace($_) ; @@ -422,7 +424,9 @@ sub PROTOTYPE_handler () $ProtoThisXSUB = C_string($_) ; } } + $ProtoUsed = 1 ; + } sub PROTOTYPES_handler () @@ -448,9 +452,6 @@ sub INCLUDE_handler () TrimWhitespace($_) ; - # If the filename is enclosed in quotes, remove them. - s/^'([^']*)'$/$1/ or s/^"([^"]*)"$/$1/ ; - death("INCLUDE: filename missing") unless $_ ; @@ -470,13 +471,13 @@ sub INCLUDE_handler () Line => \@line, LineNo => \@line_no, Filename => $filename, - Handle => $FH_string, + Handle => $FH, }) ; - ++ $FH_string ; + ++ $FH ; # open the new file - open ($FH_string, "$_") or death("Cannot open '$_': $!") ; + open ($FH, "$_") or death("Cannot open '$_': $!") ; print Q<<"EOF" ; # @@ -484,11 +485,17 @@ sub INCLUDE_handler () # EOF - *FH = $FH_string ; $filename = $_ ; - # Prime the pump by reading the first line - $lastline = <FH> ; + # Prime the pump by reading the first + # non-blank line + + # skip leading blank lines + while (<$FH>) { + last unless /^\s*$/ ; + } + + $lastline = $_ ; $lastline_no = $. ; } @@ -504,9 +511,9 @@ sub PopFile() -- $IncludedFiles{$filename} unless $isPipe ; - close FH ; + close $FH ; - *FH = $data->{Handle} ; + $FH = $data->{Handle} ; $filename = $data->{Filename} ; $lastline = $data->{LastLine} ; $lastline_no = $data->{LastLineNo} ; @@ -581,7 +588,7 @@ sub Q { $text; } -open(FH, $filename) or die "cannot open $filename: $!\n"; +open($FH, $filename) or die "cannot open $filename: $!\n"; # Identify the version of xsubpp used print <<EOM ; @@ -596,7 +603,7 @@ print <<EOM ; EOM -while (<FH>) { +while (<$FH>) { last if ($Module, $Package, $Prefix) = /^MODULE\s*=\s*([\w:]+)(?:\s+PACKAGE\s*=\s*([\w:]+))?(?:\s+PREFIX\s*=\s*(\S+))?\s*$/; print $_; @@ -607,14 +614,14 @@ $lastline = $_; $lastline_no = $.; -# Read next xsub into @line from ($lastline, <FH>). +# Read next xsub into @line from ($lastline, <$FH>). sub fetch_para { # parse paragraph @line = (); @line_no = () ; if (! defined $lastline) { return 1 if PopFile() ; - return 0 ; + return 0 ; } if ($lastline =~ @@ -638,11 +645,11 @@ sub fetch_para { } # Read next line and continuation lines - last unless defined($lastline = <FH>); + last unless defined($lastline = <$FH>); $lastline_no = $.; my $tmp_line; $lastline .= $tmp_line - while ($lastline =~ /\\$/ && defined($tmp_line = <FH>)); + while ($lastline =~ /\\$/ && defined($tmp_line = <$FH>)); chomp $lastline; $lastline =~ s/^\s+$//; @@ -673,6 +680,7 @@ while (fetch_para()) { undef($wantRETVAL) ; undef(%arg_list) ; undef(@proto_arg) ; + undef($proto_in_this_xsub) ; $ProtoThisXSUB = $WantPrototypes ; $_ = shift(@line); @@ -986,7 +994,7 @@ for (@Func_name) { # XSANY.any_i32 = $value ; EOF print Q<<"EOF" if $proto ; -# sv_setpv(cv, $ProtoXSUB{$pname}) ; +# sv_setpv((SV*)cv, $ProtoXSUB{$pname}) ; EOF } } |