1 package ExtUtils::MM_NW5;
7 ExtUtils::MM_NW5 - methods to override UN*X behaviour in ExtUtils::MakeMaker
11 use ExtUtils::MM_NW5; # 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 Exporter::import('ExtUtils::MakeMaker',
29 qw( $Verbose &neatvalue));
31 $ENV{EMXSHELL} = 'sh'; # to run `commands`
32 unshift @MM::ISA, 'ExtUtils::MM_NW5';
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;
40 # a few workarounds for command.com (very basic)
42 package ExtUtils::MM_Win95;
44 # the $^O test may be overkill, but we want to be sure Win32::IsWin95()
45 # exists before we try it
47 unshift @MM::ISA, 'ExtUtils::MM_Win95'
48 if ($^O =~ /Win32/ && Win32::IsWin95());
52 return '' unless $self->needs_linking();
55 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\
56 $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c
62 return '' unless $self->needs_linking();
65 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\
66 $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.cpp
70 # many makes are too dumb to use xs_c then c_o
73 return '' unless $self->needs_linking();
76 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\
77 $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.c
78 $(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
81 } # end of command.com workarounds
84 my($self,%attribs) = @_;
86 my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {};
87 my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || [];
88 my($funclist) = $attribs{FUNCLIST} || $self->{FUNCLIST} || [];
89 my($imports) = $attribs{IMPORTS} || $self->{IMPORTS} || {};
91 (my $boot = $self->{NAME}) =~ s/:/_/g;
93 if (not $self->{SKIPHASH}{'dynamic'}) {
95 $self->{BASEEXT}.def: Makefile.PL
97 q! $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Mksymlists \\
98 -e "Mksymlists('NAME' => '!, $self->{NAME},
99 q!', 'DLBASE' => '!,$self->{DLBASE},
100 q!', 'DL_FUNCS' => !,neatvalue($funcs),
101 q!, 'FUNCLIST' => !,neatvalue($funclist),
102 q!, 'IMPORTS' => !,neatvalue($imports),
103 q!, 'DL_VARS' => !, neatvalue($vars), q!);"
109 sub replace_manpage_separator {
116 my($self,$file) = @_;
117 my @e = exists($ENV{'PATHEXT'})
118 ? split(/;/, $ENV{PATHEXT})
119 : qw(.com .exe .bat .cmd);
121 for (@e) { $e .= "\Q$_\E|" }
123 # see if file ends in one of the known extensions
124 if ($file =~ /($e)$/i) {
125 return $file if -e $file;
129 return "$file$_" if -e "$file$_";
135 sub file_name_is_absolute {
137 return File::Spec->file_name_is_absolute(@_);
141 my($self, $ver, $names, $dirs, $trace) = @_;
144 print "Looking for perl $ver by these names:
150 foreach $dir (@$dirs){
151 next unless defined $dir; # $self->{PERL_SRC} may be undefined
152 foreach $name (@$names){
154 if (File::Spec->file_name_is_absolute($name)) { # /foo/bar
156 } elsif (File::Spec->canonpath($name) eq File::Spec->canonpath(basename($name))) { # foo
157 $abs = File::Spec->catfile($dir, $name);
159 $abs = File::Spec->canonpath(File::Spec->catfile($self->curdir, $name));
161 print "Checking $abs\n" if ($trace >= 2);
162 next unless $self->maybe_command($abs);
163 print "Executing $abs\n" if ($trace >= 2);
164 $val = `$abs -e "require $ver;" 2>&1`;
166 print "Using PERL=$abs\n" if $trace;
168 } elsif ($trace >= 2) {
169 print "Result: `$val'\n";
173 print STDOUT "Unable to find a perl $ver (by these names: @$names, in these dirs: @$dirs)\n";
174 0; # false and not empty
179 return File::Spec->catdir(@_);
184 Concatenate one or more directory names and a filename to form a
185 complete path ending with a filename
191 return File::Spec->catfile(@_);
197 &ExtUtils::MM_Unix::init_others;
198 $self->{'TOUCH'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e touch';
199 $self->{'CHMOD'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e chmod';
200 $self->{'CP'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e cp';
201 $self->{'RM_F'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e rm_f';
202 $self->{'RM_RF'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e rm_rf';
203 $self->{'MV'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mv';
204 $self->{'NOOP'} = 'rem';
205 $self->{'TEST_F'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e test_f';
206 $self->{'LD'} = $Config{'ld'} || 'link';
207 $self->{'AR'} = $Config{'ar'} || 'lib';
208 $self->{'LDLOADLIBS'} ||= $Config{'libs'};
209 # -Lfoo must come first for Borland, so we put it in LDDLFLAGS
211 my $libs = $self->{'LDLOADLIBS'};
213 while ($libs =~ s/(?:^|\s)(("?)-L.+?\2)(?:\s|$)/ /) {
214 $libpath .= ' ' if length $libpath;
217 $self->{'LDLOADLIBS'} = $libs;
218 $self->{'LDDLFLAGS'} ||= $Config{'lddlflags'};
219 $self->{'LDDLFLAGS'} .= " $libpath";
221 $self->{'DEV_NULL'} = '> NUL';
222 # $self->{'NOECHO'} = ''; # till we have it working
224 # incpath is copied to makefile var INCLUDE in constants sub, here just make it empty
225 my $libpth = $Config{'libpth'};
227 $self->{'LIBPTH'} = $libpth;
228 $self->{'BASE_IMPORT'} = $Config{'base_import'};
230 # Additional import file specified from Makefile.pl
231 if($self->{'base_import'}) {
232 $self->{'BASE_IMPORT'} .= ',' . $self->{'base_import'};
235 $self->{'NLM_VERSION'} = $Config{'nlm_version'};
236 $self->{'MPKTOOL'} = $Config{'mpktool'};
237 $self->{'TOOLPATH'} = $Config{'toolpath'};
243 Initializes lots of constants and .SUFFIXES and .PHONY
248 my($self,$libperl)=@_;
249 return $self->{CONST_CCCMD} if $self->{CONST_CCCMD};
250 return '' unless $self->needs_linking();
251 return $self->{CONST_CCCMD} =
252 q{CCCMD = $(CC) $(INC) $(CCFLAGS) $(OPTIMIZE) \\
253 $(PERLTYPE) $(LARGE) $(SPLIT) $(MPOLLUTE) \\
254 -DVERSION="$(VERSION)" -DXS_VERSION="$(XS_VERSION)"};
261 # Added LIBPTH, BASE_IMPORT, ABSTRACT, NLM_VERSION BOOT_SYMBOL, NLM_SHORT_NAME
266 AR_STATIC_ARGS NAME DISTNAME NAME_SYM VERSION
267 VERSION_SYM XS_VERSION INST_BIN INST_EXE INST_LIB
268 INST_ARCHLIB INST_SCRIPT PREFIX INSTALLDIRS
269 INSTALLPRIVLIB INSTALLARCHLIB INSTALLSITELIB
270 INSTALLSITEARCH INSTALLBIN INSTALLSCRIPT PERL_LIB
271 PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
272 FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC
273 PERL_INC PERL FULLPERL LIBPTH BASE_IMPORT PERLRUN
274 PERLRUNINST TEST_LIBS FULL_AR PERL_CORE
275 NLM_VERSION MPKTOOL TOOLPATH
278 next unless defined $self->{$tmp};
279 push @m, "$tmp = $self->{$tmp}\n";
282 (my $boot = $self->{'NAME'}) =~ s/:/_/g;
283 $self->{'BOOT_SYMBOL'}=$boot;
284 push @m, "BOOT_SYMBOL = $self->{'BOOT_SYMBOL'}\n";
286 # If the final binary name is greater than 8 chars,
287 # truncate it here and rename it after creation
288 # otherwise, Watcom Linker fails
289 if(length($self->{'BASEEXT'}) > 8) {
290 $self->{'NLM_SHORT_NAME'} = substr($self->{'NAME'},0,8);
291 push @m, "NLM_SHORT_NAME = $self->{'NLM_SHORT_NAME'}\n";
295 VERSION_MACRO = VERSION
296 DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\"
297 XS_VERSION_MACRO = XS_VERSION
298 XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\"
301 # Get the include path and replace the spaces with ;
302 # Copy this to makefile as INCLUDE = d:\...;d:\;
303 (my $inc = $Config{'incpath'}) =~ s/ /;/g;
305 # Get the additional include path and append to INCLUDE, keep it in
306 # INC will give problems during compilation, hence reset it after getting
308 (my $add_inc = $self->{'INC'}) =~ s/ -I/;/g;
311 INCLUDE = $inc;$add_inc;
314 # Set the path to Watcom binaries which might not have been set in
317 PATH = \$(PATH);\$(TOOLPATH)
321 MAKEMAKER = $INC{'ExtUtils\MakeMaker.pm'}
322 MM_VERSION = $ExtUtils::MakeMaker::VERSION
326 # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
327 # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
328 # ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD) !!! Deprecated from MM 5.32 !!!
329 # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
330 # DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
334 FULLEXT BASEEXT PARENT_NAME DLBASE VERSION_FROM INC DEFINE OBJECT
337 next unless defined $self->{$tmp};
338 push @m, "$tmp = $self->{$tmp}\n";
342 # Handy lists of source code files:
343 XS_FILES= ".join(" \\\n\t", sort keys %{$self->{XS}})."
344 C_FILES = ".join(" \\\n\t", @{$self->{C}})."
345 O_FILES = ".join(" \\\n\t", @{$self->{O_FILES}})."
346 H_FILES = ".join(" \\\n\t", @{$self->{H}})."
347 HTMLLIBPODS = ".join(" \\\n\t", sort keys %{$self->{HTMLLIBPODS}})."
348 HTMLSCRIPTPODS = ".join(" \\\n\t", sort keys %{$self->{HTMLSCRIPTPODS}})."
349 MAN1PODS = ".join(" \\\n\t", sort keys %{$self->{MAN1PODS}})."
350 MAN3PODS = ".join(" \\\n\t", sort keys %{$self->{MAN3PODS}})."
354 INST_HTMLPRIVLIBDIR INSTALLHTMLPRIVLIBDIR
355 INST_HTMLSITELIBDIR INSTALLHTMLSITELIBDIR
356 INST_HTMLSCRIPTDIR INSTALLHTMLSCRIPTDIR
357 INST_HTMLLIBDIR HTMLEXT
358 INST_MAN1DIR INSTALLMAN1DIR MAN1EXT
359 INST_MAN3DIR INSTALLMAN3DIR MAN3EXT
361 next unless defined $self->{$tmp};
362 push @m, "$tmp = $self->{$tmp}\n";
370 .NO_CONFIG_REC: Makefile
371 } if $ENV{CLEARCASE_ROOT};
373 # why not q{} ? -- emacs
375 # work around a famous dec-osf make(1) feature(?):
378 .SUFFIXES: .xs .c .C .cpp .cxx .cc \$(OBJ_EXT)
380 # Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
381 # some make implementations will delete the Makefile when we rebuild it. Because
382 # we call false(1) when we rebuild it. So make(1) is not completely wrong when it
383 # does so. Our milage may vary.
384 # .PRECIOUS: Makefile # seems to be not necessary anymore
386 .PHONY: all config static dynamic test linkext manifest
388 # Where is the Config information that we are using/depend on
389 CONFIGDEP = \$(PERL_ARCHLIB)\\Config.pm \$(PERL_INC)\\config.h
392 my @parentdir = split(/::/, $self->{PARENT_NAME});
394 # Where to put things:
395 INST_LIBDIR = }. File::Spec->catdir('$(INST_LIB)',@parentdir) .q{
396 INST_ARCHLIBDIR = }. File::Spec->catdir('$(INST_ARCHLIB)',@parentdir) .q{
398 INST_AUTODIR = }. File::Spec->catdir('$(INST_LIB)','auto','$(FULLEXT)') .q{
399 INST_ARCHAUTODIR = }. File::Spec->catdir('$(INST_ARCHLIB)','auto','$(FULLEXT)') .q{
402 if ($self->has_link_code()) {
404 INST_STATIC = $(INST_ARCHAUTODIR)\$(BASEEXT)$(LIB_EXT)
405 INST_DYNAMIC = $(INST_ARCHAUTODIR)\$(DLBASE).$(DLEXT)
406 INST_BOOT = $(INST_ARCHAUTODIR)\$(BASEEXT).bs
416 $tmp = $self->export_list;
420 $tmp = $self->perl_archive;
426 #INST_PM = }.join(" \\\n\t", sort values %{$self->{PM}}).q{
428 #PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
432 TO_INST_PM = }.join(" \\\n\t", sort keys %{$self->{PM}}).q{
434 PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
442 return File::Spec->path();
447 Defines how to produce the *.a (or equivalent) files.
453 # Come to think of it, if there are subdirs with linkcode, we still have no INST_STATIC
454 # return '' unless $self->needs_linking(); #might be because of a subdir
456 return '' unless $self->has_link_code;
460 $(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)\.exists
464 # If this extension has its own library (eg SDBM_File)
465 # then copy that to $(INST_STATIC) and add $(OBJECT) into it.
466 push(@m, "\t$self->{CP} \$(MYEXTLIB) \$\@\n") if $self->{MYEXTLIB};
469 q{ $(AR) }.($BORLAND ? '$@ $(OBJECT:^"+")'
470 : ($GCC ? '-ru $@ $(OBJECT)'
471 : '-out:$@ $(OBJECT)')).q{
472 }.$self->{NOECHO}.q{echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)\extralibs.ld
476 # Old mechanism - still available:
478 push @m, "\t$self->{NOECHO}".q{echo "$(EXTRALIBS)" >> $(PERL_SRC)\ext.libs}."\n\n"
479 if $self->{PERL_SRC};
481 push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
487 Defines targets for bootstrap files.
492 my($self, %attribs) = @_;
495 ' unless $self->has_link_code();
498 BOOTSTRAP = '."$self->{BASEEXT}.bs".'
500 # As Mkbootstrap might not write a file (if none is required)
501 # we use touch to prevent make continually trying to remake it.
502 # The DynaLoader only reads a non-empty file.
503 $(BOOTSTRAP): '."$self->{MAKEFILE} $self->{BOOTDEP}".' $(INST_ARCHAUTODIR)\.exists
504 '.$self->{NOECHO}.'echo "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
505 '.$self->{NOECHO}.'$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \
506 -MExtUtils::Mkbootstrap \
507 -e "Mkbootstrap(\'$(BASEEXT)\',\'$(BSLOADLIBS)\');"
508 '.$self->{NOECHO}.'$(TOUCH) $(BOOTSTRAP)
511 $(INST_BOOT): $(BOOTSTRAP) $(INST_ARCHAUTODIR)\.exists
512 '."$self->{NOECHO}$self->{RM_RF}".' $(INST_BOOT)
513 -'.$self->{CP}.' $(BOOTSTRAP) $(INST_BOOT)
518 =item dynamic_lib (o)
520 Defines how to produce the *.so (or equivalent) files.
525 my($self, %attribs) = @_;
526 return '' unless $self->needs_linking(); #might be because of a subdir
528 return '' unless $self->has_link_code;
530 my($otherldflags) = $attribs{OTHERLDFLAGS} || ($BORLAND ? 'c0d32.obj': '');
531 my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
532 my($ldfrom) = '$(LDFROM)';
534 (my $boot = $self->{NAME}) =~ s/:/_/g;
537 # This section creates the dynamically loadable $(INST_DYNAMIC)
538 # from $(OBJECT) and possibly $(MYEXTLIB).
539 OTHERLDFLAGS = '.$otherldflags.'
540 INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
542 $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP)
545 # q{ $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) }
546 # .q{$(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)});
548 # Create xdc data for an MT safe NLM in case of mpk build
549 if ( $self->{CCFLAGS} =~ m/ -DMPK_ON /) {
551 push @m, ' $(MPKTOOL) $(BASEEXT).xdc
558 q{ $(LD) Form Novell NLM '$(DISTNAME) Extension, XS_VERSION=$(XS_VERSION)'}
561 # Taking care of long names like FileHandle, ByteLoader, SDBM_File etc
562 if($self->{NLM_SHORT_NAME}) {
563 # In case of nlms with names exceeding 8 chars, build nlm in the
564 # current dir, rename and move to auto\lib. If we create in auto\lib
565 # in the first place, we can't rename afterwards.
567 q{ Name $(NLM_SHORT_NAME).$(DLEXT)}
571 q{ Name $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT)}
576 q{ Option Quiet Option Version = $(NLM_VERSION) Option Caseexact Option NoDefaultLibs Option screenname 'none' Option Synchronize }
581 q{ Option XDCDATA=$(BASEEXT).xdc }
585 # Add additional lib files if any (SDBM_File)
586 if($self->{MYEXTLIB}) {
588 q{ Library $(MYEXTLIB) }
592 #For now lets comment all the Watcom lib calls
593 #q{ LibPath $(LIBPTH) Library plib3s.lib Library math3s.lib Library clib3s.lib Library emu387.lib Library $(PERL_ARCHIVE) Library $(PERL_INC)\Main.lib}
596 q{ Library $(PERL_ARCHIVE) Library $(PERL_INC)\Main.lib}
597 .q{ Export boot_$(BOOT_SYMBOL) $(BASE_IMPORT) }
598 .q{ FILE $(OBJECT:.obj=,)}
601 # If it is having a short name, rename it
602 if($self->{NLM_SHORT_NAME}) {
604 if exist $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT) del $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT)';
606 rename $(NLM_SHORT_NAME).$(DLEXT) $(BASEEXT).$(DLEXT)';
608 move $(BASEEXT).$(DLEXT) $(INST_AUTODIR)';
615 push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
622 return '$(PERL_INC)\\'.$Config{'libperl'};
628 return "$self->{BASEEXT}.def";
633 No physical check on the filesystem, but a logical cleanup of a
634 path. On UNIX eliminated successive slashes and successive "/.".
639 my($self,$path) = @_;
640 $path =~ s/^([a-z]:)/\u$1/;
642 $path =~ s|(.)\\+|$1\\|g ; # xx////xx -> xx/xx
643 $path =~ s|(\\\.)+\\|\\|g ; # xx/././xx -> xx/xx
644 $path =~ s|^(\.\\)+|| unless $path eq ".\\"; # ./xx -> xx
646 unless $path =~ m#^([a-z]:)?\\#; # xx/ -> xx
647 $path .= '.' if $path =~ m#\\$#;
653 Takes one argument, a file name, and returns the file name, if the
654 argument is likely to be a perl script. On MM_Unix this is true for
655 any ordinary, readable file.
660 my($self,$file) = @_;
661 return $file if -r $file && -f _;
662 return "$file.pl" if -r "$file.pl" && -f _;
663 return "$file.bat" if -r "$file.bat" && -f _;
669 Defines target that copies all files in the hash PM to their
670 destination and autosplits them. See L<ExtUtils::Install/DESCRIPTION>
676 my($autodir) = File::Spec->catdir('$(INST_LIB)','auto');
678 pm_to_blib: $(TO_INST_PM)
679 }.$self->{NOECHO}.q{$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
680 "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
682 ($NMAKE ? 'qw[ <<pmfiles.dat ],'
683 : $DMAKE ? 'qw[ $(mktmp,pmfiles.dat $(PM_TO_BLIB:s,\\,\\\\,)\n) ],'
684 : '{ qw[$(PM_TO_BLIB)] },'
685 ).q{'}.$autodir.q{')"
689 } : '') . $self->{NOECHO}.q{$(TOUCH) $@
693 =item test_via_harness (o)
695 Helper method to write the test targets
699 sub test_via_harness {
700 my($self, $perl, $tests) = @_;
701 "\t$perl".q! -Mblib -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e "use Test::Harness qw(&runtests $$verbose); $$verbose=$(TEST_VERBOSE); runtests @ARGV;" !."$tests\n";
705 =item tool_autosplit (override)
707 Use Win32 quoting on command line.
712 my($self, %attribs) = @_;
714 $asl = "\$AutoSplit::Maxlen=$attribs{MAXLEN};" if $attribs{MAXLEN};
716 # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
717 AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MAutoSplit }.$asl.q{ -e "autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1);"
721 =item tools_other (o)
725 Defines SHELL, LD, TOUCH, CP, MV, RM_F, RM_RF, CHMOD, UMASK_NULL in
726 the Makefile. Also defines the perl programs MKPATH,
727 WARN_IF_OLD_PACKLIST, MOD_INSTALL. DOC_INSTALL, and UNINSTALL.
734 my $bin_sh = $Config{sh} || 'cmd /c';
737 } unless $DMAKE; # dmake determines its own shell
739 for (qw/ CHMOD CP LD MV NOOP RM_F RM_RF TEST_F TOUCH UMASK_NULL DEV_NULL/ ) {
740 push @m, "$_ = $self->{$_}\n";
744 # The following is a portable way to say mkdir -p
745 # To see which directories are created, change the if 0 to if 1
746 MKPATH = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mkpath
748 # This helps us to minimize the effect of the .exists files A yet
749 # better solution would be to have a stable file in the perl
750 # distribution with a timestamp of zero. But this solution doesn't
751 # need any changes to the core distribution and works with older perls
752 EQUALIZE_TIMESTAMP = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e eqtime
756 return join "", @m if $self->{PARENT};
759 # Here we warn users that an old packlist file was found somewhere,
760 # and that they should call some uninstall routine
761 WARN_IF_OLD_PACKLIST = $(PERL) -lwe "exit unless -f $$ARGV[0];" \\
762 -e "print 'WARNING: I have found an old package in';" \\
763 -e "print ' ', $$ARGV[0], '.';" \\
764 -e "print 'Please make sure the two installations are not conflicting';"
769 MOD_INSTALL = $(PERL) -I$(INST_LIB) -I$(PERL_LIB) -MExtUtils::Install \
770 -e "install({ @ARGV },'$(VERBINST)',0,'$(UNINST)');"
772 DOC_INSTALL = $(PERL) -e "$$\=\"\n\n\";" \
773 -e "print '=head2 ', scalar(localtime), ': C<', shift, '>', ' L<', shift, '>';" \
774 -e "print '=over 4';" \
775 -e "while (defined($$key = shift) and defined($$val = shift)) { print '=item *';print 'C<', \"$$key: $$val\", '>'; }" \
778 UNINSTALL = $(PERL) -MExtUtils::Install \
779 -e "uninstall($$ARGV[0],1,1); print \"\nUninstall is deprecated. Please check the";" \
780 -e "print \" packlist above carefully.\n There may be errors. Remove the\";" \
781 -e "print \" appropriate files manually.\n Sorry for the inconveniences.\n\""
789 Defines suffix rules to go from XS to object files directly. This is
790 only intended for broken make implementations.
794 sub xs_o { # many makes are too dumb to use xs_c then c_o
799 =item top_targets (o)
801 Defines the targets all, subdirs, config, and O_FILES
806 # --- Target Sections ---
811 #all :: config $(INST_PM) subdirs linkext manifypods
815 all :: pure_all htmlifypods manifypods
816 '.$self->{NOECHO}.'$(NOOP)
818 unless $self->{SKIPHASH}{'all'};
821 pure_all :: config pm_to_blib subdirs linkext
822 '.$self->{NOECHO}.'$(NOOP)
824 subdirs :: $(MYEXTLIB)
825 '.$self->{NOECHO}.'$(NOOP)
827 config :: '.$self->{MAKEFILE}.' $(INST_LIBDIR)\.exists
828 '.$self->{NOECHO}.'$(NOOP)
830 config :: $(INST_ARCHAUTODIR)\.exists
831 '.$self->{NOECHO}.'$(NOOP)
833 config :: $(INST_AUTODIR)\.exists
834 '.$self->{NOECHO}.'$(NOOP)
837 push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
839 if (%{$self->{HTMLLIBPODS}}) {
841 config :: \$(INST_HTMLLIBDIR)/.exists
842 $self->{NOECHO}\$(NOOP)
845 push @m, $self->dir_target(qw[$(INST_HTMLLIBDIR)]);
848 if (%{$self->{HTMLSCRIPTPODS}}) {
850 config :: \$(INST_HTMLSCRIPTDIR)/.exists
851 $self->{NOECHO}\$(NOOP)
854 push @m, $self->dir_target(qw[$(INST_HTMLSCRIPTDIR)]);
857 if (%{$self->{MAN1PODS}}) {
859 config :: \$(INST_MAN1DIR)\\.exists
860 $self->{NOECHO}\$(NOOP)
863 push @m, $self->dir_target(qw[$(INST_MAN1DIR)]);
865 if (%{$self->{MAN3PODS}}) {
867 config :: \$(INST_MAN3DIR)\\.exists
868 $self->{NOECHO}\$(NOOP)
871 push @m, $self->dir_target(qw[$(INST_MAN3DIR)]);
875 $(O_FILES): $(H_FILES)
876 ' if @{$self->{O_FILES} || []} && @{$self->{H} || []};
880 perldoc ExtUtils::MakeMaker
885 }.$self->{NOECHO}.q{$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
886 -MExtUtils::MakeMaker=Version_check \
887 -e "Version_check('$(MM_VERSION)')"
893 =item htmlifypods (o)
895 Defines targets and routines to translate the pods into HTML manpages
896 and put them into the INST_HTMLLIBDIR and INST_HTMLSCRIPTDIR
899 Same as MM_Unix version (changes command-line quoting).
904 my($self, %attribs) = @_;
905 return "\nhtmlifypods : pure_all\n\t$self->{NOECHO}\$(NOOP)\n" unless
906 %{$self->{HTMLLIBPODS}} || %{$self->{HTMLSCRIPTPODS}};
909 if (defined $self->{PERL_SRC}) {
910 $pod2html_exe = File::Spec->catfile($self->{PERL_SRC},'pod','pod2html');
912 $pod2html_exe = File::Spec->catfile($Config{scriptdirexp},'pod2html');
914 unless ($pod2html_exe = $self->perl_script($pod2html_exe)) {
915 # No pod2html but some HTMLxxxPODS to be installed
918 Warning: I could not locate your pod2html program. Please make sure,
919 your pod2html program is in your PATH before you execute 'make'
922 $pod2html_exe = "-S pod2html";
926 qq[POD2HTML_EXE = $pod2html_exe\n],
927 qq[POD2HTML = \$(PERL) -we "use File::Basename; use File::Path qw(mkpath); %m=\@ARGV;for (keys %m){" \\\n],
928 q[-e "next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M '],
929 $self->{MAKEFILE}, q[';" \\
930 -e "print qq(Htmlifying $$m{$$_}\n);" \\
931 -e "$$dir = dirname($$m{$$_}); mkpath($$dir) unless -d $$dir;" \\
932 -e "system(qq[$$^X ].q["-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" $(POD2HTML_EXE) ].qq[$$_>$$m{$$_}])==0 or warn qq(Couldn\\047t install $$m{$$_}\n);" \\
933 -e "chmod(oct($(PERM_RW))), $$m{$$_} or warn qq(chmod $(PERM_RW) $$m{$$_}: $$!\n);}"
935 push @m, "\nhtmlifypods : pure_all ";
936 push @m, join " \\\n\t", keys %{$self->{HTMLLIBPODS}}, keys %{$self->{HTMLSCRIPTPODS}};
939 if (%{$self->{HTMLLIBPODS}} || %{$self->{HTMLSCRIPTPODS}}) {
940 push @m, "\t$self->{NOECHO}\$(POD2HTML) \\\n\t";
941 push @m, join " \\\n\t", %{$self->{HTMLLIBPODS}}, %{$self->{HTMLSCRIPTPODS}};
948 We don't want manpage process.
954 return "\nmanifypods :\n\t$self->{NOECHO}\$(NOOP)\n";
959 Same as MM_Unix version (changes command-line quoting).
968 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=maniread \\
969 -e "@all = keys %{ maniread() };" \\
970 -e "print(\"Executing $(CI) @all\n\"); system(\"$(CI) @all\");" \\
971 -e "print(\"Executing $(RCS_LABEL) ...\n\"); system(\"$(RCS_LABEL) @all\");"
978 Same as MM_Unix version (changes command-line quoting).
986 dist : $(DIST_DEFAULT)
987 }.$self->{NOECHO}.q{$(PERL) -le "print \"Warning: Makefile possibly out of date with $$vf\" if " \
988 -e "-e ($$vf=\"$(VERSION_FROM)\") and -M $$vf < -M \"}.$self->{MAKEFILE}.q{\";"
990 tardist : $(DISTVNAME).tar$(SUFFIX)
992 zipdist : $(DISTVNAME).zip
994 $(DISTVNAME).tar$(SUFFIX) : distdir
997 $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
998 $(RM_RF) $(DISTVNAME)
999 $(COMPRESS) $(DISTVNAME).tar
1002 $(DISTVNAME).zip : distdir
1004 $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
1005 $(RM_RF) $(DISTVNAME)
1008 uutardist : $(DISTVNAME).tar$(SUFFIX)
1009 uuencode $(DISTVNAME).tar$(SUFFIX) \\
1010 $(DISTVNAME).tar$(SUFFIX) > \\
1011 $(DISTVNAME).tar$(SUFFIX)_uu
1015 $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
1016 $(RM_RF) $(DISTVNAME)
1024 Defines the string that is passed to recursive make calls in
1031 return "PASTHRU = " . ($NMAKE ? "-nologo" : "");