diff options
author | 2013-03-25 20:06:16 +0000 | |
---|---|---|
committer | 2013-03-25 20:06:16 +0000 | |
commit | 898184e3e61f9129feb5978fad5a8c6865f00b92 (patch) | |
tree | 56f32aefc1eed60b534611007c7856f82697a205 /gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker | |
parent | PGSHIFT -> PAGE_SHIFT (diff) | |
download | wireguard-openbsd-898184e3e61f9129feb5978fad5a8c6865f00b92.tar.xz wireguard-openbsd-898184e3e61f9129feb5978fad5a8c6865f00b92.zip |
import perl 5.16.3 from CPAN - worked on by Andrew Fresh and myself
Diffstat (limited to 'gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker')
52 files changed, 2144 insertions, 767 deletions
diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/MANIFEST b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/MANIFEST index b242cc55f60..fe47e55b181 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/MANIFEST +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/MANIFEST @@ -1,12 +1,36 @@ -.gitignore bin/instmodsh +bundled/CPAN-Meta-YAML/CPAN/Meta/YAML.pm +bundled/CPAN-Meta/CPAN/Meta.pm +bundled/CPAN-Meta/CPAN/Meta/Converter.pm +bundled/CPAN-Meta/CPAN/Meta/Feature.pm +bundled/CPAN-Meta/CPAN/Meta/History.pm +bundled/CPAN-Meta/CPAN/Meta/Prereqs.pm +bundled/CPAN-Meta/CPAN/Meta/Spec.pm +bundled/CPAN-Meta/CPAN/Meta/Validator.pm +bundled/ExtUtils-Command/ExtUtils/Command.pm +bundled/ExtUtils-Install/ExtUtils/Install.pm +bundled/ExtUtils-Install/ExtUtils/Installed.pm +bundled/ExtUtils-Install/ExtUtils/Packlist.pm +bundled/ExtUtils-Manifest/ExtUtils/Manifest.pm +bundled/ExtUtils-Manifest/ExtUtils/MANIFEST.SKIP +bundled/File-Copy-Recursive/File/Copy/Recursive.pm +bundled/File-Temp/File/Temp.pm +bundled/JSON-PP-Compat5006/JSON/PP/Compat5006.pm +bundled/JSON-PP/JSON/PP.pm +bundled/JSON-PP/JSON/PP/Boolean.pm +bundled/Parse-CPAN-Meta/Parse/CPAN/Meta.pm +bundled/README +bundled/Scalar-List-Utils/List/Util.pm +bundled/Scalar-List-Utils/List/Util/PP.pm +bundled/Scalar-List-Utils/Scalar/Util.pm +bundled/Scalar-List-Utils/Scalar/Util/PP.pm +bundled/Version-Requirements/Version/Requirements.pm +bundled/version/version.pm +bundled/version/version.pod +bundled/version/version/Internals.pod +bundled/version/version/vpp.pm Changes -inc/ExtUtils/Command.pm -inc/ExtUtils/Install.pm -inc/ExtUtils/Installed.pm -inc/ExtUtils/Manifest.pm -inc/ExtUtils/MANIFEST.SKIP -inc/ExtUtils/Packlist.pm +INSTALL lib/ExtUtils/Command/MM.pm lib/ExtUtils/Liblist.pm lib/ExtUtils/Liblist/Kid.pm @@ -38,9 +62,11 @@ lib/ExtUtils/testlib.pm Makefile.PL MANIFEST This list of files MANIFEST.SKIP +my/bundles.pm NOTES PATCHING README +README.packaging t/00compile.t t/arch_check.t t/backwards.t @@ -49,6 +75,7 @@ t/build_man.t t/cd.t t/config.t t/dir_target.t +t/echo.t t/FIRST_MAKEFILE.t t/fix_libs.t t/fixin.t @@ -64,6 +91,7 @@ t/lib/MakeMaker/Test/Setup/MPV.pm t/lib/MakeMaker/Test/Setup/PL_FILES.pm t/lib/MakeMaker/Test/Setup/Problem.pm t/lib/MakeMaker/Test/Setup/Recurs.pm +t/lib/MakeMaker/Test/Setup/SAS.pm t/lib/MakeMaker/Test/Setup/XS.pm t/lib/MakeMaker/Test/Utils.pm t/lib/Test/Builder.pm @@ -74,9 +102,30 @@ t/lib/Test/Simple.pm t/lib/TieIn.pm t/lib/TieOut.pm t/Liblist.t +t/liblist/win32/__test.lib +'t/liblist/win32/di r/dir_test.lib' +t/liblist/win32/dir/dir_test.lib +t/liblist/win32/double.lib +t/liblist/win32/lib/CORE/c_test.lib +t/liblist/win32/lib/CORE/double.lib +t/liblist/win32/lib__test.lib +t/liblist/win32/lib_test.lib +t/liblist/win32/libpath/lp_test.lib +t/liblist/win32/pl.lib +'t/liblist/win32/space lib.lib' +t/liblist/win32/test.a.lib +t/liblist/win32/test.lib +t/liblist/win32/test.meep +t/liblist/win32/test2.lib +t/liblist/win32/vc/vctest.lib +t/Liblist_Kid.t t/make.t t/MakeMaker_Parameters.t t/maketext_filter.t +t/meta_convert.t +t/META_for_testing.json +t/META_for_testing.yml +t/META_for_testing_tricky_version.yml t/metafile_data.t t/metafile_file.t t/min_perl_version.t @@ -91,6 +140,7 @@ t/MM_Unix.t t/MM_VMS.t t/MM_Win32.t t/oneliner.t +t/parse_abstract.t t/parse_version.t t/PL_FILES.t t/pm.t @@ -104,6 +154,7 @@ t/problems.t t/prompt.t t/recurs.t t/revision.t +t/several_authors.t t/split_command.t t/test_boilerplate.t t/testdata/reallylongdirectoryname/arch1/Config.pm @@ -114,4 +165,6 @@ t/WriteEmptyMakefile.t t/writemakefile_args.t t/xs.t TODO -META.yml Module meta-data (added by MakeMaker) +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) +SIGNATURE Public-key signature (added by MakeMaker) diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/README b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/README index 9586c0ba173..8629a53cbed 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/README +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/README @@ -1,57 +1,11 @@ This is a CPAN distribution of the venerable MakeMaker module. It has been -backported to work with Perl 5.005_03 and up. +backported to work with Perl 5.6.0 and up. -If you do not have a make program, several can be found... - -Most Unixen: The make utility which comes with your operating system -should work fine. If you don't have one, GNU make is recommended, -most others (Sun, BSD, etc...) will work fine as well. -http://www.gnu.org/software/make/make.html GNU make - -Windows: nmake or dmake will work. GNU make will *not*. -ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe nmake -http://search.cpan.org/dist/dmake/ dmake - -VMS: MMS or the free MadGoat MaKe utility (MMK) will work. -http://www.madgoat.com/mmk.html MMK - -If all else fails there is a pure Perl version of make available on -CPAN which should work on most Unixen. -http://search.cpan.org/author/NI-S/Make-1.00/ pmake - - -PLEASE NOTE: This distribution does not include the xsubpp or typemap -programs. They are extremely specific to your version or Perl, so -MakeMaker will simply use the one which came with your copy of Perl. -Do not delete your old ExtUtils/ directory. An upgraded version of xsubpp -can be found in the ExtUtils::ParseXS module. - -Known Good Systems: - -Every stable MakeMaker release is tested at least on: - -MacOS X -Linux/x86 -ActivePerl on Windows -Cygwin -OpenVMS - -Covering the major portability flavors MakeMaker has to cover. -(I'm always on the lookout for DJGPP, Solaris, *BSD and OS/2 users) - - -Known Problems: - -(See http://rt.cpan.org for a full list of open problems.) - -Windows will likely be broken if Perl is installed in C:\Program Files or -other prefix with a space in the name. - -Using the MMS utility on VMS causes lots of extra newlines. Unknown -why this is so, might be a bug in MMS. Problem not seen with MMK. - -GNU make does not work with MakeMaker on Windows. +See INSTALL for installation instrucitons. Run "perldoc +ExtUtils::MakeMaker" (while in this source directory before +installation) for more documentation. +See http://rt.cpan.org for a full list of open problems. Please report any bugs via http://rt.cpan.org. Send questions and discussion to makemaker@perl.org diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/README.packaging b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/README.packaging new file mode 100644 index 00000000000..2e2d2952b8b --- /dev/null +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/README.packaging @@ -0,0 +1,23 @@ +If you wish to package MakeMaker in a binary package, here's some tips. + +tl;dr version: + +1a) Set the BUILDING_AS_PACKAGE environment variable to a true value. +OR +1b) Set the $BUILDING_AS_PACKAGE variable in the Makefile.PL to true. +2) Package normally, but watch out for dependency loops. + +MakeMaker cannot have any dependencies, everything depends on it and +that would be a dependency loop. It instead bundles pre-built copies +of all its non-core dependencies in the bundled/ directory. It adds +them to itself if they're not already installed. + +This can confuse packagers, it makes it look like MakeMaker contains a +lot more modules than it really does and causes conflicts. + +You can tell MakeMaker not to use it's bundles and instead declare the +dependencies normally. This is done either by setting the +BUILDING_AS_PACKAGE environment variable to true or by patching the +Makefile.PL and setting $BUILDING_AS_PACKAGE to true. On the down +side, there will be dependency loops which your packaging system will +have to resolve. diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm index f9b474de16f..8d82ee49b12 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm @@ -10,7 +10,7 @@ our @ISA = qw(Exporter); our @EXPORT = qw(test_harness pod2man perllocal_install uninstall warn_if_old_packlist); -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; my $Is_VMS = $^O eq 'VMS'; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm index ea4dac4ae7c..a2ef4268d1d 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm @@ -2,7 +2,7 @@ package ExtUtils::Liblist; use strict; -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; use File::Spec; require ExtUtils::Liblist::Kid; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm index b807e97cc86..eddcc72c749 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm @@ -6,211 +6,241 @@ package ExtUtils::Liblist::Kid; # $self is not a Makemaker. use 5.006; + # Broken out of MakeMaker from version 4.11 use strict; -our $VERSION = 6.56; +use warnings; +our $VERSION = '6.63_02'; -use Config; +use ExtUtils::MakeMaker::Config; use Cwd 'cwd'; use File::Basename; use File::Spec; sub ext { - if ($^O eq 'VMS') { return &_vms_ext; } - elsif($^O eq 'MSWin32') { return &_win32_ext; } - else { return &_unix_os2_ext; } + if ( $^O eq 'VMS' ) { return &_vms_ext; } + elsif ( $^O eq 'MSWin32' ) { return &_win32_ext; } + else { return &_unix_os2_ext; } } sub _unix_os2_ext { - my($self,$potential_libs, $verbose, $give_libs) = @_; + my ( $self, $potential_libs, $verbose, $give_libs ) = @_; $verbose ||= 0; - if ($^O =~ 'os2' and $Config{perllibs}) { - # Dynamic libraries are not transitive, so we may need including - # the libraries linked against perl.dll again. + if ( $^O =~ 'os2' and $Config{perllibs} ) { + + # Dynamic libraries are not transitive, so we may need including + # the libraries linked against perl.dll again. - $potential_libs .= " " if $potential_libs; - $potential_libs .= $Config{perllibs}; + $potential_libs .= " " if $potential_libs; + $potential_libs .= $Config{perllibs}; } - return ("", "", "", "", ($give_libs ? [] : ())) unless $potential_libs; + return ( "", "", "", "", ( $give_libs ? [] : () ) ) unless $potential_libs; warn "Potential libraries are '$potential_libs':\n" if $verbose; - my($so) = $Config{so}; - my($libs) = defined $Config{perllibs} ? $Config{perllibs} : $Config{libs}; + my ( $so ) = $Config{so}; + my ( $libs ) = defined $Config{perllibs} ? $Config{perllibs} : $Config{libs}; my $Config_libext = $Config{lib_ext} || ".a"; - + my $Config_dlext = $Config{dlext}; # compute $extralibs, $bsloadlibs and $ldloadlibs from # $potential_libs # this is a rewrite of Andy Dougherty's extliblist in perl - my(@searchpath); # from "-L/path" entries in $potential_libs - my(@libpath) = split " ", $Config{'libpth'}; - my(@ldloadlibs, @bsloadlibs, @extralibs, @ld_run_path, %ld_run_path_seen); - my(@libs, %libs_seen); - my($fullname, @fullname); - my($pwd) = cwd(); # from Cwd.pm - my($found) = 0; - - foreach my $thislib (split ' ', $potential_libs) { - - # Handle possible linker path arguments. - if ($thislib =~ s/^(-[LR]|-Wl,-R)//){ # save path flag type - my($ptype) = $1; - unless (-d $thislib){ - warn "$ptype$thislib ignored, directory does not exist\n" - if $verbose; - next; - } - my($rtype) = $ptype; - if (($ptype eq '-R') or ($ptype eq '-Wl,-R')) { - if ($Config{'lddlflags'} =~ /-Wl,-R/) { - $rtype = '-Wl,-R'; - } elsif ($Config{'lddlflags'} =~ /-R/) { - $rtype = '-R'; - } - } - unless (File::Spec->file_name_is_absolute($thislib)) { - warn "Warning: $ptype$thislib changed to $ptype$pwd/$thislib\n"; - $thislib = $self->catdir($pwd,$thislib); - } - push(@searchpath, $thislib); - push(@extralibs, "$ptype$thislib"); - push(@ldloadlibs, "$rtype$thislib"); - next; - } - - # Handle possible library arguments. - unless ($thislib =~ s/^-l//){ - warn "Unrecognized argument in LIBS ignored: '$thislib'\n"; - next; - } - - my($found_lib)=0; - foreach my $thispth (@searchpath, @libpath) { - - # Try to find the full name of the library. We need this to - # determine whether it's a dynamically-loadable library or not. - # This tends to be subject to various os-specific quirks. - # For gcc-2.6.2 on linux (March 1995), DLD can not load - # .sa libraries, with the exception of libm.sa, so we - # deliberately skip them. - if (@fullname = - $self->lsdir($thispth,"^\Qlib$thislib.$so.\E[0-9]+")){ - # Take care that libfoo.so.10 wins against libfoo.so.9. - # Compare two libraries to find the most recent version - # number. E.g. if you have libfoo.so.9.0.7 and - # libfoo.so.10.1, first convert all digits into two - # decimal places. Then we'll add ".00" to the shorter - # strings so that we're comparing strings of equal length - # Thus we'll compare libfoo.so.09.07.00 with - # libfoo.so.10.01.00. Some libraries might have letters - # in the version. We don't know what they mean, but will - # try to skip them gracefully -- we'll set any letter to - # '0'. Finally, sort in reverse so we can take the - # first element. - - #TODO: iterate through the directory instead of sorting - - $fullname = "$thispth/" . - (sort { my($ma) = $a; - my($mb) = $b; - $ma =~ tr/A-Za-z/0/s; - $ma =~ s/\b(\d)\b/0$1/g; - $mb =~ tr/A-Za-z/0/s; - $mb =~ s/\b(\d)\b/0$1/g; - while (length($ma) < length($mb)) { $ma .= ".00"; } - while (length($mb) < length($ma)) { $mb .= ".00"; } - # Comparison deliberately backwards - $mb cmp $ma;} @fullname)[0]; - } elsif (-f ($fullname="$thispth/lib$thislib.$so") - && (($Config{'dlsrc'} ne "dl_dld.xs") || ($thislib eq "m"))){ - } elsif (-f ($fullname="$thispth/lib${thislib}_s$Config_libext") - && ($Config{'archname'} !~ /RM\d\d\d-svr4/) - && ($thislib .= "_s") ){ # we must explicitly use _s version - } elsif (-f ($fullname="$thispth/lib$thislib$Config_libext")){ - } elsif (-f ($fullname="$thispth/$thislib$Config_libext")){ - } elsif (-f ($fullname="$thispth/lib$thislib.dll$Config_libext")){ - } elsif (-f ($fullname="$thispth/Slib$thislib$Config_libext")){ - } elsif ($^O eq 'dgux' - && -l ($fullname="$thispth/lib$thislib$Config_libext") - && readlink($fullname) =~ /^elink:/s) { - # 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 { - warn "$thislib not found in $thispth\n" if $verbose; - next; - } - warn "'-l$thislib' found at $fullname\n" if $verbose; - push @libs, $fullname unless $libs_seen{$fullname}++; - $found++; - $found_lib++; - - # Now update library lists - - # what do we know about this library... - my $is_dyna = ($fullname !~ /\Q$Config_libext\E\z/); - my $in_perl = ($libs =~ /\B-l\Q${thislib}\E\b/s); + my ( @searchpath ); # from "-L/path" entries in $potential_libs + my ( @libpath ) = split " ", $Config{'libpth'}; + my ( @ldloadlibs, @bsloadlibs, @extralibs, @ld_run_path, %ld_run_path_seen ); + my ( @libs, %libs_seen ); + my ( $fullname, @fullname ); + my ( $pwd ) = cwd(); # from Cwd.pm + my ( $found ) = 0; + + foreach my $thislib ( split ' ', $potential_libs ) { + + # Handle possible linker path arguments. + if ( $thislib =~ s/^(-[LR]|-Wl,-R)// ) { # save path flag type + my ( $ptype ) = $1; + unless ( -d $thislib ) { + warn "$ptype$thislib ignored, directory does not exist\n" + if $verbose; + next; + } + my ( $rtype ) = $ptype; + if ( ( $ptype eq '-R' ) or ( $ptype eq '-Wl,-R' ) ) { + if ( $Config{'lddlflags'} =~ /-Wl,-R/ ) { + $rtype = '-Wl,-R'; + } + elsif ( $Config{'lddlflags'} =~ /-R/ ) { + $rtype = '-R'; + } + } + unless ( File::Spec->file_name_is_absolute( $thislib ) ) { + warn "Warning: $ptype$thislib changed to $ptype$pwd/$thislib\n"; + $thislib = $self->catdir( $pwd, $thislib ); + } + push( @searchpath, $thislib ); + push( @extralibs, "$ptype$thislib" ); + push( @ldloadlibs, "$rtype$thislib" ); + next; + } + + # Handle possible library arguments. + unless ( $thislib =~ s/^-l// ) { + warn "Unrecognized argument in LIBS ignored: '$thislib'\n"; + next; + } + + my ( $found_lib ) = 0; + foreach my $thispth ( @searchpath, @libpath ) { + + # Try to find the full name of the library. We need this to + # determine whether it's a dynamically-loadable library or not. + # This tends to be subject to various os-specific quirks. + # For gcc-2.6.2 on linux (March 1995), DLD can not load + # .sa libraries, with the exception of libm.sa, so we + # deliberately skip them. + if ( @fullname = $self->lsdir( $thispth, "^\Qlib$thislib.$so.\E[0-9]+" ) ) { + + # Take care that libfoo.so.10 wins against libfoo.so.9. + # Compare two libraries to find the most recent version + # number. E.g. if you have libfoo.so.9.0.7 and + # libfoo.so.10.1, first convert all digits into two + # decimal places. Then we'll add ".00" to the shorter + # strings so that we're comparing strings of equal length + # Thus we'll compare libfoo.so.09.07.00 with + # libfoo.so.10.01.00. Some libraries might have letters + # in the version. We don't know what they mean, but will + # try to skip them gracefully -- we'll set any letter to + # '0'. Finally, sort in reverse so we can take the + # first element. + + #TODO: iterate through the directory instead of sorting + + $fullname = "$thispth/" . ( + sort { + my ( $ma ) = $a; + my ( $mb ) = $b; + $ma =~ tr/A-Za-z/0/s; + $ma =~ s/\b(\d)\b/0$1/g; + $mb =~ tr/A-Za-z/0/s; + $mb =~ s/\b(\d)\b/0$1/g; + while ( length( $ma ) < length( $mb ) ) { $ma .= ".00"; } + while ( length( $mb ) < length( $ma ) ) { $mb .= ".00"; } + + # Comparison deliberately backwards + $mb cmp $ma; + } @fullname + )[0]; + } + elsif ( -f ( $fullname = "$thispth/lib$thislib.$so" ) + && ( ( $Config{'dlsrc'} ne "dl_dld.xs" ) || ( $thislib eq "m" ) ) ) + { + } + elsif (-f ( $fullname = "$thispth/lib${thislib}_s$Config_libext" ) + && ( $Config{'archname'} !~ /RM\d\d\d-svr4/ ) + && ( $thislib .= "_s" ) ) + { # we must explicitly use _s version + } + elsif ( -f ( $fullname = "$thispth/lib$thislib$Config_libext" ) ) { + } + elsif ( defined( $Config_dlext ) + && -f ( $fullname = "$thispth/lib$thislib.$Config_dlext" ) ) + { + } + elsif ( -f ( $fullname = "$thispth/$thislib$Config_libext" ) ) { + } + elsif ( -f ( $fullname = "$thispth/lib$thislib.dll$Config_libext" ) ) { + } + elsif ( -f ( $fullname = "$thispth/Slib$thislib$Config_libext" ) ) { + } + elsif ($^O eq 'dgux' + && -l ( $fullname = "$thispth/lib$thislib$Config_libext" ) + && readlink( $fullname ) =~ /^elink:/s ) + { + + # 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 { + warn "$thislib not found in $thispth\n" if $verbose; + next; + } + warn "'-l$thislib' found at $fullname\n" if $verbose; + push @libs, $fullname unless $libs_seen{$fullname}++; + $found++; + $found_lib++; + + # Now update library lists + + # what do we know about this library... + 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); + 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 - # are both in libsys_s - unless ($in_perl || - ($Config{'osname'} eq 'next' && - ($thislib eq 'm' || $thislib eq 'ndbm')) ){ - push(@extralibs, "-l$thislib"); - } - - # We might be able to load this archive file dynamically - if ( ($Config{'dlsrc'} =~ /dl_next/ && $Config{'osvers'} lt '4_0') - || ($Config{'dlsrc'} =~ /dl_dld/) ) - { - # We push -l$thislib instead of $fullname because - # it avoids hardwiring a fixed path into the .bs file. - # Mkbootstrap will automatically add dl_findfile() to - # the .bs file if it sees a name in the -l format. - # USE THIS, when dl_findfile() is fixed: - # push(@bsloadlibs, "-l$thislib"); - # OLD USE WAS while checking results against old_extliblist - push(@bsloadlibs, "$fullname"); - } else { - if ($is_dyna){ + 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 + # are both in libsys_s + unless ( + $in_perl + || ( $Config{'osname'} eq 'next' + && ( $thislib eq 'm' || $thislib eq 'ndbm' ) ) + ) + { + push( @extralibs, "-l$thislib" ); + } + + # We might be able to load this archive file dynamically + if ( ( $Config{'dlsrc'} =~ /dl_next/ && $Config{'osvers'} lt '4_0' ) + || ( $Config{'dlsrc'} =~ /dl_dld/ ) ) + { + + # We push -l$thislib instead of $fullname because + # it avoids hardwiring a fixed path into the .bs file. + # Mkbootstrap will automatically add dl_findfile() to + # the .bs file if it sees a name in the -l format. + # USE THIS, when dl_findfile() is fixed: + # push(@bsloadlibs, "-l$thislib"); + # OLD USE WAS while checking results against old_extliblist + push( @bsloadlibs, "$fullname" ); + } + else { + if ( $is_dyna ) { + # For SunOS4, do not add in this shared library if # it is already linked in the main perl executable - push(@ldloadlibs, "-l$thislib") - unless ($in_perl and $^O eq 'sunos'); - } else { - push(@ldloadlibs, "-l$thislib"); - } - } - last; # found one here so don't bother looking further - } - warn "Note (probably harmless): " - ."No library found for -l$thislib\n" - unless $found_lib>0; + push( @ldloadlibs, "-l$thislib" ) + unless ( $in_perl and $^O eq 'sunos' ); + } + else { + push( @ldloadlibs, "-l$thislib" ); + } + } + last; # found one here so don't bother looking further + } + warn "Note (probably harmless): " . "No library found for -l$thislib\n" + unless $found_lib > 0; } - unless( $found ) { - return ('','','','', ($give_libs ? \@libs : ())); + unless ( $found ) { + return ( '', '', '', '', ( $give_libs ? \@libs : () ) ); } else { - return ("@extralibs", "@bsloadlibs", "@ldloadlibs", - join(":",@ld_run_path), ($give_libs ? \@libs : ())); + return ( "@extralibs", "@bsloadlibs", "@ldloadlibs", join( ":", @ld_run_path ), ( $give_libs ? \@libs : () ) ); } } @@ -218,329 +248,378 @@ sub _win32_ext { require Text::ParseWords; - my($self, $potential_libs, $verbose, $give_libs) = @_; + my ( $self, $potential_libs, $verbose, $give_libs ) = @_; $verbose ||= 0; # If user did not supply a list, we punt. # (caller should probably use the list in $Config{libs}) - return ("", "", "", "", ($give_libs ? [] : ())) unless $potential_libs; - - my $cc = $Config{cc}; - my $VC = $cc =~ /^cl/i; - my $BC = $cc =~ /^bcc/i; - my $GC = $cc =~ /^gcc/i; - my $so = $Config{'so'}; - my $libs = $Config{'perllibs'}; - my $libpth = $Config{'libpth'}; - my $libext = $Config{'lib_ext'} || ".lib"; - my(@libs, %libs_seen); - - if ($libs and $potential_libs !~ /:nodefault/i) { - # If Config.pm defines a set of default libs, we always - # tack them on to the user-supplied list, unless the user - # specified :nodefault - - $potential_libs .= " " if $potential_libs; - $potential_libs .= $libs; - } - warn "Potential libraries are '$potential_libs':\n" if $verbose; + return ( "", "", "", "", ( $give_libs ? [] : () ) ) unless $potential_libs; - # normalize to forward slashes - $libpth =~ s,\\,/,g; - $potential_libs =~ s,\\,/,g; + # TODO: make this use MM_Win32.pm's compiler detection + my %libs_seen; + my @extralibs; + my $cc = $Config{cc} || ''; + my $VC = $cc =~ /\bcl\b/i; + my $GC = $cc =~ /\bgcc\b/i; - # compute $extralibs from $potential_libs + my $libext = _win32_lib_extensions(); + my @searchpath = ( '' ); # from "-L/path" entries in $potential_libs + my @libpath = _win32_default_search_paths( $VC, $GC ); + my $pwd = cwd(); # from Cwd.pm + my $search = 1; - my @searchpath; # from "-L/path" in $potential_libs - my @libpath = Text::ParseWords::quotewords('\s+', 0, $libpth); - my @extralibs; - my $pwd = cwd(); # from Cwd.pm - my $lib = ''; - my $found = 0; - my $search = 1; - my($fullname); + # compute @extralibs from $potential_libs + my @lib_search_list = _win32_make_lib_search_list( $potential_libs, $verbose ); + for ( @lib_search_list ) { - # add "$Config{installarchlib}/CORE" to default search path - push @libpath, "$Config{installarchlib}/CORE"; + my $thislib = $_; - if ($VC and exists $ENV{LIB} and $ENV{LIB}) { - push @libpath, split /;/, $ENV{LIB}; - } + # see if entry is a flag + if ( /^:\w+$/ ) { + $search = 0 if lc eq ':nosearch'; + $search = 1 if lc eq ':search'; + _debug( "Ignoring unknown flag '$thislib'\n", $verbose ) if !/^:(no)?(search|default)$/i; + next; + } + + # if searching is disabled, do compiler-specific translations + unless ( $search ) { + s/^-l(.+)$/$1.lib/ unless $GC; + s/^-L/-libpath:/ if $VC; + push( @extralibs, $_ ); + next; + } - foreach (Text::ParseWords::quotewords('\s+', 0, $potential_libs)){ + # handle possible linker path arguments + if ( s/^-L// and not -d ) { + _debug( "$thislib ignored, directory does not exist\n", $verbose ); + next; + } + elsif ( -d ) { + unless ( File::Spec->file_name_is_absolute( $_ ) ) { + warn "Warning: '$thislib' changed to '-L$pwd/$_'\n"; + $_ = $self->catdir( $pwd, $_ ); + } + push( @searchpath, $_ ); + next; + } - my $thislib = $_; + my @paths = ( @searchpath, @libpath ); + my ( $fullname, $path ) = _win32_search_file( $thislib, $libext, \@paths, $verbose, $GC ); - # see if entry is a flag - if (/^:\w+$/) { - $search = 0 if lc eq ':nosearch'; - $search = 1 if lc eq ':search'; - warn "Ignoring unknown flag '$thislib'\n" - if $verbose and !/^:(no)?(search|default)$/i; - next; - } - - # if searching is disabled, do compiler-specific translations - unless ($search) { - s/^-l(.+)$/$1.lib/ unless $GC; - s/^-L/-libpath:/ if $VC; - push(@extralibs, $_); - $found++; - next; - } - - # handle possible linker path arguments - if (s/^-L// and not -d) { - warn "$thislib ignored, directory does not exist\n" - if $verbose; - next; - } - elsif (-d) { - unless (File::Spec->file_name_is_absolute($_)) { - warn "Warning: '$thislib' changed to '-L$pwd/$_'\n"; - $_ = $self->catdir($pwd,$_); - } - push(@searchpath, $_); - next; - } - - # handle possible library arguments - if (s/^-l// and $GC and !/^lib/i) { - $_ = "lib$_"; - } - $_ .= $libext if !/\Q$libext\E$/i; - - my $secondpass = 0; - LOOKAGAIN: - - # look for the file itself - if (-f) { - warn "'$thislib' found as '$_'\n" if $verbose; - $found++; - push(@extralibs, $_); - next; - } - - my $found_lib = 0; - foreach my $thispth (@searchpath, @libpath){ - unless (-f ($fullname="$thispth\\$_")) { - warn "'$thislib' not found as '$fullname'\n" if $verbose; - next; - } - warn "'$thislib' found as '$fullname'\n" if $verbose; - $found++; - $found_lib++; - push(@extralibs, $fullname); - push @libs, $fullname unless $libs_seen{$fullname}++; - last; - } - - # do another pass with (or without) leading 'lib' if they used -l - if (!$found_lib and $thislib =~ /^-l/ and !$secondpass++) { - if ($GC) { - goto LOOKAGAIN if s/^lib//i; - } - elsif (!/^lib/i) { - $_ = "lib$_"; - goto LOOKAGAIN; - } - } - - # give up - warn "Note (probably harmless): " - ."No library found for $thislib\n" - unless $found_lib>0; + if ( !$fullname ) { + warn "Note (probably harmless): No library found for $thislib\n"; + next; + } + _debug( "'$thislib' found as '$fullname'\n", $verbose ); + push( @extralibs, $fullname ); + $libs_seen{$fullname} = 1 if $path; # why is this a special case? } - return ('','','','', ($give_libs ? \@libs : ())) unless $found; + my @libs = keys %libs_seen; + + return ( '', '', '', '', ( $give_libs ? \@libs : () ) ) unless @extralibs; # make sure paths with spaces are properly quoted - @extralibs = map { (/\s/ && !/^".*"$/) ? qq["$_"] : $_ } @extralibs; - @libs = map { (/\s/ && !/^".*"$/) ? qq["$_"] : $_ } @libs; - $lib = join(' ',@extralibs); + @extralibs = map { /\s/ ? qq["$_"] : $_ } @extralibs; + @libs = map { /\s/ ? qq["$_"] : $_ } @libs; + + my $lib = join( ' ', @extralibs ); # normalize back to backward slashes (to help braindead tools) # XXX this may break equally braindead GNU tools that don't understand # backslashes, either. Seems like one can't win here. Cursed be CP/M. $lib =~ s,/,\\,g; - warn "Result: $lib\n" if $verbose; - wantarray ? ($lib, '', $lib, '', ($give_libs ? \@libs : ())) : $lib; + _debug( "Result: $lib\n", $verbose ); + wantarray ? ( $lib, '', $lib, '', ( $give_libs ? \@libs : () ) ) : $lib; } +sub _win32_make_lib_search_list { + my ( $potential_libs, $verbose ) = @_; -sub _vms_ext { - my($self, $potential_libs, $verbose, $give_libs) = @_; - $verbose ||= 0; - - my(@crtls,$crtlstr); - @crtls = ( ($Config{'ldflags'} =~ m-/Debug-i ? $Config{'dbgprefix'} : '') - . 'PerlShr/Share' ); - push(@crtls, grep { not /\(/ } split /\s+/, $Config{'perllibs'}); - push(@crtls, grep { not /\(/ } split /\s+/, $Config{'libc'}); - # In general, we pass through the basic libraries from %Config unchanged. - # The one exception is that if we're building in the Perl source tree, and - # a library spec could be resolved via a logical name, we go to some trouble - # to insure that the copy in the local tree is used, rather than one to - # which a system-wide logical may point. - if ($self->{PERL_SRC}) { - my($locspec,$type); - foreach my $lib (@crtls) { - if (($locspec,$type) = $lib =~ m{^([\w\$-]+)(/\w+)?} and $locspec =~ /perl/i) { - if (lc $type eq '/share') { $locspec .= $Config{'exe_ext'}; } - elsif (lc $type eq '/library') { $locspec .= $Config{'lib_ext'}; } - else { $locspec .= $Config{'obj_ext'}; } - $locspec = $self->catfile($self->{PERL_SRC},$locspec); - $lib = "$locspec$type" if -e $locspec; - } - } - } - $crtlstr = @crtls ? join(' ',@crtls) : ''; - - unless ($potential_libs) { - warn "Result:\n\tEXTRALIBS: \n\tLDLOADLIBS: $crtlstr\n" if $verbose; - return ('', '', $crtlstr, '', ($give_libs ? [] : ())); - } - - my(%found,@fndlibs,$ldlib); - my $cwd = cwd(); - my($so,$lib_ext,$obj_ext) = @Config{'so','lib_ext','obj_ext'}; - # List of common Unix library names and their VMS equivalents - # (VMS equivalent of '' indicates that the library is automatically - # searched by the linker, and should be skipped here.) - my(@flibs, %libs_seen); - my %libmap = ( 'm' => '', 'f77' => '', 'F77' => '', 'V77' => '', 'c' => '', - 'malloc' => '', 'crypt' => '', 'resolv' => '', 'c_s' => '', - 'socket' => '', 'X11' => 'DECW$XLIBSHR', - 'Xt' => 'DECW$XTSHR', 'Xm' => 'DECW$XMLIBSHR', - 'Xmu' => 'DECW$XMULIBSHR'); - if ($Config{'vms_cc_type'} ne 'decc') { $libmap{'curses'} = 'VAXCCURSE'; } - - warn "Potential libraries are '$potential_libs'\n" if $verbose; - - # First, sort out directories and library names in the input - my(@dirs, @libs); - foreach my $lib (split ' ',$potential_libs) { - push(@dirs,$1), next if $lib =~ /^-L(.*)/; - push(@dirs,$lib), next if $lib =~ /[:>\]]$/; - push(@dirs,$lib), next if -d $lib; - push(@libs,$1), next if $lib =~ /^-l(.*)/; - push(@libs,$lib); - } - push(@dirs,split(' ',$Config{'libpth'})); - - # Now make sure we've got VMS-syntax absolute directory specs - # (We don't, however, check whether someone's hidden a relative - # path in a logical name.) - foreach my $dir (@dirs) { - unless (-d $dir) { - warn "Skipping nonexistent Directory $dir\n" if $verbose > 1; - $dir = ''; - next; - } - warn "Resolving directory $dir\n" if $verbose; - if (File::Spec->file_name_is_absolute($dir)) { - $dir = $self->fixpath($dir,1); - } - else { - $dir = $self->catdir($cwd,$dir); + # If Config.pm defines a set of default libs, we always + # tack them on to the user-supplied list, unless the user + # specified :nodefault + my $libs = $Config{'perllibs'}; + $potential_libs = join( ' ', $potential_libs, $libs ) if $libs and $potential_libs !~ /:nodefault/i; + _debug( "Potential libraries are '$potential_libs':\n", $verbose ); + + $potential_libs =~ s,\\,/,g; # normalize to forward slashes + + my @list = Text::ParseWords::quotewords( '\s+', 0, $potential_libs ); + + return @list; +} + +sub _win32_default_search_paths { + my ( $VC, $GC ) = @_; + + my $libpth = $Config{'libpth'} || ''; + $libpth =~ s,\\,/,g; # normalize to forward slashes + + my @libpath = Text::ParseWords::quotewords( '\s+', 0, $libpth ); + push @libpath, "$Config{installarchlib}/CORE"; # add "$Config{installarchlib}/CORE" to default search path + + push @libpath, split /;/, $ENV{LIB} if $VC and $ENV{LIB}; + push @libpath, split /;/, $ENV{LIBRARY_PATH} if $GC and $ENV{LIBRARY_PATH}; + + return @libpath; +} + +sub _win32_search_file { + my ( $thislib, $libext, $paths, $verbose, $GC ) = @_; + + my @file_list = _win32_build_file_list( $thislib, $GC, $libext ); + + for my $lib_file ( @file_list ) { + for my $path ( @{$paths} ) { + my $fullname = $lib_file; + $fullname = "$path\\$fullname" if $path; + + return ( $fullname, $path ) if -f $fullname; + + _debug( "'$thislib' not found as '$fullname'\n", $verbose ); + } } - } - @dirs = grep { length($_) } @dirs; - unshift(@dirs,''); # Check each $lib without additions first - - LIB: foreach my $lib (@libs) { - if (exists $libmap{$lib}) { - next unless length $libmap{$lib}; - $lib = $libmap{$lib}; + + return; +} + +sub _win32_build_file_list { + my ( $lib, $GC, $extensions ) = @_; + + my @pre_fixed = _win32_build_prefixed_list( $lib, $GC ); + return map _win32_attach_extensions( $_, $extensions ), @pre_fixed; +} + +sub _win32_build_prefixed_list { + my ( $lib, $GC ) = @_; + + return $lib if $lib !~ s/^-l//; + return $lib if $lib =~ /^lib/ and !$GC; + + ( my $no_prefix = $lib ) =~ s/^lib//i; + $lib = "lib$lib" if $no_prefix eq $lib; + + return ( $lib, $no_prefix ) if $GC; + return ( $no_prefix, $lib ); +} + +sub _win32_attach_extensions { + my ( $lib, $extensions ) = @_; + return map _win32_try_attach_extension( $lib, $_ ), @{$extensions}; +} + +sub _win32_try_attach_extension { + my ( $lib, $extension ) = @_; + + return $lib if $lib =~ /\Q$extension\E$/i; + return "$lib$extension"; +} + +sub _win32_lib_extensions { + my %extensions; + $extensions{ $Config{'lib_ext'} } = 1 if $Config{'lib_ext'}; + $extensions{".lib"} = 1; + return [ keys %extensions ]; +} + +sub _debug { + my ( $message, $verbose ) = @_; + return if !$verbose; + warn $message; + return; +} + +sub _vms_ext { + my ( $self, $potential_libs, $verbose, $give_libs ) = @_; + $verbose ||= 0; + + my ( @crtls, $crtlstr ); + @crtls = ( ( $Config{'ldflags'} =~ m-/Debug-i ? $Config{'dbgprefix'} : '' ) . 'PerlShr/Share' ); + push( @crtls, grep { not /\(/ } split /\s+/, $Config{'perllibs'} ); + push( @crtls, grep { not /\(/ } split /\s+/, $Config{'libc'} ); + + # In general, we pass through the basic libraries from %Config unchanged. + # The one exception is that if we're building in the Perl source tree, and + # a library spec could be resolved via a logical name, we go to some trouble + # to insure that the copy in the local tree is used, rather than one to + # which a system-wide logical may point. + if ( $self->{PERL_SRC} ) { + my ( $locspec, $type ); + foreach my $lib ( @crtls ) { + if ( ( $locspec, $type ) = $lib =~ m{^([\w\$-]+)(/\w+)?} and $locspec =~ /perl/i ) { + if ( lc $type eq '/share' ) { $locspec .= $Config{'exe_ext'}; } + elsif ( lc $type eq '/library' ) { $locspec .= $Config{'lib_ext'}; } + else { $locspec .= $Config{'obj_ext'}; } + $locspec = $self->catfile( $self->{PERL_SRC}, $locspec ); + $lib = "$locspec$type" if -e $locspec; + } + } } + $crtlstr = @crtls ? join( ' ', @crtls ) : ''; - my(@variants,$cand); - my($ctype) = ''; + unless ( $potential_libs ) { + warn "Result:\n\tEXTRALIBS: \n\tLDLOADLIBS: $crtlstr\n" if $verbose; + return ( '', '', $crtlstr, '', ( $give_libs ? [] : () ) ); + } - # If we don't have a file type, consider it a possibly abbreviated name and - # check for common variants. We try these first to grab libraries before - # a like-named executable image (e.g. -lperl resolves to perlshr.exe - # before perl.exe). - if ($lib !~ /\.[^:>\]]*$/) { - push(@variants,"${lib}shr","${lib}rtl","${lib}lib"); - push(@variants,"lib$lib") if $lib !~ /[:>\]]/; + my ( %found, @fndlibs, $ldlib ); + my $cwd = cwd(); + my ( $so, $lib_ext, $obj_ext ) = @Config{ 'so', 'lib_ext', 'obj_ext' }; + + # List of common Unix library names and their VMS equivalents + # (VMS equivalent of '' indicates that the library is automatically + # searched by the linker, and should be skipped here.) + my ( @flibs, %libs_seen ); + my %libmap = ( + 'm' => '', + 'f77' => '', + 'F77' => '', + 'V77' => '', + 'c' => '', + 'malloc' => '', + 'crypt' => '', + 'resolv' => '', + 'c_s' => '', + 'socket' => '', + 'X11' => 'DECW$XLIBSHR', + 'Xt' => 'DECW$XTSHR', + 'Xm' => 'DECW$XMLIBSHR', + 'Xmu' => 'DECW$XMULIBSHR' + ); + if ( $Config{'vms_cc_type'} ne 'decc' ) { $libmap{'curses'} = 'VAXCCURSE'; } + + warn "Potential libraries are '$potential_libs'\n" if $verbose; + + # First, sort out directories and library names in the input + my ( @dirs, @libs ); + foreach my $lib ( split ' ', $potential_libs ) { + push( @dirs, $1 ), next if $lib =~ /^-L(.*)/; + push( @dirs, $lib ), next if $lib =~ /[:>\]]$/; + push( @dirs, $lib ), next if -d $lib; + push( @libs, $1 ), next if $lib =~ /^-l(.*)/; + push( @libs, $lib ); } - push(@variants,$lib); - warn "Looking for $lib\n" if $verbose; - foreach my $variant (@variants) { - my($fullname, $name); - - foreach my $dir (@dirs) { - my($type); - - $name = "$dir$variant"; - warn "\tChecking $name\n" if $verbose > 2; - $fullname = VMS::Filespec::rmsexpand($name); - if (defined $fullname and -f $fullname) { - # It's got its own suffix, so we'll have to figure out the type - if ($fullname =~ /(?:$so|exe)$/i) { $type = 'SHR'; } - elsif ($fullname =~ /(?:$lib_ext|olb)$/i) { $type = 'OLB'; } - elsif ($fullname =~ /(?:$obj_ext|obj)$/i) { - warn "Note (probably harmless): " - ."Plain object file $fullname found in library list\n"; - $type = 'OBJ'; - } - else { - warn "Note (probably harmless): " - ."Unknown library type for $fullname; assuming shared\n"; - $type = 'SHR'; - } + push( @dirs, split( ' ', $Config{'libpth'} ) ); + + # Now make sure we've got VMS-syntax absolute directory specs + # (We don't, however, check whether someone's hidden a relative + # path in a logical name.) + foreach my $dir ( @dirs ) { + unless ( -d $dir ) { + warn "Skipping nonexistent Directory $dir\n" if $verbose > 1; + $dir = ''; + next; } - elsif (-f ($fullname = VMS::Filespec::rmsexpand($name,$so)) or - -f ($fullname = VMS::Filespec::rmsexpand($name,'.exe'))) { - $type = 'SHR'; - $name = $fullname unless $fullname =~ /exe;?\d*$/i; + warn "Resolving directory $dir\n" if $verbose; + if ( File::Spec->file_name_is_absolute( $dir ) ) { + $dir = $self->fixpath( $dir, 1 ); } - elsif (not length($ctype) and # If we've got a lib already, - # don't bother - ( -f ($fullname = VMS::Filespec::rmsexpand($name,$lib_ext)) or - -f ($fullname = VMS::Filespec::rmsexpand($name,'.olb')))) { - $type = 'OLB'; - $name = $fullname unless $fullname =~ /olb;?\d*$/i; + else { + $dir = $self->catdir( $cwd, $dir ); } - elsif (not length($ctype) and # If we've got a lib already, - # don't bother - ( -f ($fullname = VMS::Filespec::rmsexpand($name,$obj_ext)) or - -f ($fullname = VMS::Filespec::rmsexpand($name,'.obj')))) { - warn "Note (probably harmless): " - ."Plain object file $fullname found in library list\n"; - $type = 'OBJ'; - $name = $fullname unless $fullname =~ /obj;?\d*$/i; + } + @dirs = grep { length( $_ ) } @dirs; + unshift( @dirs, '' ); # Check each $lib without additions first + + LIB: foreach my $lib ( @libs ) { + if ( exists $libmap{$lib} ) { + next unless length $libmap{$lib}; + $lib = $libmap{$lib}; } - if (defined $type) { - $ctype = $type; $cand = $name; - last if $ctype eq 'SHR'; + + my ( @variants, $cand ); + my ( $ctype ) = ''; + + # If we don't have a file type, consider it a possibly abbreviated name and + # check for common variants. We try these first to grab libraries before + # a like-named executable image (e.g. -lperl resolves to perlshr.exe + # before perl.exe). + if ( $lib !~ /\.[^:>\]]*$/ ) { + push( @variants, "${lib}shr", "${lib}rtl", "${lib}lib" ); + push( @variants, "lib$lib" ) if $lib !~ /[:>\]]/; + } + push( @variants, $lib ); + warn "Looking for $lib\n" if $verbose; + foreach my $variant ( @variants ) { + my ( $fullname, $name ); + + foreach my $dir ( @dirs ) { + my ( $type ); + + $name = "$dir$variant"; + warn "\tChecking $name\n" if $verbose > 2; + $fullname = VMS::Filespec::rmsexpand( $name ); + if ( defined $fullname and -f $fullname ) { + + # It's got its own suffix, so we'll have to figure out the type + if ( $fullname =~ /(?:$so|exe)$/i ) { $type = 'SHR'; } + elsif ( $fullname =~ /(?:$lib_ext|olb)$/i ) { $type = 'OLB'; } + elsif ( $fullname =~ /(?:$obj_ext|obj)$/i ) { + warn "Note (probably harmless): " . "Plain object file $fullname found in library list\n"; + $type = 'OBJ'; + } + else { + warn "Note (probably harmless): " . "Unknown library type for $fullname; assuming shared\n"; + $type = 'SHR'; + } + } + elsif (-f ( $fullname = VMS::Filespec::rmsexpand( $name, $so ) ) + or -f ( $fullname = VMS::Filespec::rmsexpand( $name, '.exe' ) ) ) + { + $type = 'SHR'; + $name = $fullname unless $fullname =~ /exe;?\d*$/i; + } + elsif ( + not length( $ctype ) and # If we've got a lib already, + # don't bother + ( -f ( $fullname = VMS::Filespec::rmsexpand( $name, $lib_ext ) ) or -f ( $fullname = VMS::Filespec::rmsexpand( $name, '.olb' ) ) ) + ) + { + $type = 'OLB'; + $name = $fullname unless $fullname =~ /olb;?\d*$/i; + } + elsif ( + not length( $ctype ) and # If we've got a lib already, + # don't bother + ( -f ( $fullname = VMS::Filespec::rmsexpand( $name, $obj_ext ) ) or -f ( $fullname = VMS::Filespec::rmsexpand( $name, '.obj' ) ) ) + ) + { + warn "Note (probably harmless): " . "Plain object file $fullname found in library list\n"; + $type = 'OBJ'; + $name = $fullname unless $fullname =~ /obj;?\d*$/i; + } + if ( defined $type ) { + $ctype = $type; + $cand = $name; + last if $ctype eq 'SHR'; + } + } + if ( $ctype ) { + + # This has to precede any other CRTLs, so just make it first + if ( $cand eq 'VAXCCURSE' ) { unshift @{ $found{$ctype} }, $cand; } + else { push @{ $found{$ctype} }, $cand; } + warn "\tFound as $cand (really $fullname), type $ctype\n" + if $verbose > 1; + push @flibs, $name unless $libs_seen{$fullname}++; + next LIB; + } } - } - if ($ctype) { - # This has to precede any other CRTLs, so just make it first - if ($cand eq 'VAXCCURSE') { unshift @{$found{$ctype}}, $cand; } - else { push @{$found{$ctype}}, $cand; } - warn "\tFound as $cand (really $fullname), type $ctype\n" - if $verbose > 1; - push @flibs, $name unless $libs_seen{$fullname}++; - next LIB; - } + warn "Note (probably harmless): " . "No library found for $lib\n"; } - warn "Note (probably harmless): " - ."No library found for $lib\n"; - } - - push @fndlibs, @{$found{OBJ}} if exists $found{OBJ}; - push @fndlibs, map { "$_/Library" } @{$found{OLB}} if exists $found{OLB}; - push @fndlibs, map { "$_/Share" } @{$found{SHR}} if exists $found{SHR}; - my $lib = join(' ',@fndlibs); - - $ldlib = $crtlstr ? "$lib $crtlstr" : $lib; - warn "Result:\n\tEXTRALIBS: $lib\n\tLDLOADLIBS: $ldlib\n" if $verbose; - wantarray ? ($lib, '', $ldlib, '', ($give_libs ? \@flibs : ())) : $lib; + + push @fndlibs, @{ $found{OBJ} } if exists $found{OBJ}; + push @fndlibs, map { "$_/Library" } @{ $found{OLB} } if exists $found{OLB}; + push @fndlibs, map { "$_/Share" } @{ $found{SHR} } if exists $found{SHR}; + my $lib = join( ' ', @fndlibs ); + + $ldlib = $crtlstr ? "$lib $crtlstr" : $lib; + warn "Result:\n\tEXTRALIBS: $lib\n\tLDLOADLIBS: $ldlib\n" if $verbose; + wantarray ? ( $lib, '', $ldlib, '', ( $give_libs ? \@flibs : () ) ) : $lib; } 1; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM.pm index eac5f483494..418eb190dd1 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM.pm @@ -3,7 +3,7 @@ package ExtUtils::MM; use strict; use ExtUtils::MakeMaker::Config; -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; require ExtUtils::Liblist; require ExtUtils::MakeMaker; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_AIX.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_AIX.pm index 5179be4bc2a..0b0547ff521 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_AIX.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_AIX.pm @@ -1,7 +1,7 @@ package ExtUtils::MM_AIX; use strict; -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; require ExtUtils::MM_Unix; our @ISA = qw(ExtUtils::MM_Unix); diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_BeOS.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_BeOS.pm index 0b7c8db9225..a31cf2320c3 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_BeOS.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_BeOS.pm @@ -26,7 +26,7 @@ require ExtUtils::MM_Any; require ExtUtils::MM_Unix; our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix ); -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; =item os_flavor diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm index 394fbc68a75..de6f13085ee 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm @@ -9,7 +9,7 @@ require ExtUtils::MM_Unix; require ExtUtils::MM_Win32; our @ISA = qw( ExtUtils::MM_Unix ); -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; =head1 NAME @@ -116,6 +116,39 @@ sub maybe_command { return $self->SUPER::maybe_command($file); } +=item dynamic_lib + +Use the default to produce the *.dll's. +But for new archdir dll's use the same rebase address if the old exists. + +=cut + +sub dynamic_lib { + my($self, %attribs) = @_; + my $s = ExtUtils::MM_Unix::dynamic_lib($self, %attribs); + my $ori = "$self->{INSTALLARCHLIB}/auto/$self->{FULLEXT}/$self->{BASEEXT}.$self->{DLEXT}"; + if (-e $ori) { + my $imagebase = `/bin/objdump -p $ori | /bin/grep ImageBase | /bin/cut -c12-`; + chomp $imagebase; + if ($imagebase gt "40000000") { + my $LDDLFLAGS = $self->{LDDLFLAGS}; + $LDDLFLAGS =~ s/-Wl,--enable-auto-image-base/-Wl,--image-base=0x$imagebase/; + $s =~ s/ \$\(LDDLFLAGS\) / $LDDLFLAGS /m; + } + } + $s; +} + +=item all_target + +Build man pages, too + +=cut + +sub all_target { + ExtUtils::MM_Unix::all_target(shift); +} + =back =cut diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_DOS.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_DOS.pm index fc0a7947235..d902038412b 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_DOS.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_DOS.pm @@ -2,7 +2,7 @@ package ExtUtils::MM_DOS; use strict; -our $VERSION = 6.56; +our $VERSION = '6.63_02'; require ExtUtils::MM_Any; require ExtUtils::MM_Unix; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Darwin.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Darwin.pm index 1cb87c78815..6d78157fe5f 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Darwin.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Darwin.pm @@ -7,7 +7,7 @@ BEGIN { our @ISA = qw( ExtUtils::MM_Unix ); } -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; =head1 NAME diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_MacOS.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_MacOS.pm index cfc82051e1b..17bcde790e4 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_MacOS.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_MacOS.pm @@ -2,7 +2,7 @@ package ExtUtils::MM_MacOS; use strict; -our $VERSION = 6.56; +our $VERSION = '6.63_02'; sub new { die <<'UNSUPPORTED'; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_NW5.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_NW5.pm index 0c8f6c0affb..be1e1555576 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_NW5.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_NW5.pm @@ -22,7 +22,7 @@ use strict; use ExtUtils::MakeMaker::Config; use File::Basename; -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; require ExtUtils::MM_Win32; our @ISA = qw(ExtUtils::MM_Win32); diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm index 680502baf24..f4ebd1e738e 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm @@ -5,7 +5,7 @@ use strict; use ExtUtils::MakeMaker qw(neatvalue); use File::Spec; -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; require ExtUtils::MM_Any; require ExtUtils::MM_Unix; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm index f78d5e8a9ee..9d1f29223d0 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm @@ -1,7 +1,7 @@ package ExtUtils::MM_QNX; use strict; -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; require ExtUtils::MM_Unix; our @ISA = qw(ExtUtils::MM_Unix); diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_UWIN.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_UWIN.pm index 5adc46ea8d2..d4b9370bd1a 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_UWIN.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_UWIN.pm @@ -1,7 +1,7 @@ package ExtUtils::MM_UWIN; use strict; -our $VERSION = 6.56; +our $VERSION = '6.63_02'; require ExtUtils::MM_Unix; our @ISA = qw(ExtUtils::MM_Unix); diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm index 2066d035976..c204abcb2d1 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm @@ -15,7 +15,7 @@ BEGIN { use File::Basename; -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; require ExtUtils::MM_Any; require ExtUtils::MM_Unix; @@ -248,6 +248,23 @@ sub find_perl { 0; # false and not empty } +=item _fixin_replace_shebang (override) + +Helper routine for MM->fixin(), overridden because there's no such thing as an +actual shebang line that will be intepreted by the shell, so we just prepend +$Config{startperl} and preserve the shebang line argument for any switches it +may contain. + +=cut + +sub _fixin_replace_shebang { + my ( $self, $file, $line ) = @_; + + my ( undef, $arg ) = split ' ', $line, 2; + + return $Config{startperl} . "\n" . $Config{sharpbang} . "perl $arg\n"; +} + =item maybe_command (override) Follows VMS naming conventions for executable files. @@ -430,21 +447,20 @@ sub init_main { } } -=item init_others (override) +=item init_tools (override) -Provide VMS-specific forms of various utility commands, then hand -off to the default MM_Unix method. +Provide VMS-specific forms of various utility commands. -DEV_NULL should probably be overriden with something. +Sets DEV_NULL to nothing because I don't know how to do it on VMS. -Also changes EQUALIZE_TIMESTAMP to set revision date of target file to +Changes EQUALIZE_TIMESTAMP to set revision date of target file to one second later than source file, since MMK interprets precisely equal revision dates for a source and target file as a sign that the target needs to be updated. =cut -sub init_others { +sub init_tools { my($self) = @_; $self->{NOOP} = 'Continue'; @@ -476,17 +492,34 @@ sub init_others { install([ from_to => {split(' ', <STDIN>)}, verbose => '$(VERBINST)', uninstall_shadows => '$(UNINST)', dir_mode => '$(PERM_DIR)' ]); CODE - $self->SUPER::init_others; + $self->{UMASK_NULL} = '! '; - $self->{SHELL} ||= 'Posix'; + $self->SUPER::init_tools; - $self->{UMASK_NULL} = '! '; + # Use the default shell + $self->{SHELL} ||= 'Posix'; # Redirection on VMS goes before the command, not after as on Unix. # $(DEV_NULL) is used once and its not worth going nuts over making # it work. However, Unix's DEV_NULL is quite wrong for VMS. $self->{DEV_NULL} = ''; + return; +} + + +=item init_others (override) + +Provide VMS-specific forms of various compile and link commands + +=cut + +sub init_others { + my $self = shift; + + # Must come first as we're modifying and deriving from the defaults. + $self->SUPER::init_others; + if ($self->{OBJECT} =~ /\s/) { $self->{OBJECT} =~ s/(\\)?\n+\s+/ /g; $self->{OBJECT} = $self->wraplist( @@ -497,6 +530,8 @@ CODE $self->{LDFROM} = $self->wraplist( map $self->fixpath($_,0), split /,?\s+/, $self->{LDFROM} ); + + return; } @@ -1067,14 +1102,14 @@ $(INST_STATIC) : $(OBJECT) $(MYEXTLIB) =item extra_clean_files Clean up some OS specific files. Plus the temp file used to shorten -a lot of commands. +a lot of commands. And the name mangler database. =cut sub extra_clean_files { return qw( *.Map *.Dmp *.Lis *.cpp *.$(DLEXT) *.Opt $(BASEEXT).bso - .MM_Tmp + .MM_Tmp cxx_repository ); } @@ -1265,7 +1300,7 @@ sub perldepend { push @m, ' $(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)av.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)form.h $(OBJECT) : $(PERL_INC)gv.h, $(PERL_INC)handy.h, $(PERL_INC)hv.h @@ -1736,13 +1771,21 @@ native Write command instead. Besides, its faster. =cut sub echo { - my($self, $text, $file, $appending) = @_; - $appending ||= 0; + my($self, $text, $file, $opts) = @_; + + # Compatibility with old options + if( !ref $opts ) { + my $append = $opts; + $opts = { append => $append || 0 }; + } + my $opencmd = $opts->{append} ? 'Open/Append' : 'Open/Write'; + + $opts->{allow_variables} = 0 unless defined $opts->{allow_variables}; - my $opencmd = $appending ? 'Open/Append' : 'Open/Write'; + my $ql_opts = { allow_variables => $opts->{allow_variables} }; my @cmds = ("\$(NOECHO) $opencmd MMECHOFILE $file "); - push @cmds, map { '$(NOECHO) Write MMECHOFILE '.$self->quote_literal($_) } + push @cmds, map { '$(NOECHO) Write MMECHOFILE '.$self->quote_literal($_, $ql_opts) } split /\n/, $text; push @cmds, '$(NOECHO) Close MMECHOFILE'; return @cmds; @@ -1754,14 +1797,49 @@ sub echo { =cut sub quote_literal { - my($self, $text) = @_; + my($self, $text, $opts) = @_; + $opts->{allow_variables} = 1 unless defined $opts->{allow_variables}; # I believe this is all we should need. $text =~ s{"}{""}g; + $text = $opts->{allow_variables} + ? $self->escape_dollarsigns($text) : $self->escape_all_dollarsigns($text); + return qq{"$text"}; } +=item escape_dollarsigns + +Quote, don't escape. + +=cut + +sub escape_dollarsigns { + my($self, $text) = @_; + + # Quote dollar signs which are not starting a variable + $text =~ s{\$ (?!\() }{"\$"}gx; + + return $text; +} + + +=item escape_all_dollarsigns + +Quote, don't escape. + +=cut + +sub escape_all_dollarsigns { + my($self, $text) = @_; + + # Quote dollar signs + $text =~ s{\$}{"\$\"}gx; + + return $text; +} + =item escape_newlines =cut diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VOS.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VOS.pm index 1814a1dae4c..cdc6659b7f5 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VOS.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VOS.pm @@ -1,7 +1,7 @@ package ExtUtils::MM_VOS; use strict; -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; require ExtUtils::MM_Unix; our @ISA = qw(ExtUtils::MM_Unix); diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win32.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win32.pm index 19e462de593..43ae9a4dd5f 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win32.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win32.pm @@ -27,13 +27,21 @@ use ExtUtils::MakeMaker qw( neatvalue ); require ExtUtils::MM_Any; require ExtUtils::MM_Unix; our @ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix ); -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; $ENV{EMXSHELL} = 'sh'; # to run `commands` -my $BORLAND = $Config{'cc'} =~ /^bcc/i ? 1 : 0; -my $GCC = $Config{'cc'} =~ /\bgcc$/i ? 1 : 0; -my $DLLTOOL = $Config{'dlltool'} || 'dlltool'; +my ( $BORLAND, $GCC, $DLLTOOL ) = _identify_compiler_environment( \%Config ); + +sub _identify_compiler_environment { + my ( $config ) = @_; + + my $BORLAND = $config->{cc} =~ /^bcc/i ? 1 : 0; + my $GCC = $config->{cc} =~ /\bgcc\b/i ? 1 : 0; + my $DLLTOOL = $config->{dlltool} || 'dlltool'; + + return ( $BORLAND, $GCC, $DLLTOOL ); +} =head2 Overridden methods @@ -133,21 +141,13 @@ sub init_DIRFILESEP { : '\\'; } -=item B<init_others> - -Override some of the Unix specific commands with portable -ExtUtils::Command ones. - -Also provide defaults for LD and AR in case the %Config values aren't -set. - -LDLOADLIBS's default is changed to $Config{libs}. +=item init_tools -Adjustments are made for Borland's quirks needing -L to come first. +Override some of the slower, portable commands with Windows specific ones. =cut -sub init_others { +sub init_tools { my ($self) = @_; $self->{NOOP} ||= 'rem'; @@ -157,14 +157,33 @@ sub init_others { "\$(PERLRUN) $self->{PERL_SRC}/win32/bin/pl2bat.pl" : 'pl2bat.bat'; + $self->SUPER::init_tools; + + # Setting SHELL from $Config{sh} can break dmake. Its ok without it. + delete $self->{SHELL}; + + return; +} + + +=item init_others + +Override the default link and compile tools. + +LDLOADLIBS's default is changed to $Config{libs}. + +Adjustments are made for Borland's quirks needing -L to come first. + +=cut + +sub init_others { + my $self = shift; + $self->{LD} ||= 'link'; $self->{AR} ||= 'lib'; $self->SUPER::init_others; - # Setting SHELL from $Config{sh} can break dmake. Its ok without it. - delete $self->{SHELL}; - $self->{LDLOADLIBS} ||= $Config{libs}; # -Lfoo must come first for Borland, so we put it in LDDLFLAGS if ($BORLAND) { @@ -179,7 +198,7 @@ sub init_others { $self->{LDDLFLAGS} .= " $libpath"; } - return 1; + return; } @@ -195,6 +214,8 @@ sub init_platform { my($self) = shift; $self->{MM_Win32_VERSION} = $VERSION; + + return; } sub platform_constants { @@ -211,6 +232,36 @@ sub platform_constants { } +=item constants + +Add MAXLINELENGTH for dmake before all the constants are output. + +=cut + +sub constants { + my $self = shift; + + my $make_text = $self->SUPER::constants; + return $make_text unless $self->is_make_type('dmake'); + + # dmake won't read any single "line" (even those with escaped newlines) + # larger than a certain size which can be as small as 8k. PM_TO_BLIB + # on large modules like DateTime::TimeZone can create lines over 32k. + # So we'll crank it up to a <ironic>WHOPPING</ironic> 64k. + # + # This has to come here before all the constants and not in + # platform_constants which is after constants. + my $size = $self->{MAXLINELENGTH} || 64 * 1024; + my $prefix = qq{ +# Get dmake to read long commands like PM_TO_BLIB +MAXLINELENGTH = $size + +}; + + return $prefix . $make_text; +} + + =item special_targets Add .USESHELL target for dmake. @@ -289,17 +340,6 @@ sub dynamic_lib { my($ldfrom) = '$(LDFROM)'; my(@m); -# one thing for GCC/Mingw32: -# we try to overcome non-relocateable-DLL problems by generating -# a (hopefully unique) image-base from the dll's name -# -- BKS, 10-19-1999 - if ($GCC) { - my $dllname = $self->{BASEEXT} . "." . $self->{DLEXT}; - $dllname =~ /(....)(.{0,4})/; - my $baseaddr = unpack("n", $1 ^ $2); - $otherldflags .= sprintf("-Wl,--image-base,0x%x0000 ", $baseaddr); - } - push(@m,' # This section creates the dynamically loadable $(INST_DYNAMIC) # from $(OBJECT) and possibly $(MYEXTLIB). @@ -456,22 +496,34 @@ sub oneliner { sub quote_literal { - my($self, $text) = @_; - - # I don't know if this is correct, but it seems to work on - # Win98's command.com - $text =~ s{"}{\\"}g; - - # dmake eats '{' inside double quotes and leaves alone { outside double - # quotes; however it transforms {{ into { either inside and outside double - # quotes. It also translates }} into }. The escaping below is not - # 100% correct. + my($self, $text, $opts) = @_; + $opts->{allow_variables} = 1 unless defined $opts->{allow_variables}; + + # See: http://www.autohotkey.net/~deleyd/parameters/parameters.htm#CPP + + # Apply the Microsoft C/C++ parsing rules + $text =~ s{\\\\"}{\\\\\\\\\\"}g; # \\" -> \\\\\" + $text =~ s{(?<!\\)\\"}{\\\\\\"}g; # \" -> \\\" + $text =~ s{(?<!\\)"}{\\"}g; # " -> \" + $text = qq{"$text"} if $text =~ /[ \t]/; + + # Apply the Command Prompt parsing rules (cmd.exe) + my @text = split /("[^"]*")/, $text; + # We should also escape parentheses, but it breaks one-liners containing + # $(MACRO)s in makefiles. + s{([<>|&^@!])}{^$1}g foreach grep { !/^"[^"]*"$/ } @text; + $text = join('', @text); + + # dmake expands {{ to { and }} to }. if( $self->is_make_type('dmake') ) { $text =~ s/{/{{/g; - $text =~ s/}}/}}}/g; + $text =~ s/}/}}/g; } - return qq{"$text"}; + $text = $opts->{allow_variables} + ? $self->escape_dollarsigns($text) : $self->escape_all_dollarsigns($text); + + return $text; } diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win95.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win95.pm index c47147695e8..694655c1baf 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win95.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win95.pm @@ -2,7 +2,7 @@ package ExtUtils::MM_Win95; use strict; -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; require ExtUtils::MM_Win32; our @ISA = qw(ExtUtils::MM_Win32); diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MY.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MY.pm index bed177d210a..92d4da0a4b9 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MY.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MY.pm @@ -3,7 +3,7 @@ package ExtUtils::MY; use strict; require ExtUtils::MM; -our $VERSION = 6.56; +our $VERSION = '6.63_02'; our @ISA = qw(ExtUtils::MM); { diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Config.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Config.pm index 38b60affdda..872f8c181cf 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Config.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Config.pm @@ -2,7 +2,7 @@ package ExtUtils::MakeMaker::Config; use strict; -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; use Config (); diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Tutorial.pod b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Tutorial.pod index 8ad72649b1a..5120271979f 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Tutorial.pod +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Tutorial.pod @@ -1,6 +1,6 @@ package ExtUtils::MakeMaker::Tutorial; -our $VERSION = 0.02; +our $VERSION = 6.63_02; =head1 NAME diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mkbootstrap.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mkbootstrap.pm index 707466a98dd..b5f19ea95ce 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mkbootstrap.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mkbootstrap.pm @@ -3,7 +3,7 @@ package ExtUtils::Mkbootstrap; # There's just too much Dynaloader incest here to turn on strict vars. use strict 'refs'; -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; require Exporter; our @ISA = ('Exporter'); diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mksymlists.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mksymlists.pm index 962c67fd57f..f0860855923 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mksymlists.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mksymlists.pm @@ -10,7 +10,7 @@ use Config; our @ISA = qw(Exporter); our @EXPORT = qw(&Mksymlists); -our $VERSION = '6.56'; +our $VERSION = '6.63_02'; sub Mksymlists { my(%spec) = @_; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/testlib.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/testlib.pm index fe01beb0e1e..44832ee3531 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/testlib.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/testlib.pm @@ -3,7 +3,7 @@ package ExtUtils::testlib; use strict; use warnings; -our $VERSION = 6.56; +our $VERSION = '6.63_02'; use Cwd; use File::Spec; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/00compile.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/00compile.t index d627fb1c612..cdec1b977cf 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/00compile.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/00compile.t @@ -12,7 +12,11 @@ BEGIN { $Has_Test_Pod = eval 'use Test::Pod 0.95; 1'; } +plan skip_all => 'No MANIFEST' + unless -e "../MANIFEST"; + chdir ".."; + my $manifest = "MANIFEST"; open(my $manifest_fh, "<", $manifest) or die "Can't open $manifest: $!"; my @modules = map { m{^lib/(\S+)}; $1 } diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/INST.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/INST.t index 8a140eb0b47..b5ece3e157e 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/INST.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/INST.t @@ -46,10 +46,12 @@ my $mm = WriteMakefile( ); like( $stdout->read, qr{ Writing\ $Makefile\ for\ Big::Liar\n + (?:Writing\ MYMETA.yml\ and\ MYMETA.json\n)? Big::Liar's\ vars\n INST_LIB\ =\ \S+\n INST_ARCHLIB\ =\ \S+\n Writing\ $Makefile\ for\ Big::Dummy\n + (?:Writing\ MYMETA.yml\ and\ MYMETA.json\n)? }x ); undef $stdout; untie *STDOUT; @@ -126,10 +128,12 @@ $mm = WriteMakefile( ); like( $stdout->read, qr{ Writing\ $Makefile\ for\ Big::Liar\n + (?:Writing\ MYMETA.yml\ and\ MYMETA.json\n)? Big::Liar's\ vars\n INST_LIB\ =\ \S+\n INST_ARCHLIB\ =\ \S+\n Writing\ $Makefile\ for\ Big::Dummy\n + (?:Writing\ MYMETA.yml\ and\ MYMETA.json\n)? }x ); undef $stdout; untie *STDOUT; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t index 8bb9db8a1da..5bd0a5dd80f 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t @@ -50,10 +50,12 @@ my $mm = WriteMakefile( like( $stdout->read, qr{ Writing\ $Makefile\ for\ Big::Liar\n + (?:Writing\ MYMETA.yml\ and\ MYMETA.json\n)? Big::Liar's\ vars\n INST_LIB\ =\ \S+\n INST_ARCHLIB\ =\ \S+\n Writing\ $Makefile\ for\ Big::Dummy\n + (?:Writing\ MYMETA.yml\ and\ MYMETA.json\n)? }x ); is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' ); @@ -78,10 +80,12 @@ $mm = WriteMakefile( ); like( $stdout->read, qr{ Writing\ $Makefile\ for\ Big::Liar\n + (?:Writing\ MYMETA.yml\ and\ MYMETA.json\n)? Big::Liar's\ vars\n INST_LIB\ =\ \S+\n INST_ARCHLIB\ =\ \S+\n Writing\ $Makefile\ for\ Big::Dummy\n + (?:Writing\ MYMETA.yml\ and\ MYMETA.json\n)? }x ); undef $stdout; untie *STDOUT; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/META_for_testing.json b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/META_for_testing.json new file mode 100644 index 00000000000..c0ba55b9a04 --- /dev/null +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/META_for_testing.json @@ -0,0 +1,60 @@ +{ + "abstract" : "Create a module Makefile", + "author" : [ + "Michael G Schwern <schwern@pobox.com>" + ], + "dynamic_config" : 1, + "generated_by" : "ExtUtils::MakeMaker version 6.5707, CPAN::Meta::Converter version 2.110580", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "ExtUtils-MakeMaker", + "no_index" : { + "directory" : [ + "t", + "inc" + ], + "package" : [ + "DynaLoader", + "in" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "Data::Dumper" : 0 + } + }, + "configure" : { + "requires" : {} + }, + "runtime" : { + "requires" : { + "DirHandle" : 0, + "File::Basename" : 0, + "File::Spec" : "0.8", + "Pod::Man" : 0, + "perl" : "5.006" + } + } + }, + "release_status" : "testing", + "resources" : { + "bugtracker" : { + "web" : "http://rt.cpan.org/NoAuth/Bugs.html?Dist=ExtUtils-MakeMaker" + }, + "homepage" : "http://makemaker.org", + "license" : [ + "http://dev.perl.org/licenses/" + ], + "repository" : { + "url" : "http://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker" + }, + "x_MailingList" : "makemaker@perl.org" + }, + "version" : "6.57_07" +} diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/META_for_testing.yml b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/META_for_testing.yml new file mode 100644 index 00000000000..bda66a12eb4 --- /dev/null +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/META_for_testing.yml @@ -0,0 +1,34 @@ +--- +abstract: 'Create a module Makefile' +author: + - 'Michael G Schwern <schwern@pobox.com>' +build_requires: + Data::Dumper: 0 +configure_requires: {} +dynamic_config: 1 +generated_by: 'ExtUtils::MakeMaker version 6.5707, CPAN::Meta::Converter version 2.110580' +license: perl +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: ExtUtils-MakeMaker +no_index: + directory: + - t + - inc + package: + - DynaLoader + - in +requires: + DirHandle: 0 + File::Basename: 0 + File::Spec: 0.8 + Pod::Man: 0 + perl: 5.006 +resources: + bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=ExtUtils-MakeMaker + homepage: http://makemaker.org + license: http://dev.perl.org/licenses/ + repository: http://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker + x_MailingList: makemaker@perl.org +version: 6.57_07 diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/META_for_testing_tricky_version.yml b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/META_for_testing_tricky_version.yml new file mode 100644 index 00000000000..04d809a89bc --- /dev/null +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/META_for_testing_tricky_version.yml @@ -0,0 +1,23 @@ +--- #YAML:1.0 +name: GD-Barcode-Code93 +version: 1.4 +abstract: Code 93 implementation of GD::Barcode family +author: + - Chris DiMartino +license: unknown +distribution_type: module +configure_requires: + ExtUtils::MakeMaker: 0 +build_requires: + ExtUtils::MakeMaker: 0 +requires: + GD: 0 + GD::Barcode: 0 +no_index: + directory: + - t + - inc +generated_by: ExtUtils::MakeMaker version 6.55_02 +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_Cygwin.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_Cygwin.t index 9640ac7fa85..b518c8c79ed 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_Cygwin.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_Cygwin.t @@ -115,8 +115,10 @@ SKIP: { } # Our copy of Perl (with a unix-path) should always be executable. -ok(MM->maybe_command($Config{perlpath}), qq{'$Config{perlpath}' should be executable}); - +SKIP: { + skip "The Perl may not be installed yet when in core" if $ENV{PERL_CORE}; + ok(MM->maybe_command($Config{perlpath}), qq{'$Config{perlpath}' should be executable}); +} package FakeOut; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_Win32.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_Win32.t index 39475ae3b4b..4bc030d9021 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_Win32.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_Win32.t @@ -9,11 +9,9 @@ use strict; use Test::More; BEGIN { - if ($^O =~ /MSWin32/i) { - plan tests => 49; - } else { - plan skip_all => 'This is not Win32'; - } + if ($^O !~ /MSWin32/i) { + plan skip_all => 'This is not Win32'; + } } use Config; @@ -104,13 +102,20 @@ delete $ENV{PATHEXT} unless $had_pathext; 'catfile() eq File::Spec->catfile()' ); } -# init_others(): check if all keys are created and set? -# qw( TOUCH CHMOD CP RM_F RM_RF MV NOOP TEST_F LD AR LDLOADLIBS DEV_NUL ) -{ - my $mm_w32 = bless( { BASEEXT => 'Foo' }, 'MM' ); +# init_tools(): check if all keys are created and set? +note "init_tools creates expected keys"; { + my $mm_w32 = bless( { BASEEXT => 'Foo', MAKE => $Config{make} }, 'MM' ); + $mm_w32->init_tools(); + my @keys = qw( TOUCH CHMOD CP RM_F RM_RF MV NOOP NOECHO ECHO ECHO_N TEST_F DEV_NULL ); + for my $key ( @keys ) { + ok( $mm_w32->{ $key }, "init_tools: $key" ); + } +} + +note "init_others creates expected keys"; { + my $mm_w32 = bless( { BASEEXT => 'Foo', MAKE => $Config{make} }, 'MM' ); $mm_w32->init_others(); - my @keys = qw( TOUCH CHMOD CP RM_F RM_RF MV NOOP - TEST_F LD AR LDLOADLIBS DEV_NULL ); + my @keys = qw( LD AR LDLOADLIBS ); for my $key ( @keys ) { ok( $mm_w32->{ $key }, "init_others: $key" ); } @@ -124,6 +129,7 @@ delete $ENV{PATHEXT} unless $had_pathext; NAME => 'TestMM_Win32', VERSION => '1.00', PM => { 'MM_Win32.pm' => 1 }, + MAKE => $Config{make}, }, 'MM'; # XXX Hack until we have a proper init method. @@ -184,7 +190,7 @@ delete $ENV{PATHEXT} unless $had_pathext; { my $path = 'c:\\Program Files/SomeApp\\Progje.exe'; is( $MM->canonpath( $path ), File::Spec->canonpath( $path ), - 'canonpath() eq File::Spec->canonpath' ); + 'canonpath() eq File::Spec->canonpath' ); } # perl_script() @@ -234,28 +240,28 @@ unlink "${script_name}$script_ext" if -f "${script_name}$script_ext"; SKIP: { skip("Not using 'nmake'", 2) unless $Config{make} eq 'nmake'; ok( $MM->is_make_type('nmake'), '->is_make_type(nmake) true' ); - ok( ! $MM->is_make_type('dmake'), '->is_make_type(dmake) false' ); + ok( ! $MM->is_make_type('dmake'), '->is_make_type(dmake) false' ); } # Check for literal nmake SKIP: { skip("Not using /nmake/", 2) unless $Config{make} =~ /nmake/; ok( $MM->is_make_type('nmake'), '->is_make_type(nmake) true' ); - ok( ! $MM->is_make_type('dmake'), '->is_make_type(dmake) false' ); + ok( ! $MM->is_make_type('dmake'), '->is_make_type(dmake) false' ); } # Check for literal dmake SKIP: { skip("Not using 'dmake'", 2) unless $Config{make} eq 'dmake'; ok( $MM->is_make_type('dmake'), '->is_make_type(dmake) true' ); - ok( ! $MM->is_make_type('nmake'), '->is_make_type(nmake) false' ); + ok( ! $MM->is_make_type('nmake'), '->is_make_type(nmake) false' ); } # Check for literal dmake SKIP: { skip("Not using /dmake/", 2) unless $Config{make} =~ /dmake/; ok( $MM->is_make_type('dmake'), '->is_make_type(dmake) true' ); - ok( ! $MM->is_make_type('nmake'), '->is_make_type(nmake) false' ); + ok( ! $MM->is_make_type('nmake'), '->is_make_type(nmake) false' ); } } @@ -272,36 +278,110 @@ unlink "${script_name}$script_ext" if -f "${script_name}$script_ext"; is( $MM->pasthru(), $pastru, 'pasthru()' ); } -package FakeOut; +# _identify_compiler_environment() +{ + sub _run_cc_id { + my ( $config ) = @_; -sub TIEHANDLE { - bless(\(my $scalar), $_[0]); -} + $config->{cc} ||= ''; -sub PRINT { - my $self = shift; - $$self .= shift; -} + my @cc_env = ExtUtils::MM_Win32::_identify_compiler_environment( $config ); -__END__ + my %cc_env = ( BORLAND => $cc_env[0], GCC => $cc_env[1], DLLTOOL => $cc_env[2] ); -=head1 NAME + return \%cc_env; + } -MM_Win32.t - Tests for ExtUtils::MM_Win32 + sub _check_cc_id_value { + my ( $test ) = @_; -=head1 TODO + my $res = _run_cc_id( $test->{config} ); - - Methods to still be checked: - # static_lib() should look into that - # dynamic_bs() should look into that - # dynamic_lib() should look into that - # xs_o() should look into that - # top_targets() should look into that - # dist_ci() should look into that - # dist_core() should look into that + fail( "unknown key '$test->{key}'" ) if !exists $res->{$test->{key}}; + my $val = $res->{$test->{key}}; -=head1 AUTHOR + is( $val, $test->{expect}, $test->{desc} ); + + return; + } + + my @tests = ( + { + config => {}, + key => 'DLLTOOL', expect => 'dlltool', + desc => 'empty dlltool defaults to "dlltool"', + }, + { + config => { dlltool => 'test' }, + key => 'DLLTOOL', expect => 'test', + desc => 'dlltool value is taken over verbatim from %Config, if set', + }, + { + config => {}, + key => 'GCC', expect => 0, + desc => 'empty cc is not recognized as gcc', + }, + { + config => { cc => 'gcc' }, + key => 'GCC', expect => 1, + desc => 'plain "gcc" is recognized', + }, + { + config => { cc => 'C:/MinGW/bin/gcc.exe' }, + key => 'GCC', expect => 1, + desc => 'fully qualified "gcc" is recognized', + }, + { + config => { cc => 'C:/MinGW/bin/gcc-1.exe' }, + key => 'GCC', expect => 1, + desc => 'dash-extended gcc is recognized', + }, + { + config => { cc => 'C:/MinGW/bin/gcc_1.exe' }, + key => 'GCC', expect => 0, + desc => 'underscore-extended gcc is not recognized', + }, + { + config => {}, + key => 'BORLAND', expect => 0, + desc => 'empty cc is not recognized as borland', + }, + { + config => { cc => 'bcc' }, + key => 'BORLAND', expect => 1, + desc => 'plain "bcc" is recognized', + }, + { + config => { cc => 'C:/Borland/bin/bcc.exe' }, + key => 'BORLAND', expect => 0, + desc => 'fully qualified borland cc is not recognized', + }, + { + config => { cc => 'bcc-1.exe' }, + key => 'BORLAND', expect => 1, + desc => 'dash-extended borland cc is recognized', + }, + { + config => { cc => 'bcc_1.exe' }, + key => 'BORLAND', expect => 1, + desc => 'underscore-extended borland cc is recognized', + }, + ); + + _check_cc_id_value($_) for @tests; +} -20011228 Abe Timmerman <abe@ztreet.demon.nl> -=cut +done_testing; + + +package FakeOut; + +sub TIEHANDLE { + bless(\(my $scalar), $_[0]); +} + +sub PRINT { + my $self = shift; + $$self .= shift; +} diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/basic.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/basic.t index 1842a1c8396..fb374c0c9b8 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/basic.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/basic.t @@ -11,7 +11,7 @@ use strict; use Config; use ExtUtils::MakeMaker; -use Test::More tests => 80; +use Test::More tests => 171; use MakeMaker::Test::Utils; use MakeMaker::Test::Setup::BFD; use File::Find; @@ -31,8 +31,8 @@ $| = 1; ok( setup_recurs(), 'setup' ); END { - ok( chdir File::Spec->updir ); - ok( teardown_recurs(), 'teardown' ); + ok chdir File::Spec->updir or die; + ok teardown_recurs, "teardown"; } ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) || @@ -73,7 +73,6 @@ my $make = make_run(); END { unlink 'MANIFEST'; } - my $ppd_out = run("$make ppd"); is( $?, 0, ' exited normally' ) || diag $ppd_out; ok( open(PPD, 'Big-Dummy.ppd'), ' .ppd file generated' ); @@ -82,7 +81,8 @@ my $ppd_html; close PPD; like( $ppd_html, qr{^<SOFTPKG NAME="Big-Dummy" VERSION="0.01">}m, ' <SOFTPKG>' ); -like( $ppd_html, qr{^\s*<ABSTRACT>Try "our" hot dog's</ABSTRACT>}m, +like( $ppd_html, + qr{^\s*<ABSTRACT>Try "our" hot dog's, \$andwiche\$ and \$\(ub\)\$!</ABSTRACT>}m, ' <ABSTRACT>'); like( $ppd_html, qr{^\s*<AUTHOR>Michael G Schwern <schwern\@pobox.com></AUTHOR>}m, @@ -229,64 +229,163 @@ use ExtUtils::Manifest qw(maniread); my $distdir = 'Big-Dummy-0.01'; $distdir =~ s/\./_/g if $Is_VMS; my $meta_yml = "$distdir/META.yml"; +my $mymeta_yml = "$distdir/MYMETA.yml"; +my $meta_json = "$distdir/META.json"; +my $mymeta_json = "$distdir/MYMETA.json"; + +note "META file validity"; { + require CPAN::Meta; + + ok( !-f 'META.yml', 'META.yml not written to source dir' ); + ok( -f $meta_yml, 'META.yml written to dist dir' ); + ok( !-e "META_new.yml", 'temp META.yml file not left around' ); + + ok( -f 'MYMETA.yml', 'MYMETA.yml is written to source dir' ); + ok( -f $mymeta_yml, 'MYMETA.yml is written to dist dir on disttest' ); + + ok( !-f 'META.json', 'META.json not written to source dir' ); + ok( -f $meta_json, 'META.json written to dist dir' ); + ok( !-e "META_new.json", 'temp META.json file not left around' ); + + ok( -f 'MYMETA.json', 'MYMETA.json is written to source dir' ); + ok( -f $mymeta_json, 'MYMETA.json is written to dist dir on disttest' ); + + for my $case ( + ['META.yml', $meta_yml], + ['MYMETA.yml', $mymeta_yml], + ['META.json', $meta_json], + ['MYMETA.json', $mymeta_json], + ['MYMETA.yml', 'MYMETA.yml'], + ['MYMETA.json', 'MYMETA.json'], + ) { + my ($label, $meta_name) = @$case; + ok( + my $obj = eval { + CPAN::Meta->load_file($meta_name, {lazy_validation => 0}) + }, + "$label validates" + ); + my $is = sub { + my ($m,$e) = @_; + is($obj->$m, $e, "$label -> $m") + }; + my $is_list = sub { + my ($m,$e) = @_; + is_deeply([$obj->$m], $e, "$label -> $m") + }; + my $is_map = sub { + my ($m,$e) = @_; + is_deeply($obj->$m, $e, "$label -> $m") + }; + $is->( name => "Big-Dummy" ); + $is->( version => "0.01" ); + $is->( abstract => q{Try "our" hot dog's, $andwiche$ and $(ub)$!} ); + $is_list->( licenses => [q{unknown}] ); + $is_list->( authors => [ q{Michael G Schwern <schwern@pobox.com>} ] ); + $is_map->( prereqs => { + configure => { + requires => { + 'ExtUtils::MakeMaker' => 0 + }, + }, + build => { + requires => { + 'warnings' => 0 + } + }, + runtime => { + requires => { + 'strict' => 0 + } + }, + } + ); + $is_map->( + no_index => { + directory => [qw/t inc/], + } + ); + $is->( dynamic_config => ($label =~ /MYMETA/) ? 0 : 1 ); + } -ok( !-f 'META.yml', 'META.yml not written to source dir' ); -ok( -f $meta_yml, 'META.yml written to dist dir' ); -ok( !-e "META_new.yml", 'temp META.yml file not left around' ); - -SKIP: { - # META.yml spec 1.4 was added in 0.11 - skip "Test::YAML::Meta >= 0.11 required", 2 - unless eval { require Test::YAML::Meta } and - Test::YAML::Meta->VERSION >= 0.11; - - Test::YAML::Meta::meta_spec_ok($meta_yml); + my $manifest = maniread("$distdir/MANIFEST"); + # VMS is non-case preserving, so we can't know what the MANIFEST will + # look like. :( + _normalize($manifest); + is( $manifest->{'meta.yml'}, 'Module YAML meta-data (added by MakeMaker)', + "MANIFEST has META.yml" + ); + is( $manifest->{'meta.json'}, 'Module JSON meta-data (added by MakeMaker)', + "MANFIEST has META.json" + ); + + # Test NO_META META.yml suppression + for my $f ( $meta_yml, $meta_json, 'MYMETA.yml', 'MYMETA.json' ) { + 1 while unlink $f; + } + ok( !-f $meta_yml, 'META.yml deleted' ); + ok( !-f 'MYMETA.yml','MYMETA.yml deleted' ); + ok( !-f $meta_json, 'META.json deleted' ); + ok( !-f 'MYMETA.json','MYMETA.json deleted' ); + + @mpl_out = run(qq{$perl Makefile.PL "NO_META=1"}); + ok( -f 'MYMETA.yml', 'MYMETA.yml generation not suppressed by NO_META' ); + ok( -f 'MYMETA.json', 'MYMETA.json generation not suppressed by NO_META' ); + cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out); + ok( !-f $meta_yml, 'META.yml generation suppressed by NO_META' ); + ok( !-f $meta_json, 'META.json generation suppressed by NO_META' ); + my $distdir_out = run("$make distdir"); + is( $?, 0, 'distdir' ) || diag($distdir_out); + ok( !-f $meta_yml, 'META.yml generation suppressed by NO_META' ); + ok( !-f $meta_json, 'META.json generation suppressed by NO_META' ); + + for my $f ( 'MYMETA.yml', 'MYMETA.json' ) { + 1 while unlink $f; + } + ok( !-f 'MYMETA.yml','MYMETA.yml deleted' ); + ok( !-f 'MYMETA.json','MYMETA.json deleted' ); + + @mpl_out = run(qq{$perl Makefile.PL "NO_MYMETA=1"}); + cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out); + $distdir_out = run("$make distdir"); + is( $?, 0, 'distdir' ) || diag($distdir_out); + ok( !-f 'MYMETA.yml','MYMETA.yml generation suppressed by NO_MYMETA' ); + ok( !-f 'MYMETA.json','MYMETA.json generation suppressed by NO_MYMETA' ); + ok( -f $meta_yml, 'META.yml generation not suppressed by NO_MYMETA' ); + ok( -f $meta_json, 'META.json generation not suppressed by NO_MYMETA' ); + + # Test MYMETA really comes from META except for prereqs + for my $f ( $meta_yml, $meta_json, 'MYMETA.yml', 'MYMETA.json' ) { + 1 while unlink $f; + } + @mpl_out = run(qq{$perl Makefile.PL}); + cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out); + $distdir_out = run("$make distdir"); + is( $?, 0, 'distdir' ) || diag($distdir_out); + ok( -f $meta_yml, 'META.yml generated in distdir' ); + ok( -f $meta_json, 'META.json generated in distdir' ); + ok( ! -f $mymeta_yml, 'MYMETA.yml not yet generated in distdir' ); + ok( ! -f $mymeta_json, 'MYMETA.json generated in distdir' ); + my $edit_meta = CPAN::Meta->load_file($meta_json)->as_struct; + $edit_meta->{abstract} = "New abstract"; + my $meta_obj = CPAN::Meta->new($edit_meta); + is( $meta_obj->abstract, "New abstract", "MYMETA abstract from META, not Makefile.PL"); + ok( $meta_obj->save($meta_json), "Saved edited META.json in distdir" ); + ok( $meta_obj->save($meta_yml, {version => 1.4}), "Saved edited META.yml in distdir"); + ok( chdir $distdir ); + ok( -f 'META.yml', 'META.yml confirmed in distdir' ); + ok( -f 'META.json', 'META.json confirmed in distdir' ); + @mpl_out = run(qq{$perl Makefile.PL}); + cmp_ok( $?, '==', 0, 'Makefile.PL in distdir exited with zero' ) || diag(@mpl_out); + ok( chdir File::Spec->updir ); + ok( -f $mymeta_yml, 'MYMETA.yml generated in distdir' ); + ok( -f $mymeta_json, 'MYMETA.json generated in distdir' ); + $meta_obj = CPAN::Meta->load_file($meta_json); + is( $meta_obj->abstract, "New abstract", "META abstract is same as was saved"); + $meta_obj = CPAN::Meta->load_file($mymeta_json); + is( $meta_obj->abstract, "New abstract", "MYMETA abstract from META, not Makefile.PL"); } -ok open META, $meta_yml or diag $!; -my $meta = join '', <META>; -ok close META; - -is $meta, <<"END"; ---- #YAML:1.0 -name: Big-Dummy -version: 0.01 -abstract: Try "our" hot dog's -author: - - Michael G Schwern <schwern\@pobox.com> -license: unknown -distribution_type: module -configure_requires: - ExtUtils::MakeMaker: 0 -build_requires: - warnings: 0 -requires: - strict: 0 -no_index: - directory: - - t - - inc -generated_by: ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 -END - -my $manifest = maniread("$distdir/MANIFEST"); -# 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 (added by MakeMaker)' ); - - -# Test NO_META META.yml suppression -unlink $meta_yml; -ok( !-f $meta_yml, 'META.yml deleted' ); -@mpl_out = run(qq{$perl Makefile.PL "NO_META=1"}); -cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out); -my $distdir_out = run("$make distdir"); -is( $?, 0, 'distdir' ) || diag($distdir_out); -ok( !-f $meta_yml, 'META.yml generation suppressed by NO_META' ); # Make sure init_dirscan doesn't go into the distdir diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/echo.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/echo.t new file mode 100644 index 00000000000..04fcc4322d3 --- /dev/null +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/echo.t @@ -0,0 +1,114 @@ +#!/usr/bin/perl -w + +BEGIN { + unshift @INC, 't/lib'; +} + +use strict; +use warnings; + +use Carp; +use Config; +use ExtUtils::MM; +use MakeMaker::Test::Utils; +use File::Temp; +use Cwd 'abs_path'; + +use Test::More; + + +#--------------------- Setup + +my $cwd = abs_path; +my $perl = which_perl; +my $make = make_run(); +my $mm = bless { NAME => "Foo", MAKE => $Config{make}, PARENT_NAME => '' }, "MM"; +$mm->init_INST; # *PERLRUN needs INIT_* +$mm->init_PERL; # generic ECHO needs ABSPERLRUN +$mm->init_tools; # need ECHO + +# Run Perl with the currently installing MakeMaker +$mm->{$_} .= q[ "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"] for qw( PERLRUN FULLPERLRUN ABSPERLRUN ); + +#------------------- Testing functions + +sub test_for_echo { + my($calls, $want, $name) = @_; + my $output_file = $calls->[0][1]; + + note "Testing $name"; + + my $dir = File::Temp->newdir(); + chdir $dir; + note "Temp dir: $dir"; + + # Write a Makefile to test the output of echo + { + open my $makefh, ">", "Makefile" or croak "Can't open Makefile: $!"; + print $makefh "FOO=42\n"; # a variable to test with + + for my $key (qw(INST_ARCHLIB INST_LIB PERL ABSPERL ABSPERLRUN ECHO)) { + print $makefh "$key=$mm->{$key}\n"; + } + + print $makefh "all :\n"; + for my $args (@$calls) { + print $makefh map { "\t$_\n" } $mm->echo(@$args); + } + } + + # Run the Makefile + ok run($make), "make: $name"; + + # Check it made the file in question + ok -e $output_file, "$output_file exists"; + open my $fh, "<", $output_file or croak "Can't open $output_file: $!"; + is join("", <$fh>), $want, "contents"; + + chdir $cwd; +} + + +#---------------- Tests begin + +test_for_echo( + [["Foo", "bar.txt"]], + "Foo\n", + "simple echo" +); + +test_for_echo( + [["Foo\nBar\nBaz Biff\n", "something.txt"]], + "Foo\nBar\nBaz Biff\n", + "multiline echo" +); + +test_for_echo( + [['$something$', "something.txt"]], + '$something$'."\n", + "dollar signs escaped" +); + +test_for_echo( + [['$(something)', "something.txt"]], + '$(something)'."\n", + "variables escaped" +); + +test_for_echo( + [['Answer: $(FOO)', "bar.txt", { allow_variables => 1 }]], + "Answer: 42\n", + "allow_variables" +); + +test_for_echo( + [ + ["Foo", "bar.txt"], + ["Bar", "bar.txt", { append => 1 }], + ["Baz", "bar.txt", 1], + ], + "Foo\nBar\nBaz\n", + "append" +); + +done_testing; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/fixin.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/fixin.t index de5866a5c34..ab3a177b389 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/fixin.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/fixin.t @@ -64,6 +64,8 @@ sub test_fixin { # A simple test of fixin +# On VMS, the shebang line comes after the startperl business. +my $shb_line_num = $^O eq 'VMS' ? 2 : 0; test_fixin(<<END, #!/foo/bar/perl -w @@ -71,8 +73,8 @@ blah blah blah END sub { my @lines = @_; - unlike $lines[0], qr[/foo/bar/perl], "#! replaced"; - like $lines[0], qr[ -w\b], "switch retained"; + unlike $lines[$shb_line_num], qr[/foo/bar/perl], "#! replaced"; + like $lines[$shb_line_num], qr[ -w\b], "switch retained"; # In between might be that "not running under some shell" madness. @@ -90,8 +92,8 @@ END sub { my @lines = @_; - unlike $lines[0], qr[/foo/bar/perl5.8.8], "#! replaced"; - like $lines[0], qr[ -w\b], "switch retained"; + unlike $lines[$shb_line_num], qr[/foo/bar/perl5.8.8], "#! replaced"; + like $lines[$shb_line_num], qr[ -w\b], "switch retained"; # In between might be that "not running under some shell" madness. @@ -101,17 +103,20 @@ END # fixin shouldn't pick this up. -test_fixin(<<END, +SKIP: { + skip "Not relevant on VMS", 4 if $^O eq 'VMS'; + test_fixin(<<END, #!/foo/bar/perly -w blah blah blah END - sub { - is join("", @_), <<END; + sub { + is join("", @_), <<END; #!/foo/bar/perly -w blah blah blah END - } -); + } + ); +} diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/BFD.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/BFD.pm index 82dd0309387..8df77d47845 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/BFD.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/BFD.pm @@ -19,7 +19,7 @@ $VERSION = 0.01; =head1 NAME -Big::Dummy - Try "our" hot dog's +Big::Dummy - Try "our" hot dog's, $andwiche$ and $(ub)$! =cut diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/SAS.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/SAS.pm new file mode 100644 index 00000000000..04d9bd3259a --- /dev/null +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/SAS.pm @@ -0,0 +1,67 @@ +package MakeMaker::Test::Setup::SAS; + +@ISA = qw(Exporter); +require Exporter; +@EXPORT = qw(setup_recurs teardown_recurs); + +use strict; +use File::Path; +use File::Basename; + +our $dirname='Multiple-Authors'; +my %Files = ( + $dirname.'/Makefile.PL' => <<'END', +use ExtUtils::MakeMaker; + +WriteMakefile( + NAME => 'Multiple::Authors', + AUTHOR => ['John Doe <jd@example.com>', 'Jane Doe <jd@example.com>'], + VERSION_FROM => 'lib/Multiple/Authors.pm', + PREREQ_PM => { strict => 0 }, +); +END + + $dirname.'/lib/Multiple/Authors.pm' => <<'END', +package Multiple::Authors; + +$VERSION = 0.05; + +=head1 NAME + +Multiple::Authors - several authors + +=cut + +1; +END + +); + + +sub setup_recurs { + while(my($file, $text) = each %Files) { + # Convert to a relative, native file path. + $file = File::Spec->catfile(File::Spec->curdir, split m{\/}, $file); + + my $dir = dirname($file); + mkpath $dir; + open(FILE, ">$file") || die "Can't create $file: $!"; + print FILE $text; + close FILE; + } + + return 1; +} + +sub teardown_recurs { + foreach my $file (keys %Files) { + my $dir = dirname($file); + if( -e $dir ) { + rmtree($dir) || return; + } + } + return 1; +} + + +1; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm index b4e450407f0..9a6ab60e35c 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm @@ -7,8 +7,9 @@ use Config; require Exporter; our @ISA = qw(Exporter); -our $Is_VMS = $^O eq 'VMS'; -our $Is_MacOS = $^O eq 'MacOS'; +our $Is_VMS = $^O eq 'VMS'; +our $Is_MacOS = $^O eq 'MacOS'; +our $Is_FreeBSD = $^O eq 'freebsd'; our @EXPORT = qw(which_perl perl_lib makefile_name makefile_backup make make_run run make_macro calibrate_mtime @@ -32,11 +33,20 @@ our @EXPORT = qw(which_perl perl_lib makefile_name makefile_backup MAKEFLAGS ); + my %default_env_keys; + + # Inform the BSDPAN hacks not to register modules installed for testing. + $default_env_keys{PORTOBJFORMAT} = 1 if $Is_FreeBSD; + # Remember the ENV values because on VMS %ENV is global # to the user, not the process. my %restore_env_keys; sub clean_env { + for my $key (keys %default_env_keys) { + $ENV{$key} = $default_env_keys{$key} unless $ENV{$key}; + } + for my $key (@delete_env_keys) { if( exists $ENV{$key} ) { $restore_env_keys{$key} = delete $ENV{$key}; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/meta_convert.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/meta_convert.t new file mode 100644 index 00000000000..84875bab1b3 --- /dev/null +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/meta_convert.t @@ -0,0 +1,127 @@ +BEGIN { + chdir '..' if -d '../t'; + unshift @INC, 't/lib'; + use lib 'lib'; +} + +use strict; +use warnings; +use Test::More 'no_plan'; + +require ExtUtils::MM_Any; + +sub ExtUtils::MM_Any::quote_literal { $_[1] } + +my $new_mm = sub { + return bless { ARGS => {@_}, @_ }, 'ExtUtils::MM_Any'; +}; + +my $warn_ok = sub { + my($code, $want, $name) = @_; + + my @have; + my $ret; + { + local $SIG{__WARN__} = sub { push @have, @_ }; + $ret = $code->(); + } + + like join("", @have), $want, $name; + return $ret; +}; + +my $version_regex = qr/version: ''/; +my $version_action = "they're converted to empty string"; + + +note "Filename as version"; { + my $mm = $new_mm->( + DISTNAME => 'Net::FTP::Recursive', + VERSION => 'Recursive.pm', + ); + + my $res = $warn_ok->( + sub { eval { $mm->metafile_target } }, + qr{Can't parse version 'Recursive.pm'} + ); + ok $res, 'we know how to deal with bogus versions defined in Makefile.PL'; + like $res, $version_regex, $version_action; +} + + +note "'undef' version from parse_version"; { + my $mm = $new_mm->( + DISTNAME => 'Image::Imgur', + VERSION => 'undef', + ); + my $res = $warn_ok->( + sub { eval { $mm->metafile_target } }, + qr{Can't parse version 'undef'} + ); + ok $res, q|when there's no $VERSION in Module.pm, $self->{VERSION} = 'undef'; via MM_Unix::parse_version and we know how to deal with that|; + like $res, $version_regex, $version_action; +} + + +note "x.y.z version"; { + my $mm = $new_mm->( + DISTNAME => 'SQL::Library', + VERSION => 0.0.3, + ); + + # It would be more useful if the warning got translated to visible characters + my $res = $warn_ok->( + sub { eval { $mm->metafile_target } }, + qr{Can't parse version '\x00\x00\x03'} + ); + ok $res, q|we know how to deal with our $VERSION = 0.0.3; style versions defined in the module|; + like $res, $version_regex, $version_action; +} + + +note ".5 version"; { + my $mm = $new_mm->( + DISTNAME => 'Array::Suffix', + VERSION => '.5', + ); + my $res = $warn_ok->( + sub { eval { $mm->metafile_target } }, + qr{Can't parse version '.5'} + ); + ok $res, q|we know how to deal with our $VERSION = '.5'; style versions defined in the module|; + like $res, $version_regex, $version_action; +} + + +note "Non-camel case metadata"; { + my $mm = $new_mm->( + DISTNAME => 'Attribute::Signature', + META_MERGE => { + resources => { + repository => 'http://github.com/chorny/Attribute-Signature', + 'Repository-clone' => 'git://github.com/chorny/Attribute-Signature.git', + }, + }, + ); + my $res = eval { $mm->metafile_target }; + ok $res, q|we know how to deal with non-camel-cased custom meta resource keys defined in Makefile.PL|; + like $res, qr/x_Repositoryclone:/, "they're camel-cased"; +} + + +note "version object in provides"; { + my $mm = $new_mm->( + DISTNAME => 'CPAN::Testers::ParseReport', + VERSION => '2.34', + META_ADD => { + provides => { + "CPAN::Testers::ParseReport" => { + version => version->declare("v1.2.3"), + file => "lib/CPAN/Testers/ParseReport.pm" + } + } + }, + ); + my $res = eval { $mm->metafile_target }; + like $res, qr{version: \s* v1.2.3}x; +} diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/metafile_data.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/metafile_data.t index 7e970ceb3db..4c8fa76231b 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/metafile_data.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/metafile_data.t @@ -3,12 +3,51 @@ BEGIN { } use strict; -use Test::More tests => 7; +use Test::More tests => 19; use Data::Dumper; +use File::Temp; +use Cwd; +use Parse::CPAN::Meta; require ExtUtils::MM_Any; +sub in_dir(&;$) { + my $code = shift; + my $dir = shift || File::Temp->newdir; + + # chdir to the new directory + my $orig_dir = cwd(); + chdir $dir or die "Can't chdir to $dir: $!"; + + # Run the code, but trap the error so we can chdir back + my $return; + my $ok = eval { $return = $code->(); 1; }; + my $err = $@; + + # chdir back + chdir $orig_dir or die "Can't chdir to $orig_dir: $!"; + + # rethrow if necessary + die $err unless $ok; + + return $return; +} + +sub mymeta_ok { + my($have, $want, $name) = @_; + + local $Test::Builder::Level = $Test::Builder::Level + 1; + + my $have_gen = delete $have->{generated_by}; + my $want_gen = delete $want->{generated_by}; + + is_deeply $have, $want, $name; + like $have_gen, qr{CPAN::Meta}, "CPAN::Meta mentioned in the generated_by"; + + return; +} + my $new_mm = sub { return bless { ARGS => {@_}, @_ }, 'ExtUtils::MM_Any'; }; @@ -22,12 +61,13 @@ my $new_mm = sub { }, ); - is_deeply [$mm->metafile_data], [ + is_deeply {$mm->metafile_data}, { name => 'Foo-Bar', version => 1.23, - abstract => undef, + abstract => 'unknown', author => [], license => 'unknown', + dynamic_config => 1, distribution_type => 'module', configure_requires => { @@ -46,15 +86,16 @@ my $new_mm = sub { url => 'http://module-build.sourceforge.net/META-spec-v1.4.html', version => 1.4 }, - ]; + }; - is_deeply [$mm->metafile_data({}, { no_index => { directory => [qw(foo)] } })], [ + is_deeply {$mm->metafile_data({}, { no_index => { directory => [qw(foo)] } })}, { name => 'Foo-Bar', version => 1.23, - abstract => undef, + abstract => 'unknown', author => [], license => 'unknown', + dynamic_config => 1, distribution_type => 'module', configure_requires => { @@ -73,7 +114,7 @@ my $new_mm = sub { url => 'http://module-build.sourceforge.net/META-spec-v1.4.html', version => 1.4 }, - ], 'rt.cpan.org 39348'; + }, 'rt.cpan.org 39348'; } @@ -81,14 +122,14 @@ my $new_mm = sub { my $mm = $new_mm->( DISTNAME => 'Foo-Bar', VERSION => 1.23, - AUTHOR => 'Some Guy', + AUTHOR => ['Some Guy'], PREREQ_PM => { Foo => 2.34, Bar => 4.56, }, ); - is_deeply [$mm->metafile_data( + is_deeply {$mm->metafile_data( { configure_requires => { Stuff => 2.34 @@ -101,13 +142,14 @@ my $new_mm = sub { }, wibble => 23 }, - )], - [ + )}, + { name => 'Foo-Bar', version => 1.23, - abstract => undef, + abstract => 'unknown', author => ['Some Guy'], license => 'unknown', + dynamic_config => 1, distribution_type => 'script', configure_requires => { @@ -135,7 +177,7 @@ my $new_mm = sub { wibble => 23, wobble => 42, - ]; + }; } @@ -150,12 +192,13 @@ my $new_mm = sub { MIN_PERL_VERSION => 5.006, ); - is_deeply [$mm->metafile_data], [ + is_deeply {$mm->metafile_data}, { name => 'Foo-Bar', version => 1.23, - abstract => undef, + abstract => 'unknown', author => [], license => 'unknown', + dynamic_config => 1, distribution_type => 'module', configure_requires => { @@ -178,7 +221,7 @@ my $new_mm = sub { url => 'http://module-build.sourceforge.net/META-spec-v1.4.html', version => 1.4 }, - ]; + }; } @@ -196,12 +239,13 @@ my $new_mm = sub { }, ); - is_deeply [$mm->metafile_data], [ + is_deeply {$mm->metafile_data}, { name => 'Foo-Bar', version => 1.23, - abstract => undef, + abstract => 'unknown', author => [], license => 'unknown', + dynamic_config => 1, distribution_type => 'module', configure_requires => { @@ -225,7 +269,7 @@ my $new_mm = sub { url => 'http://module-build.sourceforge.net/META-spec-v1.4.html', version => 1.4 }, - ]; + }; } # Test CONFIGURE_REQUIRES @@ -241,12 +285,13 @@ my $new_mm = sub { }, ); - is_deeply [$mm->metafile_data], [ + is_deeply {$mm->metafile_data}, { name => 'Foo-Bar', version => 1.23, - abstract => undef, + abstract => 'unknown', author => [], license => 'unknown', + dynamic_config => 1, distribution_type => 'module', configure_requires => { @@ -265,7 +310,7 @@ my $new_mm = sub { url => 'http://module-build.sourceforge.net/META-spec-v1.4.html', version => 1.4 }, - ],'CONFIGURE_REQUIRES'; + },'CONFIGURE_REQUIRES'; } # Test BUILD_REQUIRES @@ -281,12 +326,13 @@ my $new_mm = sub { }, ); - is_deeply [$mm->metafile_data], [ + is_deeply {$mm->metafile_data}, { name => 'Foo-Bar', version => 1.23, - abstract => undef, + abstract => 'unknown', author => [], license => 'unknown', + dynamic_config => 1, distribution_type => 'module', configure_requires => { @@ -305,5 +351,149 @@ my $new_mm = sub { url => 'http://module-build.sourceforge.net/META-spec-v1.4.html', version => 1.4 }, - ],'CONFIGURE_REQUIRES'; + },'CONFIGURE_REQUIRES'; +} + +# Test _REQUIRES key priority over META_ADD + +{ + my $mm = $new_mm->( + DISTNAME => 'Foo-Bar', + VERSION => 1.23, + BUILD_REQUIRES => { + "Fake::Module1" => 1.01, + }, + META_ADD => (my $meta_add = { build_requires => {} }), + PM => { + "Foo::Bar" => 'lib/Foo/Bar.pm', + }, + ); + + is_deeply {$mm->metafile_data($meta_add)}, { + name => 'Foo-Bar', + version => 1.23, + abstract => 'unknown', + author => [], + license => 'unknown', + dynamic_config => 1, + distribution_type => 'module', + + configure_requires => { + 'ExtUtils::MakeMaker' => 0, + }, + build_requires => { }, + + no_index => { + directory => [qw(t inc)], + }, + + generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION", + 'meta-spec' => { + url => 'http://module-build.sourceforge.net/META-spec-v1.4.html', + version => 1.4 + }, + },'META.yml data (META_ADD wins)'; + + + # Yes, this is all hard coded. + require CPAN::Meta; + my $want_mymeta = { + name => 'ExtUtils-MakeMaker', + version => '6.57_07', + abstract => 'Create a module Makefile', + author => ['Michael G Schwern <schwern@pobox.com>'], + license => 'perl', + dynamic_config => 0, + + requires => { + "DirHandle" => 0, + "File::Basename" => 0, + "File::Spec" => "0.8", + "Pod::Man" => 0, + "perl" => "5.006" + }, + + configure_requires => { + }, + build_requires => { + 'Fake::Module1' => 1.01, + }, + + resources => { + license => 'http://dev.perl.org/licenses/', + homepage => 'http://makemaker.org', + bugtracker => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=ExtUtils-MakeMaker', + repository => 'http://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker', + x_MailingList => 'makemaker@perl.org', + }, + + no_index => { + directory => [qw(t inc)], + package => ["DynaLoader", "in"], + }, + + generated_by => "ExtUtils::MakeMaker version 6.5707, CPAN::Meta::Converter version 2.110580", + 'meta-spec' => { + url => 'http://module-build.sourceforge.net/META-spec-v1.4.html', + version => 1.4 + }, + }; + + mymeta_ok $mm->mymeta("t/META_for_testing.json"), + $want_mymeta, + 'MYMETA JSON data (BUILD_REQUIRES wins)'; + + mymeta_ok $mm->mymeta("t/META_for_testing.yml"), + $want_mymeta, + 'MYMETA YAML data (BUILD_REQUIRES wins)'; +} + + +note "CPAN::Meta bug using the module version instead of the meta spec version"; { + my $mm = $new_mm->( + NAME => 'GD::Barcode::Code93', + AUTHOR => 'Chris DiMartino', + ABSTRACT => 'Code 93 implementation of GD::Barcode family', + PREREQ_PM => { + 'GD::Barcode' => 0, + 'GD' => 0 + }, + VERSION => '1.4', + ); + + my $meta = $mm->mymeta("t/META_for_testing_tricky_version.yml"); + is $meta->{'meta-spec'}{version}, 1.4; + + in_dir { + $mm->write_mymeta($meta); + ok -e "MYMETA.yml"; + ok -e "MYMETA.json"; + + my $meta_yml = Parse::CPAN::Meta->load_file("MYMETA.yml"); + is $meta_yml->{'meta-spec'}{version}, 1.4, "MYMETA.yml correctly downgraded to 1.4"; + + my $meta_json = Parse::CPAN::Meta->load_file("MYMETA.json"); + cmp_ok $meta_json->{'meta-spec'}{version}, ">=", 2, "MYMETA.json at 2 or better"; + }; + +} + + +note "A bad license string"; { + my $mm = $new_mm->( + DISTNAME => 'Foo::Bar', + VERSION => '1.4', + LICENSE => 'death and retribution', + ); + + in_dir { + my $meta = $mm->mymeta; + $mm->write_mymeta($meta); + + my $meta_yml = Parse::CPAN::Meta->load_file("MYMETA.yml"); + is $meta_yml->{license}, "unknown", "in yaml"; + + my $meta_json = Parse::CPAN::Meta->load_file("MYMETA.json"); + is_deeply $meta_json->{license}, ["unknown"], "in json"; + }; } diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/metafile_file.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/metafile_file.t index ca8a412eba7..e4e98dc4a07 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/metafile_file.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/metafile_file.t @@ -267,8 +267,9 @@ YAML SKIP: { + # Load() behaves diffrently in versions prior to 1.06 skip "Need YAML::Tiny to test if it can load META.yml", 2 - unless eval { require YAML::Tiny }; + unless eval { require YAML::Tiny } and $YAML::Tiny::VERSION >= 1.06; my @yaml_load = YAML::Tiny::Load($mm->metafile_file(@meta)); is @yaml_load, 1, "YAML::Tiny saw one document in META.yml"; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/min_perl_version.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/min_perl_version.t index b0eb50631af..5d2ac45e860 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/min_perl_version.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/min_perl_version.t @@ -8,7 +8,7 @@ BEGIN { } use strict; -use Test::More tests => 33; +use Test::More tests => 32; use TieOut; use MakeMaker::Test::Utils; @@ -37,9 +37,7 @@ END { ok( chdir 'Min-PerlVers', 'entering dir Min-PerlVers' ) || diag("chdir failed: $!"); -{ - # ----- argument verification ----- - +note "Argument verification"; { my $stdout = tie *STDOUT, 'TieOut'; ok( $stdout, 'capturing stdout' ); my $warnings = ''; @@ -102,18 +100,15 @@ END MIN_PERL_VERSION => 'foobar', ); }; - ok( '' ne $warnings, 'MIN_PERL_VERSION=foobar triggers a warning' ); - is( $warnings, <<'END', ' with expected message text' ); + is( $@, <<'END', 'Invalid MIN_PERL_VERSION is fatal' ); Warning: MIN_PERL_VERSION is not in a recognized format. Recommended is a quoted numerical value like '5.005' or '5.008001'. END - is( $@, '', ' and without a hard failure' ); } -# ----- PREREQ_PRINT output ----- -{ +note "PREREQ_PRINT output"; { my $prereq_out = run(qq{$perl Makefile.PL "PREREQ_PRINT=1"}); is( $?, 0, 'PREREQ_PRINT exiting normally' ); my $prereq_out_sane = $prereq_out =~ /^\s*\$PREREQ_PM\s*=/; @@ -137,8 +132,7 @@ END } -# ----- PRINT_PREREQ output ----- -{ +note "PRINT_PREREQ output"; { my $prereq_out = run(qq{$perl Makefile.PL "PRINT_PREREQ=1"}); is( $?, 0, 'PRINT_PREREQ exiting normally' ); ok( $prereq_out !~ /^warning/i, ' and not complaining loudly' ); @@ -148,8 +142,7 @@ END } -# ----- generated files verification ----- -{ +note "generated files verification"; { unlink $makefile; my @mpl_out = run(qq{$perl Makefile.PL}); END { unlink $makefile, makefile_backup() } @@ -159,8 +152,7 @@ END } -# ----- ppd output ----- -{ +note "ppd output"; { my $ppd_file = 'Min-PerlVers.ppd'; my @make_out = run(qq{$make ppd}); END { unlink $ppd_file } @@ -175,21 +167,29 @@ END } -# ----- META.yml output ----- -{ +note "META.yml output"; { my $distdir = 'Min-PerlVers-0.05'; $distdir =~ s{\.}{_}g if $Is_VMS; my $meta_yml = "$distdir/META.yml"; + my $meta_json = "$distdir/META.json"; my @make_out = run(qq{$make metafile}); END { rmtree $distdir } - cmp_ok( $?, '==', 0, 'Make metafile exiting normally' ) || diag(@make_out); - my $meta = slurp($meta_yml); - ok( defined($meta), ' META.yml present' ); - - like( $meta, qr{\nrequires:[^\S\n]*\n\s+perl:\s+5\.005\n\s+strict:\s+0\n}, - ' META.yml content good'); + for my $case ( + ['META.yml', $meta_yml], + ['META.json', $meta_json], + ) { + my ($label, $meta_name) = @$case; + ok( + my $obj = eval { + CPAN::Meta->load_file($meta_name, {lazy_validation => 0}) + }, + "$label validates" + ); + is( $obj->prereqs->{runtime}{requires}{perl}, '5.005', + "$label has runtime/requires perl 5.005" + ); + } } -__END__ diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/miniperl.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/miniperl.t index 2334eb05d8e..9a4def20288 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/miniperl.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/miniperl.t @@ -6,7 +6,15 @@ use strict; use lib 't/lib'; -use Test::More 'no_plan'; +use Test::More; + +# In a BEGIN block so the END tests aren't registered. +BEGIN { + plan skip_all => "miniperl test only necessary for the perl core" + if !$ENV{PERL_CORE}; + + plan "no_plan"; +} BEGIN { ok !$INC{"ExtUtils/MakeMaker.pm"}, "MakeMaker is not yet loaded"; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/oneliner.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/oneliner.t index b040872011a..5e89295d3bb 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/oneliner.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/oneliner.t @@ -6,15 +6,16 @@ BEGIN { chdir 't'; +use Config; use MakeMaker::Test::Utils; -use Test::More tests => 6; +use Test::More tests => 16; use File::Spec; my $TB = Test::More->builder; BEGIN { use_ok('ExtUtils::MM') } -my $mm = bless { NAME => "Foo" }, 'MM'; +my $mm = bless { NAME => "Foo", MAKE => $Config{make} }, 'MM'; isa_ok($mm, 'ExtUtils::MakeMaker'); isa_ok($mm, 'ExtUtils::MM_Any'); @@ -40,6 +41,20 @@ try_oneliner(q{$PATH = 'foo'; print $PATH},[], q{foo}, 'dollar signs' ); # switches? try_oneliner(q{print 'foo'}, ['-l'], "foo\n", 'switches' ); +# some DOS-specific things +try_oneliner(q{print " \" "}, [], q{ " }, 'single quote' ); +try_oneliner(q{print " < \" "}, [], q{ < " }, 'bracket, then quote' ); +try_oneliner(q{print " \" < "}, [], q{ " < }, 'quote, then bracket' ); +try_oneliner(q{print " < \"\" < \" < \" < "}, [], q{ < "" < " < " < }, 'quotes and brackets mixed' ); +try_oneliner(q{print " < \" | \" < | \" < \" < "}, [], q{ < " | " < | " < " < }, 'brackets, pipes and quotes' ); + +# some examples from http://www.autohotkey.net/~deleyd/parameters/parameters.htm#CPP +try_oneliner(q{print q[ &<>^|()@ ! ]}, [], q{ &<>^|()@ ! }, 'example 8.1' ); +try_oneliner(q{print q[ &<>^|@()!"&<>^|@()! ]}, [], q{ &<>^|@()!"&<>^|@()! }, 'example 8.2' ); +try_oneliner(q{print q[ "&<>^|@() !"&<>^|@() !" ]}, [], q{ "&<>^|@() !"&<>^|@() !" }, 'example 8.3' ); +try_oneliner(q{print q[ "C:\TEST A\" ]}, [], q{ "C:\TEST A\" }, 'example 8.4' ); +try_oneliner(q{print q[ "C:\TEST %&^ A\" ]}, [], q{ "C:\TEST %&^ A\" }, 'example 8.5' ); + # XXX gotta rethink the newline test. The Makefile does newline # escaping, then the shell. diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/parse_abstract.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/parse_abstract.t new file mode 100644 index 00000000000..03e56c932e4 --- /dev/null +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/parse_abstract.t @@ -0,0 +1,77 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use ExtUtils::MakeMaker; + +use Test::More 'no_plan'; + +sub test_abstract { + my($code, $package, $want, $name) = @_; + + local $Test::Builder::Level = $Test::Builder::Level + 1; + + my $file = "t/abstract.tmp"; + { + open my $fh, ">", $file or die "Can't open $file"; + print $fh $code; + close $fh; + } + + # Hack up a minimal MakeMaker object. + my $mm = bless { DISTNAME => $package }, "MM"; + my $have = $mm->parse_abstract($file); + + my $ok = is( $have, $want, $name ); + + # Clean up the temp file, VMS style + 1 while unlink $file; + + return $ok; +} + + +test_abstract(<<END, "Foo", "Stuff and things", "Simple abstract"); +=head1 NAME + +Foo - Stuff and things +END + + +test_abstract(<<END, "NEXT", "Provide a pseudo-class NEXT (et al) that allows method redispatch", "Name.pm"); +=head1 NAME + +NEXT.pm - Provide a pseudo-class NEXT (et al) that allows method redispatch +END + + +test_abstract(<<END, "Compress::Raw::Zlib::FAQ", "Frequently Asked Questions about Compress::Raw::Zlib", "double dash"); +=pod + +Compress::Raw::Zlib::FAQ -- Frequently Asked Questions about Compress::Raw::Zlib +END + + +test_abstract(<<END, "Foo", "This is", "Only in POD"); +# =pod + +Foo - This is not in pod + +=cut + +Foo - This isn't in pod either + +=pod + +Foo - This is + +Foo - So is this. +END + + +test_abstract(<<END, "Foo", "the abstract", "more spaces"); +=pod + +Foo - the abstract +END diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/prereq.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/prereq.t index cd5d18d781a..07bbaf02d3b 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/prereq.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/prereq.t @@ -8,7 +8,7 @@ BEGIN { } use strict; -use Test::More tests => 13; +use Test::More tests => 16; use TieOut; use MakeMaker::Test::Utils; @@ -35,6 +35,8 @@ ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) || local $SIG{__WARN__} = sub { $warnings .= join '', @_; }; + # prerequisite warnings are disabled while building the perl core: + local $ENV{PERL_CORE} = 0; WriteMakefile( NAME => 'Big::Dummy', @@ -65,6 +67,20 @@ ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) || is $warnings, "Warning: prerequisite I::Do::Not::Exist 0 not found.\n"; + + $warnings = ''; + WriteMakefile( + NAME => 'Big::Dummy', + PREREQ_PM => { + "I::Do::Not::Exist" => "", + } + ); + my @warnings = split /\n/, $warnings; + is @warnings, 2; + like $warnings[0], qr{^Unparsable version '' for prerequisite I::Do::Not::Exist\b}; + is $warnings[1], "Warning: prerequisite I::Do::Not::Exist 0 not found."; + + $warnings = ''; WriteMakefile( NAME => 'Big::Dummy', diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/several_authors.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/several_authors.t new file mode 100644 index 00000000000..bf6cdcb906e --- /dev/null +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/several_authors.t @@ -0,0 +1,137 @@ +#!/usr/bin/perl -w + +# This is a test checking various aspects of the optional argument +# MIN_PERL_VERSION to WriteMakefile. + +BEGIN { + unshift @INC, 't/lib'; +} + +use strict; +use Test::More tests => 20; + +use TieOut; +use MakeMaker::Test::Utils; +use MakeMaker::Test::Setup::SAS; +use File::Path; + +use ExtUtils::MakeMaker; + +# avoid environment variables interfering with our make runs +delete @ENV{qw(LIB MAKEFLAGS)}; + +my $perl = which_perl(); +my $make = make_run(); +my $makefile = makefile_name(); + +chdir 't'; + +perl_lib(); + +ok( setup_recurs(), 'setup' ); +END { + ok( chdir(File::Spec->updir), 'leaving dir' ); + ok( teardown_recurs(), 'teardown' ); +} + +ok( chdir $MakeMaker::Test::Setup::SAS::dirname, "entering dir $MakeMaker::Test::Setup::SAS::dirname" ) || + diag("chdir failed: $!"); + +note "argument verification"; { + my $stdout = tie *STDOUT, 'TieOut'; + ok( $stdout, 'capturing stdout' ); + my $warnings = ''; + local $SIG{__WARN__} = sub { + $warnings .= join '', @_; + }; + + eval { + WriteMakefile( + NAME => 'Multiple::Authors', + AUTHOR => ['John Doe <jd@example.com>', 'Jane Doe <jd@example.com>'], + ); + }; + is( $warnings, '', 'arrayref in AUTHOR does not trigger a warning' ); + is( $@, '', ' nor a hard failure' ); + +} + + +note "argument verification via CONFIGURE"; { + my $stdout = tie *STDOUT, 'TieOut'; + ok( $stdout, 'capturing stdout' ); + my $warnings = ''; + local $SIG{__WARN__} = sub { + $warnings .= join '', @_; + }; + + eval { + WriteMakefile( + NAME => 'Multiple::Authors', + CONFIGURE => sub { + return {AUTHOR => 'John Doe <jd@example.com>',}; + }, + ); + }; + is( $warnings, '', 'scalar in AUTHOR inside CONFIGURE does not trigger a warning' ); + is( $@, '', ' nor a hard failure' ); + +} + + +note "generated files verification"; { + unlink $makefile; + my @mpl_out = run(qq{$perl Makefile.PL}); + END { unlink $makefile, makefile_backup() } + + cmp_ok( $?, '==', 0, 'Makefile.PL exiting normally' ) || diag(@mpl_out); + ok( -e $makefile, 'Makefile present' ); +} + + +note "ppd output"; { + my $ppd_file = 'Multiple-Authors.ppd'; + my @make_out = run(qq{$make ppd}); + END { unlink $ppd_file } + + cmp_ok( $?, '==', 0, 'Make ppd exiting normally' ) || diag(@make_out); + + my $ppd_html = slurp($ppd_file); + ok( defined($ppd_html), ' .ppd file present' ); + + like( $ppd_html, qr{John Doe <jd\@example.com>, Jane Doe <jd\@example.com>}, + ' .ppd file content good' ); +} + + +note "META.yml output"; { + my $distdir = 'Multiple-Authors-0.05'; + $distdir =~ s{\.}{_}g if $Is_VMS; + + my $meta_yml = "$distdir/META.yml"; + my $meta_json = "$distdir/META.json"; + my @make_out = run(qq{$make metafile}); + END { rmtree $distdir } + + cmp_ok( $?, '==', 0, 'Make metafile exiting normally' ) || diag(@make_out); + + for my $case ( + ['META.yml', $meta_yml], + ['META.json', $meta_json], + ) { + my ($label, $meta_name) = @$case; + ok( + my $obj = eval { + CPAN::Meta->load_file($meta_name, {lazy_validation => 0}) + }, + "$label validates" + ); + is_deeply( [ $obj->authors ], + [ + q{John Doe <jd@example.com>}, + q{Jane Doe <jd@example.com>}, + ], + "$label content good" + ); + } +} diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/split_command.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/split_command.t index e57a5427004..6e6bab355d5 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/split_command.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/split_command.t @@ -6,6 +6,7 @@ BEGIN { chdir 't'; +use Config; use ExtUtils::MM; use MakeMaker::Test::Utils; @@ -15,7 +16,7 @@ my $Is_Win32 = $^O eq 'MSWin32'; use Test::More tests => 7; my $perl = which_perl; -my $mm = bless { NAME => "Foo" }, "MM"; +my $mm = bless { NAME => "Foo", MAKE => $Config{make} }, "MM"; # I don't expect anything to have a length shorter than 256 chars. cmp_ok( $mm->max_exec_len, '>=', 256, 'max_exec_len' ); diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/writemakefile_args.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/writemakefile_args.t index 10913b9f377..daa8255fbe1 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/writemakefile_args.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/writemakefile_args.t @@ -8,7 +8,7 @@ BEGIN { } use strict; -use Test::More tests => 35; +use Test::More tests => 39; use TieOut; use MakeMaker::Test::Utils; @@ -61,7 +61,7 @@ VERIFY }; is( $warnings, <<VERIFY ); -WARNING: AUTHOR takes a string/number not a CODE reference. +WARNING: AUTHOR takes a ARRAY reference not a CODE reference. Please inform the author. VERIFY @@ -212,4 +212,31 @@ VERIFY }; is( $warnings, '' ); is( $mm->{DISTVNAME}, 'Hooballoo' ); + + + # AUTHOR / scalar + $warnings = ''; + eval { + $mm = WriteMakefile( + NAME => 'Big::Dummy', + VERSION => '1.00', + AUTHOR => "test", + ); + }; + is( $warnings, '' ); + is_deeply( $mm->{AUTHOR}, ["test"] ); + + + # AUTHOR / array + $warnings = ''; + eval { + $mm = WriteMakefile( + NAME => 'Big::Dummy', + VERSION => '1.00', + AUTHOR => ["test1", "test2"], + ); + }; + is( $warnings, '' ); + is_deeply( $mm->{AUTHOR}, ["test1","test2"] ); + } |