diff options
Diffstat (limited to 'lib/ExtUtils')
-rw-r--r-- | lib/ExtUtils/Liblist.pm | 1 | ||||
-rw-r--r-- | lib/ExtUtils/MakeMaker.pm | 79 | ||||
-rw-r--r-- | lib/ExtUtils/Manifest.pm | 36 | ||||
-rw-r--r-- | lib/ExtUtils/Mkbootstrap.pm | 30 |
4 files changed, 88 insertions, 58 deletions
diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm index 53eb0322d0..ebb2536382 100644 --- a/lib/ExtUtils/Liblist.pm +++ b/lib/ExtUtils/Liblist.pm @@ -171,6 +171,7 @@ sub lsdir { #yes, duplicate code seems less hassle than having an 1; __END__ + =head1 NAME ExtUtils::Liblist - determine libraries to use and how to use them diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index 5de54c6231..6aae816d4a 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -56,10 +56,10 @@ sub warndirectuse { package ExtUtils::MakeMaker; -# Last edited $Date: 1995/12/05 18:20:28 $ by Andreas Koenig -# $Id: MakeMaker.pm,v 1.115 1995/12/05 18:20:28 k Exp $ +# Last edited $Date: 1995/12/10 23:38:09 $ by Andreas Koenig +# $Id: MakeMaker.pm,v 1.116 1995/12/10 23:38:09 k Exp $ -$Version = $VERSION = "5.11"; +$Version = $VERSION = "5.12"; $ExtUtils::MakeMaker::Version_OK = 4.13; # Makefiles older than $Version_OK will die # (Will be checked from MakeMaker version 4.13 onwards) @@ -993,7 +993,7 @@ EOM # version compatibility between the *.pm file and the # corresponding *.xs file. The bottomline was, that we need an # XS_VERSION macro that defaults to VERSION: - $self->{XS_VERSION} ||= $self->{VERSION}; + # $self->{XS_VERSION} ||= $self->{VERSION}; # --- Initialize Perl Binary Locations @@ -1132,25 +1132,27 @@ sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc) $self->{MAN1PODS} = {}; } else { my %manifypods = (); - foreach $name (@{$self->{EXE_FILES}}) { - local(*TESTPOD); - my($ispod)=0; - if (open(TESTPOD,"<$name")) { - my $testpodline; - while ($testpodline = <TESTPOD>) { - if($testpodline =~ /^=head/) { - $ispod=1; - last; + if( exists $self->{EXE_FILES} ){ + foreach $name (@{$self->{EXE_FILES}}) { + local(*TESTPOD); + my($ispod)=0; + if (open(TESTPOD,"<$name")) { + my $testpodline; + while ($testpodline = <TESTPOD>) { + if($testpodline =~ /^=head/) { + $ispod=1; + last; + } + } + close(TESTPOD); + } else { + # If it doesn't exist yet, we assume, it has pods in it + $ispod = 1; + } + if( $ispod ) { + $manifypods{$name} = $self->catdir('$(INST_MAN1DIR)',basename($name).'.$(MAN1EXT)'); } } - close(TESTPOD); - } else { - # If it doesn't exist yet, we assume, it has pods in it - $ispod = 1; - } - if( $ispod ) { - $manifypods{$name} = $self->catdir('$(INST_MAN1DIR)',basename($name).'.$(MAN1EXT)'); - } } $self->{MAN1PODS} = \%manifypods; @@ -1241,7 +1243,10 @@ sub init_others { # --- Initialize Other Attributes # Compute EXTRALIBS, BSLOADLIBS and LDLOADLIBS from $self->{LIBS} # Lets look at $self->{LIBS} carefully: It may be an anon array, a string or # undefined. In any case we turn it into an anon array: - $self->{LIBS}=[] unless $self->{LIBS}; + + # May check $Config{libs} too, thus not empty. + $self->{LIBS}=[''] unless $self->{LIBS}; + $self->{LIBS}=[$self->{LIBS}] if ref \$self->{LIBS} eq SCALAR; $self->{LD_RUN_PATH} = ""; my($libs); @@ -1288,7 +1293,7 @@ sub init_others { # --- Initialize Other Attributes $self->{UMASK_NULL} = "umask 0"; } -sub find_perl{ +sub find_perl { my($self, $ver, $names, $dirs, $trace) = @_; unless (ref $self){ ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]); @@ -1306,10 +1311,10 @@ in these dirs: next unless defined $dir; # $self->{PERL_SRC} may be undefined foreach $name (@$names){ my $abs; - if ($name =~ m|^/|) { + if ($self->file_name_is_absolute($name)) { $abs = $name; - } elsif ($name =~ m|/|) { - $abs = $self->catfile(".", $name); # not absolute + } elsif ($name =~ m|/|) { # file_name_contains_path + $abs = $self->catfile(".", $name); } else { $abs = $self->catfile($dir, $name); } @@ -1366,6 +1371,12 @@ sub maybe_command { return; } +sub perl_script { + my($self,$file) = @_; + return 1 if -r $file && ! -d $file; + return; +} + # Ilya's suggestion, not yet used sub file_name_is_absolute { my($self,$file) = @_; @@ -1421,9 +1432,9 @@ VERSION = $self->{VERSION} VERSION_SYM = $self->{VERSION_SYM} VERSION_MACRO = VERSION DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\" -XS_VERSION = $self->{XS_VERSION} -XS_VERSION_MACRO = XS_VERSION -XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\" +# XS_VERSION = $self->{XS_VERSION} +# XS_VERSION_MACRO = XS_VERSION +# XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\" # In which directory should we put this extension during 'make'? # This is typically ./blib. @@ -2286,7 +2297,7 @@ sub manifypods { } else { $pod2man_exe = "$Config{bin}/pod2man"; } - unless ($self->maybe_command($pod2man_exe)) { + unless ($self->perl_script($pod2man_exe)) { # No pod2man but some MAN3PODS to be installed print <<END; @@ -2338,6 +2349,7 @@ $self->{PL_FILES}->{$plfile} :: $plfile sub installbin { my($self) = shift; return "" unless $self->{EXE_FILES} && ref $self->{EXE_FILES} eq "ARRAY"; + return "" unless @{$self->{EXE_FILES}}; my(@m, $from, $to, %fromto, @to); push @m, $self->dir_target(qw[$(INST_EXE)]); for $from (@{$self->{EXE_FILES}}) { @@ -2615,7 +2627,7 @@ doc_install :: @ echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod @ $(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \\ -e "use ExtUtils::MakeMaker; MY->new({})->writedoc('Module', '$(NAME)', \\ - 'LINKTYPE=$(LINKTYPE)', 'VERSION=$(VERSION)', 'XS_VERSION=$(XS_VERSION)', \\ + 'LINKTYPE=$(LINKTYPE)', 'VERSION=$(VERSION)', \\ 'EXE_FILES=$(EXE_FILES)')" >> $(INSTALLARCHLIB)/perllocal.pod }; @@ -3921,11 +3933,6 @@ May be set to an empty string, which is identical to C<-prototypes>, or C<-noprototypes>. See the xsubpp documentation for details. MakeMaker defaults to the empty string. -=item XS_VERSION - -Your version number for the XS part of your extension. This defaults -to S(VERSION). - =back =head2 Additional lowercase attributes diff --git a/lib/ExtUtils/Manifest.pm b/lib/ExtUtils/Manifest.pm index 1c54c77ee9..4d18cbe5fd 100644 --- a/lib/ExtUtils/Manifest.pm +++ b/lib/ExtUtils/Manifest.pm @@ -27,7 +27,8 @@ C<ExtUtils::Manifest::manicopy($read,$target,$how);> =head1 DESCRIPTION Mkmanifest() writes all files in and below the current directory to a -file named C<MANIFEST> in the current directory. It works similar to +file named in the global variable $ExtUtils::Manifest::MANIFEST (which +defaults to C<MANIFEST>) in the current directory. It works similar to find . -print @@ -89,6 +90,17 @@ expressions should appear one on each line. A typical example: C<&mkmanifest>, C<&manicheck>, C<&filecheck>, C<&fullcheck>, C<&maniread>, and C<&manicopy> are exportable. +=head1 GLOBAL VARIABLES + +C<$ExtUtils::Manifest::MANIFEST> defaults to C<MANIFEST>. Changing it +results in both a different C<MANIFEST> and a different +C<MANIFEST.SKIP> file. This is useful if you want to maintain +different distributions for different audiences (say a user version +and a developer version including RCS). + +<$ExtUtils::Manifest::Quiet> defaults to 0. If set to a true value, +all functions act silently. + =head1 DIAGNOSTICS All diagnostic output is sent to C<STDERR>. @@ -117,6 +129,10 @@ to MANIFEST. $Verbose is set to 1 by default. =back +=head1 SEE ALSO + +L<ExtUtils::MakeMaker> which has handy targets for most of the functionality. + =head1 AUTHOR Andreas Koenig F<E<lt>koenig@franz.ww.TU-Berlin.DEE<gt>> @@ -136,10 +152,12 @@ $Debug = 0; $Verbose = 1; $Is_VMS = $Config{'osname'} eq 'VMS'; -$VERSION = $VERSION = substr(q$Revision: 1.17 $,10,4); +$VERSION = $VERSION = substr(q$Revision: 1.18 $,10,4); $Quiet = 0; +$MANIFEST = 'MANIFEST'; + # Really cool fix from Ilya :) unless (defined $Config{d_link}) { *ln = \&cp; @@ -150,8 +168,8 @@ sub mkmanifest { my $read = maniread() or $manimiss++; $read = {} if $manimiss; local *M; - rename "MANIFEST", "MANIFEST.bak" unless $manimiss; - open M, ">MANIFEST" or die "Could not open MANIFEST: $!"; + rename $MANIFEST, "$MANIFEST.bak" unless $manimiss; + open M, ">$MANIFEST" or die "Could not open $MANIFEST: $!"; my $matches = _maniskip(); my $found = manifind(); my($key,$val,$file,%all); @@ -159,7 +177,7 @@ sub mkmanifest { foreach $file (sort keys %all) { next if &$matches($file); if ($Verbose){ - warn "Added to MANIFEST: $file\n" unless exists $read->{$file}; + warn "Added to $MANIFEST: $file\n" unless exists $read->{$file}; } my $text = $all{$file}; ($file,$text) = split(/\s+/,$text,2) if $Is_VMS; @@ -205,7 +223,7 @@ sub _manicheck { if ($arg & 1){ my $found = manifind(); foreach $file (sort keys %$read){ - warn "Debug: manicheck checking from MANIFEST $file\n" if $Debug; + warn "Debug: manicheck checking from $MANIFEST $file\n" if $Debug; unless ( exists $found->{$file} ) { warn "No such file: $file\n" unless $Quiet; push @missfile, $file; @@ -224,7 +242,7 @@ sub _manicheck { } warn "Debug: manicheck checking from disk $file\n" if $Debug; unless ( exists $read->{$file} ) { - warn "Not in MANIFEST: $file\n" unless $Quiet; + warn "Not in $MANIFEST: $file\n" unless $Quiet; push @missentry, $file; } } @@ -234,7 +252,7 @@ sub _manicheck { sub maniread { my ($mfile) = @_; - $mfile = "MANIFEST" unless defined $mfile; + $mfile = $MANIFEST unless defined $mfile; my $read = {}; local *M; unless (open M, $mfile){ @@ -255,7 +273,7 @@ sub _maniskip { my ($mfile) = @_; my $matches = sub {0}; my @skip ; - my $mfile = "MANIFEST.SKIP" unless defined $mfile; + my $mfile = "$MANIFEST.SKIP" unless defined $mfile; local *M; return $matches unless -f $mfile; open M, $mfile or return $matches; diff --git a/lib/ExtUtils/Mkbootstrap.pm b/lib/ExtUtils/Mkbootstrap.pm index a074bb1dd2..571098552f 100644 --- a/lib/ExtUtils/Mkbootstrap.pm +++ b/lib/ExtUtils/Mkbootstrap.pm @@ -7,12 +7,17 @@ $Version=2.0; # just to start somewhere sub Mkbootstrap { -=head1 USEFUL SUBROUTINES +=head1 NAME -=head2 Mkbootstrap() +Mkbootstrap - make a bootstrap file for use by DynaLoader -Make a bootstrap file for use by this system's DynaLoader. It -typically gets called from an extension Makefile. +=head1 SYNOPSIS + +C<mkbootstrap> + +=head1 DESCRIPTION + +Mkbootstrap typically gets called from an extension Makefile. There is no C<*.bs> file supplied with the extension. Instead a C<*_BS> file which has code for the special cases, like posix for @@ -20,15 +25,14 @@ berkeley db on the NeXT. This file will get parsed, and produce a maybe empty C<@DynaLoader::dl_resolve_using> array for the current architecture. -That will be extended by $BSLOADLIBS, which was computed by Andy's -extliblist script. If this array still is empty, we do nothing, else -we write a .bs file with an C<@DynaLoader::dl_resolve_using> array, but -without any C<if>s, because there is no longer a need to deal with -special cases. - -The C<*_BS> file can put some code into the generated C<*.bs> file by placing -it in C<$bscode>. This is a handy 'escape' mechanism that may prove -useful in complex situations. +That will be extended by $BSLOADLIBS, which was computed by +ExtUtils::Liblist::ext(). If this array still is empty, we do nothing, +else we write a .bs file with an C<@DynaLoader::dl_resolve_using> +array. + +The C<*_BS> file can put some code into the generated C<*.bs> file by +placing it in C<$bscode>. This is a handy 'escape' mechanism that may +prove useful in complex situations. If @DynaLoader::dl_resolve_using contains C<-L*> or C<-l*> entries then Mkbootstrap will automatically add a dl_findfile() call to the |