1# $Id$ 2package ExtUtils::MakeMaker; 3 4use strict; 5use warnings; 6 7BEGIN {require 5.006;} 8 9require Exporter; 10use ExtUtils::MakeMaker::Config; 11use ExtUtils::MakeMaker::version; # ensure we always have our fake version.pm 12use Carp; 13use File::Path; 14my $CAN_DECODE = eval { require ExtUtils::MakeMaker::Locale; }; # 2 birds, 1 stone 15eval { ExtUtils::MakeMaker::Locale::reinit('UTF-8') } 16 if $CAN_DECODE and Encode::find_encoding('locale')->name eq 'ascii'; 17 18our $Verbose = 0; # exported 19our @Parent; # needs to be localized 20our @Get_from_Config; # referenced by MM_Unix 21our @MM_Sections; 22our @Overridable; 23my @Prepend_parent; 24my %Recognized_Att_Keys; 25our %macro_fsentity; # whether a macro is a filesystem name 26our %macro_dep; # whether a macro is a dependency 27 28our $VERSION = '7.64'; 29$VERSION =~ tr/_//d; 30 31# Emulate something resembling CVS $Revision$ 32(our $Revision = $VERSION) =~ s{_}{}; 33$Revision = int $Revision * 10000; 34 35our $Filename = __FILE__; # referenced outside MakeMaker 36 37our @ISA = qw(Exporter); 38our @EXPORT = qw(&WriteMakefile $Verbose &prompt &os_unsupported); 39our @EXPORT_OK = qw($VERSION &neatvalue &mkbootstrap &mksymlists 40 &WriteEmptyMakefile &open_for_writing &write_file_via_tmp 41 &_sprintf562); 42 43# These will go away once the last of the Win32 & VMS specific code is 44# purged. 45my $Is_VMS = $^O eq 'VMS'; 46my $Is_Win32 = $^O eq 'MSWin32'; 47our $UNDER_CORE = $ENV{PERL_CORE}; # needs to be our 48 49full_setup(); 50 51require ExtUtils::MM; # Things like CPAN assume loading ExtUtils::MakeMaker 52 # will give them MM. 53 54require ExtUtils::MY; # XXX pre-5.8 versions of ExtUtils::Embed expect 55 # loading ExtUtils::MakeMaker will give them MY. 56 # This will go when Embed is its own CPAN module. 57 58 59# 5.6.2 can't do sprintf "%1$s" - this can only do %s 60sub _sprintf562 { 61 my ($format, @args) = @_; 62 for (my $i = 1; $i <= @args; $i++) { 63 $format =~ s#%$i\$s#$args[$i-1]#g; 64 } 65 $format; 66} 67 68sub WriteMakefile { 69 croak "WriteMakefile: Need even number of args" if @_ % 2; 70 71 require ExtUtils::MY; 72 my %att = @_; 73 74 _convert_compat_attrs(\%att); 75 76 _verify_att(\%att); 77 78 my $mm = MM->new(\%att); 79 $mm->flush; 80 81 return $mm; 82} 83 84 85# Basic signatures of the attributes WriteMakefile takes. Each is the 86# reference type. Empty value indicate it takes a non-reference 87# scalar. 88my %Att_Sigs; 89my %Special_Sigs = ( 90 AUTHOR => 'ARRAY', 91 C => 'ARRAY', 92 CONFIG => 'ARRAY', 93 CONFIGURE => 'CODE', 94 DIR => 'ARRAY', 95 DL_FUNCS => 'HASH', 96 DL_VARS => 'ARRAY', 97 EXCLUDE_EXT => 'ARRAY', 98 EXE_FILES => 'ARRAY', 99 FUNCLIST => 'ARRAY', 100 H => 'ARRAY', 101 IMPORTS => 'HASH', 102 INCLUDE_EXT => 'ARRAY', 103 LIBS => ['ARRAY',''], 104 MAN1PODS => 'HASH', 105 MAN3PODS => 'HASH', 106 META_ADD => 'HASH', 107 META_MERGE => 'HASH', 108 OBJECT => ['ARRAY', ''], 109 PL_FILES => 'HASH', 110 PM => 'HASH', 111 PMLIBDIRS => 'ARRAY', 112 PMLIBPARENTDIRS => 'ARRAY', 113 PREREQ_PM => 'HASH', 114 BUILD_REQUIRES => 'HASH', 115 CONFIGURE_REQUIRES => 'HASH', 116 TEST_REQUIRES => 'HASH', 117 SKIP => 'ARRAY', 118 TYPEMAPS => 'ARRAY', 119 XS => 'HASH', 120 XSBUILD => 'HASH', 121 VERSION => ['version',''], 122 _KEEP_AFTER_FLUSH => '', 123 124 clean => 'HASH', 125 depend => 'HASH', 126 dist => 'HASH', 127 dynamic_lib=> 'HASH', 128 linkext => 'HASH', 129 macro => 'HASH', 130 postamble => 'HASH', 131 realclean => 'HASH', 132 test => 'HASH', 133 tool_autosplit => 'HASH', 134); 135 136@Att_Sigs{keys %Recognized_Att_Keys} = ('') x keys %Recognized_Att_Keys; 137@Att_Sigs{keys %Special_Sigs} = values %Special_Sigs; 138 139sub _convert_compat_attrs { #result of running several times should be same 140 my($att) = @_; 141 if (exists $att->{AUTHOR}) { 142 if ($att->{AUTHOR}) { 143 if (!ref($att->{AUTHOR})) { 144 my $t = $att->{AUTHOR}; 145 $att->{AUTHOR} = [$t]; 146 } 147 } else { 148 $att->{AUTHOR} = []; 149 } 150 } 151} 152 153sub _verify_att { 154 my($att) = @_; 155 156 foreach my $key (sort keys %$att) { 157 my $val = $att->{$key}; 158 my $sig = $Att_Sigs{$key}; 159 unless( defined $sig ) { 160 warn "WARNING: $key is not a known parameter.\n"; 161 next; 162 } 163 164 my @sigs = ref $sig ? @$sig : $sig; 165 my $given = ref $val; 166 unless( grep { _is_of_type($val, $_) } @sigs ) { 167 my $takes = join " or ", map { _format_att($_) } @sigs; 168 169 my $has = _format_att($given); 170 warn "WARNING: $key takes a $takes not a $has.\n". 171 " Please inform the author.\n"; 172 } 173 } 174} 175 176 177# Check if a given thing is a reference or instance of $type 178sub _is_of_type { 179 my($thing, $type) = @_; 180 181 return 1 if ref $thing eq $type; 182 183 local $SIG{__DIE__}; 184 return 1 if eval{ $thing->isa($type) }; 185 186 return 0; 187} 188 189 190sub _format_att { 191 my $given = shift; 192 193 return $given eq '' ? "string/number" 194 : uc $given eq $given ? "$given reference" 195 : "$given object" 196 ; 197} 198 199 200sub prompt ($;$) { ## no critic 201 my($mess, $def) = @_; 202 confess("prompt function called without an argument") 203 unless defined $mess; 204 205 my $isa_tty = -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)) ; 206 207 my $dispdef = defined $def ? "[$def] " : " "; 208 $def = defined $def ? $def : ""; 209 210 local $|=1; 211 local $\; 212 print "$mess $dispdef"; 213 214 my $ans; 215 if ($ENV{PERL_MM_USE_DEFAULT} || (!$isa_tty && eof STDIN)) { 216 print "$def\n"; 217 } 218 else { 219 $ans = <STDIN>; 220 if( defined $ans ) { 221 $ans =~ s{\015?\012$}{}; 222 } 223 else { # user hit ctrl-D 224 print "\n"; 225 } 226 } 227 228 return (!defined $ans || $ans eq '') ? $def : $ans; 229} 230 231sub os_unsupported { 232 die "OS unsupported\n"; 233} 234 235sub eval_in_subdirs { 236 my($self) = @_; 237 use Cwd qw(cwd abs_path); 238 my $pwd = cwd() || die "Can't figure out your cwd!"; 239 240 local @INC = map eval {abs_path($_) if -e} || $_, @INC; 241 push @INC, '.'; # '.' has to always be at the end of @INC 242 243 foreach my $dir (@{$self->{DIR}}){ 244 my($abs) = $self->catdir($pwd,$dir); 245 eval { $self->eval_in_x($abs); }; 246 last if $@; 247 } 248 chdir $pwd; 249 die $@ if $@; 250} 251 252sub eval_in_x { 253 my($self,$dir) = @_; 254 chdir $dir or carp("Couldn't change to directory $dir: $!"); 255 256 { 257 package main; 258 do './Makefile.PL'; 259 }; 260 if ($@) { 261# if ($@ =~ /prerequisites/) { 262# die "MakeMaker WARNING: $@"; 263# } else { 264# warn "WARNING from evaluation of $dir/Makefile.PL: $@"; 265# } 266 die "ERROR from evaluation of $dir/Makefile.PL: $@"; 267 } 268} 269 270 271# package name for the classes into which the first object will be blessed 272my $PACKNAME = 'PACK000'; 273 274sub full_setup { 275 $Verbose ||= 0; 276 277 my @dep_macros = qw/ 278 PERL_INCDEP PERL_ARCHLIBDEP PERL_ARCHIVEDEP 279 /; 280 281 my @fs_macros = qw/ 282 FULLPERL XSUBPPDIR 283 284 INST_ARCHLIB INST_SCRIPT INST_BIN INST_LIB INST_MAN1DIR INST_MAN3DIR 285 INSTALLDIRS 286 DESTDIR PREFIX INSTALL_BASE 287 PERLPREFIX SITEPREFIX VENDORPREFIX 288 INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB 289 INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH 290 INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN 291 INSTALLMAN1DIR INSTALLMAN3DIR 292 INSTALLSITEMAN1DIR INSTALLSITEMAN3DIR 293 INSTALLVENDORMAN1DIR INSTALLVENDORMAN3DIR 294 INSTALLSCRIPT INSTALLSITESCRIPT INSTALLVENDORSCRIPT 295 PERL_LIB PERL_ARCHLIB 296 SITELIBEXP SITEARCHEXP 297 298 MAKE LIBPERL_A LIB PERL_SRC PERL_INC 299 PPM_INSTALL_EXEC PPM_UNINSTALL_EXEC 300 PPM_INSTALL_SCRIPT PPM_UNINSTALL_SCRIPT 301 /; 302 303 my @attrib_help = qw/ 304 305 AUTHOR ABSTRACT ABSTRACT_FROM BINARY_LOCATION 306 C CAPI CCFLAGS CONFIG CONFIGURE DEFINE DIR DISTNAME DISTVNAME 307 DL_FUNCS DL_VARS 308 EXCLUDE_EXT EXE_FILES FIRST_MAKEFILE 309 FULLPERLRUN FULLPERLRUNINST 310 FUNCLIST H IMPORTS 311 312 INC INCLUDE_EXT LDFROM LIBS LICENSE 313 LINKTYPE MAKEAPERL MAKEFILE MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET 314 META_ADD META_MERGE MIN_PERL_VERSION BUILD_REQUIRES CONFIGURE_REQUIRES 315 MYEXTLIB NAME NEEDS_LINKING NOECHO NO_META NO_MYMETA NO_PACKLIST NO_PERLLOCAL 316 NORECURS NO_VC OBJECT OPTIMIZE PERL_MALLOC_OK PERL PERLMAINCC PERLRUN 317 PERLRUNINST PERL_CORE 318 PERM_DIR PERM_RW PERM_RWX MAGICXS 319 PL_FILES PM PM_FILTER PMLIBDIRS PMLIBPARENTDIRS POLLUTE 320 PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ PUREPERL_ONLY 321 SIGN SKIP TEST_REQUIRES TYPEMAPS UNINST VERSION VERSION_FROM XS 322 XSBUILD XSMULTI XSOPT XSPROTOARG XS_VERSION 323 clean depend dist dynamic_lib linkext macro realclean tool_autosplit 324 325 MAN1EXT MAN3EXT 326 327 MACPERL_SRC MACPERL_LIB MACLIBS_68K MACLIBS_PPC MACLIBS_SC MACLIBS_MRC 328 MACLIBS_ALL_68K MACLIBS_ALL_PPC MACLIBS_SHARED 329 /; 330 push @attrib_help, @fs_macros; 331 @macro_fsentity{@fs_macros, @dep_macros} = (1) x (@fs_macros+@dep_macros); 332 @macro_dep{@dep_macros} = (1) x @dep_macros; 333 334 # IMPORTS is used under OS/2 and Win32 335 336 # @Overridable is close to @MM_Sections but not identical. The 337 # order is important. Many subroutines declare macros. These 338 # depend on each other. Let's try to collect the macros up front, 339 # then pasthru, then the rules. 340 341 # MM_Sections are the sections we have to call explicitly 342 # in Overridable we have subroutines that are used indirectly 343 344 345 @MM_Sections = 346 qw( 347 348 post_initialize const_config constants platform_constants 349 tool_autosplit tool_xsubpp tools_other 350 351 makemakerdflt 352 353 dist macro depend cflags const_loadlibs const_cccmd 354 post_constants 355 356 pasthru 357 358 special_targets 359 c_o xs_c xs_o 360 top_targets blibdirs linkext dlsyms dynamic_bs dynamic 361 dynamic_lib static static_lib manifypods processPL 362 installbin subdirs 363 clean_subdirs clean realclean_subdirs realclean 364 metafile signature 365 dist_basics dist_core distdir dist_test dist_ci distmeta distsignature 366 install force perldepend makefile staticmake test ppd 367 368 ); # loses section ordering 369 370 @Overridable = @MM_Sections; 371 push @Overridable, qw[ 372 373 libscan makeaperl needs_linking 374 subdir_x test_via_harness test_via_script 375 376 init_VERSION init_dist init_INST init_INSTALL init_DEST init_dirscan 377 init_PM init_MANPODS init_xs init_PERL init_DIRFILESEP init_linker 378 ]; 379 380 push @MM_Sections, qw[ 381 382 pm_to_blib selfdocument 383 384 ]; 385 386 # Postamble needs to be the last that was always the case 387 push @MM_Sections, "postamble"; 388 push @Overridable, "postamble"; 389 390 # All sections are valid keys. 391 @Recognized_Att_Keys{@MM_Sections} = (1) x @MM_Sections; 392 393 # we will use all these variables in the Makefile 394 @Get_from_Config = 395 qw( 396 ar cc cccdlflags ccdlflags cpprun dlext dlsrc exe_ext full_ar ld 397 lddlflags ldflags libc lib_ext obj_ext osname osvers ranlib 398 sitelibexp sitearchexp so 399 ); 400 401 # 5.5.3 doesn't have any concept of vendor libs 402 push @Get_from_Config, qw( vendorarchexp vendorlibexp ) if "$]" >= 5.006; 403 404 foreach my $item (@attrib_help){ 405 $Recognized_Att_Keys{$item} = 1; 406 } 407 foreach my $item (@Get_from_Config) { 408 $Recognized_Att_Keys{uc $item} = $Config{$item}; 409 print "Attribute '\U$item\E' => '$Config{$item}'\n" 410 if ($Verbose >= 2); 411 } 412 413 # 414 # When we eval a Makefile.PL in a subdirectory, that one will ask 415 # us (the parent) for the values and will prepend "..", so that 416 # all files to be installed end up below OUR ./blib 417 # 418 @Prepend_parent = qw( 419 INST_BIN INST_LIB INST_ARCHLIB INST_SCRIPT 420 MAP_TARGET INST_MAN1DIR INST_MAN3DIR PERL_SRC 421 PERL FULLPERL 422 ); 423} 424 425sub _has_cpan_meta_requirements { 426 return eval { 427 require CPAN::Meta::Requirements; 428 CPAN::Meta::Requirements->VERSION(2.130); 429 # Make sure vstrings can be handled. Some versions of CMR require B to 430 # do this, which won't be available in miniperl. 431 CPAN::Meta::Requirements->new->add_string_requirement('Module' => v1.2); 432 1; 433 }; 434} 435 436sub new { 437 my($class,$self) = @_; 438 my($key); 439 440 _convert_compat_attrs($self) if defined $self && $self; 441 442 # Store the original args passed to WriteMakefile() 443 foreach my $k (keys %$self) { 444 $self->{ARGS}{$k} = $self->{$k}; 445 } 446 447 $self = {} unless defined $self; 448 449 # Temporarily bless it into MM so it can be used as an 450 # object. It will be blessed into a temp package later. 451 bless $self, "MM"; 452 453 # Cleanup all the module requirement bits 454 my %key2cmr; 455 for my $key (qw(PREREQ_PM BUILD_REQUIRES CONFIGURE_REQUIRES TEST_REQUIRES)) { 456 $self->{$key} ||= {}; 457 if (_has_cpan_meta_requirements) { 458 my $cmr = CPAN::Meta::Requirements->from_string_hash( 459 $self->{$key}, 460 { 461 bad_version_hook => sub { 462 #no warnings 'numeric'; # module doesn't use warnings 463 my $fallback; 464 if ( $_[0] =~ m!^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$! ) { 465 $fallback = sprintf "%f", $_[0]; 466 } else { 467 ($fallback) = $_[0] ? ($_[0] =~ /^([0-9.]+)/) : 0; 468 $fallback += 0; 469 carp "Unparsable version '$_[0]' for prerequisite $_[1] treated as $fallback"; 470 } 471 version->new($fallback); 472 }, 473 }, 474 ); 475 $self->{$key} = $cmr->as_string_hash; 476 $key2cmr{$key} = $cmr; 477 } else { 478 for my $module (sort keys %{ $self->{$key} }) { 479 my $version = $self->{$key}->{$module}; 480 my $fallback = 0; 481 if (!defined($version) or !length($version)) { 482 carp "Undefined requirement for $module treated as '0' (CPAN::Meta::Requirements not available)"; 483 } 484 elsif ($version =~ /^\d+(?:\.\d+(?:_\d+)*)?$/) { 485 next; 486 } 487 else { 488 if ( $version =~ m!^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$! ) { 489 $fallback = sprintf "%f", $version; 490 } else { 491 ($fallback) = $version ? ($version =~ /^([0-9.]+)/) : 0; 492 $fallback += 0; 493 carp "Unparsable version '$version' for prerequisite $module treated as $fallback (CPAN::Meta::Requirements not available)"; 494 } 495 } 496 $self->{$key}->{$module} = $fallback; 497 } 498 } 499 } 500 501 if ("@ARGV" =~ /\bPREREQ_PRINT\b/) { 502 $self->_PREREQ_PRINT; 503 } 504 505 # PRINT_PREREQ is RedHatism. 506 if ("@ARGV" =~ /\bPRINT_PREREQ\b/) { 507 $self->_PRINT_PREREQ; 508 } 509 510 print "MakeMaker (v$VERSION)\n" if $Verbose; 511 if (-f "MANIFEST" && ! -f "Makefile" && ! $UNDER_CORE){ 512 check_manifest(); 513 } 514 515 check_hints($self); 516 517 if ( $self->{MIN_PERL_VERSION}) { 518 my $perl_version = $self->{MIN_PERL_VERSION}; 519 if (ref $perl_version) { 520 # assume a version object 521 } 522 else { 523 $perl_version = eval { 524 local $SIG{__WARN__} = sub { 525 # simulate "use warnings FATAL => 'all'" for vintage perls 526 die @_; 527 }; 528 version->new( $perl_version )->numify; 529 }; 530 $perl_version =~ tr/_//d 531 if defined $perl_version; 532 } 533 534 if (!defined $perl_version) { 535 # should this be a warning? 536 die sprintf <<'END', $self->{MIN_PERL_VERSION}; 537MakeMaker FATAL: MIN_PERL_VERSION (%s) is not in a recognized format. 538Recommended is a quoted numerical value like '5.005' or '5.008001'. 539END 540 } 541 elsif ($perl_version > "$]") { 542 my $message = sprintf <<'END', $perl_version, $]; 543Perl version %s or higher required. We run %s. 544END 545 if ($self->{PREREQ_FATAL}) { 546 die "MakeMaker FATAL: $message"; 547 } 548 else { 549 warn "Warning: $message"; 550 } 551 } 552 553 $self->{MIN_PERL_VERSION} = $perl_version; 554 } 555 556 my %configure_att; # record &{$self->{CONFIGURE}} attributes 557 my(%initial_att) = %$self; # record initial attributes 558 559 my(%unsatisfied) = (); 560 my %prereq2version; 561 my $cmr; 562 if (_has_cpan_meta_requirements) { 563 $cmr = CPAN::Meta::Requirements->new; 564 for my $key (qw(PREREQ_PM BUILD_REQUIRES CONFIGURE_REQUIRES TEST_REQUIRES)) { 565 $cmr->add_requirements($key2cmr{$key}) if $key2cmr{$key}; 566 } 567 foreach my $prereq ($cmr->required_modules) { 568 $prereq2version{$prereq} = $cmr->requirements_for_module($prereq); 569 } 570 } else { 571 for my $key (qw(PREREQ_PM BUILD_REQUIRES CONFIGURE_REQUIRES TEST_REQUIRES)) { 572 next unless my $module2version = $self->{$key}; 573 $prereq2version{$_} = $module2version->{$_} for keys %$module2version; 574 } 575 } 576 foreach my $prereq (sort keys %prereq2version) { 577 my $required_version = $prereq2version{$prereq}; 578 579 my $pr_version = 0; 580 my $installed_file; 581 582 if ( $prereq eq 'perl' ) { 583 if ( defined $required_version && $required_version =~ /^v?[\d_\.]+$/ 584 || $required_version !~ /^v?[\d_\.]+$/ ) { 585 require version; 586 my $normal = eval { version->new( $required_version ) }; 587 $required_version = $normal if defined $normal; 588 } 589 $installed_file = $prereq; 590 $pr_version = $]; 591 } 592 else { 593 $installed_file = MM->_installed_file_for_module($prereq); 594 $pr_version = MM->parse_version($installed_file) if $installed_file; 595 $pr_version = 0 if $pr_version eq 'undef'; 596 if ( !eval { version->new( $pr_version ); 1 } ) { 597 #no warnings 'numeric'; # module doesn't use warnings 598 my $fallback; 599 if ( $pr_version =~ m!^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$! ) { 600 $fallback = sprintf '%f', $pr_version; 601 } else { 602 ($fallback) = $pr_version ? ($pr_version =~ /^([0-9.]+)/) : 0; 603 $fallback += 0; 604 carp "Unparsable version '$pr_version' for installed prerequisite $prereq treated as $fallback"; 605 } 606 $pr_version = $fallback; 607 } 608 } 609 610 # convert X.Y_Z alpha version #s to X.YZ for easier comparisons 611 $pr_version =~ s/(\d+)\.(\d+)_(\d+)/$1.$2$3/; 612 613 if (!$installed_file) { 614 warn sprintf "Warning: prerequisite %s %s not found.\n", 615 $prereq, $required_version 616 unless $self->{PREREQ_FATAL} 617 or $UNDER_CORE; 618 619 $unsatisfied{$prereq} = 'not installed'; 620 } 621 elsif ( 622 $cmr 623 ? !$cmr->accepts_module($prereq, $pr_version) 624 : $required_version > $pr_version 625 ) { 626 warn sprintf "Warning: prerequisite %s %s not found. We have %s.\n", 627 $prereq, $required_version, ($pr_version || 'unknown version') 628 unless $self->{PREREQ_FATAL} 629 or $UNDER_CORE; 630 631 $unsatisfied{$prereq} = $required_version || 'unknown version' ; 632 } 633 } 634 635 if (%unsatisfied && $self->{PREREQ_FATAL}){ 636 my $failedprereqs = join "\n", map {" $_ $unsatisfied{$_}"} 637 sort { lc $a cmp lc $b } keys %unsatisfied; 638 die <<"END"; 639MakeMaker FATAL: prerequisites not found. 640$failedprereqs 641 642Please install these modules first and rerun 'perl Makefile.PL'. 643END 644 } 645 646 if (defined $self->{CONFIGURE}) { 647 if (ref $self->{CONFIGURE} eq 'CODE') { 648 %configure_att = %{&{$self->{CONFIGURE}}}; 649 _convert_compat_attrs(\%configure_att); 650 $self = { %$self, %configure_att }; 651 } else { 652 croak "Attribute 'CONFIGURE' to WriteMakefile() not a code reference\n"; 653 } 654 } 655 656 my $newclass = ++$PACKNAME; 657 local @Parent = @Parent; # Protect against non-local exits 658 { 659 print "Blessing Object into class [$newclass]\n" if $Verbose>=2; 660 mv_all_methods("MY",$newclass); 661 bless $self, $newclass; 662 push @Parent, $self; 663 require ExtUtils::MY; 664 665 no strict 'refs'; ## no critic; 666 @{"$newclass\:\:ISA"} = 'MM'; 667 } 668 669 if (defined $Parent[-2]){ 670 $self->{PARENT} = $Parent[-2]; 671 for my $key (@Prepend_parent) { 672 next unless defined $self->{PARENT}{$key}; 673 674 # Don't stomp on WriteMakefile() args. 675 next if defined $self->{ARGS}{$key} and 676 $self->{ARGS}{$key} eq $self->{$key}; 677 678 $self->{$key} = $self->{PARENT}{$key}; 679 680 if ($Is_VMS && $key =~ /PERL$/) { 681 # PERL or FULLPERL will be a command verb or even a 682 # command with an argument instead of a full file 683 # specification under VMS. So, don't turn the command 684 # into a filespec, but do add a level to the path of 685 # the argument if not already absolute. 686 my @cmd = split /\s+/, $self->{$key}; 687 $cmd[1] = $self->catfile('[-]',$cmd[1]) 688 unless (@cmd < 2) || $self->file_name_is_absolute($cmd[1]); 689 $self->{$key} = join(' ', @cmd); 690 } else { 691 my $value = $self->{$key}; 692 # not going to test in FS so only stripping start 693 $value =~ s/"// if $key =~ /PERL$/ and $self->is_make_type('dmake'); 694 $value =~ s/^"// if $key =~ /PERL$/; 695 $value = $self->catdir("..", $value) 696 unless $self->file_name_is_absolute($value); 697 $value = qq{"$value} if $key =~ /PERL$/; 698 $self->{$key} = $value; 699 } 700 } 701 if ($self->{PARENT}) { 702 $self->{PARENT}->{CHILDREN}->{$newclass} = $self; 703 foreach my $opt (qw(POLLUTE PERL_CORE LINKTYPE AR FULL_AR CC CCFLAGS 704 OPTIMIZE LD LDDLFLAGS LDFLAGS PERL_ARCHLIB DESTDIR)) { 705 if (exists $self->{PARENT}->{$opt} 706 and not exists $self->{$opt}) 707 { 708 # inherit, but only if already unspecified 709 $self->{$opt} = $self->{PARENT}->{$opt}; 710 } 711 } 712 } 713 my @fm = grep /^FIRST_MAKEFILE=/, @ARGV; 714 parse_args($self,@fm) if @fm; 715 } 716 else { 717 parse_args($self, _shellwords($ENV{PERL_MM_OPT} || ''),@ARGV); 718 } 719 720 # RT#91540 PREREQ_FATAL not recognized on command line 721 if (%unsatisfied && $self->{PREREQ_FATAL}){ 722 my $failedprereqs = join "\n", map {" $_ $unsatisfied{$_}"} 723 sort { lc $a cmp lc $b } keys %unsatisfied; 724 die <<"END"; 725MakeMaker FATAL: prerequisites not found. 726$failedprereqs 727 728Please install these modules first and rerun 'perl Makefile.PL'. 729END 730 } 731 732 $self->{NAME} ||= $self->guess_name; 733 734 warn "Warning: NAME must be a package name\n" 735 unless $self->{NAME} =~ m!^[A-Z_a-z][0-9A-Z_a-z]*(?:::[0-9A-Z_a-z]+)*$!; 736 737 ($self->{NAME_SYM} = $self->{NAME}) =~ s/\W+/_/g; 738 739 $self->init_MAKE; 740 $self->init_main; 741 $self->init_VERSION; 742 $self->init_dist; 743 $self->init_INST; 744 $self->init_INSTALL; 745 $self->init_DEST; 746 $self->init_dirscan; 747 $self->init_PM; 748 $self->init_MANPODS; 749 $self->init_xs; 750 $self->init_PERL; 751 $self->init_DIRFILESEP; 752 $self->init_linker; 753 $self->init_ABSTRACT; 754 755 $self->arch_check( 756 $INC{'Config.pm'}, 757 $self->catfile($Config{'archlibexp'}, "Config.pm") 758 ); 759 760 $self->init_tools(); 761 $self->init_others(); 762 $self->init_platform(); 763 $self->init_PERM(); 764 my @args = @ARGV; 765 @args = map { Encode::decode(locale => $_) } @args if $CAN_DECODE; 766 my($argv) = neatvalue(\@args); 767 $argv =~ s/^\[/(/; 768 $argv =~ s/\]$/)/; 769 770 push @{$self->{RESULT}}, <<END; 771# This Makefile is for the $self->{NAME} extension to perl. 772# 773# It was generated automatically by MakeMaker version 774# $VERSION (Revision: $Revision) from the contents of 775# Makefile.PL. Don't edit this file, edit Makefile.PL instead. 776# 777# ANY CHANGES MADE HERE WILL BE LOST! 778# 779# MakeMaker ARGV: $argv 780# 781END 782 783 push @{$self->{RESULT}}, $self->_MakeMaker_Parameters_section(\%initial_att); 784 785 if (defined $self->{CONFIGURE}) { 786 push @{$self->{RESULT}}, <<END; 787 788# MakeMaker 'CONFIGURE' Parameters: 789END 790 if (scalar(keys %configure_att) > 0) { 791 foreach my $key (sort keys %configure_att){ 792 next if $key eq 'ARGS'; 793 my($v) = neatvalue($configure_att{$key}); 794 $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/; 795 $v =~ tr/\n/ /s; 796 push @{$self->{RESULT}}, "# $key => $v"; 797 } 798 } 799 else 800 { 801 push @{$self->{RESULT}}, "# no values returned"; 802 } 803 undef %configure_att; # free memory 804 } 805 806 # turn the SKIP array into a SKIPHASH hash 807 for my $skip (@{$self->{SKIP} || []}) { 808 $self->{SKIPHASH}{$skip} = 1; 809 } 810 delete $self->{SKIP}; # free memory 811 812 if ($self->{PARENT}) { 813 for (qw/install dist dist_basics dist_core distdir dist_test dist_ci/) { 814 $self->{SKIPHASH}{$_} = 1; 815 } 816 } 817 818 # We run all the subdirectories now. They don't have much to query 819 # from the parent, but the parent has to query them: if they need linking! 820 unless ($self->{NORECURS}) { 821 $self->eval_in_subdirs if @{$self->{DIR}}; 822 } 823 824 foreach my $section ( @MM_Sections ){ 825 # Support for new foo_target() methods. 826 my $method = $section; 827 $method .= '_target' unless $self->can($method); 828 829 print "Processing Makefile '$section' section\n" if ($Verbose >= 2); 830 my($skipit) = $self->skipcheck($section); 831 if ($skipit){ 832 push @{$self->{RESULT}}, "\n# --- MakeMaker $section section $skipit."; 833 } else { 834 my(%a) = %{$self->{$section} || {}}; 835 push @{$self->{RESULT}}, "\n# --- MakeMaker $section section:"; 836 push @{$self->{RESULT}}, "# " . join ", ", %a if $Verbose && %a; 837 push @{$self->{RESULT}}, $self->maketext_filter( 838 $self->$method( %a ) 839 ); 840 } 841 } 842 843 push @{$self->{RESULT}}, "\n# End."; 844 845 $self; 846} 847 848sub WriteEmptyMakefile { 849 croak "WriteEmptyMakefile: Need an even number of args" if @_ % 2; 850 851 my %att = @_; 852 $att{DIR} = [] unless $att{DIR}; # don't recurse by default 853 my $self = MM->new(\%att); 854 855 my $new = $self->{MAKEFILE}; 856 my $old = $self->{MAKEFILE_OLD}; 857 if (-f $old) { 858 _unlink($old) or warn "unlink $old: $!"; 859 } 860 if ( -f $new ) { 861 _rename($new, $old) or warn "rename $new => $old: $!" 862 } 863 open my $mfh, '>', $new or die "open $new for write: $!"; 864 print $mfh <<'EOP'; 865all : 866 867manifypods : 868 869subdirs : 870 871dynamic : 872 873static : 874 875clean : 876 877install : 878 879makemakerdflt : 880 881test : 882 883test_dynamic : 884 885test_static : 886 887EOP 888 close $mfh or die "close $new for write: $!"; 889} 890 891 892=begin private 893 894=head3 _installed_file_for_module 895 896 my $file = MM->_installed_file_for_module($module); 897 898Return the first installed .pm $file associated with the $module. The 899one which will show up when you C<use $module>. 900 901$module is something like "strict" or "Test::More". 902 903=end private 904 905=cut 906 907sub _installed_file_for_module { 908 my $class = shift; 909 my $prereq = shift; 910 911 my $file = "$prereq.pm"; 912 $file =~ s{::}{/}g; 913 914 my $path; 915 for my $dir (@INC) { 916 my $tmp = File::Spec->catfile($dir, $file); 917 if ( -r $tmp ) { 918 $path = $tmp; 919 last; 920 } 921 } 922 923 return $path; 924} 925 926 927# Extracted from MakeMaker->new so we can test it 928sub _MakeMaker_Parameters_section { 929 my $self = shift; 930 my $att = shift; 931 932 my @result = <<'END'; 933# MakeMaker Parameters: 934END 935 936 foreach my $key (sort keys %$att){ 937 next if $key eq 'ARGS'; 938 my $v; 939 if ($key eq 'PREREQ_PM') { 940 # CPAN.pm takes prereqs from this field in 'Makefile' 941 # and does not know about BUILD_REQUIRES 942 $v = neatvalue({ 943 %{ $att->{PREREQ_PM} || {} }, 944 %{ $att->{BUILD_REQUIRES} || {} }, 945 %{ $att->{TEST_REQUIRES} || {} }, 946 }); 947 } else { 948 $v = neatvalue($att->{$key}); 949 } 950 951 $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/; 952 $v =~ tr/\n/ /s; 953 push @result, "# $key => $v"; 954 } 955 956 return @result; 957} 958 959# _shellwords and _parseline borrowed from Text::ParseWords 960sub _shellwords { 961 my (@lines) = @_; 962 my @allwords; 963 964 foreach my $line (@lines) { 965 $line =~ s/^\s+//; 966 my @words = _parse_line('\s+', 0, $line); 967 pop @words if (@words and !defined $words[-1]); 968 return() unless (@words || !length($line)); 969 push(@allwords, @words); 970 } 971 return(@allwords); 972} 973 974sub _parse_line { 975 my($delimiter, $keep, $line) = @_; 976 my($word, @pieces); 977 978 no warnings 'uninitialized'; # we will be testing undef strings 979 980 while (length($line)) { 981 # This pattern is optimised to be stack conservative on older perls. 982 # Do not refactor without being careful and testing it on very long strings. 983 # See Perl bug #42980 for an example of a stack busting input. 984 $line =~ s/^ 985 (?: 986 # double quoted string 987 (") # $quote 988 ((?>[^\\"]*(?:\\.[^\\"]*)*))" # $quoted 989 | # --OR-- 990 # singe quoted string 991 (') # $quote 992 ((?>[^\\']*(?:\\.[^\\']*)*))' # $quoted 993 | # --OR-- 994 # unquoted string 995 ( # $unquoted 996 (?:\\.|[^\\"'])*? 997 ) 998 # followed by 999 ( # $delim 1000 \Z(?!\n) # EOL 1001 | # --OR-- 1002 (?-x:$delimiter) # delimiter 1003 | # --OR-- 1004 (?!^)(?=["']) # a quote 1005 ) 1006 )//xs or return; # extended layout 1007 my ($quote, $quoted, $unquoted, $delim) = (($1 ? ($1,$2) : ($3,$4)), $5, $6); 1008 1009 1010 return() unless( defined($quote) || length($unquoted) || length($delim)); 1011 1012 if ($keep) { 1013 $quoted = "$quote$quoted$quote"; 1014 } 1015 else { 1016 $unquoted =~ s/\\(.)/$1/sg; 1017 if (defined $quote) { 1018 $quoted =~ s/\\(.)/$1/sg if ($quote eq '"'); 1019 #$quoted =~ s/\\([\\'])/$1/g if ( $PERL_SINGLE_QUOTE && $quote eq "'"); 1020 } 1021 } 1022 $word .= substr($line, 0, 0); # leave results tainted 1023 $word .= defined $quote ? $quoted : $unquoted; 1024 1025 if (length($delim)) { 1026 push(@pieces, $word); 1027 push(@pieces, $delim) if ($keep eq 'delimiters'); 1028 undef $word; 1029 } 1030 if (!length($line)) { 1031 push(@pieces, $word); 1032 } 1033 } 1034 return(@pieces); 1035} 1036 1037sub check_manifest { 1038 print STDOUT "Checking if your kit is complete...\n"; 1039 require ExtUtils::Manifest; 1040 # avoid warning 1041 $ExtUtils::Manifest::Quiet = $ExtUtils::Manifest::Quiet = 1; 1042 my(@missed) = ExtUtils::Manifest::manicheck(); 1043 if (@missed) { 1044 print "Warning: the following files are missing in your kit:\n"; 1045 print "\t", join "\n\t", @missed; 1046 print "\n"; 1047 print "Please inform the author.\n"; 1048 } else { 1049 print "Looks good\n"; 1050 } 1051} 1052 1053sub parse_args{ 1054 my($self, @args) = @_; 1055 @args = map { Encode::decode(locale => $_) } @args if $CAN_DECODE; 1056 foreach (@args) { 1057 unless (m/(.*?)=(.*)/) { 1058 ++$Verbose if m/^verb/; 1059 next; 1060 } 1061 my($name, $value) = ($1, $2); 1062 if ($value =~ m/^~(\w+)?/) { # tilde with optional username 1063 $value =~ s [^~(\w*)] 1064 [$1 ? 1065 ((getpwnam($1))[7] || "~$1") : 1066 (getpwuid($>))[7] 1067 ]ex; 1068 } 1069 1070 # Remember the original args passed it. It will be useful later. 1071 $self->{ARGS}{uc $name} = $self->{uc $name} = $value; 1072 } 1073 1074 # catch old-style 'potential_libs' and inform user how to 'upgrade' 1075 if (defined $self->{potential_libs}){ 1076 my($msg)="'potential_libs' => '$self->{potential_libs}' should be"; 1077 if ($self->{potential_libs}){ 1078 print "$msg changed to:\n\t'LIBS' => ['$self->{potential_libs}']\n"; 1079 } else { 1080 print "$msg deleted.\n"; 1081 } 1082 $self->{LIBS} = [$self->{potential_libs}]; 1083 delete $self->{potential_libs}; 1084 } 1085 # catch old-style 'ARMAYBE' and inform user how to 'upgrade' 1086 if (defined $self->{ARMAYBE}){ 1087 my($armaybe) = $self->{ARMAYBE}; 1088 print "ARMAYBE => '$armaybe' should be changed to:\n", 1089 "\t'dynamic_lib' => {ARMAYBE => '$armaybe'}\n"; 1090 my(%dl) = %{$self->{dynamic_lib} || {}}; 1091 $self->{dynamic_lib} = { %dl, ARMAYBE => $armaybe}; 1092 delete $self->{ARMAYBE}; 1093 } 1094 if (defined $self->{LDTARGET}){ 1095 print "LDTARGET should be changed to LDFROM\n"; 1096 $self->{LDFROM} = $self->{LDTARGET}; 1097 delete $self->{LDTARGET}; 1098 } 1099 # Turn a DIR argument on the command line into an array 1100 if (defined $self->{DIR} && ref \$self->{DIR} eq 'SCALAR') { 1101 # So they can choose from the command line, which extensions they want 1102 # the grep enables them to have some colons too much in case they 1103 # have to build a list with the shell 1104 $self->{DIR} = [grep $_, split ":", $self->{DIR}]; 1105 } 1106 # Turn a INCLUDE_EXT argument on the command line into an array 1107 if (defined $self->{INCLUDE_EXT} && ref \$self->{INCLUDE_EXT} eq 'SCALAR') { 1108 $self->{INCLUDE_EXT} = [grep $_, split '\s+', $self->{INCLUDE_EXT}]; 1109 } 1110 # Turn a EXCLUDE_EXT argument on the command line into an array 1111 if (defined $self->{EXCLUDE_EXT} && ref \$self->{EXCLUDE_EXT} eq 'SCALAR') { 1112 $self->{EXCLUDE_EXT} = [grep $_, split '\s+', $self->{EXCLUDE_EXT}]; 1113 } 1114 1115 foreach my $mmkey (sort keys %$self){ 1116 next if $mmkey eq 'ARGS'; 1117 print " $mmkey => ", neatvalue($self->{$mmkey}), "\n" if $Verbose; 1118 print "'$mmkey' is not a known MakeMaker parameter name.\n" 1119 unless exists $Recognized_Att_Keys{$mmkey}; 1120 } 1121 $| = 1 if $Verbose; 1122} 1123 1124sub check_hints { 1125 my($self) = @_; 1126 # We allow extension-specific hints files. 1127 1128 require File::Spec; 1129 my $curdir = File::Spec->curdir; 1130 1131 my $hint_dir = File::Spec->catdir($curdir, "hints"); 1132 return unless -d $hint_dir; 1133 1134 # First we look for the best hintsfile we have 1135 my($hint)="${^O}_$Config{osvers}"; 1136 $hint =~ s/\./_/g; 1137 $hint =~ s/_$//; 1138 return unless $hint; 1139 1140 # Also try without trailing minor version numbers. 1141 while (1) { 1142 last if -f File::Spec->catfile($hint_dir, "$hint.pl"); # found 1143 } continue { 1144 last unless $hint =~ s/_[^_]*$//; # nothing to cut off 1145 } 1146 my $hint_file = File::Spec->catfile($hint_dir, "$hint.pl"); 1147 1148 return unless -f $hint_file; # really there 1149 1150 _run_hintfile($self, $hint_file); 1151} 1152 1153sub _run_hintfile { 1154 my ($self, $hint_file) = @_; 1155 1156 local($@, $!); 1157 print "Processing hints file $hint_file\n" if $Verbose; 1158 1159 if(open(my $fh, '<', $hint_file)) { 1160 my $hints_content = do { local $/; <$fh> }; 1161 no strict; 1162 eval $hints_content; 1163 warn "Failed to run hint file $hint_file: $@" if $@; 1164 } 1165 else { 1166 warn "Could not open $hint_file for read: $!"; 1167 } 1168} 1169 1170sub mv_all_methods { 1171 my($from,$to) = @_; 1172 local $SIG{__WARN__} = sub { 1173 # can't use 'no warnings redefined', 5.6 only 1174 warn @_ unless $_[0] =~ /^Subroutine .* redefined/ 1175 }; 1176 foreach my $method (@Overridable) { 1177 next unless defined &{"${from}::$method"}; 1178 no strict 'refs'; ## no critic 1179 *{"${to}::$method"} = \&{"${from}::$method"}; 1180 1181 # If we delete a method, then it will be undefined and cannot 1182 # be called. But as long as we have Makefile.PLs that rely on 1183 # %MY:: being intact, we have to fill the hole with an 1184 # inheriting method: 1185 1186 { 1187 package MY; 1188 my $super = "SUPER::".$method; 1189 *{$method} = sub { 1190 shift->$super(@_); 1191 }; 1192 } 1193 } 1194} 1195 1196sub skipcheck { 1197 my($self) = shift; 1198 my($section) = @_; 1199 return 'skipped' if $section eq 'metafile' && $UNDER_CORE; 1200 if ($section eq 'dynamic') { 1201 print "Warning (non-fatal): Target 'dynamic' depends on targets ", 1202 "in skipped section 'dynamic_bs'\n" 1203 if $self->{SKIPHASH}{dynamic_bs} && $Verbose; 1204 print "Warning (non-fatal): Target 'dynamic' depends on targets ", 1205 "in skipped section 'dynamic_lib'\n" 1206 if $self->{SKIPHASH}{dynamic_lib} && $Verbose; 1207 } 1208 if ($section eq 'dynamic_lib') { 1209 print "Warning (non-fatal): Target '\$(INST_DYNAMIC)' depends on ", 1210 "targets in skipped section 'dynamic_bs'\n" 1211 if $self->{SKIPHASH}{dynamic_bs} && $Verbose; 1212 } 1213 if ($section eq 'static') { 1214 print "Warning (non-fatal): Target 'static' depends on targets ", 1215 "in skipped section 'static_lib'\n" 1216 if $self->{SKIPHASH}{static_lib} && $Verbose; 1217 } 1218 return 'skipped' if $self->{SKIPHASH}{$section}; 1219 return ''; 1220} 1221 1222# returns filehandle, dies on fail. :raw so no :crlf 1223sub open_for_writing { 1224 my ($file) = @_; 1225 open my $fh ,">", $file or die "Unable to open $file: $!"; 1226 my @layers = ':raw'; 1227 push @layers, join ' ', ':encoding(locale)' if $CAN_DECODE; 1228 binmode $fh, join ' ', @layers; 1229 $fh; 1230} 1231 1232sub flush { 1233 my $self = shift; 1234 1235 my $finalname = $self->{MAKEFILE}; 1236 printf STDOUT "Generating a %s %s\n", $self->make_type, $finalname if $Verbose || !$self->{PARENT}; 1237 print STDOUT "Writing $finalname for $self->{NAME}\n" if $Verbose || !$self->{PARENT}; 1238 1239 unlink($finalname, "MakeMaker.tmp", $Is_VMS ? 'Descrip.MMS' : ()); 1240 1241 write_file_via_tmp($finalname, $self->{RESULT}); 1242 1243 # Write MYMETA.yml to communicate metadata up to the CPAN clients 1244 print STDOUT "Writing MYMETA.yml and MYMETA.json\n" 1245 if !$self->{NO_MYMETA} and $self->write_mymeta( $self->mymeta ); 1246 1247 # save memory 1248 if ($self->{PARENT} && !$self->{_KEEP_AFTER_FLUSH}) { 1249 my %keep = map { ($_ => 1) } qw(NEEDS_LINKING HAS_LINK_CODE); 1250 delete $self->{$_} for grep !$keep{$_}, keys %$self; 1251 } 1252 1253 system("$Config::Config{eunicefix} $finalname") 1254 if $Config::Config{eunicefix} ne ":"; 1255 1256 return; 1257} 1258 1259sub write_file_via_tmp { 1260 my ($finalname, $contents) = @_; 1261 my $fh = open_for_writing("MakeMaker.tmp"); 1262 die "write_file_via_tmp: 2nd arg must be ref" unless ref $contents; 1263 for my $chunk (@$contents) { 1264 my $to_write = $chunk; 1265 utf8::encode $to_write if !$CAN_DECODE && "$]" > 5.008; 1266 print $fh "$to_write\n" or die "Can't write to MakeMaker.tmp: $!"; 1267 } 1268 close $fh or die "Can't write to MakeMaker.tmp: $!"; 1269 _rename("MakeMaker.tmp", $finalname) or 1270 warn "rename MakeMaker.tmp => $finalname: $!"; 1271 chmod 0644, $finalname if !$Is_VMS; 1272 return; 1273} 1274 1275# This is a rename for OS's where the target must be unlinked first. 1276sub _rename { 1277 my($src, $dest) = @_; 1278 _unlink($dest); 1279 return rename $src, $dest; 1280} 1281 1282# This is an unlink for OS's where the target must be writable first. 1283sub _unlink { 1284 my @files = @_; 1285 chmod 0666, @files; 1286 return unlink @files; 1287} 1288 1289 1290# The following mkbootstrap() is only for installations that are calling 1291# the pre-4.1 mkbootstrap() from their old Makefiles. This MakeMaker 1292# writes Makefiles, that use ExtUtils::Mkbootstrap directly. 1293sub mkbootstrap { 1294 die <<END; 1295!!! Your Makefile has been built such a long time ago, !!! 1296!!! that is unlikely to work with current MakeMaker. !!! 1297!!! Please rebuild your Makefile !!! 1298END 1299} 1300 1301# Ditto for mksymlists() as of MakeMaker 5.17 1302sub mksymlists { 1303 die <<END; 1304!!! Your Makefile has been built such a long time ago, !!! 1305!!! that is unlikely to work with current MakeMaker. !!! 1306!!! Please rebuild your Makefile !!! 1307END 1308} 1309 1310sub neatvalue { 1311 my($v) = @_; 1312 return "undef" unless defined $v; 1313 my($t) = ref $v; 1314 return "q[$v]" unless $t; 1315 if ($t eq 'ARRAY') { 1316 my(@m, @neat); 1317 push @m, "["; 1318 foreach my $elem (@$v) { 1319 push @neat, "q[$elem]"; 1320 } 1321 push @m, join ", ", @neat; 1322 push @m, "]"; 1323 return join "", @m; 1324 } 1325 return $v unless $t eq 'HASH'; 1326 my(@m, $key, $val); 1327 for my $key (sort keys %$v) { 1328 last unless defined $key; # cautious programming in case (undef,undef) is true 1329 push @m,"$key=>".neatvalue($v->{$key}); 1330 } 1331 return "{ ".join(', ',@m)." }"; 1332} 1333 1334sub _find_magic_vstring { 1335 my $value = shift; 1336 return $value if $UNDER_CORE; 1337 my $tvalue = ''; 1338 require B; 1339 my $sv = B::svref_2object(\$value); 1340 my $magic = ref($sv) eq 'B::PVMG' ? $sv->MAGIC : undef; 1341 while ( $magic ) { 1342 if ( $magic->TYPE eq 'V' ) { 1343 $tvalue = $magic->PTR; 1344 $tvalue =~ s/^v?(.+)$/v$1/; 1345 last; 1346 } 1347 else { 1348 $magic = $magic->MOREMAGIC; 1349 } 1350 } 1351 return $tvalue; 1352} 1353 1354sub selfdocument { 1355 my($self) = @_; 1356 my(@m); 1357 if ($Verbose){ 1358 push @m, "\n# Full list of MakeMaker attribute values:"; 1359 foreach my $key (sort keys %$self){ 1360 next if $key eq 'RESULT' || $key =~ /^[A-Z][a-z]/; 1361 my($v) = neatvalue($self->{$key}); 1362 $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/; 1363 $v =~ tr/\n/ /s; 1364 push @m, "# $key => $v"; 1365 } 1366 } 1367 # added here as selfdocument is not overridable 1368 push @m, <<'EOF'; 1369 1370# here so even if top_targets is overridden, these will still be defined 1371# gmake will silently still work if any are .PHONY-ed but nmake won't 1372EOF 1373 push @m, join "\n", map "$_ ::\n\t\$(NOECHO) \$(NOOP)\n", 1374 # config is so manifypods won't puke if no subdirs 1375 grep !$self->{SKIPHASH}{$_}, 1376 qw(static dynamic config); 1377 join "\n", @m; 1378} 1379 13801; 1381 1382__END__ 1383 1384=head1 NAME 1385 1386ExtUtils::MakeMaker - Create a module Makefile 1387 1388=head1 SYNOPSIS 1389 1390 use ExtUtils::MakeMaker; 1391 1392 WriteMakefile( 1393 NAME => "Foo::Bar", 1394 VERSION_FROM => "lib/Foo/Bar.pm", 1395 ); 1396 1397=head1 DESCRIPTION 1398 1399This utility is designed to write a Makefile for an extension module 1400from a Makefile.PL. It is based on the Makefile.SH model provided by 1401Andy Dougherty and the perl5-porters. 1402 1403It splits the task of generating the Makefile into several subroutines 1404that can be individually overridden. Each subroutine returns the text 1405it wishes to have written to the Makefile. 1406 1407As there are various Make programs with incompatible syntax, which 1408use operating system shells, again with incompatible syntax, it is 1409important for users of this module to know which flavour of Make 1410a Makefile has been written for so they'll use the correct one and 1411won't have to face the possibly bewildering errors resulting from 1412using the wrong one. 1413 1414On POSIX systems, that program will likely be GNU Make; on Microsoft 1415Windows, it will be either Microsoft NMake, DMake or GNU Make. 1416See the section on the L</"MAKE"> parameter for details. 1417 1418ExtUtils::MakeMaker (EUMM) is object oriented. Each directory below the current 1419directory that contains a Makefile.PL is treated as a separate 1420object. This makes it possible to write an unlimited number of 1421Makefiles with a single invocation of WriteMakefile(). 1422 1423All inputs to WriteMakefile are Unicode characters, not just octets. EUMM 1424seeks to handle all of these correctly. It is currently still not possible 1425to portably use Unicode characters in module names, because this requires 1426Perl to handle Unicode filenames, which is not yet the case on Windows. 1427 1428See L<ExtUtils::MakeMaker::FAQ> for details of the design and usage. 1429 1430=head2 How To Write A Makefile.PL 1431 1432See L<ExtUtils::MakeMaker::Tutorial>. 1433 1434The long answer is the rest of the manpage :-) 1435 1436=head2 Default Makefile Behaviour 1437 1438The generated Makefile enables the user of the extension to invoke 1439 1440 perl Makefile.PL # optionally "perl Makefile.PL verbose" 1441 make 1442 make test # optionally set TEST_VERBOSE=1 1443 make install # See below 1444 1445The Makefile to be produced may be altered by adding arguments of the 1446form C<KEY=VALUE>. E.g. 1447 1448 perl Makefile.PL INSTALL_BASE=~ 1449 1450Other interesting targets in the generated Makefile are 1451 1452 make config # to check if the Makefile is up-to-date 1453 make clean # delete local temp files (Makefile gets renamed) 1454 make realclean # delete derived files (including ./blib) 1455 make ci # check in all the files in the MANIFEST file 1456 make dist # see below the Distribution Support section 1457 1458=head2 make test 1459 1460MakeMaker checks for the existence of a file named F<test.pl> in the 1461current directory, and if it exists it executes the script with the 1462proper set of perl C<-I> options. 1463 1464MakeMaker also checks for any files matching glob("t/*.t"). It will 1465execute all matching files in alphabetical order via the 1466L<Test::Harness> module with the C<-I> switches set correctly. 1467 1468You can also organize your tests within subdirectories in the F<t/> directory. 1469To do so, use the F<test> directive in your I<Makefile.PL>. For example, if you 1470had tests in: 1471 1472 t/foo 1473 t/foo/bar 1474 1475You could tell make to run tests in both of those directories with the 1476following directives: 1477 1478 test => {TESTS => 't/*/*.t t/*/*/*.t'} 1479 test => {TESTS => 't/foo/*.t t/foo/bar/*.t'} 1480 1481The first will run all test files in all first-level subdirectories and all 1482subdirectories they contain. The second will run tests in only the F<t/foo> 1483and F<t/foo/bar>. 1484 1485If you'd like to see the raw output of your tests, set the 1486C<TEST_VERBOSE> variable to true. 1487 1488 make test TEST_VERBOSE=1 1489 1490If you want to run particular test files, set the C<TEST_FILES> variable. 1491It is possible to use globbing with this mechanism. 1492 1493 make test TEST_FILES='t/foobar.t t/dagobah*.t' 1494 1495Windows users who are using C<nmake> should note that due to a bug in C<nmake>, 1496when specifying C<TEST_FILES> you must use back-slashes instead of forward-slashes. 1497 1498 nmake test TEST_FILES='t\foobar.t t\dagobah*.t' 1499 1500=head2 make testdb 1501 1502A useful variation of the above is the target C<testdb>. It runs the 1503test under the Perl debugger (see L<perldebug>). If the file 1504F<test.pl> exists in the current directory, it is used for the test. 1505 1506If you want to debug some other testfile, set the C<TEST_FILE> variable 1507thusly: 1508 1509 make testdb TEST_FILE=t/mytest.t 1510 1511By default the debugger is called using C<-d> option to perl. If you 1512want to specify some other option, set the C<TESTDB_SW> variable: 1513 1514 make testdb TESTDB_SW=-Dx 1515 1516=head2 make install 1517 1518make alone puts all relevant files into directories that are named by 1519the macros INST_LIB, INST_ARCHLIB, INST_SCRIPT, INST_MAN1DIR and 1520INST_MAN3DIR. All these default to something below ./blib if you are 1521I<not> building below the perl source directory. If you I<are> 1522building below the perl source, INST_LIB and INST_ARCHLIB default to 1523../../lib, and INST_SCRIPT is not defined. 1524 1525The I<install> target of the generated Makefile copies the files found 1526below each of the INST_* directories to their INSTALL* 1527counterparts. Which counterparts are chosen depends on the setting of 1528INSTALLDIRS according to the following table: 1529 1530 INSTALLDIRS set to 1531 perl site vendor 1532 1533 PERLPREFIX SITEPREFIX VENDORPREFIX 1534 INST_ARCHLIB INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH 1535 INST_LIB INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB 1536 INST_BIN INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN 1537 INST_SCRIPT INSTALLSCRIPT INSTALLSITESCRIPT INSTALLVENDORSCRIPT 1538 INST_MAN1DIR INSTALLMAN1DIR INSTALLSITEMAN1DIR INSTALLVENDORMAN1DIR 1539 INST_MAN3DIR INSTALLMAN3DIR INSTALLSITEMAN3DIR INSTALLVENDORMAN3DIR 1540 1541The INSTALL... macros in turn default to their %Config 1542($Config{installprivlib}, $Config{installarchlib}, etc.) counterparts. 1543 1544You can check the values of these variables on your system with 1545 1546 perl '-V:install.*' 1547 1548And to check the sequence in which the library directories are 1549searched by perl, run 1550 1551 perl -le 'print join $/, @INC' 1552 1553Sometimes older versions of the module you're installing live in other 1554directories in @INC. Because Perl loads the first version of a module it 1555finds, not the newest, you might accidentally get one of these older 1556versions even after installing a brand new version. To delete I<all other 1557versions of the module you're installing> (not simply older ones) set the 1558C<UNINST> variable. 1559 1560 make install UNINST=1 1561 1562 1563=head2 INSTALL_BASE 1564 1565INSTALL_BASE can be passed into Makefile.PL to change where your 1566module will be installed. INSTALL_BASE is more like what everyone 1567else calls "prefix" than PREFIX is. 1568 1569To have everything installed in your home directory, do the following. 1570 1571 # Unix users, INSTALL_BASE=~ works fine 1572 perl Makefile.PL INSTALL_BASE=/path/to/your/home/dir 1573 1574Like PREFIX, it sets several INSTALL* attributes at once. Unlike 1575PREFIX it is easy to predict where the module will end up. The 1576installation pattern looks like this: 1577 1578 INSTALLARCHLIB INSTALL_BASE/lib/perl5/$Config{archname} 1579 INSTALLPRIVLIB INSTALL_BASE/lib/perl5 1580 INSTALLBIN INSTALL_BASE/bin 1581 INSTALLSCRIPT INSTALL_BASE/bin 1582 INSTALLMAN1DIR INSTALL_BASE/man/man1 1583 INSTALLMAN3DIR INSTALL_BASE/man/man3 1584 1585INSTALL_BASE in MakeMaker and C<--install_base> in Module::Build (as 1586of 0.28) install to the same location. If you want MakeMaker and 1587Module::Build to install to the same location simply set INSTALL_BASE 1588and C<--install_base> to the same location. 1589 1590INSTALL_BASE was added in 6.31. 1591 1592 1593=head2 PREFIX and LIB attribute 1594 1595PREFIX and LIB can be used to set several INSTALL* attributes in one 1596go. Here's an example for installing into your home directory. 1597 1598 # Unix users, PREFIX=~ works fine 1599 perl Makefile.PL PREFIX=/path/to/your/home/dir 1600 1601This will install all files in the module under your home directory, 1602with man pages and libraries going into an appropriate place (usually 1603~/man and ~/lib). How the exact location is determined is complicated 1604and depends on how your Perl was configured. INSTALL_BASE works more 1605like what other build systems call "prefix" than PREFIX and we 1606recommend you use that instead. 1607 1608Another way to specify many INSTALL directories with a single 1609parameter is LIB. 1610 1611 perl Makefile.PL LIB=~/lib 1612 1613This will install the module's architecture-independent files into 1614~/lib, the architecture-dependent files into ~/lib/$archname. 1615 1616Note, that in both cases the tilde expansion is done by MakeMaker, not 1617by perl by default, nor by make. 1618 1619Conflicts between parameters LIB, PREFIX and the various INSTALL* 1620arguments are resolved so that: 1621 1622=over 4 1623 1624=item * 1625 1626setting LIB overrides any setting of INSTALLPRIVLIB, INSTALLARCHLIB, 1627INSTALLSITELIB, INSTALLSITEARCH (and they are not affected by PREFIX); 1628 1629=item * 1630 1631without LIB, setting PREFIX replaces the initial C<$Config{prefix}> 1632part of those INSTALL* arguments, even if the latter are explicitly 1633set (but are set to still start with C<$Config{prefix}>). 1634 1635=back 1636 1637If the user has superuser privileges, and is not working on AFS or 1638relatives, then the defaults for INSTALLPRIVLIB, INSTALLARCHLIB, 1639INSTALLSCRIPT, etc. will be appropriate, and this incantation will be 1640the best: 1641 1642 perl Makefile.PL; 1643 make; 1644 make test 1645 make install 1646 1647make install by default writes some documentation of what has been 1648done into the file C<$(INSTALLARCHLIB)/perllocal.pod>. This feature 1649can be bypassed by calling make pure_install. 1650 1651=head2 AFS users 1652 1653will have to specify the installation directories as these most 1654probably have changed since perl itself has been installed. They will 1655have to do this by calling 1656 1657 perl Makefile.PL INSTALLSITELIB=/afs/here/today \ 1658 INSTALLSCRIPT=/afs/there/now INSTALLMAN3DIR=/afs/for/manpages 1659 make 1660 1661Be careful to repeat this procedure every time you recompile an 1662extension, unless you are sure the AFS installation directories are 1663still valid. 1664 1665=head2 Static Linking of a new Perl Binary 1666 1667An extension that is built with the above steps is ready to use on 1668systems supporting dynamic loading. On systems that do not support 1669dynamic loading, any newly created extension has to be linked together 1670with the available resources. MakeMaker supports the linking process 1671by creating appropriate targets in the Makefile whenever an extension 1672is built. You can invoke the corresponding section of the makefile with 1673 1674 make perl 1675 1676That produces a new perl binary in the current directory with all 1677extensions linked in that can be found in INST_ARCHLIB, SITELIBEXP, 1678and PERL_ARCHLIB. To do that, MakeMaker writes a new Makefile, on 1679UNIX, this is called F<Makefile.aperl> (may be system dependent). If you 1680want to force the creation of a new perl, it is recommended that you 1681delete this F<Makefile.aperl>, so the directories are searched through 1682for linkable libraries again. 1683 1684The binary can be installed into the directory where perl normally 1685resides on your machine with 1686 1687 make inst_perl 1688 1689To produce a perl binary with a different name than C<perl>, either say 1690 1691 perl Makefile.PL MAP_TARGET=myperl 1692 make myperl 1693 make inst_perl 1694 1695or say 1696 1697 perl Makefile.PL 1698 make myperl MAP_TARGET=myperl 1699 make inst_perl MAP_TARGET=myperl 1700 1701In any case you will be prompted with the correct invocation of the 1702C<inst_perl> target that installs the new binary into INSTALLBIN. 1703 1704make inst_perl by default writes some documentation of what has been 1705done into the file C<$(INSTALLARCHLIB)/perllocal.pod>. This 1706can be bypassed by calling make pure_inst_perl. 1707 1708Warning: the inst_perl: target will most probably overwrite your 1709existing perl binary. Use with care! 1710 1711Sometimes you might want to build a statically linked perl although 1712your system supports dynamic loading. In this case you may explicitly 1713set the linktype with the invocation of the Makefile.PL or make: 1714 1715 perl Makefile.PL LINKTYPE=static # recommended 1716 1717or 1718 1719 make LINKTYPE=static # works on most systems 1720 1721=head2 Determination of Perl Library and Installation Locations 1722 1723MakeMaker needs to know, or to guess, where certain things are 1724located. Especially INST_LIB and INST_ARCHLIB (where to put the files 1725during the make(1) run), PERL_LIB and PERL_ARCHLIB (where to read 1726existing modules from), and PERL_INC (header files and C<libperl*.*>). 1727 1728Extensions may be built either using the contents of the perl source 1729directory tree or from the installed perl library. The recommended way 1730is to build extensions after you have run 'make install' on perl 1731itself. You can do that in any directory on your hard disk that is not 1732below the perl source tree. The support for extensions below the ext 1733directory of the perl distribution is only good for the standard 1734extensions that come with perl. 1735 1736If an extension is being built below the C<ext/> directory of the perl 1737source then MakeMaker will set PERL_SRC automatically (e.g., 1738C<../..>). If PERL_SRC is defined and the extension is recognized as 1739a standard extension, then other variables default to the following: 1740 1741 PERL_INC = PERL_SRC 1742 PERL_LIB = PERL_SRC/lib 1743 PERL_ARCHLIB = PERL_SRC/lib 1744 INST_LIB = PERL_LIB 1745 INST_ARCHLIB = PERL_ARCHLIB 1746 1747If an extension is being built away from the perl source then MakeMaker 1748will leave PERL_SRC undefined and default to using the installed copy 1749of the perl library. The other variables default to the following: 1750 1751 PERL_INC = $archlibexp/CORE 1752 PERL_LIB = $privlibexp 1753 PERL_ARCHLIB = $archlibexp 1754 INST_LIB = ./blib/lib 1755 INST_ARCHLIB = ./blib/arch 1756 1757If perl has not yet been installed then PERL_SRC can be defined on the 1758command line as shown in the previous section. 1759 1760 1761=head2 Which architecture dependent directory? 1762 1763If you don't want to keep the defaults for the INSTALL* macros, 1764MakeMaker helps you to minimize the typing needed: the usual 1765relationship between INSTALLPRIVLIB and INSTALLARCHLIB is determined 1766by Configure at perl compilation time. MakeMaker supports the user who 1767sets INSTALLPRIVLIB. If INSTALLPRIVLIB is set, but INSTALLARCHLIB not, 1768then MakeMaker defaults the latter to be the same subdirectory of 1769INSTALLPRIVLIB as Configure decided for the counterparts in %Config, 1770otherwise it defaults to INSTALLPRIVLIB. The same relationship holds 1771for INSTALLSITELIB and INSTALLSITEARCH. 1772 1773MakeMaker gives you much more freedom than needed to configure 1774internal variables and get different results. It is worth mentioning 1775that make(1) also lets you configure most of the variables that are 1776used in the Makefile. But in the majority of situations this will not 1777be necessary, and should only be done if the author of a package 1778recommends it (or you know what you're doing). 1779 1780=head2 Using Attributes and Parameters 1781 1782The following attributes may be specified as arguments to WriteMakefile() 1783or as NAME=VALUE pairs on the command line. Attributes that became 1784available with later versions of MakeMaker are indicated. 1785 1786In order to maintain portability of attributes with older versions of 1787MakeMaker you may want to use L<App::EUMM::Upgrade> with your C<Makefile.PL>. 1788 1789=over 2 1790 1791=item ABSTRACT 1792 1793One line description of the module. Will be included in PPD file. 1794 1795=item ABSTRACT_FROM 1796 1797Name of the file that contains the package description. MakeMaker looks 1798for a line in the POD matching /^($package\s-\s)(.*)/. This is typically 1799the first line in the "=head1 NAME" section. $2 becomes the abstract. 1800 1801=item AUTHOR 1802 1803Array of strings containing name (and email address) of package author(s). 1804Is used in CPAN Meta files (META.yml or META.json) and PPD 1805(Perl Package Description) files for PPM (Perl Package Manager). 1806 1807=item BINARY_LOCATION 1808 1809Used when creating PPD files for binary packages. It can be set to a 1810full or relative path or URL to the binary archive for a particular 1811architecture. For example: 1812 1813 perl Makefile.PL BINARY_LOCATION=x86/Agent.tar.gz 1814 1815builds a PPD package that references a binary of the C<Agent> package, 1816located in the C<x86> directory relative to the PPD itself. 1817 1818=item BUILD_REQUIRES 1819 1820Available in version 6.55_03 and above. 1821 1822A hash of modules that are needed to build your module but not run it. 1823 1824This will go into the C<build_requires> field of your F<META.yml> and the C<build> of the C<prereqs> field of your F<META.json>. 1825 1826Defaults to C<<< { "ExtUtils::MakeMaker" => 0 } >>> if this attribute is not specified. 1827 1828The format is the same as PREREQ_PM. 1829 1830=item C 1831 1832Ref to array of *.c file names. Initialised from a directory scan 1833and the values portion of the XS attribute hash. This is not 1834currently used by MakeMaker but may be handy in Makefile.PLs. 1835 1836=item CCFLAGS 1837 1838String that will be included in the compiler call command line between 1839the arguments INC and OPTIMIZE. Note that setting this will overwrite its 1840default value (C<$Config::Config{ccflags}>); to preserve that, include 1841the default value directly, e.g.: 1842 1843 CCFLAGS => "$Config::Config{ccflags} ..." 1844 1845=item CONFIG 1846 1847Arrayref. E.g. [qw(archname manext)] defines ARCHNAME & MANEXT from 1848config.sh. MakeMaker will add to CONFIG the following values anyway: 1849ar 1850cc 1851cccdlflags 1852ccdlflags 1853cpprun 1854dlext 1855dlsrc 1856ld 1857lddlflags 1858ldflags 1859libc 1860lib_ext 1861obj_ext 1862ranlib 1863sitelibexp 1864sitearchexp 1865so 1866 1867=item CONFIGURE 1868 1869CODE reference. The subroutine should return a hash reference. The 1870hash may contain further attributes, e.g. {LIBS =E<gt> ...}, that have to 1871be determined by some evaluation method. 1872 1873=item CONFIGURE_REQUIRES 1874 1875Available in version 6.52 and above. 1876 1877A hash of modules that are required to run Makefile.PL itself, but not 1878to run your distribution. 1879 1880This will go into the C<configure_requires> field of your F<META.yml> and the C<configure> of the C<prereqs> field of your F<META.json>. 1881 1882Defaults to C<<< { "ExtUtils::MakeMaker" => 0 } >>> if this attribute is not specified. 1883 1884The format is the same as PREREQ_PM. 1885 1886=item DEFINE 1887 1888Something like C<"-DHAVE_UNISTD_H"> 1889 1890=item DESTDIR 1891 1892This is the root directory into which the code will be installed. It 1893I<prepends itself to the normal prefix>. For example, if your code 1894would normally go into F</usr/local/lib/perl> you could set DESTDIR=~/tmp/ 1895and installation would go into F<~/tmp/usr/local/lib/perl>. 1896 1897This is primarily of use for people who repackage Perl modules. 1898 1899NOTE: Due to the nature of make, it is important that you put the trailing 1900slash on your DESTDIR. F<~/tmp/> not F<~/tmp>. 1901 1902=item DIR 1903 1904Ref to array of subdirectories containing Makefile.PLs e.g. ['sdbm'] 1905in ext/SDBM_File 1906 1907=item DISTNAME 1908 1909A safe filename for the package. 1910 1911Defaults to NAME below but with :: replaced with -. 1912 1913For example, Foo::Bar becomes Foo-Bar. 1914 1915=item DISTVNAME 1916 1917Your name for distributing the package with the version number 1918included. This is used by 'make dist' to name the resulting archive 1919file. 1920 1921Defaults to DISTNAME-VERSION. 1922 1923For example, version 1.04 of Foo::Bar becomes Foo-Bar-1.04. 1924 1925On some OS's where . has special meaning VERSION_SYM may be used in 1926place of VERSION. 1927 1928=item DLEXT 1929 1930Specifies the extension of the module's loadable object. For example: 1931 1932 DLEXT => 'unusual_ext', # Default value is $Config{so} 1933 1934NOTE: When using this option to alter the extension of a module's 1935loadable object, it is also necessary that the module's pm file 1936specifies the same change: 1937 1938 local $DynaLoader::dl_dlext = 'unusual_ext'; 1939 1940=item DL_FUNCS 1941 1942Hashref of symbol names for routines to be made available as universal 1943symbols. Each key/value pair consists of the package name and an 1944array of routine names in that package. Used only under AIX, OS/2, 1945VMS and Win32 at present. The routine names supplied will be expanded 1946in the same way as XSUB names are expanded by the XS() macro. 1947Defaults to 1948 1949 {"$(NAME)" => ["boot_$(NAME)" ] } 1950 1951e.g. 1952 1953 {"RPC" => [qw( boot_rpcb rpcb_gettime getnetconfigent )], 1954 "NetconfigPtr" => [ 'DESTROY'] } 1955 1956Please see the L<ExtUtils::Mksymlists> documentation for more information 1957about the DL_FUNCS, DL_VARS and FUNCLIST attributes. 1958 1959=item DL_VARS 1960 1961Array of symbol names for variables to be made available as universal symbols. 1962Used only under AIX, OS/2, VMS and Win32 at present. Defaults to []. 1963(e.g. [ qw(Foo_version Foo_numstreams Foo_tree ) ]) 1964 1965=item EXCLUDE_EXT 1966 1967Array of extension names to exclude when doing a static build. This 1968is ignored if INCLUDE_EXT is present. Consult INCLUDE_EXT for more 1969details. (e.g. [ qw( Socket POSIX ) ] ) 1970 1971This attribute may be most useful when specified as a string on the 1972command line: perl Makefile.PL EXCLUDE_EXT='Socket Safe' 1973 1974=item EXE_FILES 1975 1976Ref to array of executable files. The files will be copied to the 1977INST_SCRIPT directory. Make realclean will delete them from there 1978again. 1979 1980If your executables start with something like #!perl or 1981#!/usr/bin/perl MakeMaker will change this to the path of the perl 1982'Makefile.PL' was invoked with so the programs will be sure to run 1983properly even if perl is not in /usr/bin/perl. 1984 1985=item FIRST_MAKEFILE 1986 1987The name of the Makefile to be produced. This is used for the second 1988Makefile that will be produced for the MAP_TARGET. 1989 1990Defaults to 'Makefile' or 'Descrip.MMS' on VMS. 1991 1992(Note: we couldn't use MAKEFILE because dmake uses this for something 1993else). 1994 1995=item FULLPERL 1996 1997Perl binary able to run this extension, load XS modules, etc... 1998 1999=item FULLPERLRUN 2000 2001Like PERLRUN, except it uses FULLPERL. 2002 2003=item FULLPERLRUNINST 2004 2005Like PERLRUNINST, except it uses FULLPERL. 2006 2007=item FUNCLIST 2008 2009This provides an alternate means to specify function names to be 2010exported from the extension. Its value is a reference to an 2011array of function names to be exported by the extension. These 2012names are passed through unaltered to the linker options file. 2013 2014=item H 2015 2016Ref to array of *.h file names. Similar to C. 2017 2018=item IMPORTS 2019 2020This attribute is used to specify names to be imported into the 2021extension. Takes a hash ref. 2022 2023It is only used on OS/2 and Win32. 2024 2025=item INC 2026 2027Include file dirs eg: C<"-I/usr/5include -I/path/to/inc"> 2028 2029=item INCLUDE_EXT 2030 2031Array of extension names to be included when doing a static build. 2032MakeMaker will normally build with all of the installed extensions when 2033doing a static build, and that is usually the desired behavior. If 2034INCLUDE_EXT is present then MakeMaker will build only with those extensions 2035which are explicitly mentioned. (e.g. [ qw( Socket POSIX ) ]) 2036 2037It is not necessary to mention DynaLoader or the current extension when 2038filling in INCLUDE_EXT. If the INCLUDE_EXT is mentioned but is empty then 2039only DynaLoader and the current extension will be included in the build. 2040 2041This attribute may be most useful when specified as a string on the 2042command line: perl Makefile.PL INCLUDE_EXT='POSIX Socket Devel::Peek' 2043 2044=item INSTALLARCHLIB 2045 2046Used by 'make install', which copies files from INST_ARCHLIB to this 2047directory if INSTALLDIRS is set to perl. 2048 2049=item INSTALLBIN 2050 2051Directory to install binary files (e.g. tkperl) into if 2052INSTALLDIRS=perl. 2053 2054=item INSTALLDIRS 2055 2056Determines which of the sets of installation directories to choose: 2057perl, site or vendor. Defaults to site. 2058 2059=item INSTALLMAN1DIR 2060 2061=item INSTALLMAN3DIR 2062 2063These directories get the man pages at 'make install' time if 2064INSTALLDIRS=perl. Defaults to $Config{installman*dir}. 2065 2066If set to 'none', no man pages will be installed. 2067 2068=item INSTALLPRIVLIB 2069 2070Used by 'make install', which copies files from INST_LIB to this 2071directory if INSTALLDIRS is set to perl. 2072 2073Defaults to $Config{installprivlib}. 2074 2075=item INSTALLSCRIPT 2076 2077Available in version 6.30_02 and above. 2078 2079Used by 'make install' which copies files from INST_SCRIPT to this 2080directory if INSTALLDIRS=perl. 2081 2082=item INSTALLSITEARCH 2083 2084Used by 'make install', which copies files from INST_ARCHLIB to this 2085directory if INSTALLDIRS is set to site (default). 2086 2087=item INSTALLSITEBIN 2088 2089Used by 'make install', which copies files from INST_BIN to this 2090directory if INSTALLDIRS is set to site (default). 2091 2092=item INSTALLSITELIB 2093 2094Used by 'make install', which copies files from INST_LIB to this 2095directory if INSTALLDIRS is set to site (default). 2096 2097=item INSTALLSITEMAN1DIR 2098 2099=item INSTALLSITEMAN3DIR 2100 2101These directories get the man pages at 'make install' time if 2102INSTALLDIRS=site (default). Defaults to 2103$(SITEPREFIX)/man/man$(MAN*EXT). 2104 2105If set to 'none', no man pages will be installed. 2106 2107=item INSTALLSITESCRIPT 2108 2109Used by 'make install' which copies files from INST_SCRIPT to this 2110directory if INSTALLDIRS is set to site (default). 2111 2112=item INSTALLVENDORARCH 2113 2114Used by 'make install', which copies files from INST_ARCHLIB to this 2115directory if INSTALLDIRS is set to vendor. Note that if you do not set 2116this, the value of INSTALLVENDORLIB will be used, which is probably not 2117what you want. 2118 2119=item INSTALLVENDORBIN 2120 2121Used by 'make install', which copies files from INST_BIN to this 2122directory if INSTALLDIRS is set to vendor. 2123 2124=item INSTALLVENDORLIB 2125 2126Used by 'make install', which copies files from INST_LIB to this 2127directory if INSTALLDIRS is set to vendor. 2128 2129=item INSTALLVENDORMAN1DIR 2130 2131=item INSTALLVENDORMAN3DIR 2132 2133These directories get the man pages at 'make install' time if 2134INSTALLDIRS=vendor. Defaults to $(VENDORPREFIX)/man/man$(MAN*EXT). 2135 2136If set to 'none', no man pages will be installed. 2137 2138=item INSTALLVENDORSCRIPT 2139 2140Available in version 6.30_02 and above. 2141 2142Used by 'make install' which copies files from INST_SCRIPT to this 2143directory if INSTALLDIRS is set to vendor. 2144 2145=item INST_ARCHLIB 2146 2147Same as INST_LIB for architecture dependent files. 2148 2149=item INST_BIN 2150 2151Directory to put real binary files during 'make'. These will be copied 2152to INSTALLBIN during 'make install' 2153 2154=item INST_LIB 2155 2156Directory where we put library files of this extension while building 2157it. 2158 2159=item INST_MAN1DIR 2160 2161Directory to hold the man pages at 'make' time 2162 2163=item INST_MAN3DIR 2164 2165Directory to hold the man pages at 'make' time 2166 2167=item INST_SCRIPT 2168 2169Directory where executable files should be installed during 2170'make'. Defaults to "./blib/script", just to have a dummy location during 2171testing. make install will copy the files in INST_SCRIPT to 2172INSTALLSCRIPT. 2173 2174=item LD 2175 2176Program to be used to link libraries for dynamic loading. 2177 2178Defaults to $Config{ld}. 2179 2180=item LDDLFLAGS 2181 2182Any special flags that might need to be passed to ld to create a 2183shared library suitable for dynamic loading. It is up to the makefile 2184to use it. (See L<Config/lddlflags>) 2185 2186Defaults to $Config{lddlflags}. 2187 2188=item LDFROM 2189 2190Defaults to "$(OBJECT)" and is used in the ld command to specify 2191what files to link/load from (also see dynamic_lib below for how to 2192specify ld flags) 2193 2194=item LIB 2195 2196LIB should only be set at C<perl Makefile.PL> time but is allowed as a 2197MakeMaker argument. It has the effect of setting both INSTALLPRIVLIB 2198and INSTALLSITELIB to that value regardless any explicit setting of 2199those arguments (or of PREFIX). INSTALLARCHLIB and INSTALLSITEARCH 2200are set to the corresponding architecture subdirectory. 2201 2202=item LIBPERL_A 2203 2204The filename of the perllibrary that will be used together with this 2205extension. Defaults to libperl.a. 2206 2207=item LIBS 2208 2209An anonymous array of alternative library 2210specifications to be searched for (in order) until 2211at least one library is found. E.g. 2212 2213 'LIBS' => ["-lgdbm", "-ldbm -lfoo", "-L/path -ldbm.nfs"] 2214 2215Mind, that any element of the array 2216contains a complete set of arguments for the ld 2217command. So do not specify 2218 2219 'LIBS' => ["-ltcl", "-ltk", "-lX11"] 2220 2221See ODBM_File/Makefile.PL for an example, where an array is needed. If 2222you specify a scalar as in 2223 2224 'LIBS' => "-ltcl -ltk -lX11" 2225 2226MakeMaker will turn it into an array with one element. 2227 2228=item LICENSE 2229 2230Available in version 6.31 and above. 2231 2232The licensing terms of your distribution. Generally it's "perl_5" for the 2233same license as Perl itself. 2234 2235See L<CPAN::Meta::Spec> for the list of options. 2236 2237Defaults to "unknown". 2238 2239=item LINKTYPE 2240 2241'static' or 'dynamic' (default unless usedl=undef in 2242config.sh). Should only be used to force static linking (also see 2243linkext below). 2244 2245=item MAGICXS 2246 2247Available in version 6.8305 and above. 2248 2249When this is set to C<1>, C<OBJECT> will be automagically derived from 2250C<O_FILES>. 2251 2252=item MAKE 2253 2254Available in version 6.30_01 and above. 2255 2256Variant of make you intend to run the generated Makefile with. This 2257parameter lets Makefile.PL know what make quirks to account for when 2258generating the Makefile. 2259 2260MakeMaker also honors the MAKE environment variable. This parameter 2261takes precedence. 2262 2263Currently the only significant values are 'dmake' and 'nmake' for Windows 2264users, instructing MakeMaker to generate a Makefile in the flavour of 2265DMake ("Dennis Vadura's Make") or Microsoft NMake respectively. 2266 2267Defaults to $Config{make}, which may go looking for a Make program 2268in your environment. 2269 2270How are you supposed to know what flavour of Make a Makefile has 2271been generated for if you didn't specify a value explicitly? Search 2272the generated Makefile for the definition of the MAKE variable, 2273which is used to recursively invoke the Make utility. That will tell 2274you what Make you're supposed to invoke the Makefile with. 2275 2276=item MAKEAPERL 2277 2278Boolean which tells MakeMaker that it should include the rules to 2279make a perl. This is handled automatically as a switch by 2280MakeMaker. The user normally does not need it. 2281 2282=item MAKEFILE_OLD 2283 2284When 'make clean' or similar is run, the $(FIRST_MAKEFILE) will be 2285backed up at this location. 2286 2287Defaults to $(FIRST_MAKEFILE).old or $(FIRST_MAKEFILE)_old on VMS. 2288 2289=item MAN1PODS 2290 2291Hashref of pod-containing files. MakeMaker will default this to all 2292EXE_FILES files that include POD directives. The files listed 2293here will be converted to man pages and installed as was requested 2294at Configure time. 2295 2296This hash should map POD files (or scripts containing POD) to the 2297man file names under the C<blib/man1/> directory, as in the following 2298example: 2299 2300 MAN1PODS => { 2301 'doc/command.pod' => 'blib/man1/command.1', 2302 'scripts/script.pl' => 'blib/man1/script.1', 2303 } 2304 2305=item MAN3PODS 2306 2307Hashref that assigns to *.pm and *.pod files the files into which the 2308manpages are to be written. MakeMaker parses all *.pod and *.pm files 2309for POD directives. Files that contain POD will be the default keys of 2310the MAN3PODS hashref. These will then be converted to man pages during 2311C<make> and will be installed during C<make install>. 2312 2313Example similar to MAN1PODS. 2314 2315=item MAP_TARGET 2316 2317If it is intended that a new perl binary be produced, this variable 2318may hold a name for that binary. Defaults to perl 2319 2320=item META_ADD 2321 2322=item META_MERGE 2323 2324Available in version 6.46 and above. 2325 2326A hashref of items to add to the CPAN Meta file (F<META.yml> or 2327F<META.json>). 2328 2329They differ in how they behave if they have the same key as the 2330default metadata. META_ADD will override the default value with its 2331own. META_MERGE will merge its value with the default. 2332 2333Unless you want to override the defaults, prefer META_MERGE so as to 2334get the advantage of any future defaults. 2335 2336Where prereqs are concerned, if META_MERGE is used, prerequisites are merged 2337with their counterpart C<WriteMakefile()> argument 2338(PREREQ_PM is merged into {prereqs}{runtime}{requires}, 2339BUILD_REQUIRES into C<{prereqs}{build}{requires}>, 2340CONFIGURE_REQUIRES into C<{prereqs}{configure}{requires}>, 2341and TEST_REQUIRES into C<{prereqs}{test}{requires})>. 2342When prereqs are specified with META_ADD, the only prerequisites added to the 2343file come from the metadata, not C<WriteMakefile()> arguments. 2344 2345Note that these configuration options are only used for generating F<META.yml> 2346and F<META.json> -- they are NOT used for F<MYMETA.yml> and F<MYMETA.json>. 2347Therefore data in these fields should NOT be used for dynamic (user-side) 2348configuration. 2349 2350By default CPAN Meta specification C<1.4> is used. In order to use 2351CPAN Meta specification C<2.0>, indicate with C<meta-spec> the version 2352you want to use. 2353 2354 META_MERGE => { 2355 2356 "meta-spec" => { version => 2 }, 2357 2358 resources => { 2359 2360 repository => { 2361 type => 'git', 2362 url => 'git://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker.git', 2363 web => 'https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker', 2364 }, 2365 2366 }, 2367 2368 }, 2369 2370=item MIN_PERL_VERSION 2371 2372Available in version 6.48 and above. 2373 2374The minimum required version of Perl for this distribution. 2375 2376Either the 5.006001 or the 5.6.1 format is acceptable. 2377 2378=item MYEXTLIB 2379 2380If the extension links to a library that it builds, set this to the 2381name of the library (see SDBM_File) 2382 2383=item NAME 2384 2385The package representing the distribution. For example, C<Test::More> 2386or C<ExtUtils::MakeMaker>. It will be used to derive information about 2387the distribution such as the L</DISTNAME>, installation locations 2388within the Perl library and where XS files will be looked for by 2389default (see L</XS>). 2390 2391C<NAME> I<must> be a valid Perl package name and it I<must> have an 2392associated C<.pm> file. For example, C<Foo::Bar> is a valid C<NAME> 2393and there must exist F<Foo/Bar.pm>. Any XS code should be in 2394F<Bar.xs> unless stated otherwise. 2395 2396Your distribution B<must> have a C<NAME>. 2397 2398=item NEEDS_LINKING 2399 2400MakeMaker will figure out if an extension contains linkable code 2401anywhere down the directory tree, and will set this variable 2402accordingly, but you can speed it up a very little bit if you define 2403this boolean variable yourself. 2404 2405=item NOECHO 2406 2407Command so make does not print the literal commands it's running. 2408 2409By setting it to an empty string you can generate a Makefile that 2410prints all commands. Mainly used in debugging MakeMaker itself. 2411 2412Defaults to C<@>. 2413 2414=item NORECURS 2415 2416Boolean. Attribute to inhibit descending into subdirectories. 2417 2418=item NO_META 2419 2420When true, suppresses the generation and addition to the MANIFEST of 2421the META.yml and META.json module meta-data files during 'make distdir'. 2422 2423Defaults to false. 2424 2425=item NO_MYMETA 2426 2427Available in version 6.57_02 and above. 2428 2429When true, suppresses the generation of MYMETA.yml and MYMETA.json module 2430meta-data files during 'perl Makefile.PL'. 2431 2432Defaults to false. 2433 2434=item NO_PACKLIST 2435 2436Available in version 6.7501 and above. 2437 2438When true, suppresses the writing of C<packlist> files for installs. 2439 2440Defaults to false. 2441 2442=item NO_PERLLOCAL 2443 2444Available in version 6.7501 and above. 2445 2446When true, suppresses the appending of installations to C<perllocal>. 2447 2448Defaults to false. 2449 2450=item NO_VC 2451 2452In general, any generated Makefile checks for the current version of 2453MakeMaker and the version the Makefile was built under. If NO_VC is 2454set, the version check is neglected. Do not write this into your 2455Makefile.PL, use it interactively instead. 2456 2457=item OBJECT 2458 2459List of object files, defaults to '$(BASEEXT)$(OBJ_EXT)', but can be a long 2460string or an array containing all object files, e.g. "tkpBind.o 2461tkpButton.o tkpCanvas.o" or ["tkpBind.o", "tkpButton.o", "tkpCanvas.o"] 2462 2463(Where BASEEXT is the last component of NAME, and OBJ_EXT is $Config{obj_ext}.) 2464 2465=item OPTIMIZE 2466 2467Defaults to C<-O>. Set it to C<-g> to turn debugging on. The flag is 2468passed to subdirectory makes. 2469 2470=item PERL 2471 2472Perl binary for tasks that can be done by miniperl. If it contains 2473spaces or other shell metacharacters, it needs to be quoted in a way 2474that protects them, since this value is intended to be inserted in a 2475shell command line in the Makefile. E.g.: 2476 2477 # Perl executable lives in "C:/Program Files/Perl/bin" 2478 # Normally you don't need to set this yourself! 2479 $ perl Makefile.PL PERL='"C:/Program Files/Perl/bin/perl.exe" -w' 2480 2481=item PERL_CORE 2482 2483Set only when MakeMaker is building the extensions of the Perl core 2484distribution. 2485 2486=item PERLMAINCC 2487 2488The call to the program that is able to compile perlmain.c. Defaults 2489to $(CC). 2490 2491=item PERL_ARCHLIB 2492 2493Same as for PERL_LIB, but for architecture dependent files. 2494 2495Used only when MakeMaker is building the extensions of the Perl core 2496distribution (because normally $(PERL_ARCHLIB) is automatically in @INC, 2497and adding it would get in the way of PERL5LIB). 2498 2499=item PERL_LIB 2500 2501Directory containing the Perl library to use. 2502 2503Used only when MakeMaker is building the extensions of the Perl core 2504distribution (because normally $(PERL_LIB) is automatically in @INC, 2505and adding it would get in the way of PERL5LIB). 2506 2507=item PERL_MALLOC_OK 2508 2509defaults to 0. Should be set to TRUE if the extension can work with 2510the memory allocation routines substituted by the Perl malloc() subsystem. 2511This should be applicable to most extensions with exceptions of those 2512 2513=over 4 2514 2515=item * 2516 2517with bugs in memory allocations which are caught by Perl's malloc(); 2518 2519=item * 2520 2521which interact with the memory allocator in other ways than via 2522malloc(), realloc(), free(), calloc(), sbrk() and brk(); 2523 2524=item * 2525 2526which rely on special alignment which is not provided by Perl's malloc(). 2527 2528=back 2529 2530B<NOTE.> Neglecting to set this flag in I<any one> of the loaded extension 2531nullifies many advantages of Perl's malloc(), such as better usage of 2532system resources, error detection, memory usage reporting, catchable failure 2533of memory allocations, etc. 2534 2535=item PERLPREFIX 2536 2537Directory under which core modules are to be installed. 2538 2539Defaults to $Config{installprefixexp}, falling back to 2540$Config{installprefix}, $Config{prefixexp} or $Config{prefix} should 2541$Config{installprefixexp} not exist. 2542 2543Overridden by PREFIX. 2544 2545=item PERLRUN 2546 2547Use this instead of $(PERL) when you wish to run perl. It will set up 2548extra necessary flags for you. 2549 2550=item PERLRUNINST 2551 2552Use this instead of $(PERL) when you wish to run perl to work with 2553modules. It will add things like -I$(INST_ARCH) and other necessary 2554flags so perl can see the modules you're about to install. 2555 2556=item PERL_SRC 2557 2558Directory containing the Perl source code (use of this should be 2559avoided, it may be undefined) 2560 2561=item PERM_DIR 2562 2563Available in version 6.51_01 and above. 2564 2565Desired permission for directories. Defaults to C<755>. 2566 2567=item PERM_RW 2568 2569Desired permission for read/writable files. Defaults to C<644>. 2570 2571=item PERM_RWX 2572 2573Desired permission for executable files. Defaults to C<755>. 2574 2575=item PL_FILES 2576 2577MakeMaker can run programs to generate files for you at build time. 2578By default any file named *.PL (except Makefile.PL and Build.PL) in 2579the top level directory will be assumed to be a Perl program and run 2580passing its own basename in as an argument. This basename is actually a build 2581target, and there is an intention, but not a requirement, that the *.PL file 2582make the file passed to to as an argument. For example... 2583 2584 perl foo.PL foo 2585 2586This behavior can be overridden by supplying your own set of files to 2587search. PL_FILES accepts a hash ref, the key being the file to run 2588and the value is passed in as the first argument when the PL file is run. 2589 2590 PL_FILES => {'bin/foobar.PL' => 'bin/foobar'} 2591 2592 PL_FILES => {'foo.PL' => 'foo.c'} 2593 2594Would run bin/foobar.PL like this: 2595 2596 perl bin/foobar.PL bin/foobar 2597 2598If multiple files from one program are desired an array ref can be used. 2599 2600 PL_FILES => {'bin/foobar.PL' => [qw(bin/foobar1 bin/foobar2)]} 2601 2602In this case the program will be run multiple times using each target file. 2603 2604 perl bin/foobar.PL bin/foobar1 2605 perl bin/foobar.PL bin/foobar2 2606 2607If an output file depends on extra input files beside the script itself, 2608a hash ref can be used in version 7.36 and above: 2609 2610 PL_FILES => { 'foo.PL' => { 2611 'foo.out' => 'foo.in', 2612 'bar.out' => [qw(bar1.in bar2.in)], 2613 } 2614 2615In this case the extra input files will be passed to the program after 2616the target file: 2617 2618 perl foo.PL foo.out foo.in 2619 perl foo.PL bar.out bar1.in bar2.in 2620 2621PL files are normally run B<after> pm_to_blib and include INST_LIB and 2622INST_ARCH in their C<@INC>, so the just built modules can be 2623accessed... unless the PL file is making a module (or anything else in 2624PM) in which case it is run B<before> pm_to_blib and does not include 2625INST_LIB and INST_ARCH in its C<@INC>. This apparently odd behavior 2626is there for backwards compatibility (and it's somewhat DWIM). The argument 2627passed to the .PL is set up as a target to build in the Makefile. In other 2628sections such as C<postamble> you can specify a dependency on the 2629filename/argument that the .PL is supposed (or will have, now that that is 2630is a dependency) to generate. Note the file to be generated will still be 2631generated and the .PL will still run even without an explicit dependency created 2632by you, since the C<all> target still depends on running all eligible to run.PL 2633files. 2634 2635=item PM 2636 2637Hashref of .pm files and *.pl files to be installed. e.g. 2638 2639 {'name_of_file.pm' => '$(INST_LIB)/install_as.pm'} 2640 2641By default this will include *.pm and *.pl and the files found in 2642the PMLIBDIRS directories. Defining PM in the 2643Makefile.PL will override PMLIBDIRS. 2644 2645=item PMLIBDIRS 2646 2647Ref to array of subdirectories containing library files. Defaults to 2648[ 'lib', $(BASEEXT) ]. The directories will be scanned and I<any> files 2649they contain will be installed in the corresponding location in the 2650library. A libscan() method can be used to alter the behaviour. 2651Defining PM in the Makefile.PL will override PMLIBDIRS. 2652 2653(Where BASEEXT is the last component of NAME.) 2654 2655=item PM_FILTER 2656 2657A filter program, in the traditional Unix sense (input from stdin, output 2658to stdout) that is passed on each .pm file during the build (in the 2659pm_to_blib() phase). It is empty by default, meaning no filtering is done. 2660You could use: 2661 2662 PM_FILTER => 'perl -ne "print unless /^\\#/"', 2663 2664to remove all the leading comments on the fly during the build. In order 2665to be as portable as possible, please consider using a Perl one-liner 2666rather than Unix (or other) utilities, as above. The # is escaped for 2667the Makefile, since what is going to be generated will then be: 2668 2669 PM_FILTER = perl -ne "print unless /^\#/" 2670 2671Without the \ before the #, we'd have the start of a Makefile comment, 2672and the macro would be incorrectly defined. 2673 2674You will almost certainly be better off using the C<PL_FILES> system, 2675instead. See above, or the L<ExtUtils::MakeMaker::FAQ> entry. 2676 2677=item POLLUTE 2678 2679Prior to 5.6 various interpreter variables were available without a C<PL_> 2680prefix, eg. C<PL_undef> was available as C<undef>. As of release 5.6, these 2681are only defined if the POLLUTE flag is enabled: 2682 2683 perl Makefile.PL POLLUTE=1 2684 2685Please inform the module author if this is necessary to successfully install 2686a module under 5.6 or later. 2687 2688=item PPM_INSTALL_EXEC 2689 2690Name of the executable used to run C<PPM_INSTALL_SCRIPT> below. (e.g. perl) 2691 2692=item PPM_INSTALL_SCRIPT 2693 2694Name of the script that gets executed by the Perl Package Manager after 2695the installation of a package. 2696 2697=item PPM_UNINSTALL_EXEC 2698 2699Available in version 6.8502 and above. 2700 2701Name of the executable used to run C<PPM_UNINSTALL_SCRIPT> below. (e.g. perl) 2702 2703=item PPM_UNINSTALL_SCRIPT 2704 2705Available in version 6.8502 and above. 2706 2707Name of the script that gets executed by the Perl Package Manager before 2708the removal of a package. 2709 2710=item PREFIX 2711 2712This overrides all the default install locations. Man pages, 2713libraries, scripts, etc... MakeMaker will try to make an educated 2714guess about where to place things under the new PREFIX based on your 2715Config defaults. Failing that, it will fall back to a structure 2716which should be sensible for your platform. 2717 2718If you specify LIB or any INSTALL* variables they will not be affected 2719by the PREFIX. 2720 2721=item PREREQ_FATAL 2722 2723Bool. If this parameter is true, failing to have the required modules 2724(or the right versions thereof) will be fatal. C<perl Makefile.PL> 2725will C<die> instead of simply informing the user of the missing dependencies. 2726 2727It is I<extremely> rare to have to use C<PREREQ_FATAL>. Its use by module 2728authors is I<strongly discouraged> and should never be used lightly. 2729 2730For dependencies that are required in order to run C<Makefile.PL>, 2731see C<CONFIGURE_REQUIRES>. 2732 2733Module installation tools have ways of resolving unmet dependencies but 2734to do that they need a F<Makefile>. Using C<PREREQ_FATAL> breaks this. 2735That's bad. 2736 2737Assuming you have good test coverage, your tests should fail with 2738missing dependencies informing the user more strongly that something 2739is wrong. You can write a F<t/00compile.t> test which will simply 2740check that your code compiles and stop "make test" prematurely if it 2741doesn't. See L<Test::More/BAIL_OUT> for more details. 2742 2743 2744=item PREREQ_PM 2745 2746A hash of modules that are needed to run your module. The keys are 2747the module names ie. Test::More, and the minimum version is the 2748value. If the required version number is 0 any version will do. 2749The versions given may be a Perl v-string (see L<version>) or a range 2750(see L<CPAN::Meta::Requirements>). 2751 2752This will go into the C<requires> field of your F<META.yml> and the 2753C<runtime> of the C<prereqs> field of your F<META.json>. 2754 2755 PREREQ_PM => { 2756 # Require Test::More at least 0.47 2757 "Test::More" => "0.47", 2758 2759 # Require any version of Acme::Buffy 2760 "Acme::Buffy" => 0, 2761 } 2762 2763=item PREREQ_PRINT 2764 2765Bool. If this parameter is true, the prerequisites will be printed to 2766stdout and MakeMaker will exit. The output format is an evalable hash 2767ref. 2768 2769 $PREREQ_PM = { 2770 'A::B' => Vers1, 2771 'C::D' => Vers2, 2772 ... 2773 }; 2774 2775If a distribution defines a minimal required perl version, this is 2776added to the output as an additional line of the form: 2777 2778 $MIN_PERL_VERSION = '5.008001'; 2779 2780If BUILD_REQUIRES is not empty, it will be dumped as $BUILD_REQUIRES hashref. 2781 2782=item PRINT_PREREQ 2783 2784RedHatism for C<PREREQ_PRINT>. The output format is different, though: 2785 2786 perl(A::B)>=Vers1 perl(C::D)>=Vers2 ... 2787 2788A minimal required perl version, if present, will look like this: 2789 2790 perl(perl)>=5.008001 2791 2792=item SITEPREFIX 2793 2794Like PERLPREFIX, but only for the site install locations. 2795 2796Defaults to $Config{siteprefixexp}. Perls prior to 5.6.0 didn't have 2797an explicit siteprefix in the Config. In those cases 2798$Config{installprefix} will be used. 2799 2800Overridable by PREFIX 2801 2802=item SIGN 2803 2804Available in version 6.18 and above. 2805 2806When true, perform the generation and addition to the MANIFEST of the 2807SIGNATURE file in the distdir during 'make distdir', via 'cpansign 2808-s'. 2809 2810Note that you need to install the Module::Signature module to 2811perform this operation. 2812 2813Defaults to false. 2814 2815=item SKIP 2816 2817Arrayref. E.g. [qw(name1 name2)] skip (do not write) sections of the 2818Makefile. Caution! Do not use the SKIP attribute for the negligible 2819speedup. It may seriously damage the resulting Makefile. Only use it 2820if you really need it. 2821 2822=item TEST_REQUIRES 2823 2824Available in version 6.64 and above. 2825 2826A hash of modules that are needed to test your module but not run or 2827build it. 2828 2829This will go into the C<build_requires> field of your F<META.yml> and the C<test> of the C<prereqs> field of your F<META.json>. 2830 2831The format is the same as PREREQ_PM. 2832 2833=item TYPEMAPS 2834 2835Ref to array of typemap file names. Use this when the typemaps are 2836in some directory other than the current directory or when they are 2837not named B<typemap>. The last typemap in the list takes 2838precedence. A typemap in the current directory has highest 2839precedence, even if it isn't listed in TYPEMAPS. The default system 2840typemap has lowest precedence. 2841 2842=item VENDORPREFIX 2843 2844Like PERLPREFIX, but only for the vendor install locations. 2845 2846Defaults to $Config{vendorprefixexp}. 2847 2848Overridable by PREFIX 2849 2850=item VERBINST 2851 2852If true, make install will be verbose 2853 2854=item VERSION 2855 2856Your version number for distributing the package. This defaults to 28570.1. 2858 2859=item VERSION_FROM 2860 2861Instead of specifying the VERSION in the Makefile.PL you can let 2862MakeMaker parse a file to determine the version number. The parsing 2863routine requires that the file named by VERSION_FROM contains one 2864single line to compute the version number. The first line in the file 2865that contains something like a $VERSION assignment or C<package Name 2866VERSION> will be used. The following lines will be parsed o.k.: 2867 2868 # Good 2869 package Foo::Bar 1.23; # 1.23 2870 $VERSION = '1.00'; # 1.00 2871 *VERSION = \'1.01'; # 1.01 2872 ($VERSION) = q$Revision$ =~ /(\d+)/g; # The digits in $Revision$ 2873 $FOO::VERSION = '1.10'; # 1.10 2874 *FOO::VERSION = \'1.11'; # 1.11 2875 2876but these will fail: 2877 2878 # Bad 2879 my $VERSION = '1.01'; 2880 local $VERSION = '1.02'; 2881 local $FOO::VERSION = '1.30'; 2882 2883(Putting C<my> or C<local> on the preceding line will work o.k.) 2884 2885"Version strings" are incompatible and should not be used. 2886 2887 # Bad 2888 $VERSION = 1.2.3; 2889 $VERSION = v1.2.3; 2890 2891L<version> objects are fine. As of MakeMaker 6.35 version.pm will be 2892automatically loaded, but you must declare the dependency on version.pm. 2893For compatibility with older MakeMaker you should load on the same line 2894as $VERSION is declared. 2895 2896 # All on one line 2897 use version; our $VERSION = qv(1.2.3); 2898 2899The file named in VERSION_FROM is not added as a dependency to 2900Makefile. This is not really correct, but it would be a major pain 2901during development to have to rewrite the Makefile for any smallish 2902change in that file. If you want to make sure that the Makefile 2903contains the correct VERSION macro after any change of the file, you 2904would have to do something like 2905 2906 depend => { Makefile => '$(VERSION_FROM)' } 2907 2908See attribute C<depend> below. 2909 2910=item VERSION_SYM 2911 2912A sanitized VERSION with . replaced by _. For places where . has 2913special meaning (some filesystems, RCS labels, etc...) 2914 2915=item XS 2916 2917Hashref of .xs files. MakeMaker will default this. e.g. 2918 2919 {'name_of_file.xs' => 'name_of_file.c'} 2920 2921The .c files will automatically be included in the list of files 2922deleted by a make clean. 2923 2924=item XSBUILD 2925 2926Available in version 7.12 and above. 2927 2928Hashref with options controlling the operation of C<XSMULTI>: 2929 2930 { 2931 xs => { 2932 all => { 2933 # options applying to all .xs files for this distribution 2934 }, 2935 'lib/Class/Name/File' => { # specifically for this file 2936 DEFINE => '-Dfunktastic', # defines for only this file 2937 INC => "-I$funkyliblocation", # include flags for only this file 2938 # OBJECT => 'lib/Class/Name/File$(OBJ_EXT)', # default 2939 LDFROM => "lib/Class/Name/File\$(OBJ_EXT) $otherfile\$(OBJ_EXT)", # what's linked 2940 }, 2941 }, 2942 } 2943 2944Note C<xs> is the file-extension. More possibilities may arise in the 2945future. Note that object names are specified without their XS extension. 2946 2947C<LDFROM> defaults to the same as C<OBJECT>. C<OBJECT> defaults to, 2948for C<XSMULTI>, just the XS filename with the extension replaced with 2949the compiler-specific object-file extension. 2950 2951The distinction between C<OBJECT> and C<LDFROM>: C<OBJECT> is the make 2952target, so make will try to build it. However, C<LDFROM> is what will 2953actually be linked together to make the shared object or static library 2954(SO/SL), so if you override it, make sure it includes what you want to 2955make the final SO/SL, almost certainly including the XS basename with 2956C<$(OBJ_EXT)> appended. 2957 2958=item XSMULTI 2959 2960Available in version 7.12 and above. 2961 2962When this is set to C<1>, multiple XS files may be placed under F<lib/> 2963next to their corresponding C<*.pm> files (this is essential for compiling 2964with the correct C<VERSION> values). This feature should be considered 2965experimental, and details of it may change. 2966 2967This feature was inspired by, and small portions of code copied from, 2968L<ExtUtils::MakeMaker::BigHelper>. Hopefully this feature will render 2969that module mainly obsolete. 2970 2971=item XSOPT 2972 2973String of options to pass to xsubpp. This might include C<-C++> or 2974C<-extern>. Do not include typemaps here; the TYPEMAP parameter exists for 2975that purpose. 2976 2977=item XSPROTOARG 2978 2979May be set to C<-prototypes>, C<-noprototypes> or the empty string. The 2980empty string is equivalent to the xsubpp default, or C<-noprototypes>. 2981See the xsubpp documentation for details. MakeMaker 2982defaults to the empty string. 2983 2984=item XS_VERSION 2985 2986Your version number for the .xs file of this package. This defaults 2987to the value of the VERSION attribute. 2988 2989=back 2990 2991=head2 Additional lowercase attributes 2992 2993can be used to pass parameters to the methods which implement that 2994part of the Makefile. Parameters are specified as a hash ref but are 2995passed to the method as a hash. 2996 2997=over 2 2998 2999=item clean 3000 3001 {FILES => "*.xyz foo"} 3002 3003=item depend 3004 3005 {ANY_TARGET => ANY_DEPENDENCY, ...} 3006 3007(ANY_TARGET must not be given a double-colon rule by MakeMaker.) 3008 3009=item dist 3010 3011 {TARFLAGS => 'cvfF', COMPRESS => 'gzip', SUFFIX => '.gz', 3012 SHAR => 'shar -m', DIST_CP => 'ln', ZIP => '/bin/zip', 3013 ZIPFLAGS => '-rl', DIST_DEFAULT => 'private tardist' } 3014 3015If you specify COMPRESS, then SUFFIX should also be altered, as it is 3016needed to tell make the target file of the compression. Setting 3017DIST_CP to ln can be useful, if you need to preserve the timestamps on 3018your files. DIST_CP can take the values 'cp', which copies the file, 3019'ln', which links the file, and 'best' which copies symbolic links and 3020links the rest. Default is 'best'. 3021 3022=item dynamic_lib 3023 3024 {ARMAYBE => 'ar', OTHERLDFLAGS => '...', INST_DYNAMIC_DEP => '...'} 3025 3026=item linkext 3027 3028 {LINKTYPE => 'static', 'dynamic' or ''} 3029 3030NB: Extensions that have nothing but *.pm files had to say 3031 3032 {LINKTYPE => ''} 3033 3034with Pre-5.0 MakeMakers. Since version 5.00 of MakeMaker such a line 3035can be deleted safely. MakeMaker recognizes when there's nothing to 3036be linked. 3037 3038=item macro 3039 3040 {ANY_MACRO => ANY_VALUE, ...} 3041 3042=item postamble 3043 3044Anything put here will be passed to 3045L<MY::postamble()|ExtUtils::MM_Any/postamble (o)> if you have one. 3046 3047=item realclean 3048 3049 {FILES => '$(INST_ARCHAUTODIR)/*.xyz'} 3050 3051=item test 3052 3053Specify the targets for testing. 3054 3055 {TESTS => 't/*.t'} 3056 3057C<RECURSIVE_TEST_FILES> can be used to include all directories 3058recursively under C<t> that contain C<.t> files. It will be ignored if 3059you provide your own C<TESTS> attribute, defaults to false. 3060 3061 {RECURSIVE_TEST_FILES=>1} 3062 3063This is supported since 6.76 3064 3065=item tool_autosplit 3066 3067 {MAXLEN => 8} 3068 3069=back 3070 3071=head2 Overriding MakeMaker Methods 3072 3073If you cannot achieve the desired Makefile behaviour by specifying 3074attributes you may define private subroutines in the Makefile.PL. 3075Each subroutine returns the text it wishes to have written to 3076the Makefile. To override a section of the Makefile you can 3077either say: 3078 3079 sub MY::c_o { "new literal text" } 3080 3081or you can edit the default by saying something like: 3082 3083 package MY; # so that "SUPER" works right 3084 sub c_o { 3085 my $inherited = shift->SUPER::c_o(@_); 3086 $inherited =~ s/old text/new text/; 3087 $inherited; 3088 } 3089 3090If you are running experiments with embedding perl as a library into 3091other applications, you might find MakeMaker is not sufficient. You'd 3092better have a look at L<ExtUtils::Embed> which is a collection of utilities 3093for embedding. 3094 3095If you still need a different solution, try to develop another 3096subroutine that fits your needs and submit the diffs to 3097C<makemaker@perl.org> 3098 3099For a complete description of all MakeMaker methods see 3100L<ExtUtils::MM_Unix>. 3101 3102Here is a simple example of how to add a new target to the generated 3103Makefile: 3104 3105 sub MY::postamble { 3106 return <<'MAKE_FRAG'; 3107 $(MYEXTLIB): sdbm/Makefile 3108 cd sdbm && $(MAKE) all 3109 3110 MAKE_FRAG 3111 } 3112 3113=head2 The End Of Cargo Cult Programming 3114 3115WriteMakefile() now does some basic sanity checks on its parameters to 3116protect against typos and malformatted values. This means some things 3117which happened to work in the past will now throw warnings and 3118possibly produce internal errors. 3119 3120Some of the most common mistakes: 3121 3122=over 2 3123 3124=item C<< MAN3PODS => ' ' >> 3125 3126This is commonly used to suppress the creation of man pages. MAN3PODS 3127takes a hash ref not a string, but the above worked by accident in old 3128versions of MakeMaker. 3129 3130The correct code is C<< MAN3PODS => { } >>. 3131 3132=back 3133 3134 3135=head2 Hintsfile support 3136 3137MakeMaker.pm uses the architecture-specific information from 3138Config.pm. In addition it evaluates architecture specific hints files 3139in a C<hints/> directory. The hints files are expected to be named 3140like their counterparts in C<PERL_SRC/hints>, but with an C<.pl> file 3141name extension (eg. C<next_3_2.pl>). They are simply C<eval>ed by 3142MakeMaker within the WriteMakefile() subroutine, and can be used to 3143execute commands as well as to include special variables. The rules 3144which hintsfile is chosen are the same as in Configure. 3145 3146The hintsfile is eval()ed immediately after the arguments given to 3147WriteMakefile are stuffed into a hash reference $self but before this 3148reference becomes blessed. So if you want to do the equivalent to 3149override or create an attribute you would say something like 3150 3151 $self->{LIBS} = ['-ldbm -lucb -lc']; 3152 3153=head2 Distribution Support 3154 3155For authors of extensions MakeMaker provides several Makefile 3156targets. Most of the support comes from the L<ExtUtils::Manifest> module, 3157where additional documentation can be found. 3158 3159=over 4 3160 3161=item make distcheck 3162 3163reports which files are below the build directory but not in the 3164MANIFEST file and vice versa. (See L<ExtUtils::Manifest/fullcheck> for 3165details) 3166 3167=item make skipcheck 3168 3169reports which files are skipped due to the entries in the 3170C<MANIFEST.SKIP> file (See L<ExtUtils::Manifest/skipcheck> for 3171details) 3172 3173=item make distclean 3174 3175does a realclean first and then the distcheck. Note that this is not 3176needed to build a new distribution as long as you are sure that the 3177MANIFEST file is ok. 3178 3179=item make veryclean 3180 3181does a realclean first and then removes backup files such as C<*~>, 3182C<*.bak>, C<*.old> and C<*.orig> 3183 3184=item make manifest 3185 3186rewrites the MANIFEST file, adding all remaining files found (See 3187L<ExtUtils::Manifest/mkmanifest> for details) 3188 3189=item make distdir 3190 3191Copies all the files that are in the MANIFEST file to a newly created 3192directory with the name C<$(DISTNAME)-$(VERSION)>. If that directory 3193exists, it will be removed first. 3194 3195Additionally, it will create META.yml and META.json module meta-data file 3196in the distdir and add this to the distdir's MANIFEST. You can shut this 3197behavior off with the NO_META flag. 3198 3199=item make disttest 3200 3201Makes a distdir first, and runs a C<perl Makefile.PL>, a make, and 3202a make test in that directory. 3203 3204=item make tardist 3205 3206First does a distdir. Then a command $(PREOP) which defaults to a null 3207command, followed by $(TO_UNIX), which defaults to a null command under 3208UNIX, and will convert files in distribution directory to UNIX format 3209otherwise. Next it runs C<tar> on that directory into a tarfile and 3210deletes the directory. Finishes with a command $(POSTOP) which 3211defaults to a null command. 3212 3213=item make dist 3214 3215Defaults to $(DIST_DEFAULT) which in turn defaults to tardist. 3216 3217=item make uutardist 3218 3219Runs a tardist first and uuencodes the tarfile. 3220 3221=item make shdist 3222 3223First does a distdir. Then a command $(PREOP) which defaults to a null 3224command. Next it runs C<shar> on that directory into a sharfile and 3225deletes the intermediate directory again. Finishes with a command 3226$(POSTOP) which defaults to a null command. Note: For shdist to work 3227properly a C<shar> program that can handle directories is mandatory. 3228 3229=item make zipdist 3230 3231First does a distdir. Then a command $(PREOP) which defaults to a null 3232command. Runs C<$(ZIP) $(ZIPFLAGS)> on that directory into a 3233zipfile. Then deletes that directory. Finishes with a command 3234$(POSTOP) which defaults to a null command. 3235 3236=item make ci 3237 3238Does a $(CI) and a $(RCS_LABEL) on all files in the MANIFEST file. 3239 3240=back 3241 3242Customization of the dist targets can be done by specifying a hash 3243reference to the dist attribute of the WriteMakefile call. The 3244following parameters are recognized: 3245 3246 CI ('ci -u') 3247 COMPRESS ('gzip --best') 3248 POSTOP ('@ :') 3249 PREOP ('@ :') 3250 TO_UNIX (depends on the system) 3251 RCS_LABEL ('rcs -q -Nv$(VERSION_SYM):') 3252 SHAR ('shar') 3253 SUFFIX ('.gz') 3254 TAR ('tar') 3255 TARFLAGS ('cvf') 3256 ZIP ('zip') 3257 ZIPFLAGS ('-r') 3258 3259An example: 3260 3261 WriteMakefile( 3262 ...other options... 3263 dist => { 3264 COMPRESS => "bzip2", 3265 SUFFIX => ".bz2" 3266 } 3267 ); 3268 3269 3270=head2 Module Meta-Data (META and MYMETA) 3271 3272Long plaguing users of MakeMaker based modules has been the problem of 3273getting basic information about the module out of the sources 3274I<without> running the F<Makefile.PL> and doing a bunch of messy 3275heuristics on the resulting F<Makefile>. Over the years, it has become 3276standard to keep this information in one or more CPAN Meta files 3277distributed with each distribution. 3278 3279The original format of CPAN Meta files was L<YAML> and the corresponding 3280file was called F<META.yml>. In 2010, version 2 of the L<CPAN::Meta::Spec> 3281was released, which mandates JSON format for the metadata in order to 3282overcome certain compatibility issues between YAML serializers and to 3283avoid breaking older clients unable to handle a new version of the spec. 3284The L<CPAN::Meta> library is now standard for accessing old and new-style 3285Meta files. 3286 3287If L<CPAN::Meta> is installed, MakeMaker will automatically generate 3288F<META.json> and F<META.yml> files for you and add them to your F<MANIFEST> as 3289part of the 'distdir' target (and thus the 'dist' target). This is intended to 3290seamlessly and rapidly populate CPAN with module meta-data. If you wish to 3291shut this feature off, set the C<NO_META> C<WriteMakefile()> flag to true. 3292 3293At the 2008 QA Hackathon in Oslo, Perl module toolchain maintainers agreed 3294to use the CPAN Meta format to communicate post-configuration requirements 3295between toolchain components. These files, F<MYMETA.json> and F<MYMETA.yml>, 3296are generated when F<Makefile.PL> generates a F<Makefile> (if L<CPAN::Meta> 3297is installed). Clients like L<CPAN> or L<CPANPLUS> will read these 3298files to see what prerequisites must be fulfilled before building or testing 3299the distribution. If you wish to shut this feature off, set the C<NO_MYMETA> 3300C<WriteMakeFile()> flag to true. 3301 3302=head2 Disabling an extension 3303 3304If some events detected in F<Makefile.PL> imply that there is no way 3305to create the Module, but this is a normal state of things, then you 3306can create a F<Makefile> which does nothing, but succeeds on all the 3307"usual" build targets. To do so, use 3308 3309 use ExtUtils::MakeMaker qw(WriteEmptyMakefile); 3310 WriteEmptyMakefile(); 3311 3312instead of WriteMakefile(). 3313 3314This may be useful if other modules expect this module to be I<built> 3315OK, as opposed to I<work> OK (say, this system-dependent module builds 3316in a subdirectory of some other distribution, or is listed as a 3317dependency in a CPAN::Bundle, but the functionality is supported by 3318different means on the current architecture). 3319 3320=head2 Other Handy Functions 3321 3322=over 4 3323 3324=item prompt 3325 3326 my $value = prompt($message); 3327 my $value = prompt($message, $default); 3328 3329The C<prompt()> function provides an easy way to request user input 3330used to write a makefile. It displays the $message as a prompt for 3331input. If a $default is provided it will be used as a default. The 3332function returns the $value selected by the user. 3333 3334If C<prompt()> detects that it is not running interactively and there 3335is nothing on STDIN or if the PERL_MM_USE_DEFAULT environment variable 3336is set to true, the $default will be used without prompting. This 3337prevents automated processes from blocking on user input. 3338 3339If no $default is provided an empty string will be used instead. 3340 3341=item os_unsupported 3342 3343 os_unsupported(); 3344 os_unsupported if $^O eq 'MSWin32'; 3345 3346The C<os_unsupported()> function provides a way to correctly exit your 3347C<Makefile.PL> before calling C<WriteMakefile>. It is essentially a 3348C<die> with the message "OS unsupported". 3349 3350This is supported since 7.26 3351 3352=back 3353 3354=head2 Supported versions of Perl 3355 3356Please note that while this module works on Perl 5.6, it is no longer 3357being routinely tested on 5.6 - the earliest Perl version being routinely 3358tested, and expressly supported, is 5.8.1. However, patches to repair 3359any breakage on 5.6 are still being accepted. 3360 3361=head1 ENVIRONMENT 3362 3363=over 4 3364 3365=item PERL_MM_OPT 3366 3367Command line options used by C<MakeMaker-E<gt>new()>, and thus by 3368C<WriteMakefile()>. The string is split as the shell would, and the result 3369is processed before any actual command line arguments are processed. 3370 3371 PERL_MM_OPT='CCFLAGS="-Wl,-rpath -Wl,/foo/bar/lib" LIBS="-lwibble -lwobble"' 3372 3373=item PERL_MM_USE_DEFAULT 3374 3375If set to a true value then MakeMaker's prompt function will 3376always return the default without waiting for user input. 3377 3378=item PERL_CORE 3379 3380Same as the PERL_CORE parameter. The parameter overrides this. 3381 3382=back 3383 3384=head1 SEE ALSO 3385 3386L<Module::Build> is a pure-Perl alternative to MakeMaker which does 3387not rely on make or any other external utility. It may be easier to 3388extend to suit your needs. 3389 3390L<Module::Build::Tiny> is a minimal pure-Perl alternative to MakeMaker 3391that follows the Build.PL protocol of Module::Build but without its 3392complexity and cruft, implementing only the installation of the module 3393and leaving authoring to L<mbtiny> or other authoring tools. 3394 3395L<Module::Install> is a (now discouraged) wrapper around MakeMaker which 3396adds features not normally available. 3397 3398L<ExtUtils::ModuleMaker> and L<Module::Starter> are both modules to 3399help you setup your distribution. 3400 3401L<CPAN::Meta> and L<CPAN::Meta::Spec> explain CPAN Meta files in detail. 3402 3403L<File::ShareDir::Install> makes it easy to install static, sometimes 3404also referred to as 'shared' files. L<File::ShareDir> helps accessing 3405the shared files after installation. L<Test::File::ShareDir> helps when 3406writing tests to use the shared files both before and after installation. 3407 3408L<Dist::Zilla> is an authoring tool which allows great customization and 3409extensibility of the author experience, relying on the existing install 3410tools like ExtUtils::MakeMaker only for installation. 3411 3412L<Dist::Milla> is a Dist::Zilla bundle that greatly simplifies common 3413usage. 3414 3415L<Minilla> is a minimal authoring tool that does the same things as 3416Dist::Milla without the overhead of Dist::Zilla. 3417 3418=head1 AUTHORS 3419 3420Andy Dougherty C<doughera@lafayette.edu>, Andreas KE<ouml>nig 3421C<andreas.koenig@mind.de>, Tim Bunce C<timb@cpan.org>. VMS 3422support by Charles Bailey C<bailey@newman.upenn.edu>. OS/2 support 3423by Ilya Zakharevich C<ilya@math.ohio-state.edu>. 3424 3425Currently maintained by Michael G Schwern C<schwern@pobox.com> 3426 3427Send patches and ideas to C<makemaker@perl.org>. 3428 3429Send bug reports via http://rt.cpan.org/. Please send your 3430generated Makefile along with your report. 3431 3432For more up-to-date information, see L<https://metacpan.org/release/ExtUtils-MakeMaker>. 3433 3434Repository available at L<https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker>. 3435 3436=head1 LICENSE 3437 3438This program is free software; you can redistribute it and/or 3439modify it under the same terms as Perl itself. 3440 3441See L<http://www.perl.com/perl/misc/Artistic.html> 3442 3443 3444=cut 3445