sub
_find_modules {
my
$self
=
shift
;
my
$pl
= -e
'Build.PL'
?
'Build.PL'
: -e
'Makefile.PL'
?
'Makefile.PL'
: 0;
unless
(
$pl
) {
$self
->error(
'No {Build,Makefile}.PL found in '
.
$self
->dist_dir );
return
$self
;
}
no
warnings
'redefine'
;
local
*STDIN
;
local
*ExtUtils::Liblist::ext
=
sub
{
my
(
$class
,
$lib
) =
@_
;
$lib
=~ s/\-l//;
push
@{
$self
->libs },
$lib
;
return
1;
};
local
*CORE::GLOBAL::exit
=
sub
{ };
local
$INC
{
"Module/Build.pm"
} = 1;
local
*Module::Build::new
=
sub
{
my
$class
=
shift
;
my
%args
=
@_
;
$self
->requires(
$args
{requires} || {} );
$self
->build_requires(
$args
{build_requires} || {} );
bless
{},
"Module::Depends::Intrusive::Fake::Module::Build"
;
};
local
*Module::Build::subclass
=
sub
{
'Module::Build'
};
local
$Module::Build::VERSION
= 666;
my
$WriteMakefile
=
sub
{
my
%args
=
@_
;
$self
->requires(
$args
{PREREQ_PM} || {} );
1;
};
local
*main::WriteMakefile
;
local
*ExtUtils::MakeMaker::WriteMakefile
=
$WriteMakefile
;
local
$INC
{
"Inline/MakeMaker.pm"
} = 1;
local
@Inline::MakeMaker::EXPORT
=
qw( WriteMakefile WriteInlineMakefile )
;
local
@Inline::MakeMaker::ISA
=
qw( Exporter )
;
local
*Inline::MakeMaker::WriteMakefile
=
$WriteMakefile
;
local
*Inline::MakeMaker::WriteInlineMakefile
=
$WriteMakefile
;
local
$INC
{
"inc/Module/Install.pm"
} = 1;
local
@inc::Module::Install::ISA
=
qw( Exporter )
;
local
@inc::Module::Install::EXPORT
=
qw( AUTOLOAD requires build_requires )
;
local
*inc::Module::Install::AUTOLOAD
=
sub
{ 1 };
local
*inc::Module::Install::requires
=
sub
{
my
(
$module
,
$version
) =
@_
;
$version
||= 0;
$self
->requires->{
$module
} =
$version
;
};
local
*inc::Module::Install::build_requires
=
sub
{
my
(
$module
,
$version
) =
@_
;
$version
||= 0;
$self
->build_requires->{
$module
} =
$version
;
};
my
$file
= File::Spec->catfile( getcwd(),
$pl
);
eval
{
no
strict;
no
warnings;
require
"$file"
;
};
$self
->error( $@ )
if
$@;
delete
$INC
{
$file
};
return
$self
;
}
sub
DESTROY {}
sub
AUTOLOAD {
shift
}
1;