[Midnightbsd-cvs] src [6453] trunk/contrib/perl/lib/ExtUtils: remove files from old perl version
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Tue Dec 3 20:19:50 EST 2013
Revision: 6453
http://svnweb.midnightbsd.org/src/?rev=6453
Author: laffer1
Date: 2013-12-03 20:19:50 -0500 (Tue, 03 Dec 2013)
Log Message:
-----------
remove files from old perl version
Removed Paths:
-------------
trunk/contrib/perl/lib/ExtUtils/MakeMaker/
trunk/contrib/perl/lib/ExtUtils/MakeMaker.pm
trunk/contrib/perl/lib/ExtUtils/Manifest.pm
trunk/contrib/perl/lib/ExtUtils/NOTES
trunk/contrib/perl/lib/ExtUtils/PATCHING
trunk/contrib/perl/lib/ExtUtils/Packlist.pm
trunk/contrib/perl/lib/ExtUtils/ParseXS/
trunk/contrib/perl/lib/ExtUtils/ParseXS.pm
trunk/contrib/perl/lib/ExtUtils/README
trunk/contrib/perl/lib/ExtUtils/TODO
trunk/contrib/perl/lib/ExtUtils/instmodsh
trunk/contrib/perl/lib/ExtUtils/t/00compile.t
trunk/contrib/perl/lib/ExtUtils/t/Constant.t
trunk/contrib/perl/lib/ExtUtils/t/FIRST_MAKEFILE.t
trunk/contrib/perl/lib/ExtUtils/t/INST.t
trunk/contrib/perl/lib/ExtUtils/t/INSTALL_BASE.t
trunk/contrib/perl/lib/ExtUtils/t/INST_PREFIX.t
trunk/contrib/perl/lib/ExtUtils/t/Install.t
trunk/contrib/perl/lib/ExtUtils/t/InstallWithMM.t
trunk/contrib/perl/lib/ExtUtils/t/Installapi2.t
trunk/contrib/perl/lib/ExtUtils/t/Installed.t
trunk/contrib/perl/lib/ExtUtils/t/Liblist.t
trunk/contrib/perl/lib/ExtUtils/t/MM_Any.t
trunk/contrib/perl/lib/ExtUtils/t/MM_BeOS.t
trunk/contrib/perl/lib/ExtUtils/t/MM_Cygwin.t
trunk/contrib/perl/lib/ExtUtils/t/MM_NW5.t
trunk/contrib/perl/lib/ExtUtils/t/MM_OS2.t
trunk/contrib/perl/lib/ExtUtils/t/MM_Unix.t
trunk/contrib/perl/lib/ExtUtils/t/MM_VMS.t
trunk/contrib/perl/lib/ExtUtils/t/MM_Win32.t
trunk/contrib/perl/lib/ExtUtils/t/MakeMaker_Parameters.t
trunk/contrib/perl/lib/ExtUtils/t/Manifest.t
trunk/contrib/perl/lib/ExtUtils/t/Mkbootstrap.t
trunk/contrib/perl/lib/ExtUtils/t/PL_FILES.t
trunk/contrib/perl/lib/ExtUtils/t/Packlist.t
trunk/contrib/perl/lib/ExtUtils/t/VERSION_FROM.t
trunk/contrib/perl/lib/ExtUtils/t/WriteEmptyMakefile.t
trunk/contrib/perl/lib/ExtUtils/t/arch_check.t
trunk/contrib/perl/lib/ExtUtils/t/backwards.t
trunk/contrib/perl/lib/ExtUtils/t/basic.t
trunk/contrib/perl/lib/ExtUtils/t/build_man.t
trunk/contrib/perl/lib/ExtUtils/t/bytes.t
trunk/contrib/perl/lib/ExtUtils/t/can_write_dir.t
trunk/contrib/perl/lib/ExtUtils/t/cd.t
trunk/contrib/perl/lib/ExtUtils/t/config.t
trunk/contrib/perl/lib/ExtUtils/t/cp.t
trunk/contrib/perl/lib/ExtUtils/t/dir_target.t
trunk/contrib/perl/lib/ExtUtils/t/eu_command.t
trunk/contrib/perl/lib/ExtUtils/t/fix_libs.t
trunk/contrib/perl/lib/ExtUtils/t/fixin.t
trunk/contrib/perl/lib/ExtUtils/t/hints.t
trunk/contrib/perl/lib/ExtUtils/t/installed_file.t
trunk/contrib/perl/lib/ExtUtils/t/is_of_type.t
trunk/contrib/perl/lib/ExtUtils/t/make.t
trunk/contrib/perl/lib/ExtUtils/t/maketext_filter.t
trunk/contrib/perl/lib/ExtUtils/t/metafile_data.t
trunk/contrib/perl/lib/ExtUtils/t/metafile_file.t
trunk/contrib/perl/lib/ExtUtils/t/min_perl_version.t
trunk/contrib/perl/lib/ExtUtils/t/miniperl.t
trunk/contrib/perl/lib/ExtUtils/t/oneliner.t
trunk/contrib/perl/lib/ExtUtils/t/parse_version.t
trunk/contrib/perl/lib/ExtUtils/t/pm.t
trunk/contrib/perl/lib/ExtUtils/t/pm_to_blib.t
trunk/contrib/perl/lib/ExtUtils/t/pod2man.t
trunk/contrib/perl/lib/ExtUtils/t/postamble.t
trunk/contrib/perl/lib/ExtUtils/t/prefixify.t
trunk/contrib/perl/lib/ExtUtils/t/prereq.t
trunk/contrib/perl/lib/ExtUtils/t/prereq_print.t
trunk/contrib/perl/lib/ExtUtils/t/problems.t
trunk/contrib/perl/lib/ExtUtils/t/prompt.t
trunk/contrib/perl/lib/ExtUtils/t/recurs.t
trunk/contrib/perl/lib/ExtUtils/t/revision.t
trunk/contrib/perl/lib/ExtUtils/t/split_command.t
trunk/contrib/perl/lib/ExtUtils/t/test_boilerplate.t
trunk/contrib/perl/lib/ExtUtils/t/testdata/
trunk/contrib/perl/lib/ExtUtils/t/testlib.t
trunk/contrib/perl/lib/ExtUtils/t/writemakefile_args.t
trunk/contrib/perl/lib/ExtUtils/t/xs.t
trunk/contrib/perl/lib/ExtUtils/testlib.pm
trunk/contrib/perl/lib/ExtUtils/xsubpp
Deleted: trunk/contrib/perl/lib/ExtUtils/MakeMaker.pm
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/MakeMaker.pm 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/MakeMaker.pm 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,2809 +0,0 @@
-# $Id: MakeMaker.pm,v 1.1.1.2 2011-02-17 12:49:38 laffer1 Exp $
-package ExtUtils::MakeMaker;
-
-use strict;
-
-BEGIN {require 5.006;}
-
-require Exporter;
-use ExtUtils::MakeMaker::Config;
-use Carp ();
-use File::Path;
-
-our $Verbose = 0; # exported
-our @Parent; # needs to be localized
-our @Get_from_Config; # referenced by MM_Unix
-our @MM_Sections;
-our @Overridable;
-my @Prepend_parent;
-my %Recognized_Att_Keys;
-
-our $VERSION = '6.55_02';
-
-# Emulate something resembling CVS $Revision: 1.1.1.2 $
-(our $Revision = $VERSION) =~ s{_}{};
-$Revision = int $Revision * 10000;
-
-our $Filename = __FILE__; # referenced outside MakeMaker
-
-our @ISA = qw(Exporter);
-our @EXPORT = qw(&WriteMakefile &writeMakefile $Verbose &prompt);
-our @EXPORT_OK = qw($VERSION &neatvalue &mkbootstrap &mksymlists
- &WriteEmptyMakefile);
-
-# These will go away once the last of the Win32 & VMS specific code is
-# purged.
-my $Is_VMS = $^O eq 'VMS';
-my $Is_Win32 = $^O eq 'MSWin32';
-
-full_setup();
-
-require ExtUtils::MM; # Things like CPAN assume loading ExtUtils::MakeMaker
- # will give them MM.
-
-require ExtUtils::MY; # XXX pre-5.8 versions of ExtUtils::Embed expect
- # loading ExtUtils::MakeMaker will give them MY.
- # This will go when Embed is its own CPAN module.
-
-
-sub WriteMakefile {
- Carp::croak "WriteMakefile: Need even number of args" if @_ % 2;
-
- require ExtUtils::MY;
- my %att = @_;
-
- _verify_att(\%att);
-
- my $mm = MM->new(\%att);
- $mm->flush;
-
- return $mm;
-}
-
-
-# Basic signatures of the attributes WriteMakefile takes. Each is the
-# reference type. Empty value indicate it takes a non-reference
-# scalar.
-my %Att_Sigs;
-my %Special_Sigs = (
- C => 'ARRAY',
- CONFIG => 'ARRAY',
- CONFIGURE => 'CODE',
- DIR => 'ARRAY',
- DL_FUNCS => 'HASH',
- DL_VARS => 'ARRAY',
- EXCLUDE_EXT => 'ARRAY',
- EXE_FILES => 'ARRAY',
- FUNCLIST => 'ARRAY',
- H => 'ARRAY',
- IMPORTS => 'HASH',
- INCLUDE_EXT => 'ARRAY',
- LIBS => ['ARRAY',''],
- MAN1PODS => 'HASH',
- MAN3PODS => 'HASH',
- META_ADD => 'HASH',
- META_MERGE => 'HASH',
- PL_FILES => 'HASH',
- PM => 'HASH',
- PMLIBDIRS => 'ARRAY',
- PMLIBPARENTDIRS => 'ARRAY',
- PREREQ_PM => 'HASH',
- BUILD_REQUIRES => 'HASH',
- CONFIGURE_REQUIRES => 'HASH',
- SKIP => 'ARRAY',
- TYPEMAPS => 'ARRAY',
- XS => 'HASH',
- VERSION => ['version',''],
- _KEEP_AFTER_FLUSH => '',
-
- clean => 'HASH',
- depend => 'HASH',
- dist => 'HASH',
- dynamic_lib=> 'HASH',
- linkext => 'HASH',
- macro => 'HASH',
- postamble => 'HASH',
- realclean => 'HASH',
- test => 'HASH',
- tool_autosplit => 'HASH',
-);
-
- at Att_Sigs{keys %Recognized_Att_Keys} = ('') x keys %Recognized_Att_Keys;
- at Att_Sigs{keys %Special_Sigs} = values %Special_Sigs;
-
-
-sub _verify_att {
- my($att) = @_;
-
- while( my($key, $val) = each %$att ) {
- my $sig = $Att_Sigs{$key};
- unless( defined $sig ) {
- warn "WARNING: $key is not a known parameter.\n";
- next;
- }
-
- my @sigs = ref $sig ? @$sig : $sig;
- my $given = ref $val;
- unless( grep { _is_of_type($val, $_) } @sigs ) {
- my $takes = join " or ", map { _format_att($_) } @sigs;
-
- my $has = _format_att($given);
- warn "WARNING: $key takes a $takes not a $has.\n".
- " Please inform the author.\n";
- }
- }
-}
-
-
-# Check if a given thing is a reference or instance of $type
-sub _is_of_type {
- my($thing, $type) = @_;
-
- return 1 if ref $thing eq $type;
-
- local $SIG{__DIE__};
- return 1 if eval{ $thing->isa($type) };
-
- return 0;
-}
-
-
-sub _format_att {
- my $given = shift;
-
- return $given eq '' ? "string/number"
- : uc $given eq $given ? "$given reference"
- : "$given object"
- ;
-}
-
-
-sub prompt ($;$) { ## no critic
- my($mess, $def) = @_;
- Carp::confess("prompt function called without an argument")
- unless defined $mess;
-
- my $isa_tty = -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)) ;
-
- my $dispdef = defined $def ? "[$def] " : " ";
- $def = defined $def ? $def : "";
-
- local $|=1;
- local $\;
- print "$mess $dispdef";
-
- my $ans;
- if ($ENV{PERL_MM_USE_DEFAULT} || (!$isa_tty && eof STDIN)) {
- print "$def\n";
- }
- else {
- $ans = <STDIN>;
- if( defined $ans ) {
- chomp $ans;
- }
- else { # user hit ctrl-D
- print "\n";
- }
- }
-
- return (!defined $ans || $ans eq '') ? $def : $ans;
-}
-
-sub eval_in_subdirs {
- my($self) = @_;
- use Cwd qw(cwd abs_path);
- my $pwd = cwd() || die "Can't figure out your cwd!";
-
- local @INC = map eval {abs_path($_) if -e} || $_, @INC;
- push @INC, '.'; # '.' has to always be at the end of @INC
-
- foreach my $dir (@{$self->{DIR}}){
- my($abs) = $self->catdir($pwd,$dir);
- eval { $self->eval_in_x($abs); };
- last if $@;
- }
- chdir $pwd;
- die $@ if $@;
-}
-
-sub eval_in_x {
- my($self,$dir) = @_;
- chdir $dir or Carp::carp("Couldn't change to directory $dir: $!");
-
- {
- package main;
- do './Makefile.PL';
- };
- if ($@) {
-# if ($@ =~ /prerequisites/) {
-# die "MakeMaker WARNING: $@";
-# } else {
-# warn "WARNING from evaluation of $dir/Makefile.PL: $@";
-# }
- die "ERROR from evaluation of $dir/Makefile.PL: $@";
- }
-}
-
-
-# package name for the classes into which the first object will be blessed
-my $PACKNAME = 'PACK000';
-
-sub full_setup {
- $Verbose ||= 0;
-
- my @attrib_help = qw/
-
- AUTHOR ABSTRACT ABSTRACT_FROM BINARY_LOCATION
- C CAPI CCFLAGS CONFIG CONFIGURE DEFINE DIR DISTNAME DISTVNAME
- DL_FUNCS DL_VARS
- EXCLUDE_EXT EXE_FILES FIRST_MAKEFILE
- FULLPERL FULLPERLRUN FULLPERLRUNINST
- FUNCLIST H IMPORTS
-
- INST_ARCHLIB INST_SCRIPT INST_BIN INST_LIB INST_MAN1DIR INST_MAN3DIR
- INSTALLDIRS
- DESTDIR PREFIX INSTALL_BASE
- PERLPREFIX SITEPREFIX VENDORPREFIX
- INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB
- INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH
- INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN
- INSTALLMAN1DIR INSTALLMAN3DIR
- INSTALLSITEMAN1DIR INSTALLSITEMAN3DIR
- INSTALLVENDORMAN1DIR INSTALLVENDORMAN3DIR
- INSTALLSCRIPT INSTALLSITESCRIPT INSTALLVENDORSCRIPT
- PERL_LIB PERL_ARCHLIB
- SITELIBEXP SITEARCHEXP
-
- INC INCLUDE_EXT LDFROM LIB LIBPERL_A LIBS LICENSE
- LINKTYPE MAKE MAKEAPERL MAKEFILE MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET
- META_ADD META_MERGE MIN_PERL_VERSION BUILD_REQUIRES CONFIGURE_REQUIRES
- MYEXTLIB NAME NEEDS_LINKING NOECHO NO_META NORECURS NO_VC OBJECT OPTIMIZE
- PERL_MALLOC_OK PERL PERLMAINCC PERLRUN PERLRUNINST PERL_CORE
- PERL_SRC PERM_DIR PERM_RW PERM_RWX
- PL_FILES PM PM_FILTER PMLIBDIRS PMLIBPARENTDIRS POLLUTE PPM_INSTALL_EXEC
- PPM_INSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
- SIGN SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
- XS_VERSION clean depend dist dynamic_lib linkext macro realclean
- tool_autosplit
-
- MACPERL_SRC MACPERL_LIB MACLIBS_68K MACLIBS_PPC MACLIBS_SC MACLIBS_MRC
- MACLIBS_ALL_68K MACLIBS_ALL_PPC MACLIBS_SHARED
- /;
-
- # IMPORTS is used under OS/2 and Win32
-
- # @Overridable is close to @MM_Sections but not identical. The
- # order is important. Many subroutines declare macros. These
- # depend on each other. Let's try to collect the macros up front,
- # then pasthru, then the rules.
-
- # MM_Sections are the sections we have to call explicitly
- # in Overridable we have subroutines that are used indirectly
-
-
- @MM_Sections =
- qw(
-
- post_initialize const_config constants platform_constants
- tool_autosplit tool_xsubpp tools_other
-
- makemakerdflt
-
- dist macro depend cflags const_loadlibs const_cccmd
- post_constants
-
- pasthru
-
- special_targets
- c_o xs_c xs_o
- top_targets blibdirs linkext dlsyms dynamic dynamic_bs
- dynamic_lib static static_lib manifypods processPL
- installbin subdirs
- clean_subdirs clean realclean_subdirs realclean
- metafile signature
- dist_basics dist_core distdir dist_test dist_ci distmeta distsignature
- install force perldepend makefile staticmake test ppd
-
- ); # loses section ordering
-
- @Overridable = @MM_Sections;
- push @Overridable, qw[
-
- libscan makeaperl needs_linking
- subdir_x test_via_harness test_via_script
-
- init_VERSION init_dist init_INST init_INSTALL init_DEST init_dirscan
- init_PM init_MANPODS init_xs init_PERL init_DIRFILESEP init_linker
- ];
-
- push @MM_Sections, qw[
-
- pm_to_blib selfdocument
-
- ];
-
- # Postamble needs to be the last that was always the case
- push @MM_Sections, "postamble";
- push @Overridable, "postamble";
-
- # All sections are valid keys.
- @Recognized_Att_Keys{@MM_Sections} = (1) x @MM_Sections;
-
- # we will use all these variables in the Makefile
- @Get_from_Config =
- qw(
- ar cc cccdlflags ccdlflags dlext dlsrc exe_ext full_ar ld
- lddlflags ldflags libc lib_ext obj_ext osname osvers ranlib
- sitelibexp sitearchexp so
- );
-
- # 5.5.3 doesn't have any concept of vendor libs
- push @Get_from_Config, qw( vendorarchexp vendorlibexp ) if $] >= 5.006;
-
- foreach my $item (@attrib_help){
- $Recognized_Att_Keys{$item} = 1;
- }
- foreach my $item (@Get_from_Config) {
- $Recognized_Att_Keys{uc $item} = $Config{$item};
- print "Attribute '\U$item\E' => '$Config{$item}'\n"
- if ($Verbose >= 2);
- }
-
- #
- # When we eval a Makefile.PL in a subdirectory, that one will ask
- # us (the parent) for the values and will prepend "..", so that
- # all files to be installed end up below OUR ./blib
- #
- @Prepend_parent = qw(
- INST_BIN INST_LIB INST_ARCHLIB INST_SCRIPT
- MAP_TARGET INST_MAN1DIR INST_MAN3DIR PERL_SRC
- PERL FULLPERL
- );
-}
-
-sub writeMakefile {
- die <<END;
-
-The extension you are trying to build apparently is rather old and
-most probably outdated. We detect that from the fact, that a
-subroutine "writeMakefile" is called, and this subroutine is not
-supported anymore since about October 1994.
-
-Please contact the author or look into CPAN (details about CPAN can be
-found in the FAQ and at http:/www.perl.com) for a more recent version
-of the extension. If you're really desperate, you can try to change
-the subroutine name from writeMakefile to WriteMakefile and rerun
-'perl Makefile.PL', but you're most probably left alone, when you do
-so.
-
-The MakeMaker team
-
-END
-}
-
-sub new {
- my($class,$self) = @_;
- my($key);
-
- # Store the original args passed to WriteMakefile()
- foreach my $k (keys %$self) {
- $self->{ARGS}{$k} = $self->{$k};
- }
-
- $self = {} unless defined $self;
-
- $self->{PREREQ_PM} ||= {};
- $self->{BUILD_REQUIRES} ||= {};
-
- # Temporarily bless it into MM so it can be used as an
- # object. It will be blessed into a temp package later.
- bless $self, "MM";
-
- if ("@ARGV" =~ /\bPREREQ_PRINT\b/) {
- $self->_PREREQ_PRINT;
- }
-
- # PRINT_PREREQ is RedHatism.
- if ("@ARGV" =~ /\bPRINT_PREREQ\b/) {
- $self->_PRINT_PREREQ;
- }
-
- print STDOUT "MakeMaker (v$VERSION)\n" if $Verbose;
- if (-f "MANIFEST" && ! -f "Makefile"){
- check_manifest();
- }
-
- check_hints($self);
-
- # Translate X.Y.Z to X.00Y00Z
- if( defined $self->{MIN_PERL_VERSION} ) {
- $self->{MIN_PERL_VERSION} =~ s{ ^ (\d+) \. (\d+) \. (\d+) $ }
- {sprintf "%d.%03d%03d", $1, $2, $3}ex;
- }
-
- my $perl_version_ok = eval {
- local $SIG{__WARN__} = sub {
- # simulate "use warnings FATAL => 'all'" for vintage perls
- die @_;
- };
- !$self->{MIN_PERL_VERSION} or $self->{MIN_PERL_VERSION} <= $]
- };
- if (!$perl_version_ok) {
- if (!defined $perl_version_ok) {
- warn <<'END';
-Warning: MIN_PERL_VERSION is not in a recognized format.
-Recommended is a quoted numerical value like '5.005' or '5.008001'.
-END
- }
- elsif ($self->{PREREQ_FATAL}) {
- die sprintf <<"END", $self->{MIN_PERL_VERSION}, $];
-MakeMaker FATAL: perl version too low for this distribution.
-Required is %s. We run %s.
-END
- }
- else {
- warn sprintf
- "Warning: Perl version %s or higher required. We run %s.\n",
- $self->{MIN_PERL_VERSION}, $];
- }
- }
-
- my %configure_att; # record &{$self->{CONFIGURE}} attributes
- my(%initial_att) = %$self; # record initial attributes
-
- my(%unsatisfied) = ();
- my $prereqs = $self->_all_prereqs;
- foreach my $prereq (sort keys %$prereqs) {
- my $required_version = $prereqs->{$prereq};
-
- my $installed_file = MM->_installed_file_for_module($prereq);
- my $pr_version = 0;
- $pr_version = MM->parse_version($installed_file) if $installed_file;
- $pr_version = 0 if $pr_version eq 'undef';
-
- # convert X.Y_Z alpha version #s to X.YZ for easier comparisons
- $pr_version =~ s/(\d+)\.(\d+)_(\d+)/$1.$2$3/;
-
- if (!$installed_file) {
- warn sprintf "Warning: prerequisite %s %s not found.\n",
- $prereq, $required_version
- unless $self->{PREREQ_FATAL};
-
- $unsatisfied{$prereq} = 'not installed';
- }
- elsif ($pr_version < $required_version ){
- warn sprintf "Warning: prerequisite %s %s not found. We have %s.\n",
- $prereq, $required_version, ($pr_version || 'unknown version')
- unless $self->{PREREQ_FATAL};
-
- $unsatisfied{$prereq} = $required_version ? $required_version : 'unknown version' ;
- }
- }
-
- if (%unsatisfied && $self->{PREREQ_FATAL}){
- my $failedprereqs = join "\n", map {" $_ $unsatisfied{$_}"}
- sort { $a cmp $b } keys %unsatisfied;
- die <<"END";
-MakeMaker FATAL: prerequisites not found.
-$failedprereqs
-
-Please install these modules first and rerun 'perl Makefile.PL'.
-END
- }
-
- if (defined $self->{CONFIGURE}) {
- if (ref $self->{CONFIGURE} eq 'CODE') {
- %configure_att = %{&{$self->{CONFIGURE}}};
- $self = { %$self, %configure_att };
- } else {
- Carp::croak "Attribute 'CONFIGURE' to WriteMakefile() not a code reference\n";
- }
- }
-
- # This is for old Makefiles written pre 5.00, will go away
- if ( Carp::longmess("") =~ /runsubdirpl/s ){
- Carp::carp("WARNING: Please rerun 'perl Makefile.PL' to regenerate your Makefiles\n");
- }
-
- my $newclass = ++$PACKNAME;
- local @Parent = @Parent; # Protect against non-local exits
- {
- print "Blessing Object into class [$newclass]\n" if $Verbose>=2;
- mv_all_methods("MY",$newclass);
- bless $self, $newclass;
- push @Parent, $self;
- require ExtUtils::MY;
-
- no strict 'refs'; ## no critic;
- @{"$newclass\:\:ISA"} = 'MM';
- }
-
- if (defined $Parent[-2]){
- $self->{PARENT} = $Parent[-2];
- for my $key (@Prepend_parent) {
- next unless defined $self->{PARENT}{$key};
-
- # Don't stomp on WriteMakefile() args.
- next if defined $self->{ARGS}{$key} and
- $self->{ARGS}{$key} eq $self->{$key};
-
- $self->{$key} = $self->{PARENT}{$key};
-
- unless ($Is_VMS && $key =~ /PERL$/) {
- $self->{$key} = $self->catdir("..",$self->{$key})
- unless $self->file_name_is_absolute($self->{$key});
- } else {
- # PERL or FULLPERL will be a command verb or even a
- # command with an argument instead of a full file
- # specification under VMS. So, don't turn the command
- # into a filespec, but do add a level to the path of
- # the argument if not already absolute.
- my @cmd = split /\s+/, $self->{$key};
- $cmd[1] = $self->catfile('[-]',$cmd[1])
- unless (@cmd < 2) || $self->file_name_is_absolute($cmd[1]);
- $self->{$key} = join(' ', @cmd);
- }
- }
- if ($self->{PARENT}) {
- $self->{PARENT}->{CHILDREN}->{$newclass} = $self;
- foreach my $opt (qw(POLLUTE PERL_CORE LINKTYPE)) {
- if (exists $self->{PARENT}->{$opt}
- and not exists $self->{$opt})
- {
- # inherit, but only if already unspecified
- $self->{$opt} = $self->{PARENT}->{$opt};
- }
- }
- }
- my @fm = grep /^FIRST_MAKEFILE=/, @ARGV;
- parse_args($self, at fm) if @fm;
- } else {
- parse_args($self,split(' ', $ENV{PERL_MM_OPT} || ''), at ARGV);
- }
-
-
- $self->{NAME} ||= $self->guess_name;
-
- ($self->{NAME_SYM} = $self->{NAME}) =~ s/\W+/_/g;
-
- $self->init_MAKE;
- $self->init_main;
- $self->init_VERSION;
- $self->init_dist;
- $self->init_INST;
- $self->init_INSTALL;
- $self->init_DEST;
- $self->init_dirscan;
- $self->init_PM;
- $self->init_MANPODS;
- $self->init_xs;
- $self->init_PERL;
- $self->init_DIRFILESEP;
- $self->init_linker;
- $self->init_ABSTRACT;
-
- $self->arch_check(
- $INC{'Config.pm'},
- $self->catfile($Config{'archlibexp'}, "Config.pm")
- );
-
- $self->init_others();
- $self->init_platform();
- $self->init_PERM();
- my($argv) = neatvalue(\@ARGV);
- $argv =~ s/^\[/(/;
- $argv =~ s/\]$/)/;
-
- push @{$self->{RESULT}}, <<END;
-# This Makefile is for the $self->{NAME} extension to perl.
-#
-# It was generated automatically by MakeMaker version
-# $VERSION (Revision: $Revision) from the contents of
-# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
-#
-# ANY CHANGES MADE HERE WILL BE LOST!
-#
-# MakeMaker ARGV: $argv
-#
-END
-
- push @{$self->{RESULT}}, $self->_MakeMaker_Parameters_section(\%initial_att);
-
- if (defined $self->{CONFIGURE}) {
- push @{$self->{RESULT}}, <<END;
-
-# MakeMaker 'CONFIGURE' Parameters:
-END
- if (scalar(keys %configure_att) > 0) {
- foreach my $key (sort keys %configure_att){
- next if $key eq 'ARGS';
- my($v) = neatvalue($configure_att{$key});
- $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/;
- $v =~ tr/\n/ /s;
- push @{$self->{RESULT}}, "# $key => $v";
- }
- }
- else
- {
- push @{$self->{RESULT}}, "# no values returned";
- }
- undef %configure_att; # free memory
- }
-
- # turn the SKIP array into a SKIPHASH hash
- for my $skip (@{$self->{SKIP} || []}) {
- $self->{SKIPHASH}{$skip} = 1;
- }
- delete $self->{SKIP}; # free memory
-
- if ($self->{PARENT}) {
- for (qw/install dist dist_basics dist_core distdir dist_test dist_ci/) {
- $self->{SKIPHASH}{$_} = 1;
- }
- }
-
- # We run all the subdirectories now. They don't have much to query
- # from the parent, but the parent has to query them: if they need linking!
- unless ($self->{NORECURS}) {
- $self->eval_in_subdirs if @{$self->{DIR}};
- }
-
- foreach my $section ( @MM_Sections ){
- # Support for new foo_target() methods.
- my $method = $section;
- $method .= '_target' unless $self->can($method);
-
- print "Processing Makefile '$section' section\n" if ($Verbose >= 2);
- my($skipit) = $self->skipcheck($section);
- if ($skipit){
- push @{$self->{RESULT}}, "\n# --- MakeMaker $section section $skipit.";
- } else {
- my(%a) = %{$self->{$section} || {}};
- push @{$self->{RESULT}}, "\n# --- MakeMaker $section section:";
- push @{$self->{RESULT}}, "# " . join ", ", %a if $Verbose && %a;
- push @{$self->{RESULT}}, $self->maketext_filter(
- $self->$method( %a )
- );
- }
- }
-
- push @{$self->{RESULT}}, "\n# End.";
-
- $self;
-}
-
-sub WriteEmptyMakefile {
- Carp::croak "WriteEmptyMakefile: Need an even number of args" if @_ % 2;
-
- my %att = @_;
- my $self = MM->new(\%att);
-
- my $new = $self->{MAKEFILE};
- my $old = $self->{MAKEFILE_OLD};
- if (-f $old) {
- _unlink($old) or warn "unlink $old: $!";
- }
- if ( -f $new ) {
- _rename($new, $old) or warn "rename $new => $old: $!"
- }
- open my $mfh, '>', $new or die "open $new for write: $!";
- print $mfh <<'EOP';
-all :
-
-clean :
-
-install :
-
-makemakerdflt :
-
-test :
-
-EOP
- close $mfh or die "close $new for write: $!";
-}
-
-
-=begin private
-
-=head3 _installed_file_for_module
-
- my $file = MM->_installed_file_for_module($module);
-
-Return the first installed .pm $file associated with the $module. The
-one which will show up when you C<use $module>.
-
-$module is something like "strict" or "Test::More".
-
-=end private
-
-=cut
-
-sub _installed_file_for_module {
- my $class = shift;
- my $prereq = shift;
-
- my $file = "$prereq.pm";
- $file =~ s{::}{/}g;
-
- my $path;
- for my $dir (@INC) {
- my $tmp = File::Spec->catfile($dir, $file);
- if ( -r $tmp ) {
- $path = $tmp;
- last;
- }
- }
-
- return $path;
-}
-
-
-# Extracted from MakeMaker->new so we can test it
-sub _MakeMaker_Parameters_section {
- my $self = shift;
- my $att = shift;
-
- my @result = <<'END';
-# MakeMaker Parameters:
-END
-
- # CPAN.pm takes prereqs from this field in 'Makefile'
- # and does not know about BUILD_REQUIRES
- if( $att->{PREREQ_PM} || $att->{BUILD_REQUIRES} ) {
- %{$att->{'PREREQ_PM'}} = (%{$att->{'PREREQ_PM'}||{}}, %{$att->{'BUILD_REQUIRES'}||{}});
- }
-
- foreach my $key (sort keys %$att){
- next if $key eq 'ARGS';
-
- my($v) = neatvalue($att->{$key});
- $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/;
- $v =~ tr/\n/ /s;
- push @result, "# $key => $v";
- }
-
- return @result;
-}
-
-
-sub check_manifest {
- print STDOUT "Checking if your kit is complete...\n";
- require ExtUtils::Manifest;
- # avoid warning
- $ExtUtils::Manifest::Quiet = $ExtUtils::Manifest::Quiet = 1;
- my(@missed) = ExtUtils::Manifest::manicheck();
- if (@missed) {
- print STDOUT "Warning: the following files are missing in your kit:\n";
- print "\t", join "\n\t", @missed;
- print STDOUT "\n";
- print STDOUT "Please inform the author.\n";
- } else {
- print STDOUT "Looks good\n";
- }
-}
-
-sub parse_args{
- my($self, @args) = @_;
- foreach (@args) {
- unless (m/(.*?)=(.*)/) {
- ++$Verbose if m/^verb/;
- next;
- }
- my($name, $value) = ($1, $2);
- if ($value =~ m/^~(\w+)?/) { # tilde with optional username
- $value =~ s [^~(\w*)]
- [$1 ?
- ((getpwnam($1))[7] || "~$1") :
- (getpwuid($>))[7]
- ]ex;
- }
-
- # Remember the original args passed it. It will be useful later.
- $self->{ARGS}{uc $name} = $self->{uc $name} = $value;
- }
-
- # catch old-style 'potential_libs' and inform user how to 'upgrade'
- if (defined $self->{potential_libs}){
- my($msg)="'potential_libs' => '$self->{potential_libs}' should be";
- if ($self->{potential_libs}){
- print STDOUT "$msg changed to:\n\t'LIBS' => ['$self->{potential_libs}']\n";
- } else {
- print STDOUT "$msg deleted.\n";
- }
- $self->{LIBS} = [$self->{potential_libs}];
- delete $self->{potential_libs};
- }
- # catch old-style 'ARMAYBE' and inform user how to 'upgrade'
- if (defined $self->{ARMAYBE}){
- my($armaybe) = $self->{ARMAYBE};
- print STDOUT "ARMAYBE => '$armaybe' should be changed to:\n",
- "\t'dynamic_lib' => {ARMAYBE => '$armaybe'}\n";
- my(%dl) = %{$self->{dynamic_lib} || {}};
- $self->{dynamic_lib} = { %dl, ARMAYBE => $armaybe};
- delete $self->{ARMAYBE};
- }
- if (defined $self->{LDTARGET}){
- print STDOUT "LDTARGET should be changed to LDFROM\n";
- $self->{LDFROM} = $self->{LDTARGET};
- delete $self->{LDTARGET};
- }
- # Turn a DIR argument on the command line into an array
- if (defined $self->{DIR} && ref \$self->{DIR} eq 'SCALAR') {
- # So they can choose from the command line, which extensions they want
- # the grep enables them to have some colons too much in case they
- # have to build a list with the shell
- $self->{DIR} = [grep $_, split ":", $self->{DIR}];
- }
- # Turn a INCLUDE_EXT argument on the command line into an array
- if (defined $self->{INCLUDE_EXT} && ref \$self->{INCLUDE_EXT} eq 'SCALAR') {
- $self->{INCLUDE_EXT} = [grep $_, split '\s+', $self->{INCLUDE_EXT}];
- }
- # Turn a EXCLUDE_EXT argument on the command line into an array
- if (defined $self->{EXCLUDE_EXT} && ref \$self->{EXCLUDE_EXT} eq 'SCALAR') {
- $self->{EXCLUDE_EXT} = [grep $_, split '\s+', $self->{EXCLUDE_EXT}];
- }
-
- foreach my $mmkey (sort keys %$self){
- next if $mmkey eq 'ARGS';
- print STDOUT " $mmkey => ", neatvalue($self->{$mmkey}), "\n" if $Verbose;
- print STDOUT "'$mmkey' is not a known MakeMaker parameter name.\n"
- unless exists $Recognized_Att_Keys{$mmkey};
- }
- $| = 1 if $Verbose;
-}
-
-sub check_hints {
- my($self) = @_;
- # We allow extension-specific hints files.
-
- require File::Spec;
- my $curdir = File::Spec->curdir;
-
- my $hint_dir = File::Spec->catdir($curdir, "hints");
- return unless -d $hint_dir;
-
- # First we look for the best hintsfile we have
- my($hint)="${^O}_$Config{osvers}";
- $hint =~ s/\./_/g;
- $hint =~ s/_$//;
- return unless $hint;
-
- # Also try without trailing minor version numbers.
- while (1) {
- last if -f File::Spec->catfile($hint_dir, "$hint.pl"); # found
- } continue {
- last unless $hint =~ s/_[^_]*$//; # nothing to cut off
- }
- my $hint_file = File::Spec->catfile($hint_dir, "$hint.pl");
-
- return unless -f $hint_file; # really there
-
- _run_hintfile($self, $hint_file);
-}
-
-sub _run_hintfile {
- our $self;
- local($self) = shift; # make $self available to the hint file.
- my($hint_file) = shift;
-
- local($@, $!);
- print STDERR "Processing hints file $hint_file\n";
-
- # Just in case the ./ isn't on the hint file, which File::Spec can
- # often strip off, we bung the curdir into @INC
- local @INC = (File::Spec->curdir, @INC);
- my $ret = do $hint_file;
- if( !defined $ret ) {
- my $error = $@ || $!;
- print STDERR $error;
- }
-}
-
-sub mv_all_methods {
- my($from,$to) = @_;
-
- # Here you see the *current* list of methods that are overridable
- # from Makefile.PL via MY:: subroutines. As of VERSION 5.07 I'm
- # still trying to reduce the list to some reasonable minimum --
- # because I want to make it easier for the user. A.K.
-
- local $SIG{__WARN__} = sub {
- # can't use 'no warnings redefined', 5.6 only
- warn @_ unless $_[0] =~ /^Subroutine .* redefined/
- };
- foreach my $method (@Overridable) {
-
- # We cannot say "next" here. Nick might call MY->makeaperl
- # which isn't defined right now
-
- # Above statement was written at 4.23 time when Tk-b8 was
- # around. As Tk-b9 only builds with 5.002something and MM 5 is
- # standard, we try to enable the next line again. It was
- # commented out until MM 5.23
-
- next unless defined &{"${from}::$method"};
-
- {
- no strict 'refs'; ## no critic
- *{"${to}::$method"} = \&{"${from}::$method"};
-
- # If we delete a method, then it will be undefined and cannot
- # be called. But as long as we have Makefile.PLs that rely on
- # %MY:: being intact, we have to fill the hole with an
- # inheriting method:
-
- {
- package MY;
- my $super = "SUPER::".$method;
- *{$method} = sub {
- shift->$super(@_);
- };
- }
- }
- }
-
- # We have to clean out %INC also, because the current directory is
- # changed frequently and Graham Barr prefers to get his version
- # out of a History.pl file which is "required" so woudn't get
- # loaded again in another extension requiring a History.pl
-
- # With perl5.002_01 the deletion of entries in %INC caused Tk-b11
- # to core dump in the middle of a require statement. The required
- # file was Tk/MMutil.pm. The consequence is, we have to be
- # extremely careful when we try to give perl a reason to reload a
- # library with same name. The workaround prefers to drop nothing
- # from %INC and teach the writers not to use such libraries.
-
-# my $inc;
-# foreach $inc (keys %INC) {
-# #warn "***$inc*** deleted";
-# delete $INC{$inc};
-# }
-}
-
-sub skipcheck {
- my($self) = shift;
- my($section) = @_;
- if ($section eq 'dynamic') {
- print STDOUT "Warning (non-fatal): Target 'dynamic' depends on targets ",
- "in skipped section 'dynamic_bs'\n"
- if $self->{SKIPHASH}{dynamic_bs} && $Verbose;
- print STDOUT "Warning (non-fatal): Target 'dynamic' depends on targets ",
- "in skipped section 'dynamic_lib'\n"
- if $self->{SKIPHASH}{dynamic_lib} && $Verbose;
- }
- if ($section eq 'dynamic_lib') {
- print STDOUT "Warning (non-fatal): Target '\$(INST_DYNAMIC)' depends on ",
- "targets in skipped section 'dynamic_bs'\n"
- if $self->{SKIPHASH}{dynamic_bs} && $Verbose;
- }
- if ($section eq 'static') {
- print STDOUT "Warning (non-fatal): Target 'static' depends on targets ",
- "in skipped section 'static_lib'\n"
- if $self->{SKIPHASH}{static_lib} && $Verbose;
- }
- return 'skipped' if $self->{SKIPHASH}{$section};
- return '';
-}
-
-sub flush {
- my $self = shift;
-
- my $finalname = $self->{MAKEFILE};
- print STDOUT "Writing $finalname for $self->{NAME}\n";
-
- unlink($finalname, "MakeMaker.tmp", $Is_VMS ? 'Descrip.MMS' : ());
- open(my $fh,">", "MakeMaker.tmp")
- or die "Unable to open MakeMaker.tmp: $!";
-
- for my $chunk (@{$self->{RESULT}}) {
- print $fh "$chunk\n";
- }
-
- close $fh;
- _rename("MakeMaker.tmp", $finalname) or
- warn "rename MakeMaker.tmp => $finalname: $!";
- chmod 0644, $finalname unless $Is_VMS;
-
- my %keep = map { ($_ => 1) } qw(NEEDS_LINKING HAS_LINK_CODE);
-
- if ($self->{PARENT} && !$self->{_KEEP_AFTER_FLUSH}) {
- foreach (keys %$self) { # safe memory
- delete $self->{$_} unless $keep{$_};
- }
- }
-
- system("$Config::Config{eunicefix} $finalname") unless $Config::Config{eunicefix} eq ":";
-}
-
-
-# This is a rename for OS's where the target must be unlinked first.
-sub _rename {
- my($src, $dest) = @_;
- chmod 0666, $dest;
- unlink $dest;
- return rename $src, $dest;
-}
-
-# This is an unlink for OS's where the target must be writable first.
-sub _unlink {
- my @files = @_;
- chmod 0666, @files;
- return unlink @files;
-}
-
-
-# The following mkbootstrap() is only for installations that are calling
-# the pre-4.1 mkbootstrap() from their old Makefiles. This MakeMaker
-# writes Makefiles, that use ExtUtils::Mkbootstrap directly.
-sub mkbootstrap {
- die <<END;
-!!! Your Makefile has been built such a long time ago, !!!
-!!! that is unlikely to work with current MakeMaker. !!!
-!!! Please rebuild your Makefile !!!
-END
-}
-
-# Ditto for mksymlists() as of MakeMaker 5.17
-sub mksymlists {
- die <<END;
-!!! Your Makefile has been built such a long time ago, !!!
-!!! that is unlikely to work with current MakeMaker. !!!
-!!! Please rebuild your Makefile !!!
-END
-}
-
-sub neatvalue {
- my($v) = @_;
- return "undef" unless defined $v;
- my($t) = ref $v;
- return "q[$v]" unless $t;
- if ($t eq 'ARRAY') {
- my(@m, @neat);
- push @m, "[";
- foreach my $elem (@$v) {
- push @neat, "q[$elem]";
- }
- push @m, join ", ", @neat;
- push @m, "]";
- return join "", @m;
- }
- return "$v" unless $t eq 'HASH';
- my(@m, $key, $val);
- while (($key,$val) = each %$v){
- last unless defined $key; # cautious programming in case (undef,undef) is true
- push(@m,"$key=>".neatvalue($val)) ;
- }
- return "{ ".join(', ', at m)." }";
-}
-
-sub selfdocument {
- my($self) = @_;
- my(@m);
- if ($Verbose){
- push @m, "\n# Full list of MakeMaker attribute values:";
- foreach my $key (sort keys %$self){
- next if $key eq 'RESULT' || $key =~ /^[A-Z][a-z]/;
- my($v) = neatvalue($self->{$key});
- $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/;
- $v =~ tr/\n/ /s;
- push @m, "# $key => $v";
- }
- }
- join "\n", @m;
-}
-
-1;
-
-__END__
-
-=head1 NAME
-
-ExtUtils::MakeMaker - Create a module Makefile
-
-=head1 SYNOPSIS
-
- use ExtUtils::MakeMaker;
-
- WriteMakefile( ATTRIBUTE => VALUE [, ...] );
-
-=head1 DESCRIPTION
-
-This utility is designed to write a Makefile for an extension module
-from a Makefile.PL. It is based on the Makefile.SH model provided by
-Andy Dougherty and the perl5-porters.
-
-It splits the task of generating the Makefile into several subroutines
-that can be individually overridden. Each subroutine returns the text
-it wishes to have written to the Makefile.
-
-MakeMaker is object oriented. Each directory below the current
-directory that contains a Makefile.PL is treated as a separate
-object. This makes it possible to write an unlimited number of
-Makefiles with a single invocation of WriteMakefile().
-
-=head2 How To Write A Makefile.PL
-
-See ExtUtils::MakeMaker::Tutorial.
-
-The long answer is the rest of the manpage :-)
-
-=head2 Default Makefile Behaviour
-
-The generated Makefile enables the user of the extension to invoke
-
- perl Makefile.PL # optionally "perl Makefile.PL verbose"
- make
- make test # optionally set TEST_VERBOSE=1
- make install # See below
-
-The Makefile to be produced may be altered by adding arguments of the
-form C<KEY=VALUE>. E.g.
-
- perl Makefile.PL INSTALL_BASE=~
-
-Other interesting targets in the generated Makefile are
-
- make config # to check if the Makefile is up-to-date
- make clean # delete local temp files (Makefile gets renamed)
- make realclean # delete derived files (including ./blib)
- make ci # check in all the files in the MANIFEST file
- make dist # see below the Distribution Support section
-
-=head2 make test
-
-MakeMaker checks for the existence of a file named F<test.pl> in the
-current directory and if it exists it execute the script with the
-proper set of perl C<-I> options.
-
-MakeMaker also checks for any files matching glob("t/*.t"). It will
-execute all matching files in alphabetical order via the
-L<Test::Harness> module with the C<-I> switches set correctly.
-
-If you'd like to see the raw output of your tests, set the
-C<TEST_VERBOSE> variable to true.
-
- make test TEST_VERBOSE=1
-
-=head2 make testdb
-
-A useful variation of the above is the target C<testdb>. It runs the
-test under the Perl debugger (see L<perldebug>). If the file
-F<test.pl> exists in the current directory, it is used for the test.
-
-If you want to debug some other testfile, set the C<TEST_FILE> variable
-thusly:
-
- make testdb TEST_FILE=t/mytest.t
-
-By default the debugger is called using C<-d> option to perl. If you
-want to specify some other option, set the C<TESTDB_SW> variable:
-
- make testdb TESTDB_SW=-Dx
-
-=head2 make install
-
-make alone puts all relevant files into directories that are named by
-the macros INST_LIB, INST_ARCHLIB, INST_SCRIPT, INST_MAN1DIR and
-INST_MAN3DIR. All these default to something below ./blib if you are
-I<not> building below the perl source directory. If you I<are>
-building below the perl source, INST_LIB and INST_ARCHLIB default to
-../../lib, and INST_SCRIPT is not defined.
-
-The I<install> target of the generated Makefile copies the files found
-below each of the INST_* directories to their INSTALL*
-counterparts. Which counterparts are chosen depends on the setting of
-INSTALLDIRS according to the following table:
-
- INSTALLDIRS set to
- perl site vendor
-
- PERLPREFIX SITEPREFIX VENDORPREFIX
- INST_ARCHLIB INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH
- INST_LIB INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB
- INST_BIN INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN
- INST_SCRIPT INSTALLSCRIPT INSTALLSITESCRIPT INSTALLVENDORSCRIPT
- INST_MAN1DIR INSTALLMAN1DIR INSTALLSITEMAN1DIR INSTALLVENDORMAN1DIR
- INST_MAN3DIR INSTALLMAN3DIR INSTALLSITEMAN3DIR INSTALLVENDORMAN3DIR
-
-The INSTALL... macros in turn default to their %Config
-($Config{installprivlib}, $Config{installarchlib}, etc.) counterparts.
-
-You can check the values of these variables on your system with
-
- perl '-V:install.*'
-
-And to check the sequence in which the library directories are
-searched by perl, run
-
- perl -le 'print join $/, @INC'
-
-Sometimes older versions of the module you're installing live in other
-directories in @INC. Because Perl loads the first version of a module it
-finds, not the newest, you might accidentally get one of these older
-versions even after installing a brand new version. To delete I<all other
-versions of the module you're installing> (not simply older ones) set the
-C<UNINST> variable.
-
- make install UNINST=1
-
-
-=head2 INSTALL_BASE
-
-INSTALL_BASE can be passed into Makefile.PL to change where your
-module will be installed. INSTALL_BASE is more like what everyone
-else calls "prefix" than PREFIX is.
-
-To have everything installed in your home directory, do the following.
-
- # Unix users, INSTALL_BASE=~ works fine
- perl Makefile.PL INSTALL_BASE=/path/to/your/home/dir
-
-Like PREFIX, it sets several INSTALL* attributes at once. Unlike
-PREFIX it is easy to predict where the module will end up. The
-installation pattern looks like this:
-
- INSTALLARCHLIB INSTALL_BASE/lib/perl5/$Config{archname}
- INSTALLPRIVLIB INSTALL_BASE/lib/perl5
- INSTALLBIN INSTALL_BASE/bin
- INSTALLSCRIPT INSTALL_BASE/bin
- INSTALLMAN1DIR INSTALL_BASE/man/man1
- INSTALLMAN3DIR INSTALL_BASE/man/man3
-
-INSTALL_BASE in MakeMaker and C<--install_base> in Module::Build (as
-of 0.28) install to the same location. If you want MakeMaker and
-Module::Build to install to the same location simply set INSTALL_BASE
-and C<--install_base> to the same location.
-
-INSTALL_BASE was added in 6.31.
-
-
-=head2 PREFIX and LIB attribute
-
-PREFIX and LIB can be used to set several INSTALL* attributes in one
-go. Here's an example for installing into your home directory.
-
- # Unix users, PREFIX=~ works fine
- perl Makefile.PL PREFIX=/path/to/your/home/dir
-
-This will install all files in the module under your home directory,
-with man pages and libraries going into an appropriate place (usually
-~/man and ~/lib). How the exact location is determined is complicated
-and depends on how your Perl was configured. INSTALL_BASE works more
-like what other build systems call "prefix" than PREFIX and we
-recommend you use that instead.
-
-Another way to specify many INSTALL directories with a single
-parameter is LIB.
-
- perl Makefile.PL LIB=~/lib
-
-This will install the module's architecture-independent files into
-~/lib, the architecture-dependent files into ~/lib/$archname.
-
-Note, that in both cases the tilde expansion is done by MakeMaker, not
-by perl by default, nor by make.
-
-Conflicts between parameters LIB, PREFIX and the various INSTALL*
-arguments are resolved so that:
-
-=over 4
-
-=item *
-
-setting LIB overrides any setting of INSTALLPRIVLIB, INSTALLARCHLIB,
-INSTALLSITELIB, INSTALLSITEARCH (and they are not affected by PREFIX);
-
-=item *
-
-without LIB, setting PREFIX replaces the initial C<$Config{prefix}>
-part of those INSTALL* arguments, even if the latter are explicitly
-set (but are set to still start with C<$Config{prefix}>).
-
-=back
-
-If the user has superuser privileges, and is not working on AFS or
-relatives, then the defaults for INSTALLPRIVLIB, INSTALLARCHLIB,
-INSTALLSCRIPT, etc. will be appropriate, and this incantation will be
-the best:
-
- perl Makefile.PL;
- make;
- make test
- make install
-
-make install per default writes some documentation of what has been
-done into the file C<$(INSTALLARCHLIB)/perllocal.pod>. This feature
-can be bypassed by calling make pure_install.
-
-=head2 AFS users
-
-will have to specify the installation directories as these most
-probably have changed since perl itself has been installed. They will
-have to do this by calling
-
- perl Makefile.PL INSTALLSITELIB=/afs/here/today \
- INSTALLSCRIPT=/afs/there/now INSTALLMAN3DIR=/afs/for/manpages
- make
-
-Be careful to repeat this procedure every time you recompile an
-extension, unless you are sure the AFS installation directories are
-still valid.
-
-=head2 Static Linking of a new Perl Binary
-
-An extension that is built with the above steps is ready to use on
-systems supporting dynamic loading. On systems that do not support
-dynamic loading, any newly created extension has to be linked together
-with the available resources. MakeMaker supports the linking process
-by creating appropriate targets in the Makefile whenever an extension
-is built. You can invoke the corresponding section of the makefile with
-
- make perl
-
-That produces a new perl binary in the current directory with all
-extensions linked in that can be found in INST_ARCHLIB, SITELIBEXP,
-and PERL_ARCHLIB. To do that, MakeMaker writes a new Makefile, on
-UNIX, this is called Makefile.aperl (may be system dependent). If you
-want to force the creation of a new perl, it is recommended, that you
-delete this Makefile.aperl, so the directories are searched-through
-for linkable libraries again.
-
-The binary can be installed into the directory where perl normally
-resides on your machine with
-
- make inst_perl
-
-To produce a perl binary with a different name than C<perl>, either say
-
- perl Makefile.PL MAP_TARGET=myperl
- make myperl
- make inst_perl
-
-or say
-
- perl Makefile.PL
- make myperl MAP_TARGET=myperl
- make inst_perl MAP_TARGET=myperl
-
-In any case you will be prompted with the correct invocation of the
-C<inst_perl> target that installs the new binary into INSTALLBIN.
-
-make inst_perl per default writes some documentation of what has been
-done into the file C<$(INSTALLARCHLIB)/perllocal.pod>. This
-can be bypassed by calling make pure_inst_perl.
-
-Warning: the inst_perl: target will most probably overwrite your
-existing perl binary. Use with care!
-
-Sometimes you might want to build a statically linked perl although
-your system supports dynamic loading. In this case you may explicitly
-set the linktype with the invocation of the Makefile.PL or make:
-
- perl Makefile.PL LINKTYPE=static # recommended
-
-or
-
- make LINKTYPE=static # works on most systems
-
-=head2 Determination of Perl Library and Installation Locations
-
-MakeMaker needs to know, or to guess, where certain things are
-located. Especially INST_LIB and INST_ARCHLIB (where to put the files
-during the make(1) run), PERL_LIB and PERL_ARCHLIB (where to read
-existing modules from), and PERL_INC (header files and C<libperl*.*>).
-
-Extensions may be built either using the contents of the perl source
-directory tree or from the installed perl library. The recommended way
-is to build extensions after you have run 'make install' on perl
-itself. You can do that in any directory on your hard disk that is not
-below the perl source tree. The support for extensions below the ext
-directory of the perl distribution is only good for the standard
-extensions that come with perl.
-
-If an extension is being built below the C<ext/> directory of the perl
-source then MakeMaker will set PERL_SRC automatically (e.g.,
-C<../..>). If PERL_SRC is defined and the extension is recognized as
-a standard extension, then other variables default to the following:
-
- PERL_INC = PERL_SRC
- PERL_LIB = PERL_SRC/lib
- PERL_ARCHLIB = PERL_SRC/lib
- INST_LIB = PERL_LIB
- INST_ARCHLIB = PERL_ARCHLIB
-
-If an extension is being built away from the perl source then MakeMaker
-will leave PERL_SRC undefined and default to using the installed copy
-of the perl library. The other variables default to the following:
-
- PERL_INC = $archlibexp/CORE
- PERL_LIB = $privlibexp
- PERL_ARCHLIB = $archlibexp
- INST_LIB = ./blib/lib
- INST_ARCHLIB = ./blib/arch
-
-If perl has not yet been installed then PERL_SRC can be defined on the
-command line as shown in the previous section.
-
-
-=head2 Which architecture dependent directory?
-
-If you don't want to keep the defaults for the INSTALL* macros,
-MakeMaker helps you to minimize the typing needed: the usual
-relationship between INSTALLPRIVLIB and INSTALLARCHLIB is determined
-by Configure at perl compilation time. MakeMaker supports the user who
-sets INSTALLPRIVLIB. If INSTALLPRIVLIB is set, but INSTALLARCHLIB not,
-then MakeMaker defaults the latter to be the same subdirectory of
-INSTALLPRIVLIB as Configure decided for the counterparts in %Config ,
-otherwise it defaults to INSTALLPRIVLIB. The same relationship holds
-for INSTALLSITELIB and INSTALLSITEARCH.
-
-MakeMaker gives you much more freedom than needed to configure
-internal variables and get different results. It is worth to mention,
-that make(1) also lets you configure most of the variables that are
-used in the Makefile. But in the majority of situations this will not
-be necessary, and should only be done if the author of a package
-recommends it (or you know what you're doing).
-
-=head2 Using Attributes and Parameters
-
-The following attributes may be specified as arguments to WriteMakefile()
-or as NAME=VALUE pairs on the command line.
-
-=over 2
-
-=item ABSTRACT
-
-One line description of the module. Will be included in PPD file.
-
-=item ABSTRACT_FROM
-
-Name of the file that contains the package description. MakeMaker looks
-for a line in the POD matching /^($package\s-\s)(.*)/. This is typically
-the first line in the "=head1 NAME" section. $2 becomes the abstract.
-
-=item AUTHOR
-
-String containing name (and email address) of package author(s). Is used
-in PPD (Perl Package Description) files for PPM (Perl Package Manager).
-
-=item BINARY_LOCATION
-
-Used when creating PPD files for binary packages. It can be set to a
-full or relative path or URL to the binary archive for a particular
-architecture. For example:
-
- perl Makefile.PL BINARY_LOCATION=x86/Agent.tar.gz
-
-builds a PPD package that references a binary of the C<Agent> package,
-located in the C<x86> directory relative to the PPD itself.
-
-=item BUILD_REQUIRES
-
-A hash of modules that are needed to build your module but not run it.
-
-This will go into the C<build_requires> field of your F<META.yml>.
-
-The format is the same as PREREQ_PM.
-
-=item C
-
-Ref to array of *.c file names. Initialised from a directory scan
-and the values portion of the XS attribute hash. This is not
-currently used by MakeMaker but may be handy in Makefile.PLs.
-
-=item CCFLAGS
-
-String that will be included in the compiler call command line between
-the arguments INC and OPTIMIZE.
-
-=item CONFIG
-
-Arrayref. E.g. [qw(archname manext)] defines ARCHNAME & MANEXT from
-config.sh. MakeMaker will add to CONFIG the following values anyway:
-ar
-cc
-cccdlflags
-ccdlflags
-dlext
-dlsrc
-ld
-lddlflags
-ldflags
-libc
-lib_ext
-obj_ext
-ranlib
-sitelibexp
-sitearchexp
-so
-
-=item CONFIGURE
-
-CODE reference. The subroutine should return a hash reference. The
-hash may contain further attributes, e.g. {LIBS =E<gt> ...}, that have to
-be determined by some evaluation method.
-
-=item CONFIGURE_REQUIRES
-
-A hash of modules that are required to run Makefile.PL itself, but not
-to run your distribution.
-
-This will go into the C<configure_requires> field of your F<META.yml>.
-
-Defaults to C<{ "ExtUtils::MakeMaker" => 0 }>
-
-The format is the same as PREREQ_PM.
-
-=item DEFINE
-
-Something like C<"-DHAVE_UNISTD_H">
-
-=item DESTDIR
-
-This is the root directory into which the code will be installed. It
-I<prepends itself to the normal prefix>. For example, if your code
-would normally go into F</usr/local/lib/perl> you could set DESTDIR=~/tmp/
-and installation would go into F<~/tmp/usr/local/lib/perl>.
-
-This is primarily of use for people who repackage Perl modules.
-
-NOTE: Due to the nature of make, it is important that you put the trailing
-slash on your DESTDIR. F<~/tmp/> not F<~/tmp>.
-
-=item DIR
-
-Ref to array of subdirectories containing Makefile.PLs e.g. ['sdbm']
-in ext/SDBM_File
-
-=item DISTNAME
-
-A safe filename for the package.
-
-Defaults to NAME above but with :: replaced with -.
-
-For example, Foo::Bar becomes Foo-Bar.
-
-=item DISTVNAME
-
-Your name for distributing the package with the version number
-included. This is used by 'make dist' to name the resulting archive
-file.
-
-Defaults to DISTNAME-VERSION.
-
-For example, version 1.04 of Foo::Bar becomes Foo-Bar-1.04.
-
-On some OS's where . has special meaning VERSION_SYM may be used in
-place of VERSION.
-
-=item DL_FUNCS
-
-Hashref of symbol names for routines to be made available as universal
-symbols. Each key/value pair consists of the package name and an
-array of routine names in that package. Used only under AIX, OS/2,
-VMS and Win32 at present. The routine names supplied will be expanded
-in the same way as XSUB names are expanded by the XS() macro.
-Defaults to
-
- {"$(NAME)" => ["boot_$(NAME)" ] }
-
-e.g.
-
- {"RPC" => [qw( boot_rpcb rpcb_gettime getnetconfigent )],
- "NetconfigPtr" => [ 'DESTROY'] }
-
-Please see the L<ExtUtils::Mksymlists> documentation for more information
-about the DL_FUNCS, DL_VARS and FUNCLIST attributes.
-
-=item DL_VARS
-
-Array of symbol names for variables to be made available as universal symbols.
-Used only under AIX, OS/2, VMS and Win32 at present. Defaults to [].
-(e.g. [ qw(Foo_version Foo_numstreams Foo_tree ) ])
-
-=item EXCLUDE_EXT
-
-Array of extension names to exclude when doing a static build. This
-is ignored if INCLUDE_EXT is present. Consult INCLUDE_EXT for more
-details. (e.g. [ qw( Socket POSIX ) ] )
-
-This attribute may be most useful when specified as a string on the
-command line: perl Makefile.PL EXCLUDE_EXT='Socket Safe'
-
-=item EXE_FILES
-
-Ref to array of executable files. The files will be copied to the
-INST_SCRIPT directory. Make realclean will delete them from there
-again.
-
-If your executables start with something like #!perl or
-#!/usr/bin/perl MakeMaker will change this to the path of the perl
-'Makefile.PL' was invoked with so the programs will be sure to run
-properly even if perl is not in /usr/bin/perl.
-
-=item FIRST_MAKEFILE
-
-The name of the Makefile to be produced. This is used for the second
-Makefile that will be produced for the MAP_TARGET.
-
-Defaults to 'Makefile' or 'Descrip.MMS' on VMS.
-
-(Note: we couldn't use MAKEFILE because dmake uses this for something
-else).
-
-=item FULLPERL
-
-Perl binary able to run this extension, load XS modules, etc...
-
-=item FULLPERLRUN
-
-Like PERLRUN, except it uses FULLPERL.
-
-=item FULLPERLRUNINST
-
-Like PERLRUNINST, except it uses FULLPERL.
-
-=item FUNCLIST
-
-This provides an alternate means to specify function names to be
-exported from the extension. Its value is a reference to an
-array of function names to be exported by the extension. These
-names are passed through unaltered to the linker options file.
-
-=item H
-
-Ref to array of *.h file names. Similar to C.
-
-=item IMPORTS
-
-This attribute is used to specify names to be imported into the
-extension. Takes a hash ref.
-
-It is only used on OS/2 and Win32.
-
-=item INC
-
-Include file dirs eg: C<"-I/usr/5include -I/path/to/inc">
-
-=item INCLUDE_EXT
-
-Array of extension names to be included when doing a static build.
-MakeMaker will normally build with all of the installed extensions when
-doing a static build, and that is usually the desired behavior. If
-INCLUDE_EXT is present then MakeMaker will build only with those extensions
-which are explicitly mentioned. (e.g. [ qw( Socket POSIX ) ])
-
-It is not necessary to mention DynaLoader or the current extension when
-filling in INCLUDE_EXT. If the INCLUDE_EXT is mentioned but is empty then
-only DynaLoader and the current extension will be included in the build.
-
-This attribute may be most useful when specified as a string on the
-command line: perl Makefile.PL INCLUDE_EXT='POSIX Socket Devel::Peek'
-
-=item INSTALLARCHLIB
-
-Used by 'make install', which copies files from INST_ARCHLIB to this
-directory if INSTALLDIRS is set to perl.
-
-=item INSTALLBIN
-
-Directory to install binary files (e.g. tkperl) into if
-INSTALLDIRS=perl.
-
-=item INSTALLDIRS
-
-Determines which of the sets of installation directories to choose:
-perl, site or vendor. Defaults to site.
-
-=item INSTALLMAN1DIR
-
-=item INSTALLMAN3DIR
-
-These directories get the man pages at 'make install' time if
-INSTALLDIRS=perl. Defaults to $Config{installman*dir}.
-
-If set to 'none', no man pages will be installed.
-
-=item INSTALLPRIVLIB
-
-Used by 'make install', which copies files from INST_LIB to this
-directory if INSTALLDIRS is set to perl.
-
-Defaults to $Config{installprivlib}.
-
-=item INSTALLSCRIPT
-
-Used by 'make install' which copies files from INST_SCRIPT to this
-directory if INSTALLDIRS=perl.
-
-=item INSTALLSITEARCH
-
-Used by 'make install', which copies files from INST_ARCHLIB to this
-directory if INSTALLDIRS is set to site (default).
-
-=item INSTALLSITEBIN
-
-Used by 'make install', which copies files from INST_BIN to this
-directory if INSTALLDIRS is set to site (default).
-
-=item INSTALLSITELIB
-
-Used by 'make install', which copies files from INST_LIB to this
-directory if INSTALLDIRS is set to site (default).
-
-=item INSTALLSITEMAN1DIR
-
-=item INSTALLSITEMAN3DIR
-
-These directories get the man pages at 'make install' time if
-INSTALLDIRS=site (default). Defaults to
-$(SITEPREFIX)/man/man$(MAN*EXT).
-
-If set to 'none', no man pages will be installed.
-
-=item INSTALLSITESCRIPT
-
-Used by 'make install' which copies files from INST_SCRIPT to this
-directory if INSTALLDIRS is set to site (default).
-
-=item INSTALLVENDORARCH
-
-Used by 'make install', which copies files from INST_ARCHLIB to this
-directory if INSTALLDIRS is set to vendor.
-
-=item INSTALLVENDORBIN
-
-Used by 'make install', which copies files from INST_BIN to this
-directory if INSTALLDIRS is set to vendor.
-
-=item INSTALLVENDORLIB
-
-Used by 'make install', which copies files from INST_LIB to this
-directory if INSTALLDIRS is set to vendor.
-
-=item INSTALLVENDORMAN1DIR
-
-=item INSTALLVENDORMAN3DIR
-
-These directories get the man pages at 'make install' time if
-INSTALLDIRS=vendor. Defaults to $(VENDORPREFIX)/man/man$(MAN*EXT).
-
-If set to 'none', no man pages will be installed.
-
-=item INSTALLVENDORSCRIPT
-
-Used by 'make install' which copies files from INST_SCRIPT to this
-directory if INSTALLDIRS is set to vendor.
-
-=item INST_ARCHLIB
-
-Same as INST_LIB for architecture dependent files.
-
-=item INST_BIN
-
-Directory to put real binary files during 'make'. These will be copied
-to INSTALLBIN during 'make install'
-
-=item INST_LIB
-
-Directory where we put library files of this extension while building
-it.
-
-=item INST_MAN1DIR
-
-Directory to hold the man pages at 'make' time
-
-=item INST_MAN3DIR
-
-Directory to hold the man pages at 'make' time
-
-=item INST_SCRIPT
-
-Directory, where executable files should be installed during
-'make'. Defaults to "./blib/script", just to have a dummy location during
-testing. make install will copy the files in INST_SCRIPT to
-INSTALLSCRIPT.
-
-=item LD
-
-Program to be used to link libraries for dynamic loading.
-
-Defaults to $Config{ld}.
-
-=item LDDLFLAGS
-
-Any special flags that might need to be passed to ld to create a
-shared library suitable for dynamic loading. It is up to the makefile
-to use it. (See L<Config/lddlflags>)
-
-Defaults to $Config{lddlflags}.
-
-=item LDFROM
-
-Defaults to "$(OBJECT)" and is used in the ld command to specify
-what files to link/load from (also see dynamic_lib below for how to
-specify ld flags)
-
-=item LIB
-
-LIB should only be set at C<perl Makefile.PL> time but is allowed as a
-MakeMaker argument. It has the effect of setting both INSTALLPRIVLIB
-and INSTALLSITELIB to that value regardless any explicit setting of
-those arguments (or of PREFIX). INSTALLARCHLIB and INSTALLSITEARCH
-are set to the corresponding architecture subdirectory.
-
-=item LIBPERL_A
-
-The filename of the perllibrary that will be used together with this
-extension. Defaults to libperl.a.
-
-=item LIBS
-
-An anonymous array of alternative library
-specifications to be searched for (in order) until
-at least one library is found. E.g.
-
- 'LIBS' => ["-lgdbm", "-ldbm -lfoo", "-L/path -ldbm.nfs"]
-
-Mind, that any element of the array
-contains a complete set of arguments for the ld
-command. So do not specify
-
- 'LIBS' => ["-ltcl", "-ltk", "-lX11"]
-
-See ODBM_File/Makefile.PL for an example, where an array is needed. If
-you specify a scalar as in
-
- 'LIBS' => "-ltcl -ltk -lX11"
-
-MakeMaker will turn it into an array with one element.
-
-=item LICENSE
-
-The licensing terms of your distribution. Generally its "perl" for the
-same license as Perl itself.
-
-See L<Module::Build::API> for the list of options.
-
-Defaults to "unknown".
-
-=item LINKTYPE
-
-'static' or 'dynamic' (default unless usedl=undef in
-config.sh). Should only be used to force static linking (also see
-linkext below).
-
-=item MAKE
-
-Variant of make you intend to run the generated Makefile with. This
-parameter lets Makefile.PL know what make quirks to account for when
-generating the Makefile.
-
-MakeMaker also honors the MAKE environment variable. This parameter
-takes precedent.
-
-Currently the only significant values are 'dmake' and 'nmake' for Windows
-users.
-
-Defaults to $Config{make}.
-
-=item MAKEAPERL
-
-Boolean which tells MakeMaker, that it should include the rules to
-make a perl. This is handled automatically as a switch by
-MakeMaker. The user normally does not need it.
-
-=item MAKEFILE_OLD
-
-When 'make clean' or similar is run, the $(FIRST_MAKEFILE) will be
-backed up at this location.
-
-Defaults to $(FIRST_MAKEFILE).old or $(FIRST_MAKEFILE)_old on VMS.
-
-=item MAN1PODS
-
-Hashref of pod-containing files. MakeMaker will default this to all
-EXE_FILES files that include POD directives. The files listed
-here will be converted to man pages and installed as was requested
-at Configure time.
-
-This hash should map POD files (or scripts containing POD) to the
-man file names under the C<blib/man1/> directory, as in the following
-example:
-
- MAN1PODS => {
- 'doc/command.pod' => 'blib/man1/command.1',
- 'scripts/script.pl' => 'blib/man1/script.1',
- }
-
-=item MAN3PODS
-
-Hashref that assigns to *.pm and *.pod files the files into which the
-manpages are to be written. MakeMaker parses all *.pod and *.pm files
-for POD directives. Files that contain POD will be the default keys of
-the MAN3PODS hashref. These will then be converted to man pages during
-C<make> and will be installed during C<make install>.
-
-Example similar to MAN1PODS.
-
-=item MAP_TARGET
-
-If it is intended, that a new perl binary be produced, this variable
-may hold a name for that binary. Defaults to perl
-
-=item META_ADD
-
-=item META_MERGE
-
-A hashrefs of items to add to the F<META.yml>.
-
-They differ in how they behave if they have the same key as the
-default metadata. META_ADD will override the default value with it's
-own. META_MERGE will merge its value with the default.
-
-Unless you want to override the defaults, prefer META_MERGE so as to
-get the advantage of any future defaults.
-
-=item MIN_PERL_VERSION
-
-The minimum required version of Perl for this distribution.
-
-Either 5.006001 or 5.6.1 format is acceptable.
-
-=item MYEXTLIB
-
-If the extension links to a library that it builds set this to the
-name of the library (see SDBM_File)
-
-=item NAME
-
-Perl module name for this extension (DBD::Oracle). This will default
-to the directory name but should be explicitly defined in the
-Makefile.PL.
-
-=item NEEDS_LINKING
-
-MakeMaker will figure out if an extension contains linkable code
-anywhere down the directory tree, and will set this variable
-accordingly, but you can speed it up a very little bit if you define
-this boolean variable yourself.
-
-=item NOECHO
-
-Command so make does not print the literal commands its running.
-
-By setting it to an empty string you can generate a Makefile that
-prints all commands. Mainly used in debugging MakeMaker itself.
-
-Defaults to C<@>.
-
-=item NORECURS
-
-Boolean. Attribute to inhibit descending into subdirectories.
-
-=item NO_META
-
-When true, suppresses the generation and addition to the MANIFEST of
-the META.yml module meta-data file during 'make distdir'.
-
-Defaults to false.
-
-=item NO_VC
-
-In general, any generated Makefile checks for the current version of
-MakeMaker and the version the Makefile was built under. If NO_VC is
-set, the version check is neglected. Do not write this into your
-Makefile.PL, use it interactively instead.
-
-=item OBJECT
-
-List of object files, defaults to '$(BASEEXT)$(OBJ_EXT)', but can be a long
-string containing all object files, e.g. "tkpBind.o
-tkpButton.o tkpCanvas.o"
-
-(Where BASEEXT is the last component of NAME, and OBJ_EXT is $Config{obj_ext}.)
-
-=item OPTIMIZE
-
-Defaults to C<-O>. Set it to C<-g> to turn debugging on. The flag is
-passed to subdirectory makes.
-
-=item PERL
-
-Perl binary for tasks that can be done by miniperl
-
-=item PERL_CORE
-
-Set only when MakeMaker is building the extensions of the Perl core
-distribution.
-
-=item PERLMAINCC
-
-The call to the program that is able to compile perlmain.c. Defaults
-to $(CC).
-
-=item PERL_ARCHLIB
-
-Same as for PERL_LIB, but for architecture dependent files.
-
-Used only when MakeMaker is building the extensions of the Perl core
-distribution (because normally $(PERL_ARCHLIB) is automatically in @INC,
-and adding it would get in the way of PERL5LIB).
-
-=item PERL_LIB
-
-Directory containing the Perl library to use.
-
-Used only when MakeMaker is building the extensions of the Perl core
-distribution (because normally $(PERL_LIB) is automatically in @INC,
-and adding it would get in the way of PERL5LIB).
-
-=item PERL_MALLOC_OK
-
-defaults to 0. Should be set to TRUE if the extension can work with
-the memory allocation routines substituted by the Perl malloc() subsystem.
-This should be applicable to most extensions with exceptions of those
-
-=over 4
-
-=item *
-
-with bugs in memory allocations which are caught by Perl's malloc();
-
-=item *
-
-which interact with the memory allocator in other ways than via
-malloc(), realloc(), free(), calloc(), sbrk() and brk();
-
-=item *
-
-which rely on special alignment which is not provided by Perl's malloc().
-
-=back
-
-B<NOTE.> Negligence to set this flag in I<any one> of loaded extension
-nullifies many advantages of Perl's malloc(), such as better usage of
-system resources, error detection, memory usage reporting, catchable failure
-of memory allocations, etc.
-
-=item PERLPREFIX
-
-Directory under which core modules are to be installed.
-
-Defaults to $Config{installprefixexp} falling back to
-$Config{installprefix}, $Config{prefixexp} or $Config{prefix} should
-$Config{installprefixexp} not exist.
-
-Overridden by PREFIX.
-
-=item PERLRUN
-
-Use this instead of $(PERL) when you wish to run perl. It will set up
-extra necessary flags for you.
-
-=item PERLRUNINST
-
-Use this instead of $(PERL) when you wish to run perl to work with
-modules. It will add things like -I$(INST_ARCH) and other necessary
-flags so perl can see the modules you're about to install.
-
-=item PERL_SRC
-
-Directory containing the Perl source code (use of this should be
-avoided, it may be undefined)
-
-=item PERM_DIR
-
-Desired permission for directories. Defaults to C<755>.
-
-=item PERM_RW
-
-Desired permission for read/writable files. Defaults to C<644>.
-
-=item PERM_RWX
-
-Desired permission for executable files. Defaults to C<755>.
-
-=item PL_FILES
-
-MakeMaker can run programs to generate files for you at build time.
-By default any file named *.PL (except Makefile.PL and Build.PL) in
-the top level directory will be assumed to be a Perl program and run
-passing its own basename in as an argument. For example...
-
- perl foo.PL foo
-
-This behavior can be overridden by supplying your own set of files to
-search. PL_FILES accepts a hash ref, the key being the file to run
-and the value is passed in as the first argument when the PL file is run.
-
- PL_FILES => {'bin/foobar.PL' => 'bin/foobar'}
-
-Would run bin/foobar.PL like this:
-
- perl bin/foobar.PL bin/foobar
-
-If multiple files from one program are desired an array ref can be used.
-
- PL_FILES => {'bin/foobar.PL' => [qw(bin/foobar1 bin/foobar2)]}
-
-In this case the program will be run multiple times using each target file.
-
- perl bin/foobar.PL bin/foobar1
- perl bin/foobar.PL bin/foobar2
-
-PL files are normally run B<after> pm_to_blib and include INST_LIB and
-INST_ARCH in its C<@INC> so the just built modules can be
-accessed... unless the PL file is making a module (or anything else in
-PM) in which case it is run B<before> pm_to_blib and does not include
-INST_LIB and INST_ARCH in its C<@INC>. This apparently odd behavior
-is there for backwards compatibility (and its somewhat DWIM).
-
-
-=item PM
-
-Hashref of .pm files and *.pl files to be installed. e.g.
-
- {'name_of_file.pm' => '$(INST_LIBDIR)/install_as.pm'}
-
-By default this will include *.pm and *.pl and the files found in
-the PMLIBDIRS directories. Defining PM in the
-Makefile.PL will override PMLIBDIRS.
-
-=item PMLIBDIRS
-
-Ref to array of subdirectories containing library files. Defaults to
-[ 'lib', $(BASEEXT) ]. The directories will be scanned and I<any> files
-they contain will be installed in the corresponding location in the
-library. A libscan() method can be used to alter the behaviour.
-Defining PM in the Makefile.PL will override PMLIBDIRS.
-
-(Where BASEEXT is the last component of NAME.)
-
-=item PM_FILTER
-
-A filter program, in the traditional Unix sense (input from stdin, output
-to stdout) that is passed on each .pm file during the build (in the
-pm_to_blib() phase). It is empty by default, meaning no filtering is done.
-
-Great care is necessary when defining the command if quoting needs to be
-done. For instance, you would need to say:
-
- {'PM_FILTER' => 'grep -v \\"^\\#\\"'}
-
-to remove all the leading comments on the fly during the build. The
-extra \\ are necessary, unfortunately, because this variable is interpolated
-within the context of a Perl program built on the command line, and double
-quotes are what is used with the -e switch to build that command line. The
-# is escaped for the Makefile, since what is going to be generated will then
-be:
-
- PM_FILTER = grep -v \"^\#\"
-
-Without the \\ before the #, we'd have the start of a Makefile comment,
-and the macro would be incorrectly defined.
-
-=item POLLUTE
-
-Release 5.005 grandfathered old global symbol names by providing preprocessor
-macros for extension source compatibility. As of release 5.6, these
-preprocessor definitions are not available by default. The POLLUTE flag
-specifies that the old names should still be defined:
-
- perl Makefile.PL POLLUTE=1
-
-Please inform the module author if this is necessary to successfully install
-a module under 5.6 or later.
-
-=item PPM_INSTALL_EXEC
-
-Name of the executable used to run C<PPM_INSTALL_SCRIPT> below. (e.g. perl)
-
-=item PPM_INSTALL_SCRIPT
-
-Name of the script that gets executed by the Perl Package Manager after
-the installation of a package.
-
-=item PREFIX
-
-This overrides all the default install locations. Man pages,
-libraries, scripts, etc... MakeMaker will try to make an educated
-guess about where to place things under the new PREFIX based on your
-Config defaults. Failing that, it will fall back to a structure
-which should be sensible for your platform.
-
-If you specify LIB or any INSTALL* variables they will not be effected
-by the PREFIX.
-
-=item PREREQ_FATAL
-
-Bool. If this parameter is true, failing to have the required modules
-(or the right versions thereof) will be fatal. C<perl Makefile.PL>
-will C<die> instead of simply informing the user of the missing dependencies.
-
-It is I<extremely> rare to have to use C<PREREQ_FATAL>. Its use by module
-authors is I<strongly discouraged> and should never be used lightly.
-Module installation tools have ways of resolving umet dependencies but
-to do that they need a F<Makefile>. Using C<PREREQ_FATAL> breaks this.
-That's bad.
-
-The only situation where it is appropriate is when you have
-dependencies that are indispensible to actually I<write> a
-F<Makefile>. For example, MakeMaker's F<Makefile.PL> needs L<File::Spec>.
-If its not available it cannot write the F<Makefile>.
-
-Note: see L<Test::Harness> for a shortcut for stopping tests early
-if you are missing dependencies and are afraid that users might
-use your module with an incomplete environment.
-
-=item PREREQ_PM
-
-A hash of modules that are needed to run your module. The keys are
-the module names ie. Test::More, and the minimum version is the
-value. If the required version number is 0 any version will do.
-
-This will go into the C<requires> field of your F<META.yml>.
-
- PREREQ_PM => {
- # Require Test::More at least 0.47
- "Test::More" => "0.47",
-
- # Require any version of Acme::Buffy
- "Acme::Buffy" => 0,
- }
-
-=item PREREQ_PRINT
-
-Bool. If this parameter is true, the prerequisites will be printed to
-stdout and MakeMaker will exit. The output format is an evalable hash
-ref.
-
- $PREREQ_PM = {
- 'A::B' => Vers1,
- 'C::D' => Vers2,
- ...
- };
-
-If a distribution defines a minimal required perl version, this is
-added to the output as an additional line of the form:
-
- $MIN_PERL_VERSION = '5.008001';
-
-If BUILD_REQUIRES is not empty, it will be dumped as $BUILD_REQUIRES hasref.
-
-=item PRINT_PREREQ
-
-RedHatism for C<PREREQ_PRINT>. The output format is different, though:
-
- perl(A::B)>=Vers1 perl(C::D)>=Vers2 ...
-
-A minimal required perl version, if present, will look like this:
-
- perl(perl)>=5.008001
-
-=item SITEPREFIX
-
-Like PERLPREFIX, but only for the site install locations.
-
-Defaults to $Config{siteprefixexp}. Perls prior to 5.6.0 didn't have
-an explicit siteprefix in the Config. In those cases
-$Config{installprefix} will be used.
-
-Overridable by PREFIX
-
-=item SIGN
-
-When true, perform the generation and addition to the MANIFEST of the
-SIGNATURE file in the distdir during 'make distdir', via 'cpansign
--s'.
-
-Note that you need to install the Module::Signature module to
-perform this operation.
-
-Defaults to false.
-
-=item SKIP
-
-Arrayref. E.g. [qw(name1 name2)] skip (do not write) sections of the
-Makefile. Caution! Do not use the SKIP attribute for the negligible
-speedup. It may seriously damage the resulting Makefile. Only use it
-if you really need it.
-
-=item TYPEMAPS
-
-Ref to array of typemap file names. Use this when the typemaps are
-in some directory other than the current directory or when they are
-not named B<typemap>. The last typemap in the list takes
-precedence. A typemap in the current directory has highest
-precedence, even if it isn't listed in TYPEMAPS. The default system
-typemap has lowest precedence.
-
-=item VENDORPREFIX
-
-Like PERLPREFIX, but only for the vendor install locations.
-
-Defaults to $Config{vendorprefixexp}.
-
-Overridable by PREFIX
-
-=item VERBINST
-
-If true, make install will be verbose
-
-=item VERSION
-
-Your version number for distributing the package. This defaults to
-0.1.
-
-=item VERSION_FROM
-
-Instead of specifying the VERSION in the Makefile.PL you can let
-MakeMaker parse a file to determine the version number. The parsing
-routine requires that the file named by VERSION_FROM contains one
-single line to compute the version number. The first line in the file
-that contains the regular expression
-
- /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/
-
-will be evaluated with eval() and the value of the named variable
-B<after> the eval() will be assigned to the VERSION attribute of the
-MakeMaker object. The following lines will be parsed o.k.:
-
- $VERSION = '1.00';
- *VERSION = \'1.01';
- ($VERSION) = q$Revision: 1.1.1.2 $ =~ /(\d+)/g;
- $FOO::VERSION = '1.10';
- *FOO::VERSION = \'1.11';
-
-but these will fail:
-
- # Bad
- my $VERSION = '1.01';
- local $VERSION = '1.02';
- local $FOO::VERSION = '1.30';
-
-"Version strings" are incompatible should not be used.
-
- # Bad
- $VERSION = 1.2.3;
- $VERSION = v1.2.3;
-
-L<version> objects are fine. As of MakeMaker 6.35 version.pm will be
-automatically loaded, but you must declare the dependency on version.pm.
-For compatibility with older MakeMaker you should load on the same line
-as $VERSION is declared.
-
- # All on one line
- use version; our $VERSION = qv(1.2.3);
-
-(Putting C<my> or C<local> on the preceding line will work o.k.)
-
-The file named in VERSION_FROM is not added as a dependency to
-Makefile. This is not really correct, but it would be a major pain
-during development to have to rewrite the Makefile for any smallish
-change in that file. If you want to make sure that the Makefile
-contains the correct VERSION macro after any change of the file, you
-would have to do something like
-
- depend => { Makefile => '$(VERSION_FROM)' }
-
-See attribute C<depend> below.
-
-=item VERSION_SYM
-
-A sanitized VERSION with . replaced by _. For places where . has
-special meaning (some filesystems, RCS labels, etc...)
-
-=item XS
-
-Hashref of .xs files. MakeMaker will default this. e.g.
-
- {'name_of_file.xs' => 'name_of_file.c'}
-
-The .c files will automatically be included in the list of files
-deleted by a make clean.
-
-=item XSOPT
-
-String of options to pass to xsubpp. This might include C<-C++> or
-C<-extern>. Do not include typemaps here; the TYPEMAP parameter exists for
-that purpose.
-
-=item XSPROTOARG
-
-May be set to an empty string, which is identical to C<-prototypes>, or
-C<-noprototypes>. See the xsubpp documentation for details. MakeMaker
-defaults to the empty string.
-
-=item XS_VERSION
-
-Your version number for the .xs file of this package. This defaults
-to the value of the VERSION attribute.
-
-=back
-
-=head2 Additional lowercase attributes
-
-can be used to pass parameters to the methods which implement that
-part of the Makefile. Parameters are specified as a hash ref but are
-passed to the method as a hash.
-
-=over 2
-
-=item clean
-
- {FILES => "*.xyz foo"}
-
-=item depend
-
- {ANY_TARGET => ANY_DEPENDENCY, ...}
-
-(ANY_TARGET must not be given a double-colon rule by MakeMaker.)
-
-=item dist
-
- {TARFLAGS => 'cvfF', COMPRESS => 'gzip', SUFFIX => '.gz',
- SHAR => 'shar -m', DIST_CP => 'ln', ZIP => '/bin/zip',
- ZIPFLAGS => '-rl', DIST_DEFAULT => 'private tardist' }
-
-If you specify COMPRESS, then SUFFIX should also be altered, as it is
-needed to tell make the target file of the compression. Setting
-DIST_CP to ln can be useful, if you need to preserve the timestamps on
-your files. DIST_CP can take the values 'cp', which copies the file,
-'ln', which links the file, and 'best' which copies symbolic links and
-links the rest. Default is 'best'.
-
-=item dynamic_lib
-
- {ARMAYBE => 'ar', OTHERLDFLAGS => '...', INST_DYNAMIC_DEP => '...'}
-
-=item linkext
-
- {LINKTYPE => 'static', 'dynamic' or ''}
-
-NB: Extensions that have nothing but *.pm files had to say
-
- {LINKTYPE => ''}
-
-with Pre-5.0 MakeMakers. Since version 5.00 of MakeMaker such a line
-can be deleted safely. MakeMaker recognizes when there's nothing to
-be linked.
-
-=item macro
-
- {ANY_MACRO => ANY_VALUE, ...}
-
-=item postamble
-
-Anything put here will be passed to MY::postamble() if you have one.
-
-=item realclean
-
- {FILES => '$(INST_ARCHAUTODIR)/*.xyz'}
-
-=item test
-
- {TESTS => 't/*.t'}
-
-=item tool_autosplit
-
- {MAXLEN => 8}
-
-=back
-
-=head2 Overriding MakeMaker Methods
-
-If you cannot achieve the desired Makefile behaviour by specifying
-attributes you may define private subroutines in the Makefile.PL.
-Each subroutine returns the text it wishes to have written to
-the Makefile. To override a section of the Makefile you can
-either say:
-
- sub MY::c_o { "new literal text" }
-
-or you can edit the default by saying something like:
-
- package MY; # so that "SUPER" works right
- sub c_o {
- my $inherited = shift->SUPER::c_o(@_);
- $inherited =~ s/old text/new text/;
- $inherited;
- }
-
-If you are running experiments with embedding perl as a library into
-other applications, you might find MakeMaker is not sufficient. You'd
-better have a look at ExtUtils::Embed which is a collection of utilities
-for embedding.
-
-If you still need a different solution, try to develop another
-subroutine that fits your needs and submit the diffs to
-C<makemaker at perl.org>
-
-For a complete description of all MakeMaker methods see
-L<ExtUtils::MM_Unix>.
-
-Here is a simple example of how to add a new target to the generated
-Makefile:
-
- sub MY::postamble {
- return <<'MAKE_FRAG';
- $(MYEXTLIB): sdbm/Makefile
- cd sdbm && $(MAKE) all
-
- MAKE_FRAG
- }
-
-=head2 The End Of Cargo Cult Programming
-
-WriteMakefile() now does some basic sanity checks on its parameters to
-protect against typos and malformatted values. This means some things
-which happened to work in the past will now throw warnings and
-possibly produce internal errors.
-
-Some of the most common mistakes:
-
-=over 2
-
-=item C<< MAN3PODS => ' ' >>
-
-This is commonly used to suppress the creation of man pages. MAN3PODS
-takes a hash ref not a string, but the above worked by accident in old
-versions of MakeMaker.
-
-The correct code is C<< MAN3PODS => { } >>.
-
-=back
-
-
-=head2 Hintsfile support
-
-MakeMaker.pm uses the architecture specific information from
-Config.pm. In addition it evaluates architecture specific hints files
-in a C<hints/> directory. The hints files are expected to be named
-like their counterparts in C<PERL_SRC/hints>, but with an C<.pl> file
-name extension (eg. C<next_3_2.pl>). They are simply C<eval>ed by
-MakeMaker within the WriteMakefile() subroutine, and can be used to
-execute commands as well as to include special variables. The rules
-which hintsfile is chosen are the same as in Configure.
-
-The hintsfile is eval()ed immediately after the arguments given to
-WriteMakefile are stuffed into a hash reference $self but before this
-reference becomes blessed. So if you want to do the equivalent to
-override or create an attribute you would say something like
-
- $self->{LIBS} = ['-ldbm -lucb -lc'];
-
-=head2 Distribution Support
-
-For authors of extensions MakeMaker provides several Makefile
-targets. Most of the support comes from the ExtUtils::Manifest module,
-where additional documentation can be found.
-
-=over 4
-
-=item make distcheck
-
-reports which files are below the build directory but not in the
-MANIFEST file and vice versa. (See ExtUtils::Manifest::fullcheck() for
-details)
-
-=item make skipcheck
-
-reports which files are skipped due to the entries in the
-C<MANIFEST.SKIP> file (See ExtUtils::Manifest::skipcheck() for
-details)
-
-=item make distclean
-
-does a realclean first and then the distcheck. Note that this is not
-needed to build a new distribution as long as you are sure that the
-MANIFEST file is ok.
-
-=item make manifest
-
-rewrites the MANIFEST file, adding all remaining files found (See
-ExtUtils::Manifest::mkmanifest() for details)
-
-=item make distdir
-
-Copies all the files that are in the MANIFEST file to a newly created
-directory with the name C<$(DISTNAME)-$(VERSION)>. If that directory
-exists, it will be removed first.
-
-Additionally, it will create a META.yml module meta-data file in the
-distdir and add this to the distdir's MANIFEST. You can shut this
-behavior off with the NO_META flag.
-
-=item make disttest
-
-Makes a distdir first, and runs a C<perl Makefile.PL>, a make, and
-a make test in that directory.
-
-=item make tardist
-
-First does a distdir. Then a command $(PREOP) which defaults to a null
-command, followed by $(TO_UNIX), which defaults to a null command under
-UNIX, and will convert files in distribution directory to UNIX format
-otherwise. Next it runs C<tar> on that directory into a tarfile and
-deletes the directory. Finishes with a command $(POSTOP) which
-defaults to a null command.
-
-=item make dist
-
-Defaults to $(DIST_DEFAULT) which in turn defaults to tardist.
-
-=item make uutardist
-
-Runs a tardist first and uuencodes the tarfile.
-
-=item make shdist
-
-First does a distdir. Then a command $(PREOP) which defaults to a null
-command. Next it runs C<shar> on that directory into a sharfile and
-deletes the intermediate directory again. Finishes with a command
-$(POSTOP) which defaults to a null command. Note: For shdist to work
-properly a C<shar> program that can handle directories is mandatory.
-
-=item make zipdist
-
-First does a distdir. Then a command $(PREOP) which defaults to a null
-command. Runs C<$(ZIP) $(ZIPFLAGS)> on that directory into a
-zipfile. Then deletes that directory. Finishes with a command
-$(POSTOP) which defaults to a null command.
-
-=item make ci
-
-Does a $(CI) and a $(RCS_LABEL) on all files in the MANIFEST file.
-
-=back
-
-Customization of the dist targets can be done by specifying a hash
-reference to the dist attribute of the WriteMakefile call. The
-following parameters are recognized:
-
- CI ('ci -u')
- COMPRESS ('gzip --best')
- POSTOP ('@ :')
- PREOP ('@ :')
- TO_UNIX (depends on the system)
- RCS_LABEL ('rcs -q -Nv$(VERSION_SYM):')
- SHAR ('shar')
- SUFFIX ('.gz')
- TAR ('tar')
- TARFLAGS ('cvf')
- ZIP ('zip')
- ZIPFLAGS ('-r')
-
-An example:
-
- WriteMakefile(
- ...other options...
- dist => {
- COMPRESS => "bzip2",
- SUFFIX => ".bz2"
- }
- );
-
-
-=head2 Module Meta-Data
-
-Long plaguing users of MakeMaker based modules has been the problem of
-getting basic information about the module out of the sources
-I<without> running the F<Makefile.PL> and doing a bunch of messy
-heuristics on the resulting F<Makefile>. To this end a simple module
-meta-data file has been introduced, F<META.yml>.
-
-F<META.yml> is a YAML document (see http://www.yaml.org) containing
-basic information about the module (name, version, prerequisites...)
-in an easy to read format. The format is developed and defined by the
-Module::Build developers (see
-http://module-build.sourceforge.net/META-spec.html)
-
-MakeMaker will automatically generate a F<META.yml> file for you and
-add it to your F<MANIFEST> as part of the 'distdir' target (and thus
-the 'dist' target). This is intended to seamlessly and rapidly
-populate CPAN with module meta-data. If you wish to shut this feature
-off, set the C<NO_META> C<WriteMakefile()> flag to true.
-
-
-=head2 Disabling an extension
-
-If some events detected in F<Makefile.PL> imply that there is no way
-to create the Module, but this is a normal state of things, then you
-can create a F<Makefile> which does nothing, but succeeds on all the
-"usual" build targets. To do so, use
-
- use ExtUtils::MakeMaker qw(WriteEmptyMakefile);
- WriteEmptyMakefile();
-
-instead of WriteMakefile().
-
-This may be useful if other modules expect this module to be I<built>
-OK, as opposed to I<work> OK (say, this system-dependent module builds
-in a subdirectory of some other distribution, or is listed as a
-dependency in a CPAN::Bundle, but the functionality is supported by
-different means on the current architecture).
-
-=head2 Other Handy Functions
-
-=over 4
-
-=item prompt
-
- my $value = prompt($message);
- my $value = prompt($message, $default);
-
-The C<prompt()> function provides an easy way to request user input
-used to write a makefile. It displays the $message as a prompt for
-input. If a $default is provided it will be used as a default. The
-function returns the $value selected by the user.
-
-If C<prompt()> detects that it is not running interactively and there
-is nothing on STDIN or if the PERL_MM_USE_DEFAULT environment variable
-is set to true, the $default will be used without prompting. This
-prevents automated processes from blocking on user input.
-
-If no $default is provided an empty string will be used instead.
-
-=back
-
-
-=head1 ENVIRONMENT
-
-=over 4
-
-=item PERL_MM_OPT
-
-Command line options used by C<MakeMaker-E<gt>new()>, and thus by
-C<WriteMakefile()>. The string is split on whitespace, and the result
-is processed before any actual command line arguments are processed.
-
-=item PERL_MM_USE_DEFAULT
-
-If set to a true value then MakeMaker's prompt function will
-always return the default without waiting for user input.
-
-=item PERL_CORE
-
-Same as the PERL_CORE parameter. The parameter overrides this.
-
-=back
-
-=head1 SEE ALSO
-
-L<Module::Build> is a pure-Perl alternative to MakeMaker which does
-not rely on make or any other external utility. It is easier to
-extend to suit your needs.
-
-L<Module::Install> is a wrapper around MakeMaker which adds features
-not normally available.
-
-L<ExtUtils::ModuleMaker> and L<Module::Starter> are both modules to
-help you setup your distribution.
-
-=head1 AUTHORS
-
-Andy Dougherty C<doughera at lafayette.edu>, Andreas KE<ouml>nig
-C<andreas.koenig at mind.de>, Tim Bunce C<timb at cpan.org>. VMS
-support by Charles Bailey C<bailey at newman.upenn.edu>. OS/2 support
-by Ilya Zakharevich C<ilya at math.ohio-state.edu>.
-
-Currently maintained by Michael G Schwern C<schwern at pobox.com>
-
-Send patches and ideas to C<makemaker at perl.org>.
-
-Send bug reports via http://rt.cpan.org/. Please send your
-generated Makefile along with your report.
-
-For more up-to-date information, see L<http://www.makemaker.org>.
-
-=head1 LICENSE
-
-This program is free software; you can redistribute it and/or
-modify it under the same terms as Perl itself.
-
-See L<http://www.perl.com/perl/misc/Artistic.html>
-
-
-=cut
Deleted: trunk/contrib/perl/lib/ExtUtils/Manifest.pm
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/Manifest.pm 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/Manifest.pm 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,877 +0,0 @@
-package ExtUtils::Manifest;
-
-require Exporter;
-use Config;
-use File::Basename;
-use File::Copy 'copy';
-use File::Find;
-use File::Spec;
-use Carp;
-use strict;
-
-use vars qw($VERSION @ISA @EXPORT_OK
- $Is_MacOS $Is_VMS $Is_VMS_mode $Is_VMS_lc $Is_VMS_nodot
- $Debug $Verbose $Quiet $MANIFEST $DEFAULT_MSKIP);
-
-$VERSION = '1.56';
- at ISA=('Exporter');
- at EXPORT_OK = qw(mkmanifest
- manicheck filecheck fullcheck skipcheck
- manifind maniread manicopy maniadd
- maniskip
- );
-
-$Is_MacOS = $^O eq 'MacOS';
-$Is_VMS = $^O eq 'VMS';
-$Is_VMS_mode = 0;
-$Is_VMS_lc = 0;
-$Is_VMS_nodot = 0; # No dots in dir names or double dots in files
-
-if ($Is_VMS) {
- require VMS::Filespec if $Is_VMS;
- my $vms_unix_rpt;
- my $vms_efs;
- my $vms_case;
-
- $Is_VMS_mode = 1;
- $Is_VMS_lc = 1;
- $Is_VMS_nodot = 1;
- if (eval { local $SIG{__DIE__}; require VMS::Feature; }) {
- $vms_unix_rpt = VMS::Feature::current("filename_unix_report");
- $vms_efs = VMS::Feature::current("efs_charset");
- $vms_case = VMS::Feature::current("efs_case_preserve");
- } else {
- my $unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || '';
- my $efs_charset = $ENV{'DECC$EFS_CHARSET'} || '';
- my $efs_case = $ENV{'DECC$EFS_CASE_PRESERVE'} || '';
- $vms_unix_rpt = $unix_rpt =~ /^[ET1]/i;
- $vms_efs = $efs_charset =~ /^[ET1]/i;
- $vms_case = $efs_case =~ /^[ET1]/i;
- }
- $Is_VMS_lc = 0 if ($vms_case);
- $Is_VMS_mode = 0 if ($vms_unix_rpt);
- $Is_VMS_nodot = 0 if ($vms_efs);
-}
-
-$Debug = $ENV{PERL_MM_MANIFEST_DEBUG} || 0;
-$Verbose = defined $ENV{PERL_MM_MANIFEST_VERBOSE} ?
- $ENV{PERL_MM_MANIFEST_VERBOSE} : 1;
-$Quiet = 0;
-$MANIFEST = 'MANIFEST';
-
-$DEFAULT_MSKIP = File::Spec->catfile( dirname(__FILE__), "$MANIFEST.SKIP" );
-
-
-=head1 NAME
-
-ExtUtils::Manifest - utilities to write and check a MANIFEST file
-
-=head1 SYNOPSIS
-
- use ExtUtils::Manifest qw(...funcs to import...);
-
- mkmanifest();
-
- my @missing_files = manicheck;
- my @skipped = skipcheck;
- my @extra_files = filecheck;
- my($missing, $extra) = fullcheck;
-
- my $found = manifind();
-
- my $manifest = maniread();
-
- manicopy($read,$target);
-
- maniadd({$file => $comment, ...});
-
-
-=head1 DESCRIPTION
-
-=head2 Functions
-
-ExtUtils::Manifest exports no functions by default. The following are
-exported on request
-
-=over 4
-
-=item mkmanifest
-
- mkmanifest();
-
-Writes all files in and below the current directory to your F<MANIFEST>.
-It works similar to the result of the Unix command
-
- find . > MANIFEST
-
-All files that match any regular expression in a file F<MANIFEST.SKIP>
-(if it exists) are ignored.
-
-Any existing F<MANIFEST> file will be saved as F<MANIFEST.bak>.
-
-=cut
-
-sub _sort {
- return sort { lc $a cmp lc $b } @_;
-}
-
-sub mkmanifest {
- my $manimiss = 0;
- my $read = (-r 'MANIFEST' && maniread()) or $manimiss++;
- $read = {} if $manimiss;
- local *M;
- my $bakbase = $MANIFEST;
- $bakbase =~ s/\./_/g if $Is_VMS_nodot; # avoid double dots
- rename $MANIFEST, "$bakbase.bak" unless $manimiss;
- open M, "> $MANIFEST" or die "Could not open $MANIFEST: $!";
- my $skip = maniskip();
- my $found = manifind();
- my($key,$val,$file,%all);
- %all = (%$found, %$read);
- $all{$MANIFEST} = ($Is_VMS_mode ? "$MANIFEST\t\t" : '') .
- 'This list of files'
- if $manimiss; # add new MANIFEST to known file list
- foreach $file (_sort keys %all) {
- if ($skip->($file)) {
- # Policy: only remove files if they're listed in MANIFEST.SKIP.
- # Don't remove files just because they don't exist.
- warn "Removed from $MANIFEST: $file\n" if $Verbose and exists $read->{$file};
- next;
- }
- if ($Verbose){
- warn "Added to $MANIFEST: $file\n" unless exists $read->{$file};
- }
- my $text = $all{$file};
- $file = _unmacify($file);
- my $tabs = (5 - (length($file)+1)/8);
- $tabs = 1 if $tabs < 1;
- $tabs = 0 unless $text;
- if ($file =~ /\s/) {
- $file =~ s/([\\'])/\\$1/g;
- $file = "'$file'";
- }
- print M $file, "\t" x $tabs, $text, "\n";
- }
- close M;
-}
-
-# Geez, shouldn't this use File::Spec or File::Basename or something?
-# Why so careful about dependencies?
-sub clean_up_filename {
- my $filename = shift;
- $filename =~ s|^\./||;
- $filename =~ s/^:([^:]+)$/$1/ if $Is_MacOS;
- return $filename;
-}
-
-
-=item manifind
-
- my $found = manifind();
-
-returns a hash reference. The keys of the hash are the files found
-below the current directory.
-
-=cut
-
-sub manifind {
- my $p = shift || {};
- my $found = {};
-
- my $wanted = sub {
- my $name = clean_up_filename($File::Find::name);
- warn "Debug: diskfile $name\n" if $Debug;
- return if -d $_;
-
- if( $Is_VMS_lc ) {
- $name =~ s#(.*)\.$#\L$1#;
- $name = uc($name) if $name =~ /^MANIFEST(\.SKIP)?$/i;
- }
- $found->{$name} = "";
- };
-
- # We have to use "$File::Find::dir/$_" in preprocess, because
- # $File::Find::name is unavailable.
- # Also, it's okay to use / here, because MANIFEST files use Unix-style
- # paths.
- find({wanted => $wanted},
- $Is_MacOS ? ":" : ".");
-
- return $found;
-}
-
-
-=item manicheck
-
- my @missing_files = manicheck();
-
-checks if all the files within a C<MANIFEST> in the current directory
-really do exist. If C<MANIFEST> and the tree below the current
-directory are in sync it silently returns an empty list.
-Otherwise it returns a list of files which are listed in the
-C<MANIFEST> but missing from the directory, and by default also
-outputs these names to STDERR.
-
-=cut
-
-sub manicheck {
- return _check_files();
-}
-
-
-=item filecheck
-
- my @extra_files = filecheck();
-
-finds files below the current directory that are not mentioned in the
-C<MANIFEST> file. An optional file C<MANIFEST.SKIP> will be
-consulted. Any file matching a regular expression in such a file will
-not be reported as missing in the C<MANIFEST> file. The list of any
-extraneous files found is returned, and by default also reported to
-STDERR.
-
-=cut
-
-sub filecheck {
- return _check_manifest();
-}
-
-
-=item fullcheck
-
- my($missing, $extra) = fullcheck();
-
-does both a manicheck() and a filecheck(), returning then as two array
-refs.
-
-=cut
-
-sub fullcheck {
- return [_check_files()], [_check_manifest()];
-}
-
-
-=item skipcheck
-
- my @skipped = skipcheck();
-
-lists all the files that are skipped due to your C<MANIFEST.SKIP>
-file.
-
-=cut
-
-sub skipcheck {
- my($p) = @_;
- my $found = manifind();
- my $matches = maniskip();
-
- my @skipped = ();
- foreach my $file (_sort keys %$found){
- if (&$matches($file)){
- warn "Skipping $file\n";
- push @skipped, $file;
- next;
- }
- }
-
- return @skipped;
-}
-
-
-sub _check_files {
- my $p = shift;
- my $dosnames=(defined(&Dos::UseLFN) && Dos::UseLFN()==0);
- my $read = maniread() || {};
- my $found = manifind($p);
-
- my(@missfile) = ();
- foreach my $file (_sort keys %$read){
- warn "Debug: manicheck checking from $MANIFEST $file\n" if $Debug;
- if ($dosnames){
- $file = lc $file;
- $file =~ s=(\.(\w|-)+)=substr ($1,0,4)=ge;
- $file =~ s=((\w|-)+)=substr ($1,0,8)=ge;
- }
- unless ( exists $found->{$file} ) {
- warn "No such file: $file\n" unless $Quiet;
- push @missfile, $file;
- }
- }
-
- return @missfile;
-}
-
-
-sub _check_manifest {
- my($p) = @_;
- my $read = maniread() || {};
- my $found = manifind($p);
- my $skip = maniskip();
-
- my @missentry = ();
- foreach my $file (_sort keys %$found){
- next if $skip->($file);
- warn "Debug: manicheck checking from disk $file\n" if $Debug;
- unless ( exists $read->{$file} ) {
- my $canon = $Is_MacOS ? "\t" . _unmacify($file) : '';
- warn "Not in $MANIFEST: $file$canon\n" unless $Quiet;
- push @missentry, $file;
- }
- }
-
- return @missentry;
-}
-
-
-=item maniread
-
- my $manifest = maniread();
- my $manifest = maniread($manifest_file);
-
-reads a named C<MANIFEST> file (defaults to C<MANIFEST> in the current
-directory) and returns a HASH reference with files being the keys and
-comments being the values of the HASH. Blank lines and lines which
-start with C<#> in the C<MANIFEST> file are discarded.
-
-=cut
-
-sub maniread {
- my ($mfile) = @_;
- $mfile ||= $MANIFEST;
- my $read = {};
- local *M;
- unless (open M, "< $mfile"){
- warn "Problem opening $mfile: $!";
- return $read;
- }
- local $_;
- while (<M>){
- chomp;
- next if /^\s*#/;
-
- my($file, $comment);
-
- # filename may contain spaces if enclosed in ''
- # (in which case, \\ and \' are escapes)
- if (($file, $comment) = /^'(\\[\\']|.+)+'\s*(.*)/) {
- $file =~ s/\\([\\'])/$1/g;
- }
- else {
- ($file, $comment) = /^(\S+)\s*(.*)/;
- }
- next unless $file;
-
- if ($Is_MacOS) {
- $file = _macify($file);
- $file =~ s/\\([0-3][0-7][0-7])/sprintf("%c", oct($1))/ge;
- }
- elsif ($Is_VMS_mode) {
- require File::Basename;
- my($base,$dir) = File::Basename::fileparse($file);
- # Resolve illegal file specifications in the same way as tar
- if ($Is_VMS_nodot) {
- $dir =~ tr/./_/;
- my(@pieces) = split(/\./,$base);
- if (@pieces > 2)
- { $base = shift(@pieces) . '.' . join('_', at pieces); }
- my $okfile = "$dir$base";
- warn "Debug: Illegal name $file changed to $okfile\n" if $Debug;
- $file = $okfile;
- }
- $file = lc($file)
- unless $Is_VMS_lc &&($file =~ /^MANIFEST(\.SKIP)?$/);
- }
-
- $read->{$file} = $comment;
- }
- close M;
- $read;
-}
-
-=item maniskip
-
- my $skipchk = maniskip();
- my $skipchk = maniskip($manifest_skip_file);
-
- if ($skipchk->($file)) { .. }
-
-reads a named C<MANIFEST.SKIP> file (defaults to C<MANIFEST.SKIP> in
-the current directory) and returns a CODE reference that tests whether
-a given filename should be skipped.
-
-=cut
-
-# returns an anonymous sub that decides if an argument matches
-sub maniskip {
- my @skip ;
- my $mfile = shift || "$MANIFEST.SKIP";
- _check_mskip_directives($mfile) if -f $mfile;
- local(*M, $_);
- open M, "< $mfile" or open M, "< $DEFAULT_MSKIP" or return sub {0};
- while (<M>){
- chomp;
- s/\r//;
- next if /^#/;
- next if /^\s*$/;
- s/^'//;
- s/'$//;
- push @skip, _macify($_);
- }
- close M;
- return sub {0} unless (scalar @skip > 0);
-
- my $opts = $Is_VMS_mode ? '(?i)' : '';
-
- # Make sure each entry is isolated in its own parentheses, in case
- # any of them contain alternations
- my $regex = join '|', map "(?:$_)", @skip;
-
- return sub { $_[0] =~ qr{$opts$regex} };
-}
-
-# checks for the special directives
-# #!include_default
-# #!include /path/to/some/manifest.skip
-# in a custom MANIFEST.SKIP for, for including
-# the content of, respectively, the default MANIFEST.SKIP
-# and an external manifest.skip file
-sub _check_mskip_directives {
- my $mfile = shift;
- local (*M, $_);
- my @lines = ();
- my $flag = 0;
- unless (open M, "< $mfile") {
- warn "Problem opening $mfile: $!";
- return;
- }
- while (<M>) {
- if (/^#!include_default\s*$/) {
- if (my @default = _include_mskip_file()) {
- push @lines, @default;
- warn "Debug: Including default MANIFEST.SKIP\n" if $Debug;
- $flag++;
- }
- next;
- }
- if (/^#!include\s+(.*)\s*$/) {
- my $external_file = $1;
- if (my @external = _include_mskip_file($external_file)) {
- push @lines, @external;
- warn "Debug: Including external $external_file\n" if $Debug;
- $flag++;
- }
- next;
- }
- push @lines, $_;
- }
- close M;
- return unless $flag;
- my $bakbase = $mfile;
- $bakbase =~ s/\./_/g if $Is_VMS_nodot; # avoid double dots
- rename $mfile, "$bakbase.bak";
- warn "Debug: Saving original $mfile as $bakbase.bak\n" if $Debug;
- unless (open M, "> $mfile") {
- warn "Problem opening $mfile: $!";
- return;
- }
- print M $_ for (@lines);
- close M;
- return;
-}
-
-# returns an array containing the lines of an external
-# manifest.skip file, if given, or $DEFAULT_MSKIP
-sub _include_mskip_file {
- my $mskip = shift || $DEFAULT_MSKIP;
- unless (-f $mskip) {
- warn qq{Included file "$mskip" not found - skipping};
- return;
- }
- local (*M, $_);
- unless (open M, "< $mskip") {
- warn "Problem opening $mskip: $!";
- return;
- }
- my @lines = ();
- push @lines, "\n#!start included $mskip\n";
- push @lines, $_ while <M>;
- close M;
- push @lines, "#!end included $mskip\n\n";
- return @lines;
-}
-
-=item manicopy
-
- manicopy(\%src, $dest_dir);
- manicopy(\%src, $dest_dir, $how);
-
-Copies the files that are the keys in %src to the $dest_dir. %src is
-typically returned by the maniread() function.
-
- manicopy( maniread(), $dest_dir );
-
-This function is useful for producing a directory tree identical to the
-intended distribution tree.
-
-$how can be used to specify a different methods of "copying". Valid
-values are C<cp>, which actually copies the files, C<ln> which creates
-hard links, and C<best> which mostly links the files but copies any
-symbolic link to make a tree without any symbolic link. C<cp> is the
-default.
-
-=cut
-
-sub manicopy {
- my($read,$target,$how)=@_;
- croak "manicopy() called without target argument" unless defined $target;
- $how ||= 'cp';
- require File::Path;
- require File::Basename;
-
- $target = VMS::Filespec::unixify($target) if $Is_VMS_mode;
- File::Path::mkpath([ $target ],! $Quiet,$Is_VMS ? undef : 0755);
- foreach my $file (keys %$read){
- if ($Is_MacOS) {
- if ($file =~ m!:!) {
- my $dir = _maccat($target, $file);
- $dir =~ s/[^:]+$//;
- File::Path::mkpath($dir,1,0755);
- }
- cp_if_diff($file, _maccat($target, $file), $how);
- } else {
- $file = VMS::Filespec::unixify($file) if $Is_VMS_mode;
- if ($file =~ m!/!) { # Ilya, that hurts, I fear, or maybe not?
- my $dir = File::Basename::dirname($file);
- $dir = VMS::Filespec::unixify($dir) if $Is_VMS_mode;
- File::Path::mkpath(["$target/$dir"],! $Quiet,$Is_VMS ? undef : 0755);
- }
- cp_if_diff($file, "$target/$file", $how);
- }
- }
-}
-
-sub cp_if_diff {
- my($from, $to, $how)=@_;
- if (! -f $from) {
- carp "$from not found";
- return;
- }
- my($diff) = 0;
- local(*F,*T);
- open(F,"< $from\0") or die "Can't read $from: $!\n";
- if (open(T,"< $to\0")) {
- local $_;
- while (<F>) { $diff++,last if $_ ne <T>; }
- $diff++ unless eof(T);
- close T;
- }
- else { $diff++; }
- close F;
- if ($diff) {
- if (-e $to) {
- unlink($to) or confess "unlink $to: $!";
- }
- STRICT_SWITCH: {
- best($from,$to), last STRICT_SWITCH if $how eq 'best';
- cp($from,$to), last STRICT_SWITCH if $how eq 'cp';
- ln($from,$to), last STRICT_SWITCH if $how eq 'ln';
- croak("ExtUtils::Manifest::cp_if_diff " .
- "called with illegal how argument [$how]. " .
- "Legal values are 'best', 'cp', and 'ln'.");
- }
- }
-}
-
-sub cp {
- my ($srcFile, $dstFile) = @_;
- my ($access,$mod) = (stat $srcFile)[8,9];
-
- copy($srcFile,$dstFile);
- utime $access, $mod + ($Is_VMS ? 1 : 0), $dstFile;
- _manicopy_chmod($srcFile, $dstFile);
-}
-
-
-sub ln {
- my ($srcFile, $dstFile) = @_;
- # Fix-me - VMS can support links.
- return &cp if $Is_VMS or ($^O eq 'MSWin32' and Win32::IsWin95());
- link($srcFile, $dstFile);
-
- unless( _manicopy_chmod($srcFile, $dstFile) ) {
- unlink $dstFile;
- return;
- }
- 1;
-}
-
-# 1) Strip off all group and world permissions.
-# 2) Let everyone read it.
-# 3) If the owner can execute it, everyone can.
-sub _manicopy_chmod {
- my($srcFile, $dstFile) = @_;
-
- my $perm = 0444 | (stat $srcFile)[2] & 0700;
- chmod( $perm | ( $perm & 0100 ? 0111 : 0 ), $dstFile );
-}
-
-# Files that are often modified in the distdir. Don't hard link them.
-my @Exceptions = qw(MANIFEST META.yml SIGNATURE);
-sub best {
- my ($srcFile, $dstFile) = @_;
-
- my $is_exception = grep $srcFile =~ /$_/, @Exceptions;
- if ($is_exception or !$Config{d_link} or -l $srcFile) {
- cp($srcFile, $dstFile);
- } else {
- ln($srcFile, $dstFile) or cp($srcFile, $dstFile);
- }
-}
-
-sub _macify {
- my($file) = @_;
-
- return $file unless $Is_MacOS;
-
- $file =~ s|^\./||;
- if ($file =~ m|/|) {
- $file =~ s|/+|:|g;
- $file = ":$file";
- }
-
- $file;
-}
-
-sub _maccat {
- my($f1, $f2) = @_;
-
- return "$f1/$f2" unless $Is_MacOS;
-
- $f1 .= ":$f2";
- $f1 =~ s/([^:]:):/$1/g;
- return $f1;
-}
-
-sub _unmacify {
- my($file) = @_;
-
- return $file unless $Is_MacOS;
-
- $file =~ s|^:||;
- $file =~ s|([/ \n])|sprintf("\\%03o", unpack("c", $1))|ge;
- $file =~ y|:|/|;
-
- $file;
-}
-
-
-=item maniadd
-
- maniadd({ $file => $comment, ...});
-
-Adds an entry to an existing F<MANIFEST> unless its already there.
-
-$file will be normalized (ie. Unixified). B<UNIMPLEMENTED>
-
-=cut
-
-sub maniadd {
- my($additions) = shift;
-
- _normalize($additions);
- _fix_manifest($MANIFEST);
-
- my $manifest = maniread();
- my @needed = grep { !exists $manifest->{$_} } keys %$additions;
- return 1 unless @needed;
-
- open(MANIFEST, ">>$MANIFEST") or
- die "maniadd() could not open $MANIFEST: $!";
-
- foreach my $file (_sort @needed) {
- my $comment = $additions->{$file} || '';
- if ($file =~ /\s/) {
- $file =~ s/([\\'])/\\$1/g;
- $file = "'$file'";
- }
- printf MANIFEST "%-40s %s\n", $file, $comment;
- }
- close MANIFEST or die "Error closing $MANIFEST: $!";
-
- return 1;
-}
-
-
-# Sometimes MANIFESTs are missing a trailing newline. Fix this.
-sub _fix_manifest {
- my $manifest_file = shift;
-
- open MANIFEST, $MANIFEST or die "Could not open $MANIFEST: $!";
-
- # Yes, we should be using seek(), but I'd like to avoid loading POSIX
- # to get SEEK_*
- my @manifest = <MANIFEST>;
- close MANIFEST;
-
- unless( $manifest[-1] =~ /\n\z/ ) {
- open MANIFEST, ">>$MANIFEST" or die "Could not open $MANIFEST: $!";
- print MANIFEST "\n";
- close MANIFEST;
- }
-}
-
-
-# UNIMPLEMENTED
-sub _normalize {
- return;
-}
-
-
-=back
-
-=head2 MANIFEST
-
-A list of files in the distribution, one file per line. The MANIFEST
-always uses Unix filepath conventions even if you're not on Unix. This
-means F<foo/bar> style not F<foo\bar>.
-
-Anything between white space and an end of line within a C<MANIFEST>
-file is considered to be a comment. Any line beginning with # is also
-a comment. Beginning with ExtUtils::Manifest 1.52, a filename may
-contain whitespace characters if it is enclosed in single quotes; single
-quotes or backslashes in that filename must be backslash-escaped.
-
- # this a comment
- some/file
- some/other/file comment about some/file
- 'some/third file' comment
-
-
-=head2 MANIFEST.SKIP
-
-The file MANIFEST.SKIP may contain regular expressions of files that
-should be ignored by mkmanifest() and filecheck(). The regular
-expressions should appear one on each line. Blank lines and lines
-which start with C<#> are skipped. Use C<\#> if you need a regular
-expression to start with a C<#>.
-
-For example:
-
- # Version control files and dirs.
- \bRCS\b
- \bCVS\b
- ,v$
- \B\.svn\b
-
- # Makemaker generated files and dirs.
- ^MANIFEST\.
- ^Makefile$
- ^blib/
- ^MakeMaker-\d
-
- # Temp, old and emacs backup files.
- ~$
- \.old$
- ^#.*#$
- ^\.#
-
-If no MANIFEST.SKIP file is found, a default set of skips will be
-used, similar to the example above. If you want nothing skipped,
-simply make an empty MANIFEST.SKIP file.
-
-In one's own MANIFEST.SKIP file, certain directives
-can be used to include the contents of other MANIFEST.SKIP
-files. At present two such directives are recognized.
-
-=over 4
-
-=item #!include_default
-
-This inserts the contents of the default MANIFEST.SKIP file
-
-=item #!include /Path/to/another/manifest.skip
-
-This inserts the contents of the specified external file
-
-=back
-
-The included contents will be inserted into the MANIFEST.SKIP
-file in between I<#!start included /path/to/manifest.skip>
-and I<#!end included /path/to/manifest.skip> markers.
-The original MANIFEST.SKIP is saved as MANIFEST.SKIP.bak.
-
-=head2 EXPORT_OK
-
-C<&mkmanifest>, C<&manicheck>, C<&filecheck>, C<&fullcheck>,
-C<&maniread>, and C<&manicopy> are exportable.
-
-=head2 GLOBAL VARIABLES
-
-C<$ExtUtils::Manifest::MANIFEST> defaults to C<MANIFEST>. Changing it
-results in both a different C<MANIFEST> and a different
-C<MANIFEST.SKIP> file. This is useful if you want to maintain
-different distributions for different audiences (say a user version
-and a developer version including RCS).
-
-C<$ExtUtils::Manifest::Quiet> defaults to 0. If set to a true value,
-all functions act silently.
-
-C<$ExtUtils::Manifest::Debug> defaults to 0. If set to a true value,
-or if PERL_MM_MANIFEST_DEBUG is true, debugging output will be
-produced.
-
-=head1 DIAGNOSTICS
-
-All diagnostic output is sent to C<STDERR>.
-
-=over 4
-
-=item C<Not in MANIFEST:> I<file>
-
-is reported if a file is found which is not in C<MANIFEST>.
-
-=item C<Skipping> I<file>
-
-is reported if a file is skipped due to an entry in C<MANIFEST.SKIP>.
-
-=item C<No such file:> I<file>
-
-is reported if a file mentioned in a C<MANIFEST> file does not
-exist.
-
-=item C<MANIFEST:> I<$!>
-
-is reported if C<MANIFEST> could not be opened.
-
-=item C<Added to MANIFEST:> I<file>
-
-is reported by mkmanifest() if $Verbose is set and a file is added
-to MANIFEST. $Verbose is set to 1 by default.
-
-=back
-
-=head1 ENVIRONMENT
-
-=over 4
-
-=item B<PERL_MM_MANIFEST_DEBUG>
-
-Turns on debugging
-
-=back
-
-=head1 SEE ALSO
-
-L<ExtUtils::MakeMaker> which has handy targets for most of the functionality.
-
-=head1 AUTHOR
-
-Andreas Koenig C<andreas.koenig at anima.de>
-
-Maintained by Michael G Schwern C<schwern at pobox.com> within the
-ExtUtils-MakeMaker package and, as a separate CPAN package, by
-Randy Kobes C<r.kobes at uwinnipeg.ca>.
-
-=cut
-
-1;
Deleted: trunk/contrib/perl/lib/ExtUtils/NOTES
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/NOTES 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/NOTES 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,96 +0,0 @@
-The Simplified MakeMaker class hierarchy
-****************************************
-
-What most people need to know.
-
-(Subclasses on top.)
-
- MY
- |
- ExtUtils::MakeMaker
- |
- ExtUtils::MM_{Current OS}
- |
- ExtUtils::MM_Unix
- |
- ExtUtils::MM_Any
-
-The object actually used is of the class MY which allows you to
-override bits of MakeMaker inside your Makefile.PL by declaring
-MY::foo() methods.
-
-
-The Real MakeMaker class hierarchy
-**********************************
-
-You wish it was that simple.
-
-Here's how it really works.
-
- PACK### (created each call to ExtUtils::MakeMaker->new)
- . |
- (mixin) |
- . |
- MY (created by ExtUtils::MY) |
- | |
- ExtUtils::MY MM (created by ExtUtils::MM)
- | |
- ExtUtils::MM
- | | |-----------------------
- | | |
- ExtUtils::Liblist ExtUtils::MakeMaker |
- | |
- ExtUtils::Liblist::Kid |
- |
- |
- |
- ExtUtils::MM_{Current OS} (if necessary)
- |
- ExtUtils::MM_Unix
- |
- ExtUtils::MM_Any
-
-
-NOTE: Yes, this is a mess. See
-http://archive.develooper.com/makemaker@perl.org/msg00134.html
-for some history.
-
-NOTE: When ExtUtils::MM is loaded it chooses a superclass for MM from
-amongst the ExtUtils::MM_* modules based on the current operating
-system.
-
-NOTE: ExtUtils::MM_{Current OS} represents one of the ExtUtils::MM_*
-modules except ExtUtils::MM_Any chosen based on your operating system.
-
-NOTE: The main object used by MakeMaker is a PACK### object, *not*
-ExtUtils::MakeMaker. It is, effectively, a subclass of MY,
-ExtUtils::Makemaker, ExtUtils::Liblist and ExtUtils::MM_{Current OS}
-
-NOTE: The methods in MY are simply copied into PACK### rather than
-MY being a superclass of PACK###. I don't remember the rationale.
-
-NOTE: ExtUtils::Liblist should be removed from the inheritence hiearchy
-and simply be called as functions.
-
-NOTE: Modules like File::Spec and Exporter have been omitted for clarity.
-
-
-The MM_* hierarchy
-******************
-
- MM_Win95 MM_NW5
- \ /
-MM_BeOS MM_Cygwin MM_OS2 MM_VMS MM_Win32 MM_DOS MM_UWIN
- \ | | | / / /
- ------------------------------------------------
- | |
- MM_Unix |
- | |
- MM_Any
-
-NOTE: Each direct MM_Unix subclass is also an MM_Any subclass. This
-is a temporary hack because MM_Unix overrides some MM_Any methods with
-Unix specific code. It allows the non-Unix modules to see the
-original MM_Any implementations.
-
-NOTE: Modules like File::Spec and Exporter have been omitted for clarity.
Deleted: trunk/contrib/perl/lib/ExtUtils/PATCHING
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/PATCHING 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/PATCHING 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,212 +0,0 @@
-"The easy way is always mined.
- The important things are always simple.
- The simple things are always hard."
- -- Some of Murphy's Laws of Combat
-
-This is a short set of guidelines for those patching
-ExtUtils::MakeMaker. Its not an iron-clad set of rules, but just
-things which make life easier when reading and integrating a patch.
-
-Lots of information can be found in makemaker.org.
-
-MakerMaker is being maintained until something else can replace it.
-Bugs will be fixed and compatibility improved, but I would like to
-avoid new features. If you want to add something to MakeMaker,
-consider instead working on Module::Build, MakeMaker's heir apparent.
-
-
-Reporting bugs
-
-- Often the only information we have for fixing a bug is contained in your
- report. So...
-
-- Please report your bugs via http://rt.cpan.org or by mailing to
- makemaker at perl.org. RT is preferred.
-
-- Please report your bug immediately upon encountering it. Do not wait
- until you have a patch to fix the bug. Patches are good, but not at
- the expense of timely bug reports.
-
-- Please be as verbose as possible. Include the complete output of
- your 'make test' or even 'make test TEST_VERBOSE=1' and a copy of the
- generated Makefile. Err on the side of verbosity. The more data we
- have to work with, the faster we can diagnose the problem.
-
-- If you find an undocumented feature, or if a feature has changed/been
- added which causes a problem, report it. Do not assume it was done
- deliberately. Even if it was done deliberately, we still want to hear
- if it caused problems.
-
-- If you're testing MakeMaker against a development version of Perl,
- please also check it against the latest stable version. This makes it
- easier to figure out if its MakeMaker or Perl at fault.
-
-
-Patching details
-
-- Please use unified diffs. (diff -u)
-
-- Patches against the latest development snapshot from makemaker.org are
- preferred. Patches against the latest CPAN version are ok, too.
-
-- Post your patch to makemaker at perl.org.
-
-
-Code formatting
-
-- No literal tabs (except where necessary inside Makefile code, obviously).
-
-- 4 character indentation.
-
-- this_style is prefered instead of studlyCaps.
-
-- Private subroutine names (ie. those used only in the same package
- they're declared in) should start with an underscore (_sekret_method).
-
-- Protected subroutines (ie. ones intended to be used by other modules in
- ExtUtils::*) should be named normally (no leading underscore) but
- documented as protected (see Documentation below).
-
-- Do not use indirect object syntax (ie. new Foo::Bar (@args))
-
-- make variables use dollar signs like Perl scalars. This causes problems
- when you have to mix them both in a string. If you find yourself
- backwacking lots of dollar signs because you have one interpolated
- perl variable, like this:
-
- return <<EOT;
-subdirs ::
- \$(NOECHO)cd $subdir && \$(MAKE) -f \$(FIRST_MAKEFILE) all \$(PASTHRU)
-
-EOT
-
- or are switching quoting contexts:
-
- return q{
-subdirs ::
- $(NOECHO)cd }.$subdir.q{ && $(MAKE) -f $(FIRST_MAKEFILE) all $(PASTHRU)
-
-};
-
- consider using sprintf instead.
-
- return sprintf <<'EOT', $subdir;
-subdirs ::
- $(NOECHO)cd %s && $(MAKE) -f $(FIRST_MAKEFILE) all $(PASTHRU)
-
-EOT
-
-
-Refactoring and Cleanup
-
-- MakeMaker is a mess. We like patches which clean things up.
-
-
-Backwards Compatibility
-
-- MakeMaker must be backwards compatible to 5.5.4 (5.005_04). Avoid any
- obvious 5.6-isms (threads, warnings.pm, Unicode, our, v1.2.3, attributes
- open my $fh, lvalue subroutines, qr//, any new core modules, etc...).
-
-- MakeMaker should avoid having module dependencies. Avoid using modules
- which didn't come with 5.5.4 and avoid using features from newer
- versions. Sometimes this is unavoidable.
-
-
-Cross-Platform Compatibility
-
-- With the exception of MacOS Classic, MakeMaker must work on all
- architectures Perl works on (see perlport.pod). This means all Unixen
- (including Cygwin and MacOS X), Windows (including Win9x and DOS), and VMS.
-
-- Use the available macros rather than shell commands $(MV), $(CP),
- $(TOUCH), etc...
-
-- MakeMaker must work on many makes. GNU, BSD, Solaris, nmake, dmake, MMS
- and MMK to name the most common. Keep your make code as simple as
- possible.
-
-- Avoid special make variables (even $@).
-
-- Format targets as "target : dependency", the spacing is important.
-
-- Use $(NOECHO) instead of @.
-
-- Use - to tell make to ignore the exit code of a command. (Unfortunately,
- some make variants don't honor an $(IGNORE) macro).
-
-- Always put a space between $(NOECHO) and the command.
-
-- Always put a space between - (ignore) and the command.
-
-- Always put $(NOECHO) and - together, no space between them.
-
- # Right
- -$(NOECHO) command
- $(NOECHO) command
- - command
-
-- Often when you patch ExtUtils::MM_Unix, similar patches must be done
- to the other MM_* modules. If you can, please do this extra work
- otherwise I have to. If you can't, that's ok. We can help.
-
-- If possible, please test your patch on two Very Different architectures.
- Unix, Windows and VMS being Very Different. Note: Cygwin and OS X are
- Unixen for our purposes.
-
-- If nothing else, at least try it on two different Unixen or Windows
- machines (ie. Linux and IRIX or WinNT and Win95).
-
-- HP's TestDrive (www.testdrive.compaq.com) and SourceForge's
- compile farm (www.sourceforge.net) are good sources of testing
- machines of many different architectures and platforms. Accounts are
- free.
-
-- If you find yourself writing "do_this if $^O eq 'That'" (ie. checks on
- the OS type) perhaps your code belongs in one of the non-Unix MM_*
- modules (ie. MM_Win32, MM_VMS, etc...). If one does not exist, consider
- creating one. Its ok to have an MM_* module with only one method.
-
-- Some shells have very small buffers. This means command lines must
- be as small as possible. If your command is just too long, consider
- making it an ExtUtils::Command::MM function. If your command might
- receive many arguments (such as pod2man or pm_to_blib) consider
- using split_command() to split it into several, shorter calls.
-
-- Most shells quote differently. If you need to put a perl one-liner
- in the Makefile, please use oneliner() to generate it.
-
-
-Tests
-
-- Tests would be nice, but I'm not going to pretend testing MakeMaker
- is easy. If nothing else, let us know how you tested your patch by
- hand.
-
-
-Documentation
-
-- Documentation would be nice.
-
-- If the new feature/method is private, please document it with POD
- wrapped in "=begin/end private" tags. That way it will be documented,
- but won't be displayed (future versions of perldoc may have options
- to display).
-
- =begin private
-
- =head3 _foo_bar
-
- $mm->_foo_bar
-
- Blah blah blah
-
- =end private
-
- =cut
-
- sub _foo_bar {
- ...
-
-- If you're overriding a method, document that its an override and
- *why* its being overridden. Don't repeat the original documentation.
Deleted: trunk/contrib/perl/lib/ExtUtils/Packlist.pm
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/Packlist.pm 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/Packlist.pm 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,348 +0,0 @@
-package ExtUtils::Packlist;
-
-use 5.00503;
-use strict;
-use Carp qw();
-use Config;
-use vars qw($VERSION $Relocations);
-$VERSION = '1.43';
-$VERSION = eval $VERSION;
-
-# Used for generating filehandle globs. IO::File might not be available!
-my $fhname = "FH1";
-
-=begin _undocumented
-
-=item mkfh()
-
-Make a filehandle. Same kind of idea as Symbol::gensym().
-
-=cut
-
-sub mkfh()
-{
-no strict;
-my $fh = \*{$fhname++};
-use strict;
-return($fh);
-}
-
-=item __find_relocations
-
-Works out what absolute paths in the configuration have been located at run
-time relative to $^X, and generates a regexp that matches them
-
-=end _undocumented
-
-=cut
-
-sub __find_relocations
-{
- my %paths;
- while (my ($raw_key, $raw_val) = each %Config) {
- my $exp_key = $raw_key . "exp";
- next unless exists $Config{$exp_key};
- next unless $raw_val =~ m!\.\.\./!;
- $paths{$Config{$exp_key}}++;
- }
- # Longest prefixes go first in the alternatives
- my $alternations = join "|", map {quotemeta $_}
- sort {length $b <=> length $a} keys %paths;
- qr/^($alternations)/o;
-}
-
-sub new($$)
-{
-my ($class, $packfile) = @_;
-$class = ref($class) || $class;
-my %self;
-tie(%self, $class, $packfile);
-return(bless(\%self, $class));
-}
-
-sub TIEHASH
-{
-my ($class, $packfile) = @_;
-my $self = { packfile => $packfile };
-bless($self, $class);
-$self->read($packfile) if (defined($packfile) && -f $packfile);
-return($self);
-}
-
-sub STORE
-{
-$_[0]->{data}->{$_[1]} = $_[2];
-}
-
-sub FETCH
-{
-return($_[0]->{data}->{$_[1]});
-}
-
-sub FIRSTKEY
-{
-my $reset = scalar(keys(%{$_[0]->{data}}));
-return(each(%{$_[0]->{data}}));
-}
-
-sub NEXTKEY
-{
-return(each(%{$_[0]->{data}}));
-}
-
-sub EXISTS
-{
-return(exists($_[0]->{data}->{$_[1]}));
-}
-
-sub DELETE
-{
-return(delete($_[0]->{data}->{$_[1]}));
-}
-
-sub CLEAR
-{
-%{$_[0]->{data}} = ();
-}
-
-sub DESTROY
-{
-}
-
-sub read($;$)
-{
-my ($self, $packfile) = @_;
-$self = tied(%$self) || $self;
-
-if (defined($packfile)) { $self->{packfile} = $packfile; }
-else { $packfile = $self->{packfile}; }
-Carp::croak("No packlist filename specified") if (! defined($packfile));
-my $fh = mkfh();
-open($fh, "<$packfile") || Carp::croak("Can't open file $packfile: $!");
-$self->{data} = {};
-my ($line);
-while (defined($line = <$fh>))
- {
- chomp $line;
- my ($key, $data) = $line;
- if ($key =~ /^(.*?)( \w+=.*)$/)
- {
- $key = $1;
- $data = { map { split('=', $_) } split(' ', $2)};
-
- if ($Config{userelocatableinc} && $data->{relocate_as})
- {
- require File::Spec;
- require Cwd;
- my ($vol, $dir) = File::Spec->splitpath($packfile);
- my $newpath = File::Spec->catpath($vol, $dir, $data->{relocate_as});
- $key = Cwd::realpath($newpath);
- }
- }
- $key =~ s!/\./!/!g; # Some .packlists have spurious '/./' bits in the paths
- $self->{data}->{$key} = $data;
- }
-close($fh);
-}
-
-sub write($;$)
-{
-my ($self, $packfile) = @_;
-$self = tied(%$self) || $self;
-if (defined($packfile)) { $self->{packfile} = $packfile; }
-else { $packfile = $self->{packfile}; }
-Carp::croak("No packlist filename specified") if (! defined($packfile));
-my $fh = mkfh();
-open($fh, ">$packfile") || Carp::croak("Can't open file $packfile: $!");
-foreach my $key (sort(keys(%{$self->{data}})))
- {
- my $data = $self->{data}->{$key};
- if ($Config{userelocatableinc}) {
- $Relocations ||= __find_relocations();
- if ($packfile =~ $Relocations) {
- # We are writing into a subdirectory of a run-time relocated
- # path. Figure out if the this file is also within a subdir.
- my $prefix = $1;
- if (File::Spec->no_upwards(File::Spec->abs2rel($key, $prefix)))
- {
- # The relocated path is within the found prefix
- my $packfile_prefix;
- (undef, $packfile_prefix)
- = File::Spec->splitpath($packfile);
-
- my $relocate_as
- = File::Spec->abs2rel($key, $packfile_prefix);
-
- if (!ref $data) {
- $data = {};
- }
- $data->{relocate_as} = $relocate_as;
- }
- }
- }
- print $fh ("$key");
- if (ref($data))
- {
- foreach my $k (sort(keys(%$data)))
- {
- print $fh (" $k=$data->{$k}");
- }
- }
- print $fh ("\n");
- }
-close($fh);
-}
-
-sub validate($;$)
-{
-my ($self, $remove) = @_;
-$self = tied(%$self) || $self;
-my @missing;
-foreach my $key (sort(keys(%{$self->{data}})))
- {
- if (! -e $key)
- {
- push(@missing, $key);
- delete($self->{data}{$key}) if ($remove);
- }
- }
-return(@missing);
-}
-
-sub packlist_file($)
-{
-my ($self) = @_;
-$self = tied(%$self) || $self;
-return($self->{packfile});
-}
-
-1;
-
-__END__
-
-=head1 NAME
-
-ExtUtils::Packlist - manage .packlist files
-
-=head1 SYNOPSIS
-
- use ExtUtils::Packlist;
- my ($pl) = ExtUtils::Packlist->new('.packlist');
- $pl->read('/an/old/.packlist');
- my @missing_files = $pl->validate();
- $pl->write('/a/new/.packlist');
-
- $pl->{'/some/file/name'}++;
- or
- $pl->{'/some/other/file/name'} = { type => 'file',
- from => '/some/file' };
-
-=head1 DESCRIPTION
-
-ExtUtils::Packlist provides a standard way to manage .packlist files.
-Functions are provided to read and write .packlist files. The original
-.packlist format is a simple list of absolute pathnames, one per line. In
-addition, this package supports an extended format, where as well as a filename
-each line may contain a list of attributes in the form of a space separated
-list of key=value pairs. This is used by the installperl script to
-differentiate between files and links, for example.
-
-=head1 USAGE
-
-The hash reference returned by the new() function can be used to examine and
-modify the contents of the .packlist. Items may be added/deleted from the
-.packlist by modifying the hash. If the value associated with a hash key is a
-scalar, the entry written to the .packlist by any subsequent write() will be a
-simple filename. If the value is a hash, the entry written will be the
-filename followed by the key=value pairs from the hash. Reading back the
-.packlist will recreate the original entries.
-
-=head1 FUNCTIONS
-
-=over 4
-
-=item new()
-
-This takes an optional parameter, the name of a .packlist. If the file exists,
-it will be opened and the contents of the file will be read. The new() method
-returns a reference to a hash. This hash holds an entry for each line in the
-.packlist. In the case of old-style .packlists, the value associated with each
-key is undef. In the case of new-style .packlists, the value associated with
-each key is a hash containing the key=value pairs following the filename in the
-.packlist.
-
-=item read()
-
-This takes an optional parameter, the name of the .packlist to be read. If
-no file is specified, the .packlist specified to new() will be read. If the
-.packlist does not exist, Carp::croak will be called.
-
-=item write()
-
-This takes an optional parameter, the name of the .packlist to be written. If
-no file is specified, the .packlist specified to new() will be overwritten.
-
-=item validate()
-
-This checks that every file listed in the .packlist actually exists. If an
-argument which evaluates to true is given, any missing files will be removed
-from the internal hash. The return value is a list of the missing files, which
-will be empty if they all exist.
-
-=item packlist_file()
-
-This returns the name of the associated .packlist file
-
-=back
-
-=head1 EXAMPLE
-
-Here's C<modrm>, a little utility to cleanly remove an installed module.
-
- #!/usr/local/bin/perl -w
-
- use strict;
- use IO::Dir;
- use ExtUtils::Packlist;
- use ExtUtils::Installed;
-
- sub emptydir($) {
- my ($dir) = @_;
- my $dh = IO::Dir->new($dir) || return(0);
- my @count = $dh->read();
- $dh->close();
- return(@count == 2 ? 1 : 0);
- }
-
- # Find all the installed packages
- print("Finding all installed modules...\n");
- my $installed = ExtUtils::Installed->new();
-
- foreach my $module (grep(!/^Perl$/, $installed->modules())) {
- my $version = $installed->version($module) || "???";
- print("Found module $module Version $version\n");
- print("Do you want to delete $module? [n] ");
- my $r = <STDIN>; chomp($r);
- if ($r && $r =~ /^y/i) {
- # Remove all the files
- foreach my $file (sort($installed->files($module))) {
- print("rm $file\n");
- unlink($file);
- }
- my $pf = $installed->packlist($module)->packlist_file();
- print("rm $pf\n");
- unlink($pf);
- foreach my $dir (sort($installed->directory_tree($module))) {
- if (emptydir($dir)) {
- print("rmdir $dir\n");
- rmdir($dir);
- }
- }
- }
- }
-
-=head1 AUTHOR
-
-Alan Burlison <Alan.Burlison at uk.sun.com>
-
-=cut
Deleted: trunk/contrib/perl/lib/ExtUtils/ParseXS.pm
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/ParseXS.pm 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/ParseXS.pm 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,2091 +0,0 @@
-package ExtUtils::ParseXS;
-
-use 5.006; # We use /??{}/ in regexes
-use Cwd;
-use Config;
-use File::Basename;
-use File::Spec;
-use Symbol;
-
-require Exporter;
-
- at ISA = qw(Exporter);
- at EXPORT_OK = qw(process_file);
-
-# use strict; # One of these days...
-
-my(@XSStack); # Stack of conditionals and INCLUDEs
-my($XSS_work_idx, $cpp_next_tmp);
-
-use vars qw($VERSION);
-$VERSION = '2.2002';
-
-use vars qw(%input_expr %output_expr $ProtoUsed @InitFileCode $FH $proto_re $Overload $errors $Fallback
- $cplusplus $hiertype $WantPrototypes $WantVersionChk $except $WantLineNumbers
- $WantOptimize $process_inout $process_argtypes @tm
- $dir $filename $filepathname %IncludedFiles
- %type_kind %proto_letter
- %targetable $BLOCK_re $lastline $lastline_no
- $Package $Prefix @line @BootCode %args_match %defaults %var_types %arg_list @proto_arg
- $processing_arg_with_types %argtype_seen @outlist %in_out %lengthof
- $proto_in_this_xsub $scope_in_this_xsub $interface $prepush_done $interface_macro $interface_macro_set
- $ProtoThisXSUB $ScopeThisXSUB $xsreturn
- @line_no $ret_type $func_header $orig_args
- ); # Add these just to get compilation to happen.
-
-
-sub process_file {
-
- # Allow for $package->process_file(%hash) in the future
- my ($pkg, %args) = @_ % 2 ? @_ : (__PACKAGE__, @_);
-
- $ProtoUsed = exists $args{prototypes};
-
- # Set defaults.
- %args = (
- # 'C++' => 0, # Doesn't seem to *do* anything...
- hiertype => 0,
- except => 0,
- prototypes => 0,
- versioncheck => 1,
- linenumbers => 1,
- optimize => 1,
- prototypes => 0,
- inout => 1,
- argtypes => 1,
- typemap => [],
- output => \*STDOUT,
- csuffix => '.c',
- %args,
- );
-
- # Global Constants
-
- my ($Is_VMS, $SymSet);
- if ($^O eq 'VMS') {
- $Is_VMS = 1;
- # Establish set of global symbols with max length 28, since xsubpp
- # will later add the 'XS_' prefix.
- require ExtUtils::XSSymSet;
- $SymSet = new ExtUtils::XSSymSet 28;
- }
- @XSStack = ({type => 'none'});
- ($XSS_work_idx, $cpp_next_tmp) = (0, "XSubPPtmpAAAA");
- @InitFileCode = ();
- $FH = Symbol::gensym();
- $proto_re = "[" . quotemeta('\$%&*@;[]') . "]" ;
- $Overload = 0;
- $errors = 0;
- $Fallback = '&PL_sv_undef';
-
- # Most of the 1500 lines below uses these globals. We'll have to
- # clean this up sometime, probably. For now, we just pull them out
- # of %args. -Ken
-
- $cplusplus = $args{'C++'};
- $hiertype = $args{hiertype};
- $WantPrototypes = $args{prototypes};
- $WantVersionChk = $args{versioncheck};
- $except = $args{except} ? ' TRY' : '';
- $WantLineNumbers = $args{linenumbers};
- $WantOptimize = $args{optimize};
- $process_inout = $args{inout};
- $process_argtypes = $args{argtypes};
- @tm = ref $args{typemap} ? @{$args{typemap}} : ($args{typemap});
-
- for ($args{filename}) {
- die "Missing required parameter 'filename'" unless $_;
- $filepathname = $_;
- ($dir, $filename) = (dirname($_), basename($_));
- $filepathname =~ s/\\/\\\\/g;
- $IncludedFiles{$_}++;
- }
-
- # Open the input file
- open($FH, $args{filename}) or die "cannot open $args{filename}: $!\n";
-
- # Open the output file if given as a string. If they provide some
- # other kind of reference, trust them that we can print to it.
- if (not ref $args{output}) {
- open my($fh), "> $args{output}" or die "Can't create $args{output}: $!";
- $args{outfile} = $args{output};
- $args{output} = $fh;
- }
-
- # Really, we shouldn't have to chdir() or select() in the first
- # place. For now, just save & restore.
- my $orig_cwd = cwd();
- my $orig_fh = select();
-
- chdir($dir);
- my $pwd = cwd();
- my $csuffix = $args{csuffix};
-
- if ($WantLineNumbers) {
- my $cfile;
- if ( $args{outfile} ) {
- $cfile = $args{outfile};
- } else {
- $cfile = $args{filename};
- $cfile =~ s/\.xs$/$csuffix/i or $cfile .= $csuffix;
- }
- tie(*PSEUDO_STDOUT, 'ExtUtils::ParseXS::CountLines', $cfile, $args{output});
- select PSEUDO_STDOUT;
- } else {
- select $args{output};
- }
-
- foreach my $typemap (@tm) {
- die "Can't find $typemap in $pwd\n" unless -r $typemap;
- }
-
- push @tm, standard_typemap_locations();
-
- foreach my $typemap (@tm) {
- next unless -f $typemap ;
- # skip directories, binary files etc.
- warn("Warning: ignoring non-text typemap file '$typemap'\n"), next
- unless -T $typemap ;
- open(TYPEMAP, $typemap)
- or warn ("Warning: could not open typemap file '$typemap': $!\n"), next;
- my $mode = 'Typemap';
- my $junk = "" ;
- my $current = \$junk;
- while (<TYPEMAP>) {
- next if /^\s* #/;
- my $line_no = $. + 1;
- if (/^INPUT\s*$/) {
- $mode = 'Input'; $current = \$junk; next;
- }
- if (/^OUTPUT\s*$/) {
- $mode = 'Output'; $current = \$junk; next;
- }
- if (/^TYPEMAP\s*$/) {
- $mode = 'Typemap'; $current = \$junk; next;
- }
- if ($mode eq 'Typemap') {
- chomp;
- my $line = $_ ;
- TrimWhitespace($_) ;
- # skip blank lines and comment lines
- next if /^$/ or /^#/ ;
- my($type,$kind, $proto) = /^\s*(.*?\S)\s+(\S+)\s*($proto_re*)\s*$/ or
- warn("Warning: File '$typemap' Line $. '$line' TYPEMAP entry needs 2 or 3 columns\n"), next;
- $type = TidyType($type) ;
- $type_kind{$type} = $kind ;
- # prototype defaults to '$'
- $proto = "\$" unless $proto ;
- warn("Warning: File '$typemap' Line $. '$line' Invalid prototype '$proto'\n")
- unless ValidProtoString($proto) ;
- $proto_letter{$type} = C_string($proto) ;
- } elsif (/^\s/) {
- $$current .= $_;
- } elsif ($mode eq 'Input') {
- s/\s+$//;
- $input_expr{$_} = '';
- $current = \$input_expr{$_};
- } else {
- s/\s+$//;
- $output_expr{$_} = '';
- $current = \$output_expr{$_};
- }
- }
- close(TYPEMAP);
- }
-
- foreach my $value (values %input_expr) {
- $value =~ s/;*\s+\z//;
- # Move C pre-processor instructions to column 1 to be strictly ANSI
- # conformant. Some pre-processors are fussy about this.
- $value =~ s/^\s+#/#/mg;
- }
- foreach my $value (values %output_expr) {
- # And again.
- $value =~ s/^\s+#/#/mg;
- }
-
- my ($cast, $size);
- our $bal = qr[(?:(?>[^()]+)|\((??{ $bal })\))*]; # ()-balanced
- $cast = qr[(?:\(\s*SV\s*\*\s*\)\s*)?]; # Optional (SV*) cast
- $size = qr[,\s* (??{ $bal }) ]x; # Third arg (to setpvn)
-
- foreach my $key (keys %output_expr) {
- BEGIN { $^H |= 0x00200000 }; # Equivalent to: use re 'eval', but hardcoded so we can compile re.xs
-
- my ($t, $with_size, $arg, $sarg) =
- ($output_expr{$key} =~
- m[^ \s+ sv_set ( [iunp] ) v (n)? # Type, is_setpvn
- \s* \( \s* $cast \$arg \s* ,
- \s* ( (??{ $bal }) ) # Set from
- ( (??{ $size }) )? # Possible sizeof set-from
- \) \s* ; \s* $
- ]x);
- $targetable{$key} = [$t, $with_size, $arg, $sarg] if $t;
- }
-
- my $END = "!End!\n\n"; # "impossible" keyword (multiple newline)
-
- # Match an XS keyword
- $BLOCK_re= '\s*(' . join('|', qw(
- REQUIRE BOOT CASE PREINIT INPUT INIT CODE PPCODE OUTPUT
- CLEANUP ALIAS ATTRS PROTOTYPES PROTOTYPE VERSIONCHECK INCLUDE
- SCOPE INTERFACE INTERFACE_MACRO C_ARGS POSTCALL OVERLOAD FALLBACK
- )) . "|$END)\\s*:";
-
-
- our ($C_group_rex, $C_arg);
- # Group in C (no support for comments or literals)
- $C_group_rex = qr/ [({\[]
- (?: (?> [^()\[\]{}]+ ) | (??{ $C_group_rex }) )*
- [)}\]] /x ;
- # Chunk in C without comma at toplevel (no comments):
- $C_arg = qr/ (?: (?> [^()\[\]{},"']+ )
- | (??{ $C_group_rex })
- | " (?: (?> [^\\"]+ )
- | \\.
- )* " # String literal
- | ' (?: (?> [^\\']+ ) | \\. )* ' # Char literal
- )* /xs;
-
- # Identify the version of xsubpp used
- print <<EOM ;
-/*
- * This file was generated automatically by ExtUtils::ParseXS version $VERSION from the
- * contents of $filename. Do not edit this file, edit $filename instead.
- *
- * ANY CHANGES MADE HERE WILL BE LOST!
- *
- */
-
-EOM
-
-
- print("#line 1 \"$filepathname\"\n")
- if $WantLineNumbers;
-
- firstmodule:
- while (<$FH>) {
- if (/^=/) {
- my $podstartline = $.;
- do {
- if (/^=cut\s*$/) {
- # We can't just write out a /* */ comment, as our embedded
- # POD might itself be in a comment. We can't put a /**/
- # comment inside #if 0, as the C standard says that the source
- # file is decomposed into preprocessing characters in the stage
- # before preprocessing commands are executed.
- # I don't want to leave the text as barewords, because the spec
- # isn't clear whether macros are expanded before or after
- # preprocessing commands are executed, and someone pathological
- # may just have defined one of the 3 words as a macro that does
- # something strange. Multiline strings are illegal in C, so
- # the "" we write must be a string literal. And they aren't
- # concatenated until 2 steps later, so we are safe.
- # - Nicholas Clark
- print("#if 0\n \"Skipped embedded POD.\"\n#endif\n");
- printf("#line %d \"$filepathname\"\n", $. + 1)
- if $WantLineNumbers;
- next firstmodule
- }
-
- } while (<$FH>);
- # At this point $. is at end of file so die won't state the start
- # of the problem, and as we haven't yet read any lines &death won't
- # show the correct line in the message either.
- die ("Error: Unterminated pod in $filename, line $podstartline\n")
- unless $lastline;
- }
- last if ($Package, $Prefix) =
- /^MODULE\s*=\s*[\w:]+(?:\s+PACKAGE\s*=\s*([\w:]+))?(?:\s+PREFIX\s*=\s*(\S+))?\s*$/;
-
- print $_;
- }
- unless (defined $_) {
- warn "Didn't find a 'MODULE ... PACKAGE ... PREFIX' line\n";
- exit 0; # Not a fatal error for the caller process
- }
-
- print 'ExtUtils::ParseXS::CountLines'->end_marker, "\n" if $WantLineNumbers;
-
- print <<"EOF";
-#ifndef PERL_UNUSED_VAR
-# define PERL_UNUSED_VAR(var) if (0) var = var
-#endif
-
-EOF
-
- print <<"EOF";
-#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
-#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
-
-/* prototype to pass -Wmissing-prototypes */
-STATIC void
-S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params);
-
-STATIC void
-S_croak_xs_usage(pTHX_ const CV *const cv, const char *const params)
-{
- const GV *const gv = CvGV(cv);
-
- PERL_ARGS_ASSERT_CROAK_XS_USAGE;
-
- if (gv) {
- const char *const gvname = GvNAME(gv);
- const HV *const stash = GvSTASH(gv);
- const char *const hvname = stash ? HvNAME(stash) : NULL;
-
- if (hvname)
- Perl_croak(aTHX_ "Usage: %s::%s(%s)", hvname, gvname, params);
- else
- Perl_croak(aTHX_ "Usage: %s(%s)", gvname, params);
- } else {
- /* Pants. I don't think that it should be possible to get here. */
- Perl_croak(aTHX_ "Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params);
- }
-}
-#undef PERL_ARGS_ASSERT_CROAK_XS_USAGE
-
-#ifdef PERL_IMPLICIT_CONTEXT
-#define croak_xs_usage(a,b) S_croak_xs_usage(aTHX_ a,b)
-#else
-#define croak_xs_usage S_croak_xs_usage
-#endif
-
-#endif
-
-EOF
-
- print 'ExtUtils::ParseXS::CountLines'->end_marker, "\n" if $WantLineNumbers;
-
- $lastline = $_;
- $lastline_no = $.;
-
- PARAGRAPH:
- while (fetch_para()) {
- # Print initial preprocessor statements and blank lines
- while (@line && $line[0] !~ /^[^\#]/) {
- my $line = shift(@line);
- print $line, "\n";
- next unless $line =~ /^\#\s*((if)(?:n?def)?|elsif|else|endif)\b/;
- my $statement = $+;
- if ($statement eq 'if') {
- $XSS_work_idx = @XSStack;
- push(@XSStack, {type => 'if'});
- } else {
- death ("Error: `$statement' with no matching `if'")
- if $XSStack[-1]{type} ne 'if';
- if ($XSStack[-1]{varname}) {
- push(@InitFileCode, "#endif\n");
- push(@BootCode, "#endif");
- }
-
- my(@fns) = keys %{$XSStack[-1]{functions}};
- if ($statement ne 'endif') {
- # Hide the functions defined in other #if branches, and reset.
- @{$XSStack[-1]{other_functions}}{@fns} = (1) x @fns;
- @{$XSStack[-1]}{qw(varname functions)} = ('', {});
- } else {
- my($tmp) = pop(@XSStack);
- 0 while (--$XSS_work_idx
- && $XSStack[$XSS_work_idx]{type} ne 'if');
- # Keep all new defined functions
- push(@fns, keys %{$tmp->{other_functions}});
- @{$XSStack[$XSS_work_idx]{functions}}{@fns} = (1) x @fns;
- }
- }
- }
-
- next PARAGRAPH unless @line;
-
- if ($XSS_work_idx && !$XSStack[$XSS_work_idx]{varname}) {
- # We are inside an #if, but have not yet #defined its xsubpp variable.
- print "#define $cpp_next_tmp 1\n\n";
- push(@InitFileCode, "#if $cpp_next_tmp\n");
- push(@BootCode, "#if $cpp_next_tmp");
- $XSStack[$XSS_work_idx]{varname} = $cpp_next_tmp++;
- }
-
- death ("Code is not inside a function"
- ." (maybe last function was ended by a blank line "
- ." followed by a statement on column one?)")
- if $line[0] =~ /^\s/;
-
- my ($class, $externC, $static, $ellipsis, $wantRETVAL, $RETVAL_no_return);
- my (@fake_INPUT_pre); # For length(s) generated variables
- my (@fake_INPUT);
-
- # initialize info arrays
- undef(%args_match);
- undef(%var_types);
- undef(%defaults);
- undef(%arg_list) ;
- undef(@proto_arg) ;
- undef($processing_arg_with_types) ;
- undef(%argtype_seen) ;
- undef(@outlist) ;
- undef(%in_out) ;
- undef(%lengthof) ;
- undef($proto_in_this_xsub) ;
- undef($scope_in_this_xsub) ;
- undef($interface);
- undef($prepush_done);
- $interface_macro = 'XSINTERFACE_FUNC' ;
- $interface_macro_set = 'XSINTERFACE_FUNC_SET' ;
- $ProtoThisXSUB = $WantPrototypes ;
- $ScopeThisXSUB = 0;
- $xsreturn = 0;
-
- $_ = shift(@line);
- while (my $kwd = check_keyword("REQUIRE|PROTOTYPES|FALLBACK|VERSIONCHECK|INCLUDE")) {
- &{"${kwd}_handler"}() ;
- next PARAGRAPH unless @line ;
- $_ = shift(@line);
- }
-
- if (check_keyword("BOOT")) {
- &check_cpp;
- push (@BootCode, "#line $line_no[@line_no - @line] \"$filepathname\"")
- if $WantLineNumbers && $line[0] !~ /^\s*#\s*line\b/;
- push (@BootCode, @line, "") ;
- next PARAGRAPH ;
- }
-
-
- # extract return type, function name and arguments
- ($ret_type) = TidyType($_);
- $RETVAL_no_return = 1 if $ret_type =~ s/^NO_OUTPUT\s+//;
-
- # Allow one-line ANSI-like declaration
- unshift @line, $2
- if $process_argtypes
- and $ret_type =~ s/^(.*?\w.*?)\s*\b(\w+\s*\(.*)/$1/s;
-
- # a function definition needs at least 2 lines
- blurt ("Error: Function definition too short '$ret_type'"), next PARAGRAPH
- unless @line ;
-
- $externC = 1 if $ret_type =~ s/^extern "C"\s+//;
- $static = 1 if $ret_type =~ s/^static\s+//;
-
- $func_header = shift(@line);
- blurt ("Error: Cannot parse function definition from '$func_header'"), next PARAGRAPH
- unless $func_header =~ /^(?:([\w:]*)::)?(\w+)\s*\(\s*(.*?)\s*\)\s*(const)?\s*(;\s*)?$/s;
-
- ($class, $func_name, $orig_args) = ($1, $2, $3) ;
- $class = "$4 $class" if $4;
- ($pname = $func_name) =~ s/^($Prefix)?/$Packprefix/;
- ($clean_func_name = $func_name) =~ s/^$Prefix//;
- $Full_func_name = "${Packid}_$clean_func_name";
- if ($Is_VMS) {
- $Full_func_name = $SymSet->addsym($Full_func_name);
- }
-
- # Check for duplicate function definition
- for my $tmp (@XSStack) {
- next unless defined $tmp->{functions}{$Full_func_name};
- Warn("Warning: duplicate function definition '$clean_func_name' detected");
- last;
- }
- $XSStack[$XSS_work_idx]{functions}{$Full_func_name} ++ ;
- %XsubAliases = %XsubAliasValues = %Interfaces = @Attributes = ();
- $DoSetMagic = 1;
-
- $orig_args =~ s/\\\s*/ /g; # process line continuations
- my @args;
-
- my %only_C_inlist; # Not in the signature of Perl function
- if ($process_argtypes and $orig_args =~ /\S/) {
- my $args = "$orig_args ,";
- if ($args =~ /^( (??{ $C_arg }) , )* $ /x) {
- @args = ($args =~ /\G ( (??{ $C_arg }) ) , /xg);
- for ( @args ) {
- s/^\s+//;
- s/\s+$//;
- my ($arg, $default) = / ( [^=]* ) ( (?: = .* )? ) /x;
- my ($pre, $name) = ($arg =~ /(.*?) \s*
- \b ( \w+ | length\( \s*\w+\s* \) )
- \s* $ /x);
- next unless defined($pre) && length($pre);
- my $out_type = '';
- my $inout_var;
- if ($process_inout and s/^(IN|IN_OUTLIST|OUTLIST|OUT|IN_OUT)\s+//) {
- my $type = $1;
- $out_type = $type if $type ne 'IN';
- $arg =~ s/^(IN|IN_OUTLIST|OUTLIST|OUT|IN_OUT)\s+//;
- $pre =~ s/^(IN|IN_OUTLIST|OUTLIST|OUT|IN_OUT)\s+//;
- }
- my $islength;
- if ($name =~ /^length\( \s* (\w+) \s* \)\z/x) {
- $name = "XSauto_length_of_$1";
- $islength = 1;
- die "Default value on length() argument: `$_'"
- if length $default;
- }
- if (length $pre or $islength) { # Has a type
- if ($islength) {
- push @fake_INPUT_pre, $arg;
- } else {
- push @fake_INPUT, $arg;
- }
- # warn "pushing '$arg'\n";
- $argtype_seen{$name}++;
- $_ = "$name$default"; # Assigns to @args
- }
- $only_C_inlist{$_} = 1 if $out_type eq "OUTLIST" or $islength;
- push @outlist, $name if $out_type =~ /OUTLIST$/;
- $in_out{$name} = $out_type if $out_type;
- }
- } else {
- @args = split(/\s*,\s*/, $orig_args);
- Warn("Warning: cannot parse argument list '$orig_args', fallback to split");
- }
- } else {
- @args = split(/\s*,\s*/, $orig_args);
- for (@args) {
- if ($process_inout and s/^(IN|IN_OUTLIST|OUTLIST|IN_OUT|OUT)\s+//) {
- my $out_type = $1;
- next if $out_type eq 'IN';
- $only_C_inlist{$_} = 1 if $out_type eq "OUTLIST";
- push @outlist, $name if $out_type =~ /OUTLIST$/;
- $in_out{$_} = $out_type;
- }
- }
- }
- if (defined($class)) {
- my $arg0 = ((defined($static) or $func_name eq 'new')
- ? "CLASS" : "THIS");
- unshift(@args, $arg0);
- ($report_args = "$arg0, $report_args") =~ s/^\w+, $/$arg0/;
- }
- my $extra_args = 0;
- @args_num = ();
- $num_args = 0;
- my $report_args = '';
- foreach my $i (0 .. $#args) {
- if ($args[$i] =~ s/\.\.\.//) {
- $ellipsis = 1;
- if ($args[$i] eq '' && $i == $#args) {
- $report_args .= ", ...";
- pop(@args);
- last;
- }
- }
- if ($only_C_inlist{$args[$i]}) {
- push @args_num, undef;
- } else {
- push @args_num, ++$num_args;
- $report_args .= ", $args[$i]";
- }
- if ($args[$i] =~ /^([^=]*[^\s=])\s*=\s*(.*)/s) {
- $extra_args++;
- $args[$i] = $1;
- $defaults{$args[$i]} = $2;
- $defaults{$args[$i]} =~ s/"/\\"/g;
- }
- $proto_arg[$i+1] = '$' ;
- }
- $min_args = $num_args - $extra_args;
- $report_args =~ s/"/\\"/g;
- $report_args =~ s/^,\s+//;
- my @func_args = @args;
- shift @func_args if defined($class);
-
- for (@func_args) {
- s/^/&/ if $in_out{$_};
- }
- $func_args = join(", ", @func_args);
- @args_match{@args} = @args_num;
-
- $PPCODE = grep(/^\s*PPCODE\s*:/, @line);
- $CODE = grep(/^\s*CODE\s*:/, @line);
- # Detect CODE: blocks which use ST(n)= or XST_m*(n,v)
- # to set explicit return values.
- $EXPLICIT_RETURN = ($CODE &&
- ("@line" =~ /(\bST\s*\([^;]*=) | (\bXST_m\w+\s*\()/x ));
- $ALIAS = grep(/^\s*ALIAS\s*:/, @line);
- $INTERFACE = grep(/^\s*INTERFACE\s*:/, @line);
-
- $xsreturn = 1 if $EXPLICIT_RETURN;
-
- $externC = $externC ? qq[extern "C"] : "";
-
- # print function header
- print Q(<<"EOF");
-#$externC
-#XS(XS_${Full_func_name}); /* prototype to pass -Wmissing-prototypes */
-#XS(XS_${Full_func_name})
-#[[
-##ifdef dVAR
-# dVAR; dXSARGS;
-##else
-# dXSARGS;
-##endif
-EOF
- print Q(<<"EOF") if $ALIAS ;
-# dXSI32;
-EOF
- print Q(<<"EOF") if $INTERFACE ;
-# dXSFUNCTION($ret_type);
-EOF
- if ($ellipsis) {
- $cond = ($min_args ? qq(items < $min_args) : 0);
- } elsif ($min_args == $num_args) {
- $cond = qq(items != $min_args);
- } else {
- $cond = qq(items < $min_args || items > $num_args);
- }
-
- print Q(<<"EOF") if $except;
-# char errbuf[1024];
-# *errbuf = '\0';
-EOF
-
- if($cond) {
- print Q(<<"EOF");
-# if ($cond)
-# croak_xs_usage(cv, "$report_args");
-EOF
- } else {
- # cv likely to be unused
- print Q(<<"EOF");
-# PERL_UNUSED_VAR(cv); /* -W */
-EOF
- }
-
- #gcc -Wall: if an xsub has PPCODE is used
- #it is possible none of ST, XSRETURN or XSprePUSH macros are used
- #hence `ax' (setup by dXSARGS) is unused
- #XXX: could breakup the dXSARGS; into dSP;dMARK;dITEMS
- #but such a move could break third-party extensions
- print Q(<<"EOF") if $PPCODE;
-# PERL_UNUSED_VAR(ax); /* -Wall */
-EOF
-
- print Q(<<"EOF") if $PPCODE;
-# SP -= items;
-EOF
-
- # Now do a block of some sort.
-
- $condnum = 0;
- $cond = ''; # last CASE: condidional
- push(@line, "$END:");
- push(@line_no, $line_no[-1]);
- $_ = '';
- &check_cpp;
- while (@line) {
- &CASE_handler if check_keyword("CASE");
- print Q(<<"EOF");
-# $except [[
-EOF
-
- # do initialization of input variables
- $thisdone = 0;
- $retvaldone = 0;
- $deferred = "";
- %arg_list = () ;
- $gotRETVAL = 0;
-
- INPUT_handler() ;
- process_keyword("INPUT|PREINIT|INTERFACE_MACRO|C_ARGS|ALIAS|ATTRS|PROTOTYPE|SCOPE|OVERLOAD") ;
-
- print Q(<<"EOF") if $ScopeThisXSUB;
-# ENTER;
-# [[
-EOF
-
- if (!$thisdone && defined($class)) {
- if (defined($static) or $func_name eq 'new') {
- print "\tchar *";
- $var_types{"CLASS"} = "char *";
- &generate_init("char *", 1, "CLASS");
- }
- else {
- print "\t$class *";
- $var_types{"THIS"} = "$class *";
- &generate_init("$class *", 1, "THIS");
- }
- }
-
- # do code
- if (/^\s*NOT_IMPLEMENTED_YET/) {
- print "\n\tPerl_croak(aTHX_ \"$pname: not implemented yet\");\n";
- $_ = '' ;
- } else {
- if ($ret_type ne "void") {
- print "\t" . &map_type($ret_type, 'RETVAL') . ";\n"
- if !$retvaldone;
- $args_match{"RETVAL"} = 0;
- $var_types{"RETVAL"} = $ret_type;
- print "\tdXSTARG;\n"
- if $WantOptimize and $targetable{$type_kind{$ret_type}};
- }
-
- if (@fake_INPUT or @fake_INPUT_pre) {
- unshift @line, @fake_INPUT_pre, @fake_INPUT, $_;
- $_ = "";
- $processing_arg_with_types = 1;
- INPUT_handler() ;
- }
- print $deferred;
-
- process_keyword("INIT|ALIAS|ATTRS|PROTOTYPE|INTERFACE_MACRO|INTERFACE|C_ARGS|OVERLOAD") ;
-
- if (check_keyword("PPCODE")) {
- print_section();
- death ("PPCODE must be last thing") if @line;
- print "\tLEAVE;\n" if $ScopeThisXSUB;
- print "\tPUTBACK;\n\treturn;\n";
- } elsif (check_keyword("CODE")) {
- print_section() ;
- } elsif (defined($class) and $func_name eq "DESTROY") {
- print "\n\t";
- print "delete THIS;\n";
- } else {
- print "\n\t";
- if ($ret_type ne "void") {
- print "RETVAL = ";
- $wantRETVAL = 1;
- }
- if (defined($static)) {
- if ($func_name eq 'new') {
- $func_name = "$class";
- } else {
- print "${class}::";
- }
- } elsif (defined($class)) {
- if ($func_name eq 'new') {
- $func_name .= " $class";
- } else {
- print "THIS->";
- }
- }
- $func_name =~ s/^\Q$args{'s'}//
- if exists $args{'s'};
- $func_name = 'XSFUNCTION' if $interface;
- print "$func_name($func_args);\n";
- }
- }
-
- # do output variables
- $gotRETVAL = 0; # 1 if RETVAL seen in OUTPUT section;
- undef $RETVAL_code ; # code to set RETVAL (from OUTPUT section);
- # $wantRETVAL set if 'RETVAL =' autogenerated
- ($wantRETVAL, $ret_type) = (0, 'void') if $RETVAL_no_return;
- undef %outargs ;
- process_keyword("POSTCALL|OUTPUT|ALIAS|ATTRS|PROTOTYPE|OVERLOAD");
-
- &generate_output($var_types{$_}, $args_match{$_}, $_, $DoSetMagic)
- for grep $in_out{$_} =~ /OUT$/, keys %in_out;
-
- # all OUTPUT done, so now push the return value on the stack
- if ($gotRETVAL && $RETVAL_code) {
- print "\t$RETVAL_code\n";
- } elsif ($gotRETVAL || $wantRETVAL) {
- my $t = $WantOptimize && $targetable{$type_kind{$ret_type}};
- my $var = 'RETVAL';
- my $type = $ret_type;
-
- # 0: type, 1: with_size, 2: how, 3: how_size
- if ($t and not $t->[1] and $t->[0] eq 'p') {
- # PUSHp corresponds to setpvn. Treate setpv directly
- my $what = eval qq("$t->[2]");
- warn $@ if $@;
-
- print "\tsv_setpv(TARG, $what); XSprePUSH; PUSHTARG;\n";
- $prepush_done = 1;
- }
- elsif ($t) {
- my $what = eval qq("$t->[2]");
- warn $@ if $@;
-
- my $size = $t->[3];
- $size = '' unless defined $size;
- $size = eval qq("$size");
- warn $@ if $@;
- print "\tXSprePUSH; PUSH$t->[0]($what$size);\n";
- $prepush_done = 1;
- }
- else {
- # RETVAL almost never needs SvSETMAGIC()
- &generate_output($ret_type, 0, 'RETVAL', 0);
- }
- }
-
- $xsreturn = 1 if $ret_type ne "void";
- my $num = $xsreturn;
- my $c = @outlist;
- print "\tXSprePUSH;" if $c and not $prepush_done;
- print "\tEXTEND(SP,$c);\n" if $c;
- $xsreturn += $c;
- generate_output($var_types{$_}, $num++, $_, 0, 1) for @outlist;
-
- # do cleanup
- process_keyword("CLEANUP|ALIAS|ATTRS|PROTOTYPE|OVERLOAD") ;
-
- print Q(<<"EOF") if $ScopeThisXSUB;
-# ]]
-EOF
- print Q(<<"EOF") if $ScopeThisXSUB and not $PPCODE;
-# LEAVE;
-EOF
-
- # print function trailer
- print Q(<<"EOF");
-# ]]
-EOF
- print Q(<<"EOF") if $except;
-# BEGHANDLERS
-# CATCHALL
-# sprintf(errbuf, "%s: %s\\tpropagated", Xname, Xreason);
-# ENDHANDLERS
-EOF
- if (check_keyword("CASE")) {
- blurt ("Error: No `CASE:' at top of function")
- unless $condnum;
- $_ = "CASE: $_"; # Restore CASE: label
- next;
- }
- last if $_ eq "$END:";
- death(/^$BLOCK_re/o ? "Misplaced `$1:'" : "Junk at end of function");
- }
-
- print Q(<<"EOF") if $except;
-# if (errbuf[0])
-# Perl_croak(aTHX_ errbuf);
-EOF
-
- if ($xsreturn) {
- print Q(<<"EOF") unless $PPCODE;
-# XSRETURN($xsreturn);
-EOF
- } else {
- print Q(<<"EOF") unless $PPCODE;
-# XSRETURN_EMPTY;
-EOF
- }
-
- print Q(<<"EOF");
-#]]
-#
-EOF
-
- my $newXS = "newXS" ;
- my $proto = "" ;
-
- # Build the prototype string for the xsub
- if ($ProtoThisXSUB) {
- $newXS = "newXSproto";
-
- if ($ProtoThisXSUB eq 2) {
- # User has specified empty prototype
- }
- elsif ($ProtoThisXSUB eq 1) {
- my $s = ';';
- if ($min_args < $num_args) {
- $s = '';
- $proto_arg[$min_args] .= ";" ;
- }
- push @proto_arg, "$s\@"
- if $ellipsis ;
-
- $proto = join ("", grep defined, @proto_arg);
- }
- else {
- # User has specified a prototype
- $proto = $ProtoThisXSUB;
- }
- $proto = qq{, "$proto"};
- }
-
- if (%XsubAliases) {
- $XsubAliases{$pname} = 0
- unless defined $XsubAliases{$pname} ;
- while ( ($name, $value) = each %XsubAliases) {
- push(@InitFileCode, Q(<<"EOF"));
-# cv = newXS(\"$name\", XS_$Full_func_name, file);
-# XSANY.any_i32 = $value ;
-EOF
- push(@InitFileCode, Q(<<"EOF")) if $proto;
-# sv_setpv((SV*)cv$proto) ;
-EOF
- }
- }
- elsif (@Attributes) {
- push(@InitFileCode, Q(<<"EOF"));
-# cv = newXS(\"$pname\", XS_$Full_func_name, file);
-# apply_attrs_string("$Package", cv, "@Attributes", 0);
-EOF
- }
- elsif ($interface) {
- while ( ($name, $value) = each %Interfaces) {
- $name = "$Package\::$name" unless $name =~ /::/;
- push(@InitFileCode, Q(<<"EOF"));
-# cv = newXS(\"$name\", XS_$Full_func_name, file);
-# $interface_macro_set(cv,$value) ;
-EOF
- push(@InitFileCode, Q(<<"EOF")) if $proto;
-# sv_setpv((SV*)cv$proto) ;
-EOF
- }
- }
- else {
- push(@InitFileCode,
- " ${newXS}(\"$pname\", XS_$Full_func_name, file$proto);\n");
- }
- }
-
- if ($Overload) # make it findable with fetchmethod
- {
- print Q(<<"EOF");
-#XS(XS_${Packid}_nil); /* prototype to pass -Wmissing-prototypes */
-#XS(XS_${Packid}_nil)
-#{
-# dXSARGS;
-# XSRETURN_EMPTY;
-#}
-#
-EOF
- unshift(@InitFileCode, <<"MAKE_FETCHMETHOD_WORK");
- /* Making a sub named "${Package}::()" allows the package */
- /* to be findable via fetchmethod(), and causes */
- /* overload::Overloaded("${Package}") to return true. */
- newXS("${Package}::()", XS_${Packid}_nil, file$proto);
-MAKE_FETCHMETHOD_WORK
- }
-
- # print initialization routine
-
- print Q(<<"EOF");
-##ifdef __cplusplus
-#extern "C"
-##endif
-EOF
-
- print Q(<<"EOF");
-#XS(boot_$Module_cname); /* prototype to pass -Wmissing-prototypes */
-#XS(boot_$Module_cname)
-EOF
-
- print Q(<<"EOF");
-#[[
-##ifdef dVAR
-# dVAR; dXSARGS;
-##else
-# dXSARGS;
-##endif
-EOF
-
- #-Wall: if there is no $Full_func_name there are no xsubs in this .xs
- #so `file' is unused
- print Q(<<"EOF") if $Full_func_name;
-# const char* file = __FILE__;
-EOF
-
- print Q("#\n");
-
- print Q(<<"EOF");
-# PERL_UNUSED_VAR(cv); /* -W */
-# PERL_UNUSED_VAR(items); /* -W */
-EOF
-
- print Q(<<"EOF") if $WantVersionChk ;
-# XS_VERSION_BOOTCHECK ;
-#
-EOF
-
- print Q(<<"EOF") if defined $XsubAliases or defined $Interfaces ;
-# {
-# CV * cv ;
-#
-EOF
-
- print Q(<<"EOF") if ($Overload);
-# /* register the overloading (type 'A') magic */
-# PL_amagic_generation++;
-# /* The magic for overload gets a GV* via gv_fetchmeth as */
-# /* mentioned above, and looks in the SV* slot of it for */
-# /* the "fallback" status. */
-# sv_setsv(
-# get_sv( "${Package}::()", TRUE ),
-# $Fallback
-# );
-EOF
-
- print @InitFileCode;
-
- print Q(<<"EOF") if defined $XsubAliases or defined $Interfaces ;
-# }
-EOF
-
- if (@BootCode)
- {
- print "\n /* Initialisation Section */\n\n" ;
- @line = @BootCode;
- print_section();
- print "\n /* End of Initialisation Section */\n\n" ;
- }
-
- if ($] >= 5.009) {
- print <<'EOF';
- if (PL_unitcheckav)
- call_list(PL_scopestack_ix, PL_unitcheckav);
-EOF
- }
-
- print Q(<<"EOF");
-# XSRETURN_YES;
-#]]
-#
-EOF
-
- warn("Please specify prototyping behavior for $filename (see perlxs manual)\n")
- unless $ProtoUsed ;
-
- chdir($orig_cwd);
- select($orig_fh);
- untie *PSEUDO_STDOUT if tied *PSEUDO_STDOUT;
- close $FH;
-
- return 1;
-}
-
-sub errors { $errors }
-
-sub standard_typemap_locations {
- # Add all the default typemap locations to the search path
- my @tm = qw(typemap);
-
- my $updir = File::Spec->updir;
- foreach my $dir (File::Spec->catdir(($updir) x 1), File::Spec->catdir(($updir) x 2),
- File::Spec->catdir(($updir) x 3), File::Spec->catdir(($updir) x 4)) {
-
- unshift @tm, File::Spec->catfile($dir, 'typemap');
- unshift @tm, File::Spec->catfile($dir, lib => ExtUtils => 'typemap');
- }
- foreach my $dir (@INC) {
- my $file = File::Spec->catfile($dir, ExtUtils => 'typemap');
- unshift @tm, $file if -e $file;
- }
- return @tm;
-}
-
-sub TrimWhitespace
-{
- $_[0] =~ s/^\s+|\s+$//go ;
-}
-
-sub TidyType
- {
- local ($_) = @_ ;
-
- # rationalise any '*' by joining them into bunches and removing whitespace
- s#\s*(\*+)\s*#$1#g;
- s#(\*+)# $1 #g ;
-
- # change multiple whitespace into a single space
- s/\s+/ /g ;
-
- # trim leading & trailing whitespace
- TrimWhitespace($_) ;
-
- $_ ;
-}
-
-# Input: ($_, @line) == unparsed input.
-# Output: ($_, @line) == (rest of line, following lines).
-# Return: the matched keyword if found, otherwise 0
-sub check_keyword {
- $_ = shift(@line) while !/\S/ && @line;
- s/^(\s*)($_[0])\s*:\s*(?:#.*)?/$1/s && $2;
-}
-
-sub print_section {
- # the "do" is required for right semantics
- do { $_ = shift(@line) } while !/\S/ && @line;
-
- print("#line ", $line_no[@line_no - @line -1], " \"$filepathname\"\n")
- if $WantLineNumbers && !/^\s*#\s*line\b/ && !/^#if XSubPPtmp/;
- for (; defined($_) && !/^$BLOCK_re/o; $_ = shift(@line)) {
- print "$_\n";
- }
- print 'ExtUtils::ParseXS::CountLines'->end_marker, "\n" if $WantLineNumbers;
-}
-
-sub merge_section {
- my $in = '';
-
- while (!/\S/ && @line) {
- $_ = shift(@line);
- }
-
- for (; defined($_) && !/^$BLOCK_re/o; $_ = shift(@line)) {
- $in .= "$_\n";
- }
- chomp $in;
- return $in;
- }
-
-sub process_keyword($)
- {
- my($pattern) = @_ ;
- my $kwd ;
-
- &{"${kwd}_handler"}()
- while $kwd = check_keyword($pattern) ;
- }
-
-sub CASE_handler {
- blurt ("Error: `CASE:' after unconditional `CASE:'")
- if $condnum && $cond eq '';
- $cond = $_;
- TrimWhitespace($cond);
- print " ", ($condnum++ ? " else" : ""), ($cond ? " if ($cond)\n" : "\n");
- $_ = '' ;
-}
-
-sub INPUT_handler {
- for (; !/^$BLOCK_re/o; $_ = shift(@line)) {
- last if /^\s*NOT_IMPLEMENTED_YET/;
- next unless /\S/; # skip blank lines
-
- TrimWhitespace($_) ;
- my $line = $_ ;
-
- # remove trailing semicolon if no initialisation
- s/\s*;$//g unless /[=;+].*\S/ ;
-
- # Process the length(foo) declarations
- if (s/^([^=]*)\blength\(\s*(\w+)\s*\)\s*$/$1 XSauto_length_of_$2=NO_INIT/x) {
- print "\tSTRLEN\tSTRLEN_length_of_$2;\n";
- $lengthof{$2} = $name;
- # $islengthof{$name} = $1;
- $deferred .= "\n\tXSauto_length_of_$2 = STRLEN_length_of_$2;";
- }
-
- # check for optional initialisation code
- my $var_init = '' ;
- $var_init = $1 if s/\s*([=;+].*)$//s ;
- $var_init =~ s/"/\\"/g;
-
- s/\s+/ /g;
- my ($var_type, $var_addr, $var_name) = /^(.*?[^&\s])\s*(\&?)\s*\b(\w+)$/s
- or blurt("Error: invalid argument declaration '$line'"), next;
-
- # Check for duplicate definitions
- blurt ("Error: duplicate definition of argument '$var_name' ignored"), next
- if $arg_list{$var_name}++
- or defined $argtype_seen{$var_name} and not $processing_arg_with_types;
-
- $thisdone |= $var_name eq "THIS";
- $retvaldone |= $var_name eq "RETVAL";
- $var_types{$var_name} = $var_type;
- # XXXX This check is a safeguard against the unfinished conversion of
- # generate_init(). When generate_init() is fixed,
- # one can use 2-args map_type() unconditionally.
- if ($var_type =~ / \( \s* \* \s* \) /x) {
- # Function pointers are not yet supported with &output_init!
- print "\t" . &map_type($var_type, $var_name);
- $name_printed = 1;
- } else {
- print "\t" . &map_type($var_type);
- $name_printed = 0;
- }
- $var_num = $args_match{$var_name};
-
- $proto_arg[$var_num] = ProtoString($var_type)
- if $var_num ;
- $func_args =~ s/\b($var_name)\b/&$1/ if $var_addr;
- if ($var_init =~ /^[=;]\s*NO_INIT\s*;?\s*$/
- or $in_out{$var_name} and $in_out{$var_name} =~ /^OUT/
- and $var_init !~ /\S/) {
- if ($name_printed) {
- print ";\n";
- } else {
- print "\t$var_name;\n";
- }
- } elsif ($var_init =~ /\S/) {
- &output_init($var_type, $var_num, $var_name, $var_init, $name_printed);
- } elsif ($var_num) {
- # generate initialization code
- &generate_init($var_type, $var_num, $var_name, $name_printed);
- } else {
- print ";\n";
- }
- }
-}
-
-sub OUTPUT_handler {
- for (; !/^$BLOCK_re/o; $_ = shift(@line)) {
- next unless /\S/;
- if (/^\s*SETMAGIC\s*:\s*(ENABLE|DISABLE)\s*/) {
- $DoSetMagic = ($1 eq "ENABLE" ? 1 : 0);
- next;
- }
- my ($outarg, $outcode) = /^\s*(\S+)\s*(.*?)\s*$/s ;
- blurt ("Error: duplicate OUTPUT argument '$outarg' ignored"), next
- if $outargs{$outarg} ++ ;
- if (!$gotRETVAL and $outarg eq 'RETVAL') {
- # deal with RETVAL last
- $RETVAL_code = $outcode ;
- $gotRETVAL = 1 ;
- next ;
- }
- blurt ("Error: OUTPUT $outarg not an argument"), next
- unless defined($args_match{$outarg});
- blurt("Error: No input definition for OUTPUT argument '$outarg' - ignored"), next
- unless defined $var_types{$outarg} ;
- $var_num = $args_match{$outarg};
- if ($outcode) {
- print "\t$outcode\n";
- print "\tSvSETMAGIC(ST(" , $var_num-1 , "));\n" if $DoSetMagic;
- } else {
- &generate_output($var_types{$outarg}, $var_num, $outarg, $DoSetMagic);
- }
- delete $in_out{$outarg} # No need to auto-OUTPUT
- if exists $in_out{$outarg} and $in_out{$outarg} =~ /OUT$/;
- }
-}
-
-sub C_ARGS_handler() {
- my $in = merge_section();
-
- TrimWhitespace($in);
- $func_args = $in;
-}
-
-sub INTERFACE_MACRO_handler() {
- my $in = merge_section();
-
- TrimWhitespace($in);
- if ($in =~ /\s/) { # two
- ($interface_macro, $interface_macro_set) = split ' ', $in;
- } else {
- $interface_macro = $in;
- $interface_macro_set = 'UNKNOWN_CVT'; # catch later
- }
- $interface = 1; # local
- $Interfaces = 1; # global
-}
-
-sub INTERFACE_handler() {
- my $in = merge_section();
-
- TrimWhitespace($in);
-
- foreach (split /[\s,]+/, $in) {
- my $name = $_;
- $name =~ s/^$Prefix//;
- $Interfaces{$name} = $_;
- }
- print Q(<<"EOF");
-# XSFUNCTION = $interface_macro($ret_type,cv,XSANY.any_dptr);
-EOF
- $interface = 1; # local
- $Interfaces = 1; # global
-}
-
-sub CLEANUP_handler() { print_section() }
-sub PREINIT_handler() { print_section() }
-sub POSTCALL_handler() { print_section() }
-sub INIT_handler() { print_section() }
-
-sub GetAliases
- {
- my ($line) = @_ ;
- my ($orig) = $line ;
- my ($alias) ;
- my ($value) ;
-
- # Parse alias definitions
- # format is
- # alias = value alias = value ...
-
- while ($line =~ s/^\s*([\w:]+)\s*=\s*(\w+)\s*//) {
- $alias = $1 ;
- $orig_alias = $alias ;
- $value = $2 ;
-
- # check for optional package definition in the alias
- $alias = $Packprefix . $alias if $alias !~ /::/ ;
-
- # check for duplicate alias name & duplicate value
- Warn("Warning: Ignoring duplicate alias '$orig_alias'")
- if defined $XsubAliases{$alias} ;
-
- Warn("Warning: Aliases '$orig_alias' and '$XsubAliasValues{$value}' have identical values")
- if $XsubAliasValues{$value} ;
-
- $XsubAliases = 1;
- $XsubAliases{$alias} = $value ;
- $XsubAliasValues{$value} = $orig_alias ;
- }
-
- blurt("Error: Cannot parse ALIAS definitions from '$orig'")
- if $line ;
- }
-
-sub ATTRS_handler ()
- {
- for (; !/^$BLOCK_re/o; $_ = shift(@line)) {
- next unless /\S/;
- TrimWhitespace($_) ;
- push @Attributes, $_;
- }
- }
-
-sub ALIAS_handler ()
- {
- for (; !/^$BLOCK_re/o; $_ = shift(@line)) {
- next unless /\S/;
- TrimWhitespace($_) ;
- GetAliases($_) if $_ ;
- }
- }
-
-sub OVERLOAD_handler()
-{
- for (; !/^$BLOCK_re/o; $_ = shift(@line)) {
- next unless /\S/;
- TrimWhitespace($_) ;
- while ( s/^\s*([\w:"\\)\+\-\*\/\%\<\>\.\&\|\^\!\~\{\}\=]+)\s*//) {
- $Overload = 1 unless $Overload;
- my $overload = "$Package\::(".$1 ;
- push(@InitFileCode,
- " newXS(\"$overload\", XS_$Full_func_name, file$proto);\n");
- }
- }
-}
-
-sub FALLBACK_handler()
-{
- # the rest of the current line should contain either TRUE,
- # FALSE or UNDEF
-
- TrimWhitespace($_) ;
- my %map = (
- TRUE => "&PL_sv_yes", 1 => "&PL_sv_yes",
- FALSE => "&PL_sv_no", 0 => "&PL_sv_no",
- UNDEF => "&PL_sv_undef",
- ) ;
-
- # check for valid FALLBACK value
- death ("Error: FALLBACK: TRUE/FALSE/UNDEF") unless exists $map{uc $_} ;
-
- $Fallback = $map{uc $_} ;
-}
-
-
-sub REQUIRE_handler ()
- {
- # the rest of the current line should contain a version number
- my ($Ver) = $_ ;
-
- TrimWhitespace($Ver) ;
-
- death ("Error: REQUIRE expects a version number")
- unless $Ver ;
-
- # check that the version number is of the form n.n
- death ("Error: REQUIRE: expected a number, got '$Ver'")
- unless $Ver =~ /^\d+(\.\d*)?/ ;
-
- death ("Error: xsubpp $Ver (or better) required--this is only $VERSION.")
- unless $VERSION >= $Ver ;
- }
-
-sub VERSIONCHECK_handler ()
- {
- # the rest of the current line should contain either ENABLE or
- # DISABLE
-
- TrimWhitespace($_) ;
-
- # check for ENABLE/DISABLE
- death ("Error: VERSIONCHECK: ENABLE/DISABLE")
- unless /^(ENABLE|DISABLE)/i ;
-
- $WantVersionChk = 1 if $1 eq 'ENABLE' ;
- $WantVersionChk = 0 if $1 eq 'DISABLE' ;
-
- }
-
-sub PROTOTYPE_handler ()
- {
- my $specified ;
-
- death("Error: Only 1 PROTOTYPE definition allowed per xsub")
- if $proto_in_this_xsub ++ ;
-
- for (; !/^$BLOCK_re/o; $_ = shift(@line)) {
- next unless /\S/;
- $specified = 1 ;
- TrimWhitespace($_) ;
- if ($_ eq 'DISABLE') {
- $ProtoThisXSUB = 0
- } elsif ($_ eq 'ENABLE') {
- $ProtoThisXSUB = 1
- } else {
- # remove any whitespace
- s/\s+//g ;
- death("Error: Invalid prototype '$_'")
- unless ValidProtoString($_) ;
- $ProtoThisXSUB = C_string($_) ;
- }
- }
-
- # If no prototype specified, then assume empty prototype ""
- $ProtoThisXSUB = 2 unless $specified ;
-
- $ProtoUsed = 1 ;
-
- }
-
-sub SCOPE_handler ()
- {
- death("Error: Only 1 SCOPE declaration allowed per xsub")
- if $scope_in_this_xsub ++ ;
-
- for (; !/^$BLOCK_re/o; $_ = shift(@line)) {
- next unless /\S/;
- TrimWhitespace($_) ;
- if ($_ =~ /^DISABLE/i) {
- $ScopeThisXSUB = 0
- } elsif ($_ =~ /^ENABLE/i) {
- $ScopeThisXSUB = 1
- }
- }
-
- }
-
-sub PROTOTYPES_handler ()
- {
- # the rest of the current line should contain either ENABLE or
- # DISABLE
-
- TrimWhitespace($_) ;
-
- # check for ENABLE/DISABLE
- death ("Error: PROTOTYPES: ENABLE/DISABLE")
- unless /^(ENABLE|DISABLE)/i ;
-
- $WantPrototypes = 1 if $1 eq 'ENABLE' ;
- $WantPrototypes = 0 if $1 eq 'DISABLE' ;
- $ProtoUsed = 1 ;
-
- }
-
-sub INCLUDE_handler ()
- {
- # the rest of the current line should contain a valid filename
-
- TrimWhitespace($_) ;
-
- death("INCLUDE: filename missing")
- unless $_ ;
-
- death("INCLUDE: output pipe is illegal")
- if /^\s*\|/ ;
-
- # simple minded recursion detector
- death("INCLUDE loop detected")
- if $IncludedFiles{$_} ;
-
- ++ $IncludedFiles{$_} unless /\|\s*$/ ;
-
- # Save the current file context.
- push(@XSStack, {
- type => 'file',
- LastLine => $lastline,
- LastLineNo => $lastline_no,
- Line => \@line,
- LineNo => \@line_no,
- Filename => $filename,
- Filepathname => $filepathname,
- Handle => $FH,
- }) ;
-
- $FH = Symbol::gensym();
-
- # open the new file
- open ($FH, "$_") or death("Cannot open '$_': $!") ;
-
- print Q(<<"EOF");
-#
-#/* INCLUDE: Including '$_' from '$filename' */
-#
-EOF
-
- $filepathname = $filename = $_ ;
-
- # Prime the pump by reading the first
- # non-blank line
-
- # skip leading blank lines
- while (<$FH>) {
- last unless /^\s*$/ ;
- }
-
- $lastline = $_ ;
- $lastline_no = $. ;
-
- }
-
-sub PopFile()
- {
- return 0 unless $XSStack[-1]{type} eq 'file' ;
-
- my $data = pop @XSStack ;
- my $ThisFile = $filename ;
- my $isPipe = ($filename =~ /\|\s*$/) ;
-
- -- $IncludedFiles{$filename}
- unless $isPipe ;
-
- close $FH ;
-
- $FH = $data->{Handle} ;
- # $filename is the leafname, which for some reason isused for diagnostic
- # messages, whereas $filepathname is the full pathname, and is used for
- # #line directives.
- $filename = $data->{Filename} ;
- $filepathname = $data->{Filepathname} ;
- $lastline = $data->{LastLine} ;
- $lastline_no = $data->{LastLineNo} ;
- @line = @{ $data->{Line} } ;
- @line_no = @{ $data->{LineNo} } ;
-
- if ($isPipe and $? ) {
- -- $lastline_no ;
- print STDERR "Error reading from pipe '$ThisFile': $! in $filename, line $lastline_no\n" ;
- exit 1 ;
- }
-
- print Q(<<"EOF");
-#
-#/* INCLUDE: Returning to '$filename' from '$ThisFile' */
-#
-EOF
-
- return 1 ;
- }
-
-sub ValidProtoString ($)
- {
- my($string) = @_ ;
-
- if ( $string =~ /^$proto_re+$/ ) {
- return $string ;
- }
-
- return 0 ;
- }
-
-sub C_string ($)
- {
- my($string) = @_ ;
-
- $string =~ s[\\][\\\\]g ;
- $string ;
- }
-
-sub ProtoString ($)
- {
- my ($type) = @_ ;
-
- $proto_letter{$type} or "\$" ;
- }
-
-sub check_cpp {
- my @cpp = grep(/^\#\s*(?:if|e\w+)/, @line);
- if (@cpp) {
- my ($cpp, $cpplevel);
- for $cpp (@cpp) {
- if ($cpp =~ /^\#\s*if/) {
- $cpplevel++;
- } elsif (!$cpplevel) {
- Warn("Warning: #else/elif/endif without #if in this function");
- print STDERR " (precede it with a blank line if the matching #if is outside the function)\n"
- if $XSStack[-1]{type} eq 'if';
- return;
- } elsif ($cpp =~ /^\#\s*endif/) {
- $cpplevel--;
- }
- }
- Warn("Warning: #if without #endif in this function") if $cpplevel;
- }
-}
-
-
-sub Q {
- my($text) = @_;
- $text =~ s/^#//gm;
- $text =~ s/\[\[/{/g;
- $text =~ s/\]\]/}/g;
- $text;
-}
-
-# Read next xsub into @line from ($lastline, <$FH>).
-sub fetch_para {
- # parse paragraph
- death ("Error: Unterminated `#if/#ifdef/#ifndef'")
- if !defined $lastline && $XSStack[-1]{type} eq 'if';
- @line = ();
- @line_no = () ;
- return PopFile() if !defined $lastline;
-
- if ($lastline =~
- /^MODULE\s*=\s*([\w:]+)(?:\s+PACKAGE\s*=\s*([\w:]+))?(?:\s+PREFIX\s*=\s*(\S+))?\s*$/) {
- $Module = $1;
- $Package = defined($2) ? $2 : ''; # keep -w happy
- $Prefix = defined($3) ? $3 : ''; # keep -w happy
- $Prefix = quotemeta $Prefix ;
- ($Module_cname = $Module) =~ s/\W/_/g;
- ($Packid = $Package) =~ tr/:/_/;
- $Packprefix = $Package;
- $Packprefix .= "::" if $Packprefix ne "";
- $lastline = "";
- }
-
- for (;;) {
- # Skip embedded PODs
- while ($lastline =~ /^=/) {
- while ($lastline = <$FH>) {
- last if ($lastline =~ /^=cut\s*$/);
- }
- death ("Error: Unterminated pod") unless $lastline;
- $lastline = <$FH>;
- chomp $lastline;
- $lastline =~ s/^\s+$//;
- }
- if ($lastline !~ /^\s*#/ ||
- # CPP directives:
- # ANSI: if ifdef ifndef elif else endif define undef
- # line error pragma
- # gcc: warning include_next
- # obj-c: import
- # others: ident (gcc notes that some cpps have this one)
- $lastline =~ /^#[ \t]*(?:(?:if|ifn?def|elif|else|endif|define|undef|pragma|error|warning|line\s+\d+|ident)\b|(?:include(?:_next)?|import)\s*["<].*[>"])/) {
- last if $lastline =~ /^\S/ && @line && $line[-1] eq "";
- push(@line, $lastline);
- push(@line_no, $lastline_no) ;
- }
-
- # Read next line and continuation lines
- last unless defined($lastline = <$FH>);
- $lastline_no = $.;
- my $tmp_line;
- $lastline .= $tmp_line
- while ($lastline =~ /\\$/ && defined($tmp_line = <$FH>));
-
- chomp $lastline;
- $lastline =~ s/^\s+$//;
- }
- pop(@line), pop(@line_no) while @line && $line[-1] eq "";
- 1;
-}
-
-sub output_init {
- local($type, $num, $var, $init, $name_printed) = @_;
- local($arg) = "ST(" . ($num - 1) . ")";
-
- if ( $init =~ /^=/ ) {
- if ($name_printed) {
- eval qq/print " $init\\n"/;
- } else {
- eval qq/print "\\t$var $init\\n"/;
- }
- warn $@ if $@;
- } else {
- if ( $init =~ s/^\+// && $num ) {
- &generate_init($type, $num, $var, $name_printed);
- } elsif ($name_printed) {
- print ";\n";
- $init =~ s/^;//;
- } else {
- eval qq/print "\\t$var;\\n"/;
- warn $@ if $@;
- $init =~ s/^;//;
- }
- $deferred .= eval qq/"\\n\\t$init\\n"/;
- warn $@ if $@;
- }
-}
-
-sub Warn
- {
- # work out the line number
- my $line_no = $line_no[@line_no - @line -1] ;
-
- print STDERR "@_ in $filename, line $line_no\n" ;
- }
-
-sub blurt
- {
- Warn @_ ;
- $errors ++
- }
-
-sub death
- {
- Warn @_ ;
- exit 1 ;
- }
-
-sub generate_init {
- local($type, $num, $var) = @_;
- local($arg) = "ST(" . ($num - 1) . ")";
- local($argoff) = $num - 1;
- local($ntype);
- local($tk);
-
- $type = TidyType($type) ;
- blurt("Error: '$type' not in typemap"), return
- unless defined($type_kind{$type});
-
- ($ntype = $type) =~ s/\s*\*/Ptr/g;
- ($subtype = $ntype) =~ s/(?:Array)?(?:Ptr)?$//;
- $tk = $type_kind{$type};
- $tk =~ s/OBJ$/REF/ if $func_name =~ /DESTROY$/;
- if ($tk eq 'T_PV' and exists $lengthof{$var}) {
- print "\t$var" unless $name_printed;
- print " = ($type)SvPV($arg, STRLEN_length_of_$var);\n";
- die "default value not supported with length(NAME) supplied"
- if defined $defaults{$var};
- return;
- }
- $type =~ tr/:/_/ unless $hiertype;
- blurt("Error: No INPUT definition for type '$type', typekind '$type_kind{$type}' found"), return
- unless defined $input_expr{$tk} ;
- $expr = $input_expr{$tk};
- if ($expr =~ /DO_ARRAY_ELEM/) {
- blurt("Error: '$subtype' not in typemap"), return
- unless defined($type_kind{$subtype});
- blurt("Error: No INPUT definition for type '$subtype', typekind '$type_kind{$subtype}' found"), return
- unless defined $input_expr{$type_kind{$subtype}} ;
- $subexpr = $input_expr{$type_kind{$subtype}};
- $subexpr =~ s/\$type/\$subtype/g;
- $subexpr =~ s/ntype/subtype/g;
- $subexpr =~ s/\$arg/ST(ix_$var)/g;
- $subexpr =~ s/\n\t/\n\t\t/g;
- $subexpr =~ s/is not of (.*\")/[arg %d] is not of $1, ix_$var + 1/g;
- $subexpr =~ s/\$var/${var}[ix_$var - $argoff]/;
- $expr =~ s/DO_ARRAY_ELEM/$subexpr/;
- }
- if ($expr =~ m#/\*.*scope.*\*/#i) { # "scope" in C comments
- $ScopeThisXSUB = 1;
- }
- if (defined($defaults{$var})) {
- $expr =~ s/(\t+)/$1 /g;
- $expr =~ s/ /\t/g;
- if ($name_printed) {
- print ";\n";
- } else {
- eval qq/print "\\t$var;\\n"/;
- warn $@ if $@;
- }
- if ($defaults{$var} eq 'NO_INIT') {
- $deferred .= eval qq/"\\n\\tif (items >= $num) {\\n$expr;\\n\\t}\\n"/;
- } else {
- $deferred .= eval qq/"\\n\\tif (items < $num)\\n\\t $var = $defaults{$var};\\n\\telse {\\n$expr;\\n\\t}\\n"/;
- }
- warn $@ if $@;
- } elsif ($ScopeThisXSUB or $expr !~ /^\s*\$var =/) {
- if ($name_printed) {
- print ";\n";
- } else {
- eval qq/print "\\t$var;\\n"/;
- warn $@ if $@;
- }
- $deferred .= eval qq/"\\n$expr;\\n"/;
- warn $@ if $@;
- } else {
- die "panic: do not know how to handle this branch for function pointers"
- if $name_printed;
- eval qq/print "$expr;\\n"/;
- warn $@ if $@;
- }
-}
-
-sub generate_output {
- local($type, $num, $var, $do_setmagic, $do_push) = @_;
- local($arg) = "ST(" . ($num - ($num != 0)) . ")";
- local($argoff) = $num - 1;
- local($ntype);
-
- $type = TidyType($type) ;
- if ($type =~ /^array\(([^,]*),(.*)\)/) {
- print "\t$arg = sv_newmortal();\n";
- print "\tsv_setpvn($arg, (char *)$var, $2 * sizeof($1));\n";
- print "\tSvSETMAGIC($arg);\n" if $do_setmagic;
- } else {
- blurt("Error: '$type' not in typemap"), return
- unless defined($type_kind{$type});
- blurt("Error: No OUTPUT definition for type '$type', typekind '$type_kind{$type}' found"), return
- unless defined $output_expr{$type_kind{$type}} ;
- ($ntype = $type) =~ s/\s*\*/Ptr/g;
- $ntype =~ s/\(\)//g;
- ($subtype = $ntype) =~ s/(?:Array)?(?:Ptr)?$//;
- $expr = $output_expr{$type_kind{$type}};
- if ($expr =~ /DO_ARRAY_ELEM/) {
- blurt("Error: '$subtype' not in typemap"), return
- unless defined($type_kind{$subtype});
- blurt("Error: No OUTPUT definition for type '$subtype', typekind '$type_kind{$subtype}' found"), return
- unless defined $output_expr{$type_kind{$subtype}} ;
- $subexpr = $output_expr{$type_kind{$subtype}};
- $subexpr =~ s/ntype/subtype/g;
- $subexpr =~ s/\$arg/ST(ix_$var)/g;
- $subexpr =~ s/\$var/${var}[ix_$var]/g;
- $subexpr =~ s/\n\t/\n\t\t/g;
- $expr =~ s/DO_ARRAY_ELEM\n/$subexpr/;
- eval "print qq\a$expr\a";
- warn $@ if $@;
- print "\t\tSvSETMAGIC(ST(ix_$var));\n" if $do_setmagic;
- } elsif ($var eq 'RETVAL') {
- if ($expr =~ /^\t\$arg = new/) {
- # We expect that $arg has refcnt 1, so we need to
- # mortalize it.
- eval "print qq\a$expr\a";
- warn $@ if $@;
- print "\tsv_2mortal(ST($num));\n";
- print "\tSvSETMAGIC(ST($num));\n" if $do_setmagic;
- } elsif ($expr =~ /^\s*\$arg\s*=/) {
- # We expect that $arg has refcnt >=1, so we need
- # to mortalize it!
- eval "print qq\a$expr\a";
- warn $@ if $@;
- print "\tsv_2mortal(ST(0));\n";
- print "\tSvSETMAGIC(ST(0));\n" if $do_setmagic;
- } else {
- # Just hope that the entry would safely write it
- # over an already mortalized value. By
- # coincidence, something like $arg = &sv_undef
- # works too.
- print "\tST(0) = sv_newmortal();\n";
- eval "print qq\a$expr\a";
- warn $@ if $@;
- # new mortals don't have set magic
- }
- } elsif ($do_push) {
- print "\tPUSHs(sv_newmortal());\n";
- $arg = "ST($num)";
- eval "print qq\a$expr\a";
- warn $@ if $@;
- print "\tSvSETMAGIC($arg);\n" if $do_setmagic;
- } elsif ($arg =~ /^ST\(\d+\)$/) {
- eval "print qq\a$expr\a";
- warn $@ if $@;
- print "\tSvSETMAGIC($arg);\n" if $do_setmagic;
- }
- }
-}
-
-sub map_type {
- my($type, $varname) = @_;
-
- # C++ has :: in types too so skip this
- $type =~ tr/:/_/ unless $hiertype;
- $type =~ s/^array\(([^,]*),(.*)\).*/$1 */s;
- if ($varname) {
- if ($varname && $type =~ / \( \s* \* (?= \s* \) ) /xg) {
- (substr $type, pos $type, 0) = " $varname ";
- } else {
- $type .= "\t$varname";
- }
- }
- $type;
-}
-
-
-#########################################################
-package
- ExtUtils::ParseXS::CountLines;
-use strict;
-use vars qw($SECTION_END_MARKER);
-
-sub TIEHANDLE {
- my ($class, $cfile, $fh) = @_;
- $cfile =~ s/\\/\\\\/g;
- $SECTION_END_MARKER = qq{#line --- "$cfile"};
-
- return bless {buffer => '',
- fh => $fh,
- line_no => 1,
- }, $class;
-}
-
-sub PRINT {
- my $self = shift;
- for (@_) {
- $self->{buffer} .= $_;
- while ($self->{buffer} =~ s/^([^\n]*\n)//) {
- my $line = $1;
- ++ $self->{line_no};
- $line =~ s|^\#line\s+---(?=\s)|#line $self->{line_no}|;
- print {$self->{fh}} $line;
- }
- }
-}
-
-sub PRINTF {
- my $self = shift;
- my $fmt = shift;
- $self->PRINT(sprintf($fmt, @_));
-}
-
-sub DESTROY {
- # Not necessary if we're careful to end with a "\n"
- my $self = shift;
- print {$self->{fh}} $self->{buffer};
-}
-
-sub UNTIE {
- # This sub does nothing, but is neccessary for references to be released.
-}
-
-sub end_marker {
- return $SECTION_END_MARKER;
-}
-
-
-1;
-__END__
-
-=head1 NAME
-
-ExtUtils::ParseXS - converts Perl XS code into C code
-
-=head1 SYNOPSIS
-
- use ExtUtils::ParseXS qw(process_file);
-
- process_file( filename => 'foo.xs' );
-
- process_file( filename => 'foo.xs',
- output => 'bar.c',
- 'C++' => 1,
- typemap => 'path/to/typemap',
- hiertype => 1,
- except => 1,
- prototypes => 1,
- versioncheck => 1,
- linenumbers => 1,
- optimize => 1,
- prototypes => 1,
- );
-=head1 DESCRIPTION
-
-C<ExtUtils::ParseXS> will compile XS code into C code by embedding the constructs
-necessary to let C functions manipulate Perl values and creates the glue
-necessary to let Perl access those functions. The compiler uses typemaps to
-determine how to map C function parameters and variables to Perl values.
-
-The compiler will search for typemap files called I<typemap>. It will use
-the following search path to find default typemaps, with the rightmost
-typemap taking precedence.
-
- ../../../typemap:../../typemap:../typemap:typemap
-
-=head1 EXPORT
-
-None by default. C<process_file()> may be exported upon request.
-
-
-=head1 FUNCTIONS
-
-=over 4
-
-=item process_xs()
-
-This function processes an XS file and sends output to a C file.
-Named parameters control how the processing is done. The following
-parameters are accepted:
-
-=over 4
-
-=item B<C++>
-
-Adds C<extern "C"> to the C code. Default is false.
-
-=item B<hiertype>
-
-Retains C<::> in type names so that C++ hierachical types can be
-mapped. Default is false.
-
-=item B<except>
-
-Adds exception handling stubs to the C code. Default is false.
-
-=item B<typemap>
-
-Indicates that a user-supplied typemap should take precedence over the
-default typemaps. A single typemap may be specified as a string, or
-multiple typemaps can be specified in an array reference, with the
-last typemap having the highest precedence.
-
-=item B<prototypes>
-
-Generates prototype code for all xsubs. Default is false.
-
-=item B<versioncheck>
-
-Makes sure at run time that the object file (derived from the C<.xs>
-file) and the C<.pm> files have the same version number. Default is
-true.
-
-=item B<linenumbers>
-
-Adds C<#line> directives to the C output so error messages will look
-like they came from the original XS file. Default is true.
-
-=item B<optimize>
-
-Enables certain optimizations. The only optimization that is currently
-affected is the use of I<target>s by the output C code (see L<perlguts>).
-Not optimizing may significantly slow down the generated code, but this is the way
-B<xsubpp> of 5.005 and earlier operated. Default is to optimize.
-
-=item B<inout>
-
-Enable recognition of C<IN>, C<OUT_LIST> and C<INOUT_LIST>
-declarations. Default is true.
-
-=item B<argtypes>
-
-Enable recognition of ANSI-like descriptions of function signature.
-Default is true.
-
-=item B<s>
-
-I have no clue what this does. Strips function prefixes?
-
-=back
-
-=item errors()
-
-This function returns the number of [a certain kind of] errors
-encountered during processing of the XS file.
-
-=back
-
-=head1 AUTHOR
-
-Based on xsubpp code, written by Larry Wall.
-
-Maintained by Ken Williams, <ken at mathforum.org>
-
-=head1 COPYRIGHT
-
-Copyright 2002-2003 Ken Williams. All rights reserved.
-
-This library is free software; you can redistribute it and/or
-modify it under the same terms as Perl itself.
-
-Based on the ExtUtils::xsubpp code by Larry Wall and the Perl 5
-Porters, which was released under the same license terms.
-
-=head1 SEE ALSO
-
-L<perl>, ExtUtils::xsubpp, ExtUtils::MakeMaker, L<perlxs>, L<perlxstut>.
-
-=cut
Deleted: trunk/contrib/perl/lib/ExtUtils/README
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/README 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/README 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,57 +0,0 @@
-This is a CPAN distribution of the venerable MakeMaker module. It has been
-backported to work with Perl 5.005_03 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.
-
-
-Please report any bugs via http://rt.cpan.org.
-Send questions and discussion to makemaker at perl.org
Deleted: trunk/contrib/perl/lib/ExtUtils/TODO
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/TODO 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/TODO 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,78 +0,0 @@
-This TODO list is out of date. See http://rt.cpan.org for the real list.
-
-
-Rethink MM_Win32 tests.
-
-Investigate one method per make target.
-
-Test MM_Any and pull some redundant tests out of MM_*.t
-
-Create a way to init MM objects. (XXX What's wrong with MakeMaker->new?)
-
-Move instmodsh to utils/ in the core.
-
-Handle config files (ie. /etc) and their special PREFIX needs
-(ie. PREFIX=/usr, INSTALLCONFIGDIR=/etc).
-
-Make sure PDL builds
-
-Fix find_perl on Amiga trg at privat.utfors.se
-
-Fix appending of .. when DIRS contains directories not immediately
-below the cwd.
-
-Fill in the IMPORTS docs.
-
-Remove tar -I Sun-ism from instmodsh.
-
-Consider adding a timeout option to prompt() and env variable.
-
-Unify VMS->find_perl
-
-Consider if VMS->find_perl needs to have pieces put into maybe_command()
-
-Add a MM_Any->init_others() using ExtUtils::Command.
-
-Figure out and document the 4th arg to ExtUtils::Install::install()
-
-Consider if adding a nativize() routine to replace macify() and
-fixpath() is useful.
-
-Eliminate eliminate_macros() from inside FS::VMS->catfile and catdir.
-Make into MM_VMS wrappers.
-
-Test ExtUtils::Command::MM
-
-Finish ExtUtils::MakeMaker::Tutorial
-
-Add 'how to install additional files' to ExtUtils::MakeMaker::FAQ.
-
-Give typemap location its own macro.
-
-Merge MM_VMS->tool_xsubpp
-
-Initialize PERL_SRC to '' instead of leaving undef when outside the source
-tree
-
-Reinstate HTMLification to use the new HTML Config info.
-
-split manifypods target into more generic docifypods target which depends on
-manifypods
-
-Add target to generate native Win32 help files (or whatever Win32 likes
-to use for help files these days)
-
-Add target to generate native VMS help files.
-
-On VMS, write PM_FILTERs to a temp file and run from there avoiding command
-line lengths. Worth the trouble given the Unixy nature of PM_FILTER?
-
-Move oneliner() and friends into a seperate module for general consumption.
-
-Make out of date check on 'make dist' more useful
-http://archive.develooper.com/makemaker@perl.org/msg01075.html
-
-Make maniadd() return a tied, case-insensitive hash on VMS.
-
-
-TER
\ No newline at end of file
Deleted: trunk/contrib/perl/lib/ExtUtils/instmodsh
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/instmodsh 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/instmodsh 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,192 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use IO::File;
-use ExtUtils::Packlist;
-use ExtUtils::Installed;
-
-use vars qw($Inst @Modules);
-
-
-=head1 NAME
-
-instmodsh - A shell to examine installed modules
-
-=head1 SYNOPSIS
-
- instmodsh
-
-=head1 DESCRIPTION
-
-A little interface to ExtUtils::Installed to examine installed modules,
-validate your packlists and even create a tarball from an installed module.
-
-=head1 SEE ALSO
-
-ExtUtils::Installed
-
-=cut
-
-
-my $Module_Help = <<EOF;
-Available commands are:
- f [all|prog|doc] - List installed files of a given type
- d [all|prog|doc] - List the directories used by a module
- v - Validate the .packlist - check for missing files
- t <tarfile> - Create a tar archive of the module
- h - Display module help
- q - Quit the module
-EOF
-
-my %Module_Commands = (
- f => \&list_installed,
- d => \&list_directories,
- v => \&validate_packlist,
- t => \&create_archive,
- h => \&module_help,
- );
-
-sub do_module($) {
- my ($module) = @_;
-
- print($Module_Help);
- MODULE_CMD: while (1) {
- print("$module cmd? ");
-
- my $reply = <STDIN>; chomp($reply);
- my($cmd) = $reply =~ /^(\w)\b/;
-
- last if $cmd eq 'q';
-
- if( $Module_Commands{$cmd} ) {
- $Module_Commands{$cmd}->($reply, $module);
- }
- elsif( $cmd eq 'q' ) {
- last MODULE_CMD;
- }
- else {
- module_help();
- }
- }
-}
-
-
-sub list_installed {
- my($reply, $module) = @_;
-
- my $class = (split(' ', $reply))[1];
- $class = 'all' unless $class;
-
- my @files;
- if (eval { @files = $Inst->files($module, $class); }) {
- print("$class files in $module are:\n ",
- join("\n ", @files), "\n");
- }
- else {
- print($@);
- }
-};
-
-
-sub list_directories {
- my($reply, $module) = @_;
-
- my $class = (split(' ', $reply))[1];
- $class = 'all' unless $class;
-
- my @dirs;
- if (eval { @dirs = $Inst->directories($module, $class); }) {
- print("$class directories in $module are:\n ",
- join("\n ", @dirs), "\n");
- }
- else {
- print($@);
- }
-}
-
-
-sub create_archive {
- my($reply, $module) = @_;
-
- my $file = (split(' ', $reply))[1];
-
- if( !(defined $file and length $file) ) {
- print "No tar file specified\n";
- }
- elsif( eval { require Archive::Tar } ) {
- Archive::Tar->create_archive($file, 0, $Inst->files($module));
- }
- else {
- my($first, @rest) = $Inst->files($module);
- system('tar', 'cvf', $file, $first);
- for my $f (@rest) {
- system('tar', 'rvf', $file, $f);
- }
- print "Can't use tar\n" if $?;
- }
-}
-
-
-sub validate_packlist {
- my($reply, $module) = @_;
-
- if (my @missing = $Inst->validate($module)) {
- print("Files missing from $module are:\n ",
- join("\n ", @missing), "\n");
- }
- else {
- print("$module has no missing files\n");
- }
-}
-
-sub module_help {
- print $Module_Help;
-}
-
-
-
-##############################################################################
-
-sub toplevel()
-{
-my $help = <<EOF;
-Available commands are:
- l - List all installed modules
- m <module> - Select a module
- q - Quit the program
-EOF
-print($help);
-while (1)
- {
- print("cmd? ");
- my $reply = <STDIN>; chomp($reply);
- CASE:
- {
- $reply eq 'l' and do
- {
- print("Installed modules are:\n ", join("\n ", @Modules), "\n");
- last CASE;
- };
- $reply =~ /^m\s+/ and do
- {
- do_module((split(' ', $reply))[1]);
- last CASE;
- };
- $reply eq 'q' and do
- {
- exit(0);
- };
- # Default
- print($help);
- }
- }
-}
-
-
-###############################################################################
-
-$Inst = ExtUtils::Installed->new();
- at Modules = $Inst->modules();
-toplevel();
-
-###############################################################################
Deleted: trunk/contrib/perl/lib/ExtUtils/t/00compile.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/00compile.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/00compile.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,42 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use Test::More;
-
-my $Has_Test_Pod;
-BEGIN {
- $Has_Test_Pod = eval 'use Test::Pod 0.95; 1';
-}
-
-chdir "..";
-my $manifest = "MANIFEST";
-open(my $manifest_fh, "<", $manifest) or die "Can't open $manifest: $!";
-my @modules = map { m{^lib/(\S+)}; $1 }
- grep { m{^lib/ExtUtils/\S*\.pm} }
- grep { !m{/t/} } <$manifest_fh>;
-chomp @modules;
-close $manifest_fh;
-
-chdir 'lib';
-plan tests => scalar @modules * 2;
-foreach my $file (@modules) {
- # Make sure we look at the local files and do not reload them if
- # they're already loaded. This avoids recompilation warnings.
- local @INC = @INC;
- unshift @INC, ".";
- ok eval { require($file); 1 } or diag "require $file failed.\n$@";
-
- SKIP: {
- skip "Test::Pod not installed", 1 unless $Has_Test_Pod;
- pod_file_ok($file);
- }
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/Constant.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/Constant.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/Constant.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,1056 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = '../lib';
- }
- use Config;
- unless ($Config{usedl}) {
- print "1..0 # no usedl, skipping\n";
- exit 0;
- }
-}
-
-# use warnings;
-use strict;
-use ExtUtils::MakeMaker;
-use ExtUtils::Constant qw (C_constant autoload);
-use File::Spec;
-use Cwd;
-
-my $do_utf_tests = $] > 5.006;
-my $better_than_56 = $] > 5.007;
-# For debugging set this to 1.
-my $keep_files = 0;
-$| = 1;
-
-# Because were are going to be changing directory before running Makefile.PL
-my $perl = $^X;
-# 5.005 doesn't have new enough File::Spec to have rel2abs. But actually we
-# only need it when $^X isn't absolute, which is going to be 5.8.0 or later
-# (where ExtUtils::Constant is in the core, and tests against the uninstalled
-# perl)
-$perl = File::Spec->rel2abs ($perl) unless $] < 5.006;
-# ExtUtils::Constant::C_constant uses $^X inside a comment, and we want to
-# compare output to ensure that it is the same. We were probably run as ./perl
-# whereas we will run the child with the full path in $perl. So make $^X for
-# us the same as our child will see.
-$^X = $perl;
-my $lib = $ENV{PERL_CORE} ? '../../../lib' : '../../blib/lib';
-my $runperl = "$perl \"-I$lib\"";
-print "# perl=$perl\n";
-
-my $make = $Config{make};
-$make = $ENV{MAKE} if exists $ENV{MAKE};
-if ($^O eq 'MSWin32' && $make eq 'nmake') { $make .= " -nologo"; }
-
-# VMS may be using something other than MMS/MMK
-my $mms_or_mmk = 0;
-my $vms_lc = 0;
-my $vms_nodot = 0;
-if ($^O eq 'VMS') {
- $mms_or_mmk = 1 if (($make eq 'MMK') || ($make eq 'MMS'));
- $vms_lc = 1;
- $vms_nodot = 1;
- my $vms_unix_rpt = 0;
- my $vms_efs = 0;
- my $vms_efs_case = 0;
- if (eval 'require VMS::Feature') {
- $vms_unix_rpt = VMS::Feature::current("filename_unix_report");
- $vms_efs = VMS::Feature::current("efs_case_preserve");
- $vms_efs_case = VMS::Feature::current("efs_charset");
- } else {
- my $unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || '';
- my $efs_charset = $ENV{'DECC$EFS_CHARSET'} || '';
- my $efs_case = $ENV{'DECC$EFS_CASE_PRESERVE'} || '';
- $vms_unix_rpt = $unix_rpt =~ /^[ET1]/i;
- $vms_efs = $efs_charset =~ /^[ET1]/i;
- $vms_efs_case = $efs_case =~ /^[ET1]/i;
- }
- $vms_lc = 0 if $vms_efs_case;
- $vms_nodot = 0 if $vms_unix_rpt;
-}
-
-# Renamed by make clean
-my $makefile = ($mms_or_mmk ? 'descrip' : 'Makefile');
-my $makefile_ext = ($mms_or_mmk ? '.mms' : '');
-my $makefile_rename = $makefile . ($mms_or_mmk ? '.mms_old' : '.old');
-
-my $output = "output";
-my $package = "ExtTest";
-my $dir = "ext-$$";
-my $subdir = 0;
-# The real test counter.
-my $realtest = 1;
-
-my $orig_cwd = cwd;
-my $updir = File::Spec->updir;
-die "Can't get current directory: $!" unless defined $orig_cwd;
-
-print "# $dir being created...\n";
-mkdir $dir, 0777 or die "mkdir: $!\n";
-
-END {
- if (defined $orig_cwd and length $orig_cwd) {
- chdir $orig_cwd or die "Can't chdir back to '$orig_cwd': $!";
- use File::Path;
- print "# $dir being removed...\n";
- rmtree($dir) unless $keep_files;
- } else {
- # Can't get here.
- die "cwd at start was empty, but directory '$dir' was created" if $dir;
- }
-}
-
-chdir $dir or die $!;
-push @INC, '../../lib', '../../../lib';
-
-package TieOut;
-
-sub TIEHANDLE {
- my $class = shift;
- bless(\( my $ref = ''), $class);
-}
-
-sub PRINT {
- my $self = shift;
- $$self .= join('', @_);
-}
-
-sub PRINTF {
- my $self = shift;
- $$self .= sprintf shift, @_;
-}
-
-sub read {
- my $self = shift;
- return substr($$self, 0, length($$self), '');
-}
-
-package main;
-
-sub check_for_bonus_files {
- my $dir = shift;
- my %expect = map {($vms_lc ? lc($_) : $_), 1} @_;
-
- my $fail;
- opendir DIR, $dir or die "opendir '$dir': $!";
- while (defined (my $entry = readdir DIR)) {
- $entry =~ s/\.$// if $vms_nodot; # delete trailing dot that indicates no extension
- next if $expect{$entry};
- print "# Extra file '$entry'\n";
- $fail = 1;
- }
-
- closedir DIR or warn "closedir '.': $!";
- if ($fail) {
- print "not ok $realtest\n";
- } else {
- print "ok $realtest\n";
- }
- $realtest++;
-}
-
-sub build_and_run {
- my ($tests, $expect, $files) = @_;
- my $core = $ENV{PERL_CORE} ? ' PERL_CORE=1' : '';
- my @perlout = `$runperl Makefile.PL $core`;
- if ($?) {
- print "not ok $realtest # $runperl Makefile.PL failed: $?\n";
- print "# $_" foreach @perlout;
- exit($?);
- } else {
- print "ok $realtest\n";
- }
- $realtest++;
-
- if (-f "$makefile$makefile_ext") {
- print "ok $realtest\n";
- } else {
- print "not ok $realtest\n";
- }
- $realtest++;
-
- my @makeout;
-
- if ($^O eq 'VMS') { $make .= ' all'; }
-
- # Sometimes it seems that timestamps can get confused
-
- # make failed: 256
- # Makefile out-of-date with respect to Makefile.PL
- # Cleaning current config before rebuilding Makefile...
- # make -f Makefile.old clean > /dev/null 2>&1 || /bin/sh -c true
- # ../../perl "-I../../../lib" "-I../../../lib" Makefile.PL "PERL_CORE=1"
- # Checking if your kit is complete...
- # Looks good
- # Writing Makefile for ExtTest
- # ==> Your Makefile has been rebuilt. <==
- # ==> Please rerun the make command. <==
- # false
-
- my $timewarp = (-M "Makefile.PL") - (-M "$makefile$makefile_ext");
- # Convert from days to seconds
- $timewarp *= 86400;
- print "# Makefile.PL is $timewarp second(s) older than $makefile$makefile_ext\n";
- if ($timewarp < 0) {
- # Sleep for a while to catch up.
- $timewarp = -$timewarp;
- $timewarp+=2;
- $timewarp = 10 if $timewarp > 10;
- print "# Sleeping for $timewarp second(s) to try to resolve this\n";
- sleep $timewarp;
- }
-
- print "# make = '$make'\n";
- @makeout = `$make`;
- if ($?) {
- print "not ok $realtest # $make failed: $?\n";
- print "# $_" foreach @makeout;
- exit($?);
- } else {
- print "ok $realtest\n";
- }
- $realtest++;
-
- if ($^O eq 'VMS') { $make =~ s{ all}{}; }
-
- if ($Config{usedl}) {
- print "ok $realtest # This is dynamic linking, so no need to make perl\n";
- } else {
- my $makeperl = "$make perl";
- print "# make = '$makeperl'\n";
- @makeout = `$makeperl`;
- if ($?) {
- print "not ok $realtest # $makeperl failed: $?\n";
- print "# $_" foreach @makeout;
- exit($?);
- } else {
- print "ok $realtest\n";
- }
- }
- $realtest++;
-
- my $maketest = "$make test";
- print "# make = '$maketest'\n";
-
- @makeout = `$maketest`;
-
- if (open OUTPUT, "<$output") {
- local $/; # Slurp it - faster.
- print <OUTPUT>;
- close OUTPUT or print "# Close $output failed: $!\n";
- } else {
- # Harness will report missing test results at this point.
- print "# Open <$output failed: $!\n";
- }
-
- $realtest += $tests;
- if ($?) {
- print "not ok $realtest # $maketest failed: $?\n";
- print "# $_" foreach @makeout;
- } else {
- print "ok $realtest - maketest\n";
- }
- $realtest++;
-
- if (defined $expect) {
- # -x is busted on Win32 < 5.6.1, so we emulate it.
- my $regen;
- if( $^O eq 'MSWin32' && $] <= 5.006001 ) {
- open(REGENTMP, ">regentmp") or die $!;
- open(XS, "$package.xs") or die $!;
- my $saw_shebang;
- while(<XS>) {
- $saw_shebang++ if /^#!.*/i ;
- print REGENTMP $_ if $saw_shebang;
- }
- close XS; close REGENTMP;
- $regen = `$runperl regentmp`;
- unlink 'regentmp';
- }
- else {
- $regen = `$runperl -x $package.xs`;
- }
- if ($?) {
- print "not ok $realtest # $runperl -x $package.xs failed: $?\n";
- } else {
- print "ok $realtest - regen\n";
- }
- $realtest++;
-
- if ($expect eq $regen) {
- print "ok $realtest - regen worked\n";
- } else {
- print "not ok $realtest - regen worked\n";
- # open FOO, ">expect"; print FOO $expect;
- # open FOO, ">regen"; print FOO $regen; close FOO;
- }
- $realtest++;
- } else {
- for (0..1) {
- print "ok $realtest # skip no regen or expect for this set of tests\n";
- $realtest++;
- }
- }
-
- my $makeclean = "$make clean";
- print "# make = '$makeclean'\n";
- @makeout = `$makeclean`;
- if ($?) {
- print "not ok $realtest # $make failed: $?\n";
- print "# $_" foreach @makeout;
- } else {
- print "ok $realtest\n";
- }
- $realtest++;
-
- check_for_bonus_files ('.', @$files, $output, $makefile_rename, '.', '..');
-
- rename $makefile_rename, $makefile . $makefile_ext
- or die "Can't rename '$makefile_rename' to '$makefile$makefile_ext': $!";
-
- unlink $output or warn "Can't unlink '$output': $!";
-
- # Need to make distclean to remove ../../lib/ExtTest.pm
- my $makedistclean = "$make distclean";
- print "# make = '$makedistclean'\n";
- @makeout = `$makedistclean`;
- if ($?) {
- print "not ok $realtest # $make failed: $?\n";
- print "# $_" foreach @makeout;
- } else {
- print "ok $realtest\n";
- }
- $realtest++;
-
- check_for_bonus_files ('.', @$files, '.', '..');
-
- unless ($keep_files) {
- foreach (@$files) {
- unlink $_ or warn "unlink $_: $!";
- }
- }
-
- check_for_bonus_files ('.', '.', '..');
-}
-
-sub Makefile_PL {
- my $package = shift;
- ################ Makefile.PL
- # We really need a Makefile.PL because make test for a no dynamic linking perl
- # will run Makefile.PL again as part of the "make perl" target.
- my $makefilePL = "Makefile.PL";
- open FH, ">$makefilePL" or die "open >$makefilePL: $!\n";
- print FH <<"EOT";
-#!$perl -w
-use ExtUtils::MakeMaker;
-WriteMakefile(
- 'NAME' => "$package",
- 'VERSION_FROM' => "$package.pm", # finds \$VERSION
- (\$] >= 5.005 ?
- (#ABSTRACT_FROM => "$package.pm", # XXX add this
- AUTHOR => "$0") : ())
- );
-EOT
-
- close FH or die "close $makefilePL: $!\n";
- return $makefilePL;
-}
-
-sub MANIFEST {
- my (@files) = @_;
- ################ MANIFEST
- # We really need a MANIFEST because make distclean checks it.
- my $manifest = "MANIFEST";
- push @files, $manifest;
- open FH, ">$manifest" or die "open >$manifest: $!\n";
- print FH "$_\n" foreach @files;
- close FH or die "close $manifest: $!\n";
- return @files;
-}
-
-sub write_and_run_extension {
- my ($name, $items, $export_names, $package, $header, $testfile, $num_tests,
- $wc_args) = @_;
-
- my $c = tie *C, 'TieOut';
- my $xs = tie *XS, 'TieOut';
-
- ExtUtils::Constant::WriteConstants(C_FH => \*C,
- XS_FH => \*XS,
- NAME => $package,
- NAMES => $items,
- @$wc_args,
- );
-
- my $C_code = $c->read();
- my $XS_code = $xs->read();
-
- undef $c;
- undef $xs;
-
- untie *C;
- untie *XS;
-
- # Don't check the regeneration code if we specify extra arguments to
- # WriteConstants. (Fix this to give finer grained control if needed)
- my $expect;
- $expect = $C_code . "\n#### XS Section:\n" . $XS_code unless $wc_args;
-
- print "# $name\n# $dir/$subdir being created...\n";
- mkdir $subdir, 0777 or die "mkdir: $!\n";
- chdir $subdir or die $!;
-
- my @files;
-
- ################ Header
- my $header_name = "test.h";
- push @files, $header_name;
- open FH, ">$header_name" or die "open >$header_name: $!\n";
- print FH $header or die $!;
- close FH or die "close $header_name: $!\n";
-
- ################ XS
- my $xs_name = "$package.xs";
- push @files, $xs_name;
- open FH, ">$xs_name" or die "open >$xs_name: $!\n";
-
- print FH <<"EOT";
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-#include "$header_name"
-
-
-$C_code
-MODULE = $package PACKAGE = $package
-PROTOTYPES: ENABLE
-$XS_code;
-EOT
-
- close FH or die "close $xs: $!\n";
-
- ################ PM
- my $pm = "$package.pm";
- push @files, $pm;
- open FH, ">$pm" or die "open >$pm: $!\n";
- print FH "package $package;\n";
- print FH "use $];\n";
-
- print FH <<'EOT';
-
-use strict;
-EOT
- printf FH "use warnings;\n" unless $] < 5.006;
- print FH <<'EOT';
-use Carp;
-
-require Exporter;
-require DynaLoader;
-use vars qw ($VERSION @ISA @EXPORT_OK $AUTOLOAD);
-
-$VERSION = '0.01';
- at ISA = qw(Exporter DynaLoader);
-EOT
- # Having this qw( in the here doc confuses cperl mode far too much to be
- # helpful. And I'm using cperl mode to edit this, even if you're not :-)
- print FH "\@EXPORT_OK = qw(\n";
-
- # Print the names of all our autoloaded constants
- print FH "\t$_\n" foreach (@$export_names);
- print FH ");\n";
- # Print the AUTOLOAD subroutine ExtUtils::Constant generated for us
- print FH autoload ($package, $]);
- print FH "bootstrap $package \$VERSION;\n1;\n__END__\n";
- close FH or die "close $pm: $!\n";
-
- ################ test.pl
- my $testpl = "test.pl";
- push @files, $testpl;
- open FH, ">$testpl" or die "open >$testpl: $!\n";
- # Standard test header (need an option to suppress this?)
- print FH <<"EOT" or die $!;
-use strict;
-use $package qw(@$export_names);
-
-print "1..2\n";
-if (open OUTPUT, ">$output") {
- print "ok 1\n";
- select OUTPUT;
-} else {
- print "not ok 1 # Failed to open '$output': \$!\n";
- exit 1;
-}
-EOT
- print FH $testfile or die $!;
- print FH <<"EOT" or die $!;
-select STDOUT;
-if (close OUTPUT) {
- print "ok 2\n";
-} else {
- print "not ok 2 # Failed to close '$output': \$!\n";
-}
-EOT
- close FH or die "close $testpl: $!\n";
-
- push @files, Makefile_PL($package);
- @files = MANIFEST (@files);
-
- build_and_run ($num_tests, $expect, \@files);
-
- chdir $updir or die "chdir '$updir': $!";
- ++$subdir;
-}
-
-# Tests are arrayrefs of the form
-# $name, [items], [export_names], $package, $header, $testfile, $num_tests
-my @tests;
-my $before_tests = 4; # Number of "ok"s emitted to build extension
-my $after_tests = 8; # Number of "ok"s emitted after make test run
-my $dummytest = 1;
-
-my $here;
-sub start_tests {
- $dummytest += $before_tests;
- $here = $dummytest;
-}
-sub end_tests {
- my ($name, $items, $export_names, $header, $testfile, $args) = @_;
- push @tests, [$name, $items, $export_names, $package, $header, $testfile,
- $dummytest - $here, $args];
- $dummytest += $after_tests;
-}
-
-my $pound;
-if (ord('A') == 193) { # EBCDIC platform
- $pound = chr 177; # A pound sign. (Currency)
-} else { # ASCII platform
- $pound = chr 163; # A pound sign. (Currency)
-}
-my @common_items = (
- {name=>"perl", type=>"PV",},
- {name=>"*/", type=>"PV", value=>'"CLOSE"', macro=>1},
- {name=>"/*", type=>"PV", value=>'"OPEN"', macro=>1},
- {name=>$pound, type=>"PV", value=>'"Sterling"', macro=>1},
- );
-
-my @args = undef;
-push @args, [PROXYSUBS => 1] if $] > 5.009002;
-foreach my $args (@args)
-{
- # Simple tests
- start_tests();
- my $parent_rfc1149 =
- 'A Standard for the Transmission of IP Datagrams on Avian Carriers';
- # Test the code that generates 1 and 2 letter name comparisons.
- my %compass = (
- N => 0, 'NE' => 45, E => 90, SE => 135,
- S => 180, SW => 225, W => 270, NW => 315
- );
-
- my $header = << "EOT";
-#define FIVE 5
-#define OK6 "ok 6\\n"
-#define OK7 1
-#define FARTHING 0.25
-#define NOT_ZERO 1
-#define Yes 0
-#define No 1
-#define Undef 1
-#define RFC1149 "$parent_rfc1149"
-#undef NOTDEF
-#define perl "rules"
-EOT
-
- while (my ($point, $bearing) = each %compass) {
- $header .= "#define $point $bearing\n"
- }
-
- my @items = ("FIVE", {name=>"OK6", type=>"PV",},
- {name=>"OK7", type=>"PVN",
- value=>['"not ok 7\\n\\0ok 7\\n"', 15]},
- {name => "FARTHING", type=>"NV"},
- {name => "NOT_ZERO", type=>"UV", value=>"~(UV)0"},
- {name => "OPEN", type=>"PV", value=>'"/*"', macro=>1},
- {name => "CLOSE", type=>"PV", value=>'"*/"',
- macro=>["#if 1\n", "#endif\n"]},
- {name => "ANSWER", default=>["UV", 42]}, "NOTDEF",
- {name => "Yes", type=>"YES"},
- {name => "No", type=>"NO"},
- {name => "Undef", type=>"UNDEF"},
- # OK. It wasn't really designed to allow the creation of dual valued
- # constants.
- # It was more for INADDR_ANY INADDR_BROADCAST INADDR_LOOPBACK INADDR_NONE
- {name=>"RFC1149", type=>"SV", value=>"sv_2mortal(temp_sv)",
- pre=>"SV *temp_sv = newSVpv(RFC1149, 0); "
- . "(void) SvUPGRADE(temp_sv,SVt_PVIV); SvIOK_on(temp_sv); "
- . "SvIV_set(temp_sv, 1149);"},
- );
-
- push @items, $_ foreach keys %compass;
-
- # Automatically compile the list of all the macro names, and make them
- # exported constants.
- my @export_names = map {(ref $_) ? $_->{name} : $_} @items;
-
- # Exporter::Heavy (currently) isn't able to export the last 3 of these:
- push @items, @common_items;
-
- my $test_body = <<"EOT";
-
-my \$test = $dummytest;
-
-EOT
-
- $test_body .= <<'EOT';
-# What follows goes to the temporary file.
-# IV
-my $five = FIVE;
-if ($five == 5) {
- print "ok $test\n";
-} else {
- print "not ok $test # \$five\n";
-}
-$test++;
-
-# PV
-if (OK6 eq "ok 6\n") {
- print "ok $test\n";
-} else {
- print "not ok $test # \$five\n";
-}
-$test++;
-
-# PVN containing embedded \0s
-$_ = OK7;
-s/.*\0//s;
-s/7/$test/;
-$test++;
-print;
-
-# NV
-my $farthing = FARTHING;
-if ($farthing == 0.25) {
- print "ok $test\n";
-} else {
- print "not ok $test # $farthing\n";
-}
-$test++;
-
-# UV
-my $not_zero = NOT_ZERO;
-if ($not_zero > 0 && $not_zero == ~0) {
- print "ok $test\n";
-} else {
- print "not ok $test # \$not_zero=$not_zero ~0=" . (~0) . "\n";
-}
-$test++;
-
-# Value includes a "*/" in an attempt to bust out of a C comment.
-# Also tests custom cpp #if clauses
-my $close = CLOSE;
-if ($close eq '*/') {
- print "ok $test\n";
-} else {
- print "not ok $test # \$close='$close'\n";
-}
-$test++;
-
-# Default values if macro not defined.
-my $answer = ANSWER;
-if ($answer == 42) {
- print "ok $test\n";
-} else {
- print "not ok $test # What do you get if you multiply six by nine? '$answer'\n";
-}
-$test++;
-
-# not defined macro
-my $notdef = eval { NOTDEF; };
-if (defined $notdef) {
- print "not ok $test # \$notdef='$notdef'\n";
-} elsif ($@ !~ /Your vendor has not defined ExtTest macro NOTDEF/) {
- print "not ok $test # \$@='$@'\n";
-} else {
- print "ok $test\n";
-}
-$test++;
-
-# not a macro
-my $notthere = eval { &ExtTest::NOTTHERE; };
-if (defined $notthere) {
- print "not ok $test # \$notthere='$notthere'\n";
-} elsif ($@ !~ /NOTTHERE is not a valid ExtTest macro/) {
- chomp $@;
- print "not ok $test # \$@='$@'\n";
-} else {
- print "ok $test\n";
-}
-$test++;
-
-# Truth
-my $yes = Yes;
-if ($yes) {
- print "ok $test\n";
-} else {
- print "not ok $test # $yes='\$yes'\n";
-}
-$test++;
-
-# Falsehood
-my $no = No;
-if (defined $no and !$no) {
- print "ok $test\n";
-} else {
- print "not ok $test # \$no=" . defined ($no) ? "'$no'\n" : "undef\n";
-}
-$test++;
-
-# Undef
-my $undef = Undef;
-unless (defined $undef) {
- print "ok $test\n";
-} else {
- print "not ok $test # \$undef='$undef'\n";
-}
-$test++;
-
-# invalid macro (chosen to look like a mix up between No and SW)
-$notdef = eval { &ExtTest::So };
-if (defined $notdef) {
- print "not ok $test # \$notdef='$notdef'\n";
-} elsif ($@ !~ /^So is not a valid ExtTest macro/) {
- print "not ok $test # \$@='$@'\n";
-} else {
- print "ok $test\n";
-}
-$test++;
-
-# invalid defined macro
-$notdef = eval { &ExtTest::EW };
-if (defined $notdef) {
- print "not ok $test # \$notdef='$notdef'\n";
-} elsif ($@ !~ /^EW is not a valid ExtTest macro/) {
- print "not ok $test # \$@='$@'\n";
-} else {
- print "ok $test\n";
-}
-$test++;
-
-my %compass = (
-EOT
-
-while (my ($point, $bearing) = each %compass) {
- $test_body .= "'$point' => $bearing, "
-}
-
-$test_body .= <<'EOT';
-
-);
-
-my $fail;
-while (my ($point, $bearing) = each %compass) {
- my $val = eval $point;
- if ($@) {
- print "# $point: \$@='$@'\n";
- $fail = 1;
- } elsif (!defined $bearing) {
- print "# $point: \$val=undef\n";
- $fail = 1;
- } elsif ($val != $bearing) {
- print "# $point: \$val=$val, not $bearing\n";
- $fail = 1;
- }
-}
-if ($fail) {
- print "not ok $test\n";
-} else {
- print "ok $test\n";
-}
-$test++;
-
-EOT
-
-$test_body .= <<"EOT";
-my \$rfc1149 = RFC1149;
-if (\$rfc1149 ne "$parent_rfc1149") {
- print "not ok \$test # '\$rfc1149' ne '$parent_rfc1149'\n";
-} else {
- print "ok \$test\n";
-}
-\$test++;
-
-if (\$rfc1149 != 1149) {
- printf "not ok \$test # %d != 1149\n", \$rfc1149;
-} else {
- print "ok \$test\n";
-}
-\$test++;
-
-EOT
-
-$test_body .= <<'EOT';
-# test macro=>1
-my $open = OPEN;
-if ($open eq '/*') {
- print "ok $test\n";
-} else {
- print "not ok $test # \$open='$open'\n";
-}
-$test++;
-EOT
-$dummytest+=18;
-
- end_tests("Simple tests", \@items, \@export_names, $header, $test_body,
- $args);
-}
-
-if ($do_utf_tests) {
- # utf8 tests
- start_tests();
- my ($inf, $pound_bytes, $pound_utf8);
-
- $inf = chr 0x221E;
- # Check that we can distiguish the pathological case of a string, and the
- # utf8 representation of that string.
- $pound_utf8 = $pound . '1';
- if ($better_than_56) {
- $pound_bytes = $pound_utf8;
- utf8::encode ($pound_bytes);
- } else {
- # Must have that "U*" to generate a zero length UTF string that forces
- # top bit set chars (such as the pound sign) into UTF8, so that the
- # unpack 'C*' then gets the byte form of the UTF8.
- $pound_bytes = pack 'C*', unpack 'C*', $pound_utf8 . pack "U*";
- }
-
- my @items = (@common_items,
- {name=>$inf, type=>"PV", value=>'"Infinity"', macro=>1},
- {name=>$pound_utf8, type=>"PV", value=>'"1 Pound"', macro=>1},
- {name=>$pound_bytes, type=>"PV", value=>'"1 Pound (as bytes)"',
- macro=>1},
- );
-
-=pod
-
-The above set of names seems to produce a suitably bad set of compile
-problems on a Unicode naive version of ExtUtils::Constant (ie 0.11):
-
-nick at thinking-cap 15439-32-utf$ PERL_CORE=1 ./perl lib/ExtUtils/t/Constant.t
-1..33
-# perl=/stuff/perl5/15439-32-utf/perl
-# ext-30370 being created...
-Wide character in print at lib/ExtUtils/t/Constant.t line 140.
-ok 1
-ok 2
-# make = 'make'
-ExtTest.xs: In function `constant_1':
-ExtTest.xs:80: warning: multi-character character constant
-ExtTest.xs:80: warning: case value out of range
-ok 3
-
-=cut
-
-# Grr `
-
- # Do this in 7 bit in case someone is testing with some settings that cause
- # 8 bit files incapable of storing this character.
- my @values
- = map {"'" . join (",", unpack "U*", $_ . pack "U*") . "'"}
- ($pound, $inf, $pound_bytes, $pound_utf8);
- # Values is a list of strings, such as ('194,163,49', '163,49')
-
- my $test_body .= "my \$test = $dummytest;\n";
- $dummytest += 7 * 3; # 3 tests for each of the 7 things:
-
- $test_body .= << 'EOT';
-
-use utf8;
-my $better_than_56 = $] > 5.007;
-
-my ($pound, $inf, $pound_bytes, $pound_utf8) = map {eval "pack 'U*', $_"}
-EOT
-
- $test_body .= join ",", @values;
-
- $test_body .= << 'EOT';
-;
-
-foreach (["perl", "rules", "rules"],
- ["/*", "OPEN", "OPEN"],
- ["*/", "CLOSE", "CLOSE"],
- [$pound, 'Sterling', []],
- [$inf, 'Infinity', []],
- [$pound_utf8, '1 Pound', '1 Pound (as bytes)'],
- [$pound_bytes, '1 Pound (as bytes)', []],
- ) {
- # Flag an expected error with a reference for the expect string.
- my ($string, $expect, $expect_bytes) = @$_;
- (my $name = $string) =~ s/([^ !"#\$%&'()*+,\-.\/0-9:;<=>?\@A-Z[\\\]^_`a-z{|}~])/sprintf '\x{%X}', ord $1/ges;
- print "# \"$name\" => \'$expect\'\n";
- # Try to force this to be bytes if possible.
- if ($better_than_56) {
- utf8::downgrade ($string, 1);
- } else {
- if ($string =~ tr/0-\377// == length $string) {
- # No chars outside range 0-255
- $string = pack 'C*', unpack 'U*', ($string . pack 'U*');
- }
- }
-EOT
-
- $test_body .= "my (\$error, \$got) = ${package}::constant (\$string);\n";
-
- $test_body .= <<'EOT';
- if ($error or $got ne $expect) {
- print "not ok $test # error '$error', got '$got'\n";
- } else {
- print "ok $test\n";
- }
- $test++;
- print "# Now upgrade '$name' to utf8\n";
- if ($better_than_56) {
- utf8::upgrade ($string);
- } else {
- $string = pack ('U*') . $string;
- }
-EOT
-
- $test_body .= "my (\$error, \$got) = ${package}::constant (\$string);\n";
-
- $test_body .= <<'EOT';
- if ($error or $got ne $expect) {
- print "not ok $test # error '$error', got '$got'\n";
- } else {
- print "ok $test\n";
- }
- $test++;
- if (defined $expect_bytes) {
- print "# And now with the utf8 byte sequence for name\n";
- # Try the encoded bytes.
- if ($better_than_56) {
- utf8::encode ($string);
- } else {
- $string = pack 'C*', unpack 'C*', $string . pack "U*";
- }
-EOT
-
- $test_body .= "my (\$error, \$got) = ${package}::constant (\$string);\n";
-
- $test_body .= <<'EOT';
- if (ref $expect_bytes) {
- # Error expected.
- if ($error) {
- print "ok $test # error='$error' (as expected)\n";
- } else {
- print "not ok $test # expected error, got no error and '$got'\n";
- }
- } elsif ($got ne $expect_bytes) {
- print "not ok $test # error '$error', expect '$expect_bytes', got '$got'\n";
- } else {
- print "ok $test\n";
- }
- $test++;
- }
-}
-EOT
-
- end_tests("utf8 tests", \@items, [], "#define perl \"rules\"\n", $test_body);
-}
-
-# XXX I think that I should merge this into the utf8 test above.
-sub explict_call_constant {
- my ($string, $expect) = @_;
- # This does assume simple strings suitable for ''
- my $test_body = <<"EOT";
-{
- my (\$error, \$got) = ${package}::constant ('$string');\n;
-EOT
-
- if (defined $expect) {
- # No error expected
- $test_body .= <<"EOT";
- if (\$error or \$got ne "$expect") {
- print "not ok $dummytest # error '\$error', expect '$expect', got '\$got'\n";
- } else {
- print "ok $dummytest\n";
- }
- }
-EOT
- } else {
- # Error expected.
- $test_body .= <<"EOT";
- if (\$error) {
- print "ok $dummytest # error='\$error' (as expected)\n";
- } else {
- print "not ok $dummytest # expected error, got no error and '\$got'\n";
- }
-EOT
- }
- $dummytest++;
- return $test_body . <<'EOT';
-}
-EOT
-}
-
-# Simple tests to verify bits of the switch generation system work.
-sub simple {
- start_tests();
- # Deliberately leave $name in @_, so that it is indexed from 1.
- my ($name, @items) = @_;
- my $test_header;
- my $test_body = "my \$value;\n";
- foreach my $counter (1 .. $#_) {
- my $thisname = $_[$counter];
- $test_header .= "#define $thisname $counter\n";
- $test_body .= <<"EOT";
-\$value = $thisname;
-if (\$value == $counter) {
- print "ok $dummytest\n";
-} else {
- print "not ok $dummytest # $thisname gave \$value\n";
-}
-EOT
- ++$dummytest;
- # Yes, the last time round the loop appends a z to the string.
- for my $i (0 .. length $thisname) {
- my $copyname = $thisname;
- substr ($copyname, $i, 1) = 'z';
- $test_body .= explict_call_constant ($copyname,
- $copyname eq $thisname
- ? $thisname : undef);
- }
- }
- # Ho. This seems to be buggy in 5.005_03:
- # # Now remove $name from @_:
- # shift @_;
- end_tests($name, \@items, \@items, $test_header, $test_body);
-}
-
-# Check that the memeq clauses work correctly when there isn't a switch
-# statement to bump off a character
-simple ("Singletons", "A", "AB", "ABC", "ABCD", "ABCDE");
-# Check the three code.
-simple ("Three start", qw(Bea kea Lea lea nea pea rea sea tea Wea yea Zea));
-# There were 162 2 letter words in /usr/share/dict/words on FreeBSD 4.6, which
-# I felt was rather too many. So I used words with 2 vowels.
-simple ("Twos and three middle", qw(aa ae ai ea eu ie io oe era eta));
-# Given the choice go for the end, else the earliest point
-simple ("Three end and four symetry", qw(ean ear eat barb marm tart));
-
-
-# Need this if the single test below is rolled into @tests :
-# --$dummytest;
-print "1..$dummytest\n";
-
-write_and_run_extension @$_ foreach @tests;
-
-# This was causing an assertion failure (a C<confess>ion)
-# Any single byte > 128 should do it.
-C_constant ($package, undef, undef, undef, undef, undef, chr 255);
-print "ok $realtest\n"; $realtest++;
-
-print STDERR "# You were running with \$keep_files set to $keep_files\n"
- if $keep_files;
Deleted: trunk/contrib/perl/lib/ExtUtils/t/FIRST_MAKEFILE.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/FIRST_MAKEFILE.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/FIRST_MAKEFILE.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,40 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use strict;
-use Test::More tests => 7;
-
-use MakeMaker::Test::Setup::BFD;
-use MakeMaker::Test::Utils;
-
-my $perl = which_perl();
-my $make = make_run();
-perl_lib();
-
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
- diag("chdir failed: $!");
-
-my @mpl_out = run(qq{$perl Makefile.PL FIRST_MAKEFILE=jakefile});
-cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag @mpl_out;
-
-ok( -e 'jakefile', 'FIRST_MAKEFILE honored' );
-
-ok( grep(/^Writing jakefile(?:\.)? for Big::Dummy/, @mpl_out) == 1,
- 'Makefile.PL output looks right' );
Deleted: trunk/contrib/perl/lib/ExtUtils/t/INST.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/INST.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/INST.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,148 +0,0 @@
-#!/usr/bin/perl -w
-
-# Wherein we ensure the INST_* and INSTALL* variables are set correctly
-# in a default Makefile.PL run
-#
-# Essentially, this test is a Makefile.PL.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 26;
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::BFD;
-use ExtUtils::MakeMaker;
-use File::Spec;
-use TieOut;
-use Config;
-
-chdir 't';
-
-perl_lib;
-
-$| = 1;
-
-my $Makefile = makefile_name;
-my $Curdir = File::Spec->curdir;
-my $Updir = File::Spec->updir;
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
- diag("chdir failed: $!");
-
-my $stdout = tie *STDOUT, 'TieOut' or die;
-my $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- PREREQ_PM => {},
- PERL_CORE => $ENV{PERL_CORE},
-);
-like( $stdout->read, qr{
- Writing\ $Makefile\ for\ Big::Liar\n
- Big::Liar's\ vars\n
- INST_LIB\ =\ \S+\n
- INST_ARCHLIB\ =\ \S+\n
- Writing\ $Makefile\ for\ Big::Dummy\n
-}x );
-undef $stdout;
-untie *STDOUT;
-
-isa_ok( $mm, 'ExtUtils::MakeMaker' );
-
-is( $mm->{NAME}, 'Big::Dummy', 'NAME' );
-is( $mm->{VERSION}, 0.01, 'VERSION' );
-
-my $config_prefix = $Config{installprefixexp} || $Config{installprefix} ||
- $Config{prefixexp} || $Config{prefix};
-is( $mm->{PERLPREFIX}, $config_prefix, 'PERLPREFIX' );
-
-is( !!$mm->{PERL_CORE}, !!$ENV{PERL_CORE}, 'PERL_CORE' );
-
-my($perl_src, $mm_perl_src);
-if( $ENV{PERL_CORE} ) {
- $perl_src = File::Spec->catdir($Updir, $Updir);
- $perl_src = File::Spec->canonpath($perl_src);
- $mm_perl_src = File::Spec->canonpath($mm->{PERL_SRC});
-}
-else {
- $mm_perl_src = $mm->{PERL_SRC};
-}
-
-is( $mm_perl_src, $perl_src, 'PERL_SRC' );
-
-
-# PERM_*
-is( $mm->{PERM_RW}, 644, 'PERM_RW' );
-is( $mm->{PERM_RWX}, 755, 'PERM_RWX' );
-
-
-# INST_*
-is( $mm->{INST_ARCHLIB},
- $mm->{PERL_CORE} ? $mm->{PERL_ARCHLIB}
- : File::Spec->catdir($Curdir, 'blib', 'arch'),
- 'INST_ARCHLIB');
-is( $mm->{INST_BIN}, File::Spec->catdir($Curdir, 'blib', 'bin'),
- 'INST_BIN' );
-
-is( keys %{$mm->{CHILDREN}}, 1 );
-my($child_pack) = keys %{$mm->{CHILDREN}};
-my $c_mm = $mm->{CHILDREN}{$child_pack};
-is( $c_mm->{INST_ARCHLIB},
- $c_mm->{PERL_CORE} ? $c_mm->{PERL_ARCHLIB}
- : File::Spec->catdir($Updir, 'blib', 'arch'),
- 'CHILD INST_ARCHLIB');
-is( $c_mm->{INST_BIN}, File::Spec->catdir($Updir, 'blib', 'bin'),
- 'CHILD INST_BIN' );
-
-
-my $inst_lib = File::Spec->catdir($Curdir, 'blib', 'lib');
-is( $mm->{INST_LIB},
- $mm->{PERL_CORE} ? $mm->{PERL_LIB} : $inst_lib, 'INST_LIB' );
-
-
-# INSTALL*
-is( $mm->{INSTALLDIRS}, 'site', 'INSTALLDIRS' );
-
-
-
-# Make sure the INSTALL*MAN*DIR variables work. We forgot them
-# at one point.
-$stdout = tie *STDOUT, 'TieOut' or die;
-$mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- PERL_CORE => $ENV{PERL_CORE},
- INSTALLMAN1DIR => 'none',
- INSTALLSITEMAN3DIR => 'none',
- INSTALLVENDORMAN1DIR => 'none',
- INST_MAN1DIR => 'none',
-);
-like( $stdout->read, qr{
- Writing\ $Makefile\ for\ Big::Liar\n
- Big::Liar's\ vars\n
- INST_LIB\ =\ \S+\n
- INST_ARCHLIB\ =\ \S+\n
- Writing\ $Makefile\ for\ Big::Dummy\n
-}x );
-undef $stdout;
-untie *STDOUT;
-
-isa_ok( $mm, 'ExtUtils::MakeMaker' );
-
-is ( $mm->{INSTALLMAN1DIR}, 'none' );
-is ( $mm->{INSTALLSITEMAN3DIR}, 'none' );
-is ( $mm->{INSTALLVENDORMAN1DIR}, 'none' );
-is ( $mm->{INST_MAN1DIR}, 'none' );
Deleted: trunk/contrib/perl/lib/ExtUtils/t/INSTALL_BASE.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/INSTALL_BASE.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/INSTALL_BASE.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,80 +0,0 @@
-#!/usr/bin/perl -w
-
-# Tests INSTALL_BASE
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use File::Path;
-use Config;
-
-use Test::More tests => 20;
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::BFD;
-
-my $Is_VMS = $^O eq 'VMS';
-
-my $perl = which_perl();
-
-chdir 't';
-perl_lib;
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy") || diag("chdir failed; $!");
-
-my @mpl_out = run(qq{$perl Makefile.PL "INSTALL_BASE=../dummy-install"});
-END { rmtree '../dummy-install'; }
-
-cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
- diag(@mpl_out);
-
-my $makefile = makefile_name();
-ok( grep(/^Writing $makefile for Big::Dummy/,
- @mpl_out) == 1,
- 'Makefile.PL output looks right');
-
-my $make = make_run();
-run("$make"); # this is necessary due to a dmake bug.
-my $install_out = run("$make install");
-is( $?, 0, ' make install exited normally' ) || diag $install_out;
-like( $install_out, qr/^Installing /m );
-
-ok( -r '../dummy-install', ' install dir created' );
-
-my @installed_files =
- ('../dummy-install/lib/perl5/Big/Dummy.pm',
- '../dummy-install/lib/perl5/Big/Liar.pm',
- '../dummy-install/bin/program',
- "../dummy-install/lib/perl5/$Config{archname}/perllocal.pod",
- "../dummy-install/lib/perl5/$Config{archname}/auto/Big/Dummy/.packlist"
- );
-
-foreach my $file (@installed_files) {
- ok( -e $file, " $file installed" );
- ok( -r $file, " $file readable" );
-}
-
-
-# nmake outputs its damned logo
-# Send STDERR off to oblivion.
-open(SAVERR, ">&STDERR") or die $!;
-open(STDERR, ">".File::Spec->devnull) or die $!;
-
-my $realclean_out = run("$make realclean");
-is( $?, 0, 'realclean' ) || diag($realclean_out);
-
-open(STDERR, ">&SAVERR") or die $!;
-close SAVERR;
Deleted: trunk/contrib/perl/lib/ExtUtils/t/INST_PREFIX.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/INST_PREFIX.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/INST_PREFIX.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,270 +0,0 @@
-#!/usr/bin/perl -w
-
-# Wherein we ensure the INST_* and INSTALL* variables are set correctly
-# when various PREFIX variables are set.
-#
-# Essentially, this test is a Makefile.PL.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 52;
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::BFD;
-use ExtUtils::MakeMaker;
-use File::Spec;
-use TieOut;
-use ExtUtils::MakeMaker::Config;
-
-my $Is_VMS = $^O eq 'VMS';
-
-chdir 't';
-
-perl_lib;
-
-$| = 1;
-
-my $Makefile = makefile_name;
-my $Curdir = File::Spec->curdir;
-my $Updir = File::Spec->updir;
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
- diag("chdir failed: $!");
-
-my $stdout = tie *STDOUT, 'TieOut' or die;
-
-my $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- PREREQ_PM => {},
- PERL_CORE => $ENV{PERL_CORE},
-);
-
-like( $stdout->read, qr{
- Writing\ $Makefile\ for\ Big::Liar\n
- Big::Liar's\ vars\n
- INST_LIB\ =\ \S+\n
- INST_ARCHLIB\ =\ \S+\n
- Writing\ $Makefile\ for\ Big::Dummy\n
-}x );
-
-is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' );
-
-isa_ok( $mm, 'ExtUtils::MakeMaker' );
-
-is( $mm->{NAME}, 'Big::Dummy', 'NAME' );
-is( $mm->{VERSION}, 0.01, 'VERSION' );
-
-foreach my $prefix (qw(PREFIX PERLPREFIX SITEPREFIX VENDORPREFIX)) {
- unlike( $mm->{$prefix}, qr/\$\(PREFIX\)/ );
-}
-
-
-my $PREFIX = File::Spec->catdir('foo', 'bar');
-$mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- PREREQ_PM => {},
- PERL_CORE => $ENV{PERL_CORE},
- PREFIX => $PREFIX,
-);
-like( $stdout->read, qr{
- Writing\ $Makefile\ for\ Big::Liar\n
- Big::Liar's\ vars\n
- INST_LIB\ =\ \S+\n
- INST_ARCHLIB\ =\ \S+\n
- Writing\ $Makefile\ for\ Big::Dummy\n
-}x );
-undef $stdout;
-untie *STDOUT;
-
-is( $mm->{PREFIX}, $PREFIX, 'PREFIX' );
-
-foreach my $prefix (qw(PERLPREFIX SITEPREFIX VENDORPREFIX)) {
- is( $mm->{$prefix}, '$(PREFIX)', "\$(PREFIX) overrides $prefix" );
-}
-
-is( !!$mm->{PERL_CORE}, !!$ENV{PERL_CORE}, 'PERL_CORE' );
-
-my($perl_src, $mm_perl_src);
-if( $ENV{PERL_CORE} ) {
- $perl_src = File::Spec->catdir($Updir, $Updir);
- $perl_src = File::Spec->canonpath($perl_src);
- $mm_perl_src = File::Spec->canonpath($mm->{PERL_SRC});
-}
-else {
- $mm_perl_src = $mm->{PERL_SRC};
-}
-
-is( $mm_perl_src, $perl_src, 'PERL_SRC' );
-
-
-# Every INSTALL* variable must start with some PREFIX.
-my %Install_Vars = (
- PERL => [qw(archlib privlib bin man1dir man3dir script)],
- SITE => [qw(sitearch sitelib sitebin siteman1dir siteman3dir)],
- VENDOR => [qw(vendorarch vendorlib vendorbin vendorman1dir vendorman3dir)]
-);
-
-while( my($type, $vars) = each %Install_Vars) {
- SKIP: {
- skip "VMS must expand macros in INSTALL* vars", scalar @$vars
- if $Is_VMS;
- skip '$Config{usevendorprefix} not set', scalar @$vars
- if $type eq 'VENDOR' and !$Config{usevendorprefix};
-
- foreach my $var (@$vars) {
- my $installvar = "install$var";
- my $prefix = '$('.$type.'PREFIX)';
-
- SKIP: {
- skip uc($installvar).' set to another INSTALL variable', 1
- if $mm->{uc $installvar} =~ /^\$\(INSTALL.*\)$/;
-
- # support for man page skipping
- $prefix = 'none' if $type eq 'PERL' &&
- $var =~ /man/ &&
- !$Config{$installvar};
- like( $mm->{uc $installvar}, qr/^\Q$prefix\E/,
- "$prefix + $var" );
- }
- }
- }
-}
-
-# Check that when installman*dir isn't set in Config no man pages
-# are generated.
-{
- _set_config(installman1dir => '');
- _set_config(installman3dir => '');
-
- my $wibble = File::Spec->catdir(qw(wibble and such));
- my $stdout = tie *STDOUT, 'TieOut' or die;
- my $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- PREREQ_PM => {},
- PERL_CORE => $ENV{PERL_CORE},
- PREFIX => $PREFIX,
- INSTALLMAN1DIR=> $wibble,
- );
-
- is( $mm->{INSTALLMAN1DIR}, $wibble );
- is( $mm->{INSTALLMAN3DIR}, 'none' );
-}
-
-# Check that when installvendorman*dir is set in Config it is honored
-# [rt.cpan.org 2949]
-{
- _set_config(installvendorman1dir => File::Spec->catdir('foo','bar') );
- _set_config(installvendorman3dir => '' );
- _set_config(usevendorprefix => 1 );
- _set_config(vendorprefixexp => 'something' );
-
- my $stdout = tie *STDOUT, 'TieOut' or die;
- my $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- PREREQ_PM => {},
- PERL_CORE => $ENV{PERL_CORE},
-
- # In case the local installation doesn't have man pages.
- INSTALLMAN1DIR=> 'foo/bar/baz',
- INSTALLMAN3DIR=> 'foo/bar/baz',
- );
-
- is( $mm->{INSTALLVENDORMAN1DIR}, File::Spec->catdir('foo','bar'),
- 'installvendorman1dir (in %Config) not modified' );
- isnt( $mm->{INSTALLVENDORMAN3DIR}, '',
- 'installvendorman3dir (not in %Config) set' );
-}
-
-# Check that when installsiteman*dir isn't set in Config it falls back
-# to installman*dir
-{
- _set_config(installman1dir => File::Spec->catdir('foo', 'bar') );
- _set_config(installman3dir => File::Spec->catdir('foo', 'baz') );
- _set_config(installsiteman1dir => '' );
- _set_config(installsiteman3dir => '' );
- _set_config(installvendorman1dir => '' );
- _set_config(installvendorman3dir => '' );
- _set_config(usevendorprefix => 'define' );
- _set_config(vendorprefixexp => 'something' );
-
- my $wibble = File::Spec->catdir(qw(wibble and such));
- my $stdout = tie *STDOUT, 'TieOut' or die;
- my $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- PERL_CORE => $ENV{PERL_CORE},
- );
-
- is( $mm->{INSTALLMAN1DIR}, File::Spec->catdir('foo', 'bar') );
- is( $mm->{INSTALLMAN3DIR}, File::Spec->catdir('foo', 'baz') );
- SKIP: {
- skip "VMS must expand macros in INSTALL* vars", 4 if $Is_VMS;
-
- is( $mm->{INSTALLSITEMAN1DIR}, '$(INSTALLMAN1DIR)' );
- is( $mm->{INSTALLSITEMAN3DIR}, '$(INSTALLMAN3DIR)' );
- is( $mm->{INSTALLVENDORMAN1DIR}, '$(INSTALLMAN1DIR)' );
- is( $mm->{INSTALLVENDORMAN3DIR}, '$(INSTALLMAN3DIR)' );
- }
-}
-
-
-# Check that when usevendoprefix and installvendorman*dir aren't set in
-# Config it leaves them unset.
-{
- _set_config(installman1dir => File::Spec->catdir('foo', 'bar') );
- _set_config(installman3dir => File::Spec->catdir('foo', 'baz') );
- _set_config(installsiteman1dir => '' );
- _set_config(installsiteman3dir => '' );
- _set_config(installvendorman1dir => '' );
- _set_config(installvendorman3dir => '' );
- _set_config(usevendorprefix => '' );
- _set_config(vendorprefixexp => '' );
-
- my $wibble = File::Spec->catdir(qw(wibble and such));
- my $stdout = tie *STDOUT, 'TieOut' or die;
- my $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- PERL_CORE => $ENV{PERL_CORE},
- );
-
- is( $mm->{INSTALLMAN1DIR}, File::Spec->catdir('foo', 'bar') );
- is( $mm->{INSTALLMAN3DIR}, File::Spec->catdir('foo', 'baz') );
- SKIP: {
- skip "VMS must expand macros in INSTALL* vars", 2 if $Is_VMS;
- is( $mm->{INSTALLSITEMAN1DIR}, '$(INSTALLMAN1DIR)' );
- is( $mm->{INSTALLSITEMAN3DIR}, '$(INSTALLMAN3DIR)' );
- }
- is( $mm->{INSTALLVENDORMAN1DIR}, '' );
- is( $mm->{INSTALLVENDORMAN3DIR}, '' );
-}
-
-
-sub _set_config {
- my($k,$v) = @_;
- (my $k_no_install = $k) =~ s/^install//i;
- $Config{$k} = $v;
-
- # Because VMS's config has traditionally been underpopulated, it will
- # fall back to the install-less versions in desperation.
- $Config{$k_no_install} = $v if $Is_VMS;
- return;
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/Install.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/Install.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/Install.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,194 +0,0 @@
-#!/usr/bin/perl -w
-
-# Test ExtUtils::Install.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- @INC = ('../../lib', '../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use strict;
-use TieOut;
-use File::Path;
-use File::Spec;
-
-use Test::More tests => 52;
-
-use MakeMaker::Test::Setup::BFD;
-
-BEGIN { use_ok('ExtUtils::Install') }
-# ensure the env doesnt pollute our tests
-local $ENV{EU_INSTALL_ALWAYS_COPY};
-local $ENV{EU_ALWAYS_COPY};
-
-# Check exports.
-foreach my $func (qw(install uninstall pm_to_blib install_default)) {
- can_ok(__PACKAGE__, $func);
-}
-
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-chdir 'Big-Dummy';
-
-my $stdout = tie *STDOUT, 'TieOut';
-pm_to_blib( { 'lib/Big/Dummy.pm' => 'blib/lib/Big/Dummy.pm' },
- 'blib/lib/auto'
- );
-END { rmtree 'blib' }
-
-ok( -d 'blib/lib', 'pm_to_blib created blib dir' );
-ok( -r 'blib/lib/Big/Dummy.pm', ' copied .pm file' );
-ok( -r 'blib/lib/auto', ' created autosplit dir' );
-is( $stdout->read, "cp lib/Big/Dummy.pm blib/lib/Big/Dummy.pm\n" );
-
-pm_to_blib( { 'lib/Big/Dummy.pm' => 'blib/lib/Big/Dummy.pm' },
- 'blib/lib/auto'
- );
-ok( -d 'blib/lib', 'second run, blib dir still there' );
-ok( -r 'blib/lib/Big/Dummy.pm', ' .pm file still there' );
-ok( -r 'blib/lib/auto', ' autosplit still there' );
-is( $stdout->read, "Skip blib/lib/Big/Dummy.pm (unchanged)\n" );
-
-install( { 'blib/lib' => 'install-test/lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- },
- 0, 1);
-ok( ! -d 'install-test/lib/perl', 'install made dir (dry run)');
-ok( ! -r 'install-test/lib/perl/Big/Dummy.pm',
- ' .pm file installed (dry run)');
-ok( ! -r 'install-test/packlist', ' packlist exists (dry run)');
-
-install( { 'blib/lib' => 'install-test/lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- } );
-ok( -d 'install-test/lib/perl', 'install made dir' );
-ok( -r 'install-test/lib/perl/Big/Dummy.pm', ' .pm file installed' );
-ok(!-r 'install-test/lib/perl/Big/Dummy.SKIP', ' ignored .SKIP file' );
-ok( -r 'install-test/packlist', ' packlist exists' );
-
-open(PACKLIST, 'install-test/packlist' );
-my %packlist = map { chomp; ($_ => 1) } <PACKLIST>;
-close PACKLIST;
-
-# On case-insensitive filesystems (ie. VMS), the keys of the packlist might
-# be lowercase. :(
-my $native_dummy = File::Spec->catfile(qw(install-test lib perl Big Dummy.pm));
-is( keys %packlist, 1 );
-is( lc((keys %packlist)[0]), lc $native_dummy, 'packlist written' );
-
-
-# Test UNINST=1 preserving same versions in other dirs.
-install( { 'blib/lib' => 'install-test/other_lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- },
- 0, 0, 1);
-ok( -d 'install-test/other_lib/perl', 'install made other dir' );
-ok( -r 'install-test/other_lib/perl/Big/Dummy.pm', ' .pm file installed' );
-ok( -r 'install-test/packlist', ' packlist exists' );
-ok( -r 'install-test/lib/perl/Big/Dummy.pm', ' UNINST=1 preserved same' );
-
-
-chmod 0644, 'blib/lib/Big/Dummy.pm' or die $!;
-open(DUMMY, ">>blib/lib/Big/Dummy.pm") or die $!;
-print DUMMY "Extra stuff\n";
-close DUMMY;
-
-
-# Test UNINST=0 does not remove other versions in other dirs.
-{
- ok( -r 'install-test/lib/perl/Big/Dummy.pm', 'different install exists' );
-
- local @INC = ('install-test/lib/perl');
- local $ENV{PERL5LIB} = '';
- install( { 'blib/lib' => 'install-test/other_lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- },
- 0, 0, 0);
- ok( -d 'install-test/other_lib/perl', 'install made other dir' );
- ok( -r 'install-test/other_lib/perl/Big/Dummy.pm', ' .pm file installed' );
- ok( -r 'install-test/packlist', ' packlist exists' );
- ok( -r 'install-test/lib/perl/Big/Dummy.pm',
- ' UNINST=0 left different' );
-}
-
-# Test UNINST=1 only warning when failing to remove an irrelevent shadow file
-{
- my $tfile='install-test/lib/perl/Big/Dummy.pm';
- local $ExtUtils::Install::Testing = $tfile;
- local @INC = ('install-test/other_lib/perl','install-test/lib/perl');
- local $ENV{PERL5LIB} = '';
- ok( -r $tfile, 'different install exists' );
- my @warn;
- local $SIG{__WARN__}=sub { push @warn, @_; return };
- my $ok=eval {
- install( { 'blib/lib' => 'install-test/other_lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- },
- 0, 0, 1);
- 1
- };
- ok($ok,' we didnt die');
- ok(0+ at warn," we did warn");
- ok( -d 'install-test/other_lib/perl', 'install made other dir' );
- ok( -r 'install-test/other_lib/perl/Big/Dummy.pm', ' .pm file installed' );
- ok( -r 'install-test/packlist', ' packlist exists' );
- ok( -r $tfile, ' UNINST=1 failed to remove different' );
-
-}
-
-# Test UNINST=1 dieing when failing to remove an relevent shadow file
-{
- my $tfile='install-test/lib/perl/Big/Dummy.pm';
- local $ExtUtils::Install::Testing = $tfile;
- local @INC = ('install-test/lib/perl','install-test/other_lib/perl');
- local $ENV{PERL5LIB} = '';
- ok( -r $tfile, 'different install exists' );
- my @warn;
- local $SIG{__WARN__}=sub { push @warn, at _; return };
- my $ok=eval {
- install( { 'blib/lib' => 'install-test/other_lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- },
- 0, 0, 1);
- 1
- };
- ok(!$ok,' we did die');
- ok(!@warn," we didnt warn");
- ok( -d 'install-test/other_lib/perl', 'install made other dir' );
- ok( -r 'install-test/other_lib/perl/Big/Dummy.pm', ' .pm file installed' );
- ok( -r 'install-test/packlist', ' packlist exists' );
- ok( -r $tfile,' UNINST=1 failed to remove different' );
-}
-
-# Test UNINST=1 removing other versions in other dirs.
-{
- local @INC = ('install-test/lib/perl');
- local $ENV{PERL5LIB} = '';
- install( { 'blib/lib' => 'install-test/other_lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- },
- 0, 0, 1);
- ok( -d 'install-test/other_lib/perl', 'install made other dir' );
- ok( -r 'install-test/other_lib/perl/Big/Dummy.pm', ' .pm file installed' );
- ok( -r 'install-test/packlist', ' packlist exists' );
- ok( !-r 'install-test/lib/perl/Big/Dummy.pm',
- ' UNINST=1 removed different' );
-}
-
Deleted: trunk/contrib/perl/lib/ExtUtils/t/InstallWithMM.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/InstallWithMM.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/InstallWithMM.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,95 +0,0 @@
-#!/usr/bin/perl -w
-
-# Make sure EUI works with MakeMaker
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Config;
-use ExtUtils::MakeMaker;
-
-use Test::More tests => 15;
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::BFD;
-use File::Find;
-use File::Spec;
-use File::Path;
-
-my $make = make_run();
-
-# Environment variables which interfere with our testing.
-delete @ENV{qw(PREFIX LIB MAKEFLAGS)};
-
-# Run Makefile.PL
-{
- my $perl = which_perl();
- my $Is_VMS = $^O eq 'VMS';
-
- chdir 't';
-
- perl_lib;
-
- my $Touch_Time = calibrate_mtime();
-
- $| = 1;
-
- ok( setup_recurs(), 'setup' );
- END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
- }
-
- ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
- diag("chdir failed: $!");
-
- my @mpl_out = run(qq{$perl Makefile.PL "PREFIX=../dummy-install"});
- END { rmtree '../dummy-install'; }
-
- cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
- diag(@mpl_out);
-
- END { unlink makefile_name(), makefile_backup() }
-}
-
-
-# make
-{
- my $make_out = run($make);
- is( $?, 0, 'make ran ok' ) ||
- diag($make_out);
-}
-
-
-# Test 'make install VERBINST=1'
-{
- my $make_install_verbinst = make_macro($make, 'install', VERBINST => 1);
- my $install_out = run($make_install_verbinst);
- is( $?, 0, 'install' ) || diag $install_out;
- like( $install_out, qr/^Installing /m );
- like( $install_out, qr/^Writing /m );
-
- ok( -r '../dummy-install', ' install dir created' );
- my %files = ();
- find( sub {
- # do it case-insensitive for non-case preserving OSs
- my $file = lc $_;
-
- # VMS likes to put dots on the end of things that don't have them.
- $file =~ s/\.$// if $Is_VMS;
-
- $files{$file} = $File::Find::name;
- }, '../dummy-install' );
- ok( $files{'dummy.pm'}, ' Dummy.pm installed' );
- ok( $files{'liar.pm'}, ' Liar.pm installed' );
- ok( $files{'program'}, ' program installed' );
- ok( $files{'.packlist'}, ' packlist created' );
- ok( $files{'perllocal.pod'},' perllocal.pod created' );
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/Installapi2.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/Installapi2.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/Installapi2.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,238 +0,0 @@
-#!/usr/bin/perl -w
-
-# Test ExtUtils::Install.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- @INC = ('../../lib', '../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use strict;
-use TieOut;
-use File::Path;
-use File::Spec;
-
-use Test::More tests => 70;
-
-use MakeMaker::Test::Setup::BFD;
-
-BEGIN { use_ok('ExtUtils::Install') }
-
-# Check exports.
-foreach my $func (qw(install uninstall pm_to_blib install_default)) {
- can_ok(__PACKAGE__, $func);
-}
-
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-# ensure the env doesnt pollute our tests
-local $ENV{EU_INSTALL_ALWAYS_COPY};
-local $ENV{EU_ALWAYS_COPY};
-
-chdir 'Big-Dummy';
-
-my $stdout = tie *STDOUT, 'TieOut';
-pm_to_blib( { 'lib/Big/Dummy.pm' => 'blib/lib/Big/Dummy.pm' },
- 'blib/lib/auto'
- );
-END { rmtree 'blib' }
-
-ok( -d 'blib/lib', 'pm_to_blib created blib dir' );
-ok( -r 'blib/lib/Big/Dummy.pm', ' copied .pm file' );
-ok( -r 'blib/lib/auto', ' created autosplit dir' );
-is( $stdout->read, "cp lib/Big/Dummy.pm blib/lib/Big/Dummy.pm\n" );
-
-pm_to_blib( { 'lib/Big/Dummy.pm' => 'blib/lib/Big/Dummy.pm' },
- 'blib/lib/auto'
- );
-ok( -d 'blib/lib', 'second run, blib dir still there' );
-ok( -r 'blib/lib/Big/Dummy.pm', ' .pm file still there' );
-ok( -r 'blib/lib/auto', ' autosplit still there' );
-is( $stdout->read, "Skip blib/lib/Big/Dummy.pm (unchanged)\n" );
-
-install( [
- from_to=>{ 'blib/lib' => 'install-test/lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- },
- dry_run=>1]);
-ok( ! -d 'install-test/lib/perl', 'install made dir (dry run)');
-ok( ! -r 'install-test/lib/perl/Big/Dummy.pm',
- ' .pm file installed (dry run)');
-ok( ! -r 'install-test/packlist', ' packlist exists (dry run)');
-
-install([ from_to=> { 'blib/lib' => 'install-test/lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- } ]);
-ok( -d 'install-test/lib/perl', 'install made dir' );
-ok( -r 'install-test/lib/perl/Big/Dummy.pm', ' .pm file installed' );
-ok(!-r 'install-test/lib/perl/Big/Dummy.SKIP', ' ignored .SKIP file' );
-ok( -r 'install-test/packlist', ' packlist exists' );
-
-open(PACKLIST, 'install-test/packlist' );
-my %packlist = map { chomp; ($_ => 1) } <PACKLIST>;
-close PACKLIST;
-
-# On case-insensitive filesystems (ie. VMS), the keys of the packlist might
-# be lowercase. :(
-my $native_dummy = File::Spec->catfile(qw(install-test lib perl Big Dummy.pm));
-is( keys %packlist, 1 );
-is( lc((keys %packlist)[0]), lc $native_dummy, 'packlist written' );
-
-
-# Test UNINST=1 preserving same versions in other dirs.
-install([from_to=> { 'blib/lib' => 'install-test/other_lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- },uninstall_shadows=>1]);
-ok( -d 'install-test/other_lib/perl', 'install made other dir' );
-ok( -r 'install-test/other_lib/perl/Big/Dummy.pm', ' .pm file installed' );
-ok( -r 'install-test/packlist', ' packlist exists' );
-ok( -r 'install-test/lib/perl/Big/Dummy.pm', ' UNINST=1 preserved same' );
-
-
-chmod 0644, 'blib/lib/Big/Dummy.pm' or die $!;
-open(DUMMY, ">>blib/lib/Big/Dummy.pm") or die $!;
-print DUMMY "Extra stuff\n";
-close DUMMY;
-
-
-# Test UNINST=0 does not remove other versions in other dirs.
-{
- ok( -r 'install-test/lib/perl/Big/Dummy.pm', 'different install exists' );
-
- local @INC = ('install-test/lib/perl');
- local $ENV{PERL5LIB} = '';
- install([from_to=> { 'blib/lib' => 'install-test/other_lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- }]);
- ok( -d 'install-test/other_lib/perl', 'install made other dir' );
- ok( -r 'install-test/other_lib/perl/Big/Dummy.pm', ' .pm file installed' );
- ok( -r 'install-test/packlist', ' packlist exists' );
- ok( -r 'install-test/lib/perl/Big/Dummy.pm',
- ' UNINST=0 left different' );
-}
-
-# Test UNINST=1 only warning when failing to remove an irrelevent shadow file
-{
- my $tfile='install-test/lib/perl/Big/Dummy.pm';
- local $ExtUtils::Install::Testing = $tfile;
- local @INC = ('install-test/other_lib/perl','install-test/lib/perl');
- local $ENV{PERL5LIB} = '';
- ok( -r $tfile, 'different install exists' );
- my @warn;
- local $SIG{__WARN__}=sub { push @warn, @_; return };
- my $ok=eval {
- install([from_to=> { 'blib/lib' => 'install-test/other_lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- },
- uninstall_shadows=>1]);
- 1
- };
- ok($ok,' we didnt die');
- ok(0+ at warn," we did warn");
- ok( -d 'install-test/other_lib/perl', 'install made other dir' );
- ok( -r 'install-test/other_lib/perl/Big/Dummy.pm', ' .pm file installed' );
- ok( -r 'install-test/packlist', ' packlist exists' );
- ok( -r $tfile, ' UNINST=1 failed to remove different' );
-
-}
-
-# Test UNINST=1 dieing when failing to remove an relevent shadow file
-{
- my $tfile='install-test/lib/perl/Big/Dummy.pm';
- local $ExtUtils::Install::Testing = $tfile;
- local @INC = ('install-test/lib/perl','install-test/other_lib/perl');
- local $ENV{PERL5LIB} = '';
- ok( -r $tfile, 'different install exists' );
- my @warn;
- local $SIG{__WARN__}=sub { push @warn, at _; return };
- my $ok=eval {
- install([from_to=> { 'blib/lib' => 'install-test/other_lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- },uninstall_shadows=>1]);
- 1
- };
- ok(!$ok,' we did die');
- ok(!@warn," we didnt warn");
- ok( -d 'install-test/other_lib/perl', 'install made other dir' );
- ok( -r 'install-test/other_lib/perl/Big/Dummy.pm', ' .pm file installed' );
- ok( -r 'install-test/packlist', ' packlist exists' );
- ok( -r $tfile,' UNINST=1 failed to remove different' );
-}
-
-# Test UNINST=1 removing other versions in other dirs.
-{
- local @INC = ('install-test/lib/perl');
- local $ENV{PERL5LIB} = '';
- ok( -r 'install-test/lib/perl/Big/Dummy.pm','different install exists' );
- install([from_to=>{ 'blib/lib' => 'install-test/other_lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- },uninstall_shadows=>1]);
- ok( -d 'install-test/other_lib/perl', 'install made other dir' );
- ok( -r 'install-test/other_lib/perl/Big/Dummy.pm', ' .pm file installed' );
- ok( -r 'install-test/packlist', ' packlist exists' );
- ok( !-r 'install-test/lib/perl/Big/Dummy.pm',
- ' UNINST=1 removed different' );
-}
-
-# Test EU_ALWAYS_COPY triggers copy.
-{
- local @INC = ('install-test/lib/perl');
- local $ENV{PERL5LIB} = '';
- local $ENV{EU_INSTALL_ALWAYS_COPY}=1;
- my $tfile='install-test/other_lib/perl/Big/Dummy.pm';
- my $sfile='blib/lib/Big/Dummy.pm';
- ok(-r $tfile,"install file already exists");
- ok(-r $sfile,"source file already exists");
- utime time-600, time-600, $sfile or die "utime '$sfile' failed:$!";
- ok( (stat $tfile)[9]!=(stat $sfile)[9],' Times are different');
- install([from_to=>{ 'blib/lib' => 'install-test/other_lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- },result=>\my %result]);
- ok( -d 'install-test/other_lib/perl', 'install made other dir' );
- ok( -r 'install-test/other_lib/perl/Big/Dummy.pm', ' .pm file installed' );
- ok( -r 'install-test/packlist', ' packlist exists' );
-SKIP: {
- skip "Times not preserved during copy by default", 1 if $^O eq 'VMS';
- ok( (stat $tfile)[9]==(stat $sfile)[9],' Times are same');
-}
- ok( !$result{install_unchanged},' $result{install_unchanged} should be empty');
-}
-# Test nothing is copied.
-{
- local @INC = ('install-test/lib/perl');
- local $ENV{PERL5LIB} = '';
- local $ENV{EU_INSTALL_ALWAYS_COPY}=0;
- my $tfile='install-test/other_lib/perl/Big/Dummy.pm';
- my $sfile='blib/lib/Big/Dummy.pm';
- ok(-r $tfile,"install file already exists");
- ok(-r $sfile,"source file already exists");
- utime time-1200, time-1200, $sfile or die "utime '$sfile' failed:$!";
- ok( (stat $tfile)[9]!=(stat $sfile)[9],' Times are different');
- install([from_to=>{ 'blib/lib' => 'install-test/other_lib/perl',
- read => 'install-test/packlist',
- write => 'install-test/packlist'
- },result=>\my %result]);
- ok( -d 'install-test/other_lib/perl', 'install made other dir' );
- ok( -r 'install-test/other_lib/perl/Big/Dummy.pm', ' .pm file installed' );
- ok( -r 'install-test/packlist', ' packlist exists' );
- ok( (stat $tfile)[9]!=(stat$sfile)[9],' Times are different');
- ok( !$result{install},' nothing should have been installed');
- ok( $result{install_unchanged},' install_unchanged should be populated');
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/Installed.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/Installed.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/Installed.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,313 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = '../lib';
- }
- else {
- unshift @INC, 't/lib/';
- }
-}
-chdir 't';
-
-my $Is_VMS = $^O eq 'VMS';
-
-use strict;
-
-use Config;
-use Cwd;
-use File::Path;
-use File::Basename;
-use File::Spec;
-
-use Test::More tests => 63;
-
-BEGIN { use_ok( 'ExtUtils::Installed' ) }
-
-my $mandirs = !!$Config{man1direxp} + !!$Config{man3direxp};
-
-# saves having to qualify package name for class methods
-my $ei = bless( {}, 'ExtUtils::Installed' );
-
-# Make sure meta info is available
-$ei->{':private:'}{Config} = \%Config;
-$ei->{':private:'}{INC} = \@INC;
-
-# _is_prefix
-ok( $ei->_is_prefix('foo/bar', 'foo'),
- '_is_prefix() should match valid path prefix' );
-ok( !$ei->_is_prefix('\foo\bar', '\bar'),
- '... should not match wrong prefix' );
-
-# _is_type
-ok( $ei->_is_type(0, 'all'), '_is_type() should be true for type of "all"' );
-
-foreach my $path (qw( man1dir man3dir )) {
- SKIP: {
- my $dir = File::Spec->canonpath($Config{$path.'exp'});
- skip("no man directory $path on this system", 2 ) unless $dir;
-
- my $file = $dir . '/foo';
- ok( $ei->_is_type($file, 'doc'), "... should find doc file in $path" );
- ok( !$ei->_is_type($file, 'prog'), "... but not prog file in $path" );
- }
-}
-
-# VMS 5.6.1 doesn't seem to have $Config{prefixexp}
-my $prefix = $Config{prefix} || $Config{prefixexp};
-
-# You can concatenate /foo but not foo:, which defaults in the current
-# directory
-$prefix = VMS::Filespec::unixify($prefix) if $Is_VMS;
-
-# ActivePerl 5.6.1/631 has $Config{prefixexp} as 'p:' for some reason
-$prefix = $Config{prefix} if $prefix eq 'p:' && $^O eq 'MSWin32';
-
-ok( $ei->_is_type( File::Spec->catfile($prefix, 'bar'), 'prog'),
- "... should find prog file under $prefix" );
-
-SKIP: {
- skip('no man directories on this system', 1) unless $mandirs;
- is( $ei->_is_type('bar', 'doc'), 0,
- '... should not find doc file outside path' );
-}
-
-ok( !$ei->_is_type('bar', 'prog'),
- '... nor prog file outside path' );
-ok( !$ei->_is_type('whocares', 'someother'), '... nor other type anywhere' );
-
-# _is_under
-ok( $ei->_is_under('foo'), '_is_under() should return true with no dirs' );
-
-my @under = qw( boo bar baz );
-ok( !$ei->_is_under('foo', @under), '... should find no file not under dirs');
-ok( $ei->_is_under('baz', @under), '... should find file under dir' );
-
-
-rmtree 'auto/FakeMod';
-ok( mkpath('auto/FakeMod') );
-END { rmtree 'auto' }
-
-ok(open(PACKLIST, '>auto/FakeMod/.packlist'));
-print PACKLIST 'list';
-close PACKLIST;
-
-ok(open(FAKEMOD, '>auto/FakeMod/FakeMod.pm'));
-
-print FAKEMOD <<'FAKE';
-package FakeMod;
-use vars qw( $VERSION );
-$VERSION = '1.1.1';
-1;
-FAKE
-
-close FAKEMOD;
-
-my $fake_mod_dir = File::Spec->catdir(cwd(), 'auto', 'FakeMod');
-{
- # avoid warning and death by localizing glob
- local *ExtUtils::Installed::Config;
- %ExtUtils::Installed::Config = (
- %Config,
- archlibexp => cwd(),
- sitearchexp => $fake_mod_dir,
- );
-
- # necessary to fool new()
- push @INC, $fake_mod_dir;
-
- my $realei = ExtUtils::Installed->new();
- isa_ok( $realei, 'ExtUtils::Installed' );
- isa_ok( $realei->{Perl}{packlist}, 'ExtUtils::Packlist' );
- is( $realei->{Perl}{version}, $Config{version},
- 'new() should set Perl version from %Config' );
-
- ok( exists $realei->{FakeMod}, 'new() should find modules with .packlists');
- isa_ok( $realei->{FakeMod}{packlist}, 'ExtUtils::Packlist' );
- is( $realei->{FakeMod}{version}, '1.1.1',
- '... should find version in modules' );
-}
-
-# Now try this using PERL5LIB
-{
- local $ENV{PERL5LIB} = join $Config{path_sep}, $fake_mod_dir;
- local *ExtUtils::Installed::Config;
- %ExtUtils::Installed::Config = (
- %Config,
- archlibexp => cwd(),
- sitearchexp => cwd(),
- );
-
- my $realei = ExtUtils::Installed->new();
- isa_ok( $realei, 'ExtUtils::Installed' );
- isa_ok( $realei->{Perl}{packlist}, 'ExtUtils::Packlist' );
- is( $realei->{Perl}{version}, $Config{version},
- 'new() should set Perl version from %Config' );
-
- ok( exists $realei->{FakeMod},
- 'new() should find modules with .packlists using PERL5LIB'
- );
- isa_ok( $realei->{FakeMod}{packlist}, 'ExtUtils::Packlist' );
- is( $realei->{FakeMod}{version}, '1.1.1',
- '... should find version in modules' );
-}
-
-# Do the same thing as the last block, but with overrides for
-# %Config and @INC.
-{
- my $config_override = { %Config::Config };
- $config_override->{archlibexp} = cwd();
- $config_override->{sitearchexp} = $fake_mod_dir;
- $config_override->{version} = 'fake_test_version';
-
- my @inc_override = (@INC, $fake_mod_dir);
-
- my $realei = ExtUtils::Installed->new(
- 'config_override' => $config_override,
- 'inc_override' => \@inc_override,
- );
- isa_ok( $realei, 'ExtUtils::Installed' );
- isa_ok( $realei->{Perl}{packlist}, 'ExtUtils::Packlist' );
- is( $realei->{Perl}{version}, 'fake_test_version',
- 'new(config_override => HASH) overrides %Config' );
-
- ok( exists $realei->{FakeMod}, 'new() with overrides should find modules with .packlists');
- isa_ok( $realei->{FakeMod}{packlist}, 'ExtUtils::Packlist' );
- is( $realei->{FakeMod}{version}, '1.1.1',
- '... should find version in modules' );
-}
-
-# Check if extra_libs works.
-{
- my $realei = ExtUtils::Installed->new(
- 'extra_libs' => [ cwd() ],
- );
- isa_ok( $realei, 'ExtUtils::Installed' );
- isa_ok( $realei->{Perl}{packlist}, 'ExtUtils::Packlist' );
- ok( exists $realei->{FakeMod},
- 'new() with extra_libs should find modules with .packlists');
-
- #{ use Data::Dumper; local $realei->{':private:'}{Config};
- # warn Dumper($realei); }
-
- isa_ok( $realei->{FakeMod}{packlist}, 'ExtUtils::Packlist' );
- is( $realei->{FakeMod}{version}, '1.1.1',
- '... should find version in modules' );
-}
-
-# modules
-$ei->{$_} = 1 for qw( abc def ghi );
-is( join(' ', $ei->modules()), 'abc def ghi',
- 'modules() should return sorted keys' );
-
-# This didn't work for a long time due to a sort in scalar context oddity.
-is( $ei->modules, 3, 'modules() in scalar context' );
-
-# files
-$ei->{goodmod} = {
- packlist => {
- ($Config{man1direxp} ?
- (File::Spec->catdir($Config{man1direxp}, 'foo') => 1) :
- ()),
- ($Config{man3direxp} ?
- (File::Spec->catdir($Config{man3direxp}, 'bar') => 1) :
- ()),
- File::Spec->catdir($prefix, 'foobar') => 1,
- foobaz => 1,
- },
-};
-
-eval { $ei->files('badmod') };
-like( $@, qr/badmod is not installed/,'files() should croak given bad modname');
-eval { $ei->files('goodmod', 'badtype' ) };
-like( $@, qr/type must be/,'files() should croak given bad type' );
-
-my @files;
-SKIP: {
- skip('no man directory man1dir on this system', 2)
- unless $Config{man1direxp};
- @files = $ei->files('goodmod', 'doc', $Config{man1direxp});
- is( scalar @files, 1, '... should find doc file under given dir' );
- is( (grep { /foo$/ } @files), 1, '... checking file name' );
-}
-SKIP: {
- skip('no man directories on this system', 1) unless $mandirs;
- @files = $ei->files('goodmod', 'doc');
- is( scalar @files, $mandirs, '... should find all doc files with no dir' );
-}
-
- at files = $ei->files('goodmod', 'prog', 'fake', 'fake2');
-is( scalar @files, 0, '... should find no doc files given wrong dirs' );
- at files = $ei->files('goodmod', 'prog');
-is( scalar @files, 1, '... should find doc file in correct dir' );
-like( $files[0], qr/foobar[>\]]?$/, '... checking file name' );
- at files = $ei->files('goodmod');
-is( scalar @files, 2 + $mandirs, '... should find all files with no type specified' );
-my %dirnames = map { lc($_) => dirname($_) } @files;
-
-# directories
-my @dirs = $ei->directories('goodmod', 'prog', 'fake');
-is( scalar @dirs, 0, 'directories() should return no dirs if no files found' );
-
-SKIP: {
- skip('no man directories on this system', 1) unless $mandirs;
- @dirs = $ei->directories('goodmod', 'doc');
- is( scalar @dirs, $mandirs, '... should find all files files() would' );
-}
- at dirs = $ei->directories('goodmod');
-is( scalar @dirs, 2 + $mandirs, '... should find all files files() would, again' );
- at files = sort map { exists $dirnames{lc($_)} ? $dirnames{lc($_)} : '' } @files;
-is( join(' ', @files), join(' ', @dirs), '... should sort output' );
-
-# directory_tree
-my $expectdirs =
- ($mandirs == 2) &&
- (dirname($Config{man1direxp}) eq dirname($Config{man3direxp}))
- ? 3 : 2;
-
-SKIP: {
- skip('no man directories on this system', 1) unless $mandirs;
- @dirs = $ei->directory_tree('goodmod', 'doc', $Config{man1direxp} ?
- dirname($Config{man1direxp}) : dirname($Config{man3direxp}));
- is( scalar @dirs, $expectdirs,
- 'directory_tree() should report intermediate dirs to those requested' );
-}
-
-my $fakepak = Fakepak->new(102);
-
-$ei->{yesmod} = {
- version => 101,
- packlist => $fakepak,
-};
-
-# these should all croak
-foreach my $sub (qw( validate packlist version )) {
- eval { $ei->$sub('nomod') };
- like( $@, qr/nomod is not installed/,
- "$sub() should croak when asked about uninstalled module" );
-}
-
-# validate
-is( $ei->validate('yesmod'), 'validated',
- 'validate() should return results of packlist validate() call' );
-
-# packlist
-is( ${ $ei->packlist('yesmod') }, 102,
- 'packlist() should report installed mod packlist' );
-
-# version
-is( $ei->version('yesmod'), 101,
- 'version() should report installed mod version' );
-
-
-package Fakepak;
-
-sub new {
- my $class = shift;
- bless(\(my $scalar = shift), $class);
-}
-
-sub validate {
- return 'validated'
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/Liblist.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/Liblist.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/Liblist.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,36 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use strict;
-use Test::More tests => 6;
-
-
-BEGIN {
- use_ok( 'ExtUtils::Liblist' );
-}
-
-ok( defined &ExtUtils::Liblist::ext,
- 'ExtUtils::Liblist::ext() defined for backwards compat' );
-
-{
- my @warn;
- local $SIG{__WARN__} = sub {push @warn, [@_]};
-
- my $ll = bless {}, 'ExtUtils::Liblist';
- my @out = $ll->ext('-ln0tt43r3_perl');
- is( @out, 4, 'enough output' );
- unlike( $out[2], qr/-ln0tt43r3_perl/, 'bogus library not added' );
- ok( @warn, 'had warning');
-
- is( grep(/\QNote (probably harmless): No library found for \E(-l)?n0tt43r3_perl/, map { @$_ } @warn), 1 ) || diag join "\n", @warn;
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/MM_Any.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/MM_Any.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/MM_Any.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,33 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = '../lib';
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use Test::More tests => 7;
-BEGIN { use_ok('ExtUtils::MM') }
-
-
-### OS Flavor methods
-
-can_ok( 'MM', 'os_flavor', 'os_flavor_is' );
-
-# Can't really know what the flavors are going to be, so we just
-# make sure it returns something.
-my @flavors = MM->os_flavor;
-ok( @flavors, 'os_flavor() returned something' );
-
-ok( MM->os_flavor_is($flavors[rand @flavors]),
- 'os_flavor_is() one flavor' );
-ok( MM->os_flavor_is($flavors[rand @flavors], 'BogusOS'),
- ' many flavors' );
-ok( !MM->os_flavor_is('BogusOS'), ' wrong flavor' );
-ok( !MM->os_flavor_is(), ' no flavor' );
-
Deleted: trunk/contrib/perl/lib/ExtUtils/t/MM_BeOS.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/MM_BeOS.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/MM_BeOS.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,56 +0,0 @@
-#!/usr/bin/perl
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = '../lib';
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use Test::More;
-
-BEGIN {
- if ($^O =~ /beos/i or $^O eq 'haiku') {
- plan tests => 4;
- } else {
- plan skip_all => 'This is not BeOS';
- }
-}
-
-use Config;
-use File::Spec;
-use File::Basename;
-
-# tels - Taken from MM_Win32.t - I must not understand why this works, right?
-# Does this mimic ExtUtils::MakeMaker ok?
-{
- @MM::ISA = qw(
- ExtUtils::MM_Unix
- ExtUtils::Liblist::Kid
- ExtUtils::MakeMaker
- );
- # MM package faked up by messy MI entanglement
- package MM;
- sub DESTROY {}
-}
-
-require_ok( 'ExtUtils::MM_BeOS' );
-
-my $MM = bless { NAME => "Foo" }, 'MM';
-
-# init_linker
-{
- my $libperl = File::Spec->catfile('$(PERL_INC)',
- $Config{libperl} || 'libperl.a' );
- my $export = '';
- my $after = '';
- $MM->init_linker;
-
- is( $MM->{PERL_ARCHIVE}, $libperl, 'PERL_ARCHIVE' );
- is( $MM->{PERL_ARCHIVE_AFTER}, $after, 'PERL_ARCHIVE_AFTER' );
- is( $MM->{EXPORT_LIST}, $export, 'EXPORT_LIST' );
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/MM_Cygwin.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/MM_Cygwin.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/MM_Cygwin.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,136 +0,0 @@
-#!/usr/bin/perl
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = '../lib';
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use strict;
-use Test::More;
-
-BEGIN {
- if ($^O =~ /cygwin/i) {
- plan tests => 14;
- } else {
- plan skip_all => "This is not cygwin";
- }
-}
-
-use Config;
-use File::Spec;
-use ExtUtils::MM;
-use Config;
-
-use_ok( 'ExtUtils::MM_Cygwin' );
-
-# test canonpath
-my $path = File::Spec->canonpath('/a/../../c');
-is( MM->canonpath('/a/../../c'), $path,
- 'canonpath() method should work just like the one in File::Spec' );
-
-# test cflags, with the fake package below
-my $MM = bless({
- CFLAGS => 'fakeflags',
- CCFLAGS => '',
-}, 'MM');
-
-# with CFLAGS set, it should be returned
-is( $MM->cflags(), 'fakeflags',
- 'cflags() should return CFLAGS member data, if set' );
-
-delete $MM->{CFLAGS};
-
-# ExtUtils::MM_Cygwin::cflags() calls this, fake the output
-{
- local $SIG{__WARN__} = sub {
- warn @_ unless $_[0] =~ /^Subroutine .* redefined/;
- };
- *ExtUtils::MM_Unix::cflags = sub { return $_[1] };
-}
-
-# respects the config setting, should ignore whitespace around equal sign
-my $ccflags = $Config{useshrplib} eq 'true' ? ' -DUSEIMPORTLIB' : '';
-{
- local $MM->{NEEDS_LINKING} = 1;
- $MM->cflags(<<FLAGS);
-OPTIMIZE = opt
-PERLTYPE =pt
-FLAGS
-}
-
-like( $MM->{CFLAGS}, qr/OPTIMIZE = opt/, '... should set OPTIMIZE' );
-like( $MM->{CFLAGS}, qr/PERLTYPE = pt/, '... should set PERLTYPE' );
-like( $MM->{CFLAGS}, qr/CCFLAGS = $ccflags/, '... should set CCFLAGS' );
-
-# test manifypods
-$MM = bless({
- NOECHO => 'noecho',
- MAN3PODS => {},
- MAN1PODS => {},
- MAKEFILE => 'Makefile',
-}, 'MM');
-unlike( $MM->manifypods(), qr/foo/,
- 'manifypods() should return without PODS values set' );
-
-$MM->{MAN3PODS} = { foo => 'foo.1' };
-my $res = $MM->manifypods();
-like( $res, qr/pure_all.*foo.*foo.1/s, '... should add MAN3PODS targets' );
-
-
-# init_linker
-{
- my $libperl = $Config{libperl} || 'libperl.a';
- $libperl =~ s/\.a/.dll.a/ if $] >= 5.006002;
- $libperl = "\$(PERL_INC)/$libperl";
-
- my $export = '';
- my $after = '';
- $MM->init_linker;
-
- is( $MM->{PERL_ARCHIVE}, $libperl, 'PERL_ARCHIVE' );
- is( $MM->{PERL_ARCHIVE_AFTER}, $after, 'PERL_ARCHIVE_AFTER' );
- is( $MM->{EXPORT_LIST}, $export, 'EXPORT_LIST' );
-}
-
-# Tests for correct handling of maybe_command in /cygdrive/*
-# and c:/*. $ENV{COMSPEC}, if it exists, should always be executable.
-SKIP: {
- skip "Needs Cygwin::win_to_posix_path()", 2 unless defined &Cygwin::win_to_posix_path;
-
- SKIP: {
- my $comspec = $ENV{COMSPEC};
- skip(q[$ENV{COMSPEC} does not exist], 1) unless $comspec;
-
- $comspec = Cygwin::win_to_posix_path($comspec);
-
- ok(MM->maybe_command($comspec), qq{'$comspec' should be executable"});
- }
-
- # 'C:/' should *never* be executable, it's a directory.
- {
- my $cdrive = Cygwin::win_to_posix_path("C:/");
-
- ok(!MM->maybe_command($cdrive), qq{'$cdrive' should never be executable});
- }
-}
-
-# Our copy of Perl (with a unix-path) should always be executable.
-ok(MM->maybe_command($Config{perlpath}), qq{'$Config{perlpath}' should be executable});
-
-
-package FakeOut;
-
-sub TIEHANDLE {
- bless(\(my $scalar), $_[0]);
-}
-
-sub PRINT {
- my $self = shift;
- $$self .= shift;
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/MM_NW5.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/MM_NW5.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/MM_NW5.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,302 +0,0 @@
-#!/usr/bin/perl
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-
-use Test::More;
-
-BEGIN {
- if ($^O =~ /NetWare/i) {
- plan tests => 39;
- } else {
- plan skip_all => 'This is not NW5';
- }
-}
-
-use Config;
-use File::Spec;
-use File::Basename;
-use ExtUtils::MM;
-
-require_ok( 'ExtUtils::MM_NW5' );
-
-# Dummy MM object until we have a real MM init method.
-my $MM = bless {
- DIR => [],
- NOECHO => '@',
- XS => {},
- MAKEFILE => 'Makefile',
- RM_RF => 'rm -rf',
- MV => 'mv',
- }, 'MM';
-
-
-# replace_manpage_separator() => tr|/|.|s ?
-{
- my $man = 'a/path/to//something';
- ( my $replaced = $man ) =~ tr|/|.|s;
- is( $MM->replace_manpage_separator( $man ),
- $replaced, 'replace_manpage_separator()' );
-}
-
-# maybe_command()
-SKIP: {
- skip( '$ENV{COMSPEC} not set', 2 )
- unless $ENV{COMSPEC} =~ m!((?:[a-z]:)?[^|<>]+)!i;
- my $comspec = $1;
- is( $MM->maybe_command( $comspec ),
- $comspec, 'COMSPEC is a maybe_command()' );
- ( my $comspec2 = $comspec ) =~ s|\..{3}$||;
- like( $MM->maybe_command( $comspec2 ),
- qr/\Q$comspec/i,
- 'maybe_command() without extension' );
-}
-
-my $had_pathext = exists $ENV{PATHEXT};
-{
- local $ENV{PATHEXT} = '.exe';
- ok( ! $MM->maybe_command( 'not_a_command.com' ),
- 'not a maybe_command()' );
-}
-# Bug in Perl. local $ENV{FOO} won't delete the key afterward.
-delete $ENV{PATHEXT} unless $had_pathext;
-
-# file_name_is_absolute() [Does not support UNC-paths]
-{
- ok( $MM->file_name_is_absolute( 'SYS:/' ),
- 'file_name_is_absolute()' );
- ok( ! $MM->file_name_is_absolute( 'some/path/' ),
- 'not file_name_is_absolute()' );
-
-}
-
-# find_perl()
-# Should be able to find running perl... $^X is OK on NW5
-{
- my $my_perl = $1 if $^X =~ /(.*)/; # are we in -T or -t?
- my( $perl, $path ) = fileparse( $my_perl );
- like( $MM->find_perl( $], [ $perl ], [ $path ] ),
- qr/^\Q$my_perl\E$/i, 'find_perl() finds this perl' );
-}
-
-# catdir() (calls MM_NW5->canonpath)
-{
- my @path_eg = qw( SYS trick dir/now_OK );
-
- is( $MM->catdir( @path_eg ),
- 'SYS\\trick\\dir\\now_OK', 'catdir()' );
- is( $MM->catdir( @path_eg ),
- File::Spec->catdir( @path_eg ),
- 'catdir() eq File::Spec->catdir()' );
-
-# catfile() (calls MM_NW5->catdir)
- push @path_eg, 'file.ext';
-
- is( $MM->catfile( @path_eg ),
- 'SYS\\trick\\dir\\now_OK\\file.ext', 'catfile()' );
-
- is( $MM->catfile( @path_eg ),
- File::Spec->catfile( @path_eg ),
- '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( {}, 'MM' );
- $mm_w32->init_others();
- my @keys = qw( TOUCH CHMOD CP RM_F RM_RF MV NOOP
- TEST_F LD AR LDLOADLIBS DEV_NULL );
- for my $key ( @keys ) {
- ok( $mm_w32->{ $key }, "init_others: $key" );
- }
-}
-
-# constants()
-{
- my $mm_w32 = bless {
- NAME => 'TestMM_NW5',
- VERSION => '1.00',
- VERSION_FROM => 'TestMM_NW5',
- PM => { 'MM_NW5.pm' => 1 },
- }, 'MM';
-
- # XXX Hack until we have a proper init method.
- # Flesh out some necessary keys in the MM object.
- foreach my $key (qw(XS C O_FILES H HTMLLIBPODS HTMLSCRIPTPODS
- MAN1PODS MAN3PODS PARENT_NAME)) {
- $mm_w32->{$key} = '';
- }
- my $s_PM = join( " \\\n\t", sort keys %{$mm_w32->{PM}} );
- my $k_PM = join( " \\\n\t", %{$mm_w32->{PM}} );
-
- like( $mm_w32->constants(),
- qr|^NAME\ =\ TestMM_NW5\s+VERSION\ =\ 1\.00.+
- MAKEMAKER\ =\ \Q$INC{'ExtUtils/MakeMaker.pm'}\E\s+
- MM_VERSION\ =\ \Q$ExtUtils::MakeMaker::VERSION\E.+
- VERSION_FROM\ =\ TestMM_NW5.+
- TO_INST_PM\ =\ \Q$s_PM\E\s+
- PM_TO_BLIB\ =\ \Q$k_PM\E
- |xs, 'constants()' );
-
-}
-
-# path()
-my $had_path = exists $ENV{PATH};
-{
- my @path_eg = ( qw( . .. ), 'SYS:\\Program Files' );
- local $ENV{PATH} = join ';', @path_eg;
- ok( eq_array( [ $MM->path() ], [ @path_eg ] ),
- 'path() [preset]' );
-}
-# Bug in Perl. local $ENV{FOO} will not delete key afterwards.
-delete $ENV{PATH} unless $had_path;
-
-# static_lib() should look into that
-# dynamic_bs() should look into that
-# dynamic_lib() should look into that
-
-# clean()
-{
- my $clean = $Config{cc} =~ /^gcc/i ? 'dll.base dll.exp' : '*.pdb';
- like( $MM->clean(), qr/^clean ::\s+\Q-$(RM_F) $clean\E\s+$/m,
- 'clean() Makefile target' );
-}
-
-
-# init_linker
-{
- my $libperl = $Config{libperl} || 'libperl.a';
- my $export = '$(BASEEXT).def';
- my $after = '';
- $MM->init_linker;
-
- is( $MM->{PERL_ARCHIVE}, $libperl, 'PERL_ARCHIVE' );
- is( $MM->{PERL_ARCHIVE_AFTER}, $after, 'PERL_ARCHIVE_AFTER' );
- is( $MM->{EXPORT_LIST}, $export, 'EXPORT_LIST' );
-}
-
-
-# canonpath()
-{
- my $path = 'SYS:/TEMP';
- is( $MM->canonpath( $path ), File::Spec->canonpath( $path ),
- 'canonpath() eq File::Spec->canonpath' );
-}
-
-# perl_script()
-my $script_ext = '';
-my $script_name = 'mm_w32tmp';
-SKIP: {
- local *SCRIPT;
- skip( "Can't create temp file: $!", 4 )
- unless open SCRIPT, "> $script_name";
- print SCRIPT <<'EOSCRIPT';
-#! perl
-__END__
-EOSCRIPT
- skip( "Can't write to temp file: $!", 4 )
- unless close SCRIPT;
- # now start tests:
- is( $MM->perl_script( $script_name ),
- "${script_name}$script_ext", "perl_script ($script_ext)" );
-
- skip( "Can't rename temp file: $!", 3 )
- unless rename $script_name, "${script_name}.pl";
- $script_ext = '.pl';
- is( $MM->perl_script( $script_name ),
- "${script_name}$script_ext", "perl_script ($script_ext)" );
-
- skip( "Can't rename temp file: $!", 2 )
- unless rename "${script_name}$script_ext", "${script_name}.bat";
- $script_ext = '.bat';
- is( $MM->perl_script( $script_name ),
- "${script_name}$script_ext", "perl_script ($script_ext)" );
-
- skip( "Can't rename temp file: $!", 1 )
- unless rename "${script_name}$script_ext", "${script_name}.noscript";
- $script_ext = '.noscript';
-
- isnt( $MM->perl_script( $script_name ),
- "${script_name}$script_ext",
- "not a perl_script anymore ($script_ext)" );
- is( $MM->perl_script( $script_name ), undef,
- "perl_script ($script_ext) returns empty" );
-}
-unlink "${script_name}$script_ext" if -f "${script_name}$script_ext";
-
-
-# pm_to_blib()
-{
- like( $MM->pm_to_blib(),
- qr/^pm_to_blib: \Q$(TO_INST_PM)\E.+\Q$(TOUCH) \E\$@\s+$/ms,
- 'pm_to_blib' );
-}
-
-# tool_autosplit()
-{
- my %attribs = ( MAXLEN => 255 );
- like( $MM->tool_autosplit( %attribs ),
- qr/^\#\ Usage:\ \$\(AUTOSPLITFILE\)
- \ FileToSplit\ AutoDirToSplitInto.+
- AUTOSPLITFILE\ =\ \$\(PERLRUN\)\ .+
- \$AutoSplit::Maxlen=$attribs{MAXLEN};
- /xms,
- 'tool_autosplit()' );
-}
-
-
-# xs_o() should look into that
-# top_targets() should look into that
-
-# dist_ci() should look into that
-# dist_core() should look into that
-
-# pasthru()
-{
- my $pastru = "PASTHRU = " . ($Config{make} =~ /^nmake/i ? "-nologo" : "");
- is( $MM->pasthru(), $pastru, 'pasthru()' );
-}
-
-package FakeOut;
-
-sub TIEHANDLE {
- bless(\(my $scalar), $_[0]);
-}
-
-sub PRINT {
- my $self = shift;
- $$self .= shift;
-}
-
-__END__
-
-=head1 NAME
-
-MM_NW5.t - Tests for ExtUtils::MM_NW5
-
-=head1 TODO
-
- - 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
-
-=head1 AUTHOR
-
-20011228 Abe Timmerman <abe at ztreet.demon.nl>
-
-=cut
Deleted: trunk/contrib/perl/lib/ExtUtils/t/MM_OS2.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/MM_OS2.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/MM_OS2.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,279 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = '../lib';
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use strict;
-use Test::More;
-if ($^O =~ /os2/i) {
- plan( tests => 32 );
-} else {
- plan( skip_all => "This is not OS/2" );
-}
-
-# for dlsyms, overridden in tests
-BEGIN {
- package ExtUtils::MM_OS2;
- use subs 'system', 'unlink';
-}
-
-# for maybe_command
-use File::Spec;
-
-use_ok( 'ExtUtils::MM_OS2' );
-ok( grep( 'ExtUtils::MM_OS2', @MM::ISA),
- 'ExtUtils::MM_OS2 should be parent of MM' );
-
-# dlsyms
-my $mm = bless({
- SKIPHASH => {
- dynamic => 1
- },
- NAME => 'foo:bar::',
-}, 'ExtUtils::MM_OS2');
-
-is( $mm->dlsyms(), '',
- 'dlsyms() should return nothing with dynamic flag set' );
-
-$mm->{BASEEXT} = 'baseext';
-delete $mm->{SKIPHASH};
-my $res = $mm->dlsyms();
-like( $res, qr/baseext\.def: Makefile/,
- '... without flag, should return make targets' );
-like( $res, qr/"DL_FUNCS" => { }/,
- '... should provide empty hash refs where necessary' );
-like( $res, qr/"DL_VARS" => \[]/, '... and empty array refs too' );
-
-$mm->{FUNCLIST} = 'funclist';
-$res = $mm->dlsyms( IMPORTS => 'imports' );
-like( $res, qr/"FUNCLIST" => .+funclist/,
- '... should pick up values from object' );
-like( $res, qr/"IMPORTS" => .+imports/, '... and allow parameter options too' );
-
-my $can_write;
-{
- local *OUT;
- $can_write = open(OUT, '>tmp_imp');
-}
-
-SKIP: {
- skip("Cannot write test files: $!", 7) unless $can_write;
-
- $mm->{IMPORTS} = { foo => 'bar' };
-
- local $@;
- eval { $mm->dlsyms() };
- like( $@, qr/Can.t mkdir tmp_imp/,
- '... should die if directory cannot be made' );
-
- unlink('tmp_imp') or skip("Cannot remove test file: $!", 9);
- eval { $mm->dlsyms() };
- like( $@, qr/Malformed IMPORT/, 'should die from malformed import symbols');
-
- $mm->{IMPORTS} = { foo => 'bar.baz' };
-
- my @sysfail = ( 1, 0, 1 );
- my ($sysargs, $unlinked);
-
- *ExtUtils::MM_OS2::system = sub {
- $sysargs = shift;
- return shift @sysfail;
- };
-
- *ExtUtils::MM_OS2::unlink = sub {
- $unlinked++;
- };
-
- eval { $mm->dlsyms() };
-
- like( $sysargs, qr/^emximp/, '... should try to call system() though' );
- like( $@, qr/Cannot make import library/,
- '... should die if emximp syscall fails' );
-
- # sysfail is 0 now, call emximp call should succeed
- eval { $mm->dlsyms() };
- is( $unlinked, 1, '... should attempt to unlink temp files' );
- like( $@, qr/Cannot extract import/,
- '... should die if other syscall fails' );
-
- # make both syscalls succeed
- @sysfail = (0, 0);
- local $@;
- eval { $mm->dlsyms() };
- is( $@, '', '... should not die if both syscalls succeed' );
-}
-
-# static_lib
-{
- my $called = 0;
-
- # avoid "used only once"
- local *ExtUtils::MM_Unix::static_lib;
- *ExtUtils::MM_Unix::static_lib = sub {
- $called++;
- return "\n\ncalled static_lib\n\nline2\nline3\n\nline4";
- };
-
- my $args = bless({ IMPORTS => {}, }, 'MM');
-
- # without IMPORTS as a populated hash, there will be no extra data
- my $ret = ExtUtils::MM_OS2::static_lib( $args );
- is( $called, 1, 'static_lib() should call parent method' );
- like( $ret, qr/^called static_lib/m,
- '... should return parent data unless IMPORTS exists' );
-
- $args->{IMPORTS} = { foo => 1};
- $ret = ExtUtils::MM_OS2::static_lib( $args );
- is( $called, 2, '... should call parent method if extra imports passed' );
- like( $ret, qr/^called static_lib\n\t\$\(AR\) \$\(AR_STATIC_ARGS\)/m,
- '... should append make tags to first line from parent method' );
- like( $ret, qr/\$@\n\n\nline2\nline3\n\nline4/m,
- '... should include remaining data from parent method' );
-
-}
-
-# replace_manpage_separator
-my $sep = '//a///b//c/de';
-is( ExtUtils::MM_OS2->replace_manpage_separator($sep), '.a.b.c.de',
- 'replace_manpage_separator() should turn multiple slashes into periods' );
-
-# maybe_command
-{
- local *DIR;
- my ($dir, $noext, $exe, $cmd);
- my $found = 0;
-
- my ($curdir, $updir) = (File::Spec->curdir, File::Spec->updir);
-
- # we need:
- # 1) a directory
- # 2) an executable file with no extension
- # 3) an executable file with the .exe extension
- # 4) an executable file with the .cmd extension
- # we assume there will be one somewhere in the path
- # in addition, we need them to be unique enough they do not trip
- # an earlier file test in maybe_command(). Portability.
-
- foreach my $path (split(/:/, $ENV{PATH})) {
- opendir(DIR, $path) or next;
- while (defined(my $file = readdir(DIR))) {
- next if $file eq $curdir or $file eq $updir;
- $file = File::Spec->catfile($path, $file);
- unless (defined $dir) {
- if (-d $file) {
- next if ( -x $file . '.exe' or -x $file . '.cmd' );
-
- $dir = $file;
- $found++;
- }
- }
- if (-x $file) {
- my $ext;
- if ($file =~ s/\.(exe|cmd)\z//) {
- $ext = $1;
-
- # skip executable files with names too similar
- next if -x $file;
- $file .= '.' . $ext;
-
- } else {
- unless (defined $noext) {
- $noext = $file;
- $found++;
- }
- next;
- }
-
- unless (defined $exe) {
- if ($ext eq 'exe') {
- $exe = $file;
- $found++;
- next;
- }
- }
- unless (defined $cmd) {
- if ($ext eq 'cmd') {
- $cmd = $file;
- $found++;
- next;
- }
- }
- }
- last if $found == 4;
- }
- last if $found == 4;
- }
-
- SKIP: {
- skip('No appropriate directory found', 1) unless defined $dir;
- is( ExtUtils::MM_OS2->maybe_command( $dir ), undef,
- 'maybe_command() should ignore directories' );
- }
-
- SKIP: {
- skip('No non-exension command found', 1) unless defined $noext;
- is( ExtUtils::MM_OS2->maybe_command( $noext ), $noext,
- 'maybe_command() should find executable lacking file extension' );
- }
-
- SKIP: {
- skip('No .exe command found', 1) unless defined $exe;
- (my $noexe = $exe) =~ s/\.exe\z//;
- is( ExtUtils::MM_OS2->maybe_command( $noexe ), $exe,
- 'maybe_command() should find .exe file lacking extension' );
- }
-
- SKIP: {
- skip('No .cmd command found', 1) unless defined $cmd;
- (my $nocmd = $cmd) =~ s/\.cmd\z//;
- is( ExtUtils::MM_OS2->maybe_command( $nocmd ), $cmd,
- 'maybe_command() should find .cmd file lacking extension' );
- }
-}
-
-# file_name_is_absolute
-ok( ExtUtils::MM_OS2->file_name_is_absolute( 's:/' ),
- 'file_name_is_absolute() should be true for paths with volume and slash' );
-ok( ExtUtils::MM_OS2->file_name_is_absolute( '\foo' ),
- '... and for paths with leading slash but no volume' );
-ok( ! ExtUtils::MM_OS2->file_name_is_absolute( 'arduk' ),
- '... but not for paths with no leading slash or volume' );
-
-
-$mm->init_linker;
-
-# PERL_ARCHIVE
-is( $mm->{PERL_ARCHIVE}, '$(PERL_INC)/libperl$(LIB_EXT)', 'PERL_ARCHIVE' );
-
-# PERL_ARCHIVE_AFTER
-{
- my $aout = 0;
- local *OS2::is_aout;
- *OS2::is_aout = \$aout;
-
- $mm->init_linker;
- isnt( $mm->{PERL_ARCHIVE_AFTER}, '',
- 'PERL_ARCHIVE_AFTER should be empty without $is_aout set' );
- $aout = 1;
- is( $mm->{PERL_ARCHIVE_AFTER},
- '$(PERL_INC)/libperl_override$(LIB_EXT)',
- '... and has libperl_override if it is set' );
-}
-
-# EXPORT_LIST
-is( $mm->{EXPORT_LIST}, '$(BASEEXT).def',
- 'EXPORT_LIST should add .def to BASEEXT member' );
-
-END {
- use File::Path;
- rmtree('tmp_imp');
- unlink 'tmpimp.imp';
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/MM_Unix.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/MM_Unix.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/MM_Unix.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,232 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = '../lib';
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-BEGIN {
- use Test::More;
-
- if( $^O =~ /^VMS|os2|MacOS|MSWin32|cygwin|beos|netware$/i ) {
- plan skip_all => 'Non-Unix platform';
- }
- else {
- plan tests => 110;
- }
-}
-
-BEGIN { use_ok( 'ExtUtils::MM_Unix' ); }
-
-use strict;
-use File::Spec;
-
-my $class = 'ExtUtils::MM_Unix';
-
-# only one of the following can be true
-# test should be removed if MM_Unix ever stops handling other OS than Unix
-my $os = ($ExtUtils::MM_Unix::Is{OS2} || 0)
- + ($ExtUtils::MM_Unix::Is{Win32} || 0)
- + ($ExtUtils::MM_Unix::Is{Dos} || 0)
- + ($ExtUtils::MM_Unix::Is{VMS} || 0);
-cmp_ok ( $os, '<=', 1, 'There can be only one (or none)');
-
-is($ExtUtils::MM_Unix::VERSION, $ExtUtils::MakeMaker::VERSION, 'MM_Unix has a $VERSION');
-
-# when the following calls like canonpath, catdir etc are replaced by
-# File::Spec calls, the test's become a bit pointless
-
-foreach ( qw( xx/ ./xx/ xx/././xx xx///xx) ) {
- is ($class->canonpath($_), File::Spec->canonpath($_), "canonpath $_");
-}
-
-is ($class->catdir('xx','xx'), File::Spec->catdir('xx','xx'),
- 'catdir(xx, xx) => xx/xx');
-is ($class->catfile('xx','xx','yy'), File::Spec->catfile('xx','xx','yy'),
- 'catfile(xx, xx) => xx/xx');
-
-is ($class->file_name_is_absolute('Bombdadil'),
- File::Spec->file_name_is_absolute('Bombdadil'),
- 'file_name_is_absolute()');
-
-is ($class->path(), File::Spec->path(), 'path() same as File::Spec->path()');
-
-foreach (qw/updir curdir rootdir/)
- {
- is ($class->$_(), File::Spec->$_(), $_ );
- }
-
-foreach ( qw /
- c_o
- clean
- const_cccmd
- const_config
- const_loadlibs
- constants
- depend
- dist
- dist_basics
- dist_ci
- dist_core
- distdir
- dist_test
- dlsyms
- dynamic
- dynamic_bs
- dynamic_lib
- exescan
- extliblist
- find_perl
- fixin
- force
- guess_name
- init_dirscan
- init_main
- init_others
- install
- installbin
- linkext
- lsdir
- macro
- makeaperl
- makefile
- manifypods
- needs_linking
- pasthru
- perldepend
- pm_to_blib
- ppd
- prefixify
- processPL
- quote_paren
- realclean
- static
- static_lib
- staticmake
- subdir_x
- subdirs
- test
- test_via_harness
- test_via_script
- tool_autosplit
- tool_xsubpp
- tools_other
- top_targets
- writedoc
- xs_c
- xs_cpp
- xs_o
- / )
- {
- can_ok($class, $_);
- }
-
-###############################################################################
-# some more detailed tests for the methods above
-
-ok ( join (' ', $class->dist_basics()), 'distclean :: realclean distcheck');
-
-###############################################################################
-# has_link_code tests
-
-my $t = bless { NAME => "Foo" }, $class;
-$t->{HAS_LINK_CODE} = 1;
-is ($t->has_link_code(),1,'has_link_code'); is ($t->{HAS_LINK_CODE},1);
-
-$t->{HAS_LINK_CODE} = 0;
-is ($t->has_link_code(),0); is ($t->{HAS_LINK_CODE},0);
-
-delete $t->{HAS_LINK_CODE}; delete $t->{OBJECT};
-is ($t->has_link_code(),0); is ($t->{HAS_LINK_CODE},0);
-
-delete $t->{HAS_LINK_CODE}; $t->{OBJECT} = 1;
-is ($t->has_link_code(),1); is ($t->{HAS_LINK_CODE},1);
-
-delete $t->{HAS_LINK_CODE}; delete $t->{OBJECT}; $t->{MYEXTLIB} = 1;
-is ($t->has_link_code(),1); is ($t->{HAS_LINK_CODE},1);
-
-delete $t->{HAS_LINK_CODE}; delete $t->{MYEXTLIB}; $t->{C} = [ 'Gloin' ];
-is ($t->has_link_code(),1); is ($t->{HAS_LINK_CODE},1);
-
-###############################################################################
-# libscan
-
-is ($t->libscan('foo/RCS/bar'), '', 'libscan on RCS');
-is ($t->libscan('CVS/bar/car'), '', 'libscan on CVS');
-is ($t->libscan('SCCS'), '', 'libscan on SCCS');
-is ($t->libscan('.svn/something'), '', 'libscan on Subversion');
-is ($t->libscan('foo/b~r'), 'foo/b~r', 'libscan on file with ~');
-is ($t->libscan('foo/RCS.pm'), 'foo/RCS.pm', 'libscan on file with RCS');
-
-is ($t->libscan('Fatty'), 'Fatty', 'libscan on something not a VC file' );
-
-###############################################################################
-# maybe_command
-
-open(FILE, ">command"); print FILE "foo"; close FILE;
-SKIP: {
- skip("no separate execute mode on VOS", 2) if $^O eq "vos";
-
- ok !$t->maybe_command('command') ,"non executable file isn't a command";
-
- chmod 0755, "command";
- ok ($t->maybe_command('command'), "executable file is a command");
-}
-unlink "command";
-
-
-###############################################################################
-# perl_script (on unix any ordinary, readable file)
-
-my $self_name = $ENV{PERL_CORE} ? '../lib/ExtUtils/t/MM_Unix.t'
- : 'MM_Unix.t';
-is ($t->perl_script($self_name),$self_name, 'we pass as a perl_script()');
-
-###############################################################################
-# PERM_RW and PERM_RWX
-
-$t->init_PERM;
-is ($t->{PERM_RW},'644', 'PERM_RW is 644');
-is ($t->{PERM_RWX},'755', 'PERM_RWX is 755');
-is ($t->{PERM_DIR},'755', 'PERM_DIR is 755');
-
-
-###############################################################################
-# post_constants, postamble, post_initialize
-
-foreach (qw/ post_constants postamble post_initialize/) {
- is ($t->$_(),'', "$_() is an empty string");
-}
-
-###############################################################################
-# replace_manpage_separator
-
-is ($t->replace_manpage_separator('Foo/Bar'),'Foo::Bar','manpage_separator');
-
-###############################################################################
-
-$t->init_linker;
-foreach (qw/ EXPORT_LIST PERL_ARCHIVE PERL_ARCHIVE_AFTER /)
-{
- ok( exists $t->{$_}, "$_ was defined" );
- is( $t->{$_}, '', "$_ is empty on Unix");
-}
-
-
-{
- $t->{CCFLAGS} = '-DMY_THING';
- $t->{LIBPERL_A} = 'libperl.a';
- $t->{LIB_EXT} = '.a';
- local $t->{NEEDS_LINKING} = 1;
- $t->cflags();
-
- # Brief bug where CCFLAGS was being blown away
- is( $t->{CCFLAGS}, '-DMY_THING', 'cflags retains CCFLAGS' );
-}
-
Deleted: trunk/contrib/perl/lib/ExtUtils/t/MM_VMS.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/MM_VMS.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/MM_VMS.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,76 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = '../lib';
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-BEGIN {
- @Methods = (qw(wraplist
- rootdir
- ext
- guess_name
- find_perl
- path
- maybe_command
- perl_script
- file_name_is_absolute
- replace_manpage_separator
- init_others
- constants
- cflags
- const_cccmd
- pm_to_blib
- tool_autosplit
- tool_xsubpp
- tools_other
- dist
- c_o
- xs_c
- xs_o
- top_targets
- dlsyms
- dynamic_lib
- dynamic_bs
- static_lib
- manifypods
- processPL
- installbin
- subdir_x
- clean
- realclean
- dist_basics
- dist_core
- distdir
- dist_test
- install
- perldepend
- makefile
- test
- test_via_harness
- test_via_script
- makeaperl
- ));
-}
-
-BEGIN {
- use Test::More;
- if ($^O eq 'VMS') {
- plan( tests => @Methods + 1 );
- }
- else {
- plan( skip_all => "This is not VMS" );
- }
-}
-
-use_ok( 'ExtUtils::MM_VMS' );
-
-foreach my $meth (@Methods) {
- can_ok( 'ExtUtils::MM_VMS', $meth);
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/MM_Win32.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/MM_Win32.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/MM_Win32.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,313 +0,0 @@
-#!/usr/bin/perl
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = '../lib';
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use strict;
-use Test::More;
-
-BEGIN {
- if ($^O =~ /MSWin32/i) {
- plan tests => 49;
- } else {
- plan skip_all => 'This is not Win32';
- }
-}
-
-use Config;
-use File::Spec;
-use File::Basename;
-use ExtUtils::MM;
-
-require_ok( 'ExtUtils::MM_Win32' );
-
-# Dummy MM object until we have a real MM init method.
-my $MM = bless {
- DIR => [],
- NOECHO => '@',
- XS => {},
- MAKEFILE => 'Makefile',
- RM_RF => 'rm -rf',
- MV => 'mv',
- MAKE => $Config{make}
- }, 'MM';
-
-
-# replace_manpage_separator() => tr|/|.|s ?
-{
- my $man = 'a/path/to//something';
- ( my $replaced = $man ) =~ tr|/|.|s;
- is( $MM->replace_manpage_separator( $man ),
- $replaced, 'replace_manpage_separator()' );
-}
-
-# maybe_command()
-SKIP: {
- skip( '$ENV{COMSPEC} not set', 2 )
- unless $ENV{COMSPEC} =~ m!((?:[a-z]:)?[^|<>]+)!i;
- my $comspec = $1;
- is( $MM->maybe_command( $comspec ),
- $comspec, 'COMSPEC is a maybe_command()' );
- ( my $comspec2 = $comspec ) =~ s|\..{3}$||;
- like( $MM->maybe_command( $comspec2 ),
- qr/\Q$comspec/i,
- 'maybe_command() without extension' );
-}
-
-my $had_pathext = exists $ENV{PATHEXT};
-{
- local $ENV{PATHEXT} = '.exe';
- ok( ! $MM->maybe_command( 'not_a_command.com' ),
- 'not a maybe_command()' );
-}
-# Bug in Perl. local $ENV{FOO} won't delete the key afterward.
-delete $ENV{PATHEXT} unless $had_pathext;
-
-# file_name_is_absolute() [Does not support UNC-paths]
-{
- ok( $MM->file_name_is_absolute( 'C:/' ),
- 'file_name_is_absolute()' );
- ok( ! $MM->file_name_is_absolute( 'some/path/' ),
- 'not file_name_is_absolute()' );
-
-}
-
-# find_perl()
-# Should be able to find running perl... $^X is OK on Win32
-{
- my $my_perl = $1 if $^X =~ /(.*)/; # are we in -T or -t?
- my( $perl, $path ) = fileparse( $my_perl );
- like( $MM->find_perl( $], [ $perl ], [ $path ], 0 ),
- qr/^\Q$my_perl\E$/i, 'find_perl() finds this perl' );
-}
-
-# catdir() (calls MM_Win32->canonpath)
-{
- my @path_eg = qw( c: trick dir/now_OK );
-
- is( $MM->catdir( @path_eg ),
- 'C:\\trick\\dir\\now_OK', 'catdir()' );
- is( $MM->catdir( @path_eg ),
- File::Spec->catdir( @path_eg ),
- 'catdir() eq File::Spec->catdir()' );
-
-# catfile() (calls MM_Win32->catdir)
- push @path_eg, 'file.ext';
-
- is( $MM->catfile( @path_eg ),
- 'C:\\trick\\dir\\now_OK\\file.ext', 'catfile()' );
-
- is( $MM->catfile( @path_eg ),
- File::Spec->catfile( @path_eg ),
- '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' );
- $mm_w32->init_others();
- my @keys = qw( TOUCH CHMOD CP RM_F RM_RF MV NOOP
- TEST_F LD AR LDLOADLIBS DEV_NULL );
- for my $key ( @keys ) {
- ok( $mm_w32->{ $key }, "init_others: $key" );
- }
-}
-
-# constants()
-# XXX this test is probably useless now that we can call individual
-# init_* methods and check the keys in $mm_w32 directly
-{
- my $mm_w32 = bless {
- NAME => 'TestMM_Win32',
- VERSION => '1.00',
- PM => { 'MM_Win32.pm' => 1 },
- }, 'MM';
-
- # XXX Hack until we have a proper init method.
- # Flesh out some necessary keys in the MM object.
- @{$mm_w32}{qw(XS MAN1PODS MAN3PODS)} = ({}) x 3;
- @{$mm_w32}{qw(C O_FILES H)} = ([]) x 3;
- @{$mm_w32}{qw(PARENT_NAME)} = ('') x 3;
- $mm_w32->{FULLEXT} = 'TestMM_Win32';
- $mm_w32->{BASEEXT} = 'TestMM_Win32';
-
- $mm_w32->init_VERSION;
- $mm_w32->init_linker;
- $mm_w32->init_INST;
- $mm_w32->init_xs;
-
- my $s_PM = join( " \\\n\t", sort keys %{$mm_w32->{PM}} );
- my $k_PM = join( " \\\n\t", %{$mm_w32->{PM}} );
-
- my $constants = $mm_w32->constants;
-
- foreach my $regex (
- qr|^NAME \s* = \s* TestMM_Win32 \s* $|xms,
- qr|^VERSION \s* = \s* 1\.00 \s* $|xms,
- qr|^MAKEMAKER \s* = \s* \Q$INC{'ExtUtils/MakeMaker.pm'}\E \s* $|xms,
- qr|^MM_VERSION \s* = \s* \Q$ExtUtils::MakeMaker::VERSION\E \s* $|xms,
- qr|^TO_INST_PM \s* = \s* \Q$s_PM\E \s* $|xms,
- qr|^PM_TO_BLIB \s* = \s* \Q$k_PM\E \s* $|xms,
- )
- {
- like( $constants, $regex, 'constants() check' );
- }
-}
-
-# path()
-{
- ok( eq_array( [ $MM->path() ], [ File::Spec->path ] ),
- 'path() [preset]' );
-}
-
-# static_lib() should look into that
-# dynamic_bs() should look into that
-# dynamic_lib() should look into that
-
-# init_linker
-{
- my $libperl = File::Spec->catfile('$(PERL_INC)',
- $Config{libperl} || 'libperl.a');
- my $export = '$(BASEEXT).def';
- my $after = '';
- $MM->init_linker;
-
- is( $MM->{PERL_ARCHIVE}, $libperl, 'PERL_ARCHIVE' );
- is( $MM->{PERL_ARCHIVE_AFTER}, $after, 'PERL_ARCHIVE_AFTER' );
- is( $MM->{EXPORT_LIST}, $export, 'EXPORT_LIST' );
-}
-
-# canonpath()
-{
- my $path = 'c:\\Program Files/SomeApp\\Progje.exe';
- is( $MM->canonpath( $path ), File::Spec->canonpath( $path ),
- 'canonpath() eq File::Spec->canonpath' );
-}
-
-# perl_script()
-my $script_ext = '';
-my $script_name = 'mm_w32tmp';
-SKIP: {
- local *SCRIPT;
- skip( "Can't create temp file: $!", 4 )
- unless open SCRIPT, "> $script_name";
- print SCRIPT <<'EOSCRIPT';
-#! perl
-__END__
-EOSCRIPT
- skip( "Can't write to temp file: $!", 4 )
- unless close SCRIPT;
- # now start tests:
- is( $MM->perl_script( $script_name ),
- "${script_name}$script_ext", "perl_script ($script_ext)" );
-
- skip( "Can't rename temp file: $!", 3 )
- unless rename $script_name, "${script_name}.pl";
- $script_ext = '.pl';
- is( $MM->perl_script( $script_name ),
- "${script_name}$script_ext", "perl_script ($script_ext)" );
-
- skip( "Can't rename temp file: $!", 2 )
- unless rename "${script_name}$script_ext", "${script_name}.bat";
- $script_ext = '.bat';
- is( $MM->perl_script( $script_name ),
- "${script_name}$script_ext", "perl_script ($script_ext)" );
-
- skip( "Can't rename temp file: $!", 1 )
- unless rename "${script_name}$script_ext", "${script_name}.noscript";
- $script_ext = '.noscript';
-
- isnt( $MM->perl_script( $script_name ),
- "${script_name}$script_ext",
- "not a perl_script anymore ($script_ext)" );
- is( $MM->perl_script( $script_name ), undef,
- "perl_script ($script_ext) returns empty" );
-}
-unlink "${script_name}$script_ext" if -f "${script_name}$script_ext";
-
-# is_make_type()
-{
- # Check for literal nmake
- 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' );
- }
-
- # 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' );
- }
-
- # 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' );
- }
-
- # 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' );
- }
-
-}
-
-# xs_o() should look into that
-# top_targets() should look into that
-
-# dist_ci() should look into that
-# dist_core() should look into that
-
-# pasthru()
-{
- my $pastru = "PASTHRU = " . ($Config{make} =~ /^nmake/i ? "-nologo" : "");
- is( $MM->pasthru(), $pastru, 'pasthru()' );
-}
-
-package FakeOut;
-
-sub TIEHANDLE {
- bless(\(my $scalar), $_[0]);
-}
-
-sub PRINT {
- my $self = shift;
- $$self .= shift;
-}
-
-__END__
-
-=head1 NAME
-
-MM_Win32.t - Tests for ExtUtils::MM_Win32
-
-=head1 TODO
-
- - 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
-
-=head1 AUTHOR
-
-20011228 Abe Timmerman <abe at ztreet.demon.nl>
-
-=cut
Deleted: trunk/contrib/perl/lib/ExtUtils/t/MakeMaker_Parameters.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/MakeMaker_Parameters.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/MakeMaker_Parameters.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,74 +0,0 @@
-#!/usr/bin/perl -w
-
-# Things like the CPAN shell rely on the "MakeMaker Parameters" section of the
-# Makefile to learn a module's dependencies so we'd damn well better test it.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use warnings;
-
-use ExtUtils::MakeMaker;
-use Test::More;
-
-my $mm = bless {}, "MM";
-
-sub extract_params {
- my $text = join "\n", @_;
-
- $text =~ s{^\s* \# \s+ MakeMaker\ Parameters: \s*\n}{}x;
- $text =~ s{^#}{}gms;
- $text =~ s{\n}{,\n}g;
-
- no strict 'subs';
- return { eval "$text" };
-}
-
-sub test_round_trip {
- my $args = shift;
- my $want = @_ ? shift : $args;
-
- my $have = extract_params($mm->_MakeMaker_Parameters_section($args));
-
- local $Test::Builder::Level = $Test::Builder::Level + 1;
- is_deeply $have, $want or diag explain $have, "\n", $want;
-}
-
-is join("", $mm->_MakeMaker_Parameters_section()), <<'EXPECT', "nothing";
-# MakeMaker Parameters:
-EXPECT
-
-test_round_trip({ NAME => "Foo" });
-test_round_trip({ NAME => "Foo", PREREQ_PM => { "Foo::Bar" => 0 } });
-test_round_trip({ NAME => "Foo", PREREQ_PM => { "Foo::Bar" => 1.23 } });
-
-# Test the special case for BUILD_REQUIRES
-{
- my $have = {
- NAME => "Foo",
- PREREQ_PM => { "Foo::Bar" => 1.23 },
- BUILD_REQUIRES => { "Baz" => 0.12 },
- };
-
- my $want = {
- NAME => "Foo",
- PREREQ_PM => {
- "Foo::Bar" => 1.23,
- "Baz" => 0.12,
- },
- BUILD_REQUIRES => { "Baz" => 0.12 },
- };
-
- test_round_trip( $have, $want );
-}
-
-done_testing();
-
Deleted: trunk/contrib/perl/lib/ExtUtils/t/Manifest.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/Manifest.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/Manifest.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,417 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use strict;
-
-use Test::More tests => 94;
-use Cwd;
-
-use File::Spec;
-use File::Path;
-use File::Find;
-use Config;
-
-my $Is_VMS = $^O eq 'VMS';
-my $Is_VMS_noefs = $Is_VMS;
-if ($Is_VMS) {
- my $vms_efs = 0;
- if (eval 'require VMS::Feature') {
- $vms_efs = VMS::Feature::current("efs_charset");
- } else {
- my $efs_charset = $ENV{'DECC$EFS_CHARSET'} || '';
- $vms_efs = $efs_charset =~ /^[ET1]/i;
- }
- $Is_VMS_noefs = 0 if $vms_efs;
-}
-
-
-# We're going to be chdir'ing and modules are sometimes loaded on the
-# fly in this test, so we need an absolute @INC.
- at INC = map { File::Spec->rel2abs($_) } @INC;
-
-# keep track of everything added so it can all be deleted
-my %Files;
-sub add_file {
- my ($file, $data) = @_;
- $data ||= 'foo';
- 1 while unlink $file; # or else we'll get multiple versions on VMS
- open( T, '> '.$file) or return;
- print T $data;
- close T;
- return 0 unless -e $file; # exists under the name we gave it ?
- ++$Files{$file};
-}
-
-sub read_manifest {
- open( M, 'MANIFEST' ) or return;
- chomp( my @files = <M> );
- close M;
- return @files;
-}
-
-sub catch_warning {
- my $warn = '';
- local $SIG{__WARN__} = sub { $warn .= $_[0] };
- return join('', $_[0]->() ), $warn;
-}
-
-sub remove_dir {
- ok( rmdir( $_ ), "remove $_ directory" ) for @_;
-}
-
-# use module, import functions
-BEGIN {
- use_ok( 'ExtUtils::Manifest',
- qw( mkmanifest manicheck filecheck fullcheck
- maniread manicopy skipcheck maniadd maniskip) );
-}
-
-my $cwd = Cwd::getcwd();
-
-# Just in case any old files were lying around.
-rmtree('mantest');
-
-ok( mkdir( 'mantest', 0777 ), 'make mantest directory' );
-ok( chdir( 'mantest' ), 'chdir() to mantest' );
-ok( add_file('foo'), 'add a temporary file' );
-
-# This ensures the -x check for manicopy means something
-# Some platforms don't have chmod or an executable bit, in which case
-# this call will do nothing or fail, but on the platforms where chmod()
-# works, we test the executable bit is copied
-chmod( 0744, 'foo') if $Config{'chmod'};
-
-# there shouldn't be a MANIFEST there
-my ($res, $warn) = catch_warning( \&mkmanifest );
-# Canonize the order.
-$warn = join("", map { "$_|" }
- sort { lc($a) cmp lc($b) } split /\r?\n/, $warn);
-is( $warn, "Added to MANIFEST: foo|Added to MANIFEST: MANIFEST|",
- "mkmanifest() displayed its additions" );
-
-# and now you see it
-ok( -e 'MANIFEST', 'create MANIFEST file' );
-
-my @list = read_manifest();
-is( @list, 2, 'check files in MANIFEST' );
-ok( ! ExtUtils::Manifest::filecheck(), 'no additional files in directory' );
-
-# after adding bar, the MANIFEST is out of date
-ok( add_file( 'bar' ), 'add another file' );
-ok( ! manicheck(), 'MANIFEST now out of sync' );
-
-# it reports that bar has been added and throws a warning
-($res, $warn) = catch_warning( \&filecheck );
-
-like( $warn, qr/^Not in MANIFEST: bar/, 'warning that bar has been added' );
-is( $res, 'bar', 'bar reported as new' );
-
-# now quiet the warning that bar was added and test again
-($res, $warn) = do { local $ExtUtils::Manifest::Quiet = 1;
- catch_warning( \&skipcheck )
- };
-is( $warn, '', 'disabled warnings' );
-
-# add a skip file with a rule to skip itself (and the nonexistent glob '*baz*')
-add_file( 'MANIFEST.SKIP', "baz\n.SKIP" );
-
-# this'll skip the new file
-($res, $warn) = catch_warning( \&skipcheck );
-like( $warn, qr/^Skipping MANIFEST\.SKIP/i, 'got skipping warning' );
-
-my @skipped;
-catch_warning( sub {
- @skipped = skipcheck()
-});
-
-is( join( ' ', @skipped ), 'MANIFEST.SKIP', 'listed skipped files' );
-
-{
- local $ExtUtils::Manifest::Quiet = 1;
- is( join(' ', filecheck() ), 'bar', 'listing skipped with filecheck()' );
-}
-
-# add a subdirectory and a file there that should be found
-ok( mkdir( 'moretest', 0777 ), 'created moretest directory' );
-add_file( File::Spec->catfile('moretest', 'quux'), 'quux' );
-ok( exists( ExtUtils::Manifest::manifind()->{'moretest/quux'} ),
- "manifind found moretest/quux" );
-
-# only MANIFEST and foo are in the manifest
-$_ = 'foo';
-my $files = maniread();
-is( keys %$files, 2, 'two files found' );
-is( join(' ', sort { lc($a) cmp lc($b) } keys %$files), 'foo MANIFEST',
- 'both files found' );
-is( $_, 'foo', q{maniread() doesn't clobber $_} );
-
-ok( mkdir( 'copy', 0777 ), 'made copy directory' );
-
-# Check that manicopy copies files.
-manicopy( $files, 'copy', 'cp' );
-my @copies = ();
-find( sub { push @copies, $_ if -f }, 'copy' );
- at copies = map { s/\.$//; $_ } @copies if $Is_VMS; # VMS likes to put dots on
- # the end of files.
-# Have to compare insensitively for non-case preserving VMS
-is_deeply( [sort map { lc } @copies], [sort map { lc } keys %$files] );
-
-# cp would leave files readonly, so check permissions.
-foreach my $orig (@copies) {
- my $copy = "copy/$orig";
- ok( -r $copy, "$copy: must be readable" );
- is( -w $copy, -w $orig, " writable if original was" );
- is( -x $copy, -x $orig, " executable if original was" );
-}
-rmtree('copy');
-
-
-# poison the manifest, and add a comment that should be reported
-add_file( 'MANIFEST', 'none #none' );
-is( ExtUtils::Manifest::maniread()->{none}, '#none',
- 'maniread found comment' );
-
-ok( mkdir( 'copy', 0777 ), 'made copy directory' );
-$files = maniread();
-eval { (undef, $warn) = catch_warning( sub {
- manicopy( $files, 'copy', 'cp' ) })
-};
-
-# a newline comes through, so get rid of it
-chomp($warn);
-# the copy should have given a warning
-like($warn, qr/^none not found/, 'carped about none' );
-($res, $warn) = catch_warning( \&skipcheck );
-like($warn, qr/^Skipping MANIFEST.SKIP/i, 'warned about MANIFEST.SKIP' );
-
-# tell ExtUtils::Manifest to use a different file
-{
- local $ExtUtils::Manifest::MANIFEST = 'albatross';
- ($res, $warn) = catch_warning( \&mkmanifest );
- like( $warn, qr/Added to albatross: /, 'using a new manifest file' );
-
- # add the new file to the list of files to be deleted
- $Files{'albatross'}++;
-}
-
-
-# Make sure MANIFEST.SKIP is using complete relative paths
-add_file( 'MANIFEST.SKIP' => "^moretest/q\n" );
-
-# This'll skip moretest/quux
-($res, $warn) = catch_warning( \&skipcheck );
-like( $warn, qr{^Skipping moretest/quux$}i, 'got skipping warning again' );
-
-
-# There was a bug where entries in MANIFEST would be blotted out
-# by MANIFEST.SKIP rules.
-add_file( 'MANIFEST.SKIP' => 'foo' );
-add_file( 'MANIFEST' => "foobar\n" );
-add_file( 'foobar' => '123' );
-($res, $warn) = catch_warning( \&manicheck );
-is( $res, '', 'MANIFEST overrides MANIFEST.SKIP' );
-is( $warn, '', 'MANIFEST overrides MANIFEST.SKIP, no warnings' );
-
-$files = maniread;
-ok( !$files->{wibble}, 'MANIFEST in good state' );
-maniadd({ wibble => undef });
-maniadd({ yarrow => "hock" });
-$files = maniread;
-is( $files->{wibble}, '', 'maniadd() with undef comment' );
-is( $files->{yarrow}, 'hock',' with comment' );
-is( $files->{foobar}, '', ' preserved old entries' );
-
-my %funky_files;
-# test including a filename with a space
-SKIP: {
- add_file( 'foo bar' => "space" )
- or skip "couldn't create spaced test file", 2;
- local $ExtUtils::Manifest::MANIFEST = "albatross";
- maniadd({ 'foo bar' => "contains space"});
- is( maniread()->{'foo bar'}, "contains space",
- 'spaced manifest filename' );
- add_file( 'albatross.bak', '' );
- ($res, $warn) = catch_warning( \&mkmanifest );
- like( $warn, qr/\A(Added to.*\n)+\z/m,
- 'no warnings about funky filename' );
- $funky_files{'space'} = 'foo bar';
-}
-
-# test including a filename with a space and a quote
-SKIP: {
- add_file( 'foo\' baz\'quux' => "quote" )
- or skip "couldn't create quoted test file", 1;
- local $ExtUtils::Manifest::MANIFEST = "albatross";
- maniadd({ 'foo\' baz\'quux' => "contains quote"});
- is( maniread()->{'foo\' baz\'quux'}, "contains quote",
- 'quoted manifest filename' );
- $funky_files{'space_quote'} = 'foo\' baz\'quux';
-}
-
-# test including a filename with a space and a backslash
-SKIP: {
- add_file( 'foo bar\\baz' => "backslash" )
- or skip "couldn't create backslash test file", 1;
- local $ExtUtils::Manifest::MANIFEST = "albatross";
- maniadd({ 'foo bar\\baz' => "contains backslash"});
- is( maniread()->{'foo bar\\baz'}, "contains backslash",
- 'backslashed manifest filename' );
- $funky_files{'space_backslash'} = 'foo bar\\baz';
-}
-
-# test including a filename with a space, quote, and a backslash
-SKIP: {
- add_file( 'foo bar\\baz\'quux' => "backslash/quote" )
- or skip "couldn't create backslash/quote test file", 1;
- local $ExtUtils::Manifest::MANIFEST = "albatross";
- maniadd({ 'foo bar\\baz\'quux' => "backslash and quote"});
- is( maniread()->{'foo bar\\baz\'quux'}, "backslash and quote",
- 'backslashed and quoted manifest filename' );
- $funky_files{'space_quote_backslash'} = 'foo bar\\baz\'quux';
-}
-
-my @funky_keys = qw(space space_quote space_backslash space_quote_backslash);
-# test including an external manifest.skip file in MANIFEST.SKIP
-{
- maniadd({ foo => undef , albatross => undef,
- 'mymanifest.skip' => undef, 'mydefault.skip' => undef});
- for (@funky_keys) {
- maniadd( {$funky_files{$_} => $_} ) if defined $funky_files{$_};
- }
-
- add_file('mymanifest.skip' => "^foo\n");
- add_file('mydefault.skip' => "^my\n");
- local $ExtUtils::Manifest::DEFAULT_MSKIP =
- File::Spec->catfile($cwd, qw(mantest mydefault.skip));
- my $skip = File::Spec->catfile($cwd, qw(mantest mymanifest.skip));
- add_file('MANIFEST.SKIP' =>
- "albatross\n#!include $skip\n#!include_default");
- my ($res, $warn) = catch_warning( \&skipcheck );
- for (qw(albatross foo foobar mymanifest.skip mydefault.skip)) {
- like( $warn, qr/Skipping \b$_\b/,
- "Skipping $_" );
- }
- for my $funky_key (@funky_keys) {
- SKIP: {
- my $funky_file = $funky_files{$funky_key};
- skip "'$funky_key' not created", 1 unless $funky_file;
- like( $warn, qr/Skipping \b\Q$funky_file\E\b/,
- "Skipping $funky_file");
- }
- }
- ($res, $warn) = catch_warning( \&mkmanifest );
- for (qw(albatross foo foobar mymanifest.skip mydefault.skip)) {
- like( $warn, qr/Removed from MANIFEST: \b$_\b/,
- "Removed $_ from MANIFEST" );
- }
- for my $funky_key (@funky_keys) {
- SKIP: {
- my $funky_file = $funky_files{$funky_key};
- skip "'$funky_key' not created", 1 unless $funky_file;
- like( $warn, qr/Removed from MANIFEST: \b\Q$funky_file\E\b/,
- "Removed $funky_file from MANIFEST");
- }
- }
- my $files = maniread;
- ok( ! exists $files->{albatross}, 'albatross excluded via MANIFEST.SKIP' );
- ok( exists $files->{yarrow}, 'yarrow included in MANIFEST' );
- ok( exists $files->{bar}, 'bar included in MANIFEST' );
- ok( ! exists $files->{foobar}, 'foobar excluded via mymanifest.skip' );
- ok( ! exists $files->{foo}, 'foo excluded via mymanifest.skip' );
- ok( ! exists $files->{'mymanifest.skip'},
- 'mymanifest.skip excluded via mydefault.skip' );
- ok( ! exists $files->{'mydefault.skip'},
- 'mydefault.skip excluded via mydefault.skip' );
-
- # test exclusion of funky files
- for my $funky_key (@funky_keys) {
- SKIP: {
- my $funky_file = $funky_files{$funky_key};
- skip "'$funky_key' not created", 1 unless $funky_file;
- ok( ! exists $files->{$funky_file},
- "'$funky_file' excluded via mymanifest.skip" );
- }
- }
-
- # tests for maniskip
- my $skipchk = maniskip();
- is ( $skipchk->('albatross'), 1,
- 'albatross excluded via MANIFEST.SKIP' );
- is( $skipchk->('yarrow'), '',
- 'yarrow included in MANIFEST' );
- is( $skipchk->('bar'), '',
- 'bar included in MANIFEST' );
- $skipchk = maniskip('mymanifest.skip');
- is( $skipchk->('foobar'), 1,
- 'foobar excluded via mymanifest.skip' );
- is( $skipchk->('foo'), 1,
- 'foo excluded via mymanifest.skip' );
- is( $skipchk->('mymanifest.skip'), '',
- 'mymanifest.skip included via mydefault.skip' );
- is( $skipchk->('mydefault.skip'), '',
- 'mydefault.skip included via mydefault.skip' );
- $skipchk = maniskip('mydefault.skip');
- is( $skipchk->('foobar'), '',
- 'foobar included via mydefault.skip' );
- is( $skipchk->('foo'), '',
- 'foo included via mydefault.skip' );
- is( $skipchk->('mymanifest.skip'), 1,
- 'mymanifest.skip excluded via mydefault.skip' );
- is( $skipchk->('mydefault.skip'), 1,
- 'mydefault.skip excluded via mydefault.skip' );
-
- my $extsep = $Is_VMS_noefs ? '_' : '.';
- $Files{"$_.bak"}++ for ('MANIFEST', "MANIFEST${extsep}SKIP");
-}
-
-add_file('MANIFEST' => 'Makefile.PL');
-maniadd({ foo => 'bar' });
-$files = maniread;
-# VMS downcases the MANIFEST. We normalize it here to match.
-%$files = map { (lc $_ => $files->{$_}) } keys %$files;
-my %expect = ( 'makefile.pl' => '',
- 'foo' => 'bar'
- );
-is_deeply( $files, \%expect, 'maniadd() vs MANIFEST without trailing newline');
-
-#add_file('MANIFEST' => 'Makefile.PL');
-#maniadd({ foo => 'bar' });
-
-SKIP: {
- chmod( 0400, 'MANIFEST' );
- skip "Can't make MANIFEST read-only", 2 if -w 'MANIFEST';
-
- eval {
- maniadd({ 'foo' => 'bar' });
- };
- is( $@, '', "maniadd() won't open MANIFEST if it doesn't need to" );
-
- eval {
- maniadd({ 'grrrwoof' => 'yippie' });
- };
- like( $@, qr/^\Qmaniadd() could not open MANIFEST:\E/,
- "maniadd() dies if it can't open the MANIFEST" );
-
- chmod( 0600, 'MANIFEST' );
-}
-
-
-END {
- is( unlink( keys %Files ), keys %Files, 'remove all added files' );
- remove_dir( 'moretest', 'copy' );
-
- # now get rid of the parent directory
- ok( chdir( $cwd ), 'return to parent directory' );
- remove_dir( 'mantest' );
-}
-
Deleted: trunk/contrib/perl/lib/ExtUtils/t/Mkbootstrap.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/Mkbootstrap.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/Mkbootstrap.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,155 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = ('../lib', 'lib/');
- }
- else {
- unshift @INC, 't/lib/';
- }
-}
-chdir 't';
-
-use vars qw( $required );
-use Test::More tests => 18;
-
-BEGIN { use_ok( 'ExtUtils::Mkbootstrap' ) }
-
-# Mkbootstrap makes a backup copy of "$_[0].bs" if it exists and is non-zero
-my $file_is_ready;
-local *OUT;
-if (open(OUT, '>mkboot.bs')) {
- $file_is_ready = 1;
- print OUT 'meaningless text';
- close OUT;
-}
-
-SKIP: {
- skip("could not make dummy .bs file: $!", 2) unless $file_is_ready;
-
- Mkbootstrap('mkboot');
- ok( -s 'mkboot.bso', 'Mkbootstrap should backup the .bs file' );
- local *IN;
- if (open(IN, 'mkboot.bso')) {
- chomp ($file_is_ready = <IN>);
- close IN;
- }
-
- is( $file_is_ready, 'meaningless text', 'backup should be a perfect copy' );
-}
-
-
-# if it doesn't exist or is zero bytes in size, it won't be backed up
-Mkbootstrap('fakeboot');
-ok( !( -f 'fakeboot.bso' ), 'Mkbootstrap should not backup an empty file' );
-
-use TieOut;
-my $out = tie *STDOUT, 'TieOut';
-
-# with $Verbose set, it should print status messages about libraries
-$ExtUtils::Mkbootstrap::Verbose = 1;
-Mkbootstrap('');
-is( $out->read, "\tbsloadlibs=\n", 'should report libraries in Verbose mode' );
-
-Mkbootstrap('', 'foo');
-like( $out->read, qr/bsloadlibs=foo/, 'should still report libraries' );
-
-
-# if ${_[0]}_BS exists, require it
-$file_is_ready = open(OUT, '>boot_BS');
-
-SKIP: {
- skip("cannot open boot_BS for writing: $!", 1) unless $file_is_ready;
-
- print OUT '$main::required = 1';
- close OUT;
- Mkbootstrap('boot');
-
- ok( $required, 'baseext_BS file should be require()d' );
-}
-
-
-# if there are any arguments, open a file named baseext.bs
-$file_is_ready = open(OUT, '>dasboot.bs');
-
-SKIP: {
- skip("cannot make dasboot.bs: $!", 5) unless $file_is_ready;
-
- # if it can't be opened for writing, we want to prove that it'll die
- close OUT;
- chmod 0444, 'dasboot.bs';
-
- SKIP: {
- skip("cannot write readonly files", 1) if -w 'dasboot.bs';
-
- eval{ Mkbootstrap('dasboot', 1) };
- like( $@, qr/Unable to open dasboot\.bs/, 'should die given bad filename' );
- }
-
- # now put it back like it was
- chmod 0777, 'dasboot.bs';
- eval{ Mkbootstrap('dasboot', 'myarg') };
- is( $@, '', 'should not die, given good filename' );
-
- # red and reed (a visual pun makes tests worth reading)
- my $read = $out->read();
- like( $read, qr/Writing dasboot.bs/, 'should print status' );
- like( $read, qr/containing: my/, 'should print verbose status on request' );
-
- # now be tricky, and set the status for the next skip block
- $file_is_ready = open(IN, 'dasboot.bs');
- ok( $file_is_ready, 'should have written a new .bs file' );
-}
-
-
-SKIP: {
- skip("cannot read .bs file: $!", 2) unless $file_is_ready;
-
- my $file = do { local $/ = <IN> };
-
- # filename should be in header
- like( $file, qr/# dasboot DynaLoader/, 'file should have boilerplate' );
-
- # should print arguments within this array
- like( $file, qr/qw\(myarg\);/, 'should have written array to file' );
-}
-
-
-# overwrite this file (may whack portability, but the name's too good to waste)
-$file_is_ready = open(OUT, '>dasboot.bs');
-
-SKIP: {
- skip("cannot make dasboot.bs again: $!", 1) unless $file_is_ready;
- close OUT;
-
- # if $DynaLoader::bscode is set, write its contents to the file
- local $DynaLoader::bscode;
- $DynaLoader::bscode = 'Wall';
- $ExtUtils::Mkbootstrap::Verbose = 0;
-
- # if arguments contain '-l' or '-L' or '-R' print dl_findfile message
- eval{ Mkbootstrap('dasboot', '-Larry') };
- is( $@, '', 'should be able to open a file again');
-
- $file_is_ready = open(IN, 'dasboot.bs');
-}
-
-SKIP: {
- skip("cannot open dasboot.bs for reading: $!", 3) unless $file_is_ready;
-
- my $file = do { local $/ = <IN> };
- is( $out->read, "Writing dasboot.bs\n", 'should hush without Verbose set' );
-
- # and find our hidden tribute to a fine example
- like( $file, qr/dl_findfile.+Larry/s, 'should load libraries if needed' );
- like( $file, qr/Wall\n1;\n/ms, 'should write $DynaLoader::bscode if set' );
-}
-
-close IN;
-close OUT;
-
-END {
- # clean things up, even on VMS
- 1 while unlink(qw( mkboot.bso boot_BS dasboot.bs .bs ));
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/PL_FILES.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/PL_FILES.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/PL_FILES.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,42 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use strict;
-use Test::More tests => 9;
-
-use File::Spec;
-use MakeMaker::Test::Setup::PL_FILES;
-use MakeMaker::Test::Utils;
-
-my $perl = which_perl();
-my $make = make_run();
-perl_lib();
-
-setup;
-
-END {
- ok( chdir File::Spec->updir );
- ok( teardown );
-}
-
-ok chdir('PL_FILES-Module');
-
-run(qq{$perl Makefile.PL});
-cmp_ok( $?, '==', 0 );
-
-my $make_out = run("$make");
-is( $?, 0 ) || diag $make_out;
-
-foreach my $file (qw(single.out 1.out 2.out blib/lib/PL/Bar.pm)) {
- ok( -e $file, "$file was created" );
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/Packlist.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/Packlist.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/Packlist.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,174 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = '../lib';
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use Test::More tests => 34;
-
-use_ok( 'ExtUtils::Packlist' );
-
-is( ref(ExtUtils::Packlist::mkfh()), 'GLOB', 'mkfh() should return a FH' );
-
-# new calls tie()
-my $pl = ExtUtils::Packlist->new();
-isa_ok( $pl, 'ExtUtils::Packlist' );
-is( ref tied %$pl, 'ExtUtils::Packlist', 'obj should be tied underneath' );
-
-
-$pl = ExtUtils::Packlist::TIEHASH( 'tieclass', 'packfile' );
-is( ref($pl), 'tieclass', 'TIEHASH() should bless into class' );
-is( $pl->{packfile}, 'packfile', 'TIEHASH() should store packfile name' );
-
-
-ExtUtils::Packlist::STORE($pl, 'key', 'value');
-is( $pl->{data}{key}, 'value', 'STORE() should stuff stuff in data member' );
-
-
-$pl->{data}{foo} = 'bar';
-is( ExtUtils::Packlist::FETCH($pl, 'foo'), 'bar', 'check FETCH()' );
-
-
-# test FIRSTKEY and NEXTKEY
-SKIP: {
- $pl->{data}{bar} = 'baz';
- skip('not enough keys to test FIRSTKEY', 2)
- unless keys %{ $pl->{data} } > 2;
-
- # get the first and second key
- my ($first, $second) = keys %{ $pl->{data} };
-
- # now get a couple of extra keys, to mess with the hash iterator
- my $i = 0;
- for (keys %{ $pl->{data} } ) {
- last if $i++;
- }
-
- # finally, see if it really can get the first key again
- is( ExtUtils::Packlist::FIRSTKEY($pl), $first,
- 'FIRSTKEY() should be consistent' );
-
- is( ExtUtils::Packlist::NEXTKEY($pl), $second,
- 'and NEXTKEY() should also be consistent' );
-}
-
-
-ok( ExtUtils::Packlist::EXISTS($pl, 'bar'), 'EXISTS() should find keys' );
-
-
-ExtUtils::Packlist::DELETE($pl, 'bar');
-ok( !(exists $pl->{data}{bar}), 'DELETE() should delete cleanly' );
-
-
-ExtUtils::Packlist::CLEAR($pl);
-is( keys %{ $pl->{data} }, 0, 'CLEAR() should wipe out data' );
-
-
-# DESTROY does nothing...
-can_ok( 'ExtUtils::Packlist', 'DESTROY' );
-
-
-# write is a little more complicated
-eval { ExtUtils::Packlist::write({}) };
-like( $@, qr/No packlist filename/, 'write() should croak without packfile' );
-
-eval { ExtUtils::Packlist::write({}, 'eplist') };
-my $file_is_ready = $@ ? 0 : 1;
-ok( $file_is_ready, 'write() can write a file' );
-
-local *IN;
-
-SKIP: {
- skip('cannot write files, some tests difficult', 3) unless $file_is_ready;
-
- # set this file to read-only
- chmod 0444, 'eplist';
-
- SKIP: {
- skip("cannot write readonly files", 1) if -w 'eplist';
-
- eval { ExtUtils::Packlist::write({}, 'eplist') };
- like( $@, qr/Can't open file/, 'write() should croak on open failure' );
- }
-
- #'now set it back (tick here fixes vim syntax highlighting ;)
- chmod 0777, 'eplist';
-
- # and some test data to be read
- $pl->{data} = {
- single => 1,
- hash => {
- foo => 'bar',
- baz => 'bup',
- },
- '/./abc' => '',
- };
- eval { ExtUtils::Packlist::write($pl, 'eplist') };
- is( $@, '', 'write() should normally succeed' );
- is( $pl->{packfile}, 'eplist', 'write() should set packfile name' );
-
- $file_is_ready = open(IN, 'eplist');
-}
-
-
-eval { ExtUtils::Packlist::read({}) };
-like( $@, qr/^No packlist filename/, 'read() should croak without packfile' );
-
-
-eval { ExtUtils::Packlist::read({}, 'abadfilename') };
-like( $@, qr/^Can't open file/, 'read() should croak with bad packfile name' );
-#'open packfile for reading
-
-
-# and more read() tests
-SKIP: {
- skip("cannot open file for reading: $!", 5) unless $file_is_ready;
- my $file = do { local $/ = <IN> };
-
- like( $file, qr/single\n/, 'key with value should be available' );
- like( $file, qr!/\./abc\n!, 'key with no value should also be present' );
- like( $file, qr/hash.+baz=bup/, 'key with hash value should be present' );
- like( $file, qr/hash.+foo=bar/, 'second embedded hash value should appear');
- close IN;
-
- eval{ ExtUtils::Packlist::read($pl, 'eplist') };
- is( $@, '', 'read() should normally succeed' );
- is( $pl->{data}{single}, undef, 'single keys should have undef value' );
- is( ref($pl->{data}{hash}), 'HASH', 'multivalue keys should become hashes');
-
- is( $pl->{data}{hash}{foo}, 'bar', 'hash values should be set' );
- ok( exists $pl->{data}{'/abc'}, 'read() should resolve /./ to / in keys' );
-
- # give validate a valid and an invalid file to find
- $pl->{data} = {
- eplist => 1,
- fake => undef,
- };
-
- is( ExtUtils::Packlist::validate($pl), 1,
- 'validate() should find missing files' );
- ExtUtils::Packlist::validate($pl, 1);
- ok( !exists $pl->{data}{fake},
- 'validate() should remove missing files when prompted' );
-
- # one more new() test, to see if it calls read() successfully
- $pl = ExtUtils::Packlist->new('eplist');
-}
-
-
-# packlist_file, $pl should be set from write test
-is( ExtUtils::Packlist::packlist_file({ packfile => 'pl' }), 'pl',
- 'packlist_file() should fetch packlist from passed hash' );
-is( ExtUtils::Packlist::packlist_file($pl), 'eplist',
- 'packlist_file() should fetch packlist from ExtUtils::Packlist object' );
-
-END {
- 1 while unlink qw( eplist );
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/VERSION_FROM.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/VERSION_FROM.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/VERSION_FROM.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,39 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-chdir 't';
-
-use strict;
-use Test::More tests => 1;
-use MakeMaker::Test::Utils;
-use ExtUtils::MakeMaker;
-use TieOut;
-use File::Path;
-
-perl_lib();
-
-mkdir('Odd-Version', 0777);
-END { chdir File::Spec->updir; rmtree 'Odd-Version' }
-chdir 'Odd-Version';
-
-open(MPL, ">Version") || die $!;
-print MPL "\$VERSION = 0\n";
-close MPL;
-END { unlink 'Version' }
-
-my $stdout = tie *STDOUT, 'TieOut' or die;
-my $mm = WriteMakefile(
- NAME => 'Version',
- VERSION_FROM => 'Version'
-);
-
-is( $mm->{VERSION}, 0, 'VERSION_FROM when $VERSION = 0' );
Deleted: trunk/contrib/perl/lib/ExtUtils/t/WriteEmptyMakefile.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/WriteEmptyMakefile.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/WriteEmptyMakefile.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,40 +0,0 @@
-#!/usr/bin/perl -w
-
-# This is a test of WriteEmptyMakefile.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-chdir 't';
-
-use strict;
-use Test::More tests => 5;
-
-use ExtUtils::MakeMaker qw(WriteEmptyMakefile);
-use TieOut;
-
-can_ok __PACKAGE__, 'WriteEmptyMakefile';
-
-eval { WriteEmptyMakefile("something"); };
-like $@, qr/Need an even number of args/;
-
-
-{
- ok( my $stdout = tie *STDOUT, 'TieOut' );
-
- ok !-e 'wibble';
- END { 1 while unlink 'wibble' }
-
- WriteEmptyMakefile(
- NAME => "Foo",
- FIRST_MAKEFILE => "wibble",
- );
- ok -e 'wibble';
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/arch_check.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/arch_check.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/arch_check.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,89 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if ($ENV{PERL_CORE}) {
- chdir 't' if -d 't';
- @INC = qw(../lib lib);
- }
-}
-
-use strict;
-use lib 't/lib';
-
-use TieOut;
-use Test::More 'no_plan';
-
-use Config;
-use ExtUtils::MakeMaker;
-
-ok( my $stdout = tie *STDOUT, 'TieOut' );
-
-# Create a normalized MM object to test with
-my $mm = bless {}, "MM";
-$mm->{PERL_SRC} = 0;
-$mm->{UNINSTALLED_PERL} = 0;
-
-my $rel2abs = sub { $mm->rel2abs($mm->catfile(@_)) };
-
-ok $mm->arch_check(
- $rel2abs->(qw(. t testdata reallylongdirectoryname arch1 Config.pm)),
- $rel2abs->(qw(. t testdata reallylongdirectoryname arch1 Config.pm)),
-);
-
-
-# Different architecures.
-{
- ok !$mm->arch_check(
- $rel2abs->(qw(. t testdata reallylongdirectoryname arch1 Config.pm)),
- $rel2abs->(qw(. t testdata reallylongdirectoryname arch2 Config.pm)),
- );
-
- like $stdout->read, qr{\Q
-Your perl and your Config.pm seem to have different ideas about the
-architecture they are running on.
-Perl thinks: [arch1]
-Config says: [$Config{archname}]
-This may or may not cause problems. Please check your installation of perl
-if you have problems building this extension.
-};
-
-}
-
-
-# Different file path separators [rt.cpan.org 46416]
-SKIP: {
- require File::Spec;
- skip "Win32 test", 1 unless File::Spec->isa("File::Spec::Win32");
-
- ok $mm->arch_check(
- "/_64/perl1004/lib/Config.pm",
- '\\_64\\perl1004\\lib\\Config.pm',
- );
-}
-
-
-# PERL_SRC is set, no check is done
-{
- # Clear our log
- $stdout->read;
-
- local $mm->{PERL_SRC} = 1;
- ok $mm->arch_check(
- $rel2abs->(qw(. t testdata reallylongdirectoryname arch1 Config.pm)),
- $rel2abs->(qw(. t testdata reallylongdirectoryname arch2 Config.pm)),
- );
-
- is $stdout->read, '';
-}
-
-
-# UNINSTALLED_PERL is set, no message is sent
-{
- local $mm->{UNINSTALLED_PERL} = 1;
- ok !$mm->arch_check(
- $rel2abs->(qw(. t testdata reallylongdirectoryname arch1 Config.pm)),
- $rel2abs->(qw(. t testdata reallylongdirectoryname arch2 Config.pm)),
- );
-
- like $stdout->read, qr{^Have .*\nWant .*$};
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/backwards.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/backwards.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/backwards.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,25 +0,0 @@
-#!/usr/bin/perl -w
-
-# This is a test for all the odd little backwards compatible things
-# MakeMaker has to support. And we do mean backwards.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 2;
-
-require ExtUtils::MakeMaker;
-
-# CPAN.pm wants MM.
-can_ok('MM', 'new');
-
-# Pre 5.8 ExtUtils::Embed wants MY.
-can_ok('MY', 'catdir');
Deleted: trunk/contrib/perl/lib/ExtUtils/t/basic.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/basic.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/basic.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,325 +0,0 @@
-#!/usr/bin/perl -w
-
-# This test puts MakeMaker through the paces of a basic perl module
-# build, test and installation of the Big::Fat::Dummy module.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Config;
-use ExtUtils::MakeMaker;
-
-use Test::More tests => 79;
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::BFD;
-use File::Find;
-use File::Spec;
-use File::Path;
-
-my $perl = which_perl();
-my $Is_VMS = $^O eq 'VMS';
-
-chdir 't';
-
-perl_lib;
-
-my $Touch_Time = calibrate_mtime();
-
-$| = 1;
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
- diag("chdir failed: $!");
-
-my @mpl_out = run(qq{$perl Makefile.PL "PREFIX=../dummy-install"});
-END { rmtree '../dummy-install'; }
-
-cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
- diag(@mpl_out);
-
-my $makefile = makefile_name();
-ok( grep(/^Writing $makefile for Big::Dummy/,
- @mpl_out) == 1,
- 'Makefile.PL output looks right');
-
-ok( grep(/^Current package is: main$/,
- @mpl_out) == 1,
- 'Makefile.PL run in package main');
-
-ok( -e $makefile, 'Makefile exists' );
-
-# -M is flakey on VMS
-my $mtime = (stat($makefile))[9];
-cmp_ok( $Touch_Time, '<=', $mtime, ' its been touched' );
-
-END { unlink makefile_name(), makefile_backup() }
-
-my $make = make_run();
-
-{
- # Supress 'make manifest' noise
- local $ENV{PERL_MM_MANIFEST_VERBOSE} = 0;
- my $manifest_out = run("$make manifest");
- ok( -e 'MANIFEST', 'make manifest created a MANIFEST' );
- ok( -s 'MANIFEST', ' its not empty' );
-}
-
-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' );
-my $ppd_html;
-{ local $/; $ppd_html = <PPD> }
-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,
- ' <ABSTRACT>');
-like( $ppd_html,
- qr{^\s*<AUTHOR>Michael G Schwern <schwern\@pobox.com></AUTHOR>}m,
- ' <AUTHOR>' );
-like( $ppd_html, qr{^\s*<IMPLEMENTATION>}m, ' <IMPLEMENTATION>');
-like( $ppd_html, qr{^\s*<REQUIRE NAME="strict::" />}m, ' <REQUIRE>' );
-
-my $archname = $Config{archname};
-if( $] >= 5.008 ) {
- # XXX This is a copy of the internal logic, so it's not a great test
- $archname .= "-$Config{PERL_REVISION}.$Config{PERL_VERSION}";
-}
-like( $ppd_html, qr{^\s*<ARCHITECTURE NAME="$archname" />}m,
- ' <ARCHITECTURE>');
-like( $ppd_html, qr{^\s*<CODEBASE HREF="" />}m, ' <CODEBASE>');
-like( $ppd_html, qr{^\s*</IMPLEMENTATION>}m, ' </IMPLEMENTATION>');
-like( $ppd_html, qr{^\s*</SOFTPKG>}m, ' </SOFTPKG>');
-END { unlink 'Big-Dummy.ppd' }
-
-
-my $test_out = run("$make test");
-like( $test_out, qr/All tests successful/, 'make test' );
-is( $?, 0, ' exited normally' ) ||
- diag $test_out;
-
-# Test 'make test TEST_VERBOSE=1'
-my $make_test_verbose = make_macro($make, 'test', TEST_VERBOSE => 1);
-$test_out = run("$make_test_verbose");
-like( $test_out, qr/ok \d+ - TEST_VERBOSE/, 'TEST_VERBOSE' );
-like( $test_out, qr/All tests successful/, ' successful' );
-is( $?, 0, ' exited normally' ) ||
- diag $test_out;
-
-
-my $install_out = run("$make install");
-is( $?, 0, 'install' ) || diag $install_out;
-like( $install_out, qr/^Installing /m );
-
-ok( -r '../dummy-install', ' install dir created' );
-my %files = ();
-find( sub {
- # do it case-insensitive for non-case preserving OSs
- my $file = lc $_;
-
- # VMS likes to put dots on the end of things that don't have them.
- $file =~ s/\.$// if $Is_VMS;
-
- $files{$file} = $File::Find::name;
-}, '../dummy-install' );
-ok( $files{'dummy.pm'}, ' Dummy.pm installed' );
-ok( $files{'liar.pm'}, ' Liar.pm installed' );
-ok( $files{'program'}, ' program installed' );
-ok( $files{'.packlist'}, ' packlist created' );
-ok( $files{'perllocal.pod'},' perllocal.pod created' );
-
-
-SKIP: {
- skip 'VMS install targets do not preserve $(PREFIX)', 8 if $Is_VMS;
-
- $install_out = run("$make install PREFIX=elsewhere");
- is( $?, 0, 'install with PREFIX override' ) || diag $install_out;
- like( $install_out, qr/^Installing /m );
-
- ok( -r 'elsewhere', ' install dir created' );
- %files = ();
- find( sub { $files{$_} = $File::Find::name; }, 'elsewhere' );
- ok( $files{'Dummy.pm'}, ' Dummy.pm installed' );
- ok( $files{'Liar.pm'}, ' Liar.pm installed' );
- ok( $files{'program'}, ' program installed' );
- ok( $files{'.packlist'}, ' packlist created' );
- ok( $files{'perllocal.pod'},' perllocal.pod created' );
- rmtree('elsewhere');
-}
-
-
-SKIP: {
- skip 'VMS install targets do not preserve $(DESTDIR)', 10 if $Is_VMS;
-
- $install_out = run("$make install PREFIX= DESTDIR=other");
- is( $?, 0, 'install with DESTDIR' ) ||
- diag $install_out;
- like( $install_out, qr/^Installing /m );
-
- ok( -d 'other', ' destdir created' );
- %files = ();
- my $perllocal;
- find( sub {
- $files{$_} = $File::Find::name;
- }, 'other' );
- ok( $files{'Dummy.pm'}, ' Dummy.pm installed' );
- ok( $files{'Liar.pm'}, ' Liar.pm installed' );
- ok( $files{'program'}, ' program installed' );
- ok( $files{'.packlist'}, ' packlist created' );
- ok( $files{'perllocal.pod'},' perllocal.pod created' );
-
- ok( open(PERLLOCAL, $files{'perllocal.pod'} ) ) ||
- diag("Can't open $files{'perllocal.pod'}: $!");
- { local $/;
- unlike(<PERLLOCAL>, qr/other/, 'DESTDIR should not appear in perllocal');
- }
- close PERLLOCAL;
-
-# TODO not available in the min version of Test::Harness we require
-# ok( open(PACKLIST, $files{'.packlist'} ) ) ||
-# diag("Can't open $files{'.packlist'}: $!");
-# { local $/;
-# local $TODO = 'DESTDIR still in .packlist';
-# unlike(<PACKLIST>, qr/other/, 'DESTDIR should not appear in .packlist');
-# }
-# close PACKLIST;
-
- rmtree('other');
-}
-
-
-SKIP: {
- skip 'VMS install targets do not preserve $(PREFIX)', 9 if $Is_VMS;
-
- $install_out = run("$make install PREFIX=elsewhere DESTDIR=other/");
- is( $?, 0, 'install with PREFIX override and DESTDIR' ) ||
- diag $install_out;
- like( $install_out, qr/^Installing /m );
-
- ok( !-d 'elsewhere', ' install dir not created' );
- ok( -d 'other/elsewhere', ' destdir created' );
- %files = ();
- find( sub { $files{$_} = $File::Find::name; }, 'other/elsewhere' );
- ok( $files{'Dummy.pm'}, ' Dummy.pm installed' );
- ok( $files{'Liar.pm'}, ' Liar.pm installed' );
- ok( $files{'program'}, ' program installed' );
- ok( $files{'.packlist'}, ' packlist created' );
- ok( $files{'perllocal.pod'},' perllocal.pod created' );
- rmtree('other');
-}
-
-
-my $dist_test_out = run("$make disttest");
-is( $?, 0, 'disttest' ) || diag($dist_test_out);
-
-# Test META.yml generation
-use ExtUtils::Manifest qw(maniread);
-
-my $distdir = 'Big-Dummy-0.01';
-$distdir =~ s/\./_/g if $Is_VMS;
-my $meta_yml = "$distdir/META.yml";
-
-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);
-}
-
-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:
- ExtUtils::MakeMaker: 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' );
- at 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
- at mpl_out = run(qq{$perl Makefile.PL "PREFIX=../dummy-install"});
-
-cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out);
-
-ok( grep(/^Writing $makefile for Big::Dummy/, @mpl_out) == 1,
- 'init_dirscan skipped distdir') ||
- diag(@mpl_out);
-
-# I know we'll get ignored errors from make here, that's ok.
-# Send STDERR off to oblivion.
-open(SAVERR, ">&STDERR") or die $!;
-open(STDERR, ">",File::Spec->devnull) or die $!;
-
-my $realclean_out = run("$make realclean");
-is( $?, 0, 'realclean' ) || diag($realclean_out);
-
-open(STDERR, ">&SAVERR") or die $!;
-close SAVERR;
-
-
-sub _normalize {
- my $hash = shift;
-
- while(my($k,$v) = each %$hash) {
- delete $hash->{$k};
- $hash->{lc $k} = $v;
- }
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/build_man.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/build_man.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/build_man.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,86 +0,0 @@
-#!/usr/bin/perl -w
-
-# Test if MakeMaker declines to build man pages under the right conditions.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 9;
-
-use File::Spec;
-use TieOut;
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::BFD;
-
-use ExtUtils::MakeMaker;
-use ExtUtils::MakeMaker::Config;
-
-# Simulate an installation which has man page generation turned off to
-# ensure these tests will still work.
-$Config{installman3dir} = 'none';
-
-chdir 't';
-
-perl_lib();
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
- diag("chdir failed: $!");
-
-ok( my $stdout = tie *STDOUT, 'TieOut' );
-
-{
- local $Config{installman3dir} = File::Spec->catdir(qw(t lib));
-
- my $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- );
-
- ok( keys %{ $mm->{MAN3PODS} } );
-}
-
-{
- my $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- INSTALLMAN3DIR => 'none'
- );
-
- is_deeply( $mm->{MAN3PODS}, {} );
-}
-
-
-{
- my $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- MAN3PODS => {}
- );
-
- is_deeply( $mm->{MAN3PODS}, { } );
-}
-
-
-{
- my $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- MAN3PODS => { "Foo.pm" => "Foo.1" }
- );
-
- is_deeply( $mm->{MAN3PODS}, { "Foo.pm" => "Foo.1" } );
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/bytes.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/bytes.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/bytes.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,30 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 4;
-
-use_ok('ExtUtils::MakeMaker::bytes');
-
-SKIP: {
- skip "bytes.pm appeared in 5.6", 3 if $] < 5.006;
-
- my $chr = chr(400);
- is( length $chr, 1 );
-
- {
- use ExtUtils::MakeMaker::bytes;
- is( length $chr, 2, 'byte.pm in effect' );
- }
-
- is( length $chr, 1, ' score is lexical' );
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/can_write_dir.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/can_write_dir.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/can_write_dir.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,61 +0,0 @@
-#!/usr/bin/perl -w
-
-# Test the private _can_write_dir() function.
-
-use strict;
-use ExtUtils::Install;
-use File::Spec;
-{ package FS; our @ISA = qw(File::Spec); }
-
-# Alias it for easier access
-*can_write_dir = \&ExtUtils::Install::_can_write_dir;
-
-use Test::More 'no_plan';
-
-
-my $dne = FS->catdir(qw(does not exist));
-ok ! -e $dne;
-is_deeply [can_write_dir($dne)],
- [1,
- FS->curdir,
- FS->catdir('does'),
- FS->catdir('does', 'not'),
- FS->catdir('does', 'not', 'exist')
- ];
-
-
-my $abs_dne = FS->rel2abs($dne);
-ok ! -e $abs_dne;
-is_deeply [can_write_dir($abs_dne)],
- [1,
- FS->rel2abs(FS->curdir),
- FS->rel2abs(FS->catdir('does')),
- FS->rel2abs(FS->catdir('does', 'not')),
- FS->rel2abs(FS->catdir('does', 'not', 'exist')),
- ];
-
-SKIP: {
- my $exists = FS->catdir(qw(exists));
- my $subdir = FS->catdir(qw(exists subdir));
-
-
- ok mkdir $exists;
- END { rmdir $exists }
-
- ok chmod 0555, $exists, 'make read only';
-
- skip "Current user or OS cannot create directories that they cannot read", 6
- if -w $exists; # these tests require a directory we cant read
-
- is_deeply [can_write_dir($exists)], [0, $exists];
- is_deeply [can_write_dir($subdir)], [0, $exists, $subdir];
-
- ok chmod 0777, $exists, 'make writable';
- ok -w $exists;
- is_deeply [can_write_dir($exists)], [1, $exists];
- is_deeply [can_write_dir($subdir)],
- [1,
- $exists,
- $subdir
- ];
-}
\ No newline at end of file
Deleted: trunk/contrib/perl/lib/ExtUtils/t/cd.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/cd.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/cd.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,68 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = ('../lib', 'lib/');
- }
- else {
- unshift @INC, 't/lib/';
- }
-}
-chdir 't';
-
-my $Is_VMS = $^O eq 'VMS';
-
-use File::Spec;
-
-use Test::More tests => 4;
-
-my $dir = File::Spec->catdir("some", "dir");
-my @cd_args = ($dir, "command1", "command2");
-
-{
- package Test::MM_Win32;
- use ExtUtils::MM_Win32;
- @ISA = qw(ExtUtils::MM_Win32);
-
- my $mm = bless {}, 'Test::MM_Win32';
-
- {
- local *make = sub { "nmake" };
-
- my @dirs = (File::Spec->updir) x 2;
- my $expected_updir = File::Spec->catdir(@dirs);
-
- ::is $mm->cd(@cd_args),
-qq{cd $dir
- command1
- command2
- cd $expected_updir};
- }
-
- {
- local *make = sub { "dmake" };
-
- ::is $mm->cd(@cd_args),
-qq{cd $dir && command1
- cd $dir && command2};
- }
-}
-
-{
- is +ExtUtils::MM_Unix->cd(@cd_args),
-qq{cd $dir && command1
- cd $dir && command2};
-}
-
-SKIP: {
- skip("VMS' cd requires vmspath which is only on VMS", 1) unless $Is_VMS;
-
- use ExtUtils::MM_VMS;
- is +ExtUtils::MM_VMS->cd(@cd_args),
-q{startdir = F$Environment("Default")
- Set Default [.some.dir]
- command1
- command2
- Set Default 'startdir'};
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/config.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/config.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/config.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,23 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = ('../lib', 'lib/');
- }
- else {
- unshift @INC, 't/lib/';
- }
-}
-
-use Test::More tests => 3;
-use Config ();
-
-BEGIN { use_ok 'ExtUtils::MakeMaker::Config'; }
-
-is $Config{path_sep}, $Config::Config{path_sep};
-
-eval {
- $Config{wibble} = 42;
-};
-is $Config{wibble}, 42;
Deleted: trunk/contrib/perl/lib/ExtUtils/t/cp.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/cp.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/cp.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,33 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = ('../lib', 'lib/');
- }
- else {
- unshift @INC, 't/lib/';
- }
-}
-chdir 't';
-
-use ExtUtils::Command;
-use Test::More tests => 1;
-
-open FILE, ">source" or die $!;
-print FILE "stuff\n";
-close FILE;
-
-# Instead of sleeping to make the file time older
-utime time - 900, time - 900, "source";
-
-END { 1 while unlink "source", "dest"; }
-
-# Win32 bug, cp wouldn't update mtime.
-{
- local @ARGV = qw(source dest);
- cp();
- my $mtime = (stat("dest"))[9];
- my $now = time;
- cmp_ok( abs($mtime - $now), '<=', 1, 'cp updated mtime' );
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/dir_target.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/dir_target.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/dir_target.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,18 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = ('../lib', 'lib/');
- }
- else {
- unshift @INC, 't/lib/';
- }
-}
-chdir 't';
-
-use Test::More tests => 1;
-use ExtUtils::MakeMaker;
-
-# dir_target() was typo'd as dir_targets()
-can_ok('MM', 'dir_target');
Deleted: trunk/contrib/perl/lib/ExtUtils/t/eu_command.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/eu_command.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/eu_command.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,290 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = ('../lib', 'lib/');
- }
- else {
- unshift @INC, 't/lib/';
- }
-}
-chdir 't';
-
-BEGIN {
- $Testfile = 'testfile.foo';
-}
-
-BEGIN {
- 1 while unlink $Testfile, 'newfile';
- # forcibly remove ecmddir/temp2, but don't import mkpath
- use File::Path ();
- File::Path::rmtree( 'ecmddir' );
-}
-
-use Test::More tests => 40;
-use File::Spec;
-
-BEGIN {
- # bad neighbor, but test_f() uses exit()
- *CORE::GLOBAL::exit = ''; # quiet 'only once' warning.
- *CORE::GLOBAL::exit = sub (;$) { return $_[0] };
- use_ok( 'ExtUtils::Command' );
-}
-
-{
- # concatenate this file with itself
- # be extra careful the regex doesn't match itself
- use TieOut;
- my $out = tie *STDOUT, 'TieOut';
- my $self = $0;
- unless (-f $self) {
- my ($vol, $dirs, $file) = File::Spec->splitpath($self);
- my @dirs = File::Spec->splitdir($dirs);
- unshift(@dirs, File::Spec->updir);
- $dirs = File::Spec->catdir(@dirs);
- $self = File::Spec->catpath($vol, $dirs, $file);
- }
- @ARGV = ($self, $self);
-
- cat();
- is( scalar( $$out =~ s/use_ok\( 'ExtUtils::Command'//g), 2,
- 'concatenation worked' );
-
- # the truth value here is reversed -- Perl true is shell false
- @ARGV = ( $Testfile );
- is( test_f(), 1, 'testing non-existent file' );
-
- # these are destructive, have to keep setting @ARGV
- @ARGV = ( $Testfile );
- touch();
-
- @ARGV = ( $Testfile );
- is( test_f(), 0, 'testing touch() and test_f()' );
- is_deeply( \@ARGV, [$Testfile], 'test_f preserves @ARGV' );
-
- @ARGV = ( $Testfile );
- ok( -e $ARGV[0], 'created!' );
-
- my ($now) = time;
- utime ($now, $now, $ARGV[0]);
- sleep 2;
-
- # Just checking modify time stamp, access time stamp is set
- # to the beginning of the day in Win95.
- # There's a small chance of a 1 second flutter here.
- my $stamp = (stat($ARGV[0]))[9];
- cmp_ok( abs($now - $stamp), '<=', 1, 'checking modify time stamp' ) ||
- diag "mtime == $stamp, should be $now";
-
- @ARGV = qw(newfile);
- touch();
-
- my $new_stamp = (stat('newfile'))[9];
- cmp_ok( abs($new_stamp - $stamp), '>=', 2, 'newer file created' );
-
- @ARGV = ('newfile', $Testfile);
- eqtime();
-
- $stamp = (stat($Testfile))[9];
- cmp_ok( abs($new_stamp - $stamp), '<=', 1, 'eqtime' );
-
- # eqtime use to clear the contents of the file being equalized!
- open(FILE, ">>$Testfile") || die $!;
- print FILE "Foo";
- close FILE;
-
- @ARGV = ('newfile', $Testfile);
- eqtime();
- ok( -s $Testfile, "eqtime doesn't clear the file being equalized" );
-
- SKIP: {
- if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32' ||
- $^O eq 'NetWare' || $^O eq 'dos' || $^O eq 'cygwin' ||
- $^O eq 'MacOS'
- ) {
- skip( "different file permission semantics on $^O", 3);
- }
-
- # change a file to execute-only
- @ARGV = ( '0100', $Testfile );
- ExtUtils::Command::chmod();
-
- is( ((stat($Testfile))[2] & 07777) & 0700,
- 0100, 'change a file to execute-only' );
-
- # change a file to read-only
- @ARGV = ( '0400', $Testfile );
- ExtUtils::Command::chmod();
-
- is( ((stat($Testfile))[2] & 07777) & 0700,
- ($^O eq 'vos' ? 0500 : 0400), 'change a file to read-only' );
-
- # change a file to write-only
- @ARGV = ( '0200', $Testfile );
- ExtUtils::Command::chmod();
-
- is( ((stat($Testfile))[2] & 07777) & 0700,
- ($^O eq 'vos' ? 0700 : 0200), 'change a file to write-only' );
- }
-
- # change a file to read-write
- @ARGV = ( '0600', $Testfile );
- my @orig_argv = @ARGV;
- ExtUtils::Command::chmod();
- is_deeply( \@ARGV, \@orig_argv, 'chmod preserves @ARGV' );
-
- is( ((stat($Testfile))[2] & 07777) & 0700,
- ($^O eq 'vos' ? 0700 : 0600), 'change a file to read-write' );
-
-
- SKIP: {
- if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32' ||
- $^O eq 'NetWare' || $^O eq 'dos' || $^O eq 'cygwin' ||
- $^O eq 'MacOS'
- ) {
- skip( "different file permission semantics on $^O", 5);
- }
-
- @ARGV = ('testdir');
- mkpath;
- ok( -e 'testdir' );
-
- # change a dir to execute-only
- @ARGV = ( '0100', 'testdir' );
- ExtUtils::Command::chmod();
-
- is( ((stat('testdir'))[2] & 07777) & 0700,
- 0100, 'change a dir to execute-only' );
-
- # change a dir to read-only
- @ARGV = ( '0400', 'testdir' );
- ExtUtils::Command::chmod();
-
- is( ((stat('testdir'))[2] & 07777) & 0700,
- ($^O eq 'vos' ? 0500 : 0400), 'change a dir to read-only' );
-
- # change a dir to write-only
- @ARGV = ( '0200', 'testdir' );
- ExtUtils::Command::chmod();
-
- is( ((stat('testdir'))[2] & 07777) & 0700,
- ($^O eq 'vos' ? 0700 : 0200), 'change a dir to write-only' );
-
- @ARGV = ('testdir');
- rm_rf;
- ok( ! -e 'testdir', 'rm_rf can delete a read-only dir' );
- }
-
-
- # mkpath
- my $test_dir = File::Spec->join( 'ecmddir', 'temp2' );
- @ARGV = ( $test_dir );
- ok( ! -e $ARGV[0], 'temp directory not there yet' );
- is( test_d(), 1, 'testing non-existent directory' );
-
- @ARGV = ( $test_dir );
- mkpath();
- ok( -e $ARGV[0], 'temp directory created' );
- is( test_d(), 0, 'testing existing dir' );
-
- @ARGV = ( $test_dir );
- # copy a file to a nested subdirectory
- unshift @ARGV, $Testfile;
- @orig_argv = @ARGV;
- cp();
- is_deeply( \@ARGV, \@orig_argv, 'cp preserves @ARGV' );
-
- ok( -e File::Spec->join( 'ecmddir', 'temp2', $Testfile ), 'copied okay' );
-
- # cp should croak if destination isn't directory (not a great warning)
- @ARGV = ( $Testfile ) x 3;
- eval { cp() };
-
- like( $@, qr/Too many arguments/, 'cp croaks on error' );
-
- # move a file to a subdirectory
- @ARGV = ( $Testfile, 'ecmddir' );
- @orig_argv = @ARGV;
- ok( mv() );
- is_deeply( \@ARGV, \@orig_argv, 'mv preserves @ARGV' );
-
- ok( ! -e $Testfile, 'moved file away' );
- ok( -e File::Spec->join( 'ecmddir', $Testfile ), 'file in new location' );
-
- # mv should also croak with the same wacky warning
- @ARGV = ( $Testfile ) x 3;
-
- eval { mv() };
- like( $@, qr/Too many arguments/, 'mv croaks on error' );
-
- # Test expand_wildcards()
- {
- my $file = $Testfile;
- @ARGV = ();
- chdir 'ecmddir';
-
- # % means 'match one character' on VMS. Everything else is ?
- my $match_char = $^O eq 'VMS' ? '%' : '?';
- ($ARGV[0] = $file) =~ s/.\z/$match_char/;
-
- # this should find the file
- ExtUtils::Command::expand_wildcards();
-
- is_deeply( \@ARGV, [$file], 'expanded wildcard ? successfully' );
-
- # try it with the asterisk now
- ($ARGV[0] = $file) =~ s/.{3}\z/\*/;
- ExtUtils::Command::expand_wildcards();
-
- is_deeply( \@ARGV, [$file], 'expanded wildcard * successfully' );
-
- chdir File::Spec->updir;
- }
-
- # remove some files
- my @files = @ARGV = ( File::Spec->catfile( 'ecmddir', $Testfile ),
- File::Spec->catfile( 'ecmddir', 'temp2', $Testfile ) );
- rm_f();
-
- ok( ! -e $_, "removed $_ successfully" ) for (@ARGV);
-
- # rm_f dir
- @ARGV = my $dir = File::Spec->catfile( 'ecmddir' );
- rm_rf();
- ok( ! -e $dir, "removed $dir successfully" );
-}
-
-{
- { local @ARGV = 'd2utest'; mkpath; }
- open(FILE, '>d2utest/foo');
- binmode(FILE);
- print FILE "stuff\015\012and thing\015\012";
- close FILE;
-
- open(FILE, '>d2utest/bar');
- binmode(FILE);
- my $bin = "\c@\c@\c@\c@\c@\c@\cA\c@\c@\c@\015\012".
- "\@\c@\cA\c@\c@\c at 8__LIN\015\012";
- print FILE $bin;
- close FILE;
-
- local @ARGV = 'd2utest';
- ExtUtils::Command::dos2unix();
-
- open(FILE, 'd2utest/foo');
- is( join('', <FILE>), "stuff\012and thing\012", 'dos2unix' );
- close FILE;
-
- open(FILE, 'd2utest/bar');
- binmode(FILE);
- ok( -B 'd2utest/bar' );
- is( join('', <FILE>), $bin, 'dos2unix preserves binaries');
- close FILE;
-}
-
-END {
- 1 while unlink $Testfile, 'newfile';
- File::Path::rmtree( 'ecmddir' );
- File::Path::rmtree( 'd2utest' );
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/fix_libs.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/fix_libs.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/fix_libs.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,36 +0,0 @@
-#!/usr/bin/perl -w
-
-# Unit test the code which fixes up $self->{LIBS}
-
-BEGIN {
- chdir 't' if -d 't';
-
- if( $ENV{PERL_CORE} ) {
- @INC = '../lib';
- }
-}
-
-use strict;
-use lib './lib';
-use Test::More 'no_plan';
-
-use ExtUtils::MakeMaker;
-
-my @tests = (
- # arg # want
- [ undef, [''] ],
- [ "foo", ['foo'] ],
- [ [], [''] ],
- [ ["foo"], ['foo'] ],
- [ [1, 2, 3], [1, 2, 3] ],
- [ [0], [0] ],
- [ [''], [''] ],
- [ " ", [' '] ],
-);
-
-for my $test (@tests) {
- my($arg, $want) = @$test;
-
- my $display = defined $arg ? $arg : "undef";
- is_deeply( MM->_fix_libs($arg), $want, "fix_libs($display)" );
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/fixin.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/fixin.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/fixin.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,123 +0,0 @@
-#!/usr/bin/perl -w
-
-# Try to test fixin. I say "try" because what fixin will actually do
-# is highly variable from system to system.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = ('../lib', 'lib/');
- }
- else {
- unshift @INC, 't/lib/';
- }
-}
-chdir 't';
-
-use File::Spec;
-
-use Test::More tests => 22;
-
-use Config;
-use TieOut;
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::BFD;
-
-use ExtUtils::MakeMaker;
-
-chdir 't';
-
-perl_lib();
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
- diag("chdir failed: $!");
-
-# [rt.cpan.org 26234]
-{
- local $/ = "foo";
- local $\ = "bar";
- MY->fixin("bin/program");
- is $/, "foo", '$/ not clobbered';
- is $\, "bar", '$\ not clobbered';
-}
-
-
-sub test_fixin {
- my($code, $test) = @_;
-
- my $file = "fixin_test";
- ok(open(my $fh, ">", $file), "write $file") or diag "Can't write $file: $!";
- print $fh $code;
- close $fh;
-
- MY->fixin($file);
-
- ok(open($fh, "<", $file), "read $file") or diag "Can't read $file: $!";
- my @lines = <$fh>;
- close $fh;
-
- $test->(@lines);
-
- 1 while unlink $file;
- ok !-e $file, "cleaned up $file";
-}
-
-
-# A simple test of fixin
-test_fixin(<<END,
-#!/foo/bar/perl -w
-
-blah blah blah
-END
- sub {
- my @lines = @_;
- unlike $lines[0], qr[/foo/bar/perl], "#! replaced";
- like $lines[0], qr[ -w\b], "switch retained";
-
- # In between might be that "not running under some shell" madness.
-
- is $lines[-1], "blah blah blah\n", "Program text retained";
- }
-);
-
-
-# [rt.cpan.org 29442]
-test_fixin(<<END,
-#!/foo/bar/perl5.8.8 -w
-
-blah blah blah
-END
-
- sub {
- my @lines = @_;
- unlike $lines[0], qr[/foo/bar/perl5.8.8], "#! replaced";
- like $lines[0], qr[ -w\b], "switch retained";
-
- # In between might be that "not running under some shell" madness.
-
- is $lines[-1], "blah blah blah\n", "Program text retained";
- }
-);
-
-
-# fixin shouldn't pick this up.
-test_fixin(<<END,
-#!/foo/bar/perly -w
-
-blah blah blah
-END
-
- sub {
- is join("", @_), <<END;
-#!/foo/bar/perly -w
-
-blah blah blah
-END
- }
-);
Deleted: trunk/contrib/perl/lib/ExtUtils/t/hints.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/hints.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/hints.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,56 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = ('../lib', 'lib/');
- }
- else {
- unshift @INC, 't/lib/';
- }
-}
-chdir 't';
-
-use File::Spec;
-
-use Test::More tests => 3;
-
-# Having the CWD in @INC masked a bug in finding hint files
-my $curdir = File::Spec->curdir;
- at INC = grep { $_ ne $curdir && $_ ne '.' } @INC;
-
-mkdir('hints', 0777);
-(my $os = $^O) =~ s/\./_/g;
-my $hint_file = File::Spec->catfile('hints', "$os.pl");
-
-open(HINT, ">$hint_file") || die "Can't write dummy hints file $hint_file: $!";
-print HINT <<'CLOO';
-$self->{CCFLAGS} = 'basset hounds got long ears';
-CLOO
-close HINT;
-
-use TieOut;
-use ExtUtils::MakeMaker;
-
-my $out = tie *STDERR, 'TieOut';
-my $mm = bless {}, 'ExtUtils::MakeMaker';
-$mm->check_hints;
-is( $mm->{CCFLAGS}, 'basset hounds got long ears' );
-is( $out->read, "Processing hints file $hint_file\n" );
-
-open(HINT, ">$hint_file") || die "Can't write dummy hints file $hint_file: $!";
-print HINT <<'CLOO';
-die "Argh!\n";
-CLOO
-close HINT;
-
-$mm->check_hints;
-is( $out->read, <<OUT, 'hint files produce errors' );
-Processing hints file $hint_file
-Argh!
-OUT
-
-END {
- use File::Path;
- rmtree ['hints'];
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/installed_file.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/installed_file.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/installed_file.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,51 +0,0 @@
-#!/usr/bin/perl -w
-
-# Test MM->_installed_file_for_module()
-
-BEGIN {
- chdir 't' if -d 't';
-
- if( $ENV{PERL_CORE} ) {
- @INC = '../lib';
- }
-}
-
-use strict;
-use warnings;
-
-use lib './lib';
-use ExtUtils::MakeMaker;
-use Test::More;
-use File::Spec;
-
-
-sub path_is {
- my($have, $want, $name) = @_;
-
- $have = File::Spec->canonpath($have);
- $want = File::Spec->canonpath($want);
-
- my $builder = Test::More->builder;
- return $builder->is_eq( $have, $want, $name );
-}
-
-# Test when a module is not installed
-{
- ok !MM->_installed_file_for_module("aaldkfjaldj"), "Module not installed";
- ok !MM->_installed_file_for_module("aaldkfjaldj::dlajldkj");
-}
-
-# Try a single name module
-{
- my $want = $INC{'strict.pm'};
- path_is( MM->_installed_file_for_module("strict"), $want, "single name module" );
-}
-
-# And a tuple
-{
- my $want = $INC{"Test/More.pm"};
- path_is( MM->_installed_file_for_module("Test::More"), $want, "Foo::Bar style" );
-}
-
-
-done_testing(4);
Deleted: trunk/contrib/perl/lib/ExtUtils/t/is_of_type.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/is_of_type.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/is_of_type.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,40 +0,0 @@
-#!/usr/bin/perl -w
-
-# Test _is_of_type()
-
-BEGIN {
- chdir 't' if -d 't';
-
- if( $ENV{PERL_CORE} ) {
- @INC = '../lib';
- }
-}
-
-use lib './lib';
-use strict;
-use ExtUtils::MakeMaker;
-
-use Test::More "no_plan";
-
-my $is_of_type = \&ExtUtils::MakeMaker::_is_of_type;
-
-my @tests = (
- [23, "", 1],
- [[], "", 0],
- [{}, "", 0],
- [[], "HASH", 0],
- [{}, "HASH", 1],
- [bless({}, "Foo"), "Foo", 1],
- [bless({}, "Bar"), "Foo", 0],
- [bless([], "Foo"), "", 0],
- [bless([], "Foo"), "HASH", 0],
- [bless([], "Foo"), "ARRAY", 1],
-);
-
-for my $test (@tests) {
- my($thing, $type, $want) = @$test;
-
- # [rt.cpan.org 41060]
- local $SIG{__DIE__} = sub { fail("sigdie should be ignored") };
- is !!$is_of_type->($thing, $type), !!$want, qq[_is_of_type($thing, '$type'): $want];
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/make.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/make.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/make.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,24 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = ('../lib', 'lib/');
- }
- else {
- unshift @INC, 't/lib/';
- }
-}
-
-use Test::More tests => 3;
-
-use ExtUtils::MakeMaker;
-
-my $MM = bless { MAKE => "nmake6" }, "MM";
-is $MM->make, 'nmake';
-
-$MM->{MAKE} = 'GNUmake';
-is $MM->make, 'gmake';
-
-$MM->{MAKE} = 'MMS';
-is $MM->make, 'mms';
Deleted: trunk/contrib/perl/lib/ExtUtils/t/maketext_filter.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/maketext_filter.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/maketext_filter.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,65 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = '../lib';
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use Test::More tests => 6;
-
-use ExtUtils::MakeMaker;
-use ExtUtils::MM_VMS;
-
-sub test_filter {
- my($text, $vms_text) = @_;
-
- local $Test::Builder::Level = $Test::Builder::Level + 1;
- is( ExtUtils::MM_Any->maketext_filter($text), $text, 'default filter' );
- is( ExtUtils::MM_VMS->maketext_filter($text), $vms_text, 'VMS filter' );
-}
-
-
-# VMS filter puts a space after the target
-test_filter(<<'END', <<'VMS');
-foo: bar
- thing: splat
-END
-foo : bar
- thing: splat
-VMS
-
-
-# And it does it for all targets
-test_filter(<<'END', <<'VMS');
-foo: bar
- thing: splat
-
-up: down
- yes
-END
-foo : bar
- thing: splat
-
-up : down
- yes
-VMS
-
-
-# And it doesn't mess with macros
-test_filter(<<'END', <<'VMS');
-CLASS=Foo: Bar
-
-target: stuff
- $(PROGRAM) And::Stuff
-END
-CLASS=Foo: Bar
-
-target : stuff
- $(PROGRAM) And::Stuff
-VMS
Deleted: trunk/contrib/perl/lib/ExtUtils/t/metafile_data.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/metafile_data.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/metafile_data.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,315 +0,0 @@
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 7;
-
-use Data::Dumper;
-
-require ExtUtils::MM_Any;
-
-my $new_mm = sub {
- return bless { ARGS => {@_}, @_ }, 'ExtUtils::MM_Any';
-};
-
-{
- my $mm = $new_mm->(
- DISTNAME => 'Foo-Bar',
- VERSION => 1.23,
- PM => {
- "Foo::Bar" => 'lib/Foo/Bar.pm',
- },
- );
-
- is_deeply [$mm->metafile_data], [
- name => 'Foo-Bar',
- version => 1.23,
- abstract => undef,
- author => [],
- license => 'unknown',
- distribution_type => 'module',
-
- configure_requires => {
- 'ExtUtils::MakeMaker' => 0,
- },
- build_requires => {
- 'ExtUtils::MakeMaker' => 0,
- },
-
- 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
- },
- ];
-
-
- is_deeply [$mm->metafile_data({}, { no_index => { directory => [qw(foo)] } })], [
- name => 'Foo-Bar',
- version => 1.23,
- abstract => undef,
- author => [],
- license => 'unknown',
- distribution_type => 'module',
-
- configure_requires => {
- 'ExtUtils::MakeMaker' => 0,
- },
- build_requires => {
- 'ExtUtils::MakeMaker' => 0,
- },
-
- no_index => {
- directory => [qw(t inc foo)],
- },
-
- generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
- 'meta-spec' => {
- url => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
- version => 1.4
- },
- ], 'rt.cpan.org 39348';
-}
-
-
-{
- my $mm = $new_mm->(
- DISTNAME => 'Foo-Bar',
- VERSION => 1.23,
- AUTHOR => 'Some Guy',
- PREREQ_PM => {
- Foo => 2.34,
- Bar => 4.56,
- },
- );
-
- is_deeply [$mm->metafile_data(
- {
- configure_requires => {
- Stuff => 2.34
- },
- wobble => 42
- },
- {
- no_index => {
- package => "Thing"
- },
- wibble => 23
- },
- )],
- [
- name => 'Foo-Bar',
- version => 1.23,
- abstract => undef,
- author => ['Some Guy'],
- license => 'unknown',
- distribution_type => 'script',
-
- configure_requires => {
- Stuff => 2.34,
- },
- build_requires => {
- 'ExtUtils::MakeMaker' => 0,
- },
-
- requires => {
- Foo => 2.34,
- Bar => 4.56,
- },
-
- no_index => {
- directory => [qw(t inc)],
- package => 'Thing',
- },
-
- generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
- 'meta-spec' => {
- url => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
- version => 1.4
- },
-
- wibble => 23,
- wobble => 42,
- ];
-}
-
-
-# Test MIN_PERL_VERSION
-{
- my $mm = $new_mm->(
- DISTNAME => 'Foo-Bar',
- VERSION => 1.23,
- PM => {
- "Foo::Bar" => 'lib/Foo/Bar.pm',
- },
- MIN_PERL_VERSION => 5.006,
- );
-
- is_deeply [$mm->metafile_data], [
- name => 'Foo-Bar',
- version => 1.23,
- abstract => undef,
- author => [],
- license => 'unknown',
- distribution_type => 'module',
-
- configure_requires => {
- 'ExtUtils::MakeMaker' => 0,
- },
- build_requires => {
- 'ExtUtils::MakeMaker' => 0,
- },
-
- requires => {
- perl => '5.006',
- },
-
- 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
- },
- ];
-}
-
-
-# Test MIN_PERL_VERSION
-{
- my $mm = $new_mm->(
- DISTNAME => 'Foo-Bar',
- VERSION => 1.23,
- PM => {
- "Foo::Bar" => 'lib/Foo/Bar.pm',
- },
- MIN_PERL_VERSION => 5.006,
- PREREQ_PM => {
- 'Foo::Bar' => 1.23,
- },
- );
-
- is_deeply [$mm->metafile_data], [
- name => 'Foo-Bar',
- version => 1.23,
- abstract => undef,
- author => [],
- license => 'unknown',
- distribution_type => 'module',
-
- configure_requires => {
- 'ExtUtils::MakeMaker' => 0,
- },
- build_requires => {
- 'ExtUtils::MakeMaker' => 0,
- },
-
- requires => {
- perl => '5.006',
- 'Foo::Bar' => 1.23,
- },
-
- 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
- },
- ];
-}
-
-# Test CONFIGURE_REQUIRES
-{
- my $mm = $new_mm->(
- DISTNAME => 'Foo-Bar',
- VERSION => 1.23,
- CONFIGURE_REQUIRES => {
- "Fake::Module1" => 1.01,
- },
- PM => {
- "Foo::Bar" => 'lib/Foo/Bar.pm',
- },
- );
-
- is_deeply [$mm->metafile_data], [
- name => 'Foo-Bar',
- version => 1.23,
- abstract => undef,
- author => [],
- license => 'unknown',
- distribution_type => 'module',
-
- configure_requires => {
- 'Fake::Module1' => 1.01,
- },
- build_requires => {
- 'ExtUtils::MakeMaker' => 0,
- },
-
- 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
- },
- ],'CONFIGURE_REQUIRES';
-}
-
-# Test BUILD_REQUIRES
-{
- my $mm = $new_mm->(
- DISTNAME => 'Foo-Bar',
- VERSION => 1.23,
- BUILD_REQUIRES => {
- "Fake::Module1" => 1.01,
- },
- PM => {
- "Foo::Bar" => 'lib/Foo/Bar.pm',
- },
- );
-
- is_deeply [$mm->metafile_data], [
- name => 'Foo-Bar',
- version => 1.23,
- abstract => undef,
- author => [],
- license => 'unknown',
- distribution_type => 'module',
-
- configure_requires => {
- 'ExtUtils::MakeMaker' => 0,
- },
- build_requires => {
- 'Fake::Module1' => 1.01,
- },
-
- 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
- },
- ],'CONFIGURE_REQUIRES';
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/metafile_file.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/metafile_file.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/metafile_file.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,314 +0,0 @@
-#!/usr/bin/perl -w
-
-# This is a test of the fake YAML dumper implemented by EUMM:
-# ExtUtils::MM_Any::metafile_file
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 16;
-
-require ExtUtils::MM_Any;
-
-my $mm = bless {}, 'ExtUtils::MM_Any';
-
-{
- my @meta = ( a => 1, b => 2 );
- my $expected = <<YAML;
---- #YAML:1.0
-a: 1
-b: 2
-YAML
-
- is($mm->metafile_file(@meta), $expected, "dump for flat hashes works ok");
-}
-
-{
- my @meta = ( k1 => 'some key and value', k2 => undef, k3 => 1 );
- my $expected = <<YAML;
---- #YAML:1.0
-k1: some key and value
-k2: ~
-k3: 1
-YAML
-
- is($mm->metafile_file(@meta), $expected, "dumping strings and undefs is ok");
-}
-
-{
- my @meta = ( a => 1, b => 2, h => { hh => 1 } );
- my $expected = <<YAML;
---- #YAML:1.0
-a: 1
-b: 2
-h:
- hh: 1
-YAML
-
- is($mm->metafile_file(@meta), $expected, "dump for nested hashes works ok");
-}
-
-{
- my @meta = ( a => 1, b => 2, h => { h1 => 'x', h2 => 'z' } );
- my $expected = <<YAML;
---- #YAML:1.0
-a: 1
-b: 2
-h:
- h1: x
- h2: z
-YAML
-
- is($mm->metafile_file(@meta), $expected, "nested hashes sort ascii-betically");
- # to tell the truth, they sort case-insensitively
- # that's hard to test for Perl with unstable sort's
-}
-
-{
- my @meta = ( a => 1, b => 2, h => { hh => { hhh => 1 } } );
- my $expected = <<YAML;
---- #YAML:1.0
-a: 1
-b: 2
-h:
- hh:
- hhh: 1
-YAML
-
- is($mm->metafile_file(@meta), $expected, "dump for hashes (with more nesting) works ok");
-}
-
-{
- my @meta = ( a => 1, k => [ qw(w y z) ] );
- my $expected = <<YAML;
---- #YAML:1.0
-a: 1
-k:
- - w
- - y
- - z
-YAML
-
- is($mm->metafile_file(@meta), $expected, "array of strings are handled ok");
-}
-
-is($mm->metafile_file( a => {}, b => [], c => undef ), <<'YAML', 'empty hashes and arrays');
---- #YAML:1.0
-a: {}
-b: []
-c: ~
-YAML
-
-
-{
- my @meta = (
- name => 'My-Module',
- version => '0.1',
- version_from => 'lib/My/Module.pm',
- installdirs => 'site',
- abstract => 'A does-it-all module',
- license => 'perl',
- generated_by => 'myself',
- author => 'John Doe <doe at doeland.org>',
- distribution_type => 'module',
- requires => {
- 'My::Module::Helper' => 0,
- 'Your::Module' => '1.5',
- },
- 'meta-spec' => {
- version => '1.1',
- url => 'http://module-build.sourceforge.net/META-spec-new.html',
- },
- );
- my $expected = <<'YAML';
---- #YAML:1.0
-name: My-Module
-version: 0.1
-version_from: lib/My/Module.pm
-installdirs: site
-abstract: A does-it-all module
-license: perl
-generated_by: myself
-author: John Doe <doe at doeland.org>
-distribution_type: module
-requires:
- My::Module::Helper: 0
- Your::Module: 1.5
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-new.html
- version: 1.1
-YAML
-
- is($mm->metafile_file(@meta), $expected, "dump for something like META.yml works");
-}
-
-{
- my @meta = (
- name => 'My-Module',
- version => '0.1',
- version_from => 'lib/My/Module.pm',
- installdirs => 'site',
- abstract => 'A does-it-all module',
- license => 'perl',
- generated_by => 'myself',
- author => 'John Doe <doe at doeland.org>',
- distribution_type => 'module',
- requires => {
- 'My::Module::Helper' => 0,
- 'Your::Module' => '1.5',
- },
- recommends => {
- 'Test::More' => 0,
- 'Test::Pod' => 1.18,
- 'Test::Pod::Coverage' => 1
- },
- 'meta-spec' => {
- version => '1.1',
- url => 'http://module-build.sourceforge.net/META-spec-new.html',
- },
- );
- my $expected = <<'YAML';
---- #YAML:1.0
-name: My-Module
-version: 0.1
-version_from: lib/My/Module.pm
-installdirs: site
-abstract: A does-it-all module
-license: perl
-generated_by: myself
-author: John Doe <doe at doeland.org>
-distribution_type: module
-requires:
- My::Module::Helper: 0
- Your::Module: 1.5
-recommends:
- Test::More: 0
- Test::Pod: 1.18
- Test::Pod::Coverage: 1
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-new.html
- version: 1.1
-YAML
-
- is($mm->metafile_file(@meta), $expected, "META.yml with extra 'recommends' works");
-}
-
-{
- my @meta = (
- name => 'My-Module',
- version => '0.1',
- version_from => 'lib/My/Module.pm',
- installdirs => 'site',
- abstract => 'A does-it-all module',
- license => 'perl',
- generated_by => 'myself',
- author => 'John Doe <doe at doeland.org>',
- distribution_type => 'module',
- requires => {
- 'My::Module::Helper' => 0,
- 'Your::Module' => '1.5',
- },
- recommends => {
- 'Test::More' => 0,
- 'Test::Pod' => 1.18,
- 'Test::Pod::Coverage' => 1
- },
- no_index => {
- dir => [ qw(inc) ],
- file => [ qw(TODO NOTES) ],
- },
- 'meta-spec' => {
- version => '1.1',
- url => 'http://module-build.sourceforge.net/META-spec-new.html',
- },
- );
- my $expected = <<'YAML';
---- #YAML:1.0
-name: My-Module
-version: 0.1
-version_from: lib/My/Module.pm
-installdirs: site
-abstract: A does-it-all module
-license: perl
-generated_by: myself
-author: John Doe <doe at doeland.org>
-distribution_type: module
-requires:
- My::Module::Helper: 0
- Your::Module: 1.5
-recommends:
- Test::More: 0
- Test::Pod: 1.18
- Test::Pod::Coverage: 1
-no_index:
- dir:
- - inc
- file:
- - TODO
- - NOTES
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-new.html
- version: 1.1
-YAML
-
- is($mm->metafile_file(@meta), $expected, "META.yml with extra 'no_index' works");
-
-
- # Make sure YAML.pm can ready our output
- SKIP: {
- skip "Need YAML.pm to test if it can load META.yml", 1
- unless eval { require YAML };
-
- my $yaml_load = YAML::Load($mm->metafile_file(@meta));
- is_deeply( $yaml_load, {@meta}, "META.yml can be read by YAML.pm" );
- }
-
-
- SKIP: {
- skip "Need YAML::Tiny to test if it can load META.yml", 2
- unless eval { require YAML::Tiny };
-
- my @yaml_load = YAML::Tiny::Load($mm->metafile_file(@meta));
- is @yaml_load, 1, "YAML::Tiny saw one document in META.yml";
- is_deeply( $yaml_load[0], {@meta}, "META.yml can be read by YAML::Tiny" );
- }
-}
-
-
-{
- my @meta = ( k => 'a : b', 'x : y' => 1 );
- my $expected = <<YAML;
---- #YAML:1.0
-k: a : b
-x : y: 1
-YAML
- # NOTE: the output is not YAML-equivalent to the input
-
- is($mm->metafile_file(@meta), $expected, "no quoting is done");
-}
-
-{
- my @meta = ( k => \*STDOUT );
- eval { $mm->metafile_file(@meta) };
-
- like($@, qr/^only nested hashes, arrays and objects are supported/,
- "we don't like but hash/array refs");
-}
-
-{
- my @meta = ( k => [ [] ] );
- eval { $mm->metafile_file(@meta) };
-
- like($@, qr/^only nested arrays of non-refs are supported/,
- "we also don't like but array of strings");
-}
-
-# recursive data structures: don't even think about it - endless recursion
Deleted: trunk/contrib/perl/lib/ExtUtils/t/min_perl_version.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/min_perl_version.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/min_perl_version.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,201 +0,0 @@
-#!/usr/bin/perl -w
-
-# This is a test checking various aspects of the optional argument
-# MIN_PERL_VERSION to WriteMakefile.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 33;
-
-use TieOut;
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::MPV;
-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 'Min-PerlVers', 'entering dir Min-PerlVers' ) ||
- diag("chdir failed: $!");
-
-{
- # ----- argument verification -----
-
- my $stdout = tie *STDOUT, 'TieOut';
- ok( $stdout, 'capturing stdout' );
- my $warnings = '';
- local $SIG{__WARN__} = sub {
- $warnings .= join '', @_;
- };
-
- eval {
- WriteMakefile(
- NAME => 'Min::PerlVers',
- MIN_PERL_VERSION => '5',
- );
- };
- is( $warnings, '', 'MIN_PERL_VERSION=5 does not trigger a warning' );
- is( $@, '', ' nor a hard failure' );
-
-
- $warnings = '';
- eval {
- WriteMakefile(
- NAME => 'Min::PerlVers',
- MIN_PERL_VERSION => '5.4.4',
- );
- };
- is( $warnings, '', 'MIN_PERL_VERSION=X.Y.Z does not trigger a warning' );
- is( $@, '', ' nor a hard failure' );
-
-
- $warnings = '';
- eval {
- WriteMakefile(
- NAME => 'Min::PerlVers',
- MIN_PERL_VERSION => '999999',
- );
- };
- ok( '' ne $warnings, 'MIN_PERL_VERSION=999999 triggers a warning' );
- is( $warnings,
- "Warning: Perl version 999999 or higher required. We run $].\n",
- ' with expected message text' );
- is( $@, '', ' and without a hard failure' );
-
- $warnings = '';
- eval {
- WriteMakefile(
- NAME => 'Min::PerlVers',
- MIN_PERL_VERSION => '999999',
- PREREQ_FATAL => 1,
- );
- };
- is( $warnings, '', 'MIN_PERL_VERSION=999999 and PREREQ_FATAL: no warning' );
- is( $@, <<"END", ' correct exception' );
-MakeMaker FATAL: perl version too low for this distribution.
-Required is 999999. We run $].
-END
-
- $warnings = '';
- eval {
- WriteMakefile(
- NAME => 'Min::PerlVers',
- MIN_PERL_VERSION => 'foobar',
- );
- };
- ok( '' ne $warnings, 'MIN_PERL_VERSION=foobar triggers a warning' );
- is( $warnings, <<'END', ' with expected message text' );
-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 -----
-{
- 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*=/;
- ok( $prereq_out_sane, ' and talking like we expect' ) ||
- diag($prereq_out);
-
- SKIP: {
- skip 'not going to evaluate rubbish', 3 if !$prereq_out_sane;
-
- package _Prereq::Print::WithMPV; ## no critic
- our($PREREQ_PM, $BUILD_REQUIRES, $MIN_PERL_VERSION, $ERR);
- $ERR = '';
- eval {
- eval $prereq_out; ## no critic
- $ERR = $@;
- };
- ::is( $@ . $ERR, '', 'prereqs evaluable' );
- ::is_deeply( $PREREQ_PM, { strict => 0 }, ' and looking correct' );
- ::is( $MIN_PERL_VERSION, '5.005', 'min version also correct' );
- }
-}
-
-
-# ----- 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' );
- like( $prereq_out,
- qr/^perl\(perl\) \s* >= 5\.005 \s+ perl\(strict\) \s* >= \s* 0 \s*$/x,
- 'dump has prereqs and perl version' );
-}
-
-
-# ----- 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' );
-}
-
-
-# ----- ppd output -----
-{
- my $ppd_file = 'Min-PerlVers.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{^\s*<PERLCORE VERSION="5,005,0,0" />}m,
- ' .ppd file content good' );
-}
-
-
-# ----- META.yml output -----
-{
- my $distdir = 'Min-PerlVers-0.05';
- $distdir =~ s{\.}{_}g if $Is_VMS;
-
- my $meta_yml = "$distdir/META.yml";
- 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');
-}
-
-__END__
Deleted: trunk/contrib/perl/lib/ExtUtils/t/miniperl.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/miniperl.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/miniperl.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,57 +0,0 @@
-#!/usr/bin/perl -w
-
-# Test that we can build modules as miniperl.
-# This mostly means no XS modules.
-
-BEGIN {
- if ($ENV{PERL_CORE}) {
- chdir 't' if -d 't';
- @INC = qw(../lib lib);
- }
-}
-
-use strict;
-use lib 't/lib';
-
-use Test::More 'no_plan';
-
-BEGIN {
- ok !$INC{"ExtUtils/MakeMaker.pm"}, "MakeMaker is not yet loaded";
-}
-
-# Disable all XS from here on
-use MakeMaker::Test::NoXS;
-
-use ExtUtils::MakeMaker;
-
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::BFD;
-
-
-my $perl = which_perl();
-my $makefile = makefile_name();
-my $make = make_run();
-
-
-# Setup our test environment
-{
- chdir 't';
-
- perl_lib;
-
- ok( setup_recurs(), 'setup' );
- END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
- }
-
- ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
- diag("chdir failed: $!");
-}
-
-
-# Run make once
-{
- run_ok(qq{$perl Makefile.PL});
- run_ok($make);
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/oneliner.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/oneliner.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/oneliner.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,51 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-chdir 't';
-
-use MakeMaker::Test::Utils;
-use Test::More tests => 6;
-use File::Spec;
-
-my $TB = Test::More->builder;
-
-BEGIN { use_ok('ExtUtils::MM') }
-
-my $mm = bless { NAME => "Foo" }, 'MM';
-isa_ok($mm, 'ExtUtils::MakeMaker');
-isa_ok($mm, 'ExtUtils::MM_Any');
-
-
-sub try_oneliner {
- my($code, $switches, $expect, $name) = @_;
- my $cmd = $mm->oneliner($code, $switches);
- $cmd =~ s{\$\(ABSPERLRUN\)}{$^X};
-
- # VMS likes to put newlines at the end of commands if there isn't
- # one already.
- $expect =~ s/([^\n])\z/$1\n/ if $^O eq 'VMS';
-
- $TB->is_eq(scalar `$cmd`, $expect, $name) || $TB->diag("oneliner:\n$cmd");
-}
-
-# Lets see how it deals with quotes.
-try_oneliner(q{print "foo'o", ' bar"ar'}, [], q{foo'o bar"ar}, 'quotes');
-
-# How about dollar signs?
-try_oneliner(q{$PATH = 'foo'; print $PATH},[], q{foo}, 'dollar signs' );
-
-# switches?
-try_oneliner(q{print 'foo'}, ['-l'], "foo\n", 'switches' );
-
-# XXX gotta rethink the newline test. The Makefile does newline
-# escaping, then the shell.
-
Deleted: trunk/contrib/perl/lib/ExtUtils/t/parse_version.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/parse_version.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/parse_version.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,85 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = '../lib';
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use Test::More;
-use ExtUtils::MakeMaker;
-
-my $Has_Version = eval 'require version; "version"->import; 1';
-
-my %versions = (q[$VERSION = '1.00'] => '1.00',
- q[*VERSION = \'1.01'] => '1.01',
- q[($VERSION) = q$Revision: 1.1.1.2 $ =~ /(\d+)/g;] => 32208,
- q[$FOO::VERSION = '1.10';] => '1.10',
- q[*FOO::VERSION = \'1.11';] => '1.11',
- '$VERSION = 0.02' => 0.02,
- '$VERSION = 0.0' => 0.0,
- '$VERSION = -1.0' => -1.0,
- '$VERSION = undef' => 'undef',
- '$wibble = 1.0' => 'undef',
- q[my $VERSION = '1.01'] => 'undef',
- q[local $VERISON = '1.02'] => 'undef',
- q[local $FOO::VERSION = '1.30'] => 'undef',
- q[if( $Foo::VERSION >= 3.00 ) {]=> 'undef',
- q[our $VERSION = '1.23';] => '1.23',
-
- '$Something::VERSION == 1.0' => 'undef',
- '$Something::VERSION <= 1.0' => 'undef',
- '$Something::VERSION >= 1.0' => 'undef',
- '$Something::VERSION != 1.0' => 'undef',
-
- qq[\$Something::VERSION == 1.0\n\$VERSION = 2.3\n] => '2.3',
- qq[\$Something::VERSION == 1.0\n\$VERSION = 2.3\n\$VERSION = 4.5\n] => '2.3',
-
- '$VERSION = sprintf("%d.%03d", q$Revision: 1.1.1.2 $ =~ /(\d+)\.(\d+)/);' => '3.074',
- '$VERSION = substr(q$Revision: 1.1.1.2 $, 10) + 2 . "";' => '4.8',
- );
-
-if( $Has_Version ) {
- $versions{q[use version; $VERSION = qv("1.2.3");]} = qv("1.2.3");
- $versions{q[$VERSION = qv("1.2.3")]} = qv("1.2.3");
-}
-
-plan tests => (2 * keys %versions) + 4;
-
-while( my($code, $expect) = each %versions ) {
- is( parse_version_string($code), $expect, $code );
-}
-
-
-sub parse_version_string {
- my $code = shift;
-
- open(FILE, ">VERSION.tmp") || die $!;
- print FILE "$code\n";
- close FILE;
-
- $_ = 'foo';
- my $version = MM->parse_version('VERSION.tmp');
- is( $_, 'foo', '$_ not leaked by parse_version' );
-
- unlink "VERSION.tmp";
-
- return $version;
-}
-
-
-# This is a specific test to see if a version subroutine in the $VERSION
-# declaration confuses later calls to the version class.
-# [rt.cpan.org 30747]
-SKIP: {
- skip "need version.pm", 4 unless $Has_Version;
- is parse_version_string(q[ $VERSION = '1.00'; sub version { $VERSION } ]),
- '1.00';
- is parse_version_string(q[ use version; $VERSION = version->new("1.2.3") ]),
- qv("1.2.3");
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/pm.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/pm.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/pm.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,47 +0,0 @@
-#!/usr/bin/perl -w
-
-# Test that MakeMaker honors user's PM override.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 6;
-
-use TieOut;
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::BFD;
-
-use ExtUtils::MakeMaker;
-
-chdir 't';
-
-perl_lib();
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
- diag("chdir failed: $!");
-
-ok( my $stdout = tie *STDOUT, 'TieOut' );
-
-{
- my $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- PM => { 'wibble' => 'woof' }
- );
-
- is_deeply( $mm->{PM}, { wibble => 'woof' } );
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/pm_to_blib.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/pm_to_blib.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/pm_to_blib.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,77 +0,0 @@
-#!/usr/bin/perl -w
-
-# Ensure pm_to_blib runs at the right times.
-
-BEGIN {
- if ($ENV{PERL_CORE}) {
- chdir 't' if -d 't';
- @INC = qw(../lib lib);
- }
-}
-
-use strict;
-use lib 't/lib';
-
-use Test::More 'no_plan';
-
-use ExtUtils::MakeMaker;
-
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::BFD;
-
-
-my $perl = which_perl();
-my $makefile = makefile_name();
-my $make = make_run();
-
-
-# Setup our test environment
-{
- chdir 't';
-
- perl_lib;
-
- ok( setup_recurs(), 'setup' );
- END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
- }
-
- ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
- diag("chdir failed: $!");
-}
-
-
-# Run make once
-{
- run_ok(qq{$perl Makefile.PL});
- run_ok($make);
-
- ok( -e "blib/lib/Big/Dummy.pm", "blib copied pm file" );
-}
-
-
-# Change a pm file, it should be copied.
-{
- # Wait a couple seconds else our changed file will have the same timestamp
- # as the blib file
- sleep 2;
-
- ok( open my $fh, ">>", "lib/Big/Dummy.pm" ) or die $!;
- print $fh "Something else\n";
- close $fh;
-
- run_ok($make);
- like slurp("blib/lib/Big/Dummy.pm"), qr/Something else\n$/;
-}
-
-
-# Rerun the Makefile.PL, pm_to_blib should rerun
-{
- run_ok(qq{$perl Makefile.PL});
-
- # XXX This is a fragile way to check that it reran.
- like run_ok($make), qr/^Skip /ms;
-
- ok( -e "blib/lib/Big/Dummy.pm", "blib copied pm file" );
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/pod2man.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/pod2man.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/pod2man.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,54 +0,0 @@
-#!/usr/bin/perl -w
-
-# Test our simulation of pod2man
-
-BEGIN {
- if ($ENV{PERL_CORE}) {
- chdir 't' if -d 't';
- @INC = qw(../lib lib);
- }
-}
-
-use strict;
-use lib 't/lib';
-
-use ExtUtils::Command::MM;
-
-use Test::More tests => 3;
-
-# The argument to perm_rw was optional.
-# [rt.cpan.org 35190]
-{
- my $warnings;
- local $SIG{__WARN__} = sub {
- $warnings .= join '', @_;
- };
-
- pod2man("--perm_rw");
-
- like $warnings, qr/^Option perm_rw requires an argument/;
-};
-
-
-# Simulate the failure of Pod::Man loading.
-# pod2man() should react gracefully.
-{
- local @INC = @INC;
- unshift @INC, sub {
- die "Simulated Pod::Man failure\n" if $_[1] eq 'Pod/Man.pm';
- };
- local %INC = %INC;
- delete $INC{"Pod/Man.pm"};
-
- my $warnings;
- local $SIG{__WARN__} = sub {
- $warnings .= join '', @_;
- };
-
- is pod2man(), undef;
- is $warnings, <<'END'
-Pod::Man is not available: Simulated Pod::Man failure
-Man pages will not be generated during this install.
-END
-
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/postamble.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/postamble.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/postamble.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,73 +0,0 @@
-#!/usr/bin/perl -w
-
-# Wherein we ensure that postamble works ok.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 8;
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::BFD;
-use ExtUtils::MakeMaker;
-use TieOut;
-
-chdir 't';
-perl_lib;
-$| = 1;
-
-my $Makefile = makefile_name;
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-ok( chdir 'Big-Dummy', q{chdir'd to Big-Dummy} ) ||
- diag("chdir failed: $!");
-
-{
- my $warnings = '';
- local $SIG{__WARN__} = sub {
- $warnings = join '', @_;
- };
-
- my $stdout = tie *STDOUT, 'TieOut' or die;
- my $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- postamble => {
- FOO => 1,
- BAR => "fugawazads"
- }
- );
- is( $warnings, '', 'postamble argument not warned about' );
-}
-
-sub MY::postamble {
- my($self, %extra) = @_;
-
- is_deeply( \%extra, { FOO => 1, BAR => 'fugawazads' },
- 'postamble args passed' );
-
- return <<OUT;
-# This makes sure the postamble gets written
-OUT
-
-}
-
-
-ok( open(MAKEFILE, $Makefile) ) or diag "Can't open $Makefile: $!";
-{ local $/;
- like( <MAKEFILE>, qr/^\# This makes sure the postamble gets written\n/m,
- 'postamble added to the Makefile' );
-}
-close MAKEFILE;
Deleted: trunk/contrib/perl/lib/ExtUtils/t/prefixify.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/prefixify.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/prefixify.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,52 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More;
-
-if( $^O eq 'VMS' ) {
- plan skip_all => 'prefixify works differently on VMS';
-}
-else {
- plan tests => 4;
-}
-use ExtUtils::MakeMaker::Config;
-use File::Spec;
-use ExtUtils::MM;
-
-my $Is_Dosish = $^O =~ /^(dos|MSWin32)$/;
-
-my $mm = bless {}, 'MM';
-
-my $default = File::Spec->catdir(qw(this that));
-
-$mm->prefixify('installbin', 'wibble', 'something', $default);
-is( $mm->{INSTALLBIN}, $Config{installbin},
- 'prefixify w/defaults');
-
-$mm->{ARGS}{PREFIX} = 'foo';
-$mm->prefixify('installbin', 'wibble', 'something', $default);
-is( $mm->{INSTALLBIN}, File::Spec->catdir('something', $default),
- 'prefixify w/defaults and PREFIX');
-
-$mm->prefixify('installbin', '../wibble', 'something', $default);
-is( $mm->{INSTALLBIN}, File::Spec->catdir('something', $default),
- 'relative paths + PREFIX');
-
-SKIP: {
- skip "Test for DOSish prefixification", 1 unless $Is_Dosish;
-
- $Config{wibble} = 'C:\opt\perl\wibble';
- $mm->prefixify('wibble', 'C:\opt\perl', 'C:\yarrow');
-
- is( $mm->{WIBBLE}, 'C:\yarrow\wibble', 'prefixify Win32 paths' );
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/prereq.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/prereq.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/prereq.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,133 +0,0 @@
-#!/usr/bin/perl -w
-
-# This is a test of the verification of the arguments to
-# WriteMakefile.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 13;
-
-use TieOut;
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::BFD;
-
-use ExtUtils::MakeMaker;
-
-chdir 't';
-
-perl_lib();
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
- diag("chdir failed: $!");
-
-{
- ok( my $stdout = tie *STDOUT, 'TieOut' );
- my $warnings = '';
- local $SIG{__WARN__} = sub {
- $warnings .= join '', @_;
- };
-
- WriteMakefile(
- NAME => 'Big::Dummy',
- PREREQ_PM => {
- strict => 0
- }
- );
- is $warnings, '';
-
- $warnings = '';
- WriteMakefile(
- NAME => 'Big::Dummy',
- PREREQ_PM => {
- strict => 99999
- }
- );
- is $warnings,
- sprintf("Warning: prerequisite strict 99999 not found. We have %s.\n",
- $strict::VERSION);
-
- $warnings = '';
- WriteMakefile(
- NAME => 'Big::Dummy',
- PREREQ_PM => {
- "I::Do::Not::Exist" => 0,
- }
- );
- is $warnings,
- "Warning: prerequisite I::Do::Not::Exist 0 not found.\n";
-
- $warnings = '';
- WriteMakefile(
- NAME => 'Big::Dummy',
- PREREQ_PM => {
- "I::Do::Not::Exist" => 0,
- "strict" => 99999,
- }
- );
- is $warnings,
- "Warning: prerequisite I::Do::Not::Exist 0 not found.\n".
- sprintf("Warning: prerequisite strict 99999 not found. We have %s.\n",
- $strict::VERSION);
-
- $warnings = '';
- eval {
- WriteMakefile(
- NAME => 'Big::Dummy',
- PREREQ_PM => {
- "I::Do::Not::Exist" => 0,
- "Nor::Do::I" => 0,
- "strict" => 99999,
- },
- PREREQ_FATAL => 1,
- );
- };
-
- is $warnings, '';
- is $@, <<'END', "PREREQ_FATAL";
-MakeMaker FATAL: prerequisites not found.
- I::Do::Not::Exist not installed
- Nor::Do::I not installed
- strict 99999
-
-Please install these modules first and rerun 'perl Makefile.PL'.
-END
-
-
- $warnings = '';
- eval {
- WriteMakefile(
- NAME => 'Big::Dummy',
- PREREQ_PM => {
- "I::Do::Not::Exist" => 0,
- },
- CONFIGURE => sub {
- require I::Do::Not::Exist;
- },
- PREREQ_FATAL => 1,
- );
- };
-
- is $warnings, '';
- is $@, <<'END', "PREREQ_FATAL happens before CONFIGURE";
-MakeMaker FATAL: prerequisites not found.
- I::Do::Not::Exist not installed
-
-Please install these modules first and rerun 'perl Makefile.PL'.
-END
-
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/prereq_print.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/prereq_print.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/prereq_print.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,81 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Config;
-
-use Test::More;
-
-unless( eval { require Data::Dumper } ) {
- plan skip_all => 'Data::Dumper not available';
-}
-
-plan tests => 11;
-
-
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::BFD;
-
-# 'make disttest' sets a bunch of environment variables which interfere
-# with our testing.
-delete @ENV{qw(PREFIX LIB MAKEFLAGS)};
-
-my $Perl = which_perl();
-my $Makefile = makefile_name();
-my $Is_VMS = $^O eq 'VMS';
-
-chdir 't';
-perl_lib;
-
-$| = 1;
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-ok( chdir('Big-Dummy'), "chdir'd to Big-Dummy" ) ||
- diag("chdir failed: $!");
-
-unlink $Makefile;
-my $prereq_out = run(qq{$Perl Makefile.PL "PREREQ_PRINT=1"});
-ok( !-r $Makefile, "PREREQ_PRINT produces no $Makefile" );
-is( $?, 0, ' exited normally' );
-{
- package _Prereq::Print;
- no strict;
- $PREREQ_PM = undef; # shut up "used only once" warning.
- eval $prereq_out;
- ::is_deeply( $PREREQ_PM, { strict => 0 }, 'prereqs dumped' );
- ::is( $@, '', ' without error' );
-}
-
-
-$prereq_out = run(qq{$Perl Makefile.PL "PRINT_PREREQ=1"});
-ok( !-r $Makefile, "PRINT_PREREQ produces no $Makefile" );
-is( $?, 0, ' exited normally' );
-::like( $prereq_out, qr/^perl\(strict\) \s* >= \s* 0 \s*$/x,
- 'prereqs dumped' );
-
-
-# Currently a bug.
-#my $prereq_out = run(qq{$Perl Makefile.PL "PREREQ_PRINT=0"});
-#ok( -r $Makefile, "PREREQ_PRINT=0 produces a $Makefile" );
-#is( $?, 0, ' exited normally' );
-#unlink $Makefile;
-
-# Currently a bug.
-#my $prereq_out = run(qq{$Perl Makefile.PL "PRINT_PREREQ=1"});
-#ok( -r $Makefile, "PRINT_PREREQ=0 produces a $Makefile" );
-#is( $?, 0, ' exited normally' );
-#unlink $Makefile;
Deleted: trunk/contrib/perl/lib/ExtUtils/t/problems.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/problems.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/problems.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,47 +0,0 @@
-# Test problems in Makefile.PL's and hint files.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-chdir 't';
-
-use strict;
-use Test::More tests => 6;
-use ExtUtils::MM;
-use MakeMaker::Test::Setup::Problem;
-use TieOut;
-
-my $MM = bless { DIR => ['subdir'] }, 'MM';
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-ok( chdir 'Problem-Module', "chdir'd to Problem-Module" ) ||
- diag("chdir failed: $!");
-
-
-# Make sure when Makefile.PL's break, they issue a warning.
-# Also make sure Makefile.PL's in subdirs still have '.' in @INC.
-{
- my $stdout = tie *STDOUT, 'TieOut' or die;
-
- my $warning = '';
- local $SIG{__WARN__} = sub { $warning = join '', @_ };
- eval { $MM->eval_in_subdirs; };
-
- is( $stdout->read, qq{\@INC has .\n}, 'cwd in @INC' );
- like( $@,
- qr{^ERROR from evaluation of .*subdir.*Makefile.PL: YYYAaaaakkk},
- 'Makefile.PL death in subdir warns' );
-
- untie *STDOUT;
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/prompt.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/prompt.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/prompt.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,56 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 11;
-use ExtUtils::MakeMaker;
-use TieOut;
-use TieIn;
-
-eval q{
- prompt();
-};
-like( $@, qr/^Not enough arguments for ExtUtils::MakeMaker::prompt/,
- 'no args' );
-
-eval {
- prompt(undef);
-};
-like( $@, qr/^prompt function called without an argument/,
- 'undef message' );
-
-my $stdout = tie *STDOUT, 'TieOut' or die;
-
-
-$ENV{PERL_MM_USE_DEFAULT} = 1;
-is( prompt("Foo?"), '', 'no default' );
-like( $stdout->read, qr/^Foo\?\s*\n$/, ' question' );
-
-is( prompt("Foo?", undef), '', 'undef default' );
-like( $stdout->read, qr/^Foo\?\s*\n$/, ' question' );
-
-is( prompt("Foo?", 'Bar!'), 'Bar!', 'default' );
-like( $stdout->read, qr/^Foo\? \[Bar!\]\s+Bar!\n$/, ' question' );
-
-
-SKIP: {
- skip "eof() doesn't honor ties in 5.5.3", 3 if $] < 5.006;
-
- $ENV{PERL_MM_USE_DEFAULT} = 0;
- close STDIN;
- my $stdin = tie *STDIN, 'TieIn' or die;
- $stdin->write("From STDIN");
- ok( !-t STDIN, 'STDIN not a tty' );
-
- is( prompt("Foo?", 'Bar!'), 'From STDIN', 'from STDIN' );
- like( $stdout->read, qr/^Foo\? \[Bar!\]\s*$/, ' question' );
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/recurs.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/recurs.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/recurs.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,122 +0,0 @@
-#!/usr/bin/perl -w
-
-# This tests MakeMaker against recursive builds
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Config;
-
-use Test::More tests => 26;
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::Recurs;
-
-# 'make disttest' sets a bunch of environment variables which interfere
-# with our testing.
-delete @ENV{qw(PREFIX LIB MAKEFLAGS)};
-
-my $perl = which_perl();
-my $Is_VMS = $^O eq 'VMS';
-
-chdir('t');
-
-perl_lib;
-
-my $Touch_Time = calibrate_mtime();
-
-$| = 1;
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-ok( chdir('Recurs'), q{chdir'd to Recurs} ) ||
- diag("chdir failed: $!");
-
-
-# Check recursive Makefile building.
-my @mpl_out = run(qq{$perl Makefile.PL});
-
-cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
- diag(@mpl_out);
-
-my $makefile = makefile_name();
-
-ok( -e $makefile, 'Makefile written' );
-ok( -e File::Spec->catfile('prj2',$makefile), 'sub Makefile written' );
-
-my $make = make_run();
-
-my $make_out = run("$make");
-is( $?, 0, 'recursive make exited normally' ) || diag $make_out;
-
-ok( chdir File::Spec->updir );
-ok( teardown_recurs(), 'cleaning out recurs' );
-ok( setup_recurs(), ' setting up fresh copy' );
-ok( chdir('Recurs'), q{chdir'd to Recurs} ) ||
- diag("chdir failed: $!");
-
-
-# Check NORECURS
- at mpl_out = run(qq{$perl Makefile.PL "NORECURS=1"});
-
-cmp_ok( $?, '==', 0, 'Makefile.PL NORECURS=1 exited with zero' ) ||
- diag(@mpl_out);
-
-$makefile = makefile_name();
-
-ok( -e $makefile, 'Makefile written' );
-ok( !-e File::Spec->catfile('prj2',$makefile), 'sub Makefile not written' );
-
-$make = make_run();
-
-run("$make");
-is( $?, 0, 'recursive make exited normally' );
-
-
-ok( chdir File::Spec->updir );
-ok( teardown_recurs(), 'cleaning out recurs' );
-ok( setup_recurs(), ' setting up fresh copy' );
-ok( chdir('Recurs'), q{chdir'd to Recurs} ) ||
- diag("chdir failed: $!");
-
-
-# Check that arguments aren't stomped when they have .. prepended
-# [rt.perl.org 4345]
- at mpl_out = run(qq{$perl Makefile.PL "INST_SCRIPT=cgi"});
-
-cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
- diag(@mpl_out);
-
-$makefile = makefile_name();
-my $submakefile = File::Spec->catfile('prj2',$makefile);
-
-ok( -e $makefile, 'Makefile written' );
-ok( -e $submakefile, 'sub Makefile written' );
-
-my $inst_script = File::Spec->catdir(File::Spec->updir, 'cgi');
-ok( open(MAKEFILE, $submakefile) ) || diag("Can't open $submakefile: $!");
-{ local $/;
- like( <MAKEFILE>, qr/^\s*INST_SCRIPT\s*=\s*\Q$inst_script\E/m,
- 'prepend .. not stomping WriteMakefile args' )
-}
-close MAKEFILE;
-
-
-{
- # Quiet "make test" failure noise
- close *STDERR;
-
- my $test_out = run("$make test");
- isnt $?, 0, 'test failure in a subdir causes make to fail';
-}
\ No newline at end of file
Deleted: trunk/contrib/perl/lib/ExtUtils/t/revision.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/revision.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/revision.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,23 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use Test::More tests => 4;
-
-BEGIN {
- use_ok 'ExtUtils::MakeMaker';
- use_ok 'ExtUtils::MM_VMS';
-}
-
-# Why 1? Because a common mistake is for the regex to run in scalar context
-# thus getting the count of captured elements (1) rather than the value of $1
-cmp_ok $ExtUtils::MakeMaker::Revision, '>', 1;
-cmp_ok $ExtUtils::MM_VMS::Revision, '>', 1;
Deleted: trunk/contrib/perl/lib/ExtUtils/t/split_command.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/split_command.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/split_command.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,66 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-chdir 't';
-
-use ExtUtils::MM;
-use MakeMaker::Test::Utils;
-
-my $Is_VMS = $^O eq 'VMS';
-my $Is_Win32 = $^O eq 'MSWin32';
-
-use Test::More tests => 7;
-
-my $perl = which_perl;
-my $mm = bless { NAME => "Foo" }, "MM";
-
-# I don't expect anything to have a length shorter than 256 chars.
-cmp_ok( $mm->max_exec_len, '>=', 256, 'max_exec_len' );
-
-my $echo = $mm->oneliner(q{print @ARGV}, ['-l']);
-
-# Force a short command length to make testing split_command easier.
-$mm->{_MAX_EXEC_LEN} = length($echo) + 15;
-is( $mm->max_exec_len, $mm->{_MAX_EXEC_LEN}, ' forced a short max_exec_len' );
-
-my @test_args = qw(foo bar baz yar car har ackapicklerootyjamboree);
-my @cmds = $mm->split_command($echo, @test_args);
-isnt( @cmds, 0 );
-
- at results = _run(@cmds);
-is( join('', @results), join('', @test_args));
-
-
-my %test_args = ( foo => 42, bar => 23, car => 'har' );
-$even_args = $mm->oneliner(q{print !(@ARGV % 2)});
- at cmds = $mm->split_command($even_args, %test_args);
-isnt( @cmds, 0 );
-
- at results = _run(@cmds);
-like( join('', @results ), qr/^1+$/, 'pairs preserved' );
-
-is( $mm->split_command($echo), 0, 'no args means no commands' );
-
-
-sub _run {
- my @cmds = @_;
-
- s{\$\(ABSPERLRUN\)}{$perl} foreach @cmds;
- if( $Is_VMS ) {
- s{-\n}{} foreach @cmds
- }
- elsif( $Is_Win32 ) {
- s{\\\n}{} foreach @cmds;
- }
-
- return map { s/\n+$//; $_ } map { `$_` } @cmds
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/test_boilerplate.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/test_boilerplate.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/test_boilerplate.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,26 +0,0 @@
-#!/usr/bin/perl -w
-
-# <<<Fill in with what this test does.>>>
-# Copy this when writing new tests to avoid forgetting the core boilerplate
-
-# Magic for core
-BEGIN {
- # Always run in t to unify behavor with core
- chdir 't' if -d 't';
-
- # Only use the about to be installed modules
- if( $ENV{PERL_CORE} ) {
- @INC = '../lib';
- }
-}
-
-# Use things from t/lib/
-use lib './lib';
-use strict;
-use ExtUtils::MakeMaker;
-
-use Test::More;
-
-pass("Your test code goes here");
-
-done_testing();
Deleted: trunk/contrib/perl/lib/ExtUtils/t/testlib.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/testlib.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/testlib.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,37 +0,0 @@
-#!/usr/bin/perl -Tw
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = '../lib';
- }
- else {
- # ./lib is there so t/lib can be seen even after we chdir.
- unshift @INC, 't/lib', './lib';
- }
-}
-chdir 't';
-
-use Test::More tests => 5;
-
-BEGIN {
- # non-core tests will have blib in their path. We remove it
- # and just use the one in lib/.
- unless( $ENV{PERL_CORE} ) {
- @INC = grep !/blib/, @INC;
- unshift @INC, '../lib';
- }
-}
-
-my @blib_paths = grep /blib/, @INC;
-is( @blib_paths, 0, 'No blib dirs yet in @INC' );
-
-use_ok( 'ExtUtils::testlib' );
-
- at blib_paths = grep { /blib/ } @INC;
-is( @blib_paths, 2, 'ExtUtils::testlib added two @INC dirs!' );
-ok( !(grep !File::Spec->file_name_is_absolute($_), @blib_paths),
- ' and theyre absolute');
-
-eval { eval "# @INC"; };
-is( $@, '', '@INC is not tainted' );
Deleted: trunk/contrib/perl/lib/ExtUtils/t/writemakefile_args.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/writemakefile_args.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/writemakefile_args.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,221 +0,0 @@
-#!/usr/bin/perl -w
-
-# This is a test of the verification of the arguments to
-# WriteMakefile.
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't' if -d 't';
- @INC = ('../lib', 'lib');
- }
- else {
- unshift @INC, 't/lib';
- }
-}
-
-use strict;
-use Test::More tests => 35;
-
-use TieOut;
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::BFD;
-
-use ExtUtils::MakeMaker;
-
-chdir 't';
-
-perl_lib();
-
-ok( setup_recurs(), 'setup' );
-END {
- ok( chdir File::Spec->updir );
- ok( teardown_recurs(), 'teardown' );
-}
-
-ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
- diag("chdir failed: $!");
-
-{
- ok( my $stdout = tie *STDOUT, 'TieOut' );
- my $warnings = '';
- local $SIG{__WARN__} = sub {
- $warnings .= join '', @_;
- };
-
- my $mm;
-
- eval {
- $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- MAN3PODS => ' ', # common mistake
- );
- };
-
- is( $warnings, <<VERIFY );
-WARNING: MAN3PODS takes a HASH reference not a string/number.
- Please inform the author.
-VERIFY
-
- $warnings = '';
- eval {
- $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- AUTHOR => sub {},
- );
- };
-
- is( $warnings, <<VERIFY );
-WARNING: AUTHOR takes a string/number not a CODE reference.
- Please inform the author.
-VERIFY
-
- # LIBS accepts *both* a string or an array ref. The first cut of
- # our verification did not take this into account.
- $warnings = '';
- $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- LIBS => '-lwibble -lwobble',
- );
-
- # We'll get warnings about the bogus libs, that's ok.
- unlike( $warnings, qr/WARNING: .* takes/ );
- is_deeply( $mm->{LIBS}, ['-lwibble -lwobble'] );
-
- $warnings = '';
- $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- LIBS => ['-lwibble', '-lwobble'],
- );
-
- # We'll get warnings about the bogus libs, that's ok.
- unlike( $warnings, qr/WARNING: .* takes/ );
- is_deeply( $mm->{LIBS}, ['-lwibble', '-lwobble'] );
-
- $warnings = '';
- eval {
- $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION_FROM => 'lib/Big/Dummy.pm',
- LIBS => { wibble => "wobble" },
- );
- };
-
- # We'll get warnings about the bogus libs, that's ok.
- like( $warnings, qr{^WARNING: LIBS takes a ARRAY reference or string/number not a HASH reference}m );
-
-
- $warnings = '';
- $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- WIBBLE => 'something',
- wump => { foo => 42 },
- );
-
- like( $warnings, qr{^WARNING: WIBBLE is not a known parameter.\n}m );
- like( $warnings, qr{^WARNING: wump is not a known parameter.\n}m );
-
- is( $mm->{WIBBLE}, 'something' );
- is_deeply( $mm->{wump}, { foo => 42 } );
-
-
- # Test VERSION
- $warnings = '';
- eval {
- $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION => [1,2,3],
- );
- };
- like( $warnings, qr{^WARNING: VERSION takes a version object or string/number} );
-
- $warnings = '';
- eval {
- $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION => 1.002_003,
- );
- };
- is( $warnings, '' );
- is( $mm->{VERSION}, '1.002003' );
-
- $warnings = '';
- eval {
- $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION => '1.002_003',
- );
- };
- is( $warnings, '' );
- is( $mm->{VERSION}, '1.002_003' );
-
-
- $warnings = '';
- eval {
- $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION => bless {}, "Some::Class",
- );
- };
- like( $warnings, '/^WARNING: VERSION takes a version object or string/number not a Some::Class object/' );
-
-
- SKIP: {
- skip("Can't test version objects", 8) unless eval { require version };
- version->import;
-
- my $version = version->new("1.2.3");
- $warnings = '';
- ok eval {
- $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION => $version,
- );
- } || diag $@;
- is( $warnings, '' );
- isa_ok( $mm->{VERSION}, 'version' );
- is( $mm->{VERSION}, $version );
-
- $warnings = '';
- $version = qv('1.2.3');
- ok eval {
- $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION => $version,
- );
- } || diag $@;
- is( $warnings, '' );
- isa_ok( $mm->{VERSION}, 'version' );
- is( $mm->{VERSION}, $version );
- }
-
-
- # DISTNAME
- $warnings = '';
- eval {
- $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION => '1.00',
- DISTNAME => "Hooballa",
- );
- };
- is( $warnings, '' );
- is( $mm->{DISTNAME}, "Hooballa" );
- is( $mm->{DISTVNAME}, $Is_VMS ? "Hooballa-1_00" : "Hooballa-1.00" );
-
-
- # DISTVNAME (rt.cpan.org 43217)
- $warnings = '';
- eval {
- $mm = WriteMakefile(
- NAME => 'Big::Dummy',
- VERSION => 1.00,
- DISTVNAME => "Hooballoo",
- );
- };
- is( $warnings, '' );
- is( $mm->{DISTVNAME}, 'Hooballoo' );
-}
Deleted: trunk/contrib/perl/lib/ExtUtils/t/xs.t
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/t/xs.t 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/t/xs.t 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,64 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN {
- if( $ENV{PERL_CORE} ) {
- chdir 't';
- @INC = ('../lib', 'lib/');
- }
- else {
- unshift @INC, 't/lib/';
- }
-}
-chdir 't';
-
-use strict;
-
-use Test::More;
-use MakeMaker::Test::Utils;
-use MakeMaker::Test::Setup::XS;
-use File::Find;
-use File::Spec;
-use File::Path;
-
-my $Skipped = 0;
-if( have_compiler() ) {
- plan tests => 5;
-}
-else {
- $Skipped = 1;
- plan skip_all => "ExtUtils::CBuilder not installed or couldn't find a compiler";
-}
-
-my $Is_VMS = $^O eq 'VMS';
-my $perl = which_perl();
-
-chdir 't';
-
-perl_lib;
-
-$| = 1;
-
-ok( setup_xs(), 'setup' );
-END {
- unless( $Skipped ) {
- chdir File::Spec->updir or die;
- teardown_xs(), 'teardown' or die;
- }
-}
-
-ok( chdir('XS-Test'), "chdir'd to XS-Test" ) ||
- diag("chdir failed: $!");
-
-my @mpl_out = run(qq{$perl Makefile.PL});
-
-cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
- diag(@mpl_out);
-
-my $make = make_run();
-my $make_out = run("$make");
-is( $?, 0, ' make exited normally' ) ||
- diag $make_out;
-
-my $test_out = run("$make");
-is( $?, 0, ' make test exited normally' ) ||
- diag $test_out;
Deleted: trunk/contrib/perl/lib/ExtUtils/testlib.pm
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/testlib.pm 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/testlib.pm 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,41 +0,0 @@
-package ExtUtils::testlib;
-
-use strict;
-use warnings;
-
-our $VERSION = 6.55_02;
-
-use Cwd;
-use File::Spec;
-
-# So the tests can chdir around and not break @INC.
-# We use getcwd() because otherwise rel2abs will blow up under taint
-# mode pre-5.8. We detaint is so @INC won't be tainted. This is
-# no worse, and probably better, than just shoving an untainted,
-# relative "blib/lib" onto @INC.
-my $cwd;
-BEGIN {
- ($cwd) = getcwd() =~ /(.*)/;
-}
-use lib map { File::Spec->rel2abs($_, $cwd) } qw(blib/arch blib/lib);
-1;
-__END__
-
-=head1 NAME
-
-ExtUtils::testlib - add blib/* directories to @INC
-
-=head1 SYNOPSIS
-
- use ExtUtils::testlib;
-
-=head1 DESCRIPTION
-
-After an extension has been built and before it is installed it may be
-desirable to test it bypassing C<make test>. By adding
-
- use ExtUtils::testlib;
-
-to a test program the intermediate directories used by C<make> are
-added to @INC.
-
Deleted: trunk/contrib/perl/lib/ExtUtils/xsubpp
===================================================================
--- trunk/contrib/perl/lib/ExtUtils/xsubpp 2013-12-04 00:48:19 UTC (rev 6452)
+++ trunk/contrib/perl/lib/ExtUtils/xsubpp 2013-12-04 01:19:50 UTC (rev 6453)
@@ -1,156 +0,0 @@
-#!./miniperl
-
-require 5.002;
-use ExtUtils::ParseXS qw(process_file);
-use Getopt::Long;
-
-my %args = ();
-
-my $usage = "Usage: xsubpp [-v] [-csuffix csuffix] [-except] [-prototypes] [-noversioncheck] [-nolinenumbers] [-nooptimize] [-noinout] [-noargtypes] [-s pattern] [-typemap typemap]... file.xs\n";
-
-Getopt::Long::Configure qw(no_auto_abbrev no_ignore_case);
-
- at ARGV = grep {$_ ne '-C++'} @ARGV; # Allow -C++ for backward compatibility
-GetOptions(\%args, qw(hiertype!
- prototypes!
- versioncheck!
- linenumbers!
- optimize!
- inout!
- argtypes!
- object_capi!
- except!
- v
- typemap=s@
- output=s
- s=s
- csuffix=s
- ))
- or die $usage;
-
-if ($args{v}) {
- print "xsubpp version $ExtUtils::ParseXS::VERSION\n";
- exit;
-}
-
- at ARGV == 1 or die $usage;
-
-$args{filename} = shift @ARGV;
-
-process_file(%args);
-exit( ExtUtils::ParseXS::errors() ? 1 : 0 );
-
-__END__
-
-=head1 NAME
-
-xsubpp - compiler to convert Perl XS code into C code
-
-=head1 SYNOPSIS
-
-B<xsubpp> [B<-v>] [B<-except>] [B<-s pattern>] [B<-prototypes>] [B<-noversioncheck>] [B<-nolinenumbers>] [B<-nooptimize>] [B<-typemap typemap>] [B<-output filename>]... file.xs
-
-=head1 DESCRIPTION
-
-This compiler is typically run by the makefiles created by L<ExtUtils::MakeMaker>.
-
-I<xsubpp> will compile XS code into C code by embedding the constructs
-necessary to let C functions manipulate Perl values and creates the glue
-necessary to let Perl access those functions. The compiler uses typemaps to
-determine how to map C function parameters and variables to Perl values.
-
-The compiler will search for typemap files called I<typemap>. It will use
-the following search path to find default typemaps, with the rightmost
-typemap taking precedence.
-
- ../../../typemap:../../typemap:../typemap:typemap
-
-It will also use a default typemap installed as C<ExtUtils::typemap>.
-
-=head1 OPTIONS
-
-Note that the C<XSOPT> MakeMaker option may be used to add these options to
-any makefiles generated by MakeMaker.
-
-=over 5
-
-=item B<-hiertype>
-
-Retains '::' in type names so that C++ hierarchical types can be mapped.
-
-=item B<-except>
-
-Adds exception handling stubs to the C code.
-
-=item B<-typemap typemap>
-
-Indicates that a user-supplied typemap should take precedence over the
-default typemaps. This option may be used multiple times, with the last
-typemap having the highest precedence.
-
-=item B<-output filename>
-
-Specifies the name of the output file to generate. If no file is
-specified, output will be written to standard output.
-
-=item B<-v>
-
-Prints the I<xsubpp> version number to standard output, then exits.
-
-=item B<-prototypes>
-
-By default I<xsubpp> will not automatically generate prototype code for
-all xsubs. This flag will enable prototypes.
-
-=item B<-noversioncheck>
-
-Disables the run time test that determines if the object file (derived
-from the C<.xs> file) and the C<.pm> files have the same version
-number.
-
-=item B<-nolinenumbers>
-
-Prevents the inclusion of `#line' directives in the output.
-
-=item B<-nooptimize>
-
-Disables certain optimizations. The only optimization that is currently
-affected is the use of I<target>s by the output C code (see L<perlguts>).
-This may significantly slow down the generated code, but this is the way
-B<xsubpp> of 5.005 and earlier operated.
-
-=item B<-noinout>
-
-Disable recognition of C<IN>, C<OUT_LIST> and C<INOUT_LIST> declarations.
-
-=item B<-noargtypes>
-
-Disable recognition of ANSI-like descriptions of function signature.
-
-=item B<-C++>
-
-Currently doesn't do anything at all. This flag has been a no-op for
-many versions of perl, at least as far back as perl5.003_07. It's
-allowed here for backwards compatibility.
-
-=back
-
-=head1 ENVIRONMENT
-
-No environment variables are used.
-
-=head1 AUTHOR
-
-Originally by Larry Wall. Turned into the C<ExtUtils::ParseXS> module
-by Ken Williams.
-
-=head1 MODIFICATION HISTORY
-
-See the file F<Changes>.
-
-=head1 SEE ALSO
-
-perl(1), perlxs(1), perlxstut(1), ExtUtils::ParseXS
-
-=cut
-
More information about the Midnightbsd-cvs
mailing list