From: Michael G. Schwern Date: Fri, 23 May 2003 02:10:46 +0000 (-0700) Subject: ExtUtils::MakeMaker 6.10_03 -> 6.10_04 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2530b651d288d7db98df4c0991f07a783a1cd32c;p=p5sagit%2Fp5-mst-13.2.git ExtUtils::MakeMaker 6.10_03 -> 6.10_04 Message-ID: <20030523091046.GB11662@windhund.schwern.org> p4raw-id: //depot/perl@19594 --- diff --git a/MANIFEST b/MANIFEST index f334785..bdf85f8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1084,11 +1084,13 @@ lib/ExtUtils/instmodsh Give information about installed extensions lib/ExtUtils/Liblist.pm Locates libraries lib/ExtUtils/Liblist/Kid.pm Does the real work of the above lib/ExtUtils/MakeMaker.pm Write Makefiles for extensions +lib/ExtUtils/MakeMaker/bytes.pm Version agnostic bytes.pm lib/ExtUtils/MakeMaker/FAQ.pod MakeMaker FAQ lib/ExtUtils/MakeMaker/Tutorial.pod Writing a module with MakeMaker lib/ExtUtils/MakeMaker/vmsish.pm Platform agnostic vmsish.pm lib/ExtUtils/Manifest.pm Utilities to write MANIFEST files lib/ExtUtils/MANIFEST.SKIP The default MANIFEST.SKIP +lib/ExtUtils/META.yml ExtUtils::MakeMaker metadata lib/ExtUtils/Mkbootstrap.pm Writes a bootstrap file (see MakeMaker) lib/ExtUtils/Mksymlists.pm Writes a linker options file for extensions lib/ExtUtils/MM.pm MakeMaker adaptor class @@ -1113,6 +1115,7 @@ lib/ExtUtils/t/00compile.t See if MakeMaker modules compile lib/ExtUtils/t/00setup_dummy.t Setup MakeMaker test module lib/ExtUtils/t/backwards.t Check MakeMaker's backwards compatibility lib/ExtUtils/t/basic.t See if MakeMaker can build a module +lib/ExtUtils/t/bytes.t Test ExtUtils::MakeMaker::bytes lib/ExtUtils/t/Command.t See if ExtUtils::Command works (Win32 only) lib/ExtUtils/t/Constant.t See if ExtUtils::Constant works lib/ExtUtils/t/Embed.t See if ExtUtils::Embed and embedding works @@ -1140,6 +1143,7 @@ lib/ExtUtils/t/prompt.t See if E::MM::prompt() works lib/ExtUtils/t/split_command.t See if MM's xargs-like function works lib/ExtUtils/t/testlib.t See if ExtUtils::testlib works lib/ExtUtils/t/VERSION_FROM.t See if MakeMaker's VERSION_FROM works +lib/ExtUtils/t/vmsish.t Test ExtUtils::MakeMaker::vmsish lib/ExtUtils/t/writemakefile_args.t See if WriteMakefile works lib/ExtUtils/t/zz_cleanup_dummy.t Cleanup MakeMaker test module lib/ExtUtils/testlib.pm Fixes up @INC to use just-built extension diff --git a/lib/ExtUtils/Changes b/lib/ExtUtils/Changes index 879f55d..65a5555 100644 --- a/lib/ExtUtils/Changes +++ b/lib/ExtUtils/Changes @@ -1,4 +1,82 @@ -6.06_05 +6.10_04 Fri May 23 01:13:04 PDT 2003 + - Working around BSD threaading bug in version check. [from bleadperl] + - Added the Makefile to the dist dependencies. (Slaven Rezic) + - Reversing the find_perl() version check failure warning introced in + 6.10_03. Too talkative, warned when nothing was wrong. + * Fixing META.yml auto-addition when there's no newline at the end + of the MANIFEST [rt.cpan.org 2444] + * Making it a bit more obvious in the MANIFEST where META.yml comes from. + - Fixed $_ clobbering in ExtUtils::Manifest functions. + - [rt.cpan.org 2591] some LD_RUN_PATH thing (Marek Rouchal) + - Added core.\d+ files to 'make clean' [rt.cpan.org 2543] (Slaven Rezic) + - INST_* targets were expanded too early (Stas Bekman) + - Adding ExtUtils::MakeMaker::bytes (bytes.pm backwards compat wrapper) + - Fixing MM_MacOS so it will compile on 5.5.x machines (use bytes wrapper) + * Reducing perldepend set of CORE/*.h dependencies to what 5.5.3 has. + 5.5.3 should be able to compile XS again. + * Eliminating fakethr.h and perlsfio.h from VMS's perldepend as they + sometimes don't get installed. + - ExtUtils::Install was making a few directories even with the + "don't really do it" switch on (Slaven Rezic) + * can build static linked perl binaries again. Probably damaged in + 6.06_01 when $self->{MAKEFILE} became FIRST_MAKEFILE. (Nick Clark) + +6.10_03 Fri Apr 11 00:21:25 PDT 2003 + * Added NO_META WriteMakefile() option to suppress generation of + META.yml. (Spoon, rt.cpan.org 2359) + - Spurious linebreak in uninstall_from_sitedirs on VMS (Craig Berry) + * A bit after 6.05 man page names would come out as lib::Foo::Bar + if the module name didn't contain a ::. Found with podulators. + Fixed. + * Skipping installation of RCS ,v files. + * 'make ci' was busted between 6.05 and 6.06_01. Fixed. (Andreas) + - 'make test' was broken when there's no tests. Introduced in 6.06_03. + (Stas Bekman) + - Solving some directory depth problems in tests on oldish VMS systems. + (Craig Berry) + - Fixing MM_MacOS so it compiles on UTF-8 systems. (Jarkko) + - Making find_perl() more talkative when the version check fails + miserably. + - Fixing PERL_ARCHIVE on VMS so XS can compile again (Craig Berry) + +6.10_02 Mon Apr 7 00:57:15 PDT 2003 + * Removed 2>&1 experiment introduced in 6.10_01 for all non-Unixen + except for OS/2. Thought Perl might emulate `... 2>&1`. It doesn't. + Just on OS/2. + +6.10_01 Sun Apr 6 19:31:42 PDT 2003 + - Making install "Skip ... (unchanged)" message happen consistently + - Checking file sizes as well as modification times when deciding + to skip installing a file. + - OS/2 was using $(RM) instead of $(RM_F) (Ilya) + - OS/2 needs .dll removed on failed build (Ilya) + - fixin() was assuming that rename() can overwrite the target (Ilya) + - manifypods target was empty if there are no pods to manify. Put in + at least $(NOECHO) $(NOOP) + - Cygwin test to check for finding pod2man when building the perl core + removed. No longer relevent. + - Small fixes for dmake (Mattia Barbon) + * Added "Reporting bugs" section to the PATCHING doc. + - Minor bug in compile test missed ExtUtils::Liblist::Kid + - Removing $(VERSION_FROM) from Makefile dependency. It was too + annoying to rebuild the Makefile every time the module changed. + Mentioned it in the FAQ instead. + - Fixing PERL_ARCHIVE macro on VMS. Apparently it never appeared + properly before. (Craig Berry) + - Fixing ECHO on dmake. + - Adding os_flavor() and os_flavor_is() + - Making basic.t error output combine STDOUT & STDERR for easier + reading. + * ExtUtils::Manifest will now work case insensitively. + - Fixed 'subroutine redefined' warnings in 00compile.t + - Fixed it so typemaps are only looked for in the perl core library. + * Hacking around VMS filesystem problems reconstructing package names + from filenames in ExtUtils::Installed. (Jesper Naur) + +# There was no 6.06, I jumped straight to 6.10_XX because there's been +# so much change between 6.05 and now. + +6.06_05 Mon Mar 31 02:44:11 PST 2003 - Syncing into bleadperl. Minor nits revealed... - AutoSplit open filehandle bug was fixed in bleadperl. Averted a warning because of this. diff --git a/lib/ExtUtils/Install.pm b/lib/ExtUtils/Install.pm index 68fe343..1037973 100644 --- a/lib/ExtUtils/Install.pm +++ b/lib/ExtUtils/Install.pm @@ -108,20 +108,11 @@ sub install { for (readdir DIR) { next if $_ eq $Curdir || $_ eq $Updir || $_ eq ".exists"; my $targetdir = install_rooted_dir($from_to{$source_dir_or_file}); - if ($nonono) { - if (!-w $targetdir) { - print "mkpath($targetdir)\n" if $verbose>1; - } - last; - } else { - if (-w $targetdir || - mkpath($targetdir)) { - last; - } else { - warn "Warning: You do not have permissions to " . - "install into $from_to{$source_dir_or_file}" - unless $warn_permissions++; - } + mkpath($targetdir) unless $nonono; + if (!$nonono && !-w $targetdir) { + warn "Warning: You do not have permissions to " . + "install into $from_to{$source_dir_or_file}" + unless $warn_permissions++; } } closedir DIR; diff --git a/lib/ExtUtils/Liblist/Kid.pm b/lib/ExtUtils/Liblist/Kid.pm index 9030eda..5d05680 100644 --- a/lib/ExtUtils/Liblist/Kid.pm +++ b/lib/ExtUtils/Liblist/Kid.pm @@ -148,9 +148,6 @@ sub _unix_os2_ext { next; } warn "'-l$thislib' found at $fullname\n" if $verbose; - my($fullnamedir) = dirname($fullname); - push @ld_run_path, $fullnamedir - unless $ld_run_path_seen{$fullnamedir}++; push @libs, $fullname unless $libs_seen{$fullname}++; $found++; $found_lib++; @@ -161,6 +158,13 @@ sub _unix_os2_ext { my $is_dyna = ($fullname !~ /\Q$Config_libext\E\z/); my $in_perl = ($libs =~ /\B-l\Q${thislib}\E\b/s); + # include the path to the lib once in the dynamic linker path + # but only if it is a dynamic lib and not in Perl itself + my($fullnamedir) = dirname($fullname); + push @ld_run_path, $fullnamedir + if $is_dyna && !$in_perl && + !$ld_run_path_seen{$fullnamedir}++; + # Do not add it into the list if it is already linked in # with the main perl executable. # We have to special-case the NeXT, because math and ndbm diff --git a/lib/ExtUtils/META.yml b/lib/ExtUtils/META.yml new file mode 100644 index 0000000..b05b7bb --- /dev/null +++ b/lib/ExtUtils/META.yml @@ -0,0 +1,13 @@ +#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# +name: ExtUtils-MakeMaker +version: 6.10_04 +version_from: lib/ExtUtils/MakeMaker.pm +installdirs: perl +requires: + File::Basename: 0 + File::Spec: 0.8 + DirHandle: 0 + Pod::Man: 0 + +distribution_type: module +generated_by: ExtUtils::MakeMaker version 6.10_04 diff --git a/lib/ExtUtils/MM_Any.pm b/lib/ExtUtils/MM_Any.pm index 4bdcf67..0200b29 100644 --- a/lib/ExtUtils/MM_Any.pm +++ b/lib/ExtUtils/MM_Any.pm @@ -605,7 +605,7 @@ metafile_addtomanifest: MAKE_FRAG my $add_meta = $self->oneliner(<<'CODE', ['-MExtUtils::Manifest=maniadd']); -maniadd({q{META.yml} => q{Module meta-data in YAML}}); +maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}); CODE return sprintf <<'MAKE_FRAG', $add_meta; diff --git a/lib/ExtUtils/MM_MacOS.pm b/lib/ExtUtils/MM_MacOS.pm index c811c09..5657d3b 100644 --- a/lib/ExtUtils/MM_MacOS.pm +++ b/lib/ExtUtils/MM_MacOS.pm @@ -278,7 +278,7 @@ Translate Unix filepaths and shell globs to Mac style. sub patternify { my($unix) = @_; my(@mac); - use bytes; # Non-UTF-8 high bytes below. + use ExtUtils::MakeMaker::bytes; # Non-UTF-8 high bytes below. foreach (split(/[ \t\n]+/, $unix)) { if (m|/|) { diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm index fc7febc..b6459b5 100644 --- a/lib/ExtUtils/MM_Unix.pm +++ b/lib/ExtUtils/MM_Unix.pm @@ -12,7 +12,7 @@ use DirHandle; use vars qw($VERSION @ISA $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Win95 $Is_Dos $Is_VOS - $Is_QNX $Is_AIX $Is_OSF $Is_IRIX $Is_NetBSD + $Is_QNX $Is_AIX $Is_OSF $Is_IRIX $Is_NetBSD $Is_BSD $Is_SunOS4 $Is_Solaris $Is_SunOS $Verbose %pm %static $Xsubpp_Version %Config_Override @@ -40,6 +40,7 @@ $Is_NetBSD = $^O eq 'netbsd'; $Is_SunOS4 = $^O eq 'sunos'; $Is_Solaris = $^O eq 'solaris'; $Is_SunOS = $Is_SunOS4 || $Is_Solaris; +$Is_BSD = $^O =~ /^(?:free|net|open)bsd|bsdos$/; =head1 NAME @@ -304,6 +305,9 @@ clean :: clean_subdirs } else { push(@otherfiles, qw[core core.*perl.*.? *perl.core]); + + # core.\d+ + push(@otherfiles, map { "core." . "[0-9]"x$_ } (1..5)); } push @m, "\t-\$(RM_RF) @otherfiles\n"; @@ -792,7 +796,7 @@ print 'Warning: Makefile possibly out of date with $(VERSION_FROM)' CODE return sprintf <<'MAKE_FRAG', $date_check; -dist : $(DIST_DEFAULT) +dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE) $(NOECHO) %s MAKE_FRAG } @@ -1170,12 +1174,12 @@ in these dirs: my $stderr_duped = 0; local *STDERR_COPY; - unless ($^O =~ /^(?:free|net|open)bsd|bsdos$/) { # Search for '51535'. - if( open(STDERR_COPY, '>&STDERR') ) { - $stderr_duped = 1; - } - else { - warn <&STDERR') ) { + $stderr_duped = 1; + } + else { + warn <= 2); my $version_check = qq{$abs -e "require $ver; print qq{VER_OK\n}"}; - # To avoid using the unportable 2>&1 to suppress STDERR, + # To avoid using the unportable 2>&1 to supress STDERR, # we close it before running the command. # However, thanks to a thread library bug in many BSDs # ( http://www.freebsd.org/cgi/query-pr.cgi?pr=51535 ) # we cannot use the fancier more portable way in here # but instead need to use the traditional 2>&1 construct. - if ($^O =~ /^(?:free|net|open)bsd|bsdos$/) { - $val = `$version_check 2>&1`; + if ($Is_BSD) { + $val = `$version_check 2>&1`; } else { close STDERR if $stderr_duped; $val = `$version_check`; open STDERR, '>&STDERR_COPY' if $stderr_duped; } - print STDERR "Perl version check failed: '$version_check'\n" - unless defined $val; if ($val =~ /^VER_OK/) { print "Using PERL=$abs\n" if $trace; @@ -1999,15 +2001,14 @@ sub init_INST { } my @parentdir = split(/::/, $self->{PARENT_NAME}); - $self->{INST_LIBDIR} = $self->catdir($self->{INST_LIB},@parentdir); - $self->{INST_ARCHLIBDIR} = $self->catdir($self->{INST_ARCHLIB}, - @parentdir); - $self->{INST_AUTODIR} = $self->catdir($self->{INST_LIB},'auto', - $self->{FULLEXT}); - $self->{INST_ARCHAUTODIR} = $self->catdir($self->{INST_ARCHLIB}, - 'auto',$self->{FULLEXT}); + $self->{INST_LIBDIR} = $self->catdir('$(INST_LIB)', @parentdir); + $self->{INST_ARCHLIBDIR} = $self->catdir('$(INST_ARCHLIB)', @parentdir); + $self->{INST_AUTODIR} = $self->catdir('$(INST_LIB)', 'auto', + '$(FULLEXT)'); + $self->{INST_ARCHAUTODIR} = $self->catdir('$(INST_ARCHLIB)', 'auto', + '$(FULLEXT)'); - $self->{INST_SCRIPT} ||= $self->catdir($Curdir,'blib','script'); + $self->{INST_SCRIPT} ||= $self->catdir($Curdir,'blib','script'); $self->{INST_MAN1DIR} ||= $self->catdir($Curdir,'blib','man1'); $self->{INST_MAN3DIR} ||= $self->catdir($Curdir,'blib','man3'); @@ -2703,7 +2704,7 @@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) $(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) $(NOECHO) $(PERLRUNINST) \ Makefile.PL DIR=}, $dir, q{ \ - FIRST_MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \ + MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \ MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=}; foreach (@ARGV){ @@ -3054,8 +3055,7 @@ sub parse_version { $inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod; next if $inpod || /^\s*#/; chop; - # next unless /\$(([\w\:\']*)\bVERSION)\b.*\=/; - next unless /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/; + next unless /(?{OBJECT}; diff --git a/lib/ExtUtils/MM_VMS.pm b/lib/ExtUtils/MM_VMS.pm index 469f21d..7b2b216 100644 --- a/lib/ExtUtils/MM_VMS.pm +++ b/lib/ExtUtils/MM_VMS.pm @@ -21,7 +21,7 @@ BEGIN { use File::Basename; use vars qw($Revision @ISA $VERSION); ($VERSION) = '5.67'; -($Revision = substr(q$Revision: 1.91 $, 10)) =~ s/\s+$//; +($Revision) = q$Revision: 1.95 $ =~ /Revision:\s+(\S+)/; require ExtUtils::MM_Any; require ExtUtils::MM_Unix; @@ -1196,6 +1196,9 @@ sub installbin { push @m, " EXE_FILES = @exefiles +pure_all :: @to + \$(NOECHO) \$(NOOP) + realclean :: "; @@ -1212,8 +1215,12 @@ realclean :: while (($from,$to) = each %fromto) { last unless defined $from; my $todir; - if ($to =~ m#[/>:\]]#) { $todir = dirname($to); } - else { ($todir = $to) =~ s/[^\)]+$//; } + if ($to =~ m#[/>:\]]#) { + $todir = dirname($to); + } + else { + ($todir = $to) =~ s/[^\)]+$//; + } $todir = $self->fixpath($todir,1); push @m, " $to : $from \$(FIRST_MAKEFILE) ${todir}\$(DIRFILESEP).exists @@ -1628,18 +1635,18 @@ sub perldepend { $(OBJECT) : $(PERL_INC)EXTERN.h, $(PERL_INC)INTERN.h, $(PERL_INC)XSUB.h $(OBJECT) : $(PERL_INC)av.h, $(PERL_INC)cc_runtime.h, $(PERL_INC)config.h $(OBJECT) : $(PERL_INC)cop.h, $(PERL_INC)cv.h, $(PERL_INC)embed.h -$(OBJECT) : $(PERL_INC)embedvar.h, $(PERL_INC)fakethr.h, $(PERL_INC)form.h +$(OBJECT) : $(PERL_INC)embedvar.h, $(PERL_INC)form.h $(OBJECT) : $(PERL_INC)gv.h, $(PERL_INC)handy.h, $(PERL_INC)hv.h $(OBJECT) : $(PERL_INC)intrpvar.h, $(PERL_INC)iperlsys.h, $(PERL_INC)keywords.h $(OBJECT) : $(PERL_INC)mg.h, $(PERL_INC)nostdio.h, $(PERL_INC)op.h -$(OBJECT) : $(PERL_INC)opcode.h, $(PERL_INC)opnames.h, $(PERL_INC)patchlevel.h -$(OBJECT) : $(PERL_INC)perl.h, $(PERL_INC)perlapi.h, $(PERL_INC)perlio.h -$(OBJECT) : $(PERL_INC)perlsdio.h, $(PERL_INC)perlsfio.h, $(PERL_INC)perlvars.h +$(OBJECT) : $(PERL_INC)opcode.h, $(PERL_INC)patchlevel.h +$(OBJECT) : $(PERL_INC)perl.h, $(PERL_INC)perlio.h +$(OBJECT) : $(PERL_INC)perlsdio.h, $(PERL_INC)perlvars.h $(OBJECT) : $(PERL_INC)perly.h, $(PERL_INC)pp.h, $(PERL_INC)pp_proto.h $(OBJECT) : $(PERL_INC)proto.h, $(PERL_INC)regcomp.h, $(PERL_INC)regexp.h $(OBJECT) : $(PERL_INC)regnodes.h, $(PERL_INC)scope.h, $(PERL_INC)sv.h -$(OBJECT) : $(PERL_INC)thrdvar.h, $(PERL_INC)thread.h, $(PERL_INC)utf8.h -$(OBJECT) : $(PERL_INC)util.h, $(PERL_INC)vmsish.h, $(PERL_INC)warnings.h +$(OBJECT) : $(PERL_INC)thrdvar.h, $(PERL_INC)thread.h +$(OBJECT) : $(PERL_INC)util.h, $(PERL_INC)vmsish.h ' if $self->{OBJECT}; diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index 12aade8..9922f16 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -2,8 +2,8 @@ package ExtUtils::MakeMaker; BEGIN {require 5.005_03;} -$VERSION = '6.10_03'; -($Revision = substr(q$Revision: 1.109 $, 10)) =~ s/\s+$//; +$VERSION = '6.10_04'; +($Revision) = q$Revision: 1.111 $ =~ /Revision:\s+(\S+)/; require Exporter; use Config; @@ -219,8 +219,8 @@ sub full_setup { SITELIBEXP SITEARCHEXP INC INCLUDE_EXT LDFROM LIB LIBPERL_A LIBS - LINKTYPE MAKEAPERL MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET MYEXTLIB - NAME NEEDS_LINKING NOECHO NO_META NORECURS NO_VC OBJECT OPTIMIZE + LINKTYPE MAKEAPERL MAKEFILE MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET + MYEXTLIB NAME NEEDS_LINKING NOECHO NO_META NORECURS NO_VC OBJECT OPTIMIZE PERL_MALLOC_OK PERL PERLMAINCC PERLRUN PERLRUNINST PERL_CORE PERL_SRC PERM_RW PERM_RWX PL_FILES PM PM_FILTER PMLIBDIRS POLLUTE PPM_INSTALL_EXEC @@ -1419,6 +1419,11 @@ Ref to array of executable files. The files will be copied to the INST_SCRIPT directory. Make realclean will delete them from there again. +If your executables start with something like #!perl or +#!/usr/bin/perl MakeMaker will change this to the path of the perl +'Makefile.PL' was invoked with so the programs will be sure to run +properly even if perl is not in /usr/bin/perl. + =item FIRST_MAKEFILE The name of the Makefile to be produced. This is used for the second @@ -2017,7 +2022,7 @@ MakeMaker object. The following lines will be parsed o.k.: $VERSION = '1.00'; *VERSION = \'1.01'; - ( $VERSION ) = '$Revision: 1.109 $ ' =~ /\$Revision:\s+([^\s]+)/; + $VERSION = sprintf "%d.%03d", q$Revision: 1.111 $ =~ /(\d+)/g; $FOO::VERSION = '1.10'; *FOO::VERSION = \'1.11'; our $VERSION = 1.2.3; # new for perl5.6.0 diff --git a/lib/ExtUtils/MakeMaker/FAQ.pod b/lib/ExtUtils/MakeMaker/FAQ.pod index 3e0489d..38c50ce 100644 --- a/lib/ExtUtils/MakeMaker/FAQ.pod +++ b/lib/ExtUtils/MakeMaker/FAQ.pod @@ -1,6 +1,6 @@ package ExtUtils::MakeMaker::FAQ; -our $VERSION = '0.02'; +(our $VERSION) = sprintf "%03d", q$Revision: 1.6 $ =~ /Revision:\s+(\S+)/; 1; __END__ @@ -57,6 +57,47 @@ MakeMaker. =back +=head2 Module Writing + +=over 4 + +=item How do I keep my $VERSION up to date without resetting it manually? + +Often you want to manually set the $VERSION in the main module +distribution because this is the version that everybody sees on CPAN +and maybe you want to customize it a bit. But for all the other +modules in your dist, $VERSION is really just bookkeeping and all that's +important is it goes up every time the module is changed. Doing this +by hand is a pain and you often forget. + +Simplest way to do it automatically is to use your version control +system's revision number (you are using version control, right?). + +In CVS and RCS you use $Revision: 1.6 $ writing it like so: + + $VERSION = sprintf "%d.%03d", q$Revision: 1.6 $ =~ /(\d+)/g; + +On your next check in, $Revision: 1.6 $ will magically be expanded to contain +the current revision #. + + $VERSION = sprintf "%d.%03d", q$Revision: 1.6 $ =~ /(\d+)/g; + +Every time the file is checked in the $Revision: 1.6 $ will be updated, +updating your $VERSION. + +In CVS version 1.9 is followed by 1.10. Since CPAN compares version +numbers numerically we use a sprintf() to convert 1.9 to 1.009 and +1.10 to 1.010 which compare properly. + +If branches are involved (ie. $Revision: 1.5.3.4) its a little more +complicated. + + # must be all on one line or MakeMaker will get confused. + $VERSION = do { my @r = (q$Revision: 1.6 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; + + +=back + =head2 XS =over 4 diff --git a/lib/ExtUtils/MakeMaker/Tutorial.pod b/lib/ExtUtils/MakeMaker/Tutorial.pod index bbc794a..b25e1bb 100644 --- a/lib/ExtUtils/MakeMaker/Tutorial.pod +++ b/lib/ExtUtils/MakeMaker/Tutorial.pod @@ -20,6 +20,8 @@ ExtUtils::MakeMaker::Tutorial - Writing a module with MakeMaker =head1 DESCRIPTION This is a short tutorial on writing a simple module with MakeMaker. +Its really not that hard. + =head2 The Mantra @@ -32,16 +34,17 @@ MakeMaker modules are installed using this simple mantra There are lots more commands and options, but the above will do it. + =head2 The Layout -The basic layout of a module looks something like this. +The basic files in a module look something like this. Makefile.PL MANIFEST lib/Your/Module.pm That's all that's strictly necessary. There's additional files you might -want to add: +want: lib/Your/Other/Module.pm t/some_test.t @@ -83,11 +86,17 @@ A simple listing of all the files in your distribution. MANIFEST lib/Your/Module.pm +Filepaths in a MANIFEST always use Unix conventions (ie. /) even if you're +not on Unix. + +You can write this by hand or generate it with 'make manifest'. + =item lib/ -This is the directory where your .pm files go. They are layed out -according to namespace. So Foo::Bar is lib/Foo/Bar.pm. +This is the directory where your .pm and .pod files you wish to have +installed go. They are layed out according to namespace. So Foo::Bar +is lib/Foo/Bar.pm. =item t/ @@ -96,26 +105,72 @@ Tests for your modules go here. Each test filename ends with a .t. So t/foo.t. 'make test' will run these tests. The directory is flat, you cannot, for example, have t/foo/bar.t run by 'make test'. +Tests are run from the top level of your distribution. So inside a test +you would refer to ./lib to enter the lib directory, for example. + =item Changes -A log of changes you've made to this module. +A log of changes you've made to this module. The layout is free-form. +Here's an example: + + 1.01 Fri Apr 11 00:21:25 PDT 2003 + - thing() does some stuff now + - fixed the wiggy bug in withit() + + 1.00 Mon Apr 7 00:57:15 PDT 2003 + - "Rain of Frogs" now supported =item README +A short description of your module, what it does, why someone would use it +and its limitations. CPAN automatically pulls your README file out of +the archive and makes it available to CPAN users, it is the first thing +they will read to decide if your module is right for them. + + =item INSTALL +Instructions on how to install your module along with any dependencies. +Suggested information to include here: + + any extra modules required for use + the minimum version of Perl required + if only works on certain operating systems + + =item MANIFEST.SKIP +A file full of regular expressions to exclude when using 'make +manifest' to generate the MANIFEST. These regular expressions +are checked against each filepath found in the distrubtion (so +you're matching against "t/foo.t" not "foo.t"). + +Here's a sample: + + ~$ # ignore emacs and vim backup files + .bak$ # ignore manual backups + \# # ignore CVS old revision files and emacs temp files + +Since # can be used for comments, # must be escaped. + +MakeMaker comes with a default MANIFEST.SKIP to avoid things like +version control directories and backup files. Specifying your own +will override this default. + + =item bin/ + =back =head1 SEE ALSO L gives stylistic help writing a module. +L gives more information about how to write a module. + There are modules to help you through the process of writing a module: L, L, L diff --git a/lib/ExtUtils/MakeMaker/bytes.pm b/lib/ExtUtils/MakeMaker/bytes.pm new file mode 100644 index 0000000..7b7e854 --- /dev/null +++ b/lib/ExtUtils/MakeMaker/bytes.pm @@ -0,0 +1,39 @@ +package ExtUtils::MakeMaker::bytes; + +use vars qw($VERSION); +$VERSION = 0.01; + +my $Have_Bytes = eval q{require bytes; 1;}; + +sub import { + return unless $Have_Bytes; + + shift; + unshift @_, 'bytes'; + + goto &bytes::import; +} + +1; + + +=head1 NAME + +ExtUtils::MakeMaker::bytes - Version agnostic bytes.pm + +=head1 SYNOPSIS + + use just like bytes.pm + +=head1 DESCRIPTION + +bytes.pm was introduced with 5.6. This means any code which has 'use +bytes' in it won't even compile on 5.5.X. Since bytes is a lexical +pragma and must be used at compile time we can't simply wrap it in +a BEGIN { eval 'use bytes' } block. + +ExtUtils::MakeMaker::bytes is just a very thin wrapper around bytes +which works just like it when bytes.pm exists and everywhere else it +does nothing. + +=cut diff --git a/lib/ExtUtils/Manifest.pm b/lib/ExtUtils/Manifest.pm index 6f8ce12..d3d04b6 100644 --- a/lib/ExtUtils/Manifest.pm +++ b/lib/ExtUtils/Manifest.pm @@ -309,32 +309,33 @@ sub maniread { my $read = {}; local *M; unless (open M, $mfile){ - warn "$mfile: $!"; - return $read; + warn "$mfile: $!"; + return $read; } + local $_; while (){ - chomp; - next if /^#/; + chomp; + next if /^#/; my($file, $comment) = /^(\S+)\s*(.*)/; next unless $file; - if ($Is_MacOS) { - $file = _macify($file); - $file =~ s/\\([0-3][0-7][0-7])/sprintf("%c", oct($1))/ge; - } - elsif ($Is_VMS) { - require File::Basename; - my($base,$dir) = File::Basename::fileparse($file); - # Resolve illegal file specifications in the same way as tar - $dir =~ tr/./_/; - my(@pieces) = split(/\./,$base); - if (@pieces > 2) { $base = shift(@pieces) . '.' . join('_',@pieces); } - my $okfile = "$dir$base"; - warn "Debug: Illegal name $file changed to $okfile\n" if $Debug; + if ($Is_MacOS) { + $file = _macify($file); + $file =~ s/\\([0-3][0-7][0-7])/sprintf("%c", oct($1))/ge; + } + elsif ($Is_VMS) { + require File::Basename; + my($base,$dir) = File::Basename::fileparse($file); + # Resolve illegal file specifications in the same way as tar + $dir =~ tr/./_/; + my(@pieces) = split(/\./,$base); + if (@pieces > 2) { $base = shift(@pieces) . '.' . join('_',@pieces); } + my $okfile = "$dir$base"; + warn "Debug: Illegal name $file changed to $okfile\n" if $Debug; $file = $okfile; $file = lc($file) unless $file =~ /^MANIFEST(\.SKIP)?$/; - } + } $read->{$file} = $comment; } @@ -346,7 +347,7 @@ sub maniread { sub _maniskip { my @skip ; my $mfile = "$MANIFEST.SKIP"; - local *M; + local(*M,$_); open M, $mfile or open M, $DEFAULT_MSKIP or return sub {0}; while (){ chomp; @@ -417,6 +418,7 @@ sub cp_if_diff { local(*F,*T); open(F,"< $from\0") or die "Can't read $from: $!\n"; if (open(T,"< $to\0")) { + local $_; while () { $diff++,last if $_ ne ; } $diff++ unless eof(T); close T; @@ -534,6 +536,7 @@ sub maniadd { my($additions) = shift; _normalize($additions); + _fix_manifest($MANIFEST); my $manifest = maniread(); open(MANIFEST, ">>$MANIFEST") or die "Could not open $MANIFEST: $!"; @@ -545,6 +548,26 @@ sub maniadd { close MANIFEST; } + +# Sometimes MANIFESTs are missing a trailing newline. Fix this. +sub _fix_manifest { + my $manifest_file = shift; + + open MANIFEST, $MANIFEST or die "Could not open $MANIFEST: $!"; + + # Yes, we should be using seek(), but I'd like to avoid loading POSIX + # to get SEEK_* + my @manifest = ; + close MANIFEST; + + unless( $manifest[-1] =~ /\n\z/ ) { + open MANIFEST, ">>$MANIFEST" or die "Could not open $MANIFEST: $!"; + print MANIFEST "\n"; + close MANIFEST; + } +} + + # UNIMPLEMENTED sub _normalize { return; diff --git a/lib/ExtUtils/TODO b/lib/ExtUtils/TODO index d652d6a..505e461 100644 --- a/lib/ExtUtils/TODO +++ b/lib/ExtUtils/TODO @@ -56,3 +56,23 @@ Merge MM_VMS->tool_xsubpp Initialize PERL_SRC to '' instead of leaving undef when outside the source tree + +Reinstate HTMLification to use the new HTML Config info. + +split manifypods target into more generic docifypods target which depends on +manifypods + +Add target to generate native Win32 help files (or whatever Win32 likes +to use for help files these days) + +Add target to generate native VMS help files. + +Add "What's this META.yml thing?" to the FAQ. + +On VMS, write PM_FILTERs to a temp file and run from there avoiding command +line lengths. + +Move oneliner() and friends into a seperate module for general consumption. + +Make out of date check on 'make dist' more useful +http://archive.develooper.com/makemaker@perl.org/msg01075.html diff --git a/lib/ExtUtils/t/Install.t b/lib/ExtUtils/t/Install.t index c628333..0abab68 100644 --- a/lib/ExtUtils/t/Install.t +++ b/lib/ExtUtils/t/Install.t @@ -51,9 +51,10 @@ install( { 'blib/lib' => 'install-test/lib/perl', write => 'install-test/packlist' }, 0, 1); -ok( ! -d 'install-test/lib/perl', 'install made dir - dry run' ); -ok( ! -r 'install-test/lib/perl/Big/Dummy.pm', ' .pm file installed - dry run' ); -ok( ! -r 'install-test/packlist', ' packlist exists - dry run' ); +ok( ! -d 'install-test/lib/perl', 'install made dir (dry run)'); +ok( ! -r 'install-test/lib/perl/Big/Dummy.pm', + ' .pm file installed (dry run)'); +ok( ! -r 'install-test/packlist', ' packlist exists (dry run)'); install( { 'blib/lib' => 'install-test/lib/perl', read => 'install-test/packlist', diff --git a/lib/ExtUtils/t/Manifest.t b/lib/ExtUtils/t/Manifest.t index 4d76b94..0bea89b 100644 --- a/lib/ExtUtils/t/Manifest.t +++ b/lib/ExtUtils/t/Manifest.t @@ -14,7 +14,7 @@ chdir 't'; use strict; # these files help the test run -use Test::More tests => 37; +use Test::More tests => 39; use Cwd; # these files are needed for the module itself @@ -26,14 +26,14 @@ use File::Path; @INC = map { File::Spec->rel2abs($_) } @INC; # keep track of everything added so it can all be deleted -my %files; +my %Files; sub add_file { my ($file, $data) = @_; $data ||= 'foo'; - unlink $file; # or else we'll get multiple versions on VMS + 1 while unlink $file; # or else we'll get multiple versions on VMS open( T, '>'.$file) or return; print T $data; - ++$files{$file}; + ++$Files{$file}; close T; } @@ -127,10 +127,12 @@ ok( exists( ExtUtils::Manifest::manifind()->{'moretest/quux'} ), "manifind found moretest/quux" ); # only MANIFEST and foo are in the manifest +$_ = 'foo'; my $files = maniread(); is( keys %$files, 2, 'two files found' ); is( join(' ', sort { lc($a) cmp lc($b) } keys %$files), 'foo MANIFEST', 'both files found' ); +is( $_, 'foo', q{maniread() doesn't clobber $_} ); # poison the manifest, and add a comment that should be reported add_file( 'MANIFEST', 'none #none' ); @@ -158,7 +160,7 @@ like($warn, qr/^Skipping MANIFEST.SKIP/i, 'warned about MANIFEST.SKIP' ); like( $warn, qr/Added to albatross: /, 'using a new manifest file' ); # add the new file to the list of files to be deleted - $files{'albatross'}++; + $Files{'albatross'}++; } @@ -188,10 +190,19 @@ is( $files->{wibble}, '', 'maniadd() with undef comment' ); is( $files->{yarrow}, 'hock',' with comment' ); is( $files->{foobar}, '', ' preserved old entries' ); +add_file('MANIFEST' => 'Makefile.PL'); +maniadd({ 'META.yml' => 'Module meta-data (added by MakeMaker)' }); +$files = maniread; +# VMS downcases the MANIFEST. We normalize it here to match. +%$files = map { (lc $_ => $files->{$_}) } keys %$files; +my %expect = ( 'makefile.pl' => '', + 'meta.yml' => 'Module meta-data (added by MakeMaker)' + ); +is_deeply( $files, \%expect, 'maniadd() vs MANIFEST without trailing newline'); END { # the args are evaluated in scalar context - is( unlink( keys %files ), keys %files, 'remove all added files' ); + is( unlink( keys %Files ), keys %Files, 'remove all added files' ); remove_dir( 'moretest', 'copy' ); # now get rid of the parent directory diff --git a/lib/ExtUtils/t/basic.t b/lib/ExtUtils/t/basic.t index 9008390..5e16c7e 100644 --- a/lib/ExtUtils/t/basic.t +++ b/lib/ExtUtils/t/basic.t @@ -159,7 +159,7 @@ my $manifest = maniread(); # VMS is non-case preserving, so we can't know what the MANIFEST will # look like. :( _normalize($manifest); -is( $manifest->{'meta.yml'}, 'Module meta-data in YAML' ); +is( $manifest->{'meta.yml'}, 'Module meta-data (added by MakeMaker)' ); # Test NO_META META.yml suppression unlink 'META.yml'; diff --git a/lib/ExtUtils/t/bytes.t b/lib/ExtUtils/t/bytes.t new file mode 100644 index 0000000..e566831 --- /dev/null +++ b/lib/ExtUtils/t/bytes.t @@ -0,0 +1,30 @@ +#!/usr/bin/perl -w + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; + } +} + +use strict; +use Test::More tests => 4; + +use_ok('ExtUtils::MakeMaker::bytes'); + +SKIP: { + skip "bytes.pm appeared in 5.6", 3 if $] < 5.006; + + my $chr = chr(400); + is( length $chr, 1 ); + + { + use ExtUtils::MakeMaker::bytes; + is( length $chr, 2, 'byte.pm in effect' ); + } + + is( length $chr, 1, ' score is lexical' ); +} diff --git a/lib/ExtUtils/t/vmsish.t b/lib/ExtUtils/t/vmsish.t new file mode 100644 index 0000000..6195a0d --- /dev/null +++ b/lib/ExtUtils/t/vmsish.t @@ -0,0 +1,17 @@ +#!/usr/bin/perl -w + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't' if -d 't'; + @INC = ('../lib', 'lib'); + } + else { + unshift @INC, 't/lib'; + } +} + +use strict; +use Test::More tests => 1; + +use_ok('ExtUtils::MakeMaker::vmsish'); +