1 package ExtUtils::MM_Win32;
3 our $VERSION = '1.00_02';
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
29 require ExtUtils::MakeMaker;
30 ExtUtils::MakeMaker->import(qw( $Verbose &neatvalue));
32 $ENV{EMXSHELL} = 'sh'; # to run `commands`
33 unshift @MM::ISA, 'ExtUtils::MM_Win32';
35 $BORLAND = 1 if $Config{'cc'} =~ /^bcc/i;
36 $GCC = 1 if $Config{'cc'} =~ /^gcc/i;
37 $DMAKE = 1 if $Config{'make'} =~ /^dmake/i;
38 $NMAKE = 1 if $Config{'make'} =~ /^nmake/i;
39 $PERLMAKE = 1 if $Config{'make'} =~ /^pmake/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 # The above two lines quoted differently to work around
102 # a bug in the 4DOS/4NT command line interpreter. The visible
103 # result of the bug was files named q('extension_name',) *with the
104 # single quotes and the comma* in the extension build directories.
105 q!', 'DL_FUNCS' => !,neatvalue($funcs),
106 q!, 'FUNCLIST' => !,neatvalue($funclist),
107 q!, 'IMPORTS' => !,neatvalue($imports),
108 q!, 'DL_VARS' => !, neatvalue($vars), q!);"
114 sub replace_manpage_separator {
121 my($self,$file) = @_;
122 my @e = exists($ENV{'PATHEXT'})
123 ? split(/;/, $ENV{PATHEXT})
124 : qw(.com .exe .bat .cmd);
126 for (@e) { $e .= "\Q$_\E|" }
128 # see if file ends in one of the known extensions
129 if ($file =~ /($e)$/i) {
130 return $file if -e $file;
134 return "$file$_" if -e "$file$_";
140 sub file_name_is_absolute {
142 return File::Spec->file_name_is_absolute(@_);
146 my($self, $ver, $names, $dirs, $trace) = @_;
151 print "Looking for perl $ver by these names:
157 foreach $dir (@$dirs){
158 next unless defined $dir; # $self->{PERL_SRC} may be undefined
159 foreach $name (@$names){
161 if (File::Spec->file_name_is_absolute($name)) { # /foo/bar
163 } elsif (File::Spec->canonpath($name) eq File::Spec->canonpath(basename($name))) { # foo
164 $abs = File::Spec->catfile($dir, $name);
166 $abs = File::Spec->canonpath(File::Spec->catfile(File::Spec->curdir, $name));
168 print "Checking $abs\n" if ($trace >= 2);
169 next unless $self->maybe_command($abs);
170 print "Executing $abs\n" if ($trace >= 2);
171 $val = `$abs -e "require $ver;" 2>&1`;
173 print "Using PERL=$abs\n" if $trace;
175 } elsif ($trace >= 2) {
176 print "Result: `$val'\n";
180 print STDOUT "Unable to find a perl $ver (by these names: @$names, in these dirs: @$dirs)\n";
181 0; # false and not empty
186 return File::Spec->catdir(@_);
191 Concatenate one or more directory names and a filename to form a
192 complete path ending with a filename
198 return File::Spec->catfile(@_);
204 &ExtUtils::MM_Unix::init_others;
205 $self->{'TOUCH'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e touch';
206 $self->{'CHMOD'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e chmod';
207 $self->{'CP'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e cp';
208 $self->{'RM_F'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e rm_f';
209 $self->{'RM_RF'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e rm_rf';
210 $self->{'MV'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mv';
211 $self->{'NOOP'} = 'rem';
212 $self->{'TEST_F'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e test_f';
213 $self->{'LD'} = $Config{'ld'} || 'link';
214 $self->{'AR'} = $Config{'ar'} || 'lib';
215 $self->{'LDLOADLIBS'} ||= $Config{'libs'};
216 # -Lfoo must come first for Borland, so we put it in LDDLFLAGS
218 my $libs = $self->{'LDLOADLIBS'};
220 while ($libs =~ s/(?:^|\s)(("?)-L.+?\2)(?:\s|$)/ /) {
221 $libpath .= ' ' if length $libpath;
224 $self->{'LDLOADLIBS'} = $libs;
225 $self->{'LDDLFLAGS'} ||= $Config{'lddlflags'};
226 $self->{'LDDLFLAGS'} .= " $libpath";
228 $self->{'DEV_NULL'} = '> NUL';
229 # $self->{'NOECHO'} = ''; # till we have it working
235 Initializes lots of constants and .SUFFIXES and .PHONY
245 AR_STATIC_ARGS NAME DISTNAME NAME_SYM VERSION
246 VERSION_SYM XS_VERSION INST_BIN INST_EXE INST_LIB
247 INST_ARCHLIB INST_SCRIPT PREFIX INSTALLDIRS
248 INSTALLPRIVLIB INSTALLARCHLIB INSTALLSITELIB
249 INSTALLSITEARCH INSTALLBIN INSTALLSCRIPT PERL_LIB
250 PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
251 FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC
252 PERL_INC PERL FULLPERL PERLRUN PERLRUNINST TEST_LIBS
256 next unless defined $self->{$tmp};
257 push @m, "$tmp = $self->{$tmp}\n";
261 VERSION_MACRO = VERSION
262 DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\"
263 XS_VERSION_MACRO = XS_VERSION
264 XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\"
268 MAKEMAKER = $INC{'ExtUtils/MakeMaker.pm'}
269 MM_VERSION = $ExtUtils::MakeMaker::VERSION
273 # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
274 # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
275 # ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD) !!! Deprecated from MM 5.32 !!!
276 # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
277 # DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
281 FULLEXT BASEEXT PARENT_NAME DLBASE VERSION_FROM INC DEFINE OBJECT
284 next unless defined $self->{$tmp};
285 push @m, "$tmp = $self->{$tmp}\n";
289 # Handy lists of source code files:
290 XS_FILES= ".join(" \\\n\t", sort keys %{$self->{XS}})."
291 C_FILES = ".join(" \\\n\t", @{$self->{C}})."
292 O_FILES = ".join(" \\\n\t", @{$self->{O_FILES}})."
293 H_FILES = ".join(" \\\n\t", @{$self->{H}})."
294 HTMLLIBPODS = ".join(" \\\n\t", sort keys %{$self->{HTMLLIBPODS}})."
295 HTMLSCRIPTPODS = ".join(" \\\n\t", sort keys %{$self->{HTMLSCRIPTPODS}})."
296 MAN1PODS = ".join(" \\\n\t", sort keys %{$self->{MAN1PODS}})."
297 MAN3PODS = ".join(" \\\n\t", sort keys %{$self->{MAN3PODS}})."
301 INST_HTMLPRIVLIBDIR INSTALLHTMLPRIVLIBDIR
302 INST_HTMLSITELIBDIR INSTALLHTMLSITELIBDIR
303 INST_HTMLSCRIPTDIR INSTALLHTMLSCRIPTDIR
304 INST_HTMLLIBDIR HTMLEXT
305 INST_MAN1DIR INSTALLMAN1DIR MAN1EXT
306 INST_MAN3DIR INSTALLMAN3DIR MAN3EXT
308 next unless defined $self->{$tmp};
309 push @m, "$tmp = $self->{$tmp}\n";
317 .NO_CONFIG_REC: Makefile
318 } if $ENV{CLEARCASE_ROOT};
320 # why not q{} ? -- emacs
322 # work around a famous dec-osf make(1) feature(?):
325 .SUFFIXES: .xs .c .C .cpp .cxx .cc \$(OBJ_EXT)
327 # Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to
328 # recall, that some make implementations will delete the Makefile when we
329 # rebuild it. Because we call false(1) when we rebuild it. So make(1) is
330 # not completely wrong when it does so. Our milage may vary.
331 # .PRECIOUS: Makefile # seems to be not necessary anymore
333 .PHONY: all config static dynamic test linkext manifest
335 # Where is the Config information that we are using/depend on
336 CONFIGDEP = \$(PERL_ARCHLIB)\\Config.pm \$(PERL_INC)\\config.h
339 my @parentdir = split(/::/, $self->{PARENT_NAME});
341 # Where to put things:
342 INST_LIBDIR = }. File::Spec->catdir('$(INST_LIB)',@parentdir) .q{
343 INST_ARCHLIBDIR = }. File::Spec->catdir('$(INST_ARCHLIB)',@parentdir) .q{
345 INST_AUTODIR = }. File::Spec->catdir('$(INST_LIB)','auto','$(FULLEXT)') .q{
346 INST_ARCHAUTODIR = }. File::Spec->catdir('$(INST_ARCHLIB)','auto','$(FULLEXT)') .q{
349 if ($self->has_link_code()) {
351 INST_STATIC = $(INST_ARCHAUTODIR)\$(BASEEXT)$(LIB_EXT)
352 INST_DYNAMIC = $(INST_ARCHAUTODIR)\$(DLBASE).$(DLEXT)
353 INST_BOOT = $(INST_ARCHAUTODIR)\$(BASEEXT).bs
363 $tmp = $self->export_list;
367 $tmp = $self->perl_archive;
373 #INST_PM = }.join(" \\\n\t", sort values %{$self->{PM}}).q{
375 #PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
379 TO_INST_PM = }.join(" \\\n\t", sort keys %{$self->{PM}}).q{
381 PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
389 return File::Spec->path();
394 Defines how to produce the *.a (or equivalent) files.
400 # Come to think of it, if there are subdirs with linkcode, we still have no INST_STATIC
401 # return '' unless $self->needs_linking(); #might be because of a subdir
403 return '' unless $self->has_link_code;
407 $(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)\.exists
410 # If this extension has its own library (eg SDBM_File)
411 # then copy that to $(INST_STATIC) and add $(OBJECT) into it.
412 push(@m, "\t$self->{CP} \$(MYEXTLIB) \$\@\n") if $self->{MYEXTLIB};
415 q{ $(AR) }.($BORLAND ? '$@ $(OBJECT:^"+")'
416 : ($GCC ? '-ru $@ $(OBJECT)'
417 : '-out:$@ $(OBJECT)')).q{
418 }.$self->{NOECHO}.q{echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)\extralibs.ld
422 # Old mechanism - still available:
424 push @m, "\t$self->{NOECHO}".q{echo "$(EXTRALIBS)" >> $(PERL_SRC)\ext.libs}."\n\n"
425 if $self->{PERL_SRC};
427 push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
433 Defines targets for bootstrap files.
438 my($self, %attribs) = @_;
441 ' unless $self->has_link_code();
444 BOOTSTRAP = '."$self->{BASEEXT}.bs".'
446 # As Mkbootstrap might not write a file (if none is required)
447 # we use touch to prevent make continually trying to remake it.
448 # The DynaLoader only reads a non-empty file.
449 $(BOOTSTRAP): '."$self->{MAKEFILE} $self->{BOOTDEP}".' $(INST_ARCHAUTODIR)\.exists
450 '.$self->{NOECHO}.'echo "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
451 '.$self->{NOECHO}.'$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \
452 -MExtUtils::Mkbootstrap \
453 -e "Mkbootstrap(\'$(BASEEXT)\',\'$(BSLOADLIBS)\');"
454 '.$self->{NOECHO}.'$(TOUCH) $(BOOTSTRAP)
457 $(INST_BOOT): $(BOOTSTRAP) $(INST_ARCHAUTODIR)\.exists
458 '."$self->{NOECHO}$self->{RM_RF}".' $(INST_BOOT)
459 -'.$self->{CP}.' $(BOOTSTRAP) $(INST_BOOT)
464 =item dynamic_lib (o)
466 Defines how to produce the *.so (or equivalent) files.
471 my($self, %attribs) = @_;
472 return '' unless $self->needs_linking(); #might be because of a subdir
474 return '' unless $self->has_link_code;
476 my($otherldflags) = $attribs{OTHERLDFLAGS} || ($BORLAND ? 'c0d32.obj': '');
477 my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
478 my($ldfrom) = '$(LDFROM)';
481 # one thing for GCC/Mingw32:
482 # we try to overcome non-relocateable-DLL problems by generating
483 # a (hopefully unique) image-base from the dll's name
486 my $dllname = $self->{BASEEXT} . "." . $self->{DLEXT};
487 $dllname =~ /(....)(.{0,4})/;
488 my $baseaddr = unpack("n", $1 ^ $2);
489 $otherldflags .= sprintf("-Wl,--image-base,0x%x0000 ", $baseaddr);
493 # This section creates the dynamically loadable $(INST_DYNAMIC)
494 # from $(OBJECT) and possibly $(MYEXTLIB).
495 OTHERLDFLAGS = '.$otherldflags.'
496 INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
498 $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)\.exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
502 q{ dlltool --def $(EXPORT_LIST) --output-exp dll.exp
503 $(LD) -o $@ -Wl,--base-file -Wl,dll.base $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) dll.exp
504 dlltool --def $(EXPORT_LIST) --base-file dll.base --output-exp dll.exp
505 $(LD) -o $@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) dll.exp });
508 q{ $(LD) $(LDDLFLAGS) $(OTHERLDFLAGS) }.$ldfrom.q{,$@,,}
509 .($DMAKE ? q{$(PERL_ARCHIVE:s,/,\,) $(LDLOADLIBS:s,/,\,) }
510 .q{$(MYEXTLIB:s,/,\,),$(EXPORT_LIST:s,/,\,)}
511 : q{$(subst /,\,$(PERL_ARCHIVE)) $(subst /,\,$(LDLOADLIBS)) }
512 .q{$(subst /,\,$(MYEXTLIB)),$(subst /,\,$(EXPORT_LIST))})
516 q{ $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) }
517 .q{$(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)});
523 push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
530 my $s = &ExtUtils::MM_Unix::clean;
531 my $clean = $GCC ? 'dll.base dll.exp' : '*.pdb';
545 return '$(PERL_INC)\\'.$Config{'libperl'};
551 return "$self->{BASEEXT}.def";
556 No physical check on the filesystem, but a logical cleanup of a
557 path. On UNIX eliminated successive slashes and successive "/.".
562 my($self,$path) = @_;
563 $path =~ s/^([a-z]:)/\u$1/;
565 $path =~ s|(.)\\+|$1\\|g ; # xx////xx -> xx/xx
566 $path =~ s|(\\\.)+\\|\\|g ; # xx/././xx -> xx/xx
567 $path =~ s|^(\.\\)+|| unless $path eq ".\\"; # ./xx -> xx
569 unless $path =~ m#^([a-z]:)?\\#; # xx/ -> xx
570 $path .= '.' if $path =~ m#\\$#;
576 Takes one argument, a file name, and returns the file name, if the
577 argument is likely to be a perl script. On MM_Unix this is true for
578 any ordinary, readable file.
583 my($self,$file) = @_;
584 return $file if -r $file && -f _;
585 return "$file.pl" if -r "$file.pl" && -f _;
586 return "$file.bat" if -r "$file.bat" && -f _;
592 Defines target that copies all files in the hash PM to their
593 destination and autosplits them. See L<ExtUtils::Install/DESCRIPTION>
599 my($autodir) = File::Spec->catdir('$(INST_LIB)','auto');
601 pm_to_blib: $(TO_INST_PM)
602 }.$self->{NOECHO}.q{$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
603 "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
605 ($NMAKE ? 'qw[ <<pmfiles.dat ],'
606 : $DMAKE ? 'qw[ $(mktmp,pmfiles.dat $(PM_TO_BLIB:s,\\,\\\\,)\n) ],'
607 : '{ qw[$(PM_TO_BLIB)] },'
608 ).q{'}.$autodir.q{','$(PM_FILTER)')"
612 } : '') . $self->{NOECHO}.q{$(TOUCH) $@
616 =item test_via_harness (o)
618 Helper method to write the test targets
622 sub test_via_harness {
623 my($self, $perl, $tests) = @_;
624 "\t$perl".q! -Mblib -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e "use Test::Harness qw(&runtests $$verbose); $$verbose=$(TEST_VERBOSE); runtests @ARGV;" !."$tests\n";
628 =item tool_autosplit (override)
630 Use Win32 quoting on command line.
635 my($self, %attribs) = @_;
637 $asl = "\$AutoSplit::Maxlen=$attribs{MAXLEN};" if $attribs{MAXLEN};
639 # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
640 AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MAutoSplit }.$asl.q{ -e "autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1);"
644 =item tools_other (o)
648 Defines SHELL, LD, TOUCH, CP, MV, RM_F, RM_RF, CHMOD, UMASK_NULL in
649 the Makefile. Also defines the perl programs MKPATH,
650 WARN_IF_OLD_PACKLIST, MOD_INSTALL. DOC_INSTALL, and UNINSTALL.
657 my $bin_sh = $Config{sh} || 'cmd /c';
660 } unless $DMAKE; # dmake determines its own shell
662 for (qw/ CHMOD CP LD MV NOOP RM_F RM_RF TEST_F TOUCH UMASK_NULL DEV_NULL/ ) {
663 push @m, "$_ = $self->{$_}\n";
667 # The following is a portable way to say mkdir -p
668 # To see which directories are created, change the if 0 to if 1
669 MKPATH = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mkpath
671 # This helps us to minimize the effect of the .exists files A yet
672 # better solution would be to have a stable file in the perl
673 # distribution with a timestamp of zero. But this solution doesn't
674 # need any changes to the core distribution and works with older perls
675 EQUALIZE_TIMESTAMP = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e eqtime
679 return join "", @m if $self->{PARENT};
682 # Here we warn users that an old packlist file was found somewhere,
683 # and that they should call some uninstall routine
684 WARN_IF_OLD_PACKLIST = $(PERL) -lwe "exit unless -f $$ARGV[0];" \\
685 -e "print 'WARNING: I have found an old package in';" \\
686 -e "print ' ', $$ARGV[0], '.';" \\
687 -e "print 'Please make sure the two installations are not conflicting';"
692 MOD_INSTALL = $(PERL) -I$(INST_LIB) -I$(PERL_LIB) -MExtUtils::Install \
693 -e "install({ @ARGV },'$(VERBINST)',0,'$(UNINST)');"
695 DOC_INSTALL = $(PERL) -e "$$\=\"\n\n\";" \
696 -e "print '=head2 ', scalar(localtime), ': C<', shift, '>', ' L<', $$arg=shift, '|', $$arg, '>';" \
697 -e "print '=over 4';" \
698 -e "while (defined($$key = shift) and defined($$val = shift)) { print '=item *';print 'C<', \"$$key: $$val\", '>'; }" \
701 UNINSTALL = $(PERL) -MExtUtils::Install \
702 -e "uninstall($$ARGV[0],1,1); print \"\nUninstall is deprecated. Please check the";" \
703 -e "print \" packlist above carefully.\n There may be errors. Remove the\";" \
704 -e "print \" appropriate files manually.\n Sorry for the inconveniences.\n\""
712 Defines suffix rules to go from XS to object files directly. This is
713 only intended for broken make implementations.
717 sub xs_o { # many makes are too dumb to use xs_c then c_o
722 =item top_targets (o)
724 Defines the targets all, subdirs, config, and O_FILES
729 # --- Target Sections ---
734 #all :: config $(INST_PM) subdirs linkext manifypods
738 all :: pure_all htmlifypods manifypods
739 '.$self->{NOECHO}.'$(NOOP)
741 unless $self->{SKIPHASH}{'all'};
744 pure_all :: config pm_to_blib subdirs linkext
745 '.$self->{NOECHO}.'$(NOOP)
747 subdirs :: $(MYEXTLIB)
748 '.$self->{NOECHO}.'$(NOOP)
750 config :: '.$self->{MAKEFILE}.' $(INST_LIBDIR)\.exists
751 '.$self->{NOECHO}.'$(NOOP)
753 config :: $(INST_ARCHAUTODIR)\.exists
754 '.$self->{NOECHO}.'$(NOOP)
756 config :: $(INST_AUTODIR)\.exists
757 '.$self->{NOECHO}.'$(NOOP)
760 push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
762 if (%{$self->{HTMLLIBPODS}}) {
764 config :: \$(INST_HTMLLIBDIR)/.exists
765 $self->{NOECHO}\$(NOOP)
768 push @m, $self->dir_target(qw[$(INST_HTMLLIBDIR)]);
771 if (%{$self->{HTMLSCRIPTPODS}}) {
773 config :: \$(INST_HTMLSCRIPTDIR)/.exists
774 $self->{NOECHO}\$(NOOP)
777 push @m, $self->dir_target(qw[$(INST_HTMLSCRIPTDIR)]);
780 if (%{$self->{MAN1PODS}}) {
782 config :: \$(INST_MAN1DIR)\\.exists
783 $self->{NOECHO}\$(NOOP)
786 push @m, $self->dir_target(qw[$(INST_MAN1DIR)]);
788 if (%{$self->{MAN3PODS}}) {
790 config :: \$(INST_MAN3DIR)\\.exists
791 $self->{NOECHO}\$(NOOP)
794 push @m, $self->dir_target(qw[$(INST_MAN3DIR)]);
798 $(O_FILES): $(H_FILES)
799 ' if @{$self->{O_FILES} || []} && @{$self->{H} || []};
803 perldoc ExtUtils::MakeMaker
808 }.$self->{NOECHO}.q{$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
809 -MExtUtils::MakeMaker=Version_check \
810 -e "Version_check('$(MM_VERSION)')"
816 =item htmlifypods (o)
818 Defines targets and routines to translate the pods into HTML manpages
819 and put them into the INST_HTMLLIBDIR and INST_HTMLSCRIPTDIR
822 Same as MM_Unix version (changes command-line quoting).
827 my($self, %attribs) = @_;
828 return "\nhtmlifypods : pure_all\n\t$self->{NOECHO}\$(NOOP)\n" unless
829 %{$self->{HTMLLIBPODS}} || %{$self->{HTMLSCRIPTPODS}};
832 if (defined $self->{PERL_SRC}) {
833 $pod2html_exe = File::Spec->catfile($self->{PERL_SRC},'pod','pod2html');
835 $pod2html_exe = File::Spec->catfile($Config{scriptdirexp},'pod2html');
837 unless ($pod2html_exe = $self->perl_script($pod2html_exe)) {
838 # No pod2html but some HTMLxxxPODS to be installed
841 Warning: I could not locate your pod2html program. Please make sure,
842 your pod2html program is in your PATH before you execute 'make'
845 $pod2html_exe = "-S pod2html";
849 qq[POD2HTML_EXE = $pod2html_exe\n],
850 qq[POD2HTML = \$(PERL) -we "use File::Basename; use File::Path qw(mkpath); %m=\@ARGV;for (keys %m){" \\\n],
851 q[-e "next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M '],
852 $self->{MAKEFILE}, q[';" \\
853 -e "print qq(Htmlifying $$m{$$_}\n);" \\
854 -e "$$dir = dirname($$m{$$_}); mkpath($$dir) unless -d $$dir;" \\
855 -e "system(qq[$$^X ].q["-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" $(POD2HTML_EXE) ].qq[$$_>$$m{$$_}])==0 or warn qq(Couldn\\047t install $$m{$$_}\n);" \\
856 -e "chmod(oct($(PERM_RW))), $$m{$$_} or warn qq(chmod $(PERM_RW) $$m{$$_}: $$!\n);}"
858 push @m, "\nhtmlifypods : pure_all ";
859 push @m, join " \\\n\t", keys %{$self->{HTMLLIBPODS}}, keys %{$self->{HTMLSCRIPTPODS}};
862 if (%{$self->{HTMLLIBPODS}} || %{$self->{HTMLSCRIPTPODS}}) {
863 push @m, "\t$self->{NOECHO}\$(POD2HTML) \\\n\t";
864 push @m, join " \\\n\t", %{$self->{HTMLLIBPODS}}, %{$self->{HTMLSCRIPTPODS}};
871 We don't want manpage process.
877 return "\nmanifypods :\n\t$self->{NOECHO}\$(NOOP)\n";
882 Same as MM_Unix version (changes command-line quoting).
891 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=maniread \\
892 -e "@all = keys %{ maniread() };" \\
893 -e "print(\"Executing $(CI) @all\n\"); system(\"$(CI) @all\");" \\
894 -e "print(\"Executing $(RCS_LABEL) ...\n\"); system(\"$(RCS_LABEL) @all\");"
901 Same as MM_Unix version (changes command-line quoting).
909 dist : $(DIST_DEFAULT)
910 }.$self->{NOECHO}.q{$(PERL) -le "print \"Warning: Makefile possibly out of date with $$vf\" if " \
911 -e "-e ($$vf=\"$(VERSION_FROM)\") and -M $$vf < -M \"}.$self->{MAKEFILE}.q{\";"
913 tardist : $(DISTVNAME).tar$(SUFFIX)
915 zipdist : $(DISTVNAME).zip
917 $(DISTVNAME).tar$(SUFFIX) : distdir
920 $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
921 $(RM_RF) $(DISTVNAME)
922 $(COMPRESS) $(DISTVNAME).tar
925 $(DISTVNAME).zip : distdir
927 $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
928 $(RM_RF) $(DISTVNAME)
931 uutardist : $(DISTVNAME).tar$(SUFFIX)
932 uuencode $(DISTVNAME).tar$(SUFFIX) \\
933 $(DISTVNAME).tar$(SUFFIX) > \\
934 $(DISTVNAME).tar$(SUFFIX)_uu
938 $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
939 $(RM_RF) $(DISTVNAME)
947 Defines the string that is passed to recursive make calls in
954 return "PASTHRU = " . ($NMAKE ? "-nologo" : "");