@@ -448,21 +448,8 @@ sub new {
448
448
$self -> extract_hints;
449
449
450
450
$self -> check_min_perl_version;
451
-
452
- my %configure_att ; # record &{$self->{CONFIGURE}} attributes
453
- my (%initial_att ) = %$self ; # record initial attributes
454
-
455
451
my $unsatisfied_prereqs = $self -> check_prereqs($cmrstash );
456
-
457
- if (defined $self -> {CONFIGURE }) {
458
- if (ref $self -> {CONFIGURE } eq ' CODE' ) {
459
- %configure_att = %{&{$self -> {CONFIGURE }}};
460
- _convert_compat_attrs(\%configure_att );
461
- %$self = (%$self , %configure_att );
462
- } else {
463
- croak " Attribute 'CONFIGURE' to WriteMakefile() not a code reference\n " ;
464
- }
465
- }
452
+ my ($initial_att , $configure_att ) = $self -> extract_CONFIGURE;
466
453
467
454
local @Parent = @Parent ; # Protect against non-local exits
468
455
$self -> extract_PARENT;
@@ -493,12 +480,26 @@ END
493
480
File::Spec-> catfile($Config {' archlibexp' }, " Config.pm" )
494
481
);
495
482
496
- $self -> makefile_preamble(\@ARGV , \ % initial_att , \ % configure_att );
483
+ $self -> makefile_preamble(\@ARGV , $ initial_att , $ configure_att );
497
484
$self -> generate_makefile;
498
485
499
486
$self ;
500
487
}
501
488
489
+ sub extract_CONFIGURE {
490
+ my ($self ) = @_ ;
491
+ my %initial_att = %$self ; # record initial attributes
492
+ my %configure_att ; # record &{$self->{CONFIGURE}} attributes
493
+ if (defined $self -> {CONFIGURE }) {
494
+ croak " Attribute 'CONFIGURE' to WriteMakefile() not a code reference\n "
495
+ unless ref $self -> {CONFIGURE } eq ' CODE' ;
496
+ %configure_att = %{&{$self -> {CONFIGURE }}};
497
+ _convert_compat_attrs(\%configure_att );
498
+ while (my ($k , $v ) = each %configure_att ) { $self -> {$k } = $v }
499
+ }
500
+ (\%initial_att , \%configure_att );
501
+ }
502
+
502
503
sub makefile_preamble {
503
504
my ($self , $argvref , $initial_att , $configure_att ) = @_ ;
504
505
my ($argv ) = neatvalue($argvref );
0 commit comments