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$/i){
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$/$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 next if $once_only{$m};
1019 push @m, "\U$m\E = ".$self->{uc $m}."\n";
1034 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1035 $self = $ExtUtils::MakeMaker::Parent[-1];
1040 AR_STATIC_ARGS NAME DISTNAME NAME_SYM VERSION VERSION_SYM XS_VERSION
1041 INST_LIB INST_ARCHLIB INST_EXE PREFIX INSTALLDIRS INSTALLPRIVLIB
1042 INSTALLARCHLIB INSTALLSITELIB INSTALLSITEARCH INSTALLBIN PERL_LIB
1043 PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
1044 FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC PERL_INC PERL FULLPERL
1046 next unless defined $self->{$tmp};
1047 push @m, "$tmp = $self->{$tmp}\n";
1051 VERSION_MACRO = VERSION
1052 DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\"
1053 XS_VERSION_MACRO = XS_VERSION
1054 XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\"
1058 MAKEMAKER = \$(PERL_LIB)/ExtUtils/MakeMaker.pm
1059 MM_VERSION = $ExtUtils::MakeMaker::VERSION
1060 MM_REVISION = $Revision
1064 # FULLEXT = Pathname for extension directory (eg DBD/Oracle).
1065 # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT.
1066 # ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD)
1067 # DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
1071 FULLEXT BASEEXT ROOTEXT DLBASE VERSION_FROM INC DEFINE OBJECT OBJECT
1074 next unless defined $self->{$tmp};
1075 push @m, "$tmp = $self->{$tmp}\n";
1079 # Handy lists of source code files:
1080 XS_FILES= ".join(" \\\n\t", sort keys %{$self->{XS}})."
1081 C_FILES = ".join(" \\\n\t", @{$self->{C}})."
1082 O_FILES = ".join(" \\\n\t", @{$self->{O_FILES}})."
1083 H_FILES = ".join(" \\\n\t", @{$self->{H}})."
1084 MAN1PODS = ".join(" \\\n\t", sort keys %{$self->{MAN1PODS}})."
1085 MAN3PODS = ".join(" \\\n\t", sort keys %{$self->{MAN3PODS}})."
1089 INST_MAN1DIR INSTALLMAN1DIR MAN1EXT INST_MAN3DIR INSTALLMAN3DIR MAN3EXT
1091 next unless defined $self->{$tmp};
1092 push @m, "$tmp = $self->{$tmp}\n";
1096 # work around a famous dec-osf make(1) feature(?):
1099 .SUFFIXES: .xs .c .C \$(OBJ_EXT)
1101 # Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
1102 # some make implementations will delete the Makefile when we rebuild it. Because
1103 # we call false(1) when we rebuild it. So make(1) is not completely wrong when it
1104 # does so. Our milage may vary.
1105 # .PRECIOUS: Makefile # seems to be not necessary anymore
1107 .PHONY: all config static dynamic test linkext manifest
1109 # Where is the Config information that we are using/depend on
1110 CONFIGDEP = \$(PERL_ARCHLIB)/Config.pm \$(PERL_INC)/config.h \$(VERSION_FROM)
1114 # Where to put things:
1115 INST_LIBDIR = $(INST_LIB)$(ROOTEXT)
1116 INST_ARCHLIBDIR = $(INST_ARCHLIB)$(ROOTEXT)
1118 INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT)
1119 INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT)
1122 if ($self->has_link_code()) {
1124 INST_STATIC = $(INST_ARCHAUTODIR)/$(BASEEXT)$(LIB_EXT)
1125 INST_DYNAMIC = $(INST_ARCHAUTODIR)/$(DLBASE).$(DLEXT)
1126 INST_BOOT = $(INST_ARCHAUTODIR)/$(BASEEXT).bs
1137 $tmp = "$self->{BASEEXT}.def";
1146 $tmp = "\$(PERL_INC)/libperl.lib";
1155 INST_PM = '.join(" \\\n\t", sort values %{$self->{PM}}).'
1161 =item const_loadlibs
1167 sub const_loadlibs {
1170 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1171 $self = $ExtUtils::MakeMaker::Parent[-1];
1173 return "" unless $self->needs_linking;
1174 # This description can be deleted after ExtUtils::Liblist is in
1175 # the perl dist with pods
1177 # $self->{NAME} might depend on some other libraries:
1178 # (These comments may need revising:)
1180 # Dependent libraries can be linked in one of three ways:
1182 # 1. (For static extensions) by the ld command when the perl binary
1183 # is linked with the extension library. See EXTRALIBS below.
1185 # 2. (For dynamic extensions) by the ld command when the shared
1186 # object is built/linked. See LDLOADLIBS below.
1188 # 3. (For dynamic extensions) by the DynaLoader when the shared
1189 # object is loaded. See BSLOADLIBS below.
1191 # EXTRALIBS = List of libraries that need to be linked with when
1192 # linking a perl binary which includes this extension
1193 # Only those libraries that actually exist are included.
1194 # These are written to a file and used when linking perl.
1196 # LDLOADLIBS = List of those libraries which can or must be linked into
1197 # the shared library when created using ld. These may be
1198 # static or dynamic libraries.
1199 # LD_RUN_PATH is a colon separated list of the directories
1200 # in LDLOADLIBS. It is passed as an environment variable to
1201 # the process that links the shared library.
1203 # BSLOADLIBS = List of those libraries that are needed but can be
1204 # linked in dynamically at run time on this platform.
1205 # SunOS/Solaris does not need this because ld records
1206 # the information (from LDLOADLIBS) into the object file.
1207 # This list is used to create a .bs (bootstrap) file.
1209 EXTRALIBS = $self->{EXTRALIBS}
1210 LDLOADLIBS = $self->{LDLOADLIBS}
1211 BSLOADLIBS = $self->{BSLOADLIBS}
1212 LD_RUN_PATH= $self->{LD_RUN_PATH}
1223 my($self,$libperl)=@_;
1225 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1226 $self = $ExtUtils::MakeMaker::Parent[-1];
1228 return $self->{CONST_CCCMD} if $self->{CONST_CCCMD};
1229 return '' unless $self->needs_linking();
1230 $libperl or $libperl = $self->{LIBPERL_A} || "libperl$self->{LIB_EXT}" ;
1231 $libperl =~ s/\.\$\(A\)$/$self->{LIB_EXT}/;
1232 # This is implemented in the same manner as extliblist,
1233 # e.g., do both and compare results during the transition period.
1234 my($cc,$ccflags,$optimize,$large,$split, $shflags)
1235 = @Config{qw(cc ccflags optimize large split shellflags)};
1238 $shflags = '' unless $shflags;
1239 my($prog, $uc, $perltype);
1244 DE => '-DDEBUGGING -DEMBED',
1245 M => '-DEMBED -DMULTIPLICITY',
1246 DM => '-DDEBUGGING -DEMBED -DMULTIPLICITY',
1249 if ($libperl =~ /libperl(\w*)\Q$self->{LIB_EXT}/){
1252 $uc = ""; # avoid warning
1254 $perltype = $map{$uc} ? $map{$uc} : "";
1262 ( $name = $self->{NAME} . "_cflags" ) =~ s/:/_/g ;
1263 if ($prog = $Config::Config{$name}) {
1264 # Expand hints for this extension via the shell
1265 print STDOUT "Processing $name hint:\n" if $Verbose;
1267 ccflags=\"$ccflags\"
1268 optimize=\"$optimize\"
1269 perltype=\"$perltype\"
1270 optdebug=\"$optdebug\"
1275 echo ccflags=\$ccflags
1276 echo optimize=\$optimize
1277 echo perltype=\$perltype
1278 echo optdebug=\$optdebug
1285 if ($line =~ /(.*?)=\s*(.*)\s*$/){
1287 print STDOUT " $1 = $2\n" if $Verbose;
1289 print STDOUT "Unrecognised result from hint: '$line'\n";
1292 ( $cc,$ccflags,$perltype,$optdebug,$optimize,$large,$split )=@cflags{
1293 qw( cc ccflags perltype optdebug optimize large split)};
1297 $optimize = $optdebug;
1300 my($new) = "$cc -c \$(INC) $ccflags $optimize $perltype $large $split";
1301 $new =~ s/^\s+//; $new =~ s/\s+/ /g; $new =~ s/\s+$//;
1304 $cccmd =~ s/^\s*\Q$Config::Config{cc}\E\s/\$(CC) /;
1305 $cccmd .= " \$(DEFINE_VERSION) \$(XS_DEFINE_VERSION)";
1306 $self->{CONST_CCCMD} = "CCCMD = $cccmd\n";
1309 =item tool_autosplit
1315 sub tool_autosplit {
1316 # --- Tool Sections ---
1318 my($self, %attribs) = @_;
1320 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1321 $self = $ExtUtils::MakeMaker::Parent[-1];
1324 $asl = "\$AutoSplit::Maxlen=$attribs{MAXLEN};" if $attribs{MAXLEN};
1326 # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
1327 AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e 'use AutoSplit;}.$asl.q{autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) ;'
1340 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1341 $self = $ExtUtils::MakeMaker::Parent[-1];
1343 my($xsdir) = "$self->{PERL_LIB}/ExtUtils";
1344 # drop back to old location if xsubpp is not in new location yet
1345 $xsdir = "$self->{PERL_SRC}/ext" unless (-f "$self->{PERL_LIB}/ExtUtils/xsubpp");
1346 my(@tmdeps) = ('$(XSUBPPDIR)/typemap');
1347 if( $self->{TYPEMAPS} ){
1349 foreach $typemap (@{$self->{TYPEMAPS}}){
1350 if( ! -f $typemap ){
1351 warn "Typemap $typemap not found.\n";
1354 push(@tmdeps, $typemap);
1358 push(@tmdeps, "typemap") if -f "typemap";
1359 my(@tmargs) = map("-typemap $_", @tmdeps);
1360 if( exists $self->{XSOPT} ){
1361 unshift( @tmargs, $self->{XSOPT} );
1364 my $xsubpp_version = $self->xsubpp_version("$xsdir/xsubpp");
1366 # What are the correct thresholds for version 1 && 2 Paul?
1367 if ( $xsubpp_version > 1.923 ){
1368 $self->{XSPROTOARG} = "" unless defined $self->{XSPROTOARG};
1370 if (defined $self->{XSPROTOARG} && $self->{XSPROTOARG} =~ /\-prototypes/) {
1371 print STDOUT qq{Warning: This extension wants to pass the switch "-prototypes" to xsubpp.
1372 Your version of xsubpp is $xsubpp_version and cannot handle this.
1373 Please upgrade to a more recent version of xsubpp.
1376 $self->{XSPROTOARG} = "";
1382 XSUBPP = \$(XSUBPPDIR)/xsubpp
1383 XSPROTOARG = $self->{XSPROTOARG}
1384 XSUBPPDEPS = @tmdeps
1385 XSUBPPARGS = @tmargs
1391 my($self,$xsubpp) = @_;
1394 # try to figure out the version number of the xsubpp on the system
1396 # first try the -v flag, introduced in 1.921 & 2.000a2
1398 my $command = "$self->{PERL} $xsubpp -v 2>&1";
1399 print "Running $command\n" if $Verbose >= 2;
1400 $version = `$command` ;
1401 warn "Running '$command' exits with status " . ($?>>8) if $?;
1404 return $1 if $version =~ /^xsubpp version (.*)/ ;
1406 # nope, then try something else
1408 my $counter = '000';
1409 my ($file) = 'temp' ;
1410 $counter++ while -e "$file$counter"; # don't overwrite anything
1413 open(F, ">$file") or die "Cannot open file '$file': $!\n" ;
1415 MODULE = fred PACKAGE = fred
1424 $command = "$self->{PERL} $xsubpp $file 2>&1";
1425 print "Running $command\n" if $Verbose >= 2;
1426 my $text = `$command` ;
1427 warn "Running '$command' exits with status " . ($?>>8) if $?;
1430 # gets 1.2 -> 1.92 and 2.000a1
1431 return $1 if $text =~ /automatically by xsubpp version ([\S]+)\s*/ ;
1433 # it is either 1.0 or 1.1
1434 return 1.1 if $text =~ /^Warning: ignored semicolon/ ;
1436 # none of the above, so 1.0
1449 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1450 $self = $ExtUtils::MakeMaker::Parent[-1];
1455 TOUCH = $self->{TOUCH}
1458 RM_F = $self->{RM_F}
1459 RM_RF = $self->{RM_RF}
1460 CHMOD = $self->{CHMOD}
1461 UMASK_NULL = $self->{UMASK_NULL}
1463 # The following is a portable way to say mkdir -p
1464 # To see which directories are created, change the if 0 to if 1
1465 MKPATH = $(PERL) -wle '$$"="/"; foreach $$p (@ARGV){' \\
1466 -e 'next if -d $$p; my(@p); foreach(split(/\//,$$p)){' \\
1467 -e 'push(@p,$$_); next if -d "@p/"; print "mkdir @p" if 0;' \\
1468 -e 'mkdir("@p",0777)||die $$! } } exit 0;'
1470 # This helps us to minimize the effect of the .exists files A yet
1471 # better solution would be to have a stable file in the perl
1472 # distribution with a timestamp of zero. But this solution doesn't
1473 # need any changes to the core distribution and works with older perls
1474 EQUALIZE_TIMESTAMP = $(PERL) -we 'open F, ">$$ARGV[1]"; close F;' \\
1475 -e 'utime ((stat("$$ARGV[0]"))[8,9], $$ARGV[1])'
1477 # Here we warn users that an old packlist file was found somewhere,
1478 # and that they should call some uninstall routine
1479 WARN_IF_OLD_PACKLIST = $(PERL) -we 'exit unless -f $$ARGV[0];' \\
1480 -e 'print "WARNING: I have found an old package in\n";' \\
1481 -e 'print "\t$$ARGV[0].\n";' \\
1482 -e 'print "Please make sure the two installations are not conflicting\n";'
1484 MOD_INSTALL = $(PERL) -I$(INST_LIB) -MExtUtils::Install \
1485 -e 'install({@ARGV},1);'
1487 DOC_INSTALL = $(PERL) -e '$$\="\n\n";print "=head3 ", scalar(localtime), ": C<", shift, ">";' \
1488 -e 'print "=over 4";' \
1489 -e 'while ($$key = shift and $$val = shift){print "=item *";print "C<$$key: $$val>";}' \
1492 UNINSTALL = $(PERL) -MExtUtils::Install \
1493 -e 'uninstall($$ARGV[0],1);'
1505 my($self, %attribs) = @_;
1507 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1508 $self = $ExtUtils::MakeMaker::Parent[-1];
1511 # VERSION should be sanitised before use as a file name
1512 my($name) = $attribs{NAME} || '$(DISTVNAME)';
1513 my($tar) = $attribs{TAR} || 'tar'; # eg /usr/bin/gnutar
1514 my($tarflags) = $attribs{TARFLAGS} || 'cvf';
1515 my($compress) = $attribs{COMPRESS} || 'compress'; # eg gzip
1516 my($suffix) = $attribs{SUFFIX} || 'Z'; # eg gz
1517 my($shar) = $attribs{SHAR} || 'shar'; # eg "shar --gzip"
1518 my($preop) = $attribs{PREOP} || "$self->{NOECHO}true"; # eg update MANIFEST
1519 my($postop) = $attribs{POSTOP} || "$self->{NOECHO}true"; # eg remove the distdir
1520 my($ci) = $attribs{CI} || 'ci -u';
1521 my($rcs_label)= $attribs{RCS_LABEL}|| 'rcs -Nv$(VERSION_SYM): -q';
1522 my($dist_cp) = $attribs{DIST_CP} || 'best';
1523 my($dist_default) = $attribs{DIST_DEFAULT} || 'tardist';
1526 DISTVNAME = \$(DISTNAME)-\$(VERSION)
1528 TARFLAGS = $tarflags
1529 COMPRESS = $compress
1535 RCS_LABEL = $rcs_label
1537 DIST_DEFAULT = $dist_default
1549 my($self,%attribs) = @_;
1551 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1552 $self = $ExtUtils::MakeMaker::Parent[-1];
1555 while (($key,$val) = each %attribs){
1556 push @m, "$key = $val\n";
1568 my($self,%attribs) = @_;
1570 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1571 $self = $ExtUtils::MakeMaker::Parent[-1];
1574 while (($key,$val) = each %attribs){
1575 push @m, "$key: $val\n";
1580 =item post_constants
1589 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1590 $self = $ExtUtils::MakeMaker::Parent[-1];
1604 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1605 $self = $ExtUtils::MakeMaker::Parent[-1];
1611 foreach $key (qw(INSTALLPRIVLIB INSTALLARCHLIB INSTALLBIN
1612 INSTALLMAN1DIR INSTALLMAN3DIR LIBPERL_A
1613 LINKTYPE PREFIX INSTALLSITELIB
1614 INSTALLSITEARCH INSTALLDIRS)){
1615 push @pasthru, "$key=\"\$($key)\"";
1618 push @m, "\nPASTHRU = ", join ("\\\n\t", @pasthru), "\n";
1629 # --- Translation Sections ---
1633 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1634 $self = $ExtUtils::MakeMaker::Parent[-1];
1636 return '' unless $self->needs_linking();
1640 $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
1643 $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.C
1657 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1658 $self = $ExtUtils::MakeMaker::Parent[-1];
1660 return '' unless $self->needs_linking();
1663 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs >$*.tc && mv $*.tc $@
1673 sub xs_o { # many makes are too dumb to use xs_c then c_o
1676 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1677 $self = $ExtUtils::MakeMaker::Parent[-1];
1679 return '' unless $self->needs_linking();
1682 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs >xstmp.c && mv xstmp.c $*.c
1683 $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
1694 # --- Target Sections ---
1698 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1699 $self = $ExtUtils::MakeMaker::Parent[-1];
1703 all :: config $(INST_PM) subdirs linkext manifypods
1705 subdirs :: $(MYEXTLIB)
1709 config :: '.$self->{MAKEFILE}.' $(INST_LIBDIR)/.exists
1711 config :: $(INST_ARCHAUTODIR)/.exists
1713 config :: $(INST_AUTODIR)/.exists
1717 config :: Version_check
1719 } unless $self->{PARENT} or ($self->{PERL_SRC} && $self->{INSTALLDIRS} eq "perl");
1721 push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
1723 if (%{$self->{MAN1PODS}}) {
1725 config :: $(INST_MAN1DIR)/.exists
1728 push @m, $self->dir_target(qw[$(INST_MAN1DIR)]);
1730 if (%{$self->{MAN3PODS}}) {
1732 config :: $(INST_MAN3DIR)/.exists
1735 push @m, $self->dir_target(qw[$(INST_MAN3DIR)]);
1739 $(O_FILES): $(H_FILES)
1740 ' if @{$self->{O_FILES} || []} && @{$self->{H} || []};
1744 perldoc ExtUtils::MakeMaker
1749 }.$self->{NOECHO}.q{$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
1750 -MExtUtils::MakeMaker=Version_check \
1751 -e 'Version_check("$(MM_VERSION)")'
1764 my($self, %attribs) = @_;
1766 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1767 $self = $ExtUtils::MakeMaker::Parent[-1];
1769 # LINKTYPE => static or dynamic or ''
1770 my($linktype) = defined $attribs{LINKTYPE} ?
1771 $attribs{LINKTYPE} : '$(LINKTYPE)';
1773 linkext :: $linktype
1785 my($self,%attribs) = @_;
1787 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1788 $self = $ExtUtils::MakeMaker::Parent[-1];
1791 return '' unless ($Config::Config{osname} eq 'aix' && $self->needs_linking() );
1793 my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {};
1794 my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || [];
1798 dynamic :: $self->{BASEEXT}.exp
1800 ") unless $self->{SKIPHASH}{'dynamic'}; # dynamic and static are subs, so...
1803 static :: $self->{BASEEXT}.exp
1805 ") unless $self->{SKIPHASH}{'static'}; # we avoid a warning if we tick them
1808 $self->{BASEEXT}.exp: Makefile.PL
1809 ",' $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e \'use ExtUtils::Mksymlists; \\
1810 Mksymlists("NAME" => "',$self->{NAME},'", "DL_FUNCS" => ',
1811 neatvalue($funcs),', "DL_VARS" => ', neatvalue($vars), ');\'
1824 # --- Dynamic Loading Sections ---
1828 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1829 $self = $ExtUtils::MakeMaker::Parent[-1];
1832 # $(INST_PM) has been moved to the all: target.
1833 # It remains here for awhile to allow for old usage: "make dynamic"
1834 dynamic :: '.$self->{MAKEFILE}.' $(INST_DYNAMIC) $(INST_BOOT) $(INST_PM)
1846 my($self, %attribs) = @_;
1848 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1849 $self = $ExtUtils::MakeMaker::Parent[-1];
1853 ' unless $self->has_link_code();
1856 BOOTSTRAP = '."$self->{BASEEXT}.bs".'
1858 # As Mkbootstrap might not write a file (if none is required)
1859 # we use touch to prevent make continually trying to remake it.
1860 # The DynaLoader only reads a non-empty file.
1861 $(BOOTSTRAP): '."$self->{MAKEFILE} $self->{BOOTDEP}".' $(INST_ARCHAUTODIR)/.exists
1862 '.$self->{NOECHO}.'echo "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
1863 '.$self->{NOECHO}.'$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \
1864 -e \'use ExtUtils::Mkbootstrap;\' \
1865 -e \'Mkbootstrap("$(BASEEXT)","$(BSLOADLIBS)");\'
1866 '.$self->{NOECHO}.'$(TOUCH) $(BOOTSTRAP)
1869 $(INST_BOOT): $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists
1870 '."$self->{NOECHO}$self->{RM_RF}".' $(INST_BOOT)
1871 -'.$self->{CP}.' $(BOOTSTRAP) $(INST_BOOT)
1883 my($self, %attribs) = @_;
1885 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1886 $self = $ExtUtils::MakeMaker::Parent[-1];
1888 return '' unless $self->needs_linking(); #might be because of a subdir
1890 return '' unless $self->has_link_code;
1892 my($otherldflags) = $attribs{OTHERLDFLAGS} || "";
1893 my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
1894 my($armaybe) = $attribs{ARMAYBE} || $self->{ARMAYBE} || ":";
1895 my($ldfrom) = '$(LDFROM)';
1896 my($osname) = $Config::Config{osname};
1897 $armaybe = 'ar' if ($osname eq 'dec_osf' and $armaybe eq ':');
1900 # This section creates the dynamically loadable $(INST_DYNAMIC)
1901 # from $(OBJECT) and possibly $(MYEXTLIB).
1902 ARMAYBE = '.$armaybe.'
1903 OTHERLDFLAGS = '.$otherldflags.'
1904 INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
1906 $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
1908 if ($armaybe ne ':'){
1909 $ldfrom = 'tmp$(LIB_EXT)';
1910 push(@m,' $(ARMAYBE) cr '.$ldfrom.' $(OBJECT)'."\n");
1911 push(@m,' $(RANLIB) '."$ldfrom\n");
1913 $ldfrom = "-all $ldfrom -none" if ($osname eq 'dec_osf');
1914 push(@m,' LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) -o $@ $(LDDLFLAGS) '.$ldfrom.
1915 ' $(OTHERLDFLAGS) $(MYEXTLIB) $(LDLOADLIBS) $(EXPORT_LIST) $(PERL_ARCHIVE)');
1920 push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
1931 # --- Static Loading Sections ---
1935 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1936 $self = $ExtUtils::MakeMaker::Parent[-1];
1939 # $(INST_PM) has been moved to the all: target.
1940 # It remains here for awhile to allow for old usage: "make static"
1941 static :: '.$self->{MAKEFILE}.' $(INST_STATIC) $(INST_PM)
1955 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1956 $self = $ExtUtils::MakeMaker::Parent[-1];
1958 # Come to think of it, if there are subdirs with linkcode, we still have no INST_STATIC
1959 # return '' unless $self->needs_linking(); #might be because of a subdir
1961 return '' unless $self->has_link_code;
1965 $(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)/.exists
1967 # If this extension has it's own library (eg SDBM_File)
1968 # then copy that to $(INST_STATIC) and add $(OBJECT) into it.
1969 push(@m, "\t$self->{CP} \$(MYEXTLIB) \$\@\n") if $self->{MYEXTLIB};
1972 q{ $(AR) $(AR_STATIC_ARGS) $@ $(OBJECT) && $(RANLIB) $@
1973 }.$self->{NOECHO}.q{echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)/extralibs.ld
1977 # Old mechanism - still available:
1979 push @m, "\t$self->{NOECHO}".q{echo "$(EXTRALIBS)" >> $(PERL_SRC)/ext.libs}."\n\n"
1980 if $self->{PERL_SRC};
1982 push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
1993 my($self, %attribs) = @_;
1995 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
1996 $self = $ExtUtils::MakeMaker::Parent[-1];
1998 # By default .pm files are split into the architecture independent
1999 # library. This is a good thing. If a specific module requires that
2000 # it's .pm files are split into the architecture specific library
2001 # then it should use: installpm => {SPLITLIB=>'$(INST_ARCHLIB)'}
2002 # Note that installperl currently interferes with this (Config.pm)
2003 # User can disable split by saying: installpm => {SPLITLIB=>''}
2004 my($splitlib) = '$(INST_LIB)'; # NOT arch specific by default
2005 $splitlib = $attribs{SPLITLIB} if exists $attribs{SPLITLIB};
2007 push @m, "inst_pm :: \$(INST_PM)\n\n";
2008 foreach $dist (sort keys %{$self->{PM}}){
2009 my($inst) = $self->{PM}->{$dist};
2010 push(@m, "\n# installpm: $dist => $inst, splitlib=$splitlib\n");
2011 push(@m, $self->installpm_x($dist, $inst, $splitlib));
2023 sub installpm_x { # called by installpm per file
2024 my($self, $dist, $inst, $splitlib) = @_;
2026 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2027 $self = $ExtUtils::MakeMaker::Parent[-1];
2029 if ($inst =~ m,[:\#],){
2030 warn "Warning: 'make' would have problems processing this file: '$inst', SKIPPED\n";
2033 my($instdir) = $inst =~ m|(.*)/|;
2036 $inst: $dist $self->{MAKEFILE} $instdir/.exists \$(INST_ARCHAUTODIR)/.exists
2037 $self->{NOECHO}$self->{RM_F}".' $@
2038 $(UMASK_NULL) && '."$self->{CP} $dist".' $@
2040 push(@m, "\t$self->{NOECHO}\$(AUTOSPLITFILE) \$@ $splitlib/auto\n")
2041 if ($splitlib and $inst =~ m/\.pm$/);
2043 push @m, $self->dir_target($instdir);
2054 my($self, %attribs) = @_;
2056 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2057 $self = $ExtUtils::MakeMaker::Parent[-1];
2059 return "\nmanifypods :\n" unless %{$self->{MAN3PODS}};
2062 if (defined $self->{PERL_SRC}) {
2063 $pod2man_exe = $self->catfile($self->{PERL_SRC},'pod','pod2man');
2065 $pod2man_exe = $self->catfile($Config{bin},'pod2man');
2067 unless ($self->perl_script($pod2man_exe)) {
2068 # No pod2man but some MAN3PODS to be installed
2071 Warning: I could not locate your pod2man program. Please make sure,
2072 your pod2man program is in your PATH before you execute 'make'
2075 $pod2man_exe = "-S pod2man";
2079 qq[POD2MAN_EXE = $pod2man_exe\n],
2080 q[POD2MAN = $(PERL) -we '%m=@ARGV;for (keys %m){' \\
2081 -e 'next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M "].$self->{MAKEFILE}.q[";' \\
2082 -e 'print "Manifying $$m{$$_}\n";' \\
2083 -e 'system("$$^X \\"-I$(PERL_ARCHLIB)\\" \\"-I$(PERL_LIB)\\" $(POD2MAN_EXE) $$_>$$m{$$_}")==0 or warn "Couldn\\047t install $$m{$$_}\n";' \\
2084 -e 'chmod 0644, $$m{$$_} or warn "chmod 644 $$m{$$_}: $$!\n";}'
2086 push @m, "\nmanifypods : ";
2087 push @m, join " \\\n\t", keys %{$self->{MAN1PODS}}, keys %{$self->{MAN3PODS}};
2090 if (%{$self->{MAN1PODS}} || %{$self->{MAN3PODS}}) {
2091 push @m, "\t$self->{NOECHO}\$(POD2MAN) \\\n\t";
2092 push @m, join " \\\n\t", %{$self->{MAN1PODS}}, %{$self->{MAN3PODS}};
2106 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2107 $self = $ExtUtils::MakeMaker::Parent[-1];
2109 return "" unless $self->{PL_FILES};
2111 foreach $plfile (sort keys %{$self->{PL_FILES}}) {
2113 all :: $self->{PL_FILES}->{$plfile}
2115 $self->{PL_FILES}->{$plfile} :: $plfile
2116 \$(PERL) -I\$(INST_ARCHLIB) -I\$(INST_LIB) -I\$(PERL_ARCHLIB) -I\$(PERL_LIB) $plfile
2130 return "" unless $self->{EXE_FILES} && ref $self->{EXE_FILES} eq "ARRAY";
2131 return "" unless @{$self->{EXE_FILES}};
2132 my(@m, $from, $to, %fromto, @to);
2133 push @m, $self->dir_target(qw[$(INST_EXE)]);
2134 for $from (@{$self->{EXE_FILES}}) {
2135 my($path)= '$(INST_EXE)/' . basename($from);
2136 local($_) = $path; # for backwards compatibility
2137 $to = $self->libscan($path);
2138 print "libscan($from) => '$to'\n" if ($Verbose >=2);
2141 @to = values %fromto;
2143 EXE_FILES = @{$self->{EXE_FILES}}
2151 while (($from,$to) = each %fromto) {
2152 my $todir = dirname($to);
2154 $to: $from $self->{MAKEFILE} $todir/.exists
2155 $self->{CP} $from $to
2168 # --- Sub-directory Sections ---
2171 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2172 $self = $ExtUtils::MakeMaker::Parent[-1];
2175 # This method provides a mechanism to automatically deal with
2176 # subdirectories containing further Makefile.PL scripts.
2177 # It calls the subdir_x() method for each subdirectory.
2178 foreach $dir (@{$self->{DIR}}){
2179 push(@m, $self->subdir_x($dir));
2180 #### print "Including $dir subdirectory\n";
2184 # The default clean, realclean and test targets in this Makefile
2185 # have automatically been given entries for each subdir.
2189 push(@m, "\n# none")
2201 my($self, $subdir) = @_;
2203 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2204 $self = $ExtUtils::MakeMaker::Parent[-1];
2210 $self->{NOECHO}-cd $subdir && \$(MAKE) all \$(PASTHRU)
2222 # --- Cleanup and Distribution Sections ---
2224 my($self, %attribs) = @_;
2226 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2227 $self = $ExtUtils::MakeMaker::Parent[-1];
2231 # Delete temporary files but do not touch installed files. We don\'t delete
2232 # the Makefile here so a later make realclean still has a makefile to use.
2236 # clean subdirectories first
2237 for $dir (@{$self->{DIR}}) {
2238 push @m, "\t-cd $dir && test -f $self->{MAKEFILE} && \$(MAKE) clean\n";
2241 my(@otherfiles) = values %{$self->{XS}}; # .c files from *.xs files
2242 push(@otherfiles, $attribs{FILES}) if $attribs{FILES};
2243 push(@otherfiles, qw[./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all
2244 perlmain.c mon.out core so_locations
2246 *$(OBJ_EXT) *$(LIB_EXT)
2247 perl.exe $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def $(BASEEXT).exp
2249 push @m, "\t-$self->{RM_RF} @otherfiles\n";
2250 # See realclean and ext/utils/make_ext for usage of Makefile.old
2252 "\t-$self->{MV} $self->{MAKEFILE} $self->{MAKEFILE}.old 2>/dev/null\n");
2254 "\t$attribs{POSTOP}\n") if $attribs{POSTOP};
2265 my($self, %attribs) = @_;
2267 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2268 $self = $ExtUtils::MakeMaker::Parent[-1];
2272 # Delete temporary files (via clean) and also delete installed files
2273 realclean purge :: clean
2275 # realclean subdirectories first (already cleaned)
2276 my $sub = "\t-cd %s && test -f %s && \$(MAKE) %s realclean\n";
2277 foreach(@{$self->{DIR}}){
2278 push(@m, sprintf($sub,$_,"$self->{MAKEFILE}.old","-f $self->{MAKEFILE}.old"));
2279 push(@m, sprintf($sub,$_,"$self->{MAKEFILE}",''));
2281 push(@m, " $self->{RM_RF} \$(INST_AUTODIR) \$(INST_ARCHAUTODIR)\n");
2282 push(@m, " $self->{RM_F} \$(INST_DYNAMIC) \$(INST_BOOT)\n");
2283 push(@m, " $self->{RM_F} \$(INST_STATIC) \$(INST_PM)\n");
2284 my(@otherfiles) = ($self->{MAKEFILE},
2285 "$self->{MAKEFILE}.old"); # Makefiles last
2286 push(@otherfiles, $attribs{FILES}) if $attribs{FILES};
2287 push(@m, " $self->{RM_RF} @otherfiles\n") if @otherfiles;
2288 push(@m, " $attribs{POSTOP}\n") if $attribs{POSTOP};
2301 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2302 $self = $ExtUtils::MakeMaker::Parent[-1];
2306 distclean :: realclean distcheck
2311 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&fullcheck";' \\
2317 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&skipcheck";' \\
2323 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&mkmanifest";' \\
2338 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2339 $self = $ExtUtils::MakeMaker::Parent[-1];
2343 dist : $(DIST_DEFAULT)
2345 tardist : $(DISTVNAME).tar.$(SUFFIX)
2347 $(DISTVNAME).tar.$(SUFFIX) : distdir
2349 $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
2350 $(RM_RF) $(DISTVNAME)
2351 $(COMPRESS) $(DISTVNAME).tar
2354 uutardist : $(DISTVNAME).tar.$(SUFFIX)
2355 uuencode $(DISTVNAME).tar.$(SUFFIX) \\
2356 $(DISTVNAME).tar.$(SUFFIX) > \\
2357 $(DISTVNAME).tar.$(SUFFIX).uu
2361 $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
2362 $(RM_RF) $(DISTVNAME)
2377 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2378 $self = $ExtUtils::MakeMaker::Parent[-1];
2383 $(RM_RF) $(DISTVNAME)
2384 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "/mani/";' \\
2385 -e 'manicopy(maniread(),"$(DISTVNAME)", "$(DIST_CP)");'
2399 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2400 $self = $ExtUtils::MakeMaker::Parent[-1];
2405 cd $(DISTVNAME) && $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) Makefile.PL
2406 cd $(DISTVNAME) && $(MAKE)
2407 cd $(DISTVNAME) && $(MAKE) test
2421 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2422 $self = $ExtUtils::MakeMaker::Parent[-1];
2427 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e 'use ExtUtils::Manifest "&maniread";' \\
2428 -e '@all = keys %{ maniread() };' \\
2429 -e 'print("Executing $(CI) @all\n"); system("$(CI) @all");' \\
2430 -e 'print("Executing $(RCS_LABEL) ...\n"); system("$(RCS_LABEL) @all");'
2442 my($self, %attribs) = @_;
2444 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2445 $self = $ExtUtils::MakeMaker::Parent[-1];
2450 install :: all pure_install doc_install
2452 install_perl :: pure_perl_install doc_perl_install
2454 install_site :: pure_site_install doc_site_install
2456 install_ :: install_site
2457 @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
2459 pure_install :: pure_$(INSTALLDIRS)_install
2461 doc_install :: doc_$(INSTALLDIRS)_install
2462 }.$self->{NOECHO}.q{echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
2464 pure__install : pure_site_install
2465 @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
2467 doc__install : doc_site_install
2468 @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
2470 pure_perl_install ::
2471 }.$self->{NOECHO}.q{$(MOD_INSTALL) \
2472 read }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
2473 write }.$self->catfile('$(INSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
2474 $(INST_LIB) $(INSTALLPRIVLIB) \
2475 $(INST_ARCHLIB) $(INSTALLARCHLIB) \
2476 $(INST_EXE) $(INSTALLBIN) \
2477 $(INST_MAN1DIR) $(INSTALLMAN1DIR) \
2478 $(INST_MAN3DIR) $(INSTALLMAN3DIR)
2479 }.$self->{NOECHO}.q{$(WARN_IF_OLD_PACKLIST) \
2480 }.$self->catdir('$(SITEARCHEXP)','auto','$(FULLEXT)').q{
2483 pure_site_install ::
2484 }.$self->{NOECHO}.q{$(MOD_INSTALL) \
2485 read }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \
2486 write }.$self->catfile('$(INSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q{ \
2487 $(INST_LIB) $(INSTALLSITELIB) \
2488 $(INST_ARCHLIB) $(INSTALLSITEARCH) \
2489 $(INST_EXE) $(INSTALLBIN) \
2490 $(INST_MAN1DIR) $(INSTALLMAN1DIR) \
2491 $(INST_MAN3DIR) $(INSTALLMAN3DIR)
2492 }.$self->{NOECHO}.q{$(WARN_IF_OLD_PACKLIST) \
2493 }.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{
2496 }.$self->{NOECHO}.q{$(DOC_INSTALL) \
2498 "installed into" "$(INSTALLPRIVLIB)" \
2499 LINKTYPE "$(LINKTYPE)" \
2500 VERSION "$(VERSION)" \
2501 EXE_FILES "$(EXE_FILES)" \
2502 >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{
2505 }.$self->{NOECHO}.q{$(DOC_INSTALL) \
2507 "installed into" "$(INSTALLSITELIB)" \
2508 LINKTYPE "$(LINKTYPE)" \
2509 VERSION "$(VERSION)" \
2510 EXE_FILES "$(EXE_FILES)" \
2511 >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{
2516 uninstall :: uninstall_from_$(INSTALLDIRS)dirs
2518 uninstall_from_perldirs ::
2520 q{$(UNINSTALL) }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{
2522 uninstall_from_sitedirs ::
2524 q{$(UNINSTALL) }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{
2539 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2540 $self = $ExtUtils::MakeMaker::Parent[-1];
2542 '# Phony target to force checking subdirectories.
2556 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2557 $self = $ExtUtils::MakeMaker::Parent[-1];
2561 PERL_HDRS = $(PERL_INC)/EXTERN.h $(PERL_INC)/INTERN.h \
2562 $(PERL_INC)/XSUB.h $(PERL_INC)/av.h $(PERL_INC)/cop.h \
2563 $(PERL_INC)/cv.h $(PERL_INC)/dosish.h $(PERL_INC)/embed.h \
2564 $(PERL_INC)/form.h $(PERL_INC)/gv.h $(PERL_INC)/handy.h \
2565 $(PERL_INC)/hv.h $(PERL_INC)/keywords.h $(PERL_INC)/mg.h \
2566 $(PERL_INC)/op.h $(PERL_INC)/opcode.h $(PERL_INC)/patchlevel.h \
2567 $(PERL_INC)/perl.h $(PERL_INC)/perly.h $(PERL_INC)/pp.h \
2568 $(PERL_INC)/proto.h $(PERL_INC)/regcomp.h $(PERL_INC)/regexp.h \
2569 $(PERL_INC)/scope.h $(PERL_INC)/sv.h $(PERL_INC)/unixish.h \
2570 $(PERL_INC)/util.h $(PERL_INC)/config.h
2575 $(OBJECT) : $(PERL_HDRS)
2576 ' if $self->{OBJECT};
2579 # Check for unpropogated config.sh changes. Should never happen.
2580 # We do NOT just update config.h because that is not sufficient.
2581 # An out of date config.h is not fatal but complains loudly!
2582 $(PERL_INC)/config.h: $(PERL_SRC)/config.sh
2583 -'.$self->{NOECHO}.'echo "Warning: $(PERL_INC)/config.h out of date with $(PERL_SRC)/config.sh"; false
2585 $(PERL_ARCHLIB)/Config.pm: $(PERL_SRC)/config.sh
2586 '.$self->{NOECHO}.'echo "Warning: $(PERL_ARCHLIB)/Config.pm may be out of date with $(PERL_SRC)/config.sh"
2587 cd $(PERL_SRC) && $(MAKE) lib/Config.pm
2588 ') if $self->{PERL_SRC};
2590 push(@m, join(" ", values %{$self->{XS}})." : \$(XSUBPPDEPS)\n")
2604 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2605 $self = $ExtUtils::MakeMaker::Parent[-1];
2608 # We do not know what target was originally specified so we
2609 # must force a manual rerun to be sure. But as it should only
2610 # happen very rarely it is not a significant problem.
2612 $(OBJECT) : $(FIRST_MAKEFILE)
2613 ' if $self->{OBJECT};
2616 # We take a very conservative approach here, but it\'s worth it.
2617 # We move Makefile to Makefile.old here to avoid gnu make looping.
2618 '.$self->{MAKEFILE}.' : Makefile.PL $(CONFIGDEP)
2619 '.$self->{NOECHO}.'echo "Makefile out-of-date with respect to $?"
2620 '.$self->{NOECHO}.'echo "Cleaning current config before rebuilding Makefile..."
2621 -'.$self->{NOECHO}.'mv '."$self->{MAKEFILE} $self->{MAKEFILE}.old".'
2622 -$(MAKE) -f '.$self->{MAKEFILE}.'.old clean >/dev/null 2>&1 || true
2623 $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" Makefile.PL '.join(" ",map(qq["$_"],@ARGV)).'
2624 '.$self->{NOECHO}.'echo ">>> Your Makefile has been rebuilt. <<<"
2625 '.$self->{NOECHO}.'echo ">>> Please rerun the make command. <<<"; false
2638 my($self, %attribs) = @_;
2640 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2641 $self = $ExtUtils::MakeMaker::Parent[-1];
2645 my(@searchdirs)=($self->{PERL_ARCHLIB}, $self->{SITEARCHEXP}, $self->{INST_ARCHLIB});
2647 # And as it's not yet built, we add the current extension
2648 # but only if it has some C code (or XS code, which implies C code)
2649 if (@{$self->{C}}) {
2650 @static="$self->{INST_ARCHLIB}/auto/$self->{FULLEXT}/$self->{BASEEXT}$self->{LIB_EXT}";
2653 # Either we determine now, which libraries we will produce in the
2654 # subdirectories or we do it at runtime of the make.
2656 # We could ask all subdir objects, but I cannot imagine, why it
2657 # would be necessary.
2659 # Instead we determine all libraries for the new perl at
2661 my(@perlinc) = ($self->{INST_ARCHLIB}, $self->{INST_LIB}, $self->{PERL_ARCHLIB}, $self->{PERL_LIB});
2663 $self->makeaperl(MAKE => $self->{MAKEFILE},
2664 DIRS => \@searchdirs,
2667 TARGET => $self->{MAP_TARGET},
2669 LIBPERL => $self->{LIBPERL_A}
2680 # --- Test and Installation Sections ---
2682 my($self, %attribs) = @_;
2684 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2685 $self = $ExtUtils::MakeMaker::Parent[-1];
2687 my($tests) = $attribs{TESTS} || (-d "t" ? "t/*.t" : "");
2691 TEST_TYPE=test_\$(LINKTYPE)
2693 test :: \$(TEST_TYPE)
2695 push(@m, map("\t$self->{NOECHO}cd $_ && test -f $self->{MAKEFILE} && \$(MAKE) test \$(PASTHRU)\n",
2697 push(@m, "\t$self->{NOECHO}echo 'No tests defined for \$(NAME) extension.'\n")
2698 unless $tests or -f "test.pl" or @{$self->{DIR}};
2701 push(@m, "test_dynamic :: all\n");
2702 push(@m, $self->test_via_harness('$(FULLPERL)', $tests)) if $tests;
2703 push(@m, $self->test_via_script('$(FULLPERL)', 'test.pl')) if -f "test.pl";
2706 # Occasionally we may face this degenerate target:
2707 push @m, "test_ : test_dynamic\n\n";
2709 if ($self->needs_linking()) {
2710 push(@m, "test_static :: all \$(MAP_TARGET)\n");
2711 push(@m, $self->test_via_harness('./$(MAP_TARGET)', $tests)) if $tests;
2712 push(@m, $self->test_via_script('./$(MAP_TARGET)', 'test.pl')) if -f "test.pl";
2715 push @m, "test_static :: test_dynamic\n";
2720 =item test_via_harness
2726 sub test_via_harness {
2727 my($self, $perl, $tests) = @_;
2729 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2730 $self = $ExtUtils::MakeMaker::Parent[-1];
2732 "\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";
2735 =item test_via_script
2741 sub test_via_script {
2742 my($self, $perl, $script) = @_;
2744 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2745 $self = $ExtUtils::MakeMaker::Parent[-1];
2747 qq{\tPERL_DL_NONLAZY=1 $perl}.q{ -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) }.qq{$script
2753 Returns an empty string. Can be used in Makefile.PLs to write some
2754 text to the Makefile at the end.
2761 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2762 $self = $ExtUtils::MakeMaker::Parent[-1];
2769 Called by staticmake.
2774 my($self, %attribs) = @_;
2776 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2777 $self = $ExtUtils::MakeMaker::Parent[-1];
2779 my($makefilename, $searchdirs, $static, $extra, $perlinc, $target, $tmp, $libperl) =
2780 @attribs{qw(MAKE DIRS STAT EXTRA INCL TARGET TMP LIBPERL)};
2783 # --- MakeMaker makeaperl section ---
2784 MAP_TARGET = $target
2785 FULLPERL = $self->{FULLPERL}
2787 return join '', @m if $self->{PARENT};
2789 my($dir) = join ":", @{$self->{DIR}};
2791 unless ($self->{MAKEAPERL}) {
2793 $(MAP_TARGET) :: $(MAKE_APERL_FILE)
2794 $(MAKE) -f $(MAKE_APERL_FILE) static $@
2796 $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE)
2797 }.$self->{NOECHO}.q{echo Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
2798 }.$self->{NOECHO}.q{$(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
2799 Makefile.PL DIR=}, $dir, q{ \
2800 MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
2801 MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=};
2803 push @m, map( " \\\n\t\t$_", @ARGV );
2811 my($cccmd, $linkcmd, $lperl);
2814 $cccmd = $self->const_cccmd($libperl);
2815 $cccmd =~ s/^CCCMD\s*=\s*//;
2816 $cccmd =~ s/\$\(INC\)/ -I$self->{PERL_INC} /;
2817 $cccmd .= " $Config::Config{cccdlflags}" if ($Config::Config{d_shrplib});
2818 $cccmd =~ s/\n/ /g; # yes I've seen "\n", don't ask me where it came from. A.K.
2819 $cccmd =~ s/\(CC\)/\(PERLMAINCC\)/;
2821 # The front matter of the linkcommand...
2822 $linkcmd = join ' ', "\$(CC)",
2823 grep($_, @Config{qw(large split ldflags ccdlflags)});
2824 $linkcmd =~ s/\s+/ /g;
2826 # Which *.a files could we make use of...
2828 File::Find::find(sub {
2829 return unless m/\Q$self->{LIB_EXT}\E$/;
2830 return if m/^libperl/;
2831 # don't include the installed version of this extension. I
2832 # leave this line here, although it is not necessary anymore:
2833 # I patched minimod.PL instead, so that Miniperl.pm won't
2834 # enclude duplicates
2836 # Once the patch to minimod.PL is in the distribution, I can
2838 return if $File::Find::name =~ m:auto/$self->{FULLEXT}/$self->{BASEEXT}$self->{LIB_EXT}$:;
2839 $static{fastcwd() . "/" . $_}++;
2840 }, grep( -d $_, @{$searchdirs || []}) );
2842 # We trust that what has been handed in as argument, will be buildable
2843 $static = [] unless $static;
2844 @static{@{$static}} = (1) x @{$static};
2846 $extra = [] unless $extra && ref $extra eq 'ARRAY';
2847 for (sort keys %static) {
2848 next unless /\Q$self->{LIB_EXT}\E$/;
2849 $_ = dirname($_) . "/extralibs.ld";
2853 grep(s/^/-I/, @{$perlinc || []});
2855 $target = "perl" unless $target;
2856 $tmp = "." unless $tmp;
2858 # MAP_STATIC doesn't look into subdirs yet. Once "all" is made and we
2859 # regenerate the Makefiles, MAP_STATIC and the dependencies for
2860 # extralibs.all are computed correctly
2862 MAP_LINKCMD = $linkcmd
2863 MAP_PERLINC = @{$perlinc || []}
2865 join(" \\\n\t", reverse sort keys %static), "
2867 MAP_PRELIBS = $Config::Config{libs} $Config::Config{cryptlib}
2870 if (defined $libperl) {
2871 ($lperl = $libperl) =~ s/\$\(A\)/$self->{LIB_EXT}/;
2873 unless ($libperl && -f $lperl) { # Ilya's code...
2874 my $dir = $self->{PERL_SRC} || "$self->{PERL_ARCHLIB}/CORE";
2875 $libperl ||= "libperl$self->{LIB_EXT}";
2876 $libperl = "$dir/$libperl";
2877 $lperl ||= "libperl$self->{LIB_EXT}";
2878 $lperl = "$dir/$lperl";
2879 print STDOUT "Warning: $libperl not found
2880 If you're going to build a static perl binary, make sure perl is installed
2881 otherwise ignore this warning\n"
2882 unless (-f $lperl || defined($self->{PERL_SRC}));
2886 MAP_LIBPERL = $libperl
2890 \$(INST_ARCHAUTODIR)/extralibs.all: \$(INST_ARCHAUTODIR)/.exists ".join(" \\\n\t", @$extra)."
2891 $self->{NOECHO}$self->{RM_F} \$\@
2892 $self->{NOECHO}\$(TOUCH) \$\@
2896 foreach $catfile (@$extra){
2897 push @m, "\tcat $catfile >> \$\@\n";
2901 \$(MAP_TARGET) :: $tmp/perlmain\$(OBJ_EXT) \$(MAP_LIBPERL) \$(MAP_STATIC) \$(INST_ARCHAUTODIR)/extralibs.all
2902 \$(MAP_LINKCMD) -o \$\@ $tmp/perlmain\$(OBJ_EXT) \$(MAP_LIBPERL) \$(MAP_STATIC) `cat \$(INST_ARCHAUTODIR)/extralibs.all` \$(MAP_PRELIBS)
2903 $self->{NOECHO}echo 'To install the new \"\$(MAP_TARGET)\" binary, call'
2904 $self->{NOECHO}echo ' make -f $makefilename inst_perl MAP_TARGET=\$(MAP_TARGET)'
2905 $self->{NOECHO}echo 'To remove the intermediate files say'
2906 $self->{NOECHO}echo ' make -f $makefilename map_clean'
2908 $tmp/perlmain\$(OBJ_EXT): $tmp/perlmain.c
2910 push @m, "\tcd $tmp && $cccmd -I\$(PERL_INC) perlmain.c\n";
2913 $tmp/perlmain.c: $makefilename}, q{
2914 }.$self->{NOECHO}.q{echo Writing $@
2915 }.$self->{NOECHO}.q{$(PERL) $(MAP_PERLINC) -e 'use ExtUtils::Miniperl; \\
2916 writemain(grep s#.*/auto/##, qw|$(MAP_STATIC)|)' > $@.tmp && mv $@.tmp $@
2922 }.$self->{NOECHO}.q{echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
2923 }.$self->{NOECHO}.q{$(DOC_INSTALL) \
2924 "Perl binary $(MAP_TARGET)" \
2925 MAP_STATIC "$(MAP_STATIC)" \
2926 MAP_EXTRA "`cat $(INST_ARCHAUTODIR)/extralibs.all`" \
2927 MAP_LIBPERL "$(MAP_LIBPERL)" \
2928 >> }.$self->catfile('$(INSTALLARCHLIB)','perllocal.pod').q{
2933 inst_perl: pure_inst_perl doc_inst_perl
2935 pure_inst_perl: \$(MAP_TARGET)
2936 $self->{CP} \$(MAP_TARGET) \$(INSTALLBIN)/\$(MAP_TARGET)
2941 $self->{RM_F} $tmp/perlmain\$(OBJ_EXT) $tmp/perlmain.c \$(MAP_TARGET) $makefilename \$(INST_ARCHAUTODIR)/extralibs.all
2949 Called by init_others.
2954 my($self,$libs) = @_;
2956 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2957 $self = $ExtUtils::MakeMaker::Parent[-1];
2959 $self->ext($libs, $Verbose);
2964 Takes an array of directories that need to exist and returns a
2965 Makefile entry for a .exists file in these directories. Returns
2966 nothing, if the entry has already been processed. We're helpless
2967 though, if the same directory comes as $(FOO) _and_ as "bar". Both of
2968 them get an entry, that's why we use "::".
2973 # --- Make-Directories section (internal method) ---
2974 # dir_target(@array) returns a Makefile entry for the file .exists in each
2975 # named directory. Returns nothing, if the entry has already been processed.
2976 # We're helpless though, if the same directory comes as $(FOO) _and_ as "bar".
2977 # Both of them get an entry, that's why we use "::". I chose '$(PERL)' as the
2978 # prerequisite, because there has to be one, something that doesn't change
2981 my($self,@dirs) = @_;
2983 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
2984 $self = $ExtUtils::MakeMaker::Parent[-1];
2987 foreach $dir (@dirs) {
2988 next if $self->{DIR_TARGET}{$self}{$dir}++;
2990 $dir/.exists :: }.$self->catfile($self->{PERL_INC},"perl.h").qq{
2991 $self->{NOECHO}\$(MKPATH) $dir
2992 $self->{NOECHO}\$(EQUALIZE_TIMESTAMP) \$(PERL) $dir/.exists
2993 -$self->{NOECHO}\$(CHMOD) 755 $dir
3001 Does this module need linking? Looks into subdirectory objects (see
3002 also has_link_code())
3009 $caller = (caller(0))[3];
3011 ExtUtils::MakeMaker::TieAtt::warndirectuse($caller);
3012 $self = $ExtUtils::MakeMaker::Parent[-1];
3014 Carp::confess("Needs_linking called too early") if $caller =~ /^ExtUtils::MakeMaker::/;
3015 return $self->{NEEDS_LINKING} if defined $self->{NEEDS_LINKING};
3016 if ($self->has_link_code or $self->{MAKEAPERL}){
3017 $self->{NEEDS_LINKING} = 1;
3020 foreach $child (keys %{$self->{CHILDREN}}) {
3021 if ($self->{CHILDREN}->{$child}->needs_linking) {
3022 $self->{NEEDS_LINKING} = 1;
3026 return $self->{NEEDS_LINKING} = 0;
3031 Returns true if C, XS, MYEXTLIB or similar objects exist within this
3032 object that need a compiler. Does not descend into subdirectories as
3033 needs_linking() does.
3039 return $self->{HAS_LINK_CODE} if defined $self->{HAS_LINK_CODE};
3040 if ($self->{OBJECT} or @{$self->{C} || []} or $self->{MYEXTLIB}){
3041 $self->{HAS_LINK_CODE} = 1;
3044 return $self->{HAS_LINK_CODE} = 0;
3049 Obsolete, depecated method.
3054 # --- perllocal.pod section ---
3055 my($self,$what,$name,@attribs)=@_;
3057 ExtUtils::MakeMaker::TieAtt::warndirectuse((caller(0))[3]);
3058 $self = $ExtUtils::MakeMaker::Parent[-1];
3060 my $time = localtime;
3061 print "=head2 $time: $what C<$name>\n\n=over 4\n\n=item *\n\n";
3062 print join "\n\n=item *\n\n", map("C<$_>",@attribs);
3063 print "\n\n=back\n\n";
3068 L<ExtUtils::MakeMaker>