1 package ExtUtils::MM_Win32;
7 ExtUtils::MM_Win32 - methods to override UN*X behaviour in ExtUtils::MakeMaker
11 use ExtUtils::MM_Win32; # Done internally by ExtUtils::MakeMaker if needed
15 See ExtUtils::MM_Unix for a documentation of the methods provided
16 there. This package overrides the implementation of these methods, not
28 require ExtUtils::MakeMaker;
29 ExtUtils::MakeMaker->import(qw( $Verbose &neatvalue));
31 $ENV{EMXSHELL} = 'sh'; # to run `commands`
32 unshift @MM::ISA, 'ExtUtils::MM_Win32';
34 $BORLAND = 1 if $Config{'cc'} =~ /^bcc/i;
35 $GCC = 1 if $Config{'cc'} =~ /^gcc/i;
36 $DMAKE = 1 if $Config{'make'} =~ /^dmake/i;
37 $NMAKE = 1 if $Config{'make'} =~ /^nmake/i;
38 $PERLMAKE = 1 if $Config{'make'} =~ /^pmake/i;
39 $OBJ = 1 if $Config{'ccflags'} =~ /PERL_OBJECT/i;
41 # a few workarounds for command.com (very basic)
43 package ExtUtils::MM_Win95;
45 # the $^O test may be overkill, but we want to be sure Win32::IsWin95()
46 # exists before we try it
48 unshift @MM::ISA, 'ExtUtils::MM_Win95'
49 if ($^O =~ /Win32/ && Win32::IsWin95());
53 return '' unless $self->needs_linking();
56 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\
57 $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c
63 return '' unless $self->needs_linking();
66 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\
67 $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.cpp
71 # many makes are too dumb to use xs_c then c_o
74 return '' unless $self->needs_linking();
77 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\
78 $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c
79 $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
82 } # end of command.com workarounds
85 my($self,%attribs) = @_;
87 my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {};
88 my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || [];
89 my($funclist) = $attribs{FUNCLIST} || $self->{FUNCLIST} || [];
90 my($imports) = $attribs{IMPORTS} || $self->{IMPORTS} || {};
92 (my $boot = $self->{NAME}) =~ s/:/_/g;
94 if (not $self->{SKIPHASH}{'dynamic'}) {
96 $self->{BASEEXT}.def: Makefile.PL
98 q! $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Mksymlists \\
99 -e "Mksymlists('NAME' => '!, $self->{NAME},
100 q!', 'DLBASE' => '!,$self->{DLBASE},
101 q!', 'DL_FUNCS' => !,neatvalue($funcs),
102 q!, 'FUNCLIST' => !,neatvalue($funclist),
103 q!, 'IMPORTS' => !,neatvalue($imports),
104 q!, 'DL_VARS' => !, neatvalue($vars), q!);"
110 sub replace_manpage_separator {
117 my($self,$file) = @_;
118 my @e = exists($ENV{'PATHEXT'})
119 ? split(/;/, $ENV{PATHEXT})
120 : qw(.com .exe .bat .cmd);
122 for (@e) { $e .= "\Q$_\E|" }
124 # see if file ends in one of the known extensions
125 if ($file =~ /($e)$/i) {
126 return $file if -e $file;
130 return "$file$_" if -e "$file$_";
136 sub file_name_is_absolute {
137 my($self,$file) = @_;
138 $file =~ m{^([a-z]:)?[\\/]}i ;
142 my($self, $ver, $names, $dirs, $trace) = @_;
145 print "Looking for perl $ver by these names:
151 foreach $dir (@$dirs){
152 next unless defined $dir; # $self->{PERL_SRC} may be undefined
153 foreach $name (@$names){
155 if ($self->file_name_is_absolute($name)) { # /foo/bar
157 } elsif ($self->canonpath($name) eq $self->canonpath(basename($name))) { # foo
158 $abs = $self->catfile($dir, $name);
160 $abs = $self->canonpath($self->catfile($self->curdir, $name));
162 print "Checking $abs\n" if ($trace >= 2);
163 next unless $self->maybe_command($abs);
164 print "Executing $abs\n" if ($trace >= 2);
165 $val = `$abs -e "require $ver;" 2>&1`;
167 print "Using PERL=$abs\n" if $trace;
169 } elsif ($trace >= 2) {
170 print "Result: `$val'\n";
174 print STDOUT "Unable to find a perl $ver (by these names: @$names, in these dirs: @$dirs)\n";
175 0; # false and not empty
182 # append a slash to each argument unless it has one there
183 $_ .= "\\" if $_ eq '' or substr($_,-1) ne "\\";
185 my $result = $self->canonpath(join('', @args));
191 Concatenate one or more directory names and a filename to form a
192 complete path ending with a filename
199 return $file unless @_;
200 my $dir = $self->catdir(@_);
202 $dir .= "\\" unless substr($dir,length($dir)-1,1) eq "\\";
209 &ExtUtils::MM_Unix::init_others;
210 $self->{'TOUCH'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e touch';
211 $self->{'CHMOD'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e chmod';
212 $self->{'CP'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e cp';
213 $self->{'RM_F'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e rm_f';
214 $self->{'RM_RF'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e rm_rf';
215 $self->{'MV'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mv';
216 $self->{'NOOP'} = 'rem';
217 $self->{'TEST_F'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e test_f';
218 $self->{'LD'} = $Config{'ld'} || 'link';
219 $self->{'AR'} = $Config{'ar'} || 'lib';
220 $self->{'LDLOADLIBS'} ||= $Config{'libs'};
221 # -Lfoo must come first for Borland, so we put it in LDDLFLAGS
223 my $libs = $self->{'LDLOADLIBS'};
225 while ($libs =~ s/(?:^|\s)(("?)-L.+?\2)(?:\s|$)/ /) {
226 $libpath .= ' ' if length $libpath;
229 $self->{'LDLOADLIBS'} = $libs;
230 $self->{'LDDLFLAGS'} ||= $Config{'lddlflags'};
231 $self->{'LDDLFLAGS'} .= " $libpath";
233 $self->{'DEV_NULL'} = '> NUL';
234 # $self->{'NOECHO'} = ''; # till we have it working
240 Initializes lots of constants and .SUFFIXES and .PHONY
250 AR_STATIC_ARGS NAME DISTNAME NAME_SYM VERSION
251 VERSION_SYM XS_VERSION INST_BIN INST_EXE INST_LIB
252 INST_ARCHLIB INST_SCRIPT PREFIX INSTALLDIRS
253 INSTALLPRIVLIB INSTALLARCHLIB INSTALLSITELIB
254 INSTALLSITEARCH INSTALLBIN INSTALLSCRIPT PERL_LIB
255 PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
256 FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC
257 PERL_INC PERL FULLPERL
260 next unless defined $self->{$tmp};
261 push @m, "$tmp = $self->{$tmp}\n";
265 VERSION_MACRO = VERSION
266 DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\"
267 XS_VERSION_MACRO = XS_VERSION
268 XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\"
272 MAKEMAKER = $INC{'ExtUtils\MakeMaker.pm'}
273 MM_VERSION = $ExtUtils::MakeMaker::VERSION
277 # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
278 # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
279 # ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD) !!! Deprecated from MM 5.32 !!!
280 # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
281 # DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
285 FULLEXT BASEEXT PARENT_NAME DLBASE VERSION_FROM INC DEFINE OBJECT
288 next unless defined $self->{$tmp};
289 push @m, "$tmp = $self->{$tmp}\n";
293 # Handy lists of source code files:
294 XS_FILES= ".join(" \\\n\t", sort keys %{$self->{XS}})."
295 C_FILES = ".join(" \\\n\t", @{$self->{C}})."
296 O_FILES = ".join(" \\\n\t", @{$self->{O_FILES}})."
297 H_FILES = ".join(" \\\n\t", @{$self->{H}})."
298 HTMLLIBPODS = ".join(" \\\n\t", sort keys %{$self->{HTMLLIBPODS}})."
299 HTMLSCRIPTPODS = ".join(" \\\n\t", sort keys %{$self->{HTMLSCRIPTPODS}})."
300 MAN1PODS = ".join(" \\\n\t", sort keys %{$self->{MAN1PODS}})."
301 MAN3PODS = ".join(" \\\n\t", sort keys %{$self->{MAN3PODS}})."
305 INST_HTMLPRIVLIBDIR INSTALLHTMLPRIVLIBDIR
306 INST_HTMLSITELIBDIR INSTALLHTMLSITELIBDIR
307 INST_HTMLSCRIPTDIR INSTALLHTMLSCRIPTDIR
308 INST_HTMLLIBDIR HTMLEXT
309 INST_MAN1DIR INSTALLMAN1DIR MAN1EXT
310 INST_MAN3DIR INSTALLMAN3DIR MAN3EXT
312 next unless defined $self->{$tmp};
313 push @m, "$tmp = $self->{$tmp}\n";
321 .NO_CONFIG_REC: Makefile
322 } if $ENV{CLEARCASE_ROOT};
324 # why not q{} ? -- emacs
326 # work around a famous dec-osf make(1) feature(?):
329 .SUFFIXES: .xs .c .C .cpp .cxx .cc \$(OBJ_EXT)
331 # Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
332 # some make implementations will delete the Makefile when we rebuild it. Because
333 # we call false(1) when we rebuild it. So make(1) is not completely wrong when it
334 # does so. Our milage may vary.
335 # .PRECIOUS: Makefile # seems to be not necessary anymore
337 .PHONY: all config static dynamic test linkext manifest
339 # Where is the Config information that we are using/depend on
340 CONFIGDEP = \$(PERL_ARCHLIB)\\Config.pm \$(PERL_INC)\\config.h
343 my @parentdir = split(/::/, $self->{PARENT_NAME});
345 # Where to put things:
346 INST_LIBDIR = }. $self->catdir('$(INST_LIB)',@parentdir) .q{
347 INST_ARCHLIBDIR = }. $self->catdir('$(INST_ARCHLIB)',@parentdir) .q{
349 INST_AUTODIR = }. $self->catdir('$(INST_LIB)','auto','$(FULLEXT)') .q{
350 INST_ARCHAUTODIR = }. $self->catdir('$(INST_ARCHLIB)','auto','$(FULLEXT)') .q{
353 if ($self->has_link_code()) {
355 INST_STATIC = $(INST_ARCHAUTODIR)\$(BASEEXT)$(LIB_EXT)
356 INST_DYNAMIC = $(INST_ARCHAUTODIR)\$(DLBASE).$(DLEXT)
357 INST_BOOT = $(INST_ARCHAUTODIR)\$(BASEEXT).bs
367 $tmp = $self->export_list;
371 $tmp = $self->perl_archive;
377 #INST_PM = }.join(" \\\n\t", sort values %{$self->{PM}}).q{
379 #PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
383 TO_INST_PM = }.join(" \\\n\t", sort keys %{$self->{PM}}).q{
385 PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
394 my $path = $ENV{'PATH'} || $ENV{'Path'} || $ENV{'path'};
395 my @path = split(';',$path);
396 foreach(@path) { $_ = '.' if $_ eq '' }
402 Defines how to produce the *.a (or equivalent) files.
408 # Come to think of it, if there are subdirs with linkcode, we still have no INST_STATIC
409 # return '' unless $self->needs_linking(); #might be because of a subdir
411 return '' unless $self->has_link_code;
415 $(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)\.exists
418 # If this extension has it's own library (eg SDBM_File)
419 # then copy that to $(INST_STATIC) and add $(OBJECT) into it.
420 push(@m, "\t$self->{CP} \$(MYEXTLIB) \$\@\n") if $self->{MYEXTLIB};
423 q{ $(AR) }.($BORLAND ? '$@ $(OBJECT:^"+")'
424 : ($GCC ? '-ru $@ $(OBJECT)'
425 : '-out:$@ $(OBJECT)')).q{
426 }.$self->{NOECHO}.q{echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)\extralibs.ld
430 # Old mechanism - still available:
432 push @m, "\t$self->{NOECHO}".q{echo "$(EXTRALIBS)" >> $(PERL_SRC)\ext.libs}."\n\n"
433 if $self->{PERL_SRC};
435 push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
441 Defines targets for bootstrap files.
446 my($self, %attribs) = @_;
449 ' unless $self->has_link_code();
452 BOOTSTRAP = '."$self->{BASEEXT}.bs".'
454 # As Mkbootstrap might not write a file (if none is required)
455 # we use touch to prevent make continually trying to remake it.
456 # The DynaLoader only reads a non-empty file.
457 $(BOOTSTRAP): '."$self->{MAKEFILE} $self->{BOOTDEP}".' $(INST_ARCHAUTODIR)\.exists
458 '.$self->{NOECHO}.'echo "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
459 '.$self->{NOECHO}.'$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \
460 -MExtUtils::Mkbootstrap \
461 -e "Mkbootstrap(\'$(BASEEXT)\',\'$(BSLOADLIBS)\');"
462 '.$self->{NOECHO}.'$(TOUCH) $(BOOTSTRAP)
465 $(INST_BOOT): $(BOOTSTRAP) $(INST_ARCHAUTODIR)\.exists
466 '."$self->{NOECHO}$self->{RM_RF}".' $(INST_BOOT)
467 -'.$self->{CP}.' $(BOOTSTRAP) $(INST_BOOT)
472 =item dynamic_lib (o)
474 Defines how to produce the *.so (or equivalent) files.
479 my($self, %attribs) = @_;
480 return '' unless $self->needs_linking(); #might be because of a subdir
482 return '' unless $self->has_link_code;
484 my($otherldflags) = $attribs{OTHERLDFLAGS} || ($BORLAND ? 'c0d32.obj': '');
485 my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
486 my($ldfrom) = '$(LDFROM)';
489 # one thing for GCC/Mingw32:
490 # we try to overcome non-relocateable-DLL problems by generating
491 # a (hopefully unique) image-base from the dll's name
494 my $dllname = $self->{BASEEXT} . "." . $self->{DLEXT};
495 $dllname =~ /(....)(.{0,4})/;
496 my $baseaddr = unpack("n", $1 ^ $2);
497 $otherldflags .= sprintf("-Wl,--image-base,0x%x0000 ", $baseaddr);
501 # This section creates the dynamically loadable $(INST_DYNAMIC)
502 # from $(OBJECT) and possibly $(MYEXTLIB).
503 OTHERLDFLAGS = '.$otherldflags.'
504 INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
506 $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)\.exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
510 q{ dlltool --def $(EXPORT_LIST) --output-exp dll.exp
511 $(LD) -o $@ -Wl,--base-file -Wl,dll.base $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) dll.exp
512 dlltool --def $(EXPORT_LIST) --base-file dll.base --output-exp dll.exp
513 $(LD) -o $@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) dll.exp });
516 q{ $(LD) $(LDDLFLAGS) $(OTHERLDFLAGS) }.$ldfrom.q{,$@,,}
517 .($DMAKE ? q{$(PERL_ARCHIVE:s,/,\,) $(LDLOADLIBS:s,/,\,) }
518 .q{$(MYEXTLIB:s,/,\,),$(EXPORT_LIST:s,/,\,)}
519 : q{$(subst /,\,$(PERL_ARCHIVE)) $(subst /,\,$(LDLOADLIBS)) }
520 .q{$(subst /,\,$(MYEXTLIB)),$(subst /,\,$(EXPORT_LIST))})
524 q{ $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) }
525 .q{$(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)});
531 push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
538 return '$(PERL_INC)\\'.$Config{'libperl'};
544 return "$self->{BASEEXT}.def";
549 No physical check on the filesystem, but a logical cleanup of a
550 path. On UNIX eliminated successive slashes and successive "/.".
555 my($self,$path) = @_;
556 $path =~ s/^([a-z]:)/\u$1/;
558 $path =~ s|(.)\\+|$1\\|g ; # xx////xx -> xx/xx
559 $path =~ s|(\\\.)+\\|\\|g ; # xx/././xx -> xx/xx
560 $path =~ s|^(\.\\)+|| unless $path eq ".\\"; # ./xx -> xx
562 unless $path =~ m#^([a-z]:)?\\#; # xx/ -> xx
563 $path .= '.' if $path =~ m#\\$#;
569 Takes one argument, a file name, and returns the file name, if the
570 argument is likely to be a perl script. On MM_Unix this is true for
571 any ordinary, readable file.
576 my($self,$file) = @_;
577 return $file if -r $file && -f _;
578 return "$file.pl" if -r "$file.pl" && -f _;
579 return "$file.bat" if -r "$file.bat" && -f _;
585 Defines target that copies all files in the hash PM to their
586 destination and autosplits them. See L<ExtUtils::Install/DESCRIPTION>
592 my($autodir) = $self->catdir('$(INST_LIB)','auto');
594 pm_to_blib: $(TO_INST_PM)
595 }.$self->{NOECHO}.q{$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
596 "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
598 ($NMAKE ? 'qw[ <<pmfiles.dat ],'
599 : $DMAKE ? 'qw[ $(mktmp,pmfiles.dat $(PM_TO_BLIB:s,\\,\\\\,)\n) ],'
600 : '{ qw[$(PM_TO_BLIB)] },'
601 ).q{'}.$autodir.q{')"
605 } : '') . $self->{NOECHO}.q{$(TOUCH) $@
609 =item test_via_harness (o)
611 Helper method to write the test targets
615 sub test_via_harness {
616 my($self, $perl, $tests) = @_;
617 "\t$perl".q! -Mblib -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e "use Test::Harness qw(&runtests $$verbose); $$verbose=$(TEST_VERBOSE); runtests @ARGV;" !."$tests\n";
621 =item tool_autosplit (override)
623 Use Win32 quoting on command line.
628 my($self, %attribs) = @_;
630 $asl = "\$AutoSplit::Maxlen=$attribs{MAXLEN};" if $attribs{MAXLEN};
632 # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
633 AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MAutoSplit }.$asl.q{ -e "autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1);"
637 =item tools_other (o)
641 Defines SHELL, LD, TOUCH, CP, MV, RM_F, RM_RF, CHMOD, UMASK_NULL in
642 the Makefile. Also defines the perl programs MKPATH,
643 WARN_IF_OLD_PACKLIST, MOD_INSTALL. DOC_INSTALL, and UNINSTALL.
650 my $bin_sh = $Config{sh} || 'cmd /c';
653 } unless $DMAKE; # dmake determines its own shell
655 for (qw/ CHMOD CP LD MV NOOP RM_F RM_RF TEST_F TOUCH UMASK_NULL DEV_NULL/ ) {
656 push @m, "$_ = $self->{$_}\n";
660 # The following is a portable way to say mkdir -p
661 # To see which directories are created, change the if 0 to if 1
662 MKPATH = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mkpath
664 # This helps us to minimize the effect of the .exists files A yet
665 # better solution would be to have a stable file in the perl
666 # distribution with a timestamp of zero. But this solution doesn't
667 # need any changes to the core distribution and works with older perls
668 EQUALIZE_TIMESTAMP = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e eqtime
672 return join "", @m if $self->{PARENT};
675 # Here we warn users that an old packlist file was found somewhere,
676 # and that they should call some uninstall routine
677 WARN_IF_OLD_PACKLIST = $(PERL) -lwe "exit unless -f $$ARGV[0];" \\
678 -e "print 'WARNING: I have found an old package in';" \\
679 -e "print ' ', $$ARGV[0], '.';" \\
680 -e "print 'Please make sure the two installations are not conflicting';"
685 MOD_INSTALL = $(PERL) -I$(INST_LIB) -I$(PERL_LIB) -MExtUtils::Install \
686 -e "install({ @ARGV },'$(VERBINST)',0,'$(UNINST)');"
688 DOC_INSTALL = $(PERL) -e "$$\=\"\n\n\";" \
689 -e "print '=head2 ', scalar(localtime), ': C<', shift, '>', ' L<', $$arg=shift, '|', $$arg, '>';" \
690 -e "print '=over 4';" \
691 -e "while (defined($$key = shift) and defined($$val = shift)) { print '=item *';print 'C<', \"$$key: $$val\", '>'; }" \
694 UNINSTALL = $(PERL) -MExtUtils::Install \
695 -e "uninstall($$ARGV[0],1,1); print \"\nUninstall is deprecated. Please check the";" \
696 -e "print \" packlist above carefully.\n There may be errors. Remove the\";" \
697 -e "print \" appropriate files manually.\n Sorry for the inconveniences.\n\""
705 Defines suffix rules to go from XS to object files directly. This is
706 only intended for broken make implementations.
710 sub xs_o { # many makes are too dumb to use xs_c then c_o
715 =item top_targets (o)
717 Defines the targets all, subdirs, config, and O_FILES
722 # --- Target Sections ---
727 #all :: config $(INST_PM) subdirs linkext manifypods
731 all :: pure_all htmlifypods manifypods
732 '.$self->{NOECHO}.'$(NOOP)
734 unless $self->{SKIPHASH}{'all'};
737 pure_all :: config pm_to_blib subdirs linkext
738 '.$self->{NOECHO}.'$(NOOP)
740 subdirs :: $(MYEXTLIB)
741 '.$self->{NOECHO}.'$(NOOP)
743 config :: '.$self->{MAKEFILE}.' $(INST_LIBDIR)\.exists
744 '.$self->{NOECHO}.'$(NOOP)
746 config :: $(INST_ARCHAUTODIR)\.exists
747 '.$self->{NOECHO}.'$(NOOP)
749 config :: $(INST_AUTODIR)\.exists
750 '.$self->{NOECHO}.'$(NOOP)
753 push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
755 if (%{$self->{HTMLLIBPODS}}) {
757 config :: \$(INST_HTMLLIBDIR)/.exists
758 $self->{NOECHO}\$(NOOP)
761 push @m, $self->dir_target(qw[$(INST_HTMLLIBDIR)]);
764 if (%{$self->{HTMLSCRIPTPODS}}) {
766 config :: \$(INST_HTMLSCRIPTDIR)/.exists
767 $self->{NOECHO}\$(NOOP)
770 push @m, $self->dir_target(qw[$(INST_HTMLSCRIPTDIR)]);
773 if (%{$self->{MAN1PODS}}) {
775 config :: \$(INST_MAN1DIR)\\.exists
776 $self->{NOECHO}\$(NOOP)
779 push @m, $self->dir_target(qw[$(INST_MAN1DIR)]);
781 if (%{$self->{MAN3PODS}}) {
783 config :: \$(INST_MAN3DIR)\\.exists
784 $self->{NOECHO}\$(NOOP)
787 push @m, $self->dir_target(qw[$(INST_MAN3DIR)]);
791 $(O_FILES): $(H_FILES)
792 ' if @{$self->{O_FILES} || []} && @{$self->{H} || []};
796 perldoc ExtUtils::MakeMaker
801 }.$self->{NOECHO}.q{$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
802 -MExtUtils::MakeMaker=Version_check \
803 -e "Version_check('$(MM_VERSION)')"
809 =item htmlifypods (o)
811 Defines targets and routines to translate the pods into HTML manpages
812 and put them into the INST_HTMLLIBDIR and INST_HTMLSCRIPTDIR
815 Same as MM_Unix version (changes command-line quoting).
820 my($self, %attribs) = @_;
821 return "\nhtmlifypods : pure_all\n\t$self->{NOECHO}\$(NOOP)\n" unless
822 %{$self->{HTMLLIBPODS}} || %{$self->{HTMLSCRIPTPODS}};
825 if (defined $self->{PERL_SRC}) {
826 $pod2html_exe = $self->catfile($self->{PERL_SRC},'pod','pod2html');
828 $pod2html_exe = $self->catfile($Config{scriptdirexp},'pod2html');
830 unless ($pod2html_exe = $self->perl_script($pod2html_exe)) {
831 # No pod2html but some HTMLxxxPODS to be installed
834 Warning: I could not locate your pod2html program. Please make sure,
835 your pod2html program is in your PATH before you execute 'make'
838 $pod2html_exe = "-S pod2html";
842 qq[POD2HTML_EXE = $pod2html_exe\n],
843 qq[POD2HTML = \$(PERL) -we "use File::Basename; use File::Path qw(mkpath); %m=\@ARGV;for (keys %m){" \\\n],
844 q[-e "next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M '],
845 $self->{MAKEFILE}, q[';" \\
846 -e "print qq(Htmlifying $$m{$$_}\n);" \\
847 -e "$$dir = dirname($$m{$$_}); mkpath($$dir) unless -d $$dir;" \\
848 -e "system(qq[$$^X ].q["-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" $(POD2HTML_EXE) ].qq[$$_>$$m{$$_}])==0 or warn qq(Couldn\\047t install $$m{$$_}\n);" \\
849 -e "chmod(oct($(PERM_RW))), $$m{$$_} or warn qq(chmod $(PERM_RW) $$m{$$_}: $$!\n);}"
851 push @m, "\nhtmlifypods : pure_all ";
852 push @m, join " \\\n\t", keys %{$self->{HTMLLIBPODS}}, keys %{$self->{HTMLSCRIPTPODS}};
855 if (%{$self->{HTMLLIBPODS}} || %{$self->{HTMLSCRIPTPODS}}) {
856 push @m, "\t$self->{NOECHO}\$(POD2HTML) \\\n\t";
857 push @m, join " \\\n\t", %{$self->{HTMLLIBPODS}}, %{$self->{HTMLSCRIPTPODS}};
864 We don't want manpage process.
870 return "\nmanifypods :\n\t$self->{NOECHO}\$(NOOP)\n";
875 Same as MM_Unix version (changes command-line quoting).
884 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=maniread \\
885 -e "@all = keys %{ maniread() };" \\
886 -e "print(\"Executing $(CI) @all\n\"); system(\"$(CI) @all\");" \\
887 -e "print(\"Executing $(RCS_LABEL) ...\n\"); system(\"$(RCS_LABEL) @all\");"
894 Same as MM_Unix version (changes command-line quoting).
902 dist : $(DIST_DEFAULT)
903 }.$self->{NOECHO}.q{$(PERL) -le "print \"Warning: Makefile possibly out of date with $$vf\" if " \
904 -e "-e ($$vf=\"$(VERSION_FROM)\") and -M $$vf < -M \"}.$self->{MAKEFILE}.q{\";"
906 tardist : $(DISTVNAME).tar$(SUFFIX)
908 zipdist : $(DISTVNAME).zip
910 $(DISTVNAME).tar$(SUFFIX) : distdir
913 $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
914 $(RM_RF) $(DISTVNAME)
915 $(COMPRESS) $(DISTVNAME).tar
918 $(DISTVNAME).zip : distdir
920 $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
921 $(RM_RF) $(DISTVNAME)
924 uutardist : $(DISTVNAME).tar$(SUFFIX)
925 uuencode $(DISTVNAME).tar$(SUFFIX) \\
926 $(DISTVNAME).tar$(SUFFIX) > \\
927 $(DISTVNAME).tar$(SUFFIX)_uu
931 $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
932 $(RM_RF) $(DISTVNAME)
940 Defines the string that is passed to recursive make calls in
947 return "PASTHRU = " . ($NMAKE ? "-nologo" : "");