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