|
476 | 476 | File::Spec->catfile($Config{'archlibexp'}, "Config.pm")
|
477 | 477 | );
|
478 | 478 |
|
479 |
| - my($argv) = neatvalue(\@ARGV); |
480 |
| - $argv =~ s/^\[/(/; |
481 |
| - $argv =~ s/\]$/)/; |
482 |
| - push @{$self->{RESULT}}, <<END; |
483 |
| -# This Makefile is for the $self->{NAME} extension to perl. |
484 |
| -# |
485 |
| -# It was generated automatically by MakeMaker version |
486 |
| -# $VERSION (Revision: $Revision) from the contents of |
487 |
| -# Makefile.PL. Don't edit this file, edit Makefile.PL instead. |
488 |
| -# |
489 |
| -# ANY CHANGES MADE HERE WILL BE LOST! |
490 |
| -# |
491 |
| -# MakeMaker ARGV: $argv |
492 |
| -# |
493 |
| -END |
494 |
| - |
495 |
| - push @{$self->{RESULT}}, $self->_MakeMaker_Parameters_section(\%initial_att); |
496 |
| - |
497 |
| - if (defined $self->{CONFIGURE}) { |
498 |
| - push @{$self->{RESULT}}, <<END; |
499 |
| -
|
500 |
| -# MakeMaker 'CONFIGURE' Parameters: |
501 |
| -END |
502 |
| - if (scalar(keys %configure_att) > 0) { |
503 |
| - foreach my $key (sort keys %configure_att) { |
504 |
| - next if $key eq 'ARGS'; |
505 |
| - my($v) = neatvalue($configure_att{$key}); |
506 |
| - $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/; |
507 |
| - $v =~ tr/\n/ /s; |
508 |
| - push @{$self->{RESULT}}, "# $key => $v"; |
509 |
| - } |
510 |
| - } |
511 |
| - else |
512 |
| - { |
513 |
| - push @{$self->{RESULT}}, "# no values returned"; |
514 |
| - } |
515 |
| - undef %configure_att; # free memory |
516 |
| - } |
| 479 | + $self->makefile_preamble(\@ARGV, \%initial_att, \%configure_att); |
517 | 480 |
|
518 | 481 | # turn the SKIP array into a SKIPHASH hash
|
519 | 482 | for my $skip (@{$self->{SKIP} || []}) {
|
|
556 | 519 | $self;
|
557 | 520 | }
|
558 | 521 |
|
| 522 | +sub makefile_preamble { |
| 523 | + my ($self, $argvref, $initial_att, $configure_att) = @_; |
| 524 | + my ($argv) = neatvalue($argvref); |
| 525 | + $argv =~ s/^\[/(/; |
| 526 | + $argv =~ s/\]$/)/; |
| 527 | + my $results = $self->{RESULT}; # cache, plus looks nicer |
| 528 | + push @$results, <<END; |
| 529 | +# This Makefile is for the $self->{NAME} extension to perl. |
| 530 | +# |
| 531 | +# It was generated automatically by MakeMaker version |
| 532 | +# $VERSION (Revision: $Revision) from the contents of |
| 533 | +# Makefile.PL. Don't edit this file, edit Makefile.PL instead. |
| 534 | +# |
| 535 | +# ANY CHANGES MADE HERE WILL BE LOST! |
| 536 | +# |
| 537 | +# MakeMaker ARGV: $argv |
| 538 | +# |
| 539 | +END |
| 540 | + push @$results, $self->_MakeMaker_Parameters_section($initial_att); |
| 541 | + if (defined $self->{CONFIGURE}) { |
| 542 | + push @$results, "\n# MakeMaker 'CONFIGURE' Parameters:\n"; |
| 543 | + if (scalar(keys %$configure_att) > 0) { |
| 544 | + foreach my $key (sort keys %$configure_att) { |
| 545 | + next if $key eq 'ARGS'; |
| 546 | + my($v) = neatvalue($configure_att->{$key}); |
| 547 | + $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/; |
| 548 | + $v =~ tr/\n/ /s; |
| 549 | + push @$results, "# $key => $v"; |
| 550 | + } |
| 551 | + } else { |
| 552 | + push @$results, "# no values returned"; |
| 553 | + } |
| 554 | + } |
| 555 | +} |
| 556 | + |
559 | 557 | sub extract_ARGV {
|
560 | 558 | my ($self, $argvref) = @_;
|
561 | 559 | if ($self->{PARENT}) {
|
|
0 commit comments