1 package ExtUtils::MM_Win32;
5 ExtUtils::MM_Win32 - methods to override UN*X behaviour in ExtUtils::MakeMaker
9 use ExtUtils::MM_Win32; # Done internally by ExtUtils::MakeMaker if needed
13 See ExtUtils::MM_Unix for a documentation of the methods provided
14 there. This package overrides the implementation of these methods, not
26 Exporter::import('ExtUtils::MakeMaker',
27 qw( $Verbose &neatvalue));
29 $ENV{EMXSHELL} = 'sh'; # to run `commands`
30 unshift @MM::ISA, 'ExtUtils::MM_Win32';
32 $BORLAND = 1 if $Config{'cc'} =~ /^bcc/i;
33 $GCC = 1 if $Config{'cc'} =~ /^gcc/i;
34 $DMAKE = 1 if $Config{'make'} =~ /^dmake/i;
35 $NMAKE = 1 if $Config{'make'} =~ /^nmake/i;
36 $PERLMAKE = 1 if $Config{'make'} =~ /^pmake/i;
37 $OBJ = 1 if $Config{'ccflags'} =~ /PERL_OBJECT/i;
39 # a few workarounds for command.com (very basic)
41 package ExtUtils::MM_Win95;
43 # the $^O test may be overkill, but we want to be sure Win32::IsWin95()
44 # exists before we try it
46 unshift @MM::ISA, 'ExtUtils::MM_Win95'
47 if ($^O =~ /Win32/ && Win32::IsWin95());
51 return '' unless $self->needs_linking();
54 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\
55 $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c
61 return '' unless $self->needs_linking();
64 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\
65 $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.cpp
69 # many makes are too dumb to use xs_c then c_o
72 return '' unless $self->needs_linking();
75 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\
76 $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c
77 $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
80 } # end of command.com workarounds
83 my($self,%attribs) = @_;
85 my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {};
86 my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || [];
87 my($funclist) = $attribs{FUNCLIST} || $self->{FUNCLIST} || [];
88 my($imports) = $attribs{IMPORTS} || $self->{IMPORTS} || {};
90 (my $boot = $self->{NAME}) =~ s/:/_/g;
92 if (not $self->{SKIPHASH}{'dynamic'}) {
94 $self->{BASEEXT}.def: Makefile.PL
96 q! $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Mksymlists \\
97 -e "Mksymlists('NAME' => '!, $self->{NAME},
98 q!', 'DLBASE' => '!,$self->{DLBASE},
99 q!', 'DL_FUNCS' => !,neatvalue($funcs),
100 q!, 'FUNCLIST' => !,neatvalue($funclist),
101 q!, 'IMPORTS' => !,neatvalue($imports),
102 q!, 'DL_VARS' => !, neatvalue($vars), q!);"
108 sub replace_manpage_separator {
115 my($self,$file) = @_;
116 my @e = exists($ENV{'PATHEXT'})
117 ? split(/;/, $ENV{PATHEXT})
118 : qw(.com .exe .bat .cmd);
120 for (@e) { $e .= "\Q$_\E|" }
122 # see if file ends in one of the known extensions
123 if ($file =~ /($e)$/i) {
124 return $file if -e $file;
128 return "$file$_" if -e "$file$_";
134 sub file_name_is_absolute {
135 my($self,$file) = @_;
136 $file =~ m{^([a-z]:)?[\\/]}i ;
140 my($self, $ver, $names, $dirs, $trace) = @_;
143 print "Looking for perl $ver by these names:
149 foreach $dir (@$dirs){
150 next unless defined $dir; # $self->{PERL_SRC} may be undefined
151 foreach $name (@$names){
153 if ($self->file_name_is_absolute($name)) { # /foo/bar
155 } elsif ($self->canonpath($name) eq $self->canonpath(basename($name))) { # foo
156 $abs = $self->catfile($dir, $name);
158 $abs = $self->canonpath($self->catfile($self->curdir, $name));
160 print "Checking $abs\n" if ($trace >= 2);
161 next unless $self->maybe_command($abs);
162 print "Executing $abs\n" if ($trace >= 2);
163 $val = `$abs -e "require $ver;" 2>&1`;
165 print "Using PERL=$abs\n" if $trace;
167 } elsif ($trace >= 2) {
168 print "Result: `$val'\n";
172 print STDOUT "Unable to find a perl $ver (by these names: @$names, in these dirs: @$dirs)\n";
173 0; # false and not empty
180 # append a slash to each argument unless it has one there
181 $_ .= "\\" if $_ eq '' or substr($_,-1) ne "\\";
183 my $result = $self->canonpath(join('', @args));
189 Concatenate one or more directory names and a filename to form a
190 complete path ending with a filename
197 return $file unless @_;
198 my $dir = $self->catdir(@_);
200 $dir .= "\\" unless substr($dir,length($dir)-1,1) eq "\\";
207 &ExtUtils::MM_Unix::init_others;
208 $self->{'TOUCH'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e touch';
209 $self->{'CHMOD'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e chmod';
210 $self->{'CP'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e cp';
211 $self->{'RM_F'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e rm_f';
212 $self->{'RM_RF'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e rm_rf';
213 $self->{'MV'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mv';
214 $self->{'NOOP'} = 'rem';
215 $self->{'TEST_F'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e test_f';
216 $self->{'LD'} = $Config{'ld'} || 'link';
217 $self->{'AR'} = $Config{'ar'} || 'lib';
218 $self->{'LDLOADLIBS'} ||= $Config{'libs'};
219 # -Lfoo must come first for Borland, so we put it in LDDLFLAGS
221 my $libs = $self->{'LDLOADLIBS'};
223 while ($libs =~ s/(?:^|\s)(("?)-L.+?\2)(?:\s|$)/ /) {
224 $libpath .= ' ' if length $libpath;
227 $self->{'LDLOADLIBS'} = $libs;
228 $self->{'LDDLFLAGS'} ||= $Config{'lddlflags'};
229 $self->{'LDDLFLAGS'} .= " $libpath";
231 $self->{'DEV_NULL'} = '> NUL';
232 # $self->{'NOECHO'} = ''; # till we have it working
238 Initializes lots of constants and .SUFFIXES and .PHONY
248 AR_STATIC_ARGS NAME DISTNAME NAME_SYM VERSION
249 VERSION_SYM XS_VERSION INST_BIN INST_EXE INST_LIB
250 INST_ARCHLIB INST_SCRIPT PREFIX INSTALLDIRS
251 INSTALLPRIVLIB INSTALLARCHLIB INSTALLSITELIB
252 INSTALLSITEARCH INSTALLBIN INSTALLSCRIPT PERL_LIB
253 PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
254 FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC
255 PERL_INC PERL FULLPERL
258 next unless defined $self->{$tmp};
259 push @m, "$tmp = $self->{$tmp}\n";
263 VERSION_MACRO = VERSION
264 DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\"
265 XS_VERSION_MACRO = XS_VERSION
266 XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\"
270 MAKEMAKER = $INC{'ExtUtils\MakeMaker.pm'}
271 MM_VERSION = $ExtUtils::MakeMaker::VERSION
275 # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
276 # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
277 # ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD) !!! Deprecated from MM 5.32 !!!
278 # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
279 # DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
283 FULLEXT BASEEXT PARENT_NAME DLBASE VERSION_FROM INC DEFINE OBJECT
286 next unless defined $self->{$tmp};
287 push @m, "$tmp = $self->{$tmp}\n";
291 # Handy lists of source code files:
292 XS_FILES= ".join(" \\\n\t", sort keys %{$self->{XS}})."
293 C_FILES = ".join(" \\\n\t", @{$self->{C}})."
294 O_FILES = ".join(" \\\n\t", @{$self->{O_FILES}})."
295 H_FILES = ".join(" \\\n\t", @{$self->{H}})."
296 HTMLLIBPODS = ".join(" \\\n\t", sort keys %{$self->{HTMLLIBPODS}})."
297 HTMLSCRIPTPODS = ".join(" \\\n\t", sort keys %{$self->{HTMLSCRIPTPODS}})."
298 MAN1PODS = ".join(" \\\n\t", sort keys %{$self->{MAN1PODS}})."
299 MAN3PODS = ".join(" \\\n\t", sort keys %{$self->{MAN3PODS}})."
303 INST_HTMLPRIVLIBDIR INSTALLHTMLPRIVLIBDIR
304 INST_HTMLSITELIBDIR INSTALLHTMLSITELIBDIR
305 INST_HTMLSCRIPTDIR INSTALLHTMLSCRIPTDIR
306 INST_HTMLLIBDIR HTMLEXT
307 INST_MAN1DIR INSTALLMAN1DIR MAN1EXT
308 INST_MAN3DIR INSTALLMAN3DIR MAN3EXT
310 next unless defined $self->{$tmp};
311 push @m, "$tmp = $self->{$tmp}\n";
319 .NO_CONFIG_REC: Makefile
320 } if $ENV{CLEARCASE_ROOT};
322 # why not q{} ? -- emacs
324 # work around a famous dec-osf make(1) feature(?):
327 .SUFFIXES: .xs .c .C .cpp .cxx .cc \$(OBJ_EXT)
329 # Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
330 # some make implementations will delete the Makefile when we rebuild it. Because
331 # we call false(1) when we rebuild it. So make(1) is not completely wrong when it
332 # does so. Our milage may vary.
333 # .PRECIOUS: Makefile # seems to be not necessary anymore
335 .PHONY: all config static dynamic test linkext manifest
337 # Where is the Config information that we are using/depend on
338 CONFIGDEP = \$(PERL_ARCHLIB)\\Config.pm \$(PERL_INC)\\config.h
341 my @parentdir = split(/::/, $self->{PARENT_NAME});
343 # Where to put things:
344 INST_LIBDIR = }. $self->catdir('$(INST_LIB)',@parentdir) .q{
345 INST_ARCHLIBDIR = }. $self->catdir('$(INST_ARCHLIB)',@parentdir) .q{
347 INST_AUTODIR = }. $self->catdir('$(INST_LIB)','auto','$(FULLEXT)') .q{
348 INST_ARCHAUTODIR = }. $self->catdir('$(INST_ARCHLIB)','auto','$(FULLEXT)') .q{
351 if ($self->has_link_code()) {
353 INST_STATIC = $(INST_ARCHAUTODIR)\$(BASEEXT)$(LIB_EXT)
354 INST_DYNAMIC = $(INST_ARCHAUTODIR)\$(DLBASE).$(DLEXT)
355 INST_BOOT = $(INST_ARCHAUTODIR)\$(BASEEXT).bs
365 $tmp = $self->export_list;
369 $tmp = $self->perl_archive;
375 #INST_PM = }.join(" \\\n\t", sort values %{$self->{PM}}).q{
377 #PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
381 TO_INST_PM = }.join(" \\\n\t", sort keys %{$self->{PM}}).q{
383 PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
393 my $path = $ENV{'PATH'} || $ENV{'Path'} || $ENV{'path'};
394 my @path = split(';',$path);
395 foreach(@path) { $_ = '.' if $_ eq '' }
401 Defines how to produce the *.a (or equivalent) files.
407 # Come to think of it, if there are subdirs with linkcode, we still have no INST_STATIC
408 # return '' unless $self->needs_linking(); #might be because of a subdir
410 return '' unless $self->has_link_code;
414 $(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)\.exists
417 # If this extension has it's own library (eg SDBM_File)
418 # then copy that to $(INST_STATIC) and add $(OBJECT) into it.
419 push(@m, "\t$self->{CP} \$(MYEXTLIB) \$\@\n") if $self->{MYEXTLIB};
422 q{ $(AR) }.($BORLAND ? '$@ $(OBJECT:^"+")'
423 : ($GCC ? '-ru $@ $(OBJECT)'
424 : '-out:$@ $(OBJECT)')).q{
425 }.$self->{NOECHO}.q{echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)\extralibs.ld
429 # Old mechanism - still available:
431 push @m, "\t$self->{NOECHO}".q{echo "$(EXTRALIBS)" >> $(PERL_SRC)\ext.libs}."\n\n"
432 if $self->{PERL_SRC};
434 push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
440 Defines targets for bootstrap files.
445 my($self, %attribs) = @_;
448 ' unless $self->has_link_code();
451 BOOTSTRAP = '."$self->{BASEEXT}.bs".'
453 # As Mkbootstrap might not write a file (if none is required)
454 # we use touch to prevent make continually trying to remake it.
455 # The DynaLoader only reads a non-empty file.
456 $(BOOTSTRAP): '."$self->{MAKEFILE} $self->{BOOTDEP}".' $(INST_ARCHAUTODIR)\.exists
457 '.$self->{NOECHO}.'echo "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
458 '.$self->{NOECHO}.'$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \
459 -MExtUtils::Mkbootstrap \
460 -e "Mkbootstrap(\'$(BASEEXT)\',\'$(BSLOADLIBS)\');"
461 '.$self->{NOECHO}.'$(TOUCH) $(BOOTSTRAP)
464 $(INST_BOOT): $(BOOTSTRAP) $(INST_ARCHAUTODIR)\.exists
465 '."$self->{NOECHO}$self->{RM_RF}".' $(INST_BOOT)
466 -'.$self->{CP}.' $(BOOTSTRAP) $(INST_BOOT)
471 =item dynamic_lib (o)
473 Defines how to produce the *.so (or equivalent) files.
478 my($self, %attribs) = @_;
479 return '' unless $self->needs_linking(); #might be because of a subdir
481 return '' unless $self->has_link_code;
483 my($otherldflags) = $attribs{OTHERLDFLAGS} || ($BORLAND ? 'c0d32.obj': '');
484 my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
485 my($ldfrom) = '$(LDFROM)';
488 # one thing for GCC/Mingw32:
489 # we try to overcome non-relocateable-DLL problems by generating
490 # a (hopefully unique) image-base from the dll's name
493 my $dllname = $self->{BASEEXT} . "." . $self->{DLEXT};
494 $dllname =~ /(....)(.{0,4})/;
495 my $baseaddr = unpack("n", $1 ^ $2);
496 $otherldflags .= sprintf("-Wl,--image-base,0x%x0000 ", $baseaddr);
500 # This section creates the dynamically loadable $(INST_DYNAMIC)
501 # from $(OBJECT) and possibly $(MYEXTLIB).
502 OTHERLDFLAGS = '.$otherldflags.'
503 INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
505 $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)\.exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
509 q{ dlltool --def $(EXPORT_LIST) --output-exp dll.exp
510 $(LD) -o $@ -Wl,--base-file -Wl,dll.base $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) dll.exp
511 dlltool --def $(EXPORT_LIST) --base-file dll.base --output-exp dll.exp
512 $(LD) -o $@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) dll.exp });
515 q{ $(LD) $(LDDLFLAGS) $(OTHERLDFLAGS) }.$ldfrom.q{,$@,,}
516 .($DMAKE ? q{$(PERL_ARCHIVE:s,/,\,) $(LDLOADLIBS:s,/,\,) }
517 .q{$(MYEXTLIB:s,/,\,),$(EXPORT_LIST:s,/,\,)}
518 : q{$(subst /,\,$(PERL_ARCHIVE)) $(subst /,\,$(LDLOADLIBS)) }
519 .q{$(subst /,\,$(MYEXTLIB)),$(subst /,\,$(EXPORT_LIST))})
523 q{ $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) }
524 .q{$(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)});
530 push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
537 return '$(PERL_INC)\\'.$Config{'libperl'};
543 return "$self->{BASEEXT}.def";
548 No physical check on the filesystem, but a logical cleanup of a
549 path. On UNIX eliminated successive slashes and successive "/.".
554 my($self,$path) = @_;
555 $path =~ s/^([a-z]:)/\u$1/;
557 $path =~ s|(.)\\+|$1\\|g ; # xx////xx -> xx/xx
558 $path =~ s|(\\\.)+\\|\\|g ; # xx/././xx -> xx/xx
559 $path =~ s|^(\.\\)+|| unless $path eq ".\\"; # ./xx -> xx
561 unless $path =~ m#^([a-z]:)?\\#; # xx/ -> xx
562 $path .= '.' if $path =~ m#\\$#;
568 Takes one argument, a file name, and returns the file name, if the
569 argument is likely to be a perl script. On MM_Unix this is true for
570 any ordinary, readable file.
575 my($self,$file) = @_;
576 return $file if -r $file && -f _;
577 return "$file.pl" if -r "$file.pl" && -f _;
578 return "$file.bat" if -r "$file.bat" && -f _;
584 Defines target that copies all files in the hash PM to their
585 destination and autosplits them. See L<ExtUtils::Install/DESCRIPTION>
591 my($autodir) = $self->catdir('$(INST_LIB)','auto');
593 pm_to_blib: $(TO_INST_PM)
594 }.$self->{NOECHO}.q{$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
595 "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
597 ($NMAKE ? 'qw[ <<pmfiles.dat ],'
598 : $DMAKE ? 'qw[ $(mktmp,pmfiles.dat $(PM_TO_BLIB:s,\\,\\\\,)\n) ],'
599 : '{ qw[$(PM_TO_BLIB)] },'
600 ).q{'}.$autodir.q{')"
604 } : '') . $self->{NOECHO}.q{$(TOUCH) $@
608 =item test_via_harness (o)
610 Helper method to write the test targets
614 sub test_via_harness {
615 my($self, $perl, $tests) = @_;
616 "\t$perl".q! -Mblib -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e "use Test::Harness qw(&runtests $$verbose); $$verbose=$(TEST_VERBOSE); runtests @ARGV;" !."$tests\n";
620 =item tool_autosplit (override)
622 Use Win32 quoting on command line.
627 my($self, %attribs) = @_;
629 $asl = "\$AutoSplit::Maxlen=$attribs{MAXLEN};" if $attribs{MAXLEN};
631 # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
632 AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MAutoSplit }.$asl.q{ -e "autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1);"
636 =item tools_other (o)
640 Defines SHELL, LD, TOUCH, CP, MV, RM_F, RM_RF, CHMOD, UMASK_NULL in
641 the Makefile. Also defines the perl programs MKPATH,
642 WARN_IF_OLD_PACKLIST, MOD_INSTALL. DOC_INSTALL, and UNINSTALL.
649 my $bin_sh = $Config{sh} || 'cmd /c';
652 } unless $DMAKE; # dmake determines its own shell
654 for (qw/ CHMOD CP LD MV NOOP RM_F RM_RF TEST_F TOUCH UMASK_NULL DEV_NULL/ ) {
655 push @m, "$_ = $self->{$_}\n";
659 # The following is a portable way to say mkdir -p
660 # To see which directories are created, change the if 0 to if 1
661 MKPATH = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mkpath
663 # This helps us to minimize the effect of the .exists files A yet
664 # better solution would be to have a stable file in the perl
665 # distribution with a timestamp of zero. But this solution doesn't
666 # need any changes to the core distribution and works with older perls
667 EQUALIZE_TIMESTAMP = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e eqtime
671 return join "", @m if $self->{PARENT};
674 # Here we warn users that an old packlist file was found somewhere,
675 # and that they should call some uninstall routine
676 WARN_IF_OLD_PACKLIST = $(PERL) -lwe "exit unless -f $$ARGV[0];" \\
677 -e "print 'WARNING: I have found an old package in';" \\
678 -e "print ' ', $$ARGV[0], '.';" \\
679 -e "print 'Please make sure the two installations are not conflicting';"
684 MOD_INSTALL = $(PERL) -I$(INST_LIB) -I$(PERL_LIB) -MExtUtils::Install \
685 -e "install({ @ARGV },'$(VERBINST)',0,'$(UNINST)');"
687 DOC_INSTALL = $(PERL) -e "$$\=\"\n\n\";" \
688 -e "print '=head2 ', scalar(localtime), ': C<', shift, '>', ' L<', shift, '>';" \
689 -e "print '=over 4';" \
690 -e "while (defined($$key = shift) and defined($$val = shift)) { print '=item *';print 'C<', \"$$key: $$val\", '>'; }" \
693 UNINSTALL = $(PERL) -MExtUtils::Install \
694 -e "uninstall($$ARGV[0],1,1); print \"\nUninstall is deprecated. Please check the";" \
695 -e "print \" packlist above carefully.\n There may be errors. Remove the\";" \
696 -e "print \" appropriate files manually.\n Sorry for the inconveniences.\n\""
704 Defines suffix rules to go from XS to object files directly. This is
705 only intended for broken make implementations.
709 sub xs_o { # many makes are too dumb to use xs_c then c_o
714 =item top_targets (o)
716 Defines the targets all, subdirs, config, and O_FILES
721 # --- Target Sections ---
726 #all :: config $(INST_PM) subdirs linkext manifypods
730 all :: pure_all htmlifypods manifypods
731 '.$self->{NOECHO}.'$(NOOP)
733 unless $self->{SKIPHASH}{'all'};
736 pure_all :: config pm_to_blib subdirs linkext
737 '.$self->{NOECHO}.'$(NOOP)
739 subdirs :: $(MYEXTLIB)
740 '.$self->{NOECHO}.'$(NOOP)
742 config :: '.$self->{MAKEFILE}.' $(INST_LIBDIR)\.exists
743 '.$self->{NOECHO}.'$(NOOP)
745 config :: $(INST_ARCHAUTODIR)\.exists
746 '.$self->{NOECHO}.'$(NOOP)
748 config :: $(INST_AUTODIR)\.exists
749 '.$self->{NOECHO}.'$(NOOP)
752 push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
754 if (%{$self->{HTMLLIBPODS}}) {
756 config :: \$(INST_HTMLLIBDIR)/.exists
757 $self->{NOECHO}\$(NOOP)
760 push @m, $self->dir_target(qw[$(INST_HTMLLIBDIR)]);
763 if (%{$self->{HTMLSCRIPTPODS}}) {
765 config :: \$(INST_HTMLSCRIPTDIR)/.exists
766 $self->{NOECHO}\$(NOOP)
769 push @m, $self->dir_target(qw[$(INST_HTMLSCRIPTDIR)]);
772 if (%{$self->{MAN1PODS}}) {
774 config :: \$(INST_MAN1DIR)\\.exists
775 $self->{NOECHO}\$(NOOP)
778 push @m, $self->dir_target(qw[$(INST_MAN1DIR)]);
780 if (%{$self->{MAN3PODS}}) {
782 config :: \$(INST_MAN3DIR)\\.exists
783 $self->{NOECHO}\$(NOOP)
786 push @m, $self->dir_target(qw[$(INST_MAN3DIR)]);
790 $(O_FILES): $(H_FILES)
791 ' if @{$self->{O_FILES} || []} && @{$self->{H} || []};
795 perldoc ExtUtils::MakeMaker
800 }.$self->{NOECHO}.q{$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
801 -MExtUtils::MakeMaker=Version_check \
802 -e "Version_check('$(MM_VERSION)')"
808 =item htmlifypods (o)
810 Defines targets and routines to translate the pods into HTML manpages
811 and put them into the INST_HTMLLIBDIR and INST_HTMLSCRIPTDIR
814 Same as MM_Unix version (changes command-line quoting).
819 my($self, %attribs) = @_;
820 return "\nhtmlifypods : pure_all\n\t$self->{NOECHO}\$(NOOP)\n" unless
821 %{$self->{HTMLLIBPODS}} || %{$self->{HTMLSCRIPTPODS}};
824 if (defined $self->{PERL_SRC}) {
825 $pod2html_exe = $self->catfile($self->{PERL_SRC},'pod','pod2html');
827 $pod2html_exe = $self->catfile($Config{scriptdirexp},'pod2html');
829 unless ($pod2html_exe = $self->perl_script($pod2html_exe)) {
830 # No pod2html but some HTMLxxxPODS to be installed
833 Warning: I could not locate your pod2html program. Please make sure,
834 your pod2html program is in your PATH before you execute 'make'
837 $pod2html_exe = "-S pod2html";
841 qq[POD2HTML_EXE = $pod2html_exe\n],
842 qq[POD2HTML = \$(PERL) -we "use File::Basename; use File::Path qw(mkpath); %m=\@ARGV;for (keys %m){" \\\n],
843 q[-e "next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M '],
844 $self->{MAKEFILE}, q[';" \\
845 -e "print qq(Htmlifying $$m{$$_}\n);" \\
846 -e "$$dir = dirname($$m{$$_}); mkpath($$dir) unless -d $$dir;" \\
847 -e "system(qq[$$^X ].q["-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" $(POD2HTML_EXE) ].qq[$$_>$$m{$$_}])==0 or warn qq(Couldn\\047t install $$m{$$_}\n);" \\
848 -e "chmod(oct($(PERM_RW))), $$m{$$_} or warn qq(chmod $(PERM_RW) $$m{$$_}: $$!\n);}"
850 push @m, "\nhtmlifypods : pure_all ";
851 push @m, join " \\\n\t", keys %{$self->{HTMLLIBPODS}}, keys %{$self->{HTMLSCRIPTPODS}};
854 if (%{$self->{HTMLLIBPODS}} || %{$self->{HTMLSCRIPTPODS}}) {
855 push @m, "\t$self->{NOECHO}\$(POD2HTML) \\\n\t";
856 push @m, join " \\\n\t", %{$self->{HTMLLIBPODS}}, %{$self->{HTMLSCRIPTPODS}};
863 We don't want manpage process.
869 return "\nmanifypods :\n\t$self->{NOECHO}\$(NOOP)\n";
874 Same as MM_Unix version (changes command-line quoting).
883 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=maniread \\
884 -e "@all = keys %{ maniread() };" \\
885 -e "print(\"Executing $(CI) @all\n\"); system(\"$(CI) @all\");" \\
886 -e "print(\"Executing $(RCS_LABEL) ...\n\"); system(\"$(RCS_LABEL) @all\");"
893 Same as MM_Unix version (changes command-line quoting).
901 dist : $(DIST_DEFAULT)
902 }.$self->{NOECHO}.q{$(PERL) -le "print \"Warning: Makefile possibly out of date with $$vf\" if " \
903 -e "-e ($$vf=\"$(VERSION_FROM)\") and -M $$vf < -M \"}.$self->{MAKEFILE}.q{\";"
905 tardist : $(DISTVNAME).tar$(SUFFIX)
907 zipdist : $(DISTVNAME).zip
909 $(DISTVNAME).tar$(SUFFIX) : distdir
912 $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
913 $(RM_RF) $(DISTVNAME)
914 $(COMPRESS) $(DISTVNAME).tar
917 $(DISTVNAME).zip : distdir
919 $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
920 $(RM_RF) $(DISTVNAME)
923 uutardist : $(DISTVNAME).tar$(SUFFIX)
924 uuencode $(DISTVNAME).tar$(SUFFIX) \\
925 $(DISTVNAME).tar$(SUFFIX) > \\
926 $(DISTVNAME).tar$(SUFFIX)_uu
930 $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
931 $(RM_RF) $(DISTVNAME)
939 Defines the string that is passed to recursive make calls in
946 return "PASTHRU = " . ($NMAKE ? "-nologo" : "");