1# $Id$ 2package ExtUtils::MakeMaker; 3 4use strict; 5 6BEGIN {require 5.006;} 7 8require Exporter; 9use ExtUtils::MakeMaker::Config; 10use ExtUtils::MakeMaker::version; # ensure we always have our fake version.pm 11use Carp; 12use File::Path; 13my $CAN_DECODE = eval { require ExtUtils::MakeMaker::Locale; }; # 2 birds, 1 stone 14eval { ExtUtils::MakeMaker::Locale::reinit('UTF-8') } 15 if $CAN_DECODE and Encode::find_encoding('locale')->name eq 'ascii'; 16 17our $Verbose = 0; # exported 18our @Parent; # needs to be localized 19our @Get_from_Config; # referenced by MM_Unix 20our @MM_Sections; 21our @Overridable; 22my @Prepend_parent; 23my %Recognized_Att_Keys; 24our %macro_fsentity; # whether a macro is a filesystem name 25our %macro_dep; # whether a macro is a dependency 26 27our $VERSION = '7.44'; 28$VERSION =~ tr/_//d; 29 30# Emulate something resembling CVS $Revision$ 31(our $Revision = $VERSION) =~ s{_}{}; 32$Revision = int $Revision * 10000; 33 34our $Filename = __FILE__; # referenced outside MakeMaker 35 36our @ISA = qw(Exporter); 37our @EXPORT = qw(&WriteMakefile $Verbose &prompt &os_unsupported); 38our @EXPORT_OK = qw($VERSION &neatvalue &mkbootstrap &mksymlists 39 &WriteEmptyMakefile &open_for_writing &write_file_via_tmp 40 &_sprintf562); 41 42# These will go away once the last of the Win32 & VMS specific code is 43# purged. 44my $Is_VMS = $^O eq 'VMS'; 45my $Is_Win32 = $^O eq 'MSWin32'; 46our $UNDER_CORE = $ENV{PERL_CORE}; # needs to be our 47 48full_setup(); 49 50require ExtUtils::MM; # Things like CPAN assume loading ExtUtils::MakeMaker 51 # will give them MM. 52 53require ExtUtils::MY; # XXX pre-5.8 versions of ExtUtils::Embed expect 54 # loading ExtUtils::MakeMaker will give them MY. 55 # This will go when Embed is its own CPAN module. 56 57 58# 5.6.2 can't do sprintf "%1$s" - this can only do %s 59sub _sprintf562 { 60 my ($format, @args) = @_; 61 for (my $i = 1; $i <= @args; $i++) { 62 $format =~ s#%$i\$s#$args[$i-1]#g; 63 } 64 $format; 65} 66 67sub WriteMakefile { 68 croak "WriteMakefile: Need even number of args" if @_ % 2; 69 70 require ExtUtils::MY; 71 my %att = @_; 72 73 _convert_compat_attrs(\%att); 74 75 _verify_att(\%att); 76 77 my $mm = MM->new(\%att); 78 $mm->flush; 79 80 return $mm; 81} 82 83 84# Basic signatures of the attributes WriteMakefile takes. Each is the 85# reference type. Empty value indicate it takes a non-reference 86# scalar. 87my %Att_Sigs; 88my %Special_Sigs = ( 89 AUTHOR => 'ARRAY', 90 C => 'ARRAY', 91 CONFIG => 'ARRAY', 92 CONFIGURE => 'CODE', 93 DIR => 'ARRAY', 94 DL_FUNCS => 'HASH', 95 DL_VARS => 'ARRAY', 96 EXCLUDE_EXT => 'ARRAY', 97 EXE_FILES => 'ARRAY', 98 FUNCLIST => 'ARRAY', 99 H => 'ARRAY', 100 IMPORTS => 'HASH', 101 INCLUDE_EXT => 'ARRAY', 102 LIBS => ['ARRAY',''], 103 MAN1PODS => 'HASH', 104 MAN3PODS => 'HASH', 105 META_ADD => 'HASH', 106 META_MERGE => 'HASH', 107 OBJECT => ['ARRAY', ''], 108 PL_FILES => 'HASH', 109 PM => 'HASH', 110 PMLIBDIRS => 'ARRAY', 111 PMLIBPARENTDIRS => 'ARRAY', 112 PREREQ_PM => 'HASH', 113 BUILD_REQUIRES => 'HASH', 114 CONFIGURE_REQUIRES => 'HASH', 115 TEST_REQUIRES => 'HASH', 116 SKIP => 'ARRAY', 117 TYPEMAPS => 'ARRAY', 118 XS => 'HASH', 119 XSBUILD => 'HASH', 120 VERSION => ['version',''], 121 _KEEP_AFTER_FLUSH => '', 122 123 clean => 'HASH', 124 depend => 'HASH', 125 dist => 'HASH', 126 dynamic_lib=> 'HASH', 127 linkext => 'HASH', 128 macro => 'HASH', 129 postamble => 'HASH', 130 realclean => 'HASH', 131 test => 'HASH', 132 tool_autosplit => 'HASH', 133); 134 135@Att_Sigs{keys %Recognized_Att_Keys} = ('') x keys %Recognized_Att_Keys; 136@Att_Sigs{keys %Special_Sigs} = values %Special_Sigs; 137 138sub _convert_compat_attrs { #result of running several times should be same 139 my($att) = @_; 140 if (exists $att->{AUTHOR}) { 141 if ($att->{AUTHOR}) { 142 if (!ref($att->{AUTHOR})) { 143 my $t = $att->{AUTHOR}; 144 $att->{AUTHOR} = [$t]; 145 } 146 } else { 147 $att->{AUTHOR} = []; 148 } 149 } 150} 151 152sub _verify_att { 153 my($att) = @_; 154 155 foreach my $key (sort keys %$att) { 156 my $val = $att->{$key}; 157 my $sig = $Att_Sigs{$key}; 158 unless( defined $sig ) { 159 warn "WARNING: $key is not a known parameter.\n"; 160 next; 161 } 162 163 my @sigs = ref $sig ? @$sig : $sig; 164 my $given = ref $val; 165 unless( grep { _is_of_type($val, $_) } @sigs ) { 166 my $takes = join " or ", map { _format_att($_) } @sigs; 167 168 my $has = _format_att($given); 169 warn "WARNING: $key takes a $takes not a $has.\n". 170 " Please inform the author.\n"; 171 } 172 } 173} 174 175 176# Check if a given thing is a reference or instance of $type 177sub _is_of_type { 178 my($thing, $type) = @_; 179 180 return 1 if ref $thing eq $type; 181 182 local $SIG{__DIE__}; 183 return 1 if eval{ $thing->isa($type) }; 184 185 return 0; 186} 187 188 189sub _format_att { 190 my $given = shift; 191 192 return $given eq '' ? "string/number" 193 : uc $given eq $given ? "$given reference" 194 : "$given object" 195 ; 196} 197 198 199sub prompt ($;$) { ## no critic 200 my($mess, $def) = @_; 201 confess("prompt function called without an argument") 202 unless defined $mess; 203 204 my $isa_tty = -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)) ; 205 206 my $dispdef = defined $def ? "[$def] " : " "; 207 $def = defined $def ? $def : ""; 208 209 local $|=1; 210 local $\; 211 print "$mess $dispdef"; 212 213 my $ans; 214 if ($ENV{PERL_MM_USE_DEFAULT} || (!$isa_tty && eof STDIN)) { 215 print "$def\n"; 216 } 217 else { 218 $ans = <STDIN>; 219 if( defined $ans ) { 220 $ans =~ s{\015?\012$}{}; 221 } 222 else { # user hit ctrl-D 223 print "\n"; 224 } 225 } 226 227 return (!defined $ans || $ans eq '') ? $def : $ans; 228} 229 230sub os_unsupported { 231 die "OS unsupported\n"; 232} 233 234sub eval_in_subdirs { 235 my($self) = @_; 236 use Cwd qw(cwd abs_path); 237 my $pwd = cwd() || die "Can't figure out your cwd!"; 238 239 local @INC = map eval {abs_path($_) if -e} || $_, @INC; 240 push @INC, '.'; # '.' has to always be at the end of @INC 241 242 foreach my $dir (@{$self->{DIR}}){ 243 my($abs) = $self->catdir($pwd,$dir); 244 eval { $self->eval_in_x($abs); }; 245 last if $@; 246 } 247 chdir $pwd; 248 die $@ if $@; 249} 250 251sub eval_in_x { 252 my($self,$dir) = @_; 253 chdir $dir or carp("Couldn't change to directory $dir: $!"); 254 255 { 256 package main; 257 do './Makefile.PL'; 258 }; 259 if ($@) { 260# if ($@ =~ /prerequisites/) { 261# die "MakeMaker WARNING: $@"; 262# } else { 263# warn "WARNING from evaluation of $dir/Makefile.PL: $@"; 264# } 265 die "ERROR from evaluation of $dir/Makefile.PL: $@"; 266 } 267} 268 269 270# package name for the classes into which the first object will be blessed 271my $PACKNAME = 'PACK000'; 272 273sub full_setup { 274 $Verbose ||= 0; 275 276 my @dep_macros = qw/ 277 PERL_INCDEP PERL_ARCHLIBDEP PERL_ARCHIVEDEP 278 /; 279 280 my @fs_macros = qw/ 281 FULLPERL XSUBPPDIR 282 283 INST_ARCHLIB INST_SCRIPT INST_BIN INST_LIB INST_MAN1DIR INST_MAN3DIR 284 INSTALLDIRS 285 DESTDIR PREFIX INSTALL_BASE 286 PERLPREFIX SITEPREFIX VENDORPREFIX 287 INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB 288 INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH 289 INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN 290 INSTALLMAN1DIR INSTALLMAN3DIR 291 INSTALLSITEMAN1DIR INSTALLSITEMAN3DIR 292 INSTALLVENDORMAN1DIR INSTALLVENDORMAN3DIR 293 INSTALLSCRIPT INSTALLSITESCRIPT INSTALLVENDORSCRIPT 294 PERL_LIB PERL_ARCHLIB 295 SITELIBEXP SITEARCHEXP 296 297 MAKE LIBPERL_A LIB PERL_SRC PERL_INC 298 PPM_INSTALL_EXEC PPM_UNINSTALL_EXEC 299 PPM_INSTALL_SCRIPT PPM_UNINSTALL_SCRIPT 300 /; 301 302 my @attrib_help = qw/ 303 304 AUTHOR ABSTRACT ABSTRACT_FROM BINARY_LOCATION 305 C CAPI CCFLAGS CONFIG CONFIGURE DEFINE DIR DISTNAME DISTVNAME 306 DL_FUNCS DL_VARS 307 EXCLUDE_EXT EXE_FILES FIRST_MAKEFILE 308 FULLPERLRUN FULLPERLRUNINST 309 FUNCLIST H IMPORTS 310 311 INC INCLUDE_EXT LDFROM LIBS LICENSE 312 LINKTYPE MAKEAPERL MAKEFILE MAKEFILE_OLD MAN1PODS MAN3PODS MAP_TARGET 313 META_ADD META_MERGE MIN_PERL_VERSION BUILD_REQUIRES CONFIGURE_REQUIRES 314 MYEXTLIB NAME NEEDS_LINKING NOECHO NO_META NO_MYMETA NO_PACKLIST NO_PERLLOCAL 315 NORECURS NO_VC OBJECT OPTIMIZE PERL_MALLOC_OK PERL PERLMAINCC PERLRUN 316 PERLRUNINST PERL_CORE 317 PERM_DIR PERM_RW PERM_RWX MAGICXS 318 PL_FILES PM PM_FILTER PMLIBDIRS PMLIBPARENTDIRS POLLUTE 319 PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ PUREPERL_ONLY 320 SIGN SKIP TEST_REQUIRES TYPEMAPS UNINST VERSION VERSION_FROM XS 321 XSBUILD XSMULTI XSOPT XSPROTOARG XS_VERSION 322 clean depend dist dynamic_lib linkext macro realclean tool_autosplit 323 324 MAN1EXT MAN3EXT 325 326 MACPERL_SRC MACPERL_LIB MACLIBS_68K MACLIBS_PPC MACLIBS_SC MACLIBS_MRC 327 MACLIBS_ALL_68K MACLIBS_ALL_PPC MACLIBS_SHARED 328 /; 329 push @attrib_help, @fs_macros; 330 @macro_fsentity{@fs_macros, @dep_macros} = (1) x (@fs_macros+@dep_macros); 331 @macro_dep{@dep_macros} = (1) x @dep_macros; 332 333 # IMPORTS is used under OS/2 and Win32 334 335 # @Overridable is close to @MM_Sections but not identical. The 336 # order is important. Many subroutines declare macros. These 337 # depend on each other. Let's try to collect the macros up front, 338 # then pasthru, then the rules. 339 340 # MM_Sections are the sections we have to call explicitly 341 # in Overridable we have subroutines that are used indirectly 342 343 344 @MM_Sections = 345 qw( 346 347 post_initialize const_config constants platform_constants 348 tool_autosplit tool_xsubpp tools_other 349 350 makemakerdflt 351 352 dist macro depend cflags const_loadlibs const_cccmd 353 post_constants 354 355 pasthru 356 357 special_targets 358 c_o xs_c xs_o 359 top_targets blibdirs linkext dlsyms dynamic_bs dynamic 360 dynamic_lib static static_lib manifypods processPL 361 installbin subdirs 362 clean_subdirs clean realclean_subdirs realclean 363 metafile signature 364 dist_basics dist_core distdir dist_test dist_ci distmeta distsignature 365 install force perldepend makefile staticmake test ppd 366 367 ); # loses section ordering 368 369 @Overridable = @MM_Sections; 370 push @Overridable, qw[ 371 372 libscan makeaperl needs_linking 373 subdir_x test_via_harness test_via_script 374 375 init_VERSION init_dist init_INST init_INSTALL init_DEST init_dirscan 376 init_PM init_MANPODS init_xs init_PERL init_DIRFILESEP init_linker 377 ]; 378 379 push @MM_Sections, qw[ 380 381 pm_to_blib selfdocument 382 383 ]; 384 385 # Postamble needs to be the last that was always the case 386 push @MM_Sections, "postamble"; 387 push @Overridable, "postamble"; 388 389 # All sections are valid keys. 390 @Recognized_Att_Keys{@MM_Sections} = (1) x @MM_Sections; 391 392 # we will use all these variables in the Makefile 393 @Get_from_Config = 394 qw( 395 ar cc cccdlflags ccdlflags dlext dlsrc exe_ext full_ar ld 396 lddlflags ldflags libc lib_ext obj_ext osname osvers ranlib 397 sitelibexp sitearchexp so 398 ); 399 400 # 5.5.3 doesn't have any concept of vendor libs 401 push @Get_from_Config, qw( vendorarchexp vendorlibexp ) if "$]" >= 5.006; 402 403 foreach my $item (@attrib_help){ 404 $Recognized_Att_Keys{$item} = 1; 405 } 406 foreach my $item (@Get_from_Config) { 407 $Recognized_Att_Keys{uc $item} = $Config{$item}; 408 print "Attribute '\U$item\E' => '$Config{$item}'\n" 409 if ($Verbose >= 2); 410 } 411 412 # 413 # When we eval a Makefile.PL in a subdirectory, that one will ask 414 # us (the parent) for the values and will prepend "..", so that 415 # all files to be installed end up below OUR ./blib 416 # 417 @Prepend_parent = qw( 418 INST_BIN INST_LIB INST_ARCHLIB INST_SCRIPT 419 MAP_TARGET INST_MAN1DIR INST_MAN3DIR PERL_SRC 420 PERL FULLPERL 421 ); 422} 423 424sub _has_cpan_meta_requirements { 425 return eval { 426 require CPAN::Meta::Requirements; 427 CPAN::Meta::Requirements->VERSION(2.130); 428 require B; # CMR requires this, for core we have to too. 429 }; 430} 431 432sub new { 433 my($class,$self) = @_; 434 my($key); 435 436 _convert_compat_attrs($self) if defined $self && $self; 437 438 # Store the original args passed to WriteMakefile() 439 foreach my $k (keys %$self) { 440 $self->{ARGS}{$k} = $self->{$k}; 441 } 442 443 $self = {} unless defined $self; 444 445 # Temporarily bless it into MM so it can be used as an 446 # object. It will be blessed into a temp package later. 447 bless $self, "MM"; 448 449 # Cleanup all the module requirement bits 450 my %key2cmr; 451 for my $key (qw(PREREQ_PM BUILD_REQUIRES CONFIGURE_REQUIRES TEST_REQUIRES)) { 452 $self->{$key} ||= {}; 453 if (_has_cpan_meta_requirements) { 454 my $cmr = CPAN::Meta::Requirements->from_string_hash( 455 $self->{$key}, 456 { 457 bad_version_hook => sub { 458 #no warnings 'numeric'; # module doesn't use warnings 459 my $fallback; 460 if ( $_[0] =~ m!^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$! ) { 461 $fallback = sprintf "%f", $_[0]; 462 } else { 463 ($fallback) = $_[0] ? ($_[0] =~ /^([0-9.]+)/) : 0; 464 $fallback += 0; 465 carp "Unparsable version '$_[0]' for prerequisite $_[1] treated as $fallback"; 466 } 467 version->new($fallback); 468 }, 469 }, 470 ); 471 $self->{$key} = $cmr->as_string_hash; 472 $key2cmr{$key} = $cmr; 473 } else { 474 for my $module (sort keys %{ $self->{$key} }) { 475 my $version = $self->{$key}->{$module}; 476 my $fallback = 0; 477 if (!defined($version) or !length($version)) { 478 carp "Undefined requirement for $module treated as '0' (CPAN::Meta::Requirements not available)"; 479 } 480 elsif ($version =~ /^\d+(?:\.\d+(?:_\d+)*)?$/) { 481 next; 482 } 483 else { 484 if ( $version =~ m!^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$! ) { 485 $fallback = sprintf "%f", $version; 486 } else { 487 ($fallback) = $version ? ($version =~ /^([0-9.]+)/) : 0; 488 $fallback += 0; 489 carp "Unparsable version '$version' for prerequisite $module treated as $fallback (CPAN::Meta::Requirements not available)"; 490 } 491 } 492 $self->{$key}->{$module} = $fallback; 493 } 494 } 495 } 496 497 if ("@ARGV" =~ /\bPREREQ_PRINT\b/) { 498 $self->_PREREQ_PRINT; 499 } 500 501 # PRINT_PREREQ is RedHatism. 502 if ("@ARGV" =~ /\bPRINT_PREREQ\b/) { 503 $self->_PRINT_PREREQ; 504 } 505 506 print "MakeMaker (v$VERSION)\n" if $Verbose; 507 if (-f "MANIFEST" && ! -f "Makefile" && ! $UNDER_CORE){ 508 check_manifest(); 509 } 510 511 check_hints($self); 512 513 if ( defined $self->{MIN_PERL_VERSION} 514 && $self->{MIN_PERL_VERSION} !~ /^v?[\d_\.]+$/ ) { 515 require version; 516 my $normal = eval { 517 local $SIG{__WARN__} = sub { 518 # simulate "use warnings FATAL => 'all'" for vintage perls 519 die @_; 520 }; 521 version->new( $self->{MIN_PERL_VERSION} ) 522 }; 523 $self->{MIN_PERL_VERSION} = $normal if defined $normal && !$@; 524 } 525 526 # Translate X.Y.Z to X.00Y00Z 527 if( defined $self->{MIN_PERL_VERSION} ) { 528 $self->{MIN_PERL_VERSION} =~ s{ ^v? (\d+) \. (\d+) \. (\d+) $ } 529 {sprintf "%d.%03d%03d", $1, $2, $3}ex; 530 } 531 532 my $perl_version_ok = eval { 533 local $SIG{__WARN__} = sub { 534 # simulate "use warnings FATAL => 'all'" for vintage perls 535 die @_; 536 }; 537 !$self->{MIN_PERL_VERSION} or $self->{MIN_PERL_VERSION} <= "$]" 538 }; 539 if (!$perl_version_ok) { 540 if (!defined $perl_version_ok) { 541 die <<'END'; 542Warning: MIN_PERL_VERSION is not in a recognized format. 543Recommended is a quoted numerical value like '5.005' or '5.008001'. 544END 545 } 546 elsif ($self->{PREREQ_FATAL}) { 547 die sprintf <<"END", $self->{MIN_PERL_VERSION}, $]; 548MakeMaker FATAL: perl version too low for this distribution. 549Required is %s. We run %s. 550END 551 } 552 else { 553 warn sprintf 554 "Warning: Perl version %s or higher required. We run %s.\n", 555 $self->{MIN_PERL_VERSION}, $]; 556 } 557 } 558 559 my %configure_att; # record &{$self->{CONFIGURE}} attributes 560 my(%initial_att) = %$self; # record initial attributes 561 562 my(%unsatisfied) = (); 563 my %prereq2version; 564 my $cmr; 565 if (_has_cpan_meta_requirements) { 566 $cmr = CPAN::Meta::Requirements->new; 567 for my $key (qw(PREREQ_PM BUILD_REQUIRES CONFIGURE_REQUIRES TEST_REQUIRES)) { 568 $cmr->add_requirements($key2cmr{$key}) if $key2cmr{$key}; 569 } 570 foreach my $prereq ($cmr->required_modules) { 571 $prereq2version{$prereq} = $cmr->requirements_for_module($prereq); 572 } 573 } else { 574 for my $key (qw(PREREQ_PM BUILD_REQUIRES CONFIGURE_REQUIRES TEST_REQUIRES)) { 575 next unless my $module2version = $self->{$key}; 576 $prereq2version{$_} = $module2version->{$_} for keys %$module2version; 577 } 578 } 579 foreach my $prereq (sort keys %prereq2version) { 580 my $required_version = $prereq2version{$prereq}; 581 582 my $pr_version = 0; 583 my $installed_file; 584 585 if ( $prereq eq 'perl' ) { 586 if ( defined $required_version && $required_version =~ /^v?[\d_\.]+$/ 587 || $required_version !~ /^v?[\d_\.]+$/ ) { 588 require version; 589 my $normal = eval { version->new( $required_version ) }; 590 $required_version = $normal if defined $normal; 591 } 592 $installed_file = $prereq; 593 $pr_version = $]; 594 } 595 else { 596 $installed_file = MM->_installed_file_for_module($prereq); 597 $pr_version = MM->parse_version($installed_file) if $installed_file; 598 $pr_version = 0 if $pr_version eq 'undef'; 599 if ( !eval { version->new( $pr_version ); 1 } ) { 600 #no warnings 'numeric'; # module doesn't use warnings 601 my $fallback; 602 if ( $pr_version =~ m!^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$! ) { 603 $fallback = sprintf '%f', $pr_version; 604 } else { 605 ($fallback) = $pr_version ? ($pr_version =~ /^([0-9.]+)/) : 0; 606 $fallback += 0; 607 carp "Unparsable version '$pr_version' for installed prerequisite $prereq treated as $fallback"; 608 } 609 $pr_version = $fallback; 610 } 611 } 612 613 # convert X.Y_Z alpha version #s to X.YZ for easier comparisons 614 $pr_version =~ s/(\d+)\.(\d+)_(\d+)/$1.$2$3/; 615 616 if (!$installed_file) { 617 warn sprintf "Warning: prerequisite %s %s not found.\n", 618 $prereq, $required_version 619 unless $self->{PREREQ_FATAL} 620 or $UNDER_CORE; 621 622 $unsatisfied{$prereq} = 'not installed'; 623 } 624 elsif ( 625 $cmr 626 ? !$cmr->accepts_module($prereq, $pr_version) 627 : $required_version > $pr_version 628 ) { 629 warn sprintf "Warning: prerequisite %s %s not found. We have %s.\n", 630 $prereq, $required_version, ($pr_version || 'unknown version') 631 unless $self->{PREREQ_FATAL} 632 or $UNDER_CORE; 633 634 $unsatisfied{$prereq} = $required_version || 'unknown version' ; 635 } 636 } 637 638 if (%unsatisfied && $self->{PREREQ_FATAL}){ 639 my $failedprereqs = join "\n", map {" $_ $unsatisfied{$_}"} 640 sort { $a cmp $b } keys %unsatisfied; 641 die <<"END"; 642MakeMaker FATAL: prerequisites not found. 643$failedprereqs 644 645Please install these modules first and rerun 'perl Makefile.PL'. 646END 647 } 648 649 if (defined $self->{CONFIGURE}) { 650 if (ref $self->{CONFIGURE} eq 'CODE') { 651 %configure_att = %{&{$self->{CONFIGURE}}}; 652 _convert_compat_attrs(\%configure_att); 653 $self = { %$self, %configure_att }; 654 } else { 655 croak "Attribute 'CONFIGURE' to WriteMakefile() not a code reference\n"; 656 } 657 } 658 659 my $newclass = ++$PACKNAME; 660 local @Parent = @Parent; # Protect against non-local exits 661 { 662 print "Blessing Object into class [$newclass]\n" if $Verbose>=2; 663 mv_all_methods("MY",$newclass); 664 bless $self, $newclass; 665 push @Parent, $self; 666 require ExtUtils::MY; 667 668 no strict 'refs'; ## no critic; 669 @{"$newclass\:\:ISA"} = 'MM'; 670 } 671 672 if (defined $Parent[-2]){ 673 $self->{PARENT} = $Parent[-2]; 674 for my $key (@Prepend_parent) { 675 next unless defined $self->{PARENT}{$key}; 676 677 # Don't stomp on WriteMakefile() args. 678 next if defined $self->{ARGS}{$key} and 679 $self->{ARGS}{$key} eq $self->{$key}; 680 681 $self->{$key} = $self->{PARENT}{$key}; 682 683 if ($Is_VMS && $key =~ /PERL$/) { 684 # PERL or FULLPERL will be a command verb or even a 685 # command with an argument instead of a full file 686 # specification under VMS. So, don't turn the command 687 # into a filespec, but do add a level to the path of 688 # the argument if not already absolute. 689 my @cmd = split /\s+/, $self->{$key}; 690 $cmd[1] = $self->catfile('[-]',$cmd[1]) 691 unless (@cmd < 2) || $self->file_name_is_absolute($cmd[1]); 692 $self->{$key} = join(' ', @cmd); 693 } else { 694 my $value = $self->{$key}; 695 # not going to test in FS so only stripping start 696 $value =~ s/"// if $key =~ /PERL$/ and $self->is_make_type('dmake'); 697 $value =~ s/^"// if $key =~ /PERL$/; 698 $value = $self->catdir("..", $value) 699 unless $self->file_name_is_absolute($value); 700 $value = qq{"$value} if $key =~ /PERL$/; 701 $self->{$key} = $value; 702 } 703 } 704 if ($self->{PARENT}) { 705 $self->{PARENT}->{CHILDREN}->{$newclass} = $self; 706 foreach my $opt (qw(POLLUTE PERL_CORE LINKTYPE AR FULL_AR CC CCFLAGS 707 OPTIMIZE LD LDDLFLAGS LDFLAGS PERL_ARCHLIB DESTDIR)) { 708 if (exists $self->{PARENT}->{$opt} 709 and not exists $self->{$opt}) 710 { 711 # inherit, but only if already unspecified 712 $self->{$opt} = $self->{PARENT}->{$opt}; 713 } 714 } 715 } 716 my @fm = grep /^FIRST_MAKEFILE=/, @ARGV; 717 parse_args($self,@fm) if @fm; 718 } 719 else { 720 parse_args($self, _shellwords($ENV{PERL_MM_OPT} || ''),@ARGV); 721 } 722 723 # RT#91540 PREREQ_FATAL not recognized on command line 724 if (%unsatisfied && $self->{PREREQ_FATAL}){ 725 my $failedprereqs = join "\n", map {" $_ $unsatisfied{$_}"} 726 sort { $a cmp $b } keys %unsatisfied; 727 die <<"END"; 728MakeMaker FATAL: prerequisites not found. 729$failedprereqs 730 731Please install these modules first and rerun 'perl Makefile.PL'. 732END 733 } 734 735 $self->{NAME} ||= $self->guess_name; 736 737 warn "Warning: NAME must be a package name\n" 738 unless $self->{NAME} =~ m!^[A-Z_a-z][0-9A-Z_a-z]*(?:::[0-9A-Z_a-z]+)*$!; 739 740 ($self->{NAME_SYM} = $self->{NAME}) =~ s/\W+/_/g; 741 742 $self->init_MAKE; 743 $self->init_main; 744 $self->init_VERSION; 745 $self->init_dist; 746 $self->init_INST; 747 $self->init_INSTALL; 748 $self->init_DEST; 749 $self->init_dirscan; 750 $self->init_PM; 751 $self->init_MANPODS; 752 $self->init_xs; 753 $self->init_PERL; 754 $self->init_DIRFILESEP; 755 $self->init_linker; 756 $self->init_ABSTRACT; 757 758 $self->arch_check( 759 $INC{'Config.pm'}, 760 $self->catfile($Config{'archlibexp'}, "Config.pm") 761 ); 762 763 $self->init_tools(); 764 $self->init_others(); 765 $self->init_platform(); 766 $self->init_PERM(); 767 my @args = @ARGV; 768 @args = map { Encode::decode(locale => $_) } @args if $CAN_DECODE; 769 my($argv) = neatvalue(\@args); 770 $argv =~ s/^\[/(/; 771 $argv =~ s/\]$/)/; 772 773 push @{$self->{RESULT}}, <<END; 774# This Makefile is for the $self->{NAME} extension to perl. 775# 776# It was generated automatically by MakeMaker version 777# $VERSION (Revision: $Revision) from the contents of 778# Makefile.PL. Don't edit this file, edit Makefile.PL instead. 779# 780# ANY CHANGES MADE HERE WILL BE LOST! 781# 782# MakeMaker ARGV: $argv 783# 784END 785 786 push @{$self->{RESULT}}, $self->_MakeMaker_Parameters_section(\%initial_att); 787 788 if (defined $self->{CONFIGURE}) { 789 push @{$self->{RESULT}}, <<END; 790 791# MakeMaker 'CONFIGURE' Parameters: 792END 793 if (scalar(keys %configure_att) > 0) { 794 foreach my $key (sort keys %configure_att){ 795 next if $key eq 'ARGS'; 796 my($v) = neatvalue($configure_att{$key}); 797 $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/; 798 $v =~ tr/\n/ /s; 799 push @{$self->{RESULT}}, "# $key => $v"; 800 } 801 } 802 else 803 { 804 push @{$self->{RESULT}}, "# no values returned"; 805 } 806 undef %configure_att; # free memory 807 } 808 809 # turn the SKIP array into a SKIPHASH hash 810 for my $skip (@{$self->{SKIP} || []}) { 811 $self->{SKIPHASH}{$skip} = 1; 812 } 813 delete $self->{SKIP}; # free memory 814 815 if ($self->{PARENT}) { 816 for (qw/install dist dist_basics dist_core distdir dist_test dist_ci/) { 817 $self->{SKIPHASH}{$_} = 1; 818 } 819 } 820 821 # We run all the subdirectories now. They don't have much to query 822 # from the parent, but the parent has to query them: if they need linking! 823 unless ($self->{NORECURS}) { 824 $self->eval_in_subdirs if @{$self->{DIR}}; 825 } 826 827 foreach my $section ( @MM_Sections ){ 828 # Support for new foo_target() methods. 829 my $method = $section; 830 $method .= '_target' unless $self->can($method); 831 832 print "Processing Makefile '$section' section\n" if ($Verbose >= 2); 833 my($skipit) = $self->skipcheck($section); 834 if ($skipit){ 835 push @{$self->{RESULT}}, "\n# --- MakeMaker $section section $skipit."; 836 } else { 837 my(%a) = %{$self->{$section} || {}}; 838 push @{$self->{RESULT}}, "\n# --- MakeMaker $section section:"; 839 push @{$self->{RESULT}}, "# " . join ", ", %a if $Verbose && %a; 840 push @{$self->{RESULT}}, $self->maketext_filter( 841 $self->$method( %a ) 842 ); 843 } 844 } 845 846 push @{$self->{RESULT}}, "\n# End."; 847 848 $self; 849} 850 851sub WriteEmptyMakefile { 852 croak "WriteEmptyMakefile: Need an even number of args" if @_ % 2; 853 854 my %att = @_; 855 $att{DIR} = [] unless $att{DIR}; # don't recurse by default 856 my $self = MM->new(\%att); 857 858 my $new = $self->{MAKEFILE}; 859 my $old = $self->{MAKEFILE_OLD}; 860 if (-f $old) { 861 _unlink($old) or warn "unlink $old: $!"; 862 } 863 if ( -f $new ) { 864 _rename($new, $old) or warn "rename $new => $old: $!" 865 } 866 open my $mfh, '>', $new or die "open $new for write: $!"; 867 print $mfh <<'EOP'; 868all : 869 870manifypods : 871 872subdirs : 873 874dynamic : 875 876static : 877 878clean : 879 880install : 881 882makemakerdflt : 883 884test : 885 886test_dynamic : 887 888test_static : 889 890EOP 891 close $mfh or die "close $new for write: $!"; 892} 893 894 895=begin private 896 897=head3 _installed_file_for_module 898 899 my $file = MM->_installed_file_for_module($module); 900 901Return the first installed .pm $file associated with the $module. The 902one which will show up when you C<use $module>. 903 904$module is something like "strict" or "Test::More". 905 906=end private 907 908=cut 909 910sub _installed_file_for_module { 911 my $class = shift; 912 my $prereq = shift; 913 914 my $file = "$prereq.pm"; 915 $file =~ s{::}{/}g; 916 917 my $path; 918 for my $dir (@INC) { 919 my $tmp = File::Spec->catfile($dir, $file); 920 if ( -r $tmp ) { 921 $path = $tmp; 922 last; 923 } 924 } 925 926 return $path; 927} 928 929 930# Extracted from MakeMaker->new so we can test it 931sub _MakeMaker_Parameters_section { 932 my $self = shift; 933 my $att = shift; 934 935 my @result = <<'END'; 936# MakeMaker Parameters: 937END 938 939 foreach my $key (sort keys %$att){ 940 next if $key eq 'ARGS'; 941 my $v; 942 if ($key eq 'PREREQ_PM') { 943 # CPAN.pm takes prereqs from this field in 'Makefile' 944 # and does not know about BUILD_REQUIRES 945 $v = neatvalue({ 946 %{ $att->{PREREQ_PM} || {} }, 947 %{ $att->{BUILD_REQUIRES} || {} }, 948 %{ $att->{TEST_REQUIRES} || {} }, 949 }); 950 } else { 951 $v = neatvalue($att->{$key}); 952 } 953 954 $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/; 955 $v =~ tr/\n/ /s; 956 push @result, "# $key => $v"; 957 } 958 959 return @result; 960} 961 962# _shellwords and _parseline borrowed from Text::ParseWords 963sub _shellwords { 964 my (@lines) = @_; 965 my @allwords; 966 967 foreach my $line (@lines) { 968 $line =~ s/^\s+//; 969 my @words = _parse_line('\s+', 0, $line); 970 pop @words if (@words and !defined $words[-1]); 971 return() unless (@words || !length($line)); 972 push(@allwords, @words); 973 } 974 return(@allwords); 975} 976 977sub _parse_line { 978 my($delimiter, $keep, $line) = @_; 979 my($word, @pieces); 980 981 no warnings 'uninitialized'; # we will be testing undef strings 982 983 while (length($line)) { 984 # This pattern is optimised to be stack conservative on older perls. 985 # Do not refactor without being careful and testing it on very long strings. 986 # See Perl bug #42980 for an example of a stack busting input. 987 $line =~ s/^ 988 (?: 989 # double quoted string 990 (") # $quote 991 ((?>[^\\"]*(?:\\.[^\\"]*)*))" # $quoted 992 | # --OR-- 993 # singe quoted string 994 (') # $quote 995 ((?>[^\\']*(?:\\.[^\\']*)*))' # $quoted 996 | # --OR-- 997 # unquoted string 998 ( # $unquoted 999 (?:\\.|[^\\"'])*? 1000 ) 1001 # followed by 1002 ( # $delim 1003 \Z(?!\n) # EOL 1004 | # --OR-- 1005 (?-x:$delimiter) # delimiter 1006 | # --OR-- 1007 (?!^)(?=["']) # a quote 1008 ) 1009 )//xs or return; # extended layout 1010 my ($quote, $quoted, $unquoted, $delim) = (($1 ? ($1,$2) : ($3,$4)), $5, $6); 1011 1012 1013 return() unless( defined($quote) || length($unquoted) || length($delim)); 1014 1015 if ($keep) { 1016 $quoted = "$quote$quoted$quote"; 1017 } 1018 else { 1019 $unquoted =~ s/\\(.)/$1/sg; 1020 if (defined $quote) { 1021 $quoted =~ s/\\(.)/$1/sg if ($quote eq '"'); 1022 #$quoted =~ s/\\([\\'])/$1/g if ( $PERL_SINGLE_QUOTE && $quote eq "'"); 1023 } 1024 } 1025 $word .= substr($line, 0, 0); # leave results tainted 1026 $word .= defined $quote ? $quoted : $unquoted; 1027 1028 if (length($delim)) { 1029 push(@pieces, $word); 1030 push(@pieces, $delim) if ($keep eq 'delimiters'); 1031 undef $word; 1032 } 1033 if (!length($line)) { 1034 push(@pieces, $word); 1035 } 1036 } 1037 return(@pieces); 1038} 1039 1040sub check_manifest { 1041 print "Checking if your kit is complete...\n"; 1042 require ExtUtils::Manifest; 1043 # avoid warning 1044 $ExtUtils::Manifest::Quiet = $ExtUtils::Manifest::Quiet = 1; 1045 my(@missed) = ExtUtils::Manifest::manicheck(); 1046 if (@missed) { 1047 print "Warning: the following files are missing in your kit:\n"; 1048 print "\t", join "\n\t", @missed; 1049 print "\n"; 1050 print "Please inform the author.\n"; 1051 } else { 1052 print "Looks good\n"; 1053 } 1054} 1055 1056sub parse_args{ 1057 my($self, @args) = @_; 1058 @args = map { Encode::decode(locale => $_) } @args if $CAN_DECODE; 1059 foreach (@args) { 1060 unless (m/(.*?)=(.*)/) { 1061 ++$Verbose if m/^verb/; 1062 next; 1063 } 1064 my($name, $value) = ($1, $2); 1065 if ($value =~ m/^~(\w+)?/) { # tilde with optional username 1066 $value =~ s [^~(\w*)] 1067 [$1 ? 1068 ((getpwnam($1))[7] || "~$1") : 1069 (getpwuid($>))[7] 1070 ]ex; 1071 } 1072 1073 # Remember the original args passed it. It will be useful later. 1074 $self->{ARGS}{uc $name} = $self->{uc $name} = $value; 1075 } 1076 1077 # catch old-style 'potential_libs' and inform user how to 'upgrade' 1078 if (defined $self->{potential_libs}){ 1079 my($msg)="'potential_libs' => '$self->{potential_libs}' should be"; 1080 if ($self->{potential_libs}){ 1081 print "$msg changed to:\n\t'LIBS' => ['$self->{potential_libs}']\n"; 1082 } else { 1083 print "$msg deleted.\n"; 1084 } 1085 $self->{LIBS} = [$self->{potential_libs}]; 1086 delete $self->{potential_libs}; 1087 } 1088 # catch old-style 'ARMAYBE' and inform user how to 'upgrade' 1089 if (defined $self->{ARMAYBE}){ 1090 my($armaybe) = $self->{ARMAYBE}; 1091 print "ARMAYBE => '$armaybe' should be changed to:\n", 1092 "\t'dynamic_lib' => {ARMAYBE => '$armaybe'}\n"; 1093 my(%dl) = %{$self->{dynamic_lib} || {}}; 1094 $self->{dynamic_lib} = { %dl, ARMAYBE => $armaybe}; 1095 delete $self->{ARMAYBE}; 1096 } 1097 if (defined $self->{LDTARGET}){ 1098 print "LDTARGET should be changed to LDFROM\n"; 1099 $self->{LDFROM} = $self->{LDTARGET}; 1100 delete $self->{LDTARGET}; 1101 } 1102 # Turn a DIR argument on the command line into an array 1103 if (defined $self->{DIR} && ref \$self->{DIR} eq 'SCALAR') { 1104 # So they can choose from the command line, which extensions they want 1105 # the grep enables them to have some colons too much in case they 1106 # have to build a list with the shell 1107 $self->{DIR} = [grep $_, split ":", $self->{DIR}]; 1108 } 1109 # Turn a INCLUDE_EXT argument on the command line into an array 1110 if (defined $self->{INCLUDE_EXT} && ref \$self->{INCLUDE_EXT} eq 'SCALAR') { 1111 $self->{INCLUDE_EXT} = [grep $_, split '\s+', $self->{INCLUDE_EXT}]; 1112 } 1113 # Turn a EXCLUDE_EXT argument on the command line into an array 1114 if (defined $self->{EXCLUDE_EXT} && ref \$self->{EXCLUDE_EXT} eq 'SCALAR') { 1115 $self->{EXCLUDE_EXT} = [grep $_, split '\s+', $self->{EXCLUDE_EXT}]; 1116 } 1117 1118 foreach my $mmkey (sort keys %$self){ 1119 next if $mmkey eq 'ARGS'; 1120 print " $mmkey => ", neatvalue($self->{$mmkey}), "\n" if $Verbose; 1121 print "'$mmkey' is not a known MakeMaker parameter name.\n" 1122 unless exists $Recognized_Att_Keys{$mmkey}; 1123 } 1124 $| = 1 if $Verbose; 1125} 1126 1127sub check_hints { 1128 my($self) = @_; 1129 # We allow extension-specific hints files. 1130 1131 require File::Spec; 1132 my $curdir = File::Spec->curdir; 1133 1134 my $hint_dir = File::Spec->catdir($curdir, "hints"); 1135 return unless -d $hint_dir; 1136 1137 # First we look for the best hintsfile we have 1138 my($hint)="${^O}_$Config{osvers}"; 1139 $hint =~ s/\./_/g; 1140 $hint =~ s/_$//; 1141 return unless $hint; 1142 1143 # Also try without trailing minor version numbers. 1144 while (1) { 1145 last if -f File::Spec->catfile($hint_dir, "$hint.pl"); # found 1146 } continue { 1147 last unless $hint =~ s/_[^_]*$//; # nothing to cut off 1148 } 1149 my $hint_file = File::Spec->catfile($hint_dir, "$hint.pl"); 1150 1151 return unless -f $hint_file; # really there 1152 1153 _run_hintfile($self, $hint_file); 1154} 1155 1156sub _run_hintfile { 1157 our $self; 1158 local($self) = shift; # make $self available to the hint file. 1159 my($hint_file) = shift; 1160 1161 local($@, $!); 1162 print "Processing hints file $hint_file\n" if $Verbose; 1163 1164 # Just in case the ./ isn't on the hint file, which File::Spec can 1165 # often strip off, we bung the curdir into @INC 1166 local @INC = (File::Spec->curdir, @INC); 1167 my $ret = do $hint_file; 1168 if( !defined $ret ) { 1169 my $error = $@ || $!; 1170 warn $error; 1171 } 1172} 1173 1174sub mv_all_methods { 1175 my($from,$to) = @_; 1176 local $SIG{__WARN__} = sub { 1177 # can't use 'no warnings redefined', 5.6 only 1178 warn @_ unless $_[0] =~ /^Subroutine .* redefined/ 1179 }; 1180 foreach my $method (@Overridable) { 1181 next unless defined &{"${from}::$method"}; 1182 no strict 'refs'; ## no critic 1183 *{"${to}::$method"} = \&{"${from}::$method"}; 1184 1185 # If we delete a method, then it will be undefined and cannot 1186 # be called. But as long as we have Makefile.PLs that rely on 1187 # %MY:: being intact, we have to fill the hole with an 1188 # inheriting method: 1189 1190 { 1191 package MY; 1192 my $super = "SUPER::".$method; 1193 *{$method} = sub { 1194 shift->$super(@_); 1195 }; 1196 } 1197 } 1198} 1199 1200sub skipcheck { 1201 my($self) = shift; 1202 my($section) = @_; 1203 return 'skipped' if $section eq 'metafile' && $UNDER_CORE; 1204 if ($section eq 'dynamic') { 1205 print "Warning (non-fatal): Target 'dynamic' depends on targets ", 1206 "in skipped section 'dynamic_bs'\n" 1207 if $self->{SKIPHASH}{dynamic_bs} && $Verbose; 1208 print "Warning (non-fatal): Target 'dynamic' depends on targets ", 1209 "in skipped section 'dynamic_lib'\n" 1210 if $self->{SKIPHASH}{dynamic_lib} && $Verbose; 1211 } 1212 if ($section eq 'dynamic_lib') { 1213 print "Warning (non-fatal): Target '\$(INST_DYNAMIC)' depends on ", 1214 "targets in skipped section 'dynamic_bs'\n" 1215 if $self->{SKIPHASH}{dynamic_bs} && $Verbose; 1216 } 1217 if ($section eq 'static') { 1218 print "Warning (non-fatal): Target 'static' depends on targets ", 1219 "in skipped section 'static_lib'\n" 1220 if $self->{SKIPHASH}{static_lib} && $Verbose; 1221 } 1222 return 'skipped' if $self->{SKIPHASH}{$section}; 1223 return ''; 1224} 1225 1226# returns filehandle, dies on fail. :raw so no :crlf 1227sub open_for_writing { 1228 my ($file) = @_; 1229 open my $fh ,">", $file or die "Unable to open $file: $!"; 1230 my @layers = ':raw'; 1231 push @layers, join ' ', ':encoding(locale)' if $CAN_DECODE; 1232 binmode $fh, join ' ', @layers; 1233 $fh; 1234} 1235 1236sub flush { 1237 my $self = shift; 1238 1239 my $finalname = $self->{MAKEFILE}; 1240 printf "Generating a %s %s\n", $self->make_type, $finalname if $Verbose || !$self->{PARENT}; 1241 print "Writing $finalname for $self->{NAME}\n" if $Verbose || !$self->{PARENT}; 1242 1243 unlink($finalname, "MakeMaker.tmp", $Is_VMS ? 'Descrip.MMS' : ()); 1244 1245 write_file_via_tmp($finalname, $self->{RESULT}); 1246 1247 # Write MYMETA.yml to communicate metadata up to the CPAN clients 1248 print "Writing MYMETA.yml and MYMETA.json\n" 1249 if !$self->{NO_MYMETA} and $self->write_mymeta( $self->mymeta ); 1250 1251 # save memory 1252 if ($self->{PARENT} && !$self->{_KEEP_AFTER_FLUSH}) { 1253 my %keep = map { ($_ => 1) } qw(NEEDS_LINKING HAS_LINK_CODE); 1254 delete $self->{$_} for grep !$keep{$_}, keys %$self; 1255 } 1256 1257 system("$Config::Config{eunicefix} $finalname") 1258 if $Config::Config{eunicefix} ne ":"; 1259 1260 return; 1261} 1262 1263sub write_file_via_tmp { 1264 my ($finalname, $contents) = @_; 1265 my $fh = open_for_writing("MakeMaker.tmp"); 1266 die "write_file_via_tmp: 2nd arg must be ref" unless ref $contents; 1267 for my $chunk (@$contents) { 1268 my $to_write = $chunk; 1269 utf8::encode $to_write if !$CAN_DECODE && "$]" > 5.008; 1270 print $fh "$to_write\n" or die "Can't write to MakeMaker.tmp: $!"; 1271 } 1272 close $fh or die "Can't write to MakeMaker.tmp: $!"; 1273 _rename("MakeMaker.tmp", $finalname) or 1274 warn "rename MakeMaker.tmp => $finalname: $!"; 1275 chmod 0644, $finalname if !$Is_VMS; 1276 return; 1277} 1278 1279# This is a rename for OS's where the target must be unlinked first. 1280sub _rename { 1281 my($src, $dest) = @_; 1282 _unlink($dest); 1283 return rename $src, $dest; 1284} 1285 1286# This is an unlink for OS's where the target must be writable first. 1287sub _unlink { 1288 my @files = @_; 1289 chmod 0666, @files; 1290 return unlink @files; 1291} 1292 1293 1294# The following mkbootstrap() is only for installations that are calling 1295# the pre-4.1 mkbootstrap() from their old Makefiles. This MakeMaker 1296# writes Makefiles, that use ExtUtils::Mkbootstrap directly. 1297sub mkbootstrap { 1298 die <<END; 1299!!! Your Makefile has been built such a long time ago, !!! 1300!!! that is unlikely to work with current MakeMaker. !!! 1301!!! Please rebuild your Makefile !!! 1302END 1303} 1304 1305# Ditto for mksymlists() as of MakeMaker 5.17 1306sub mksymlists { 1307 die <<END; 1308!!! Your Makefile has been built such a long time ago, !!! 1309!!! that is unlikely to work with current MakeMaker. !!! 1310!!! Please rebuild your Makefile !!! 1311END 1312} 1313 1314sub neatvalue { 1315 my($v) = @_; 1316 return "undef" unless defined $v; 1317 my($t) = ref $v; 1318 return "q[$v]" unless $t; 1319 if ($t eq 'ARRAY') { 1320 my(@m, @neat); 1321 push @m, "["; 1322 foreach my $elem (@$v) { 1323 push @neat, "q[$elem]"; 1324 } 1325 push @m, join ", ", @neat; 1326 push @m, "]"; 1327 return join "", @m; 1328 } 1329 return $v unless $t eq 'HASH'; 1330 my(@m, $key, $val); 1331 for my $key (sort keys %$v) { 1332 last unless defined $key; # cautious programming in case (undef,undef) is true 1333 push @m,"$key=>".neatvalue($v->{$key}); 1334 } 1335 return "{ ".join(', ',@m)." }"; 1336} 1337 1338sub _find_magic_vstring { 1339 my $value = shift; 1340 return $value if $UNDER_CORE; 1341 my $tvalue = ''; 1342 require B; 1343 my $sv = B::svref_2object(\$value); 1344 my $magic = ref($sv) eq 'B::PVMG' ? $sv->MAGIC : undef; 1345 while ( $magic ) { 1346 if ( $magic->TYPE eq 'V' ) { 1347 $tvalue = $magic->PTR; 1348 $tvalue =~ s/^v?(.+)$/v$1/; 1349 last; 1350 } 1351 else { 1352 $magic = $magic->MOREMAGIC; 1353 } 1354 } 1355 return $tvalue; 1356} 1357 1358sub selfdocument { 1359 my($self) = @_; 1360 my(@m); 1361 if ($Verbose){ 1362 push @m, "\n# Full list of MakeMaker attribute values:"; 1363 foreach my $key (sort keys %$self){ 1364 next if $key eq 'RESULT' || $key =~ /^[A-Z][a-z]/; 1365 my($v) = neatvalue($self->{$key}); 1366 $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/; 1367 $v =~ tr/\n/ /s; 1368 push @m, "# $key => $v"; 1369 } 1370 } 1371 # added here as selfdocument is not overridable 1372 push @m, <<'EOF'; 1373 1374# here so even if top_targets is overridden, these will still be defined 1375# gmake will silently still work if any are .PHONY-ed but nmake won't 1376EOF 1377 push @m, join "\n", map "$_ ::\n\t\$(NOECHO) \$(NOOP)\n", 1378 # config is so manifypods won't puke if no subdirs 1379 grep !$self->{SKIPHASH}{$_}, 1380 qw(static dynamic config); 1381 join "\n", @m; 1382} 1383 13841; 1385 1386__END__ 1387 1388=head1 NAME 1389 1390ExtUtils::MakeMaker - Create a module Makefile 1391 1392=head1 SYNOPSIS 1393 1394 use ExtUtils::MakeMaker; 1395 1396 WriteMakefile( 1397 NAME => "Foo::Bar", 1398 VERSION_FROM => "lib/Foo/Bar.pm", 1399 ); 1400 1401=head1 DESCRIPTION 1402 1403This utility is designed to write a Makefile for an extension module 1404from a Makefile.PL. It is based on the Makefile.SH model provided by 1405Andy Dougherty and the perl5-porters. 1406 1407It splits the task of generating the Makefile into several subroutines 1408that can be individually overridden. Each subroutine returns the text 1409it wishes to have written to the Makefile. 1410 1411As there are various Make programs with incompatible syntax, which 1412use operating system shells, again with incompatible syntax, it is 1413important for users of this module to know which flavour of Make 1414a Makefile has been written for so they'll use the correct one and 1415won't have to face the possibly bewildering errors resulting from 1416using the wrong one. 1417 1418On POSIX systems, that program will likely be GNU Make; on Microsoft 1419Windows, it will be either Microsoft NMake, DMake or GNU Make. 1420See the section on the L</"MAKE"> parameter for details. 1421 1422ExtUtils::MakeMaker (EUMM) is object oriented. Each directory below the current 1423directory that contains a Makefile.PL is treated as a separate 1424object. This makes it possible to write an unlimited number of 1425Makefiles with a single invocation of WriteMakefile(). 1426 1427All inputs to WriteMakefile are Unicode characters, not just octets. EUMM 1428seeks to handle all of these correctly. It is currently still not possible 1429to portably use Unicode characters in module names, because this requires 1430Perl to handle Unicode filenames, which is not yet the case on Windows. 1431 1432See L<ExtUtils::MakeMaker::FAQ> for details of the design and usage. 1433 1434=head2 How To Write A Makefile.PL 1435 1436See L<ExtUtils::MakeMaker::Tutorial>. 1437 1438The long answer is the rest of the manpage :-) 1439 1440=head2 Default Makefile Behaviour 1441 1442The generated Makefile enables the user of the extension to invoke 1443 1444 perl Makefile.PL # optionally "perl Makefile.PL verbose" 1445 make 1446 make test # optionally set TEST_VERBOSE=1 1447 make install # See below 1448 1449The Makefile to be produced may be altered by adding arguments of the 1450form C<KEY=VALUE>. E.g. 1451 1452 perl Makefile.PL INSTALL_BASE=~ 1453 1454Other interesting targets in the generated Makefile are 1455 1456 make config # to check if the Makefile is up-to-date 1457 make clean # delete local temp files (Makefile gets renamed) 1458 make realclean # delete derived files (including ./blib) 1459 make ci # check in all the files in the MANIFEST file 1460 make dist # see below the Distribution Support section 1461 1462=head2 make test 1463 1464MakeMaker checks for the existence of a file named F<test.pl> in the 1465current directory, and if it exists it executes the script with the 1466proper set of perl C<-I> options. 1467 1468MakeMaker also checks for any files matching glob("t/*.t"). It will 1469execute all matching files in alphabetical order via the 1470L<Test::Harness> module with the C<-I> switches set correctly. 1471 1472You can also organize your tests within subdirectories in the F<t/> directory. 1473To do so, use the F<test> directive in your I<Makefile.PL>. For example, if you 1474had tests in: 1475 1476 t/foo 1477 t/foo/bar 1478 1479You could tell make to run tests in both of those directories with the 1480following directives: 1481 1482 test => {TESTS => 't/*/*.t t/*/*/*.t'} 1483 test => {TESTS => 't/foo/*.t t/foo/bar/*.t'} 1484 1485The first will run all test files in all first-level subdirectories and all 1486subdirectories they contain. The second will run tests in only the F<t/foo> 1487and F<t/foo/bar>. 1488 1489If you'd like to see the raw output of your tests, set the 1490C<TEST_VERBOSE> variable to true. 1491 1492 make test TEST_VERBOSE=1 1493 1494If you want to run particular test files, set the C<TEST_FILES> variable. 1495It is possible to use globbing with this mechanism. 1496 1497 make test TEST_FILES='t/foobar.t t/dagobah*.t' 1498 1499Windows users who are using C<nmake> should note that due to a bug in C<nmake>, 1500when specifying C<TEST_FILES> you must use back-slashes instead of forward-slashes. 1501 1502 nmake test TEST_FILES='t\foobar.t t\dagobah*.t' 1503 1504=head2 make testdb 1505 1506A useful variation of the above is the target C<testdb>. It runs the 1507test under the Perl debugger (see L<perldebug>). If the file 1508F<test.pl> exists in the current directory, it is used for the test. 1509 1510If you want to debug some other testfile, set the C<TEST_FILE> variable 1511thusly: 1512 1513 make testdb TEST_FILE=t/mytest.t 1514 1515By default the debugger is called using C<-d> option to perl. If you 1516want to specify some other option, set the C<TESTDB_SW> variable: 1517 1518 make testdb TESTDB_SW=-Dx 1519 1520=head2 make install 1521 1522make alone puts all relevant files into directories that are named by 1523the macros INST_LIB, INST_ARCHLIB, INST_SCRIPT, INST_MAN1DIR and 1524INST_MAN3DIR. All these default to something below ./blib if you are 1525I<not> building below the perl source directory. If you I<are> 1526building below the perl source, INST_LIB and INST_ARCHLIB default to 1527../../lib, and INST_SCRIPT is not defined. 1528 1529The I<install> target of the generated Makefile copies the files found 1530below each of the INST_* directories to their INSTALL* 1531counterparts. Which counterparts are chosen depends on the setting of 1532INSTALLDIRS according to the following table: 1533 1534 INSTALLDIRS set to 1535 perl site vendor 1536 1537 PERLPREFIX SITEPREFIX VENDORPREFIX 1538 INST_ARCHLIB INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH 1539 INST_LIB INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB 1540 INST_BIN INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN 1541 INST_SCRIPT INSTALLSCRIPT INSTALLSITESCRIPT INSTALLVENDORSCRIPT 1542 INST_MAN1DIR INSTALLMAN1DIR INSTALLSITEMAN1DIR INSTALLVENDORMAN1DIR 1543 INST_MAN3DIR INSTALLMAN3DIR INSTALLSITEMAN3DIR INSTALLVENDORMAN3DIR 1544 1545The INSTALL... macros in turn default to their %Config 1546($Config{installprivlib}, $Config{installarchlib}, etc.) counterparts. 1547 1548You can check the values of these variables on your system with 1549 1550 perl '-V:install.*' 1551 1552And to check the sequence in which the library directories are 1553searched by perl, run 1554 1555 perl -le 'print join $/, @INC' 1556 1557Sometimes older versions of the module you're installing live in other 1558directories in @INC. Because Perl loads the first version of a module it 1559finds, not the newest, you might accidentally get one of these older 1560versions even after installing a brand new version. To delete I<all other 1561versions of the module you're installing> (not simply older ones) set the 1562C<UNINST> variable. 1563 1564 make install UNINST=1 1565 1566 1567=head2 INSTALL_BASE 1568 1569INSTALL_BASE can be passed into Makefile.PL to change where your 1570module will be installed. INSTALL_BASE is more like what everyone 1571else calls "prefix" than PREFIX is. 1572 1573To have everything installed in your home directory, do the following. 1574 1575 # Unix users, INSTALL_BASE=~ works fine 1576 perl Makefile.PL INSTALL_BASE=/path/to/your/home/dir 1577 1578Like PREFIX, it sets several INSTALL* attributes at once. Unlike 1579PREFIX it is easy to predict where the module will end up. The 1580installation pattern looks like this: 1581 1582 INSTALLARCHLIB INSTALL_BASE/lib/perl5/$Config{archname} 1583 INSTALLPRIVLIB INSTALL_BASE/lib/perl5 1584 INSTALLBIN INSTALL_BASE/bin 1585 INSTALLSCRIPT INSTALL_BASE/bin 1586 INSTALLMAN1DIR INSTALL_BASE/man/man1 1587 INSTALLMAN3DIR INSTALL_BASE/man/man3 1588 1589INSTALL_BASE in MakeMaker and C<--install_base> in Module::Build (as 1590of 0.28) install to the same location. If you want MakeMaker and 1591Module::Build to install to the same location simply set INSTALL_BASE 1592and C<--install_base> to the same location. 1593 1594INSTALL_BASE was added in 6.31. 1595 1596 1597=head2 PREFIX and LIB attribute 1598 1599PREFIX and LIB can be used to set several INSTALL* attributes in one 1600go. Here's an example for installing into your home directory. 1601 1602 # Unix users, PREFIX=~ works fine 1603 perl Makefile.PL PREFIX=/path/to/your/home/dir 1604 1605This will install all files in the module under your home directory, 1606with man pages and libraries going into an appropriate place (usually 1607~/man and ~/lib). How the exact location is determined is complicated 1608and depends on how your Perl was configured. INSTALL_BASE works more 1609like what other build systems call "prefix" than PREFIX and we 1610recommend you use that instead. 1611 1612Another way to specify many INSTALL directories with a single 1613parameter is LIB. 1614 1615 perl Makefile.PL LIB=~/lib 1616 1617This will install the module's architecture-independent files into 1618~/lib, the architecture-dependent files into ~/lib/$archname. 1619 1620Note, that in both cases the tilde expansion is done by MakeMaker, not 1621by perl by default, nor by make. 1622 1623Conflicts between parameters LIB, PREFIX and the various INSTALL* 1624arguments are resolved so that: 1625 1626=over 4 1627 1628=item * 1629 1630setting LIB overrides any setting of INSTALLPRIVLIB, INSTALLARCHLIB, 1631INSTALLSITELIB, INSTALLSITEARCH (and they are not affected by PREFIX); 1632 1633=item * 1634 1635without LIB, setting PREFIX replaces the initial C<$Config{prefix}> 1636part of those INSTALL* arguments, even if the latter are explicitly 1637set (but are set to still start with C<$Config{prefix}>). 1638 1639=back 1640 1641If the user has superuser privileges, and is not working on AFS or 1642relatives, then the defaults for INSTALLPRIVLIB, INSTALLARCHLIB, 1643INSTALLSCRIPT, etc. will be appropriate, and this incantation will be 1644the best: 1645 1646 perl Makefile.PL; 1647 make; 1648 make test 1649 make install 1650 1651make install by default writes some documentation of what has been 1652done into the file C<$(INSTALLARCHLIB)/perllocal.pod>. This feature 1653can be bypassed by calling make pure_install. 1654 1655=head2 AFS users 1656 1657will have to specify the installation directories as these most 1658probably have changed since perl itself has been installed. They will 1659have to do this by calling 1660 1661 perl Makefile.PL INSTALLSITELIB=/afs/here/today \ 1662 INSTALLSCRIPT=/afs/there/now INSTALLMAN3DIR=/afs/for/manpages 1663 make 1664 1665Be careful to repeat this procedure every time you recompile an 1666extension, unless you are sure the AFS installation directories are 1667still valid. 1668 1669=head2 Static Linking of a new Perl Binary 1670 1671An extension that is built with the above steps is ready to use on 1672systems supporting dynamic loading. On systems that do not support 1673dynamic loading, any newly created extension has to be linked together 1674with the available resources. MakeMaker supports the linking process 1675by creating appropriate targets in the Makefile whenever an extension 1676is built. You can invoke the corresponding section of the makefile with 1677 1678 make perl 1679 1680That produces a new perl binary in the current directory with all 1681extensions linked in that can be found in INST_ARCHLIB, SITELIBEXP, 1682and PERL_ARCHLIB. To do that, MakeMaker writes a new Makefile, on 1683UNIX, this is called F<Makefile.aperl> (may be system dependent). If you 1684want to force the creation of a new perl, it is recommended that you 1685delete this F<Makefile.aperl>, so the directories are searched through 1686for linkable libraries again. 1687 1688The binary can be installed into the directory where perl normally 1689resides on your machine with 1690 1691 make inst_perl 1692 1693To produce a perl binary with a different name than C<perl>, either say 1694 1695 perl Makefile.PL MAP_TARGET=myperl 1696 make myperl 1697 make inst_perl 1698 1699or say 1700 1701 perl Makefile.PL 1702 make myperl MAP_TARGET=myperl 1703 make inst_perl MAP_TARGET=myperl 1704 1705In any case you will be prompted with the correct invocation of the 1706C<inst_perl> target that installs the new binary into INSTALLBIN. 1707 1708make inst_perl by default writes some documentation of what has been 1709done into the file C<$(INSTALLARCHLIB)/perllocal.pod>. This 1710can be bypassed by calling make pure_inst_perl. 1711 1712Warning: the inst_perl: target will most probably overwrite your 1713existing perl binary. Use with care! 1714 1715Sometimes you might want to build a statically linked perl although 1716your system supports dynamic loading. In this case you may explicitly 1717set the linktype with the invocation of the Makefile.PL or make: 1718 1719 perl Makefile.PL LINKTYPE=static # recommended 1720 1721or 1722 1723 make LINKTYPE=static # works on most systems 1724 1725=head2 Determination of Perl Library and Installation Locations 1726 1727MakeMaker needs to know, or to guess, where certain things are 1728located. Especially INST_LIB and INST_ARCHLIB (where to put the files 1729during the make(1) run), PERL_LIB and PERL_ARCHLIB (where to read 1730existing modules from), and PERL_INC (header files and C<libperl*.*>). 1731 1732Extensions may be built either using the contents of the perl source 1733directory tree or from the installed perl library. The recommended way 1734is to build extensions after you have run 'make install' on perl 1735itself. You can do that in any directory on your hard disk that is not 1736below the perl source tree. The support for extensions below the ext 1737directory of the perl distribution is only good for the standard 1738extensions that come with perl. 1739 1740If an extension is being built below the C<ext/> directory of the perl 1741source then MakeMaker will set PERL_SRC automatically (e.g., 1742C<../..>). If PERL_SRC is defined and the extension is recognized as 1743a standard extension, then other variables default to the following: 1744 1745 PERL_INC = PERL_SRC 1746 PERL_LIB = PERL_SRC/lib 1747 PERL_ARCHLIB = PERL_SRC/lib 1748 INST_LIB = PERL_LIB 1749 INST_ARCHLIB = PERL_ARCHLIB 1750 1751If an extension is being built away from the perl source then MakeMaker 1752will leave PERL_SRC undefined and default to using the installed copy 1753of the perl library. The other variables default to the following: 1754 1755 PERL_INC = $archlibexp/CORE 1756 PERL_LIB = $privlibexp 1757 PERL_ARCHLIB = $archlibexp 1758 INST_LIB = ./blib/lib 1759 INST_ARCHLIB = ./blib/arch 1760 1761If perl has not yet been installed then PERL_SRC can be defined on the 1762command line as shown in the previous section. 1763 1764 1765=head2 Which architecture dependent directory? 1766 1767If you don't want to keep the defaults for the INSTALL* macros, 1768MakeMaker helps you to minimize the typing needed: the usual 1769relationship between INSTALLPRIVLIB and INSTALLARCHLIB is determined 1770by Configure at perl compilation time. MakeMaker supports the user who 1771sets INSTALLPRIVLIB. If INSTALLPRIVLIB is set, but INSTALLARCHLIB not, 1772then MakeMaker defaults the latter to be the same subdirectory of 1773INSTALLPRIVLIB as Configure decided for the counterparts in %Config, 1774otherwise it defaults to INSTALLPRIVLIB. The same relationship holds 1775for INSTALLSITELIB and INSTALLSITEARCH. 1776 1777MakeMaker gives you much more freedom than needed to configure 1778internal variables and get different results. It is worth mentioning 1779that make(1) also lets you configure most of the variables that are 1780used in the Makefile. But in the majority of situations this will not 1781be necessary, and should only be done if the author of a package 1782recommends it (or you know what you're doing). 1783 1784=head2 Using Attributes and Parameters 1785 1786The following attributes may be specified as arguments to WriteMakefile() 1787or as NAME=VALUE pairs on the command line. Attributes that became 1788available with later versions of MakeMaker are indicated. 1789 1790In order to maintain portability of attributes with older versions of 1791MakeMaker you may want to use L<App::EUMM::Upgrade> with your C<Makefile.PL>. 1792 1793=over 2 1794 1795=item ABSTRACT 1796 1797One line description of the module. Will be included in PPD file. 1798 1799=item ABSTRACT_FROM 1800 1801Name of the file that contains the package description. MakeMaker looks 1802for a line in the POD matching /^($package\s-\s)(.*)/. This is typically 1803the first line in the "=head1 NAME" section. $2 becomes the abstract. 1804 1805=item AUTHOR 1806 1807Array of strings containing name (and email address) of package author(s). 1808Is used in CPAN Meta files (META.yml or META.json) and PPD 1809(Perl Package Description) files for PPM (Perl Package Manager). 1810 1811=item BINARY_LOCATION 1812 1813Used when creating PPD files for binary packages. It can be set to a 1814full or relative path or URL to the binary archive for a particular 1815architecture. For example: 1816 1817 perl Makefile.PL BINARY_LOCATION=x86/Agent.tar.gz 1818 1819builds a PPD package that references a binary of the C<Agent> package, 1820located in the C<x86> directory relative to the PPD itself. 1821 1822=item BUILD_REQUIRES 1823 1824Available in version 6.55_03 and above. 1825 1826A hash of modules that are needed to build your module but not run it. 1827 1828This 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>. 1829 1830Defaults to C<<< { "ExtUtils::MakeMaker" => 0 } >>> if this attribute is not specified. 1831 1832The format is the same as PREREQ_PM. 1833 1834=item C 1835 1836Ref to array of *.c file names. Initialised from a directory scan 1837and the values portion of the XS attribute hash. This is not 1838currently used by MakeMaker but may be handy in Makefile.PLs. 1839 1840=item CCFLAGS 1841 1842String that will be included in the compiler call command line between 1843the arguments INC and OPTIMIZE. 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 1853dlext 1854dlsrc 1855ld 1856lddlflags 1857ldflags 1858libc 1859lib_ext 1860obj_ext 1861ranlib 1862sitelibexp 1863sitearchexp 1864so 1865 1866=item CONFIGURE 1867 1868CODE reference. The subroutine should return a hash reference. The 1869hash may contain further attributes, e.g. {LIBS =E<gt> ...}, that have to 1870be determined by some evaluation method. 1871 1872=item CONFIGURE_REQUIRES 1873 1874Available in version 6.52 and above. 1875 1876A hash of modules that are required to run Makefile.PL itself, but not 1877to run your distribution. 1878 1879This 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>. 1880 1881Defaults to C<<< { "ExtUtils::MakeMaker" => 0 } >>> if this attribute is not specified. 1882 1883The format is the same as PREREQ_PM. 1884 1885=item DEFINE 1886 1887Something like C<"-DHAVE_UNISTD_H"> 1888 1889=item DESTDIR 1890 1891This is the root directory into which the code will be installed. It 1892I<prepends itself to the normal prefix>. For example, if your code 1893would normally go into F</usr/local/lib/perl> you could set DESTDIR=~/tmp/ 1894and installation would go into F<~/tmp/usr/local/lib/perl>. 1895 1896This is primarily of use for people who repackage Perl modules. 1897 1898NOTE: Due to the nature of make, it is important that you put the trailing 1899slash on your DESTDIR. F<~/tmp/> not F<~/tmp>. 1900 1901=item DIR 1902 1903Ref to array of subdirectories containing Makefile.PLs e.g. ['sdbm'] 1904in ext/SDBM_File 1905 1906=item DISTNAME 1907 1908A safe filename for the package. 1909 1910Defaults to NAME below but with :: replaced with -. 1911 1912For example, Foo::Bar becomes Foo-Bar. 1913 1914=item DISTVNAME 1915 1916Your name for distributing the package with the version number 1917included. This is used by 'make dist' to name the resulting archive 1918file. 1919 1920Defaults to DISTNAME-VERSION. 1921 1922For example, version 1.04 of Foo::Bar becomes Foo-Bar-1.04. 1923 1924On some OS's where . has special meaning VERSION_SYM may be used in 1925place of VERSION. 1926 1927=item DLEXT 1928 1929Specifies the extension of the module's loadable object. For example: 1930 1931 DLEXT => 'unusual_ext', # Default value is $Config{so} 1932 1933NOTE: When using this option to alter the extension of a module's 1934loadable object, it is also necessary that the module's pm file 1935specifies the same change: 1936 1937 local $DynaLoader::dl_dlext = 'unusual_ext'; 1938 1939=item DL_FUNCS 1940 1941Hashref of symbol names for routines to be made available as universal 1942symbols. Each key/value pair consists of the package name and an 1943array of routine names in that package. Used only under AIX, OS/2, 1944VMS and Win32 at present. The routine names supplied will be expanded 1945in the same way as XSUB names are expanded by the XS() macro. 1946Defaults to 1947 1948 {"$(NAME)" => ["boot_$(NAME)" ] } 1949 1950e.g. 1951 1952 {"RPC" => [qw( boot_rpcb rpcb_gettime getnetconfigent )], 1953 "NetconfigPtr" => [ 'DESTROY'] } 1954 1955Please see the L<ExtUtils::Mksymlists> documentation for more information 1956about the DL_FUNCS, DL_VARS and FUNCLIST attributes. 1957 1958=item DL_VARS 1959 1960Array of symbol names for variables to be made available as universal symbols. 1961Used only under AIX, OS/2, VMS and Win32 at present. Defaults to []. 1962(e.g. [ qw(Foo_version Foo_numstreams Foo_tree ) ]) 1963 1964=item EXCLUDE_EXT 1965 1966Array of extension names to exclude when doing a static build. This 1967is ignored if INCLUDE_EXT is present. Consult INCLUDE_EXT for more 1968details. (e.g. [ qw( Socket POSIX ) ] ) 1969 1970This attribute may be most useful when specified as a string on the 1971command line: perl Makefile.PL EXCLUDE_EXT='Socket Safe' 1972 1973=item EXE_FILES 1974 1975Ref to array of executable files. The files will be copied to the 1976INST_SCRIPT directory. Make realclean will delete them from there 1977again. 1978 1979If your executables start with something like #!perl or 1980#!/usr/bin/perl MakeMaker will change this to the path of the perl 1981'Makefile.PL' was invoked with so the programs will be sure to run 1982properly even if perl is not in /usr/bin/perl. 1983 1984=item FIRST_MAKEFILE 1985 1986The name of the Makefile to be produced. This is used for the second 1987Makefile that will be produced for the MAP_TARGET. 1988 1989Defaults to 'Makefile' or 'Descrip.MMS' on VMS. 1990 1991(Note: we couldn't use MAKEFILE because dmake uses this for something 1992else). 1993 1994=item FULLPERL 1995 1996Perl binary able to run this extension, load XS modules, etc... 1997 1998=item FULLPERLRUN 1999 2000Like PERLRUN, except it uses FULLPERL. 2001 2002=item FULLPERLRUNINST 2003 2004Like PERLRUNINST, except it uses FULLPERL. 2005 2006=item FUNCLIST 2007 2008This provides an alternate means to specify function names to be 2009exported from the extension. Its value is a reference to an 2010array of function names to be exported by the extension. These 2011names are passed through unaltered to the linker options file. 2012 2013=item H 2014 2015Ref to array of *.h file names. Similar to C. 2016 2017=item IMPORTS 2018 2019This attribute is used to specify names to be imported into the 2020extension. Takes a hash ref. 2021 2022It is only used on OS/2 and Win32. 2023 2024=item INC 2025 2026Include file dirs eg: C<"-I/usr/5include -I/path/to/inc"> 2027 2028=item INCLUDE_EXT 2029 2030Array of extension names to be included when doing a static build. 2031MakeMaker will normally build with all of the installed extensions when 2032doing a static build, and that is usually the desired behavior. If 2033INCLUDE_EXT is present then MakeMaker will build only with those extensions 2034which are explicitly mentioned. (e.g. [ qw( Socket POSIX ) ]) 2035 2036It is not necessary to mention DynaLoader or the current extension when 2037filling in INCLUDE_EXT. If the INCLUDE_EXT is mentioned but is empty then 2038only DynaLoader and the current extension will be included in the build. 2039 2040This attribute may be most useful when specified as a string on the 2041command line: perl Makefile.PL INCLUDE_EXT='POSIX Socket Devel::Peek' 2042 2043=item INSTALLARCHLIB 2044 2045Used by 'make install', which copies files from INST_ARCHLIB to this 2046directory if INSTALLDIRS is set to perl. 2047 2048=item INSTALLBIN 2049 2050Directory to install binary files (e.g. tkperl) into if 2051INSTALLDIRS=perl. 2052 2053=item INSTALLDIRS 2054 2055Determines which of the sets of installation directories to choose: 2056perl, site or vendor. Defaults to site. 2057 2058=item INSTALLMAN1DIR 2059 2060=item INSTALLMAN3DIR 2061 2062These directories get the man pages at 'make install' time if 2063INSTALLDIRS=perl. Defaults to $Config{installman*dir}. 2064 2065If set to 'none', no man pages will be installed. 2066 2067=item INSTALLPRIVLIB 2068 2069Used by 'make install', which copies files from INST_LIB to this 2070directory if INSTALLDIRS is set to perl. 2071 2072Defaults to $Config{installprivlib}. 2073 2074=item INSTALLSCRIPT 2075 2076Available in version 6.30_02 and above. 2077 2078Used by 'make install' which copies files from INST_SCRIPT to this 2079directory if INSTALLDIRS=perl. 2080 2081=item INSTALLSITEARCH 2082 2083Used by 'make install', which copies files from INST_ARCHLIB to this 2084directory if INSTALLDIRS is set to site (default). 2085 2086=item INSTALLSITEBIN 2087 2088Used by 'make install', which copies files from INST_BIN to this 2089directory if INSTALLDIRS is set to site (default). 2090 2091=item INSTALLSITELIB 2092 2093Used by 'make install', which copies files from INST_LIB to this 2094directory if INSTALLDIRS is set to site (default). 2095 2096=item INSTALLSITEMAN1DIR 2097 2098=item INSTALLSITEMAN3DIR 2099 2100These directories get the man pages at 'make install' time if 2101INSTALLDIRS=site (default). Defaults to 2102$(SITEPREFIX)/man/man$(MAN*EXT). 2103 2104If set to 'none', no man pages will be installed. 2105 2106=item INSTALLSITESCRIPT 2107 2108Used by 'make install' which copies files from INST_SCRIPT to this 2109directory if INSTALLDIRS is set to site (default). 2110 2111=item INSTALLVENDORARCH 2112 2113Used by 'make install', which copies files from INST_ARCHLIB to this 2114directory if INSTALLDIRS is set to vendor. Note that if you do not set 2115this, the value of INSTALLVENDORLIB will be used, which is probably not 2116what you want. 2117 2118=item INSTALLVENDORBIN 2119 2120Used by 'make install', which copies files from INST_BIN to this 2121directory if INSTALLDIRS is set to vendor. 2122 2123=item INSTALLVENDORLIB 2124 2125Used by 'make install', which copies files from INST_LIB to this 2126directory if INSTALLDIRS is set to vendor. 2127 2128=item INSTALLVENDORMAN1DIR 2129 2130=item INSTALLVENDORMAN3DIR 2131 2132These directories get the man pages at 'make install' time if 2133INSTALLDIRS=vendor. Defaults to $(VENDORPREFIX)/man/man$(MAN*EXT). 2134 2135If set to 'none', no man pages will be installed. 2136 2137=item INSTALLVENDORSCRIPT 2138 2139Available in version 6.30_02 and above. 2140 2141Used by 'make install' which copies files from INST_SCRIPT to this 2142directory if INSTALLDIRS is set to vendor. 2143 2144=item INST_ARCHLIB 2145 2146Same as INST_LIB for architecture dependent files. 2147 2148=item INST_BIN 2149 2150Directory to put real binary files during 'make'. These will be copied 2151to INSTALLBIN during 'make install' 2152 2153=item INST_LIB 2154 2155Directory where we put library files of this extension while building 2156it. 2157 2158=item INST_MAN1DIR 2159 2160Directory to hold the man pages at 'make' time 2161 2162=item INST_MAN3DIR 2163 2164Directory to hold the man pages at 'make' time 2165 2166=item INST_SCRIPT 2167 2168Directory where executable files should be installed during 2169'make'. Defaults to "./blib/script", just to have a dummy location during 2170testing. make install will copy the files in INST_SCRIPT to 2171INSTALLSCRIPT. 2172 2173=item LD 2174 2175Program to be used to link libraries for dynamic loading. 2176 2177Defaults to $Config{ld}. 2178 2179=item LDDLFLAGS 2180 2181Any special flags that might need to be passed to ld to create a 2182shared library suitable for dynamic loading. It is up to the makefile 2183to use it. (See L<Config/lddlflags>) 2184 2185Defaults to $Config{lddlflags}. 2186 2187=item LDFROM 2188 2189Defaults to "$(OBJECT)" and is used in the ld command to specify 2190what files to link/load from (also see dynamic_lib below for how to 2191specify ld flags) 2192 2193=item LIB 2194 2195LIB should only be set at C<perl Makefile.PL> time but is allowed as a 2196MakeMaker argument. It has the effect of setting both INSTALLPRIVLIB 2197and INSTALLSITELIB to that value regardless any explicit setting of 2198those arguments (or of PREFIX). INSTALLARCHLIB and INSTALLSITEARCH 2199are set to the corresponding architecture subdirectory. 2200 2201=item LIBPERL_A 2202 2203The filename of the perllibrary that will be used together with this 2204extension. Defaults to libperl.a. 2205 2206=item LIBS 2207 2208An anonymous array of alternative library 2209specifications to be searched for (in order) until 2210at least one library is found. E.g. 2211 2212 'LIBS' => ["-lgdbm", "-ldbm -lfoo", "-L/path -ldbm.nfs"] 2213 2214Mind, that any element of the array 2215contains a complete set of arguments for the ld 2216command. So do not specify 2217 2218 'LIBS' => ["-ltcl", "-ltk", "-lX11"] 2219 2220See ODBM_File/Makefile.PL for an example, where an array is needed. If 2221you specify a scalar as in 2222 2223 'LIBS' => "-ltcl -ltk -lX11" 2224 2225MakeMaker will turn it into an array with one element. 2226 2227=item LICENSE 2228 2229Available in version 6.31 and above. 2230 2231The licensing terms of your distribution. Generally it's "perl_5" for the 2232same license as Perl itself. 2233 2234See L<CPAN::Meta::Spec> for the list of options. 2235 2236Defaults to "unknown". 2237 2238=item LINKTYPE 2239 2240'static' or 'dynamic' (default unless usedl=undef in 2241config.sh). Should only be used to force static linking (also see 2242linkext below). 2243 2244=item MAGICXS 2245 2246Available in version 6.8305 and above. 2247 2248When this is set to C<1>, C<OBJECT> will be automagically derived from 2249C<O_FILES>. 2250 2251=item MAKE 2252 2253Available in version 6.30_01 and above. 2254 2255Variant of make you intend to run the generated Makefile with. This 2256parameter lets Makefile.PL know what make quirks to account for when 2257generating the Makefile. 2258 2259MakeMaker also honors the MAKE environment variable. This parameter 2260takes precedence. 2261 2262Currently the only significant values are 'dmake' and 'nmake' for Windows 2263users, instructing MakeMaker to generate a Makefile in the flavour of 2264DMake ("Dennis Vadura's Make") or Microsoft NMake respectively. 2265 2266Defaults to $Config{make}, which may go looking for a Make program 2267in your environment. 2268 2269How are you supposed to know what flavour of Make a Makefile has 2270been generated for if you didn't specify a value explicitly? Search 2271the generated Makefile for the definition of the MAKE variable, 2272which is used to recursively invoke the Make utility. That will tell 2273you what Make you're supposed to invoke the Makefile with. 2274 2275=item MAKEAPERL 2276 2277Boolean which tells MakeMaker that it should include the rules to 2278make a perl. This is handled automatically as a switch by 2279MakeMaker. The user normally does not need it. 2280 2281=item MAKEFILE_OLD 2282 2283When 'make clean' or similar is run, the $(FIRST_MAKEFILE) will be 2284backed up at this location. 2285 2286Defaults to $(FIRST_MAKEFILE).old or $(FIRST_MAKEFILE)_old on VMS. 2287 2288=item MAN1PODS 2289 2290Hashref of pod-containing files. MakeMaker will default this to all 2291EXE_FILES files that include POD directives. The files listed 2292here will be converted to man pages and installed as was requested 2293at Configure time. 2294 2295This hash should map POD files (or scripts containing POD) to the 2296man file names under the C<blib/man1/> directory, as in the following 2297example: 2298 2299 MAN1PODS => { 2300 'doc/command.pod' => 'blib/man1/command.1', 2301 'scripts/script.pl' => 'blib/man1/script.1', 2302 } 2303 2304=item MAN3PODS 2305 2306Hashref that assigns to *.pm and *.pod files the files into which the 2307manpages are to be written. MakeMaker parses all *.pod and *.pm files 2308for POD directives. Files that contain POD will be the default keys of 2309the MAN3PODS hashref. These will then be converted to man pages during 2310C<make> and will be installed during C<make install>. 2311 2312Example similar to MAN1PODS. 2313 2314=item MAP_TARGET 2315 2316If it is intended that a new perl binary be produced, this variable 2317may hold a name for that binary. Defaults to perl 2318 2319=item META_ADD 2320 2321=item META_MERGE 2322 2323Available in version 6.46 and above. 2324 2325A hashref of items to add to the CPAN Meta file (F<META.yml> or 2326F<META.json>). 2327 2328They differ in how they behave if they have the same key as the 2329default metadata. META_ADD will override the default value with its 2330own. META_MERGE will merge its value with the default. 2331 2332Unless you want to override the defaults, prefer META_MERGE so as to 2333get the advantage of any future defaults. 2334 2335Where prereqs are concerned, if META_MERGE is used, prerequisites are merged 2336with their counterpart C<WriteMakefile()> argument 2337(PREREQ_PM is merged into {prereqs}{runtime}{requires}, 2338BUILD_REQUIRES into C<{prereqs}{build}{requires}>, 2339CONFIGURE_REQUIRES into C<{prereqs}{configure}{requires}>, 2340and TEST_REQUIRES into C<{prereqs}{test}{requires})>. 2341When prereqs are specified with META_ADD, the only prerequisites added to the 2342file come from the metadata, not C<WriteMakefile()> arguments. 2343 2344Note that these configuration options are only used for generating F<META.yml> 2345and F<META.json> -- they are NOT used for F<MYMETA.yml> and F<MYMETA.json>. 2346Therefore data in these fields should NOT be used for dynamic (user-side) 2347configuration. 2348 2349By default CPAN Meta specification C<1.4> is used. In order to use 2350CPAN Meta specification C<2.0>, indicate with C<meta-spec> the version 2351you want to use. 2352 2353 META_MERGE => { 2354 2355 "meta-spec" => { version => 2 }, 2356 2357 resources => { 2358 2359 repository => { 2360 type => 'git', 2361 url => 'git://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker.git', 2362 web => 'https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker', 2363 }, 2364 2365 }, 2366 2367 }, 2368 2369=item MIN_PERL_VERSION 2370 2371Available in version 6.48 and above. 2372 2373The minimum required version of Perl for this distribution. 2374 2375Either the 5.006001 or the 5.6.1 format is acceptable. 2376 2377=item MYEXTLIB 2378 2379If the extension links to a library that it builds, set this to the 2380name of the library (see SDBM_File) 2381 2382=item NAME 2383 2384The package representing the distribution. For example, C<Test::More> 2385or C<ExtUtils::MakeMaker>. It will be used to derive information about 2386the distribution such as the L</DISTNAME>, installation locations 2387within the Perl library and where XS files will be looked for by 2388default (see L</XS>). 2389 2390C<NAME> I<must> be a valid Perl package name and it I<must> have an 2391associated C<.pm> file. For example, C<Foo::Bar> is a valid C<NAME> 2392and there must exist F<Foo/Bar.pm>. Any XS code should be in 2393F<Bar.xs> unless stated otherwise. 2394 2395Your distribution B<must> have a C<NAME>. 2396 2397=item NEEDS_LINKING 2398 2399MakeMaker will figure out if an extension contains linkable code 2400anywhere down the directory tree, and will set this variable 2401accordingly, but you can speed it up a very little bit if you define 2402this boolean variable yourself. 2403 2404=item NOECHO 2405 2406Command so make does not print the literal commands it's running. 2407 2408By setting it to an empty string you can generate a Makefile that 2409prints all commands. Mainly used in debugging MakeMaker itself. 2410 2411Defaults to C<@>. 2412 2413=item NORECURS 2414 2415Boolean. Attribute to inhibit descending into subdirectories. 2416 2417=item NO_META 2418 2419When true, suppresses the generation and addition to the MANIFEST of 2420the META.yml and META.json module meta-data files during 'make distdir'. 2421 2422Defaults to false. 2423 2424=item NO_MYMETA 2425 2426Available in version 6.57_02 and above. 2427 2428When true, suppresses the generation of MYMETA.yml and MYMETA.json module 2429meta-data files during 'perl Makefile.PL'. 2430 2431Defaults to false. 2432 2433=item NO_PACKLIST 2434 2435Available in version 6.7501 and above. 2436 2437When true, suppresses the writing of C<packlist> files for installs. 2438 2439Defaults to false. 2440 2441=item NO_PERLLOCAL 2442 2443Available in version 6.7501 and above. 2444 2445When true, suppresses the appending of installations to C<perllocal>. 2446 2447Defaults to false. 2448 2449=item NO_VC 2450 2451In general, any generated Makefile checks for the current version of 2452MakeMaker and the version the Makefile was built under. If NO_VC is 2453set, the version check is neglected. Do not write this into your 2454Makefile.PL, use it interactively instead. 2455 2456=item OBJECT 2457 2458List of object files, defaults to '$(BASEEXT)$(OBJ_EXT)', but can be a long 2459string or an array containing all object files, e.g. "tkpBind.o 2460tkpButton.o tkpCanvas.o" or ["tkpBind.o", "tkpButton.o", "tkpCanvas.o"] 2461 2462(Where BASEEXT is the last component of NAME, and OBJ_EXT is $Config{obj_ext}.) 2463 2464=item OPTIMIZE 2465 2466Defaults to C<-O>. Set it to C<-g> to turn debugging on. The flag is 2467passed to subdirectory makes. 2468 2469=item PERL 2470 2471Perl binary for tasks that can be done by miniperl. If it contains 2472spaces or other shell metacharacters, it needs to be quoted in a way 2473that protects them, since this value is intended to be inserted in a 2474shell command line in the Makefile. E.g.: 2475 2476 # Perl executable lives in "C:/Program Files/Perl/bin" 2477 # Normally you don't need to set this yourself! 2478 $ perl Makefile.PL PERL='"C:/Program Files/Perl/bin/perl.exe" -w' 2479 2480=item PERL_CORE 2481 2482Set only when MakeMaker is building the extensions of the Perl core 2483distribution. 2484 2485=item PERLMAINCC 2486 2487The call to the program that is able to compile perlmain.c. Defaults 2488to $(CC). 2489 2490=item PERL_ARCHLIB 2491 2492Same as for PERL_LIB, but for architecture dependent files. 2493 2494Used only when MakeMaker is building the extensions of the Perl core 2495distribution (because normally $(PERL_ARCHLIB) is automatically in @INC, 2496and adding it would get in the way of PERL5LIB). 2497 2498=item PERL_LIB 2499 2500Directory containing the Perl library to use. 2501 2502Used only when MakeMaker is building the extensions of the Perl core 2503distribution (because normally $(PERL_LIB) is automatically in @INC, 2504and adding it would get in the way of PERL5LIB). 2505 2506=item PERL_MALLOC_OK 2507 2508defaults to 0. Should be set to TRUE if the extension can work with 2509the memory allocation routines substituted by the Perl malloc() subsystem. 2510This should be applicable to most extensions with exceptions of those 2511 2512=over 4 2513 2514=item * 2515 2516with bugs in memory allocations which are caught by Perl's malloc(); 2517 2518=item * 2519 2520which interact with the memory allocator in other ways than via 2521malloc(), realloc(), free(), calloc(), sbrk() and brk(); 2522 2523=item * 2524 2525which rely on special alignment which is not provided by Perl's malloc(). 2526 2527=back 2528 2529B<NOTE.> Neglecting to set this flag in I<any one> of the loaded extension 2530nullifies many advantages of Perl's malloc(), such as better usage of 2531system resources, error detection, memory usage reporting, catchable failure 2532of memory allocations, etc. 2533 2534=item PERLPREFIX 2535 2536Directory under which core modules are to be installed. 2537 2538Defaults to $Config{installprefixexp}, falling back to 2539$Config{installprefix}, $Config{prefixexp} or $Config{prefix} should 2540$Config{installprefixexp} not exist. 2541 2542Overridden by PREFIX. 2543 2544=item PERLRUN 2545 2546Use this instead of $(PERL) when you wish to run perl. It will set up 2547extra necessary flags for you. 2548 2549=item PERLRUNINST 2550 2551Use this instead of $(PERL) when you wish to run perl to work with 2552modules. It will add things like -I$(INST_ARCH) and other necessary 2553flags so perl can see the modules you're about to install. 2554 2555=item PERL_SRC 2556 2557Directory containing the Perl source code (use of this should be 2558avoided, it may be undefined) 2559 2560=item PERM_DIR 2561 2562Available in version 6.51_01 and above. 2563 2564Desired permission for directories. Defaults to C<755>. 2565 2566=item PERM_RW 2567 2568Desired permission for read/writable files. Defaults to C<644>. 2569 2570=item PERM_RWX 2571 2572Desired permission for executable files. Defaults to C<755>. 2573 2574=item PL_FILES 2575 2576MakeMaker can run programs to generate files for you at build time. 2577By default any file named *.PL (except Makefile.PL and Build.PL) in 2578the top level directory will be assumed to be a Perl program and run 2579passing its own basename in as an argument. This basename is actually a build 2580target, and there is an intention, but not a requirement, that the *.PL file 2581make the file passed to to as an argument. For example... 2582 2583 perl foo.PL foo 2584 2585This behavior can be overridden by supplying your own set of files to 2586search. PL_FILES accepts a hash ref, the key being the file to run 2587and the value is passed in as the first argument when the PL file is run. 2588 2589 PL_FILES => {'bin/foobar.PL' => 'bin/foobar'} 2590 2591 PL_FILES => {'foo.PL' => 'foo.c'} 2592 2593Would run bin/foobar.PL like this: 2594 2595 perl bin/foobar.PL bin/foobar 2596 2597If multiple files from one program are desired an array ref can be used. 2598 2599 PL_FILES => {'bin/foobar.PL' => [qw(bin/foobar1 bin/foobar2)]} 2600 2601In this case the program will be run multiple times using each target file. 2602 2603 perl bin/foobar.PL bin/foobar1 2604 perl bin/foobar.PL bin/foobar2 2605 2606If an output file depends on extra input files beside the script itself, 2607a hash ref can be used in version 7.36 and above: 2608 2609 PL_FILES => { 'foo.PL' => { 2610 'foo.out' => 'foo.in', 2611 'bar.out' => [qw(bar1.in bar2.in)], 2612 } 2613 2614In this case the extra input files will be passed to the program after 2615the target file: 2616 2617 perl foo.PL foo.out foo.in 2618 perl foo.PL bar.out bar1.in bar2.in 2619 2620PL files are normally run B<after> pm_to_blib and include INST_LIB and 2621INST_ARCH in their C<@INC>, so the just built modules can be 2622accessed... unless the PL file is making a module (or anything else in 2623PM) in which case it is run B<before> pm_to_blib and does not include 2624INST_LIB and INST_ARCH in its C<@INC>. This apparently odd behavior 2625is there for backwards compatibility (and it's somewhat DWIM). The argument 2626passed to the .PL is set up as a target to build in the Makefile. In other 2627sections such as C<postamble> you can specify a dependency on the 2628filename/argument that the .PL is supposed (or will have, now that that is 2629is a dependency) to generate. Note the file to be generated will still be 2630generated and the .PL will still run even without an explicit dependency created 2631by you, since the C<all> target still depends on running all eligible to run.PL 2632files. 2633 2634=item PM 2635 2636Hashref of .pm files and *.pl files to be installed. e.g. 2637 2638 {'name_of_file.pm' => '$(INST_LIB)/install_as.pm'} 2639 2640By default this will include *.pm and *.pl and the files found in 2641the PMLIBDIRS directories. Defining PM in the 2642Makefile.PL will override PMLIBDIRS. 2643 2644=item PMLIBDIRS 2645 2646Ref to array of subdirectories containing library files. Defaults to 2647[ 'lib', $(BASEEXT) ]. The directories will be scanned and I<any> files 2648they contain will be installed in the corresponding location in the 2649library. A libscan() method can be used to alter the behaviour. 2650Defining PM in the Makefile.PL will override PMLIBDIRS. 2651 2652(Where BASEEXT is the last component of NAME.) 2653 2654=item PM_FILTER 2655 2656A filter program, in the traditional Unix sense (input from stdin, output 2657to stdout) that is passed on each .pm file during the build (in the 2658pm_to_blib() phase). It is empty by default, meaning no filtering is done. 2659You could use: 2660 2661 PM_FILTER => 'perl -ne "print unless /^\\#/"', 2662 2663to remove all the leading comments on the fly during the build. In order 2664to be as portable as possible, please consider using a Perl one-liner 2665rather than Unix (or other) utilities, as above. The # is escaped for 2666the Makefile, since what is going to be generated will then be: 2667 2668 PM_FILTER = perl -ne "print unless /^\#/" 2669 2670Without the \ before the #, we'd have the start of a Makefile comment, 2671and the macro would be incorrectly defined. 2672 2673You will almost certainly be better off using the C<PL_FILES> system, 2674instead. See above, or the L<ExtUtils::MakeMaker::FAQ> entry. 2675 2676=item POLLUTE 2677 2678Release 5.005 grandfathered old global symbol names by providing preprocessor 2679macros for extension source compatibility. As of release 5.6, these 2680preprocessor definitions are not available by default. The POLLUTE flag 2681specifies that the old names should still be defined: 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<-protoypes>, 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