@@ -437,21 +437,8 @@ sub new {
437
437
$self -> extract_hints;
438
438
439
439
$self -> check_min_perl_version;
440
-
441
- my %configure_att ; # record &{$self->{CONFIGURE}} attributes
442
- my (%initial_att ) = %$self ; # record initial attributes
443
-
444
440
my $unsatisfied_prereqs = $self -> check_prereqs($cmrstash );
445
-
446
- if (defined $self -> {CONFIGURE }) {
447
- if (ref $self -> {CONFIGURE } eq ' CODE' ) {
448
- %configure_att = %{&{$self -> {CONFIGURE }}};
449
- _convert_compat_attrs(\%configure_att );
450
- %$self = (%$self , %configure_att );
451
- } else {
452
- croak " Attribute 'CONFIGURE' to WriteMakefile() not a code reference\n " ;
453
- }
454
- }
441
+ my ($initial_att , $configure_att ) = $self -> extract_CONFIGURE;
455
442
456
443
local @Parent = @Parent ; # Protect against non-local exits
457
444
$self -> extract_PARENT;
@@ -482,12 +469,26 @@ END
482
469
File::Spec-> catfile($Config {' archlibexp' }, " Config.pm" )
483
470
);
484
471
485
- $self -> makefile_preamble(\@ARGV , \ % initial_att , \ % configure_att );
472
+ $self -> makefile_preamble(\@ARGV , $ initial_att , $ configure_att );
486
473
$self -> generate_makefile;
487
474
488
475
$self ;
489
476
}
490
477
478
+ sub extract_CONFIGURE {
479
+ my ($self ) = @_ ;
480
+ my %initial_att = %$self ; # record initial attributes
481
+ my %configure_att ; # record &{$self->{CONFIGURE}} attributes
482
+ if (defined $self -> {CONFIGURE }) {
483
+ croak " Attribute 'CONFIGURE' to WriteMakefile() not a code reference\n "
484
+ unless ref $self -> {CONFIGURE } eq ' CODE' ;
485
+ %configure_att = %{&{$self -> {CONFIGURE }}};
486
+ _convert_compat_attrs(\%configure_att );
487
+ while (my ($k , $v ) = each %configure_att ) { $self -> {$k } = $v }
488
+ }
489
+ (\%initial_att , \%configure_att );
490
+ }
491
+
491
492
sub makefile_preamble {
492
493
my ($self , $argvref , $initial_att , $configure_att ) = @_ ;
493
494
my ($argv ) = neatvalue($argvref );
0 commit comments