1 package ExtUtils::MM_Unix;
9 require ExtUtils::MakeMaker; # for $Is_OS2 and FileHandle
10 require ExtUtils::Liblist;
13 Exporter::import('ExtUtils::MakeMaker',
14 qw( $Verbose &neatvalue));
16 if ($Is_VMS = $Config::Config{osname} eq 'VMS') {
17 require VMS::Filespec;
18 import VMS::Filespec qw( &vmsify );
21 $Is_OS2 = $ExtUtils::MakeMaker::Is_OS2;
25 ExtUtils::MM_Unix - methods used by ExtUtils::MakeMaker
29 C<require ExtUtils::MM_Unix;>
33 The methods provided by this package are designed to be used in
34 conjunction with ExtUtils::MakeMaker. When MakeMaker writes a
35 Makefile, it creates one or more objects that inherit their methods
36 from a package C<MM>. MM itself doesn't provide any methods, but it
37 ISA ExtUtils::MM_Unix class. The inheritance tree of MM lets operating
38 specific packages take the responsibility for all the methods provided
39 by MM_Unix. We are trying to reduce the number of the necessary
40 overrides by defining rather primitive operations within
43 If you are going to write a platform specific MM package, please try
44 to limit the necessary overrides to primitiv methods, and if it is not
45 possible to do so, let's work it out how to achieve that gain.
49 The following description of methods is still under
50 development. Please refer to the code for not suitably documented
51 sections and complain loudly to the makemaker mailing list.
53 =head2 Preloaded methods
59 Concatenate two or more directory names to form a complete path ending
68 my $result = join('/',@_);
69 $result =~ s:/\./:/:g;
76 Concatenate two or more directory names and a filename to form a
77 complete path ending with a filename
83 my $result = join('/',@_);
84 $result =~ s:/\./:/:g;
91 misnamed method (will have to be changed). The MM_Unix method just
92 returns the argument without further processing.
94 On VMS used to insure that colons marking targets are preceded by
95 space - most Unix Makes don't need this, but it's necessary under VMS
96 to distinguish the target delimiter from a colon appearing as part of
102 my($self,$text) = @_;
104 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
105 $self = $ExtUtils::MakeMaker::Parent[-1];
112 Takes a path to a file that is found by init_dirscan and returns false
113 if we don't want to include this file in the library. Mainly used to
114 exclude RCS, CVS, and SCCS directories from installation.
121 my($self,$path) = @_;
122 return '' if $path =~ m:/(RCS|CVS|SCCS)/: ;
128 Deprecated method. Use libscan instead.
133 my($self,$path) = @_;
139 Takes as arguments a directory name and a regular expression. Returns
140 all entries in the directory that match the regular expression.
146 my($dir, $regex) = @_;
148 my $dh = new DirHandle;
149 $dh->open($dir || ".") or return ();
152 @ls = grep(/$regex/, @ls) if $regex;
158 Takes no argument, returns the environment variable PATH as an array.
164 my $path_sep = $Is_OS2 ? ";" : $Is_VMS ? "/" : ":";
165 my $path = $ENV{PATH};
166 $path =~ s:\\:/:g if $Is_OS2;
167 my @path = split $path_sep, $path;
170 =item replace_manpage_separator
172 Takes the name of a package, which may be a nested package, in the
173 form Foo/Bar and replaces the slash with C<::>. Returns the replacement.
177 sub replace_manpage_separator {
183 =item file_name_is_absolute
185 Takes as argument a path and returns true, it it is an absolute path.
189 sub file_name_is_absolute {
190 my($self,$file) = @_;
196 Check a path variable in $self from %Config, if it contains a prefix,
197 and replace it with another one.
199 Takes as arguments an attribute name, a search prefix and a
200 replacement prefix. Changes the attribute in the object.
205 my($self,$var,$sprefix,$rprefix) = @_;
206 $self->{uc $var} ||= $Config{lc $var};
207 $self->{uc $var} = VMS::Filespec::unixpath($self->{uc $var}) if $Is_VMS;
208 $self->{uc $var} =~ s/\Q$sprefix\E/$rprefix/;
211 =item maybe_command_in_dirs
213 method under development. Not yet used. Ask Ilya :-)
217 sub maybe_command_in_dirs { # $ver is optional argument if looking for perl
218 # Ilya's suggestion. Not yet used, want to understand it first, but at least the code is here
219 my($self, $names, $dirs, $trace, $ver) = @_;
221 foreach $dir (@$dirs){
222 next unless defined $dir; # $self->{PERL_SRC} may be undefined
223 foreach $name (@$names){
225 if ($self->file_name_is_absolute($name)) {
227 } elsif ($name =~ m|/|) {
228 $abs = $self->catfile(".", $name); # not absolute
230 $abs = $self->catfile($dir, $name);
232 print "Checking $abs for $name\n" if ($trace >= 2);
233 next unless $tryabs = $self->maybe_command($abs);
234 print "Substituting $tryabs instead of $abs\n"
235 if ($trace >= 2 and $tryabs ne $abs);
238 print "Executing $abs\n" if ($trace >= 2);
239 if (`$abs -e 'require $ver; print "VER_OK\n" ' 2>&1` =~ /VER_OK/) {
240 print "Using PERL=$abs\n" if $trace;
243 } else { # Do not look for perl
252 Returns true, if the argument is likely to be a command.
257 my($self,$file) = @_;
258 return $file if -x $file && ! -d $file;
264 Returns true, if we the argument is likely to be a perl script. On
265 MM_Unix this is true for any ordinary, readable file.
270 my($self,$file) = @_;
271 return 1 if -r $file && ! -d $file;
276 # sub ExtUtils::MM_Unix::guess_name ;
277 # sub ExtUtils::MM_Unix::init_main ;
278 # sub ExtUtils::MM_Unix::init_dirscan ;
279 # sub ExtUtils::MM_Unix::init_others ;
280 # sub ExtUtils::MM_Unix::find_perl ;
281 # sub ExtUtils::MM_Unix::post_initialize ;
282 # sub ExtUtils::MM_Unix::const_config ;
283 # sub ExtUtils::MM_Unix::constants ;
284 # sub ExtUtils::MM_Unix::const_loadlibs ;
285 # sub ExtUtils::MM_Unix::const_cccmd ;
286 # sub ExtUtils::MM_Unix::tool_autosplit ;
287 # sub ExtUtils::MM_Unix::tool_xsubpp ;
288 # sub ExtUtils::MM_Unix::xsubpp_version ;
289 # sub ExtUtils::MM_Unix::tools_other ;
290 # sub ExtUtils::MM_Unix::dist ;
291 # sub ExtUtils::MM_Unix::macro ;
292 # sub ExtUtils::MM_Unix::depend ;
293 # sub ExtUtils::MM_Unix::post_constants ;
294 # sub ExtUtils::MM_Unix::pasthru ;
295 # sub ExtUtils::MM_Unix::c_o ;
296 # sub ExtUtils::MM_Unix::xs_c ;
297 # sub ExtUtils::MM_Unix::xs_o ;
298 # sub ExtUtils::MM_Unix::top_targets ;
299 # sub ExtUtils::MM_Unix::linkext ;
300 # sub ExtUtils::MM_Unix::dlsyms ;
301 # sub ExtUtils::MM_Unix::dynamic ;
302 # sub ExtUtils::MM_Unix::dynamic_bs ;
303 # sub ExtUtils::MM_Unix::dynamic_lib ;
304 # sub ExtUtils::MM_Unix::static ;
305 # sub ExtUtils::MM_Unix::static_lib ;
306 # sub ExtUtils::MM_Unix::installpm ;
307 # sub ExtUtils::MM_Unix::installpm_x ;
308 # sub ExtUtils::MM_Unix::manifypods ;
309 # sub ExtUtils::MM_Unix::processPL ;
310 # sub ExtUtils::MM_Unix::installbin ;
311 # sub ExtUtils::MM_Unix::subdirs ;
312 # sub ExtUtils::MM_Unix::subdir_x ;
313 # sub ExtUtils::MM_Unix::clean ;
314 # sub ExtUtils::MM_Unix::realclean ;
315 # sub ExtUtils::MM_Unix::dist_basics ;
316 # sub ExtUtils::MM_Unix::dist_core ;
317 # sub ExtUtils::MM_Unix::dist_dir ;
318 # sub ExtUtils::MM_Unix::dist_test ;
319 # sub ExtUtils::MM_Unix::dist_ci ;
320 # sub ExtUtils::MM_Unix::install ;
321 # sub ExtUtils::MM_Unix::force ;
322 # sub ExtUtils::MM_Unix::perldepend ;
323 # sub ExtUtils::MM_Unix::makefile ;
324 # sub ExtUtils::MM_Unix::staticmake ;
325 # sub ExtUtils::MM_Unix::test ;
326 # sub ExtUtils::MM_Unix::test_via_harness ;
327 # sub ExtUtils::MM_Unix::test_via_script ;
328 # sub ExtUtils::MM_Unix::postamble ;
329 # sub ExtUtils::MM_Unix::makeaperl ;
330 # sub ExtUtils::MM_Unix::extliblist ;
331 # sub ExtUtils::MM_Unix::dir_target ;
332 # sub ExtUtils::MM_Unix::needs_linking ;
333 # sub ExtUtils::MM_Unix::has_link_code ;
334 # sub ExtUtils::MM_Unix::writedoc ;
340 # Without SelfLoader we need
343 =head2 SelfLoaded methods
347 Guess the name of this package by examining the working directory's
348 name. MakeMaker calls this only if the developer has not supplied a
357 my $name = fastcwd();
358 $name =~ s:.*/:: unless ($name =~ s:^.*/ext/::);
360 $name =~ s#[\-_][\d.\-]+$##; # this is new with MM 5.00
373 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
374 $self = $ExtUtils::MakeMaker::Parent[-1];
377 # --- Initialize Module Name and Paths
379 # NAME = The perl module name for this extension (eg DBD::Oracle).
380 # FULLEXT = Pathname for extension directory (eg DBD/Oracle).
381 # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
382 # ROOTEXT = Directory part of FULLEXT with leading /.
384 $self->{NAME}) =~ s!::!/!g ; #eg. BSD/Foo/Socket
386 # Copied from DynaLoader:
388 my(@modparts) = split(/::/,$self->{NAME});
389 my($modfname) = $modparts[-1];
391 # Some systems have restrictions on files names for DLL's etc.
392 # mod2fname returns appropriate file base name (typically truncated)
393 # It may also edit @modparts if required.
394 if (defined &DynaLoader::mod2fname) {
395 $modfname = &DynaLoader::mod2fname(\@modparts);
396 } elsif ($Is_OS2) { # Need manual correction if run with miniperl:-(
397 $modfname = substr($modfname, 0, 7) . '_';
402 $self->{NAME}) =~ s!.*::!! ; #eg. Socket
404 if (defined &DynaLoader::mod2fname or $Is_OS2) {
405 # As of 5.001m, dl_os2 appends '_'
406 $self->{DLBASE} = $modfname; #eg. Socket_
408 $self->{DLBASE} = '$(BASEEXT)';
412 $self->{FULLEXT}) =~ s#/?\Q$self->{BASEEXT}\E$## ; #eg. /BSD/Foo
414 $self->{ROOTEXT} = ($Is_VMS ? '' : '/') . $self->{ROOTEXT} if $self->{ROOTEXT};
417 # --- Initialize PERL_LIB, INST_LIB, PERL_SRC
419 # *Real* information: where did we get these two from? ...
420 my $inc_config_dir = dirname($INC{'Config.pm'});
421 my $inc_carp_dir = dirname($INC{'Carp.pm'});
423 unless ($self->{PERL_SRC}){
425 foreach $dir (qw(.. ../.. ../../..)){
426 if ( -f "$dir/config.sh"
428 && -f "$dir/lib/Exporter.pm") {
429 $self->{PERL_SRC}=$dir ;
434 if ($self->{PERL_SRC}){
435 $self->{PERL_LIB} ||= $self->catdir("$self->{PERL_SRC}","lib");
436 $self->{PERL_ARCHLIB} = $self->{PERL_LIB};
437 $self->{PERL_INC} = $self->{PERL_SRC};
438 # catch a situation that has occurred a few times in the past:
439 warn <<EOM unless -s "$self->{PERL_SRC}/cflags";
440 You cannot build extensions below the perl source tree after executing
441 a 'make clean' in the perl source tree.
443 To rebuild extensions distributed with the perl source you should
444 simply Configure (to include those extensions) and then build perl as
445 normal. After installing perl the source tree can be deleted. It is
446 not needed for building extensions by running 'perl Makefile.PL'
447 usually without extra arguments.
449 It is recommended that you unpack and build additional extensions away
450 from the perl source tree.
453 # we should also consider $ENV{PERL5LIB} here
454 $self->{PERL_LIB} ||= $Config::Config{privlibexp};
455 $self->{PERL_ARCHLIB} ||= $Config::Config{archlibexp};
456 $self->{PERL_INC} = $self->catdir("$self->{PERL_ARCHLIB}","CORE"); # wild guess for now
458 die <<EOM unless (-f ($perl_h = $self->catfile($self->{PERL_INC},"perl.h")));
459 Error: Unable to locate installed Perl libraries or Perl source code.
461 It is recommended that you install perl in a standard location before
462 building extensions. You can say:
464 $^X Makefile.PL PERL_SRC=/path/to/perl/source/directory
466 if you have not yet installed perl but still want to build this
468 (You get this message, because MakeMaker could not find "$perl_h")
471 # print STDOUT "Using header files found in $self->{PERL_INC}\n"
472 # if $Verbose && $self->needs_linking();
476 # We get SITELIBEXP and SITEARCHEXP directly via
477 # Get_from_Config. When we are running standard modules, these
478 # won't matter, we will set INSTALLDIRS to "perl". Otherwise we
479 # set it to "site". I prefer that INSTALLDIRS be set from outside
481 $self->{INSTALLDIRS} ||= "site";
483 # INST_LIB typically pre-set if building an extension after
484 # perl has been built and installed. Setting INST_LIB allows
485 # you to build directly into, say $Config::Config{privlibexp}.
486 unless ($self->{INST_LIB}){
489 ##### XXXXX We have to change this nonsense
491 if (defined $self->{PERL_SRC} and $self->{INSTALLDIRS} eq "perl") {
492 $self->{INST_LIB} = $self->{INST_ARCHLIB} = $self->{PERL_LIB};
494 $self->{INST_LIB} = $self->catdir(".","blib","lib");
497 $self->{INST_ARCHLIB} ||= $self->catdir(".","blib","arch");
498 $self->{INST_EXE} ||= $self->catdir('.','blib','bin');
500 # The user who requests an installation directory explicitly
501 # should not have to tell us a architecture installation directory
502 # as well We look if a directory exists that is named after the
503 # architecture. If not we take it as a sign that it should be the
504 # same as the requested installation directory. Otherwise we take
506 # We do the same thing twice: for privlib/archlib and for sitelib/sitearch
508 for $libpair ({l=>"privlib", a=>"archlib"}, {l=>"sitelib", a=>"sitearch"}) {
509 my $lib = "install$libpair->{l}";
511 my $Arch = uc "install$libpair->{a}";
512 if( $self->{$Lib} && ! $self->{$Arch} ){
513 my($ilib) = $Config{$lib};
514 $ilib = VMS::Filespec::unixify($ilib) if $Is_VMS;
516 $self->prefixify($Arch,$ilib,$self->{$Lib});
518 unless (-d $self->{$Arch}) {
519 print STDOUT "Directory $self->{$Arch} not found, thusly\n" if $Verbose;
520 $self->{$Arch} = $self->{$Lib};
522 print STDOUT "Defaulting $Arch to $self->{$Arch}\n" if $Verbose;
526 # we have to look at the relation between $Config{prefix} and the
527 # requested values. We're going to set the $Config{prefix} part of
528 # all the installation path variables to literally $(PREFIX), so
529 # the user can still say make PREFIX=foo
530 my($prefix) = $Config{'prefix'};
531 $prefix = VMS::Filespec::unixify($prefix) if $Is_VMS;
532 unless ($self->{PREFIX}){
533 $self->{PREFIX} = $prefix;
535 my($install_variable);
536 for $install_variable (qw/INSTALLPRIVLIB INSTALLARCHLIB INSTALLBIN INSTALLMAN1DIR
537 INSTALLMAN3DIR INSTALLSITELIB INSTALLSITEARCH/) {
538 $self->prefixify($install_variable,$prefix,q[$(PREFIX)]);
542 # Now we head at the manpages. Maybe they DO NOT want manpages
544 $self->{INSTALLMAN1DIR} = $Config::Config{installman1dir}
545 unless defined $self->{INSTALLMAN1DIR};
546 unless (defined $self->{INST_MAN1DIR}){
547 if ($self->{INSTALLMAN1DIR} =~ /^(none|\s*)$/){
548 $self->{INST_MAN1DIR} = $self->{INSTALLMAN1DIR};
550 $self->{INST_MAN1DIR} = $self->catdir('.','blib','man1');
553 $self->{MAN1EXT} ||= $Config::Config{man1ext};
555 $self->{INSTALLMAN3DIR} = $Config::Config{installman3dir}
556 unless defined $self->{INSTALLMAN3DIR};
557 unless (defined $self->{INST_MAN3DIR}){
558 if ($self->{INSTALLMAN3DIR} =~ /^(none|\s*)$/){
559 $self->{INST_MAN3DIR} = $self->{INSTALLMAN3DIR};
561 $self->{INST_MAN3DIR} = $self->catdir('.','blib','man3');
564 $self->{MAN3EXT} ||= $Config::Config{man3ext};
567 # Get some stuff out of %Config if we haven't yet done so
568 print STDOUT "CONFIG must be an array ref\n"
569 if ($self->{CONFIG} and ref $self->{CONFIG} ne 'ARRAY');
570 $self->{CONFIG} = [] unless (ref $self->{CONFIG});
571 push(@{$self->{CONFIG}}, @ExtUtils::MakeMaker::Get_from_Config);
572 push(@{$self->{CONFIG}}, 'shellflags') if $Config::Config{shellflags};
574 foreach $m (@{$self->{CONFIG}}){
575 next if $once_only{$m};
576 print STDOUT "CONFIG key '$m' does not exist in Config.pm\n"
577 unless exists $Config::Config{$m};
578 $self->{uc $m} ||= $Config::Config{$m};
582 # This is too dangerous:
583 # if ($Config{osname} eq "next") {
584 # $self->{AR} = "libtool";
585 # $self->{AR_STATIC_ARGS} = "-o";
587 # But I leave it as a placeholder
589 $self->{AR_STATIC_ARGS} ||= "cr";
591 # These should never be needed
592 $self->{LD} ||= 'ld';
593 $self->{OBJ_EXT} ||= '.o';
594 $self->{LIB_EXT} ||= '.a';
596 $self->{MAP_TARGET} ||= "perl";
598 $self->{LIBPERL_A} ||= "libperl$self->{LIB_EXT}";
600 # make a simple check if we find Exporter
601 warn "Warning: PERL_LIB ($self->{PERL_LIB}) seems not to be a perl library directory
602 (Exporter.pm not found)"
603 unless (-f $self->catfile("$self->{PERL_LIB}","Exporter.pm"));
605 # Determine VERSION and VERSION_FROM
606 ($self->{DISTNAME}=$self->{NAME}) =~ s#(::)#-#g unless $self->{DISTNAME};
607 if ($self->{VERSION_FROM}){
608 my $fh = new FileHandle;
609 $fh->open($self->{VERSION_FROM}) or die "Could not open '$self->{VERSION_FROM}' (attribute VERSION_FROM): $!";
612 next unless /\$([\w:]*\bVERSION)\b.*=/;
613 local $ExtUtils::MakeMaker::module_version_variable = $1;
616 die "Could not eval '$eval': $@" if $@;
617 if ($self->{VERSION} = $ {$ExtUtils::MakeMaker::module_version_variable}){
618 print "$self->{NAME} VERSION is $self->{VERSION} (from $self->{VERSION_FROM})\n" if $Verbose;
620 # XXX this should probably croak
621 print "WARNING: Setting VERSION via file '$self->{VERSION_FROM}' failed\n";
628 # if your FOO.pm says
629 # $VERSION = substr(q$Revision: 1.4 $, 10);
630 # then MM says something like
631 # -DXS_VERSION=\"n.nn \"
632 if ($self->{VERSION}) {
633 $self->{VERSION} =~ s/^\s+//;
634 $self->{VERSION} =~ s/\s+$//;
637 $self->{VERSION} = "0.10" unless $self->{VERSION};
638 ($self->{VERSION_SYM} = $self->{VERSION}) =~ s/\W/_/g;
641 # Graham Barr and Paul Marquess had some ideas how to ensure
642 # version compatibility between the *.pm file and the
643 # corresponding *.xs file. The bottomline was, that we need an
644 # XS_VERSION macro that defaults to VERSION:
645 $self->{XS_VERSION} ||= $self->{VERSION};
647 # --- Initialize Perl Binary Locations
649 # Find Perl 5. The only contract here is that both 'PERL' and 'FULLPERL'
650 # will be working versions of perl 5. miniperl has priority over perl
651 # for PERL to ensure that $(PERL) is usable while building ./ext/*
652 my ($component,@defpath);
653 foreach $component ($self->{PERL_SRC}, $self->path(), $Config::Config{binexp}) {
654 push @defpath, $component if defined $component;
657 $self->find_perl(5.0, [ $^X, 'miniperl','perl','perl5',"perl$]" ],
658 \@defpath, $Verbose ) unless ($self->{PERL});
659 # don't check if perl is executable, maybe they have decided to
660 # supply switches with perl
662 # Define 'FULLPERL' to be a non-miniperl (used in test: target)
663 ($self->{FULLPERL} = $self->{PERL}) =~ s/miniperl/perl/i
664 unless ($self->{FULLPERL});
673 sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
676 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
677 $self = $ExtUtils::MakeMaker::Parent[-1];
679 my($name, %dir, %xs, %c, %h, %ignore, %pl_files, %manifypods);
680 local(%pm); #the sub in find() has to see this hash
681 $ignore{'test.pl'} = 1;
682 $ignore{'makefile.pl'} = 1 if $Is_VMS;
683 foreach $name ($self->lsdir(".")){
684 next if ($name =~ /^\./ or $ignore{$name});
685 next unless $self->libscan($name);
687 $dir{$name} = $name if (-f "$name/Makefile.PL");
688 } elsif ($name =~ /\.xs$/){
689 my($c); ($c = $name) =~ s/\.xs$/.c/;
692 } elsif ($name =~ /\.c(pp|xx|c)?$/i){ # .c .C .cpp .cxx .cc
694 unless $name =~ m/perlmain\.c/; # See MAP_TARGET
695 } elsif ($name =~ /\.h$/i){
697 } elsif ($name =~ /\.(p[ml]|pod)$/){
698 $pm{$name} = $self->catfile('$(INST_LIBDIR)',$name);
699 } elsif ($name =~ /\.PL$/ && $name ne "Makefile.PL") {
700 ($pl_files{$name} = $name) =~ s/\.PL$// ;
701 } elsif ($Is_VMS && $name =~ /\.pl$/ && $name ne 'makefile.pl' &&
702 $name ne 'test.pl') { # case-insensitive filesystem
703 ($pl_files{$name} = $name) =~ s/\.pl$// ;
707 # Some larger extensions often wish to install a number of *.pm/pl
708 # files into the library in various locations.
710 # The attribute PMLIBDIRS holds an array reference which lists
711 # subdirectories which we should search for library files to
712 # install. PMLIBDIRS defaults to [ 'lib', $self->{BASEEXT} ]. We
713 # recursively search through the named directories (skipping any
714 # which don't exist or contain Makefile.PL files).
716 # For each *.pm or *.pl file found $self->libscan() is called with
717 # the default installation path in $_[1]. The return value of
718 # libscan defines the actual installation location. The default
719 # libscan function simply returns the path. The file is skipped
720 # if libscan returns false.
722 # The default installation location passed to libscan in $_[1] is:
724 # ./*.pm => $(INST_LIBDIR)/*.pm
725 # ./xyz/... => $(INST_LIBDIR)/xyz/...
726 # ./lib/... => $(INST_LIB)/...
728 # In this way the 'lib' directory is seen as the root of the actual
729 # perl library whereas the others are relative to INST_LIBDIR
730 # (which includes ROOTEXT). This is a subtle distinction but one
731 # that's important for nested modules.
733 $self->{PMLIBDIRS} = ['lib', $self->{BASEEXT}]
734 unless $self->{PMLIBDIRS};
736 #only existing directories that aren't in $dir are allowed
738 # Avoid $_ wherever possible:
739 # @{$self->{PMLIBDIRS}} = grep -d && !$dir{$_}, @{$self->{PMLIBDIRS}};
740 my (@pmlibdirs) = @{$self->{PMLIBDIRS}};
742 @{$self->{PMLIBDIRS}} = ();
743 foreach $pmlibdir (@pmlibdirs) {
744 -d $pmlibdir && !$dir{$pmlibdir} && push @{$self->{PMLIBDIRS}}, $pmlibdir;
747 if (@{$self->{PMLIBDIRS}}){
748 print "Searching PMLIBDIRS: @{$self->{PMLIBDIRS}}\n"
750 File::Find::find(sub {
752 if ($_ eq "CVS" || $_ eq "RCS"){
753 $File::Find::prune = 1;
757 my($path, $prefix) = ($File::Find::name, '$(INST_LIBDIR)');
758 my($striplibpath,$striplibname);
759 $prefix = '$(INST_LIB)' if (($striplibpath = $path) =~ s:^(\W*)lib\W:$1:);
760 ($striplibname,$striplibpath) = fileparse($striplibpath);
761 my($inst) = $self->catfile($prefix,$striplibpath,$striplibname);
762 local($_) = $inst; # for backwards compatibility
763 $inst = $self->libscan($inst);
764 print "libscan($path) => '$inst'\n" if ($Verbose >= 2);
767 }, @{$self->{PMLIBDIRS}});
770 $self->{DIR} = [sort keys %dir] unless $self->{DIR};
771 $self->{XS} = \%xs unless $self->{XS};
772 $self->{PM} = \%pm unless $self->{PM};
773 $self->{C} = [sort keys %c] unless $self->{C};
774 my(@o_files) = @{$self->{C}};
775 $self->{O_FILES} = [grep s/\.c(pp|xx|c)?$/$self->{OBJ_EXT}/i, @o_files] ;
776 $self->{H} = [sort keys %h] unless $self->{H};
777 $self->{PL_FILES} = \%pl_files unless $self->{PL_FILES};
779 # Set up names of manual pages to generate from pods
780 if ($self->{MAN1PODS}) {
781 } elsif ( $self->{INST_MAN1DIR} =~ /^(none|\s*)$/ ) {
782 $self->{MAN1PODS} = {};
785 if ( exists $self->{EXE_FILES} ) {
786 foreach $name (@{$self->{EXE_FILES}}) {
787 my $fh = new FileHandle;
789 # one day test, if $/ can be set to '' safely (is the bug fixed that was in 5.001m?)
790 if ($fh->open("<$name")) {
792 while ($testpodline = <$fh>) {
793 if($testpodline =~ /^=head1\s+\w+/) {
800 # If it doesn't exist yet, we assume, it has pods in it
804 $manifypods{$name} = $self->catfile('$(INST_MAN1DIR)',basename($name).'.$(MAN1EXT)');
808 $self->{MAN1PODS} = \%manifypods;
810 if ($self->{MAN3PODS}) {
811 } elsif ( $self->{INST_MAN3DIR} =~ /^(none|\s*)$/ ) {
812 $self->{MAN3PODS} = {};
814 my %manifypods = (); # we collect the keys first, i.e. the files
815 # we have to convert to pod
816 foreach $name (keys %{$self->{PM}}) {
817 if ($name =~ /\.pod$/ ) {
818 $manifypods{$name} = $self->{PM}{$name};
819 } elsif ($name =~ /\.p[ml]$/ ) {
820 my $fh = new FileHandle;
824 while ($testpodline = <$fh>) {
825 if($testpodline =~ /^=head1\s+\w+/) {
829 #Speculation on the future (K.A., not A.K. :)
830 #if(/^=don't\S+install/) { $ispod=0; last}
835 $manifypods{$name} = $self->{PM}{$name};
840 # Remove "Configure.pm" and similar, if it's not the only pod listed
841 # To force inclusion, just name it "Configure.pod", or override MAN3PODS
842 foreach $name (keys %manifypods) {
843 if ($name =~ /(config|setup).*\.pm/i) {
844 delete $manifypods{$name};
847 my($manpagename) = $name;
848 unless ($manpagename =~ s!^(\W*)lib\W!$1!) {
849 $manpagename = $self->catfile($self->{ROOTEXT},$manpagename);
851 $manpagename =~ s/\.p(od|m|l)$//;
852 # Strip leading slashes
853 $manpagename =~ s!^/+!!;
854 # Turn other slashes into colons
855 # $manpagename =~ s,/+,::,g;
856 $manpagename = $self->replace_manpage_separator($manpagename);
857 $manifypods{$name} = $self->catfile("\$(INST_MAN3DIR)","$manpagename.\$(MAN3EXT)");
859 $self->{MAN3PODS} = \%manifypods;
869 sub init_others { # --- Initialize Other Attributes
872 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
873 $self = $ExtUtils::MakeMaker::Parent[-1];
876 # Compute EXTRALIBS, BSLOADLIBS and LDLOADLIBS from $self->{LIBS}
877 # Lets look at $self->{LIBS} carefully: It may be an anon array, a string or
878 # undefined. In any case we turn it into an anon array:
880 # May check $Config{libs} too, thus not empty.
881 $self->{LIBS}=[''] unless $self->{LIBS};
883 $self->{LIBS}=[$self->{LIBS}] if ref \$self->{LIBS} eq SCALAR;
884 $self->{LD_RUN_PATH} = "";
886 foreach $libs ( @{$self->{LIBS}} ){
887 $libs =~ s/^\s*(.*\S)\s*$/$1/; # remove leading and trailing whitespace
888 my(@libs) = $self->extliblist($libs);
889 if ($libs[0] or $libs[1] or $libs[2]){
890 # LD_RUN_PATH now computed by ExtUtils::Liblist
891 ($self->{EXTRALIBS}, $self->{BSLOADLIBS}, $self->{LDLOADLIBS}, $self->{LD_RUN_PATH}) = @libs;
896 unless ( $self->{OBJECT} ){
897 # init_dirscan should have found out, if we have C files
898 $self->{OBJECT} = "";
899 $self->{OBJECT} = '$(BASEEXT)$(OBJ_EXT)' if @{$self->{C}||[]};
901 $self->{OBJECT} =~ s/\n+/ \\\n\t/g;
902 $self->{BOOTDEP} = (-f "$self->{BASEEXT}_BS") ? "$self->{BASEEXT}_BS" : "";
903 $self->{PERLMAINCC} ||= '$(CC)';
904 $self->{LDFROM} = '$(OBJECT)' unless $self->{LDFROM};
906 # Sanity check: don't define LINKTYPE = dynamic if we're skipping
907 # the 'dynamic' section of MM. We don't have this problem with
908 # 'static', since we either must use it (%Config says we can't
909 # use dynamic loading) or the caller asked for it explicitly.
910 if (!$self->{LINKTYPE}) {
911 $self->{LINKTYPE} = grep(/dynamic/,@{$self->{SKIP} || []})
913 : ($Config::Config{usedl} ? 'dynamic' : 'static');
916 # These get overridden for VMS and maybe some other systems
917 $self->{NOOP} ||= "";
918 $self->{FIRST_MAKEFILE} ||= "Makefile";
919 $self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE};
920 $self->{MAKE_APERL_FILE} ||= "Makefile.aperl";
921 $self->{NOECHO} = '@' unless defined $self->{NOECHO};
922 $self->{RM_F} ||= "rm -f";
923 $self->{RM_RF} ||= "rm -rf";
924 $self->{TOUCH} ||= "touch";
925 $self->{CP} ||= "cp";
926 $self->{MV} ||= "mv";
927 $self->{CHMOD} ||= "chmod";
928 $self->{UMASK_NULL} ||= "umask 0";
938 my($self, $ver, $names, $dirs, $trace) = @_;
940 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
941 $self = $ExtUtils::MakeMaker::Parent[-1];
945 print "Looking for perl $ver by these names:
951 foreach $dir (@$dirs){
952 next unless defined $dir; # $self->{PERL_SRC} may be undefined
953 foreach $name (@$names){
955 if ($self->file_name_is_absolute($name)) {
957 } elsif (($name =~ m|/|) && ($name !~ m|^\.{1,2}/|)) {
958 # name is a path that does not begin with dot or dotdot
959 $abs = $self->catfile(".", $name);
961 $abs = $self->catfile($dir, $name);
963 print "Checking $abs\n" if ($trace >= 2);
964 next unless $self->maybe_command($abs);
965 print "Executing $abs\n" if ($trace >= 2);
966 if (`$abs -e 'require $ver; print "VER_OK\n" ' 2>&1` =~ /VER_OK/) {
967 print "Using PERL=$abs\n" if $trace;
972 print STDOUT "Unable to find a perl $ver (by these names: @$names, in these dirs: @$dirs)\n";
973 0; # false and not empty
976 =head2 Methods to actually produce chunks of text for the Makefile
978 The methods here are called in the order specified by
979 @ExtUtils::MakeMaker::MM_Sections. This manpage reflects the order as
980 well as possible. Some methods call each other, so in doubt refer to
983 =item post_initialize
985 Returns an ampty string per default. Used in Makefile.PLs to add some
986 chunk of text to the Makefile after the object is initialized.
990 sub post_initialize {
993 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
994 $self = $ExtUtils::MakeMaker::Parent[-1];
1006 # --- Constants Sections ---
1010 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1011 $self = $ExtUtils::MakeMaker::Parent[-1];
1014 push(@m,"\n# These definitions are from config.sh (via $INC{'Config.pm'})\n");
1015 push(@m,"\n# They may have been overridden via Makefile.PL or on the command line\n");
1017 foreach $m (@{$self->{CONFIG}}){
1018 # SITE*EXP macros are defined in &constants; avoid duplicates here
1019 next if $once_only{$m} or $m eq 'SITELIBEXP' or $m eq 'SITEARCHEXP';
1020 push @m, "\U$m\E = ".$self->{uc $m}."\n";
1035 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1036 $self = $ExtUtils::MakeMaker::Parent[-1];
1041 AR_STATIC_ARGS NAME DISTNAME NAME_SYM VERSION VERSION_SYM XS_VERSION
1042 INST_LIB INST_ARCHLIB INST_EXE PREFIX INSTALLDIRS INSTALLPRIVLIB
1043 INSTALLARCHLIB INSTALLSITELIB INSTALLSITEARCH INSTALLBIN PERL_LIB
1044 PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
1045 FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC PERL_INC PERL FULLPERL
1047 next unless defined $self->{$tmp};
1048 push @m, "$tmp = $self->{$tmp}\n";
1052 VERSION_MACRO = VERSION
1053 DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\"
1054 XS_VERSION_MACRO = XS_VERSION
1055 XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\"
1059 MAKEMAKER = \$(PERL_LIB)/ExtUtils/MakeMaker.pm
1060 MM_VERSION = $ExtUtils::MakeMaker::VERSION
1061 MM_REVISION = $Revision
1065 # FULLEXT = Pathname for extension directory (eg DBD/Oracle).
1066 # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
1067 # ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD)
1068 # DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
1072 FULLEXT BASEEXT ROOTEXT DLBASE VERSION_FROM INC DEFINE OBJECT OBJECT
1075 next unless defined $self->{$tmp};
1076 push @m, "$tmp = $self->{$tmp}\n";
1080 # Handy lists of source code files:
1081 XS_FILES= ".join(" \\\n\t", sort keys %{$self->{XS}})."
1082 C_FILES = ".join(" \\\n\t", @{$self->{C}})."
1083 O_FILES = ".join(" \\\n\t", @{$self->{O_FILES}})."
1084 H_FILES = ".join(" \\\n\t", @{$self->{H}})."
1085 MAN1PODS = ".join(" \\\n\t", sort keys %{$self->{MAN1PODS}})."
1086 MAN3PODS = ".join(" \\\n\t", sort keys %{$self->{MAN3PODS}})."
1090 INST_MAN1DIR INSTALLMAN1DIR MAN1EXT INST_MAN3DIR INSTALLMAN3DIR MAN3EXT
1092 next unless defined $self->{$tmp};
1093 push @m, "$tmp = $self->{$tmp}\n";
1097 # work around a famous dec-osf make(1) feature(?):
1100 .SUFFIXES: .xs .c .C .cpp .cxx .cc \$(OBJ_EXT)
1102 # Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
1103 # some make implementations will delete the Makefile when we rebuild it. Because
1104 # we call false(1) when we rebuild it. So make(1) is not completely wrong when it
1105 # does so. Our milage may vary.
1106 # .PRECIOUS: Makefile # seems to be not necessary anymore
1108 .PHONY: all config static dynamic test linkext manifest
1110 # Where is the Config information that we are using/depend on
1111 CONFIGDEP = \$(PERL_ARCHLIB)/Config.pm \$(PERL_INC)/config.h \$(VERSION_FROM)
1115 # Where to put things:
1116 INST_LIBDIR = $(INST_LIB)$(ROOTEXT)
1117 INST_ARCHLIBDIR = $(INST_ARCHLIB)$(ROOTEXT)
1119 INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT)
1120 INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT)
1123 if ($self->has_link_code()) {
1125 INST_STATIC = $(INST_ARCHAUTODIR)/$(BASEEXT)$(LIB_EXT)
1126 INST_DYNAMIC = $(INST_ARCHAUTODIR)/$(DLBASE).$(DLEXT)
1127 INST_BOOT = $(INST_ARCHAUTODIR)/$(BASEEXT).bs
1138 $tmp = "$self->{BASEEXT}.def";
1147 $tmp = "\$(PERL_INC)/libperl.lib";
1156 INST_PM = '.join(" \\\n\t", sort values %{$self->{PM}}).'
1162 =item const_loadlibs
1168 sub const_loadlibs {
1171 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1172 $self = $ExtUtils::MakeMaker::Parent[-1];
1174 return "" unless $self->needs_linking;
1175 # This description can be deleted after ExtUtils::Liblist is in
1176 # the perl dist with pods
1178 # $self->{NAME} might depend on some other libraries:
1179 # (These comments may need revising:)
1181 # Dependent libraries can be linked in one of three ways:
1183 # 1. (For static extensions) by the ld command when the perl binary
1184 # is linked with the extension library. See EXTRALIBS below.
1186 # 2. (For dynamic extensions) by the ld command when the shared
1187 # object is built/linked. See LDLOADLIBS below.
1189 # 3. (For dynamic extensions) by the DynaLoader when the shared
1190 # object is loaded. See BSLOADLIBS below.
1192 # EXTRALIBS = List of libraries that need to be linked with when
1193 # linking a perl binary which includes this extension
1194 # Only those libraries that actually exist are included.
1195 # These are written to a file and used when linking perl.
1197 # LDLOADLIBS = List of those libraries which can or must be linked into
1198 # the shared library when created using ld. These may be
1199 # static or dynamic libraries.
1200 # LD_RUN_PATH is a colon separated list of the directories
1201 # in LDLOADLIBS. It is passed as an environment variable to
1202 # the process that links the shared library.
1204 # BSLOADLIBS = List of those libraries that are needed but can be
1205 # linked in dynamically at run time on this platform.
1206 # SunOS/Solaris does not need this because ld records
1207 # the information (from LDLOADLIBS) into the object file.
1208 # This list is used to create a .bs (bootstrap) file.
1210 EXTRALIBS = $self->{EXTRALIBS}
1211 LDLOADLIBS = $self->{LDLOADLIBS}
1212 BSLOADLIBS = $self->{BSLOADLIBS}
1213 LD_RUN_PATH= $self->{LD_RUN_PATH}
1224 my($self,$libperl)=@_;
1226 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1227 $self = $ExtUtils::MakeMaker::Parent[-1];
1229 return $self->{CONST_CCCMD} if $self->{CONST_CCCMD};
1230 return '' unless $self->needs_linking();
1231 $libperl or $libperl = $self->{LIBPERL_A} || "libperl$self->{LIB_EXT}" ;
1232 $libperl =~ s/\.\$\(A\)$/$self->{LIB_EXT}/;
1233 # This is implemented in the same manner as extliblist,
1234 # e.g., do both and compare results during the transition period.
1235 my($cc,$ccflags,$optimize,$large,$split, $shflags)
1236 = @Config{qw(cc ccflags optimize large split shellflags)};
1239 $shflags = '' unless $shflags;
1240 my($prog, $uc, $perltype);
1245 DE => '-DDEBUGGING -DEMBED',
1246 M => '-DEMBED -DMULTIPLICITY',
1247 DM => '-DDEBUGGING -DEMBED -DMULTIPLICITY',
1250 if ($libperl =~ /libperl(\w*)\Q$self->{LIB_EXT}/){
1253 $uc = ""; # avoid warning
1255 $perltype = $map{$uc} ? $map{$uc} : "";
1263 ( $name = $self->{NAME} . "_cflags" ) =~ s/:/_/g ;
1264 if ($prog = $Config::Config{$name}) {
1265 # Expand hints for this extension via the shell
1266 print STDOUT "Processing $name hint:\n" if $Verbose;
1268 ccflags=\"$ccflags\"
1269 optimize=\"$optimize\"
1270 perltype=\"$perltype\"
1271 optdebug=\"$optdebug\"
1276 echo ccflags=\$ccflags
1277 echo optimize=\$optimize
1278 echo perltype=\$perltype
1279 echo optdebug=\$optdebug
1286 if ($line =~ /(.*?)=\s*(.*)\s*$/){
1288 print STDOUT " $1 = $2\n" if $Verbose;
1290 print STDOUT "Unrecognised result from hint: '$line'\n";
1293 ( $cc,$ccflags,$perltype,$optdebug,$optimize,$large,$split )=@cflags{
1294 qw( cc ccflags perltype optdebug optimize large split)};
1298 $optimize = $optdebug;
1301 my($new) = "$cc -c \$(INC) $ccflags $optimize $perltype $large $split";
1302 $new =~ s/^\s+//; $new =~ s/\s+/ /g; $new =~ s/\s+$//;
1305 $cccmd =~ s/^\s*\Q$Config::Config{cc}\E\s/\$(CC) /;
1306 $cccmd .= " \$(DEFINE_VERSION) \$(XS_DEFINE_VERSION)";
1307 $self->{CONST_CCCMD} = "CCCMD = $cccmd\n";
1310 =item tool_autosplit
1316 sub tool_autosplit {
1317 # --- Tool Sections ---
1319 my($self, %attribs) = @_;
1321 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1322 $self = $ExtUtils::MakeMaker::Parent[-1];
1325 $asl = "\$AutoSplit::Maxlen=$attribs{MAXLEN};" if $attribs{MAXLEN};
1327 # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
1328 AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e 'use AutoSplit;}.$asl.q{autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) ;'
1341 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1342 $self = $ExtUtils::MakeMaker::Parent[-1];
1344 my($xsdir) = "$self->{PERL_LIB}/ExtUtils";
1345 # drop back to old location if xsubpp is not in new location yet
1346 $xsdir = "$self->{PERL_SRC}/ext" unless (-f "$self->{PERL_LIB}/ExtUtils/xsubpp");
1347 my(@tmdeps) = ('$(XSUBPPDIR)/typemap');
1348 if( $self->{TYPEMAPS} ){
1350 foreach $typemap (@{$self->{TYPEMAPS}}){
1351 if( ! -f $typemap ){
1352 warn "Typemap $typemap not found.\n";
1355 push(@tmdeps, $typemap);
1359 push(@tmdeps, "typemap") if -f "typemap";
1360 my(@tmargs) = map("-typemap $_", @tmdeps);
1361 if( exists $self->{XSOPT} ){
1362 unshift( @tmargs, $self->{XSOPT} );
1365 my $xsubpp_version = $self->xsubpp_version("$xsdir/xsubpp");
1367 # What are the correct thresholds for version 1 && 2 Paul?
1368 if ( $xsubpp_version > 1.923 ){
1369 $self->{XSPROTOARG} = "" unless defined $self->{XSPROTOARG};
1371 if (defined $self->{XSPROTOARG} && $self->{XSPROTOARG} =~ /\-prototypes/) {
1372 print STDOUT qq{Warning: This extension wants to pass the switch "-prototypes" to xsubpp.
1373 Your version of xsubpp is $xsubpp_version and cannot handle this.
1374 Please upgrade to a more recent version of xsubpp.
1377 $self->{XSPROTOARG} = "";
1383 XSUBPP = \$(XSUBPPDIR)/xsubpp
1384 XSPROTOARG = $self->{XSPROTOARG}
1385 XSUBPPDEPS = @tmdeps
1386 XSUBPPARGS = @tmargs
1392 my($self,$xsubpp) = @_;
1395 # try to figure out the version number of the xsubpp on the system
1397 # first try the -v flag, introduced in 1.921 & 2.000a2
1399 my $command = "$self->{PERL} $xsubpp -v 2>&1";
1400 print "Running $command\n" if $Verbose >= 2;
1401 $version = `$command` ;
1402 warn "Running '$command' exits with status " . ($?>>8) if $?;
1405 return $1 if $version =~ /^xsubpp version (.*)/ ;
1407 # nope, then try something else
1409 my $counter = '000';
1410 my ($file) = 'temp' ;
1411 $counter++ while -e "$file$counter"; # don't overwrite anything
1414 open(F, ">$file") or die "Cannot open file '$file': $!\n" ;
1416 MODULE = fred PACKAGE = fred
1425 $command = "$self->{PERL} $xsubpp $file 2>&1";
1426 print "Running $command\n" if $Verbose >= 2;
1427 my $text = `$command` ;
1428 warn "Running '$command' exits with status " . ($?>>8) if $?;
1431 # gets 1.2 -> 1.92 and 2.000a1
1432 return $1 if $text =~ /automatically by xsubpp version ([\S]+)\s*/ ;
1434 # it is either 1.0 or 1.1
1435 return 1.1 if $text =~ /^Warning: ignored semicolon/ ;
1437 # none of the above, so 1.0
1450 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1451 $self = $ExtUtils::MakeMaker::Parent[-1];
1456 TOUCH = $self->{TOUCH}
1459 RM_F = $self->{RM_F}
1460 RM_RF = $self->{RM_RF}
1461 CHMOD = $self->{CHMOD}
1462 UMASK_NULL = $self->{UMASK_NULL}
1464 # The following is a portable way to say mkdir -p
1465 # To see which directories are created, change the if 0 to if 1
1466 MKPATH = $(PERL) -wle '$$"="/"; foreach $$p (@ARGV){' \\
1467 -e 'next if -d $$p; my(@p); foreach(split(/\//,$$p)){' \\
1468 -e 'push(@p,$$_); next if -d "@p/"; print "mkdir @p" if 0;' \\
1469 -e 'mkdir("@p",0777)||die $$! } } exit 0;'
1471 # This helps us to minimize the effect of the .exists files A yet
1472 # better solution would be to have a stable file in the perl
1473 # distribution with a timestamp of zero. But this solution doesn't
1474 # need any changes to the core distribution and works with older perls
1475 EQUALIZE_TIMESTAMP = $(PERL) -we 'open F, ">$$ARGV[1]"; close F;' \\
1476 -e 'utime ((stat("$$ARGV[0]"))[8,9], $$ARGV[1])'
1478 # Here we warn users that an old packlist file was found somewhere,
1479 # and that they should call some uninstall routine
1480 WARN_IF_OLD_PACKLIST = $(PERL) -we 'exit unless -f $$ARGV[0];' \\
1481 -e 'print "WARNING: I have found an old package in\n";' \\
1482 -e 'print "\t$$ARGV[0].\n";' \\
1483 -e 'print "Please make sure the two installations are not conflicting\n";'
1485 MOD_INSTALL = $(PERL) -I$(INST_LIB) -MExtUtils::Install \
1486 -e 'install({@ARGV},1);'
1488 DOC_INSTALL = $(PERL) -e '$$\="\n\n";print "=head3 ", scalar(localtime), ": C<", shift, ">";' \
1489 -e 'print "=over 4";' \
1490 -e 'while ($$key = shift and $$val = shift){print "=item *";print "C<$$key: $$val>";}' \
1493 UNINSTALL = $(PERL) -MExtUtils::Install \
1494 -e 'uninstall($$ARGV[0],1);'
1506 my($self, %attribs) = @_;
1508 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1509 $self = $ExtUtils::MakeMaker::Parent[-1];
1512 # VERSION should be sanitised before use as a file name
1513 my($name) = $attribs{NAME} || '$(DISTVNAME)';
1514 my($tar) = $attribs{TAR} || 'tar'; # eg /usr/bin/gnutar
1515 my($tarflags) = $attribs{TARFLAGS} || 'cvf';
1516 my($compress) = $attribs{COMPRESS} || 'compress'; # eg gzip
1517 my($suffix) = $attribs{SUFFIX} || 'Z'; # eg gz
1518 my($shar) = $attribs{SHAR} || 'shar'; # eg "shar --gzip"
1519 my($preop) = $attribs{PREOP} || "$self->{NOECHO}true"; # eg update MANIFEST
1520 my($postop) = $attribs{POSTOP} || "$self->{NOECHO}true"; # eg remove the distdir
1521 my($ci) = $attribs{CI} || 'ci -u';
1522 my($rcs_label)= $attribs{RCS_LABEL}|| 'rcs -Nv$(VERSION_SYM): -q';
1523 my($dist_cp) = $attribs{DIST_CP} || 'best';
1524 my($dist_default) = $attribs{DIST_DEFAULT} || 'tardist';
1527 DISTVNAME = \$(DISTNAME)-\$(VERSION)
1529 TARFLAGS = $tarflags
1530 COMPRESS = $compress
1536 RCS_LABEL = $rcs_label
1538 DIST_DEFAULT = $dist_default
1550 my($self,%attribs) = @_;
1552 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1553 $self = $ExtUtils::MakeMaker::Parent[-1];
1556 while (($key,$val) = each %attribs){
1557 push @m, "$key = $val\n";
1569 my($self,%attribs) = @_;
1571 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1572 $self = $ExtUtils::MakeMaker::Parent[-1];
1575 while (($key,$val) = each %attribs){
1576 push @m, "$key: $val\n";
1581 =item post_constants
1590 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1591 $self = $ExtUtils::MakeMaker::Parent[-1];
1605 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1606 $self = $ExtUtils::MakeMaker::Parent[-1];
1612 foreach $key (qw(INSTALLPRIVLIB INSTALLARCHLIB INSTALLBIN
1613 INSTALLMAN1DIR INSTALLMAN3DIR LIBPERL_A
1614 LINKTYPE PREFIX INSTALLSITELIB
1615 INSTALLSITEARCH INSTALLDIRS)){
1616 push @pasthru, "$key=\"\$($key)\"";
1619 push @m, "\nPASTHRU = ", join ("\\\n\t", @pasthru), "\n";
1630 # --- Translation Sections ---
1634 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1635 $self = $ExtUtils::MakeMaker::Parent[-1];
1637 return '' unless $self->needs_linking();
1641 $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
1644 $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.C
1647 $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.cpp
1650 $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.cxx
1653 $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.cc
1667 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1668 $self = $ExtUtils::MakeMaker::Parent[-1];
1670 return '' unless $self->needs_linking();
1673 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs >$*.tc && mv $*.tc $@
1683 sub xs_o { # many makes are too dumb to use xs_c then c_o
1686 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1687 $self = $ExtUtils::MakeMaker::Parent[-1];
1689 return '' unless $self->needs_linking();
1692 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs >xstmp.c && mv xstmp.c $*.c
1693 $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
1704 # --- Target Sections ---
1708 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1709 $self = $ExtUtils::MakeMaker::Parent[-1];
1713 all :: config $(INST_PM) subdirs linkext manifypods
1715 subdirs :: $(MYEXTLIB)
1719 config :: '.$self->{MAKEFILE}.' $(INST_LIBDIR)/.exists
1721 config :: $(INST_ARCHAUTODIR)/.exists
1723 config :: $(INST_AUTODIR)/.exists
1727 config :: Version_check
1729 } unless $self->{PARENT} or ($self->{PERL_SRC} && $self->{INSTALLDIRS} eq "perl");
1731 push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
1733 if (%{$self->{MAN1PODS}}) {
1735 config :: $(INST_MAN1DIR)/.exists
1738 push @m, $self->dir_target(qw[$(INST_MAN1DIR)]);
1740 if (%{$self->{MAN3PODS}}) {
1742 config :: $(INST_MAN3DIR)/.exists
1745 push @m, $self->dir_target(qw[$(INST_MAN3DIR)]);
1749 $(O_FILES): $(H_FILES)
1750 ' if @{$self->{O_FILES} || []} && @{$self->{H} || []};
1754 perldoc ExtUtils::MakeMaker
1759 }.$self->{NOECHO}.q{$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
1760 -MExtUtils::MakeMaker=Version_check \
1761 -e 'Version_check("$(MM_VERSION)")'
1774 my($self, %attribs) = @_;
1776 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1777 $self = $ExtUtils::MakeMaker::Parent[-1];
1779 # LINKTYPE => static or dynamic or ''
1780 my($linktype) = defined $attribs{LINKTYPE} ?
1781 $attribs{LINKTYPE} : '$(LINKTYPE)';
1783 linkext :: $linktype
1795 my($self,%attribs) = @_;
1797 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1798 $self = $ExtUtils::MakeMaker::Parent[-1];
1801 return '' unless ($Config::Config{osname} eq 'aix' && $self->needs_linking() );
1803 my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {};
1804 my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || [];
1808 dynamic :: $self->{BASEEXT}.exp
1810 ") unless $self->{SKIPHASH}{'dynamic'}; # dynamic and static are subs, so...
1813 static :: $self->{BASEEXT}.exp
1815 ") unless $self->{SKIPHASH}{'static'}; # we avoid a warning if we tick them
1818 $self->{BASEEXT}.exp: Makefile.PL
1819 ",' $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e \'use ExtUtils::Mksymlists; \\
1820 Mksymlists("NAME" => "',$self->{NAME},'", "DL_FUNCS" => ',
1821 neatvalue($funcs),', "DL_VARS" => ', neatvalue($vars), ');\'
1834 # --- Dynamic Loading Sections ---
1838 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1839 $self = $ExtUtils::MakeMaker::Parent[-1];
1842 # $(INST_PM) has been moved to the all: target.
1843 # It remains here for awhile to allow for old usage: "make dynamic"
1844 dynamic :: '.$self->{MAKEFILE}.' $(INST_DYNAMIC) $(INST_BOOT) $(INST_PM)
1856 my($self, %attribs) = @_;
1858 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1859 $self = $ExtUtils::MakeMaker::Parent[-1];
1863 ' unless $self->has_link_code();
1866 BOOTSTRAP = '."$self->{BASEEXT}.bs".'
1868 # As Mkbootstrap might not write a file (if none is required)
1869 # we use touch to prevent make continually trying to remake it.
1870 # The DynaLoader only reads a non-empty file.
1871 $(BOOTSTRAP): '."$self->{MAKEFILE} $self->{BOOTDEP}".' $(INST_ARCHAUTODIR)/.exists
1872 '.$self->{NOECHO}.'echo "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
1873 '.$self->{NOECHO}.'$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \
1874 -e \'use ExtUtils::Mkbootstrap;\' \
1875 -e \'Mkbootstrap("$(BASEEXT)","$(BSLOADLIBS)");\'
1876 '.$self->{NOECHO}.'$(TOUCH) $(BOOTSTRAP)
1879 $(INST_BOOT): $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists
1880 '."$self->{NOECHO}$self->{RM_RF}".' $(INST_BOOT)
1881 -'.$self->{CP}.' $(BOOTSTRAP) $(INST_BOOT)
1893 my($self, %attribs) = @_;
1895 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1896 $self = $ExtUtils::MakeMaker::Parent[-1];
1898 return '' unless $self->needs_linking(); #might be because of a subdir
1900 return '' unless $self->has_link_code;
1902 my($otherldflags) = $attribs{OTHERLDFLAGS} || "";
1903 my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
1904 my($armaybe) = $attribs{ARMAYBE} || $self->{ARMAYBE} || ":";
1905 my($ldfrom) = '$(LDFROM)';
1906 my($osname) = $Config::Config{osname};
1907 $armaybe = 'ar' if ($osname eq 'dec_osf' and $armaybe eq ':');
1910 # This section creates the dynamically loadable $(INST_DYNAMIC)
1911 # from $(OBJECT) and possibly $(MYEXTLIB).
1912 ARMAYBE = '.$armaybe.'
1913 OTHERLDFLAGS = '.$otherldflags.'
1914 INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
1916 $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
1918 if ($armaybe ne ':'){
1919 $ldfrom = 'tmp$(LIB_EXT)';
1920 push(@m,' $(ARMAYBE) cr '.$ldfrom.' $(OBJECT)'."\n");
1921 push(@m,' $(RANLIB) '."$ldfrom\n");
1923 $ldfrom = "-all $ldfrom -none" if ($osname eq 'dec_osf');
1924 push(@m,' LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) -o $@ $(LDDLFLAGS) '.$ldfrom.
1925 ' $(OTHERLDFLAGS) $(MYEXTLIB) $(LDLOADLIBS) $(EXPORT_LIST) $(PERL_ARCHIVE)');
1930 push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
1941 # --- Static Loading Sections ---
1945 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1946 $self = $ExtUtils::MakeMaker::Parent[-1];
1949 # $(INST_PM) has been moved to the all: target.
1950 # It remains here for awhile to allow for old usage: "make static"
1951 static :: '.$self->{MAKEFILE}.' $(INST_STATIC) $(INST_PM)
1965 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1966 $self = $ExtUtils::MakeMaker::Parent[-1];
1968 # Come to think of it, if there are subdirs with linkcode, we still have no INST_STATIC
1969 # return '' unless $self->needs_linking(); #might be because of a subdir
1971 return '' unless $self->has_link_code;
1975 $(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)/.exists
1977 # If this extension has it's own library (eg SDBM_File)
1978 # then copy that to $(INST_STATIC) and add $(OBJECT) into it.
1979 push(@m, "\t$self->{CP} \$(MYEXTLIB) \$\@\n") if $self->{MYEXTLIB};
1982 q{ $(AR) $(AR_STATIC_ARGS) $@ $(OBJECT) && $(RANLIB) $@
1983 }.$self->{NOECHO}.q{echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)/extralibs.ld
1987 # Old mechanism - still available:
1989 push @m, "\t$self->{NOECHO}".q{echo "$(EXTRALIBS)" >> $(PERL_SRC)/ext.libs}."\n\n"
1990 if $self->{PERL_SRC};
1992 push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
2003 my($self, %attribs) = @_;
2005 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2006 $self = $ExtUtils::MakeMaker::Parent[-1];
2008 # By default .pm files are split into the architecture independent
2009 # library. This is a good thing. If a specific module requires that
2010 # it's .pm files are split into the architecture specific library
2011 # then it should use: installpm => {SPLITLIB=>'$(INST_ARCHLIB)'}
2012 # Note that installperl currently interferes with this (Config.pm)
2013 # User can disable split by saying: installpm => {SPLITLIB=>''}
2014 my($splitlib) = '$(INST_LIB)'; # NOT arch specific by default
2015 $splitlib = $attribs{SPLITLIB} if exists $attribs{SPLITLIB};
2017 push @m, "inst_pm :: \$(INST_PM)\n\n";
2018 foreach $dist (sort keys %{$self->{PM}}){
2019 my($inst) = $self->{PM}->{$dist};
2020 push(@m, "\n# installpm: $dist => $inst, splitlib=$splitlib\n");
2021 push(@m, $self->installpm_x($dist, $inst, $splitlib));
2033 sub installpm_x { # called by installpm per file
2034 my($self, $dist, $inst, $splitlib) = @_;
2036 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2037 $self = $ExtUtils::MakeMaker::Parent[-1];
2039 if ($inst =~ m,[:\#],){
2040 warn "Warning: 'make' would have problems processing this file: '$inst', SKIPPED\n";
2043 my($instdir) = $inst =~ m|(.*)/|;
2046 $inst: $dist $self->{MAKEFILE} $instdir/.exists \$(INST_ARCHAUTODIR)/.exists
2047 $self->{NOECHO}$self->{RM_F}".' $@
2048 $(UMASK_NULL) && '."$self->{CP} $dist".' $@
2050 push(@m, "\t$self->{NOECHO}\$(AUTOSPLITFILE) \$@ $splitlib/auto\n")
2051 if ($splitlib and $inst =~ m/\.pm$/);
2053 push @m, $self->dir_target($instdir);
2064 my($self, %attribs) = @_;
2066 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2067 $self = $ExtUtils::MakeMaker::Parent[-1];
2069 return "\nmanifypods :\n" unless %{$self->{MAN3PODS}};
2072 if (defined $self->{PERL_SRC}) {
2073 $pod2man_exe = $self->catfile($self->{PERL_SRC},'pod','pod2man');
2075 $pod2man_exe = $self->catfile($Config{bin},'pod2man');
2077 unless ($self->perl_script($pod2man_exe)) {
2078 # No pod2man but some MAN3PODS to be installed
2081 Warning: I could not locate your pod2man program. Please make sure,
2082 your pod2man program is in your PATH before you execute 'make'
2085 $pod2man_exe = "-S pod2man";
2089 qq[POD2MAN_EXE = $pod2man_exe\n],
2090 q[POD2MAN = $(PERL) -we '%m=@ARGV;for (keys %m){' \\
2091 -e 'next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M "].$self->{MAKEFILE}.q[";' \\
2092 -e 'print "Manifying $$m{$$_}\n";' \\
2093 -e 'system("$$^X \\"-I$(PERL_ARCHLIB)\\" \\"-I$(PERL_LIB)\\" $(POD2MAN_EXE) $$_>$$m{$$_}")==0 or warn "Couldn\\047t install $$m{$$_}\n";' \\
2094 -e 'chmod 0644, $$m{$$_} or warn "chmod 644 $$m{$$_}: $$!\n";}'
2096 push @m, "\nmanifypods : ";
2097 push @m, join " \\\n\t", keys %{$self->{MAN1PODS}}, keys %{$self->{MAN3PODS}};
2100 if (%{$self->{MAN1PODS}} || %{$self->{MAN3PODS}}) {
2101 push @m, "\t$self->{NOECHO}\$(POD2MAN) \\\n\t";
2102 push @m, join " \\\n\t", %{$self->{MAN1PODS}}, %{$self->{MAN3PODS}};
2116 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2117 $self = $ExtUtils::MakeMaker::Parent[-1];
2119 return "" unless $self->{PL_FILES};
2121 foreach $plfile (sort keys %{$self->{PL_FILES}}) {
2123 all :: $self->{PL_FILES}->{$plfile}
2125 $self->{PL_FILES}->{$plfile} :: $plfile
2126 \$(PERL) -I\$(INST_ARCHLIB) -I\$(INST_LIB) -I\$(PERL_ARCHLIB) -I\$(PERL_LIB) $plfile
2140 return "" unless $self->{EXE_FILES} && ref $self->{EXE_FILES} eq "ARRAY";
2141 return "" unless @{$self->{EXE_FILES}};
2142 my(@m, $from, $to, %fromto, @to);
2143 push @m, $self->dir_target(qw[$(INST_EXE)]);
2144 for $from (@{$self->{EXE_FILES}}) {
2145 my($path)= '$(INST_EXE)/' . basename($from);
2146 local($_) = $path; # for backwards compatibility
2147 $to = $self->libscan($path);
2148 print "libscan($from) => '$to'\n" if ($Verbose >=2);
2151 @to = values %fromto;
2153 EXE_FILES = @{$self->{EXE_FILES}}
2161 while (($from,$to) = each %fromto) {
2162 my $todir = dirname($to);
2164 $to: $from $self->{MAKEFILE} $todir/.exists
2165 $self->{CP} $from $to
2178 # --- Sub-directory Sections ---
2181 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2182 $self = $ExtUtils::MakeMaker::Parent[-1];
2185 # This method provides a mechanism to automatically deal with
2186 # subdirectories containing further Makefile.PL scripts.
2187 # It calls the subdir_x() method for each subdirectory.
2188 foreach $dir (@{$self->{DIR}}){
2189 push(@m, $self->subdir_x($dir));
2190 #### print "Including $dir subdirectory\n";
2194 # The default clean, realclean and test targets in this Makefile
2195 # have automatically been given entries for each subdir.
2199 push(@m, "\n# none")
2211 my($self, $subdir) = @_;
2213 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2214 $self = $ExtUtils::MakeMaker::Parent[-1];
2220 $self->{NOECHO}-cd $subdir && \$(MAKE) all \$(PASTHRU)
2232 # --- Cleanup and Distribution Sections ---
2234 my($self, %attribs) = @_;
2236 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2237 $self = $ExtUtils::MakeMaker::Parent[-1];
2241 # Delete temporary files but do not touch installed files. We don\'t delete
2242 # the Makefile here so a later make realclean still has a makefile to use.
2246 # clean subdirectories first
2247 for $dir (@{$self->{DIR}}) {
2248 push @m, "\t-cd $dir && test -f $self->{MAKEFILE} && \$(MAKE) clean\n";
2251 my(@otherfiles) = values %{$self->{XS}}; # .c files from *.xs files
2252 push(@otherfiles, $attribs{FILES}) if $attribs{FILES};
2253 push(@otherfiles, qw[./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all
2254 perlmain.c mon.out core so_locations
2256 *$(OBJ_EXT) *$(LIB_EXT)
2257 perl.exe $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def $(BASEEXT).exp
2259 push @m, "\t-$self->{RM_RF} @otherfiles\n";
2260 # See realclean and ext/utils/make_ext for usage of Makefile.old
2262 "\t-$self->{MV} $self->{MAKEFILE} $self->{MAKEFILE}.old 2>/dev/null\n");
2264 "\t$attribs{POSTOP}\n") if $attribs{POSTOP};
2275 my($self, %attribs) = @_;
2277 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2278 $self = $ExtUtils::MakeMaker::Parent[-1];
2282 # Delete temporary files (via clean) and also delete installed files
2283 realclean purge :: clean
2285 # realclean subdirectories first (already cleaned)
2286 my $sub = "\t-cd %s && test -f %s && \$(MAKE) %s realclean\n";
2287 foreach(@{$self->{DIR}}){
2288 push(@m, sprintf($sub,$_,"$self->{MAKEFILE}.old","-f $self->{MAKEFILE}.old"));
2289 push(@m, sprintf($sub,$_,"$self->{MAKEFILE}",''));
2291 push(@m, " $self->{RM_RF} \$(INST_AUTODIR) \$(INST_ARCHAUTODIR)\n");
2292 push(@m, " $self->{RM_F} \$(INST_DYNAMIC) \$(INST_BOOT)\n");
2293 push(@m, " $self->{RM_F} \$(INST_STATIC) \$(INST_PM)\n");
2294 my(@otherfiles) = ($self->{MAKEFILE},
2295 "$self->{MAKEFILE}.old"); # Makefiles last
2296 push(@otherfiles, $attribs{FILES}) if $attribs{FILES};
2297 push(@m, " $self->{RM_RF} @otherfiles\n") if @otherfiles;
2298 push(@m, " $attribs{POSTOP}\n") if $attribs{POSTOP};
2311 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2312 $self = $ExtUtils::MakeMaker::Parent[-1];
2316 distclean :: realclean distcheck
2321 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&fullcheck";' \\
2327 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&skipcheck";' \\
2333 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&mkmanifest";' \\
2348 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2349 $self = $ExtUtils::MakeMaker::Parent[-1];
2353 dist : $(DIST_DEFAULT)
2355 tardist : $(DISTVNAME).tar.$(SUFFIX)
2357 $(DISTVNAME).tar.$(SUFFIX) : distdir
2359 $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
2360 $(RM_RF) $(DISTVNAME)
2361 $(COMPRESS) $(DISTVNAME).tar
2364 uutardist : $(DISTVNAME).tar.$(SUFFIX)
2365 uuencode $(DISTVNAME).tar.$(SUFFIX) \\
2366 $(DISTVNAME).tar.$(SUFFIX) > \\
2367 $(DISTVNAME).tar.$(SUFFIX).uu
2371 $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
2372 $(RM_RF) $(DISTVNAME)
2387 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2388 $self = $ExtUtils::MakeMaker::Parent[-1];
2393 $(RM_RF) $(DISTVNAME)
2394 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "/mani/";' \\
2395 -e 'manicopy(maniread(),"$(DISTVNAME)", "$(DIST_CP)");'
2409 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2410 $self = $ExtUtils::MakeMaker::Parent[-1];
2415 cd $(DISTVNAME) && $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) Makefile.PL
2416 cd $(DISTVNAME) && $(MAKE)
2417 cd $(DISTVNAME) && $(MAKE) test
2431 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2432 $self = $ExtUtils::MakeMaker::Parent[-1];
2437 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&maniread";' \\
2438 -e '@all = keys %{ maniread() };' \\
2439 -e 'print("Executing $(CI) @all\n"); system("$(CI) @all");' \\
2440 -e 'print("Executing $(RCS_LABEL) ...\n"); system("$(RCS_LABEL) @all");'
2452 my($self, %attribs) = @_;
2454 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2455 $self = $ExtUtils::MakeMaker::Parent[-1];
2460 install :: all pure_install doc_install
2462 install_perl :: all pure_perl_install doc_perl_install
2464 install_site :: all pure_site_install doc_site_install
2466 install_ :: install_site
2467 @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
2469 pure_install :: pure_$(INSTALLDIRS)_install
2471 doc_install :: doc_$(INSTALLDIRS)_install
2472 }.$self->{NOECHO}.q{echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
2474 pure__install : pure_site_install
2475 @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
2477 doc__install : doc_site_install
2478 @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
2480 pure_perl_install ::
2481 }.$self->{NOECHO}.q{$(MOD_INSTALL) \
2482 read }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
2483 write }.$self->catfile('$(INSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
2484 $(INST_LIB) $(INSTALLPRIVLIB) \
2485 $(INST_ARCHLIB) $(INSTALLARCHLIB) \
2486 $(INST_EXE) $(INSTALLBIN) \
2487 $(INST_MAN1DIR) $(INSTALLMAN1DIR) \
2488 $(INST_MAN3DIR) $(INSTALLMAN3DIR)
2489 }.$self->{NOECHO}.q{$(WARN_IF_OLD_PACKLIST) \
2490 }.$self->catdir('$(SITEARCHEXP)','auto','$(FULLEXT)').q{
2493 pure_site_install ::
2494 }.$self->{NOECHO}.q{$(MOD_INSTALL) \
2495 read }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \
2496 write }.$self->catfile('$(INSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q{ \
2497 $(INST_LIB) $(INSTALLSITELIB) \
2498 $(INST_ARCHLIB) $(INSTALLSITEARCH) \
2499 $(INST_EXE) $(INSTALLBIN) \
2500 $(INST_MAN1DIR) $(INSTALLMAN1DIR) \
2501 $(INST_MAN3DIR) $(INSTALLMAN3DIR)
2502 }.$self->{NOECHO}.q{$(WARN_IF_OLD_PACKLIST) \
2503 }.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{
2506 }.$self->{NOECHO}.q{$(DOC_INSTALL) \
2508 "installed into" "$(INSTALLPRIVLIB)" \
2509 LINKTYPE "$(LINKTYPE)" \
2510 VERSION "$(VERSION)" \
2511 EXE_FILES "$(EXE_FILES)" \
2512 >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{
2515 }.$self->{NOECHO}.q{$(DOC_INSTALL) \
2517 "installed into" "$(INSTALLSITELIB)" \
2518 LINKTYPE "$(LINKTYPE)" \
2519 VERSION "$(VERSION)" \
2520 EXE_FILES "$(EXE_FILES)" \
2521 >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{
2526 uninstall :: uninstall_from_$(INSTALLDIRS)dirs
2528 uninstall_from_perldirs ::
2530 q{$(UNINSTALL) }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{
2532 uninstall_from_sitedirs ::
2534 q{$(UNINSTALL) }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{
2549 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2550 $self = $ExtUtils::MakeMaker::Parent[-1];
2552 '# Phony target to force checking subdirectories.
2566 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2567 $self = $ExtUtils::MakeMaker::Parent[-1];
2571 PERL_HDRS = $(PERL_INC)/EXTERN.h $(PERL_INC)/INTERN.h \
2572 $(PERL_INC)/XSUB.h $(PERL_INC)/av.h $(PERL_INC)/cop.h \
2573 $(PERL_INC)/cv.h $(PERL_INC)/dosish.h $(PERL_INC)/embed.h \
2574 $(PERL_INC)/form.h $(PERL_INC)/gv.h $(PERL_INC)/handy.h \
2575 $(PERL_INC)/hv.h $(PERL_INC)/keywords.h $(PERL_INC)/mg.h \
2576 $(PERL_INC)/op.h $(PERL_INC)/opcode.h $(PERL_INC)/patchlevel.h \
2577 $(PERL_INC)/perl.h $(PERL_INC)/perly.h $(PERL_INC)/pp.h \
2578 $(PERL_INC)/proto.h $(PERL_INC)/regcomp.h $(PERL_INC)/regexp.h \
2579 $(PERL_INC)/scope.h $(PERL_INC)/sv.h $(PERL_INC)/unixish.h \
2580 $(PERL_INC)/util.h $(PERL_INC)/config.h
2585 $(OBJECT) : $(PERL_HDRS)
2586 ' if $self->{OBJECT};
2589 # Check for unpropogated config.sh changes. Should never happen.
2590 # We do NOT just update config.h because that is not sufficient.
2591 # An out of date config.h is not fatal but complains loudly!
2592 $(PERL_INC)/config.h: $(PERL_SRC)/config.sh
2593 -'.$self->{NOECHO}.'echo "Warning: $(PERL_INC)/config.h out of date with $(PERL_SRC)/config.sh"; false
2595 $(PERL_ARCHLIB)/Config.pm: $(PERL_SRC)/config.sh
2596 '.$self->{NOECHO}.'echo "Warning: $(PERL_ARCHLIB)/Config.pm may be out of date with $(PERL_SRC)/config.sh"
2597 cd $(PERL_SRC) && $(MAKE) lib/Config.pm
2598 ') if $self->{PERL_SRC};
2600 push(@m, join(" ", values %{$self->{XS}})." : \$(XSUBPPDEPS)\n")
2614 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2615 $self = $ExtUtils::MakeMaker::Parent[-1];
2618 # We do not know what target was originally specified so we
2619 # must force a manual rerun to be sure. But as it should only
2620 # happen very rarely it is not a significant problem.
2622 $(OBJECT) : $(FIRST_MAKEFILE)
2623 ' if $self->{OBJECT};
2626 # We take a very conservative approach here, but it\'s worth it.
2627 # We move Makefile to Makefile.old here to avoid gnu make looping.
2628 '.$self->{MAKEFILE}.' : Makefile.PL $(CONFIGDEP)
2629 '.$self->{NOECHO}.'echo "Makefile out-of-date with respect to $?"
2630 '.$self->{NOECHO}.'echo "Cleaning current config before rebuilding Makefile..."
2631 -'.$self->{NOECHO}.'mv '."$self->{MAKEFILE} $self->{MAKEFILE}.old".'
2632 -$(MAKE) -f '.$self->{MAKEFILE}.'.old clean >/dev/null 2>&1 || true
2633 $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" Makefile.PL '.join(" ",map(qq["$_"],@ARGV)).'
2634 '.$self->{NOECHO}.'echo ">>> Your Makefile has been rebuilt. <<<"
2635 '.$self->{NOECHO}.'echo ">>> Please rerun the make command. <<<"; false
2648 my($self, %attribs) = @_;
2650 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2651 $self = $ExtUtils::MakeMaker::Parent[-1];
2655 my(@searchdirs)=($self->{PERL_ARCHLIB}, $self->{SITEARCHEXP}, $self->{INST_ARCHLIB});
2657 # And as it's not yet built, we add the current extension
2658 # but only if it has some C code (or XS code, which implies C code)
2659 if (@{$self->{C}}) {
2660 @static="$self->{INST_ARCHLIB}/auto/$self->{FULLEXT}/$self->{BASEEXT}$self->{LIB_EXT}";
2663 # Either we determine now, which libraries we will produce in the
2664 # subdirectories or we do it at runtime of the make.
2666 # We could ask all subdir objects, but I cannot imagine, why it
2667 # would be necessary.
2669 # Instead we determine all libraries for the new perl at
2671 my(@perlinc) = ($self->{INST_ARCHLIB}, $self->{INST_LIB}, $self->{PERL_ARCHLIB}, $self->{PERL_LIB});
2673 $self->makeaperl(MAKE => $self->{MAKEFILE},
2674 DIRS => \@searchdirs,
2677 TARGET => $self->{MAP_TARGET},
2679 LIBPERL => $self->{LIBPERL_A}
2690 # --- Test and Installation Sections ---
2692 my($self, %attribs) = @_;
2694 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2695 $self = $ExtUtils::MakeMaker::Parent[-1];
2697 my($tests) = $attribs{TESTS} || (-d "t" ? "t/*.t" : "");
2701 TEST_TYPE=test_\$(LINKTYPE)
2703 test :: \$(TEST_TYPE)
2705 push(@m, map("\t$self->{NOECHO}cd $_ && test -f $self->{MAKEFILE} && \$(MAKE) test \$(PASTHRU)\n",
2707 push(@m, "\t$self->{NOECHO}echo 'No tests defined for \$(NAME) extension.'\n")
2708 unless $tests or -f "test.pl" or @{$self->{DIR}};
2711 push(@m, "test_dynamic :: all\n");
2712 push(@m, $self->test_via_harness('$(FULLPERL)', $tests)) if $tests;
2713 push(@m, $self->test_via_script('$(FULLPERL)', 'test.pl')) if -f "test.pl";
2716 # Occasionally we may face this degenerate target:
2717 push @m, "test_ : test_dynamic\n\n";
2719 if ($self->needs_linking()) {
2720 push(@m, "test_static :: all \$(MAP_TARGET)\n");
2721 push(@m, $self->test_via_harness('./$(MAP_TARGET)', $tests)) if $tests;
2722 push(@m, $self->test_via_script('./$(MAP_TARGET)', 'test.pl')) if -f "test.pl";
2725 push @m, "test_static :: test_dynamic\n";
2730 =item test_via_harness
2736 sub test_via_harness {
2737 my($self, $perl, $tests) = @_;
2739 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2740 $self = $ExtUtils::MakeMaker::Parent[-1];
2742 "\tPERL_DL_NONLAZY=1 $perl".q! -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use Test::Harness qw(&runtests $$verbose); $$verbose=$(TEST_VERBOSE); runtests @ARGV;' !."$tests\n";
2745 =item test_via_script
2751 sub test_via_script {
2752 my($self, $perl, $script) = @_;
2754 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2755 $self = $ExtUtils::MakeMaker::Parent[-1];
2757 qq{\tPERL_DL_NONLAZY=1 $perl}.q{ -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) }.qq{$script
2763 Returns an empty string. Can be used in Makefile.PLs to write some
2764 text to the Makefile at the end.
2771 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2772 $self = $ExtUtils::MakeMaker::Parent[-1];
2779 Called by staticmake.
2784 my($self, %attribs) = @_;
2786 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2787 $self = $ExtUtils::MakeMaker::Parent[-1];
2789 my($makefilename, $searchdirs, $static, $extra, $perlinc, $target, $tmp, $libperl) =
2790 @attribs{qw(MAKE DIRS STAT EXTRA INCL TARGET TMP LIBPERL)};
2793 # --- MakeMaker makeaperl section ---
2794 MAP_TARGET = $target
2795 FULLPERL = $self->{FULLPERL}
2797 return join '', @m if $self->{PARENT};
2799 my($dir) = join ":", @{$self->{DIR}};
2801 unless ($self->{MAKEAPERL}) {
2803 $(MAP_TARGET) :: $(MAKE_APERL_FILE)
2804 $(MAKE) -f $(MAKE_APERL_FILE) static $@
2806 $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE)
2807 }.$self->{NOECHO}.q{echo Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
2808 }.$self->{NOECHO}.q{$(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
2809 Makefile.PL DIR=}, $dir, q{ \
2810 MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
2811 MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=};
2813 push @m, map( " \\\n\t\t$_", @ARGV );
2821 my($cccmd, $linkcmd, $lperl);
2824 $cccmd = $self->const_cccmd($libperl);
2825 $cccmd =~ s/^CCCMD\s*=\s*//;
2826 $cccmd =~ s/\$\(INC\)/ -I$self->{PERL_INC} /;
2827 $cccmd .= " $Config::Config{cccdlflags}" if ($Config::Config{d_shrplib});
2828 $cccmd =~ s/\n/ /g; # yes I've seen "\n", don't ask me where it came from. A.K.
2829 $cccmd =~ s/\(CC\)/\(PERLMAINCC\)/;
2831 # The front matter of the linkcommand...
2832 $linkcmd = join ' ', "\$(CC)",
2833 grep($_, @Config{qw(large split ldflags ccdlflags)});
2834 $linkcmd =~ s/\s+/ /g;
2836 # Which *.a files could we make use of...
2838 File::Find::find(sub {
2839 return unless m/\Q$self->{LIB_EXT}\E$/;
2840 return if m/^libperl/;
2841 # don't include the installed version of this extension. I
2842 # leave this line here, although it is not necessary anymore:
2843 # I patched minimod.PL instead, so that Miniperl.pm won't
2844 # enclude duplicates
2846 # Once the patch to minimod.PL is in the distribution, I can
2848 return if $File::Find::name =~ m:auto/$self->{FULLEXT}/$self->{BASEEXT}$self->{LIB_EXT}$:;
2849 $static{fastcwd() . "/" . $_}++;
2850 }, grep( -d $_, @{$searchdirs || []}) );
2852 # We trust that what has been handed in as argument, will be buildable
2853 $static = [] unless $static;
2854 @static{@{$static}} = (1) x @{$static};
2856 $extra = [] unless $extra && ref $extra eq 'ARRAY';
2857 for (sort keys %static) {
2858 next unless /\Q$self->{LIB_EXT}\E$/;
2859 $_ = dirname($_) . "/extralibs.ld";
2863 grep(s/^/-I/, @{$perlinc || []});
2865 $target = "perl" unless $target;
2866 $tmp = "." unless $tmp;
2868 # MAP_STATIC doesn't look into subdirs yet. Once "all" is made and we
2869 # regenerate the Makefiles, MAP_STATIC and the dependencies for
2870 # extralibs.all are computed correctly
2872 MAP_LINKCMD = $linkcmd
2873 MAP_PERLINC = @{$perlinc || []}
2875 join(" \\\n\t", reverse sort keys %static), "
2877 MAP_PRELIBS = $Config::Config{libs} $Config::Config{cryptlib}
2880 if (defined $libperl) {
2881 ($lperl = $libperl) =~ s/\$\(A\)/$self->{LIB_EXT}/;
2883 unless ($libperl && -f $lperl) { # Ilya's code...
2884 my $dir = $self->{PERL_SRC} || "$self->{PERL_ARCHLIB}/CORE";
2885 $libperl ||= "libperl$self->{LIB_EXT}";
2886 $libperl = "$dir/$libperl";
2887 $lperl ||= "libperl$self->{LIB_EXT}";
2888 $lperl = "$dir/$lperl";
2889 print STDOUT "Warning: $libperl not found
2890 If you're going to build a static perl binary, make sure perl is installed
2891 otherwise ignore this warning\n"
2892 unless (-f $lperl || defined($self->{PERL_SRC}));
2896 MAP_LIBPERL = $libperl
2900 \$(INST_ARCHAUTODIR)/extralibs.all: \$(INST_ARCHAUTODIR)/.exists ".join(" \\\n\t", @$extra)."
2901 $self->{NOECHO}$self->{RM_F} \$\@
2902 $self->{NOECHO}\$(TOUCH) \$\@
2906 foreach $catfile (@$extra){
2907 push @m, "\tcat $catfile >> \$\@\n";
2911 \$(MAP_TARGET) :: $tmp/perlmain\$(OBJ_EXT) \$(MAP_LIBPERL) \$(MAP_STATIC) \$(INST_ARCHAUTODIR)/extralibs.all
2912 \$(MAP_LINKCMD) -o \$\@ $tmp/perlmain\$(OBJ_EXT) \$(MAP_LIBPERL) \$(MAP_STATIC) `cat \$(INST_ARCHAUTODIR)/extralibs.all` \$(MAP_PRELIBS)
2913 $self->{NOECHO}echo 'To install the new \"\$(MAP_TARGET)\" binary, call'
2914 $self->{NOECHO}echo ' make -f $makefilename inst_perl MAP_TARGET=\$(MAP_TARGET)'
2915 $self->{NOECHO}echo 'To remove the intermediate files say'
2916 $self->{NOECHO}echo ' make -f $makefilename map_clean'
2918 $tmp/perlmain\$(OBJ_EXT): $tmp/perlmain.c
2920 push @m, "\tcd $tmp && $cccmd -I\$(PERL_INC) perlmain.c\n";
2923 $tmp/perlmain.c: $makefilename}, q{
2924 }.$self->{NOECHO}.q{echo Writing $@
2925 }.$self->{NOECHO}.q{$(PERL) $(MAP_PERLINC) -e 'use ExtUtils::Miniperl; \\
2926 writemain(grep s#.*/auto/##, qw|$(MAP_STATIC)|)' > $@.tmp && mv $@.tmp $@
2932 }.$self->{NOECHO}.q{echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
2933 }.$self->{NOECHO}.q{$(DOC_INSTALL) \
2934 "Perl binary $(MAP_TARGET)" \
2935 MAP_STATIC "$(MAP_STATIC)" \
2936 MAP_EXTRA "`cat $(INST_ARCHAUTODIR)/extralibs.all`" \
2937 MAP_LIBPERL "$(MAP_LIBPERL)" \
2938 >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{
2943 inst_perl: pure_inst_perl doc_inst_perl
2945 pure_inst_perl: \$(MAP_TARGET)
2946 $self->{CP} \$(MAP_TARGET) \$(INSTALLBIN)/\$(MAP_TARGET)
2951 $self->{RM_F} $tmp/perlmain\$(OBJ_EXT) $tmp/perlmain.c \$(MAP_TARGET) $makefilename \$(INST_ARCHAUTODIR)/extralibs.all
2959 Called by init_others.
2964 my($self,$libs) = @_;
2966 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2967 $self = $ExtUtils::MakeMaker::Parent[-1];
2969 $self->ext($libs, $Verbose);
2974 Takes an array of directories that need to exist and returns a
2975 Makefile entry for a .exists file in these directories. Returns
2976 nothing, if the entry has already been processed. We're helpless
2977 though, if the same directory comes as $(FOO) _and_ as "bar". Both of
2978 them get an entry, that's why we use "::".
2983 # --- Make-Directories section (internal method) ---
2984 # dir_target(@array) returns a Makefile entry for the file .exists in each
2985 # named directory. Returns nothing, if the entry has already been processed.
2986 # We're helpless though, if the same directory comes as $(FOO) _and_ as "bar".
2987 # Both of them get an entry, that's why we use "::". I chose '$(PERL)' as the
2988 # prerequisite, because there has to be one, something that doesn't change
2991 my($self,@dirs) = @_;
2993 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2994 $self = $ExtUtils::MakeMaker::Parent[-1];
2997 foreach $dir (@dirs) {
2998 next if $self->{DIR_TARGET}{$self}{$dir}++;
3000 $dir/.exists :: }.$self->catfile($self->{PERL_INC},"perl.h").qq{
3001 $self->{NOECHO}\$(MKPATH) $dir
3002 $self->{NOECHO}\$(EQUALIZE_TIMESTAMP) \$(PERL) $dir/.exists
3003 -$self->{NOECHO}\$(CHMOD) 755 $dir
3011 Does this module need linking? Looks into subdirectory objects (see
3012 also has_link_code())
3019 $caller = (caller(0))[3];
3021 ExtUtils::MakeMaker::TieAtt::warndirectuse($caller);
3022 $self = $ExtUtils::MakeMaker::Parent[-1];
3024 Carp::confess("Needs_linking called too early") if $caller =~ /^ExtUtils::MakeMaker::/;
3025 return $self->{NEEDS_LINKING} if defined $self->{NEEDS_LINKING};
3026 if ($self->has_link_code or $self->{MAKEAPERL}){
3027 $self->{NEEDS_LINKING} = 1;
3030 foreach $child (keys %{$self->{CHILDREN}}) {
3031 if ($self->{CHILDREN}->{$child}->needs_linking) {
3032 $self->{NEEDS_LINKING} = 1;
3036 return $self->{NEEDS_LINKING} = 0;
3041 Returns true if C, XS, MYEXTLIB or similar objects exist within this
3042 object that need a compiler. Does not descend into subdirectories as
3043 needs_linking() does.
3049 return $self->{HAS_LINK_CODE} if defined $self->{HAS_LINK_CODE};
3050 if ($self->{OBJECT} or @{$self->{C} || []} or $self->{MYEXTLIB}){
3051 $self->{HAS_LINK_CODE} = 1;
3054 return $self->{HAS_LINK_CODE} = 0;
3059 Obsolete, depecated method.
3064 # --- perllocal.pod section ---
3065 my($self,$what,$name,@attribs)=@_;
3067 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
3068 $self = $ExtUtils::MakeMaker::Parent[-1];
3070 my $time = localtime;
3071 print "=head2 $time: $what C<$name>\n\n=over 4\n\n=item *\n\n";
3072 print join "\n\n=item *\n\n", map("C<$_>",@attribs);
3073 print "\n\n=back\n\n";
3078 L<ExtUtils::MakeMaker>