1 require 5.002; # MakeMaker 5.17 was the last MakeMaker that was compatible with perl5.001m
6 package ExtUtils::MakeMaker::TieAtt;
7 # this package will go away again, when we don't have modules around
8 # anymore that import %att It ties an empty %att and records in which
9 # object this %att was tied. FETCH and STORE return/store-to the
10 # appropriate value from %$self
12 # the warndirectuse method warns if somebody calls MM->something. It
13 # has nothing to do with the tie'd %att.
17 package ExtUtils::MakeMaker;
19 $Version = $VERSION = "5.26";
20 $Version_OK = "5.05"; # Makefiles older than $Version_OK will die
21 # (Will be checked from MakeMaker version 4.13 onwards)
22 ($Revision = substr(q$Revision: 1.187 $, 10)) =~ s/\s+$//;
32 $VERSION $Version_OK $Revision
33 $Verbose %MM_Sections $ISA_TTY
34 @MM_Sections %Recognized_Att_Keys @Get_from_Config
35 %Prepend_dot_dot %Config @Parent %NORMAL_INC
36 $Setup_done %Keep_after_flush
41 eval {require DynaLoader;}; # Get mod2fname, if defined. Will fail
45 # Set up the inheritance before we pull in the MM_* packages, because they
46 # import variables and functions from here
49 @EXPORT = qw(&WriteMakefile &writeMakefile $Verbose &prompt);
50 @EXPORT_OK = qw($VERSION &Version_check &neatvalue &mkbootstrap &mksymlists
51 $Version %att); ## Import of %att is deprecated, please use OO features!
52 # $Version in mixed case will go away!
55 # Dummy package MM inherits actual methods from OS-specific
56 # default packages. We use this intermediate package so
57 # MY::XYZ->func() can call MM->func() and get the proper
58 # default routine without having to know under what OS
61 @MM::ISA = qw[ExtUtils::MM_Unix ExtUtils::Liblist ExtUtils::MakeMaker];
64 # Setup dummy package:
65 # MY exists for overriding methods to be defined within
74 # "predeclare the package: we only load it via AUTOLOAD
75 # but we have already mentioned it in @ISA
76 package ExtUtils::Liblist;
78 package ExtUtils::MakeMaker;
80 # Now we can can pull in the friends
82 $Is_VMS = $^O eq 'VMS';
83 $Is_OS2 = $^O eq 'os2';
85 require ExtUtils::MM_Unix;
88 require ExtUtils::MM_VMS;
91 require ExtUtils::MM_OS2;
95 @NORMAL_INC{qw|File/Find.pm Cwd.pm ExtUtils/Manifest.pm ExtUtils/Liblist.pm|} = (1) x 4;
98 # This has to go one day...
99 $SIG{__WARN__} = sub {
100 $_[0] =~ /^Use of uninitialized value/ && return;
101 $_[0] =~ /used only once/ && return;
102 $_[0] =~ /^Subroutine\s+[\w:]+\s+redefined/ && return;
106 # The SelfLoader would bring a lot of overhead for MakeMaker, because
107 # we know for sure we will use most of the autoloaded functions once
108 # we have to use one of them. So we write our own loader
112 if (defined fileno(DATA)) {
124 warn "AUTOLOAD called unexpectedly for $AUTOLOAD";
126 defined(&$AUTOLOAD) or die "Myloader inconsistency error";
130 # The only subroutine we do not SelfLoad is Version_Check because it's
131 # called so often. Loading this minimum still requires 1.2 secs on my
135 my($checkversion) = @_;
136 die "Your Makefile was built with ExtUtils::MakeMaker v $checkversion.
137 Current Version is $ExtUtils::MakeMaker::VERSION. There have been considerable
138 changes in the meantime.
139 Please rerun 'perl Makefile.PL' to regenerate the Makefile.\n"
140 if $checkversion < $Version_OK;
141 printf STDOUT "%s %s %s %s.\n", "Makefile built with ExtUtils::MakeMaker v",
142 $checkversion, "Current Version is", $VERSION
143 unless $checkversion == $VERSION;
146 sub ExtUtils::MakeMaker::eval_in_subdirs ;
147 sub ExtUtils::MakeMaker::eval_in_x ;
148 sub ExtUtils::MakeMaker::full_setup ;
149 sub ExtUtils::MakeMaker::writeMakefile ;
150 sub ExtUtils::MakeMaker::new ;
151 sub ExtUtils::MakeMaker::check_manifest ;
152 sub ExtUtils::MakeMaker::parse_args ;
153 sub ExtUtils::MakeMaker::check_hints ;
154 sub ExtUtils::MakeMaker::mv_all_methods ;
155 sub ExtUtils::MakeMaker::skipcheck ;
156 sub ExtUtils::MakeMaker::flush ;
157 sub ExtUtils::MakeMaker::mkbootstrap ;
158 sub ExtUtils::MakeMaker::mksymlists ;
159 sub ExtUtils::MakeMaker::neatvalue ;
160 sub ExtUtils::MakeMaker::selfdocument ;
161 sub ExtUtils::MakeMaker::WriteMakefile ;
162 sub ExtUtils::MakeMaker::prompt ;
163 sub ExtUtils::MakeMaker::TieAtt::TIEHASH ;
164 sub ExtUtils::MakeMaker::TieAtt::FETCH ;
165 sub ExtUtils::MakeMaker::TieAtt::STORE ;
166 sub ExtUtils::MakeMaker::TieAtt::FIRSTKEY ;
167 sub ExtUtils::MakeMaker::TieAtt::NEXTKEY ;
168 sub ExtUtils::MakeMaker::TieAtt::DESTROY ;
169 sub ExtUtils::MakeMaker::TieAtt::warndirectuse ;
172 package ExtUtils::MakeMaker;
175 Carp::croak "WriteMakefile: Need even number of args" if @_ % 2;
176 unless ($Setup_done++){
178 undef &ExtUtils::MakeMaker::full_setup; #safe memory
181 MM->new(\%att)->flush;
186 $ISA_TTY = -t STDIN && -t STDOUT ;
187 Carp::confess("prompt function called without an argument") unless defined $mess;
188 $def = "" unless defined $def;
189 my $dispdef = "[$def] ";
193 print "$mess $dispdef";
194 chop($ans = <STDIN>);
196 return $ans if defined $ans;
200 sub eval_in_subdirs {
206 foreach $dir (@{$self->{DIR}}){
207 my($abs) = $self->catdir($pwd,$dir);
208 $self->eval_in_x($abs);
216 chdir $dir or Carp::carp("Couldn't change to directory $dir: $!");
218 # my $fh = new FileHandle;
219 # $fh->open("Makefile.PL") or Carp::carp("Couldn't open Makefile.PL in $dir");
221 open(FH,"Makefile.PL") or Carp::carp("Couldn't open Makefile.PL in $dir");
222 # my $eval = join "", <$fh>;
223 my $eval = join "", <FH>;
227 warn "WARNING from evaluation of $dir/Makefile.PL: $@" if $@;
234 # package name for the classes into which the first object will be blessed
235 $PACKNAME = "PACK000";
239 C CONFIG CONFIGURE DEFINE DIR DISTNAME DL_FUNCS DL_VARS EXE_FILES
240 NO_VC FIRST_MAKEFILE FULLPERL H INC INSTALLARCHLIB INSTALLBIN
241 INSTALLDIRS INSTALLMAN1DIR INSTALLMAN3DIR INSTALLPRIVLIB
242 INSTALLSITEARCH INSTALLSITELIB INST_ARCHLIB INST_EXE INST_LIB
243 INST_MAN1DIR INST_MAN3DIR LDFROM LIBPERL_A LIBS LINKTYPE MAKEAPERL
244 MAKEFILE MAN1PODS MAN3PODS MAP_TARGET MYEXTLIB NAME NEEDS_LINKING
245 NOECHO NORECURS OBJECT OPTIMIZE PERL PERLMAINCC PERL_ARCHLIB
246 PERL_LIB PERL_SRC PL_FILES PM PMLIBDIRS PREFIX PREREQ SKIP
247 TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG XS_VERSION clean
248 depend dist dynamic_lib linkext macro realclean tool_autosplit
255 # @Overridable is close to MM_Sections
260 post_initialize const_config constants tool_autosplit
261 tool_xsubpp tools_other dist macro depend post_constants
262 pasthru c_o xs_c xs_o top_targets linkext dlsyms dynamic
263 dynamic_bs dynamic_lib static static_lib manifypods processPL
264 installbin subdirs clean realclean dist_basics dist_core
265 dist_dir dist_test dist_ci install force perldepend makefile
266 staticmake test postamble
268 ); # loses section ordering
270 @Overridable = @MM_Sections;
271 push @Overridable, qw[ dir_target
273 needs_linking subdir_x test_via_harness
275 push @MM_Sections, qw[
276 pm_to_blib selfdocument cflags const_loadlibs
281 #### Can we drop this?
282 #### @MM_Sections{@MM_Sections} = {} x @MM_Sections;
284 # All sections are valid keys.
285 @Recognized_Att_Keys{@MM_Sections} = (1) x @MM_Sections;
287 # we will use all these variables in the Makefile
290 ar cc cccdlflags ccdlflags dlext dlsrc ld lddlflags ldflags libc
291 lib_ext obj_ext ranlib sitelibexp sitearchexp so
295 foreach $item (@Attrib_help){
296 $Recognized_Att_Keys{$item} = 1;
298 foreach $item (@Get_from_Config) {
299 $Recognized_Att_Keys{uc $item} = $Config{$item};
300 print "Attribute '\U$item\E' => '$Config{$item}'\n"
305 # When we eval a Makefile.PL in a subdirectory, that one will ask
306 # us (the parent) for the values and will prepend "..", so that
307 # all files to be installed end up below OUR ./blib
311 INST_LIB 1 INST_ARCHLIB 1 INST_EXE 1 MAP_TARGET 1 INST_MAN1DIR 1 INST_MAN3DIR 1
312 PERL_SRC 1 PERL 1 FULLPERL 1
316 NEEDS_LINKING HAS_LINK_CODE
318 @Keep_after_flush{@keep} = (1) x @keep;
324 The extension you are trying to build apparently is rather old and
325 most probably outdated. We detect that from the fact, that a
326 subroutine "writeMakefile" is called, and this subroutine is not
327 supported anymore since about October 1994.
329 Please contact the author or look into CPAN (details about CPAN can be
330 found in the FAQ and at http:/www.perl.com) for a more recent version
331 of the extension. If you're really desperate, you can try to change
332 the subroutine name from writeMakefile to WriteMakefile and rerun
333 'perl Makefile.PL', but you're most probably left alone, when you do
341 sub ExtUtils::MakeMaker::new {
342 my($class,$self) = @_;
345 print STDOUT "MakeMaker (v$VERSION)\n" if $Verbose;
346 if (-f "MANIFEST" && ! -f "Makefile"){
350 $self = {} unless (defined $self);
354 my(%initial_att) = %$self; # record initial attributes
356 if (defined $self->{CONFIGURE}) {
357 if (ref $self->{CONFIGURE} eq 'CODE') {
358 $self = { %$self, %{&{$self->{CONFIGURE}}}};
360 Carp::croak "Attribute 'CONFIGURE' to WriteMakefile() not a code reference\n";
364 # This is for old Makefiles written pre 5.00, will go away
365 if ( Carp::longmess("") =~ /runsubdirpl/s ){
366 #$self->{Correct_relativ_directories}++;
367 Carp::carp("WARNING: Please rerun 'perl Makefile.PL' to regenerate your Makefiles\n");
369 $self->{Correct_relativ_directories}=0;
372 my $class = ++$PACKNAME;
375 print "Blessing Object into class [$class]\n" if $Verbose>=2;
376 mv_all_methods("MY",$class);
379 @{"$class\:\:ISA"} = 'MM';
382 if (defined $Parent[-2]){
383 $self->{PARENT} = $Parent[-2];
385 for $key (keys %Prepend_dot_dot) {
386 next unless defined $self->{PARENT}{$key};
387 $self->{$key} = $self->{PARENT}{$key};
388 $self->{$key} = $self->catdir("..",$self->{$key})
389 unless $self->file_name_is_absolute($self->{$key});
391 $self->{PARENT}->{CHILDREN}->{$class} = $self if $self->{PARENT};
393 parse_args($self,@ARGV);
396 $self->{NAME} ||= $self->guess_name;
398 ($self->{NAME_SYM} = $self->{NAME}) =~ s/\W+/_/g;
402 if (! $self->{PERL_SRC} ) {
403 my($pthinks) = $INC{'Config.pm'};
404 $pthinks = VMS::Filespec::vmsify($pthinks) if $Is_VMS;
405 if ($pthinks ne $self->catfile($Config{archlibexp},'Config.pm')){
406 $pthinks =~ s!/Config\.pm$!!;
409 Your perl and your Config.pm seem to have different ideas about the architecture
411 Perl thinks: [$pthinks]
412 Config says: [$Config{archname}]
413 This may or may not cause problems. Please check your installation of perl if you
414 have problems building this extension.
419 $self->init_dirscan();
420 $self->init_others();
422 push @{$self->{RESULT}}, <<END;
423 # This Makefile is for the $self->{NAME} extension to perl.
425 # It was generated automatically by MakeMaker version
426 # $VERSION (Revision: $Revision) from the contents of
427 # Makefile.PL. Don't edit this file, edit Makefile.PL instead.
429 # ANY CHANGES MADE HERE WILL BE LOST!
431 # MakeMaker Parameters:
434 foreach $key (sort keys %initial_att){
435 my($v) = neatvalue($initial_att{$key});
436 $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/;
438 push @{$self->{RESULT}}, "# $key => $v";
441 # turn the SKIP array into a SKIPHASH hash
443 for $skip (@{$self->{SKIP} || []}) {
444 $self->{SKIPHASH}{$skip} = 1;
446 delete $self->{SKIP}; # free memory
448 if ($self->{PARENT}) {
449 for (qw/install dist dist_basics dist_core dist_dir dist_test dist_ci/) {
450 $self->{SKIPHASH}{$_} = 1;
454 # We run all the subdirectories now. They don't have much to query
455 # from the parent, but the parent has to query them: if they need linking!
456 unless ($self->{NORECURS}) {
457 $self->eval_in_subdirs if @{$self->{DIR}};
460 tie %::att, ExtUtils::MakeMaker::TieAtt, $self;
462 foreach $section ( @MM_Sections ){
463 print "Processing Makefile '$section' section\n" if ($Verbose >= 2);
464 my($skipit) = $self->skipcheck($section);
466 push @{$self->{RESULT}}, "\n# --- MakeMaker $section section $skipit.";
468 my(%a) = %{$self->{$section} || {}};
469 push @{$self->{RESULT}}, "\n# --- MakeMaker $section section:";
470 push @{$self->{RESULT}}, "# " . join ", ", %a if $Verbose && %a;
471 push @{$self->{RESULT}}, $self->nicetext($self->$section( %a ));
475 push @{$self->{RESULT}}, "\n# End.";
482 print STDOUT "Checking if your kit is complete...\n";
483 require ExtUtils::Manifest;
484 $ExtUtils::Manifest::Quiet=$ExtUtils::Manifest::Quiet=1; #avoid warning
485 my(@missed)=ExtUtils::Manifest::manicheck();
487 print STDOUT "Warning: the following files are missing in your kit:\n";
488 print "\t", join "\n\t", @missed;
490 print STDOUT "Please inform the author.\n";
492 print STDOUT "Looks good\n";
497 my($self, @args) = @_;
499 unless (m/(.*?)=(.*)/){
500 help(),exit 1 if m/^help$/;
501 ++$Verbose if m/^verb/;
504 my($name, $value) = ($1, $2);
505 if ($value =~ m/^~(\w+)?/){ # tilde with optional username
506 $value =~ s [^~(\w*)]
508 ((getpwnam($1))[7] || "~$1") :
512 # This may go away, in mid 1996
513 if ($self->{Correct_relativ_directories}){
514 $value = $self->catdir("..",$value)
515 if $Prepend_dot_dot{$name} && ! $self->file_name_is_absolute($value);
517 $self->{uc($name)} = $value;
519 # This may go away, in mid 1996
520 delete $self->{Correct_relativ_directories};
522 # catch old-style 'potential_libs' and inform user how to 'upgrade'
523 if (defined $self->{potential_libs}){
524 my($msg)="'potential_libs' => '$self->{potential_libs}' should be";
525 if ($self->{potential_libs}){
526 print STDOUT "$msg changed to:\n\t'LIBS' => ['$self->{potential_libs}']\n";
528 print STDOUT "$msg deleted.\n";
530 $self->{LIBS} = [$self->{potential_libs}];
531 delete $self->{potential_libs};
533 # catch old-style 'ARMAYBE' and inform user how to 'upgrade'
534 if (defined $self->{ARMAYBE}){
535 my($armaybe) = $self->{ARMAYBE};
536 print STDOUT "ARMAYBE => '$armaybe' should be changed to:\n",
537 "\t'dynamic_lib' => {ARMAYBE => '$armaybe'}\n";
538 my(%dl) = %{$self->{dynamic_lib} || {}};
539 $self->{dynamic_lib} = { %dl, ARMAYBE => $armaybe};
540 delete $self->{ARMAYBE};
542 if (defined $self->{LDTARGET}){
543 print STDOUT "LDTARGET should be changed to LDFROM\n";
544 $self->{LDFROM} = $self->{LDTARGET};
545 delete $self->{LDTARGET};
547 # Turn a DIR argument on the command line into an array
548 if (defined $self->{DIR} && ref \$self->{DIR} eq 'SCALAR') {
549 # So they can choose from the command line, which extensions they want
550 # the grep enables them to have some colons too much in case they
551 # have to build a list with the shell
552 $self->{DIR} = [grep $_, split ":", $self->{DIR}];
555 foreach $mmkey (sort keys %$self){
556 print STDOUT " $mmkey => ", neatvalue($self->{$mmkey}), "\n" if $Verbose;
557 print STDOUT "'$mmkey' is not a known MakeMaker parameter name.\n"
558 unless exists $Recognized_Att_Keys{$mmkey};
564 # We allow extension-specific hints files.
566 return unless -d "hints";
568 # First we look for the best hintsfile we have
570 my($hint)="$Config{osname}_$Config{osvers}";
575 # Also try without trailing minor version numbers.
577 last if -f "hints/$hint.pl"; # found
579 last unless $hint =~ s/_[^_]*$//; # nothing to cut off
581 return unless -f "hints/$hint.pl"; # really there
583 # execute the hintsfile:
585 # my $fh = new FileHandle;
586 # $fh->open("hints/$hint.pl");
588 open(FH,"hints/$hint.pl");
589 # @goodhints = <$fh>;
593 print STDOUT "Processing hints file hints/$hint.pl\n";
594 eval join('',@goodhints);
595 print STDOUT $@ if $@;
601 my($symtab) = \%{"${from}::"};
604 # Here you see the *current* list of methods that are overridable
605 # from Makefile.PL via MY:: subroutines. As of VERSION 5.07 I'm
606 # still trying to reduce the list to some reasonable minimum --
607 # because I want to make it easier for the user. A.K.
609 foreach $method (@Overridable) {
611 # We cannot say "next" here. Nick might call MY->makeaperl
612 # which isn't defined right now
614 # Above statement was written at 4.23 time when Tk-b8 was
615 # around. As Tk-b9 only builds with 5.002something and MM 5 is
616 # standard, we try to enable the next line again. It was
617 # commented out until MM 5.23
619 next unless defined &{"${from}::$method"};
621 *{"${to}::$method"} = \&{"${from}::$method"};
623 # delete would do, if we were sure, nobody ever called
624 # MY->makeaperl directly
626 # delete $symtab->{$method};
628 # If we delete a method, then it will be undefined and cannot
629 # be called. But as long as we have Makefile.PLs that rely on
630 # %MY:: being intact, we have to fill the hole with an
633 eval "package MY; sub $method {local *$method; shift->MY::$method(\@_); }";
636 # We have to clean out %INC also, because the current directory is
637 # changed frequently and Graham Barr prefers to get his version
638 # out of a History.pl file which is "required" so woudn't get
639 # loaded again in another extension requiring a History.pl
642 foreach $inc (keys %INC) {
643 next if $NORMAL_INC{$inc};
644 #warn "***$inc*** deleted";
653 if ($section eq 'dynamic') {
654 print STDOUT "Warning (non-fatal): Target 'dynamic' depends on targets ",
655 "in skipped section 'dynamic_bs'\n"
656 if $self->{SKIPHASH}{dynamic_bs} && $Verbose;
657 print STDOUT "Warning (non-fatal): Target 'dynamic' depends on targets ",
658 "in skipped section 'dynamic_lib'\n"
659 if $self->{SKIPHASH}{dynamic_lib} && $Verbose;
661 if ($section eq 'dynamic_lib') {
662 print STDOUT "Warning (non-fatal): Target '\$(INST_DYNAMIC)' depends on ",
663 "targets in skipped section 'dynamic_bs'\n"
664 if $self->{SKIPHASH}{dynamic_bs} && $Verbose;
666 if ($section eq 'static') {
667 print STDOUT "Warning (non-fatal): Target 'static' depends on targets ",
668 "in skipped section 'static_lib'\n"
669 if $self->{SKIPHASH}{static_lib} && $Verbose;
671 return 'skipped' if $self->{SKIPHASH}{$section};
679 # my $fh = new FileHandle;
681 print STDOUT "Writing $self->{MAKEFILE} for $self->{NAME}\n";
683 unlink($self->{MAKEFILE}, "MakeMaker.tmp", $Is_VMS ? 'Descrip.MMS' : '');
684 # $fh->open(">MakeMaker.tmp") or die "Unable to open MakeMaker.tmp: $!";
685 open(FH,">MakeMaker.tmp") or die "Unable to open MakeMaker.tmp: $!";
687 for $chunk (@{$self->{RESULT}}) {
688 # print $fh "$chunk\n";
694 my($finalname) = $self->{MAKEFILE};
695 rename("MakeMaker.tmp", $finalname);
696 chmod 0644, $finalname unless $Is_VMS;
698 if ($self->{PARENT}) {
699 foreach (keys %$self) { # safe memory
700 delete $self->{$_} unless $Keep_after_flush{$_};
704 system("$Config::Config{eunicefix} $finalname") unless $Config::Config{eunicefix} eq ":";
707 # The following mkbootstrap() is only for installations that are calling
708 # the pre-4.1 mkbootstrap() from their old Makefiles. This MakeMaker
709 # writes Makefiles, that use ExtUtils::Mkbootstrap directly.
712 !!! Your Makefile has been built such a long time ago, !!!
713 !!! that is unlikely to work with current MakeMaker. !!!
714 !!! Please rebuild your Makefile !!!
718 # Ditto for mksymlists() as of MakeMaker 5.17
721 !!! Your Makefile has been built such a long time ago, !!!
722 !!! that is unlikely to work with current MakeMaker. !!!
723 !!! Please rebuild your Makefile !!!
729 return "undef" unless defined $v;
731 return "q[$v]" unless $t;
733 my(@m, $elem, @neat);
735 foreach $elem (@$v) {
736 push @neat, "q[$elem]";
738 push @m, join ", ", @neat;
742 return "$v" unless $t eq 'HASH';
744 while (($key,$val) = each %$v){
745 last unless defined $key; # cautious programming in case (undef,undef) is true
746 push(@m,"$key=>".neatvalue($val)) ;
748 return "{ ".join(', ',@m)." }";
755 push @m, "\n# Full list of MakeMaker attribute values:";
756 foreach $key (sort keys %$self){
757 next if $key eq 'RESULT' || $key =~ /^[A-Z][a-z]/;
758 my($v) = neatvalue($self->{$key});
759 $v =~ s/(CODE|HASH|ARRAY|SCALAR)\([\dxa-f]+\)/$1\(...\)/;
761 push @m, "# $key => $v";
767 package ExtUtils::MakeMaker::TieAtt;
770 bless { SECRETHASH => $_[1]};
774 print "Warning (non-fatal): Importing of %att is deprecated [$_[1]]
775 use \$self instead\n" unless ++$Enough>$Enough_limit;
776 print "Further ExtUtils::MakeMaker::TieAtt warnings suppressed\n" if $Enough==$Enough_limit;
777 $_[0]->{SECRETHASH}->{$_[1]};
781 print "Warning (non-fatal): Importing of %att is deprecated [$_[1]][$_[2]]
782 use \$self instead\n" unless ++$Enough>$Enough_limit;
783 print "Further ExtUtils::MakeMaker::TieAtt warnings suppressed\n" if $Enough==$Enough_limit;
784 $_[0]->{SECRETHASH}->{$_[1]} = $_[2];
788 print "Warning (non-fatal): Importing of %att is deprecated [FIRSTKEY]
789 use \$self instead\n" unless ++$Enough>$Enough_limit;
790 print "Further ExtUtils::MakeMaker::TieAtt warnings suppressed\n" if $Enough==$Enough_limit;
791 each %{$_[0]->{SECRETHASH}};
795 each %{$_[0]->{SECRETHASH}};
803 return if $Enough>$Enough_limit;
804 print STDOUT "Warning (non-fatal): Direct use of class methods deprecated; use\n";
805 my($method) = $caller =~ /.*:(\w+)$/;
808 $self->MM::', $method, "();
810 print "Further ExtUtils::MakeMaker::TieAtt warnings suppressed\n"
811 if ++$Enough==$Enough_limit;
814 package ExtUtils::MakeMaker;
821 ExtUtils::MakeMaker - create an extension Makefile
825 C<use ExtUtils::MakeMaker;>
827 C<WriteMakefile( ATTRIBUTE =E<gt> VALUE [, ...] );>
831 C<MM-E<gt>new(\%att)-E<gt>flush;>
835 This utility is designed to write a Makefile for an extension module
836 from a Makefile.PL. It is based on the Makefile.SH model provided by
837 Andy Dougherty and the perl5-porters.
839 It splits the task of generating the Makefile into several subroutines
840 that can be individually overridden. Each subroutine returns the text
841 it wishes to have written to the Makefile.
843 =head2 Hintsfile support
845 MakeMaker.pm uses the architecture specific information from
846 Config.pm. In addition it evaluates architecture specific hints files
847 in a C<hints/> directory. The hints files are expected to be named
848 like their counterparts in C<PERL_SRC/hints>, but with an C<.pl> file
849 name extension (eg. C<next_3_2.pl>). They are simply C<eval>ed by
850 MakeMaker within the WriteMakefile() subroutine, and can be used to
851 execute commands as well as to include special variables. The rules
852 which hintsfile is chosen are the same as in Configure.
854 The hintsfile is eval()ed immediately after the arguments given to
855 WriteMakefile are stuffed into a hash reference $self but before this
856 reference becomes blessed. So if you want to do the equivalent to
857 override or create an attribute you would say something like
859 $self->{LIBS} = ['-ldbm -lucb -lc'];
861 =head2 What's new in version 5 of MakeMaker
863 MakeMaker 5 is pure object oriented. This allows us to write an
864 unlimited number of Makefiles with a single perl process. 'perl
865 Makefile.PL' with MakeMaker 5 goes through all subdirectories
866 immediately and evaluates any Makefile.PL found in the next level
867 subdirectories. The benefit of this approach comes in useful for both
868 single and multi directories extensions.
870 Multi directory extensions have an immediately visible speed
871 advantage, because there's no startup penalty for any single
872 subdirectory Makefile.
874 Single directory packages benefit from the much improved
875 needs_linking() method. As the main Makefile knows everything about
876 the subdirectories, a needs_linking() method can now query all
877 subdirectories if there is any linking involved down in the tree. The
878 speedup for PM-only Makefiles seems to be around 1 second on my
881 =head2 Incompatibilities between MakeMaker 5.00 and 4.23
883 There are no incompatibilities in the short term, as all changes are
884 accompanied by short-term workarounds that guarantee full backwards
887 You are likely to face a few warnings that expose deprecations which
888 will result in incompatibilities in the long run:
890 You should not use %att directly anymore. Instead any subroutine you
891 override in the MY package will be called by the object method, so you
892 can access all object attributes directly via the object in $_[0].
894 You should not call the class methos MM->something anymore. Instead
895 you should call the superclass. Something like
899 $self->MM::constants();
902 Especially the libscan() and exescan() methods should be altered
903 towards OO programming, that means do not expect that $_ to contain
904 the path but rather $_[1].
906 Try to build several extensions simultanously to debug your
907 Makefile.PL. You can unpack a bunch of distributed packages within one
910 perl -MExtUtils::MakeMaker -e 'WriteMakefile()'
912 That's actually fun to watch :)
914 Do not use exit() in your Makefile.PL. MakeMaker tries hard to enable
915 multi-module builds in one go.
917 Final suggestion: Try to delete all of your MY:: subroutines and
918 watch, if you really still need them. MakeMaker might already do what
919 you want without them. If you see no way to avoid your own subroutine
920 solution, please let us know about the problem.
923 =head2 Default Makefile Behaviour
925 The automatically generated Makefile enables the user of the extension
928 perl Makefile.PL # optionally "perl Makefile.PL verbose"
930 make test # optionally set TEST_VERBOSE=1
931 make install # See below
933 The Makefile to be produced may be altered by adding arguments of the
934 form C<KEY=VALUE>. E.g.
936 perl Makefile.PL PREFIX=/tmp/myperl5
938 Other interesting targets in the generated Makefile are
940 make config # to check if the Makefile is up-to-date
941 make clean # delete local temp files (Makefile gets renamed)
942 make realclean # delete derived files (including ./blib)
943 make ci # check in all the files in the MANIFEST file
944 make dist # see below the Distribution Support section
948 MakeMaker checks for the existence of a file named "test.pl" in the
949 current directory and if it exists it adds commands to the test target
950 of the generated Makefile that will execute the script with the proper
951 set of perl C<-I> options.
953 MakeMaker also checks for any files matching glob("t/*.t"). It will
954 add commands to the test target of the generated Makefile that execute
955 all matching files via the L<Test::Harness> module with the C<-I>
956 switches set correctly.
960 make alone puts all relevant files into directories that are named by
961 the macros INST_LIB, INST_ARCHLIB, INST_EXE, INST_MAN1DIR, and
962 INST_MAN3DIR. All these default to something below ./blib if
963 you are I<not> building below the perl source directory. If you I<are>
964 building below the perl source, INST_LIB and INST_ARCHLIB default to
965 ../../lib, and INST_EXE is not defined.
967 The I<install> target of the generated Makefile copies the files found
968 below each of the INST_* directories to their INSTALL*
969 counterparts. Which counterparts are chosen depends on the setting of
970 INSTALLDIRS according to the following table:
975 INST_ARCHLIB INSTALLARCHLIB INSTALLSITEARCH
976 INST_LIB INSTALLPRIVLIB INSTALLSITELIB
978 INST_MAN1DIR INSTALLMAN1DIR
979 INST_MAN3DIR INSTALLMAN3DIR
981 The INSTALL... macros in turn default to their %Config
982 ($Config{installprivlib}, $Config{installarchlib}, etc.) counterparts.
984 You can check the values of these variables on your system with
986 perl -MConfig -le 'print join $/, map
987 sprintf("%20s: %s", $_, $Config{$_}),
988 grep /^install/, keys %Config'
990 If you don't want to keep the defaults, MakeMaker helps you to
991 minimize the typing needed: the usual relationship between
992 INSTALLPRIVLIB and INSTALLARCHLIB is determined by Configure at perl
993 compilation time. MakeMaker supports the user who sets
994 INSTALLPRIVLIB. If INSTALLPRIVLIB is set, but INSTALLARCHLIB not, then
995 MakeMaker defaults the latter to be the same subdirectory of
996 INSTALLPRIVLIB as Configure decided for the counterparts in %Config ,
997 otherwise it defaults to INSTALLPRIVLIB. The same relationship holds
998 for INSTALLSITELIB and INSTALLSITEARCH.
1000 MakeMaker gives you much more freedom than needed to configure
1001 internal variables and get different results. It is worth to mention,
1002 that make(1) also lets you configure most of the variables that are
1003 used in the Makefile. But in the majority of situations this will not
1004 be necessary, and should only be done, if the author of a package
1005 recommends it (or you know what you're doing).
1011 =head2 PREFIX attribute
1013 The PREFIX attribute can be used to set the INSTALL* attributes in one
1014 go. The quickest way to install a module in a non-standard place
1016 perl Makefile.PL PREFIX=~
1018 This will replace the string specified by $Config{prefix} in all
1019 $Config{install*} values.
1021 Note, that the tilde expansion is done by MakeMaker, not by perl by
1022 default, nor by make.
1024 If the user has superuser privileges, and is not working on AFS
1025 (Andrew File System) or relatives, then the defaults for
1026 INSTALLPRIVLIB, INSTALLARCHLIB, INSTALLBIN, etc. will be appropriate,
1027 and this incantation will be the best:
1029 perl Makefile.PL; make; make test
1032 make install per default writes some documentation of what has been
1033 done into the file C<$(INSTALLARCHLIB)/perllocal.pod>. This feature
1034 can be bypassed by calling make pure_install.
1038 will have to specify the installation directories as these most
1039 probably have changed since perl itself has been installed. They will
1040 have to do this by calling
1042 perl Makefile.PL INSTALLSITELIB=/afs/here/today \
1043 INSTALLBIN=/afs/there/now INSTALLMAN3DIR=/afs/for/manpages
1046 Be careful to repeat this procedure every time you recompile an
1047 extension, unless you are sure the AFS installation directories are
1050 =head2 Static Linking of a new Perl Binary
1052 An extension that is built with the above steps is ready to use on
1053 systems supporting dynamic loading. On systems that do not support
1054 dynamic loading, any newly created extension has to be linked together
1055 with the available resources. MakeMaker supports the linking process
1056 by creating appropriate targets in the Makefile whenever an extension
1057 is built. You can invoke the corresponding section of the makefile with
1061 That produces a new perl binary in the current directory with all
1062 extensions linked in that can be found in INST_ARCHLIB , SITELIBEXP,
1063 and PERL_ARCHLIB. To do that, MakeMaker writes a new Makefile, on
1064 UNIX, this is called Makefile.aperl (may be system dependent). If you
1065 want to force the creation of a new perl, it is recommended, that you
1066 delete this Makefile.aperl, so the directories are searched-through
1067 for linkable libraries again.
1069 The binary can be installed into the directory where perl normally
1070 resides on your machine with
1074 To produce a perl binary with a different name than C<perl>, either say
1076 perl Makefile.PL MAP_TARGET=myperl
1083 make myperl MAP_TARGET=myperl
1084 make inst_perl MAP_TARGET=myperl
1086 In any case you will be prompted with the correct invocation of the
1087 C<inst_perl> target that installs the new binary into INSTALLBIN.
1089 make inst_perl per default writes some documentation of what has been
1090 done into the file C<$(INSTALLARCHLIB)/perllocal.pod>. This
1091 can be bypassed by calling make pure_inst_perl.
1093 Warning: the inst_perl: target will most probably overwrite your
1094 existing perl binary. Use with care!
1096 Sometimes you might want to build a statically linked perl although
1097 your system supports dynamic loading. In this case you may explicitly
1098 set the linktype with the invocation of the Makefile.PL or make:
1100 perl Makefile.PL LINKTYPE=static # recommended
1104 make LINKTYPE=static # works on most systems
1106 =head2 Determination of Perl Library and Installation Locations
1108 MakeMaker needs to know, or to guess, where certain things are
1109 located. Especially INST_LIB and INST_ARCHLIB (where to put the files
1110 during the make(1) run), PERL_LIB and PERL_ARCHLIB (where to read
1111 existing modules from), and PERL_INC (header files and C<libperl*.*>).
1113 Extensions may be built either using the contents of the perl source
1114 directory tree or from the installed perl library. The recommended way
1115 is to build extensions after you have run 'make install' on perl
1116 itself. You can do that in any directory on your hard disk that is not
1117 below the perl source tree. The support for extensions below the ext
1118 directory of the perl distribution is only good for the standard
1119 extensions that come with perl.
1121 If an extension is being built below the C<ext/> directory of the perl
1122 source then MakeMaker will set PERL_SRC automatically (e.g.,
1123 C<../..>). If PERL_SRC is defined and the extension is recognized as
1124 a standard extension, then other variables default to the following:
1127 PERL_LIB = PERL_SRC/lib
1128 PERL_ARCHLIB = PERL_SRC/lib
1130 INST_ARCHLIB = PERL_ARCHLIB
1132 If an extension is being built away from the perl source then MakeMaker
1133 will leave PERL_SRC undefined and default to using the installed copy
1134 of the perl library. The other variables default to the following:
1136 PERL_INC = $archlibexp/CORE
1137 PERL_LIB = $privlibexp
1138 PERL_ARCHLIB = $archlibexp
1139 INST_LIB = ./blib/lib
1140 INST_ARCHLIB = ./blib/arch
1142 If perl has not yet been installed then PERL_SRC can be defined on the
1143 command line as shown in the previous section.
1145 =head2 Useful Default Makefile Macros
1147 FULLEXT = Pathname for extension directory (eg DBD/Oracle).
1149 BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
1151 ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD)
1153 INST_LIBDIR = C<$(INST_LIB)$(ROOTEXT)>
1155 INST_AUTODIR = C<$(INST_LIB)/auto/$(FULLEXT)>
1157 INST_ARCHAUTODIR = C<$(INST_ARCHLIB)/auto/$(FULLEXT)>
1159 =head2 Using Attributes and Parameters
1161 The following attributes can be specified as arguments to WriteMakefile()
1162 or as NAME=VALUE pairs on the command line:
1166 # The following "=item C" is used by the attrib_help routine
1167 # likewise the "=back" below. So be careful when changing it!
1173 Ref to array of *.c file names. Initialised from a directory scan
1174 and the values portion of the XS attribute hash. This is not
1175 currently used by MakeMaker but may be handy in Makefile.PLs.
1179 Arrayref. E.g. [qw(archname manext)] defines ARCHNAME & MANEXT from
1180 config.sh. MakeMaker will add to CONFIG the following values anyway:
1200 CODE reference. The subroutine should return a hash reference. The
1201 hash may contain further attributes, e.g. {LIBS => ...}, that have to
1202 be determined by some evaluation method.
1206 Something like C<"-DHAVE_UNISTD_H">
1210 Ref to array of subdirectories containing Makefile.PLs e.g. [ 'sdbm'
1215 Your name for distributing the package (by tar file). This defaults to
1220 Hashref of symbol names for routines to be made available as
1221 universal symbols. Each key/value pair consists of the package name
1222 and an array of routine names in that package. Used only under AIX
1223 (export lists) and VMS (linker options) at present. The routine
1224 names supplied will be expanded in the same way as XSUB names are
1225 expanded by the XS() macro. Defaults to
1227 {"$(NAME)" => ["boot_$(NAME)" ] }
1231 {"RPC" => [qw( boot_rpcb rpcb_gettime getnetconfigent )],
1232 "NetconfigPtr" => [ 'DESTROY'] }
1236 Array of symbol names for variables to be made available as
1237 universal symbols. Used only under AIX (export lists) and VMS
1238 (linker options) at present. Defaults to []. (e.g. [ qw(
1239 Foo_version Foo_numstreams Foo_tree ) ])
1243 Ref to array of executable files. The files will be copied to the
1244 INST_EXE directory. Make realclean will delete them from there
1249 In general any generated Makefile checks for the current version of
1250 MakeMaker and the version the Makefile was built under. If NO_VC is
1251 set, the version check is neglected. Do not write this into your
1252 Makefile.PL, use it interactively instead.
1254 =item FIRST_MAKEFILE
1256 The name of the Makefile to be produced. Defaults to the contents of
1257 MAKEFILE, but can be overridden. This is used for the second Makefile
1258 that will be produced for the MAP_TARGET.
1262 Perl binary able to run this extension.
1266 Ref to array of *.h file names. Similar to C.
1270 Include file dirs eg: C<"-I/usr/5include -I/path/to/inc">
1272 =item INSTALLARCHLIB
1274 Used by 'make install', which copies files from INST_ARCHLIB to this
1275 directory if INSTALLDIRS is set to perl.
1279 Used by 'make install' which copies files from INST_EXE to this
1284 Determines which of the two sets of installation directories to
1285 choose: installprivlib and installarchlib versus installsitelib and
1286 installsitearch. The first pair is chosen with INSTALLDIRS=perl, the
1287 second with INSTALLDIRS=site. Default is site.
1289 =item INSTALLMAN1DIR
1291 This directory gets the man pages at 'make install' time. Defaults to
1292 $Config{installman1dir}.
1294 =item INSTALLMAN3DIR
1296 This directory gets the man pages at 'make install' time. Defaults to
1297 $Config{installman3dir}.
1299 =item INSTALLPRIVLIB
1301 Used by 'make install', which copies files from INST_LIB to this
1302 directory if INSTALLDIRS is set to perl.
1304 =item INSTALLSITELIB
1306 Used by 'make install', which copies files from INST_LIB to this
1307 directory if INSTALLDIRS is set to site (default).
1309 =item INSTALLSITEARCH
1311 Used by 'make install', which copies files from INST_ARCHLIB to this
1312 directory if INSTALLDIRS is set to site (default).
1316 Same as INST_LIB for architecture dependent files.
1320 Directory, where executable scripts should be installed during
1321 'make'. Defaults to "./blib/bin", just to have a dummy location during
1322 testing. make install will copy the files in INST_EXE to INSTALLBIN.
1326 Directory where we put library files of this extension while building
1331 Directory to hold the man pages at 'make' time
1335 Directory to hold the man pages at 'make' time
1339 defaults to "$(OBJECT)" and is used in the ld command to specify
1340 what files to link/load from (also see dynamic_lib below for how to
1345 The filename of the perllibrary that will be used together with this
1346 extension. Defaults to libperl.a.
1350 An anonymous array of alternative library
1351 specifications to be searched for (in order) until
1352 at least one library is found. E.g.
1354 'LIBS' => ["-lgdbm", "-ldbm -lfoo", "-L/path -ldbm.nfs"]
1356 Mind, that any element of the array
1357 contains a complete set of arguments for the ld
1358 command. So do not specify
1360 'LIBS' => ["-ltcl", "-ltk", "-lX11"]
1362 See ODBM_File/Makefile.PL for an example, where an array is needed. If
1363 you specify a scalar as in
1365 'LIBS' => "-ltcl -ltk -lX11"
1367 MakeMaker will turn it into an array with one element.
1371 'static' or 'dynamic' (default unless usedl=undef in
1372 config.sh). Should only be used to force static linking (also see
1377 Boolean which tells MakeMaker, that it should include the rules to
1378 make a perl. This is handled automatically as a switch by
1379 MakeMaker. The user normally does not need it.
1383 The name of the Makefile to be produced.
1387 Hashref of pod-containing files. MakeMaker will default this to all
1388 EXE_FILES files that include POD directives. The files listed
1389 here will be converted to man pages and installed as was requested
1394 Hashref of .pm and .pod files. MakeMaker will default this to all
1395 .pod and any .pm files that include POD directives. The files listed
1396 here will be converted to man pages and installed as was requested
1401 If it is intended, that a new perl binary be produced, this variable
1402 may hold a name for that binary. Defaults to perl
1406 If the extension links to a library that it builds set this to the
1407 name of the library (see SDBM_File)
1411 Perl module name for this extension (DBD::Oracle). This will default
1412 to the directory name but should be explicitly defined in the
1417 MakeMaker will figure out, if an extension contains linkable code
1418 anywhere down the directory tree, and will set this variable
1419 accordingly, but you can speed it up a very little bit, if you define
1420 this boolean variable yourself.
1424 Defaults the C<@>. By setting it to an empty string you can generate a
1425 Makefile that echos all commands. Mainly used in debugging MakeMaker
1430 Boolean. Attribute to inhibit descending into subdirectories.
1434 List of object files, defaults to '$(BASEEXT)$(OBJ_EXT)', but can be a long
1435 string containing all object files, e.g. "tkpBind.o
1436 tkpButton.o tkpCanvas.o"
1440 Defaults to C<-O>. Set it to C<-g> to turn debugging on. The flag is
1441 passed to subdirectory makes.
1445 Perl binary for tasks that can be done by miniperl
1449 The call to the program that is able to compile perlmain.c. Defaults
1454 Same as above for architecture dependent files
1458 Directory containing the Perl library to use.
1462 Directory containing the Perl source code (use of this should be
1463 avoided, it may be undefined)
1467 Ref to hash of files to be processed as perl programs. MakeMaker
1468 will default to any found *.PL file (except Makefile.PL) being keys
1469 and the basename of the file being the value. E.g.
1471 {'foobar.PL' => 'foobar'}
1473 The *.PL files are expected to produce output to the target files
1478 Hashref of .pm files and *.pl files to be installed. e.g.
1480 {'name_of_file.pm' => '$(INST_LIBDIR)/install_as.pm'}
1482 By default this will include *.pm and *.pl. If a lib directory
1483 exists and is not listed in DIR (above) then any *.pm and *.pl files
1484 it contains will also be included by default. Defining PM in the
1485 Makefile.PL will override PMLIBDIRS.
1489 Ref to array of subdirectories containing library files. Defaults to
1490 [ 'lib', $(BASEEXT) ]. The directories will be scanned and any files
1491 they contain will be installed in the corresponding location in the
1492 library. A libscan() method can be used to alter the behaviour.
1493 Defining PM in the Makefile.PL will override PMLIBDIRS.
1497 Can be used to set the three INSTALL* attributes in one go (except for
1498 probably INSTALLMAN1DIR, if it is not below PREFIX according to
1499 %Config). They will have PREFIX as a common directory node and will
1500 branch from that node into lib/, lib/ARCHNAME or whatever Configure
1501 decided at the build time of your perl (unless you override one of
1506 Placeholder, not yet implemented. Will eventually be a hashref: Names
1507 of modules that need to be available to run this extension (e.g. Fcntl
1508 for SDBM_File) are the keys of the hash and the desired version is the
1509 value. Needs further evaluation, should probably allow to define
1510 prerequisites among header files, libraries, perl version, etc.
1514 Arryref. E.g. [qw(name1 name2)] skip (do not write) sections of the
1519 Ref to array of typemap file names. Use this when the typemaps are
1520 in some directory other than the current directory or when they are
1521 not named B<typemap>. The last typemap in the list takes
1522 precedence. A typemap in the current directory has highest
1523 precedence, even if it isn't listed in TYPEMAPS. The default system
1524 typemap has lowest precedence.
1528 Your version number for distributing the package. This defaults to
1533 Instead of specifying the VERSION in the Makefile.PL you can let
1534 MakeMaker parse a file to determine the version number. The parsing
1535 routine requires that the file named by VERSION_FROM contains one
1536 single line to compute the version number. The first line in the file
1537 that contains the regular expression
1539 /(\$[\w:]*\bVERSION)\b.*=/
1541 will be evaluated with eval() and the value of the named variable
1542 B<after> the eval() will be assigned to the VERSION attribute of the
1543 MakeMaker object. The following lines will be parsed o.k.:
1546 ( $VERSION ) = '$Revision: 1.187 $ ' =~ /\$Revision:\s+([^\s]+)/;
1547 $FOO::VERSION = '1.10';
1549 but these will fail:
1551 my $VERSION = '1.01';
1552 local $VERSION = '1.02';
1553 local $FOO::VERSION = '1.30';
1555 The file named in VERSION_FROM is added as a dependency to Makefile to
1556 guarantee, that the Makefile contains the correct VERSION macro after
1557 a change of the file.
1561 Hashref of .xs files. MakeMaker will default this. e.g.
1563 {'name_of_file.xs' => 'name_of_file.c'}
1565 The .c files will automatically be included in the list of files
1566 deleted by a make clean.
1570 String of options to pass to xsubpp. This might include C<-C++> or
1571 C<-extern>. Do not include typemaps here; the TYPEMAP parameter exists for
1576 May be set to an empty string, which is identical to C<-prototypes>, or
1577 C<-noprototypes>. See the xsubpp documentation for details. MakeMaker
1578 defaults to the empty string.
1582 Your version number for the .xs file of this package. This defaults
1583 to the value of the VERSION attribute.
1587 =head2 Additional lowercase attributes
1589 can be used to pass parameters to the methods which implement that
1590 part of the Makefile. These are not normally required:
1596 {FILES => "*.xyz foo"}
1600 {ANY_TARGET => ANY_DEPENDECY, ...}
1604 {TARFLAGS => 'cvfF', COMPRESS => 'gzip', SUFFIX => 'gz',
1605 SHAR => 'shar -m', DIST_CP => 'ln', ZIP => '/bin/zip',
1608 If you specify COMPRESS, then SUFFIX should also be altered, as it is
1609 needed to tell make the target file of the compression. Setting
1610 DIST_CP to ln can be useful, if you need to preserve the timestamps on
1611 your files. DIST_CP can take the values 'cp', which copies the file,
1612 'ln', which links the file, and 'best' which copies symbolic links and
1613 links the rest. Default is 'best'.
1617 {ARMAYBE => 'ar', OTHERLDFLAGS => '...', INST_DYNAMIC_DEP => '...'}
1621 Deprecated as of MakeMaker 5.23. See L<ExtUtils::MM_Unix/pm_to_blib>.
1625 {LINKTYPE => 'static', 'dynamic' or ''}
1627 NB: Extensions that have nothing but *.pm files had to say
1631 with Pre-5.0 MakeMakers. Since version 5.00 of MakeMaker such a line
1632 can be deleted safely. MakeMaker recognizes, when there's nothing to
1637 {ANY_MACRO => ANY_VALUE, ...}
1641 {FILES => '$(INST_ARCHAUTODIR)/*.xyz'}
1643 =item tool_autosplit
1651 # bug in pod2html, so leave the =back
1653 # Don't delete this cut, MM depends on it!
1655 =head2 Overriding MakeMaker Methods
1657 If you cannot achieve the desired Makefile behaviour by specifying
1658 attributes you may define private subroutines in the Makefile.PL.
1659 Each subroutines returns the text it wishes to have written to
1660 the Makefile. To override a section of the Makefile you can
1663 sub MY::c_o { "new literal text" }
1665 or you can edit the default by saying something like:
1671 s/old text/new text/;
1675 Both methods above are available for backwards compatibility with
1678 If you still need a different solution, try to develop another
1679 subroutine, that fits your needs and submit the diffs to
1680 F<perl5-porters@nicoh.com> or F<comp.lang.perl.misc> as appropriate.
1682 For a complete description of all MakeMaker methods see L<ExtUtils::MM_Unix>.
1684 Here is a simple example of how to add a new target to the generated
1689 $(MYEXTLIB): sdbm/Makefile
1690 cd sdbm && $(MAKE) all
1695 =head2 Distribution Support
1697 For authors of extensions MakeMaker provides several Makefile
1698 targets. Most of the support comes from the ExtUtils::Manifest module,
1699 where additional documentation can be found.
1703 =item make distcheck
1705 reports which files are below the build directory but not in the
1706 MANIFEST file and vice versa. (See ExtUtils::Manifest::fullcheck() for
1709 =item make skipcheck
1711 reports which files are skipped due to the entries in the
1712 C<MANIFEST.SKIP> file (See ExtUtils::Manifest::skipcheck() for
1715 =item make distclean
1717 does a realclean first and then the distcheck. Note that this is not
1718 needed to build a new distribution as long as you are sure, that the
1719 MANIFEST file is ok.
1723 rewrites the MANIFEST file, adding all remaining files found (See
1724 ExtUtils::Manifest::mkmanifest() for details)
1728 Copies all the files that are in the MANIFEST file to a newly created
1729 directory with the name C<$(DISTNAME)-$(VERSION)>. If that directory
1730 exists, it will be removed first.
1734 Makes a distdir first, and runs a C<perl Makefile.PL>, a make, and
1735 a make test in that directory.
1739 First does a distdir. Then a command $(PREOP) which defaults to a null
1740 command. Next it runs C<tar> on that directory into a tarfile and
1741 deletes the directory. Finishes with a command $(POSTOP) which
1742 defaults to a null command.
1746 Defaults to $(DIST_DEFAULT) which in turn defaults to tardist.
1748 =item make uutardist
1750 Runs a tardist first and uuencodes the tarfile.
1754 First does a distdir. Then a command $(PREOP) which defaults to a null
1755 command. Next it runs C<shar> on that directory into a sharfile and
1756 deletes the intermediate directory again. Finishes with a command
1757 $(POSTOP) which defaults to a null command. Note: For shdist to work
1758 properly a C<shar> program that can handle directories is mandatory.
1762 First does a distdir. Then a command $(PREOP) which defaults to a null
1763 command. Runs C<$(ZIP) $(ZIPFLAGS)> on that directory into a
1764 zipfile. Then deletes that directory. Finishes with a command
1765 $(POSTOP) which defaults to a null command.
1769 Does a $(CI) and a $(RCS_LABEL) on all files in the MANIFEST file.
1773 Customization of the dist targets can be done by specifying a hash
1774 reference to the dist attribute of the WriteMakefile call. The
1775 following parameters are recognized:
1778 COMPRESS ('compress')
1781 RCS_LABEL ('rcs -q -Nv$(VERSION_SYM):')
1791 WriteMakefile( 'dist' => { COMPRESS=>"gzip", SUFFIX=>"gz" })
1796 Andy Dougherty F<E<lt>doughera@lafcol.lafayette.eduE<gt>>, Andreas
1797 KE<ouml>nig F<E<lt>A.Koenig@franz.ww.TU-Berlin.DEE<gt>>, Tim Bunce
1798 F<E<lt>Tim.Bunce@ig.co.ukE<gt>>. VMS support by Charles Bailey
1799 F<E<lt>bailey@genetics.upenn.eduE<gt>>. OS/2 support by Ilya
1800 Zakharevich F<E<lt>ilya@math.ohio-state.eduE<gt>>. Contact the
1801 makemaker mailing list C<mailto:makemaker@franz.ww.tu-berlin.de>, if
1802 you have any questions.
1804 =head1 MODIFICATION HISTORY
1806 For a more complete documentation see the file Changes in the
1807 MakeMaker distribution package.
1811 See the file Todo in the MakeMaker distribution package.