Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove inc directory.

  • Loading branch information...
commit 01fb2088d9cd917cea9b70f1c9e1785f8f7fa862 1 parent 9af2e8a
Yusuke Wada authored
2  .gitignore
View
@@ -5,10 +5,12 @@ blib
pm_to_blib
MANIFEST
Makefile.old
+MYMETA.*
nytprof.out
MANIFEST.bak
*.sw[po]
MYMETA.*
+inc/
.DS_Store
._*
.Spotlight-V100
1,138 inc/ExtUtils/MakeMaker.pm
View
@@ -1,1138 +0,0 @@
-#line 1
-# $Id$
-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.62';
-$VERSION = eval $VERSION;
-
-# Emulate something resembling CVS $Revision$
-(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 {
- croak "WriteMakefile: Need even number of args" if @_ % 2;
-
- require ExtUtils::MY;
- my %att = @_;
-
- _convert_compat_attrs(\%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 = (
- AUTHOR => 'ARRAY',
- 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',
-);
-
-@Att_Sigs{keys %Recognized_Att_Keys} = ('') x keys %Recognized_Att_Keys;
-@Att_Sigs{keys %Special_Sigs} = values %Special_Sigs;
-
-sub _convert_compat_attrs { #result of running several times should be same
- my($att) = @_;
- if (exists $att->{AUTHOR}) {
- if ($att->{AUTHOR}) {
- if (!ref($att->{AUTHOR})) {
- my $t = $att->{AUTHOR};
- $att->{AUTHOR} = [$t];
- }
- } else {
- $att->{AUTHOR} = [];
- }
- }
-}
-
-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) = @_;
- 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("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 NO_MYMETA 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);
-
- _convert_compat_attrs($self) if defined $self && $self;
-
- # Store the original args passed to WriteMakefile()
- foreach my $k (keys %$self) {
- $self->{ARGS}{$k} = $self->{$k};
- }
-
- $self = {} unless defined $self;
-
- # 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";
-
- # Cleanup all the module requirement bits
- for my $key (qw(PREREQ_PM BUILD_REQUIRES CONFIGURE_REQUIRES)) {
- $self->{$key} ||= {};
- $self->clean_versions( $key );
- }
-
-
- 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" && ! $ENV{PERL_CORE}){
- 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) {
- die <<'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}
- or $ENV{PERL_CORE};
-
- $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}
- or $ENV{PERL_CORE};
-
- $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}}};
- _convert_compat_attrs(\%configure_att);
- $self = { %$self, %configure_att };
- } else {
- 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("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,@fm) if @fm;
- } else {
- parse_args($self,split(' ', $ENV{PERL_MM_OPT} || ''),@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 {
- 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: $!";
-}
-
-
-#line 745
-
-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
-
- foreach my $key (sort keys %$att){
- next if $key eq 'ARGS';
- my ($v) = neatvalue($att->{$key});
- if ($key eq 'PREREQ_PM') {
- # CPAN.pm takes prereqs from this field in 'Makefile'
- # and does not know about BUILD_REQUIRES
- $v = neatvalue({ %{ $att->{PREREQ_PM} || {} }, %{ $att->{BUILD_REQUIRES} || {} } });
- } else {
- $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"
- or die "Can't write to MakeMaker.tmp: $!";
- }
-
- close $fh
- or die "Can't write to MakeMaker.tmp: $!";
- _rename("MakeMaker.tmp", $finalname) or
- warn "rename MakeMaker.tmp => $finalname: $!";
- chmod 0644, $finalname unless $Is_VMS;
-
- unless ($self->{NO_MYMETA}) {
- # Write MYMETA.yml to communicate metadata up to the CPAN clients
- if ( $self->write_mymeta( $self->mymeta ) ) {;
- print STDOUT "Writing MYMETA.yml and MYMETA.json\n";
- }
-
- }
- 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(', ',@m)." }";
-}
-
-# Look for weird version numbers, warn about them and set them to 0
-# before CPAN::Meta chokes.
-sub clean_versions {
- my($self, $key) = @_;
-
- my $reqs = $self->{$key};
- for my $module (keys %$reqs) {
- my $version = $reqs->{$module};
-
- if( !defined $version or $version !~ /^[\d_\.]+$/ ) {
- carp "Unparsable version '$version' for prerequisite $module";
- $reqs->{$module} = 0;
- }
- }
-}
-
-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__
-
-#line 2882
470 inc/Module/Install.pm
View
@@ -1,470 +0,0 @@
-#line 1
-package Module::Install;
-
-# For any maintainers:
-# The load order for Module::Install is a bit magic.
-# It goes something like this...
-#
-# IF ( host has Module::Install installed, creating author mode ) {
-# 1. Makefile.PL calls "use inc::Module::Install"
-# 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install
-# 3. The installed version of inc::Module::Install loads
-# 4. inc::Module::Install calls "require Module::Install"
-# 5. The ./inc/ version of Module::Install loads
-# } ELSE {
-# 1. Makefile.PL calls "use inc::Module::Install"
-# 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install
-# 3. The ./inc/ version of Module::Install loads
-# }
-
-use 5.005;
-use strict 'vars';
-use Cwd ();
-use File::Find ();
-use File::Path ();
-
-use vars qw{$VERSION $MAIN};
-BEGIN {
- # All Module::Install core packages now require synchronised versions.
- # This will be used to ensure we don't accidentally load old or
- # different versions of modules.
- # This is not enforced yet, but will be some time in the next few
- # releases once we can make sure it won't clash with custom
- # Module::Install extensions.
- $VERSION = '1.04';
-
- # Storage for the pseudo-singleton
- $MAIN = undef;
-
- *inc::Module::Install::VERSION = *VERSION;
- @inc::Module::Install::ISA = __PACKAGE__;
-
-}
-
-sub import {
- my $class = shift;
- my $self = $class->new(@_);
- my $who = $self->_caller;
-
- #-------------------------------------------------------------
- # all of the following checks should be included in import(),
- # to allow "eval 'require Module::Install; 1' to test
- # installation of Module::Install. (RT #51267)
- #-------------------------------------------------------------
-
- # Whether or not inc::Module::Install is actually loaded, the
- # $INC{inc/Module/Install.pm} is what will still get set as long as
- # the caller loaded module this in the documented manner.
- # If not set, the caller may NOT have loaded the bundled version, and thus
- # they may not have a MI version that works with the Makefile.PL. This would
- # result in false errors or unexpected behaviour. And we don't want that.
- my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
- unless ( $INC{$file} ) { die <<"END_DIE" }
-
-Please invoke ${\__PACKAGE__} with:
-
- use inc::${\__PACKAGE__};
-
-not:
-
- use ${\__PACKAGE__};
-
-END_DIE
-
- # This reportedly fixes a rare Win32 UTC file time issue, but
- # as this is a non-cross-platform XS module not in the core,
- # we shouldn't really depend on it. See RT #24194 for detail.
- # (Also, this module only supports Perl 5.6 and above).
- eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006;
-
- # If the script that is loading Module::Install is from the future,
- # then make will detect this and cause it to re-run over and over
- # again. This is bad. Rather than taking action to touch it (which
- # is unreliable on some platforms and requires write permissions)
- # for now we should catch this and refuse to run.
- if ( -f $0 ) {
- my $s = (stat($0))[9];
-
- # If the modification time is only slightly in the future,
- # sleep briefly to remove the problem.
- my $a = $s - time;
- if ( $a > 0 and $a < 5 ) { sleep 5 }
-
- # Too far in the future, throw an error.
- my $t = time;
- if ( $s > $t ) { die <<"END_DIE" }
-
-Your installer $0 has a modification time in the future ($s > $t).
-
-This is known to create infinite loops in make.
-
-Please correct this, then run $0 again.
-
-END_DIE
- }
-
-
- # Build.PL was formerly supported, but no longer is due to excessive
- # difficulty in implementing every single feature twice.
- if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" }
-
-Module::Install no longer supports Build.PL.
-
-It was impossible to maintain duel backends, and has been deprecated.
-
-Please remove all Build.PL files and only use the Makefile.PL installer.
-
-END_DIE
-
- #-------------------------------------------------------------
-
- # To save some more typing in Module::Install installers, every...
- # use inc::Module::Install
- # ...also acts as an implicit use strict.
- $^H |= strict::bits(qw(refs subs vars));
-
- #-------------------------------------------------------------
-
- unless ( -f $self->{file} ) {
- foreach my $key (keys %INC) {
- delete $INC{$key} if $key =~ /Module\/Install/;
- }
-
- local $^W;
- require "$self->{path}/$self->{dispatch}.pm";
- File::Path::mkpath("$self->{prefix}/$self->{author}");
- $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self );
- $self->{admin}->init;
- @_ = ($class, _self => $self);
- goto &{"$self->{name}::import"};
- }
-
- local $^W;
- *{"${who}::AUTOLOAD"} = $self->autoload;
- $self->preload;
-
- # Unregister loader and worker packages so subdirs can use them again
- delete $INC{'inc/Module/Install.pm'};
- delete $INC{'Module/Install.pm'};
-
- # Save to the singleton
- $MAIN = $self;
-
- return 1;
-}
-
-sub autoload {
- my $self = shift;
- my $who = $self->_caller;
- my $cwd = Cwd::cwd();
- my $sym = "${who}::AUTOLOAD";
- $sym->{$cwd} = sub {
- my $pwd = Cwd::cwd();
- if ( my $code = $sym->{$pwd} ) {
- # Delegate back to parent dirs
- goto &$code unless $cwd eq $pwd;
- }
- unless ($$sym =~ s/([^:]+)$//) {
- # XXX: it looks like we can't retrieve the missing function
- # via $$sym (usually $main::AUTOLOAD) in this case.
- # I'm still wondering if we should slurp Makefile.PL to
- # get some context or not ...
- my ($package, $file, $line) = caller;
- die <<"EOT";
-Unknown function is found at $file line $line.
-Execution of $file aborted due to runtime errors.
-
-If you're a contributor to a project, you may need to install
-some Module::Install extensions from CPAN (or other repository).
-If you're a user of a module, please contact the author.
-EOT
- }
- my $method = $1;
- if ( uc($method) eq $method ) {
- # Do nothing
- return;
- } elsif ( $method =~ /^_/ and $self->can($method) ) {
- # Dispatch to the root M:I class
- return $self->$method(@_);
- }
-
- # Dispatch to the appropriate plugin
- unshift @_, ( $self, $1 );
- goto &{$self->can('call')};
- };
-}
-
-sub preload {
- my $self = shift;
- unless ( $self->{extensions} ) {
- $self->load_extensions(
- "$self->{prefix}/$self->{path}", $self
- );
- }
-
- my @exts = @{$self->{extensions}};
- unless ( @exts ) {
- @exts = $self->{admin}->load_all_extensions;
- }
-
- my %seen;
- foreach my $obj ( @exts ) {
- while (my ($method, $glob) = each %{ref($obj) . '::'}) {
- next unless $obj->can($method);
- next if $method =~ /^_/;
- next if $method eq uc($method);
- $seen{$method}++;
- }
- }
-
- my $who = $self->_caller;
- foreach my $name ( sort keys %seen ) {
- local $^W;
- *{"${who}::$name"} = sub {
- ${"${who}::AUTOLOAD"} = "${who}::$name";
- goto &{"${who}::AUTOLOAD"};
- };
- }
-}
-
-sub new {
- my ($class, %args) = @_;
-
- delete $INC{'FindBin.pm'};
- {
- # to suppress the redefine warning
- local $SIG{__WARN__} = sub {};
- require FindBin;
- }
-
- # ignore the prefix on extension modules built from top level.
- my $base_path = Cwd::abs_path($FindBin::Bin);
- unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) {
- delete $args{prefix};
- }
- return $args{_self} if $args{_self};
-
- $args{dispatch} ||= 'Admin';
- $args{prefix} ||= 'inc';
- $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author');
- $args{bundle} ||= 'inc/BUNDLES';
- $args{base} ||= $base_path;
- $class =~ s/^\Q$args{prefix}\E:://;
- $args{name} ||= $class;
- $args{version} ||= $class->VERSION;
- unless ( $args{path} ) {
- $args{path} = $args{name};
- $args{path} =~ s!::!/!g;
- }
- $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
- $args{wrote} = 0;
-
- bless( \%args, $class );
-}
-
-sub call {
- my ($self, $method) = @_;
- my $obj = $self->load($method) or return;
- splice(@_, 0, 2, $obj);
- goto &{$obj->can($method)};
-}
-
-sub load {
- my ($self, $method) = @_;
-
- $self->load_extensions(
- "$self->{prefix}/$self->{path}", $self
- ) unless $self->{extensions};
-
- foreach my $obj (@{$self->{extensions}}) {
- return $obj if $obj->can($method);
- }
-
- my $admin = $self->{admin} or die <<"END_DIE";
-The '$method' method does not exist in the '$self->{prefix}' path!
-Please remove the '$self->{prefix}' directory and run $0 again to load it.
-END_DIE
-
- my $obj = $admin->load($method, 1);
- push @{$self->{extensions}}, $obj;
-
- $obj;
-}
-
-sub load_extensions {
- my ($self, $path, $top) = @_;
-
- my $should_reload = 0;
- unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
- unshift @INC, $self->{prefix};
- $should_reload = 1;
- }
-
- foreach my $rv ( $self->find_extensions($path) ) {
- my ($file, $pkg) = @{$rv};
- next if $self->{pathnames}{$pkg};
-
- local $@;
- my $new = eval { local $^W; require $file; $pkg->can('new') };
- unless ( $new ) {
- warn $@ if $@;
- next;
- }
- $self->{pathnames}{$pkg} =
- $should_reload ? delete $INC{$file} : $INC{$file};
- push @{$self->{extensions}}, &{$new}($pkg, _top => $top );
- }
-
- $self->{extensions} ||= [];
-}
-
-sub find_extensions {
- my ($self, $path) = @_;
-
- my @found;
- File::Find::find( sub {
- my $file = $File::Find::name;
- return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
- my $subpath = $1;
- return if lc($subpath) eq lc($self->{dispatch});
-
- $file = "$self->{path}/$subpath.pm";
- my $pkg = "$self->{name}::$subpath";
- $pkg =~ s!/!::!g;
-
- # If we have a mixed-case package name, assume case has been preserved
- # correctly. Otherwise, root through the file to locate the case-preserved
- # version of the package name.
- if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
- my $content = Module::Install::_read($subpath . '.pm');
- my $in_pod = 0;
- foreach ( split //, $content ) {
- $in_pod = 1 if /^=\w/;
- $in_pod = 0 if /^=cut/;
- next if ($in_pod || /^=cut/); # skip pod text
- next if /^\s*#/; # and comments
- if ( m/^\s*package\s+($pkg)\s*;/i ) {
- $pkg = $1;
- last;
- }
- }
- }
-
- push @found, [ $file, $pkg ];
- }, $path ) if -d $path;
-
- @found;
-}
-
-
-
-
-
-#####################################################################
-# Common Utility Functions
-
-sub _caller {
- my $depth = 0;
- my $call = caller($depth);
- while ( $call eq __PACKAGE__ ) {
- $depth++;
- $call = caller($depth);
- }
- return $call;
-}
-
-# Done in evals to avoid confusing Perl::MinimumVersion
-eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
-sub _read {
- local *FH;
- open( FH, '<', $_[0] ) or die "open($_[0]): $!";
- my $string = do { local $/; <FH> };
- close FH or die "close($_[0]): $!";
- return $string;
-}
-END_NEW
-sub _read {
- local *FH;
- open( FH, "< $_[0]" ) or die "open($_[0]): $!";
- my $string = do { local $/; <FH> };
- close FH or die "close($_[0]): $!";
- return $string;
-}
-END_OLD
-
-sub _readperl {
- my $string = Module::Install::_read($_[0]);
- $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg;
- $string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s;
- $string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg;
- return $string;
-}
-
-sub _readpod {
- my $string = Module::Install::_read($_[0]);
- $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg;
- return $string if $_[0] =~ /\.pod\z/;
- $string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg;
- $string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg;
- $string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg;
- $string =~ s/^\n+//s;
- return $string;
-}
-
-# Done in evals to avoid confusing Perl::MinimumVersion
-eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
-sub _write {
- local *FH;
- open( FH, '>', $_[0] ) or die "open($_[0]): $!";
- foreach ( 1 .. $#_ ) {
- print FH $_[$_] or die "print($_[0]): $!";
- }
- close FH or die "close($_[0]): $!";
-}
-END_NEW
-sub _write {
- local *FH;
- open( FH, "> $_[0]" ) or die "open($_[0]): $!";
- foreach ( 1 .. $#_ ) {
- print FH $_[$_] or die "print($_[0]): $!";
- }
- close FH or die "close($_[0]): $!";
-}
-END_OLD
-
-# _version is for processing module versions (eg, 1.03_05) not
-# Perl versions (eg, 5.8.1).
-sub _version ($) {
- my $s = shift || 0;
- my $d =()= $s =~ /(\.)/g;
- if ( $d >= 2 ) {
- # Normalise multipart versions
- $s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg;
- }
- $s =~ s/^(\d+)\.?//;
- my $l = $1 || 0;
- my @v = map {
- $_ . '0' x (3 - length $_)
- } $s =~ /(\d{1,3})\D?/g;
- $l = $l . '.' . join '', @v if @v;
- return $l + 0;
-}
-
-sub _cmp ($$) {
- _version($_[1]) <=> _version($_[2]);
-}
-
-# Cloned from Params::Util::_CLASS
-sub _CLASS ($) {
- (
- defined $_[0]
- and
- ! ref $_[0]
- and
- $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s
- ) ? $_[0] : undef;
-}
-
-1;
-
-# Copyright 2008 - 2011 Adam Kennedy.
59 inc/Module/Install/AuthorTests.pm
View
@@ -1,59 +0,0 @@
-#line 1
-package Module::Install::AuthorTests;
-
-use 5.005;
-use strict;
-use Module::Install::Base;
-use Carp ();
-
-#line 16
-
-use vars qw{$VERSION $ISCORE @ISA};
-BEGIN {
- $VERSION = '0.002';
- $ISCORE = 1;
- @ISA = qw{Module::Install::Base};
-}
-
-#line 42
-
-sub author_tests {
- my ($self, @dirs) = @_;
- _add_author_tests($self, \@dirs, 0);
-}
-
-#line 56
-
-sub recursive_author_tests {
- my ($self, @dirs) = @_;
- _add_author_tests($self, \@dirs, 1);
-}
-
-sub _wanted {
- my $href = shift;
- sub { /\.t$/ and -f $_ and $href->{$File::Find::dir} = 1 }
-}
-
-sub _add_author_tests {
- my ($self, $dirs, $recurse) = @_;
- return unless $Module::Install::AUTHOR;
-
- my @tests = $self->tests ? (split / /, $self->tests) : 't/*.t';
-
- # XXX: pick a default, later -- rjbs, 2008-02-24
- my @dirs = @$dirs ? @$dirs : Carp::confess "no dirs given to author_tests";
- @dirs = grep { -d } @dirs;
-
- if ($recurse) {
- require File::Find;
- my %test_dir;
- File::Find::find(_wanted(\%test_dir), @dirs);
- $self->tests( join ' ', @tests, map { "$_/*.t" } sort keys %test_dir );
- } else {
- $self->tests( join ' ', @tests, map { "$_/*.t" } sort @dirs );
- }
-}
-
-#line 107
-
-1;
83 inc/Module/Install/Base.pm
View
@@ -1,83 +0,0 @@
-#line 1
-package Module::Install::Base;
-
-use strict 'vars';
-use vars qw{$VERSION};
-BEGIN {
- $VERSION = '1.04';
-}
-
-# Suspend handler for "redefined" warnings
-BEGIN {
- my $w = $SIG{__WARN__};
- $SIG{__WARN__} = sub { $w };
-}
-
-#line 42
-
-sub new {
- my $class = shift;
- unless ( defined &{"${class}::call"} ) {
- *{"${class}::call"} = sub { shift->_top->call(@_) };
- }
- unless ( defined &{"${class}::load"} ) {
- *{"${class}::load"} = sub { shift->_top->load(@_) };
- }
- bless { @_ }, $class;
-}
-
-#line 61
-
-sub AUTOLOAD {
- local $@;
- my $func = eval { shift->_top->autoload } or return;
- goto &$func;
-}
-
-#line 75
-
-sub _top {
- $_[0]->{_top};
-}
-
-#line 90
-
-sub admin {
- $_[0]->_top->{admin}
- or
- Module::Install::Base::FakeAdmin->new;
-}
-
-#line 106
-
-sub is_admin {
- ! $_[0]->admin->isa('Module::Install::Base::FakeAdmin');
-}
-
-sub DESTROY {}
-
-package Module::Install::Base::FakeAdmin;
-
-use vars qw{$VERSION};
-BEGIN {
- $VERSION = $Module::Install::Base::VERSION;
-}
-
-my $fake;
-
-sub new {
- $fake ||= bless(\@_, $_[0]);
-}
-
-sub AUTOLOAD {}
-
-sub DESTROY {}
-
-# Restore warning handler
-BEGIN {
- $SIG{__WARN__} = $SIG{__WARN__}->();
-}
-
-1;
-
-#line 159
81 inc/Module/Install/Can.pm
View
@@ -1,81 +0,0 @@
-#line 1
-package Module::Install::Can;
-
-use strict;
-use Config ();
-use File::Spec ();
-use ExtUtils::MakeMaker ();
-use Module::Install::Base ();
-
-use vars qw{$VERSION @ISA $ISCORE};
-BEGIN {
- $VERSION = '1.04';
- @ISA = 'Module::Install::Base';
- $ISCORE = 1;
-}
-
-# check if we can load some module
-### Upgrade this to not have to load the module if possible
-sub can_use {
- my ($self, $mod, $ver) = @_;
- $mod =~ s{::|\\}{/}g;
- $mod .= '.pm' unless $mod =~ /\.pm$/i;
-
- my $pkg = $mod;
- $pkg =~ s{/}{::}g;
- $pkg =~ s{\.pm$}{}i;
-
- local $@;
- eval { require $mod; $pkg->VERSION($ver || 0); 1 };
-}
-
-# check if we can run some command
-sub can_run {
- my ($self, $cmd) = @_;
-
- my $_cmd = $cmd;
- return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
-
- for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
- next if $dir eq '';
- my $abs = File::Spec->catfile($dir, $_[1]);
- return $abs if (-x $abs or $abs = MM->maybe_command($abs));
- }
-
- return;
-}
-
-# can we locate a (the) C compiler
-sub can_cc {
- my $self = shift;
- my @chunks = split(/ /, $Config::Config{cc}) or return;
-
- # $Config{cc} may contain args; try to find out the program part
- while (@chunks) {
- return $self->can_run("@chunks") || (pop(@chunks), next);
- }
-
- return;
-}
-
-# Fix Cygwin bug on maybe_command();
-if ( $^O eq 'cygwin' ) {
- require ExtUtils::MM_Cygwin;
- require ExtUtils::MM_Win32;
- if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) {
- *ExtUtils::MM_Cygwin::maybe_command = sub {
- my ($self, $file) = @_;
- if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
- ExtUtils::MM_Win32->maybe_command($file);
- } else {
- ExtUtils::MM_Unix->maybe_command($file);
- }
- }
- }
-}
-
-1;
-
-__END__
-
-#line 156
93 inc/Module/Install/Fetch.pm
View
@@ -1,93 +0,0 @@
-#line 1
-package Module::Install::Fetch;
-
-use strict;
-use Module::Install::Base ();
-
-use vars qw{$VERSION @ISA $ISCORE};
-BEGIN {
- $VERSION = '1.04';
- @ISA = 'Module::Install::Base';
- $ISCORE = 1;
-}
-
-sub get_file {
- my ($self, %args) = @_;
- my ($scheme, $host, $path, $file) =
- $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
-
- if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) {
- $args{url} = $args{ftp_url}
- or (warn("LWP support unavailable!\n"), return);
- ($scheme, $host, $path, $file) =
- $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
- }
-
- $|++;
- print "Fetching '$file' from $host... ";
-
- unless (eval { require Socket; Socket::inet_aton($host) }) {
- warn "'$host' resolve failed!\n";
- return;
- }
-
- return unless $scheme eq 'ftp' or $scheme eq 'http';
-
- require Cwd;
- my $dir = Cwd::getcwd();
- chdir $args{local_dir} or return if exists $args{local_dir};
-
- if (eval { require LWP::Simple; 1 }) {
- LWP::Simple::mirror($args{url}, $file);
- }
- elsif (eval { require Net::FTP; 1 }) { eval {
- # use Net::FTP to get past firewall
- my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
- $ftp->login("anonymous", 'anonymous@example.com');
- $ftp->cwd($path);
- $ftp->binary;
- $ftp->get($file) or (warn("$!\n"), return);
- $ftp->quit;
- } }
- elsif (my $ftp = $self->can_run('ftp')) { eval {
- # no Net::FTP, fallback to ftp.exe
- require FileHandle;
- my $fh = FileHandle->new;
-
- local $SIG{CHLD} = 'IGNORE';
- unless ($fh->open("|$ftp -n")) {
- warn "Couldn't open ftp: $!\n";
- chdir $dir; return;
- }
-
- my @dialog = split(/\n/, <<"END_FTP");
-open $host
-user anonymous anonymous\@example.com
-cd $path
-binary
-get $file $file
-quit
-END_FTP
- foreach (@dialog) { $fh->print("$_\n") }
- $fh->close;
- } }
- else {
- warn "No working 'ftp' program available!\n";
- chdir $dir; return;
- }
-
- unless (-f $file) {
- warn "Fetching failed: $@\n";
- chdir $dir; return;
- }
-
- return if exists $args{size} and -s $file != $args{size};
- system($args{run}) if exists $args{run};
- unlink($file) if $args{remove};
-
- print(((!exists $args{check_for} or -e $args{check_for})
- ? "done!" : "failed! ($!)"), "\n");
- chdir $dir; return !$?;
-}
-
-1;
34 inc/Module/Install/Include.pm
View
@@ -1,34 +0,0 @@
-#line 1
-package Module::Install::Include;
-
-use strict;
-use Module::Install::Base ();
-
-use vars qw{$VERSION @ISA $ISCORE};
-BEGIN {
- $VERSION = '1.04';
- @ISA = 'Module::Install::Base';
- $ISCORE = 1;
-}
-
-sub include {
- shift()->admin->include(@_);
-}
-
-sub include_deps {
- shift()->admin->include_deps(@_);
-}
-
-sub auto_include {
- shift()->admin->auto_include(@_);
-}
-
-sub auto_include_deps {
- shift()->admin->auto_include_deps(@_);
-}
-
-sub auto_include_dependent_dists {
- shift()->admin->auto_include_dependent_dists(@_);
-}
-
-1;
414 inc/Module/Install/Makefile.pm
View
@@ -1,414 +0,0 @@
-#line 1
-package Module::Install::Makefile;
-
-use strict 'vars';
-use ExtUtils::MakeMaker ();
-use Module::Install::Base ();
-use Fcntl qw/:flock :seek/;
-
-use vars qw{$VERSION @ISA $ISCORE};
-BEGIN {
- $VERSION = '1.04';
- @ISA = 'Module::Install::Base';
- $ISCORE = 1;
-}
-
-sub Makefile { $_[0] }
-
-my %seen = ();
-
-sub prompt {
- shift;
-
- # Infinite loop protection
- my @c = caller();
- if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
- die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
- }
-
- # In automated testing or non-interactive session, always use defaults
- if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) {
- local $ENV{PERL_MM_USE_DEFAULT} = 1;
- goto &ExtUtils::MakeMaker::prompt;
- } else {
- goto &ExtUtils::MakeMaker::prompt;
- }
-}
-
-# Store a cleaned up version of the MakeMaker version,
-# since we need to behave differently in a variety of
-# ways based on the MM version.
-my $makemaker = eval $ExtUtils::MakeMaker::VERSION;
-
-# If we are passed a param, do a "newer than" comparison.
-# Otherwise, just return the MakeMaker version.
-sub makemaker {
- ( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0
-}
-
-# Ripped from ExtUtils::MakeMaker 6.56, and slightly modified
-# as we only need to know here whether the attribute is an array
-# or a hash or something else (which may or may not be appendable).
-my %makemaker_argtype = (
- C => 'ARRAY',
- CONFIG => 'ARRAY',
-# CONFIGURE => 'CODE', # ignore
- 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', # ignore ''
- MAN1PODS => 'HASH',
- MAN3PODS => 'HASH',
- META_ADD => 'HASH',
- META_MERGE => 'HASH',
- PL_FILES => 'HASH',
- PM => 'HASH',
- PMLIBDIRS => 'ARRAY',
- PMLIBPARENTDIRS => 'ARRAY',
- PREREQ_PM => 'HASH',
- CONFIGURE_REQUIRES => 'HASH',
- SKIP => 'ARRAY',
- TYPEMAPS => 'ARRAY',
- XS => 'HASH',
-# VERSION => ['version',''], # ignore
-# _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',
-
- # special cases where you can use makemaker_append
- CCFLAGS => 'APPENDABLE',
- DEFINE => 'APPENDABLE',
- INC => 'APPENDABLE',
- LDDLFLAGS => 'APPENDABLE',
- LDFROM => 'APPENDABLE',
-);
-
-sub makemaker_args {
- my ($self, %new_args) = @_;
- my $args = ( $self->{makemaker_args} ||= {} );
- foreach my $key (keys %new_args) {
- if ($makemaker_argtype{$key}) {
- if ($makemaker_argtype{$key} eq 'ARRAY') {
- $args->{$key} = [] unless defined $args->{$key};
- unless (ref $args->{$key} eq 'ARRAY') {
- $args->{$key} = [$args->{$key}]
- }
- push @{$args->{$key}},
- ref $new_args{$key} eq 'ARRAY'
- ? @{$new_args{$key}}
- : $new_args{$key};
- }
- elsif ($makemaker_argtype{$key} eq 'HASH') {
- $args->{$key} = {} unless defined $args->{$key};
- foreach my $skey (keys %{ $new_args{$key} }) {
- $args->{$key}{$skey} = $new_args{$key}{$skey};
- }
- }
- elsif ($makemaker_argtype{$key} eq 'APPENDABLE') {
- $self->makemaker_append($key => $new_args{$key});
- }
- }
- else {
- if (defined $args->{$key}) {
- warn qq{MakeMaker attribute "$key" is overriden; use "makemaker_append" to append values\n};
- }
- $args->{$key} = $new_args{$key};
- }
- }
- return $args;
-}
-
-# For mm args that take multiple space-seperated args,
-# append an argument to the current list.
-sub makemaker_append {
- my $self = shift;
- my $name = shift;
- my $args = $self->makemaker_args;
- $args->{$name} = defined $args->{$name}
- ? join( ' ', $args->{$name}, @_ )
- : join( ' ', @_ );
-}
-
-sub build_subdirs {
- my $self = shift;
- my $subdirs = $self->makemaker_args->{DIR} ||= [];
- for my $subdir (@_) {
- push @$subdirs, $subdir;
- }
-}
-
-sub clean_files {
- my $self = shift;
- my $clean = $self->makemaker_args->{clean} ||= {};
- %$clean = (
- %$clean,
- FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_),
- );
-}
-
-sub realclean_files {
- my $self = shift;
- my $realclean = $self->makemaker_args->{realclean} ||= {};
- %$realclean = (
- %$realclean,
- FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_),
- );
-}
-
-sub libs {
- my $self = shift;
- my $libs = ref $_[0] ? shift : [ shift ];
- $self->makemaker_args( LIBS => $libs );
-}
-
-sub inc {
- my $self = shift;
- $self->makemaker_args( INC => shift );
-}
-
-sub _wanted_t {
-}
-
-sub tests_recursive {
- my $self = shift;
- my $dir = shift || 't';
- unless ( -d $dir ) {
- die "tests_recursive dir '$dir' does not exist";
- }
- my %tests = map { $_ => 1 } split / /, ($self->tests || '');
- require File::Find;
- File::Find::find(
- sub { /\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 },
- $dir
- );
- $self->tests( join ' ', sort keys %tests );
-}
-
-sub write {
- my $self = shift;
- die "&Makefile->write() takes no arguments\n" if @_;
-
- # Check the current Perl version
- my $perl_version = $self->perl_version;
- if ( $perl_version ) {
- eval "use $perl_version; 1"
- or die "ERROR: perl: Version $] is installed, "
- . "but we need version >= $perl_version";
- }
-
- # Make sure we have a new enough MakeMaker
- require ExtUtils::MakeMaker;
-
- if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
- # MakeMaker can complain about module versions that include
- # an underscore, even though its own version may contain one!
- # Hence the funny regexp to get rid of it. See RT #35800
- # for details.
- my ($v) = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
- $self->build_requires( 'ExtUtils::MakeMaker' => $v );
- $self->configure_requires( 'ExtUtils::MakeMaker' => $v );
- } else {
- # Allow legacy-compatibility with 5.005 by depending on the
- # most recent EU:MM that supported 5.005.
- $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 );
- $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 );
- }
-
- # Generate the MakeMaker params
- my $args = $self->makemaker_args;
- $args->{DISTNAME} = $self->name;
- $args->{NAME} = $self->module_name || $self->name;
- $args->{NAME} =~ s/-/::/g;
- $args->{VERSION} = $self->version or die <<'EOT';
-ERROR: Can't determine distribution version. Please specify it
-explicitly via 'version' in Makefile.PL, or set a valid $VERSION
-in a module, and provide its file path via 'version_from' (or
-'all_from' if you prefer) in Makefile.PL.
-EOT
-
- if ( $self->tests ) {
- my @tests = split ' ', $self->tests;
- my %seen;
- $args->{test} = {
- TESTS => (join ' ', grep {!$seen{$_}++} @tests),
- };
- } elsif ( $Module::Install::ExtraTests::use_extratests ) {
- # Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness.
- # So, just ignore our xt tests here.
- } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) {
- $args->{test} = {
- TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ),
- };
- }
- if ( $] >= 5.005 ) {
- $args->{ABSTRACT} = $self->abstract;
- $args->{AUTHOR} = join ', ', @{$self->author || []};
- }
- if ( $self->makemaker(6.10) ) {
- $args->{NO_META} = 1;
- #$args->{NO_MYMETA} = 1;
- }
- if ( $self->makemaker(6.17) and $self->sign ) {
- $args->{SIGN} = 1;
- }
- unless ( $self->is_admin ) {
- delete $args->{SIGN};
- }
- if ( $self->makemaker(6.31) and $self->license ) {
- $args->{LICENSE} = $self->license;
- }
-
- my $prereq = ($args->{PREREQ_PM} ||= {});
- %$prereq = ( %$prereq,
- map { @$_ } # flatten [module => version]
- map { @$_ }
- grep $_,
- ($self->requires)
- );
-
- # Remove any reference to perl, PREREQ_PM doesn't support it
- delete $args->{PREREQ_PM}->{perl};
-
- # Merge both kinds of requires into BUILD_REQUIRES
- my $build_prereq = ($args->{BUILD_REQUIRES} ||= {});
- %$build_prereq = ( %$build_prereq,
- map { @$_ } # flatten [module => version]
- map { @$_ }
- grep $_,
- ($self->configure_requires, $self->build_requires)
- );
-
- # Remove any reference to perl, BUILD_REQUIRES doesn't support it
- delete $args->{BUILD_REQUIRES}->{perl};
-
- # Delete bundled dists from prereq_pm, add it to Makefile DIR
- my $subdirs = ($args->{DIR} || []);
- if ($self->bundles) {
- my %processed;
- foreach my $bundle (@{ $self->bundles }) {
- my ($mod_name, $dist_dir) = @$bundle;
- delete $prereq->{$mod_name};
- $dist_dir = File::Basename::basename($dist_dir); # dir for building this module
- if (not exists $processed{$dist_dir}) {
- if (-d $dist_dir) {
- # List as sub-directory to be processed by make
- push @$subdirs, $dist_dir;
- }
- # Else do nothing: the module is already present on the system
- $processed{$dist_dir} = undef;
- }
- }
- }
-
- unless ( $self->makemaker('6.55_03') ) {
- %$prereq = (%$prereq,%$build_prereq);
- delete $args->{BUILD_REQUIRES};
- }
-
- if ( my $perl_version = $self->perl_version ) {
- eval "use $perl_version; 1"
- or die "ERROR: perl: Version $] is installed, "
- . "but we need version >= $perl_version";
-
- if ( $self->makemaker(6.48) ) {
- $args->{MIN_PERL_VERSION} = $perl_version;
- }
- }
-
- if ($self->installdirs) {
- warn qq{old INSTALLDIRS (probably set by makemaker_args) is overriden by installdirs\n} if $args->{INSTALLDIRS};
- $args->{INSTALLDIRS} = $self->installdirs;
- }
-
- my %args = map {
- ( $_ => $args->{$_} ) } grep {defined($args->{$_} )
- } keys %$args;
-
- my $user_preop = delete $args{dist}->{PREOP};
- if ( my $preop = $self->admin->preop($user_preop) ) {
- foreach my $key ( keys %$preop ) {
- $args{dist}->{$key} = $preop->{$key};
- }
- }
-
- my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
- $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile');
-}
-
-sub fix_up_makefile {
- my $self = shift;
- my $makefile_name = shift;
- my $top_class = ref($self->_top) || '';
- my $top_version = $self->_top->VERSION || '';
-
- my $preamble = $self->preamble
- ? "# Preamble by $top_class $top_version\n"
- . $self->preamble
- : '';
- my $postamble = "# Postamble by $top_class $top_version\n"
- . ($self->postamble || '');
-
- local *MAKEFILE;
- open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
- eval { flock MAKEFILE, LOCK_EX };
- my $makefile = do { local $/; <MAKEFILE> };
-
- $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
- $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
- $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
- $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
- $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
-
- # Module::Install will never be used to build the Core Perl
- # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
- # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
- $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m;
- #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
-
- # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.
- $makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g;
-
- # XXX - This is currently unused; not sure if it breaks other MM-users
- # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
-
- seek MAKEFILE, 0, SEEK_SET;
- truncate MAKEFILE, 0;
- print MAKEFILE "$preamble$makefile$postamble" or die $!;
- close MAKEFILE or die $!;
-
- 1;
-}
-
-sub preamble {
- my ($self, $text) = @_;
- $self->{preamble} = $text . $self->{preamble} if defined $text;
- $self->{preamble};
-}
-
-sub postamble {
- my ($self, $text) = @_;
- $self->{postamble} ||= $self->admin->postamble;
- $self->{postamble} .= $text if defined $text;
- $self->{postamble}
-}
-
-1;
-
-__END__
-
-#line 540
722 inc/Module/Install/Metadata.pm
View
@@ -1,722 +0,0 @@
-#line 1
-package Module::Install::Metadata;
-
-use strict 'vars';
-use Module::Install::Base ();
-
-use vars qw{$VERSION @ISA $ISCORE};
-BEGIN {
- $VERSION = '1.04';
- @ISA = 'Module::Install::Base';
- $ISCORE = 1;
-}
-
-my @boolean_keys = qw{
- sign
-};
-
-my @scalar_keys = qw{
- name
- module_name
- abstract
- version
- distribution_type
- tests
- installdirs
-};
-
-my @tuple_keys = qw{
- configure_requires
- build_requires
- requires
- recommends
- bundles
- resources
-};
-
-my @resource_keys = qw{
- homepage
- bugtracker
- repository
-};
-
-my @array_keys = qw{
- keywords
- author
-};
-
-*authors = \&author;
-
-sub Meta { shift }
-sub Meta_BooleanKeys { @boolean_keys }
-sub Meta_ScalarKeys { @scalar_keys }
-sub Meta_TupleKeys { @tuple_keys }
-sub Meta_ResourceKeys { @resource_keys }
-sub Meta_ArrayKeys { @array_keys }
-
-foreach my $key ( @boolean_keys ) {
- *$key = sub {
- my $self = shift;
- if ( defined wantarray and not @_ ) {
- return $self->{values}->{$key};
- }
- $self->{values}->{$key} = ( @_ ? $_[0] : 1 );
- return $self;
- };
-}
-
-foreach my $key ( @scalar_keys ) {
- *$key = sub {
- my $self = shift;
- return $self->{values}->{$key} if defined wantarray and !@_;
- $self->{values}->{$key} = shift;
- return $self;
- };
-}
-
-foreach my $key ( @array_keys ) {
- *$key = sub {
- my $self = shift;
- return $self->{values}->{$key} if defined wantarray and !@_;
- $self->{values}->{$key} ||= [];
- push @{$self->{values}->{$key}}, @_;
- return $self;
- };
-}
-
-foreach my $key ( @resource_keys ) {
- *$key = sub {
- my $self = shift;
- unless ( @_ ) {
- return () unless $self->{values}->{resources};
- return map { $_->[1] }
- grep { $_->[0] eq $key }
- @{ $self->{values}->{resources} };
- }
- return $self->{values}->{resources}->{$key} unless @_;
- my $uri = shift or die(
- "Did not provide a value to $key()"
- );
- $self->resources( $key => $uri );
- return 1;
- };
-}
-
-foreach my $key ( grep { $_ ne "resources" } @tuple_keys) {
- *$key = sub {
- my $self = shift;
- return $self->{values}->{$key} unless @_;
- my @added;
- while ( @_ ) {
- my $module = shift or last;
- my $version = shift || 0;
- push @added, [ $module, $version ];
- }
- push @{ $self->{values}->{$key} }, @added;
- return map {@$_} @added;
- };
-}
-
-# Resource handling
-my %lc_resource = map { $_ => 1 } qw{