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