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 use ExtUtils::MakeMaker;
29 Exporter::import('ExtUtils::MakeMaker',
30 qw( $Verbose &neatvalue));
32 $ENV{EMXSHELL} = 'sh'; # to run `commands`
33 unshift @MM::ISA, 'ExtUtils::MM_NW5';
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 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 {
138 return File::Spec->file_name_is_absolute(@_);
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 (File::Spec->file_name_is_absolute($name)) { # /foo/bar
157 } elsif (File::Spec->canonpath($name) eq File::Spec->canonpath(basename($name))) { # foo
158 $abs = File::Spec->catfile($dir, $name);
160 $abs = File::Spec->canonpath(File::Spec->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
180 return File::Spec->catdir(@_);
185 Concatenate one or more directory names and a filename to form a
186 complete path ending with a filename
192 return File::Spec->catfile(@_);
198 &ExtUtils::MM_Unix::init_others;
199 $self->{'TOUCH'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e touch';
200 $self->{'CHMOD'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e chmod';
201 $self->{'CP'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e cp';
202 $self->{'RM_F'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e rm_f';
203 $self->{'RM_RF'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e rm_rf';
204 $self->{'MV'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mv';
205 $self->{'NOOP'} = 'rem';
206 $self->{'TEST_F'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e test_f';
207 $self->{'LD'} = $Config{'ld'} || 'link';
208 $self->{'AR'} = $Config{'ar'} || 'lib';
209 $self->{'LDLOADLIBS'} ||= $Config{'libs'};
210 # -Lfoo must come first for Borland, so we put it in LDDLFLAGS
212 my $libs = $self->{'LDLOADLIBS'};
214 while ($libs =~ s/(?:^|\s)(("?)-L.+?\2)(?:\s|$)/ /) {
215 $libpath .= ' ' if length $libpath;
218 $self->{'LDLOADLIBS'} = $libs;
219 $self->{'LDDLFLAGS'} ||= $Config{'lddlflags'};
220 $self->{'LDDLFLAGS'} .= " $libpath";
222 $self->{'DEV_NULL'} = '> NUL';
223 # $self->{'NOECHO'} = ''; # till we have it working
225 # incpath is copied to makefile var INCLUDE in constants sub, here just make it empty
226 my $libpth = $Config{'libpth'};
228 $self->{'LIBPTH'} = $libpth;
229 $self->{'BASE_IMPORT'} = $Config{'base_import'};
231 # Additional import file specified from Makefile.pl
232 if($self->{'base_import'}) {
233 $self->{'BASE_IMPORT'} .= ',' . $self->{'base_import'};
236 $self->{'NLM_VERSION'} = $Config{'nlm_version'};
237 $self->{'MPKTOOL'} = $Config{'mpktool'};
238 $self->{'TOOLPATH'} = $Config{'toolpath'};
244 Initializes lots of constants and .SUFFIXES and .PHONY
249 my($self,$libperl)=@_;
250 return $self->{CONST_CCCMD} if $self->{CONST_CCCMD};
251 return '' unless $self->needs_linking();
252 return $self->{CONST_CCCMD} =
253 q{CCCMD = $(CC) $(INC) $(CCFLAGS) $(OPTIMIZE) \\
254 $(PERLTYPE) $(LARGE) $(SPLIT) $(MPOLLUTE) \\
255 -DVERSION="$(VERSION)" -DXS_VERSION="$(XS_VERSION)"};
262 # Added LIBPTH, BASE_IMPORT, ABSTRACT, NLM_VERSION BOOT_SYMBOL, NLM_SHORT_NAME
267 AR_STATIC_ARGS NAME DISTNAME NAME_SYM VERSION
268 VERSION_SYM XS_VERSION INST_BIN INST_EXE INST_LIB
269 INST_ARCHLIB INST_SCRIPT PREFIX INSTALLDIRS
270 INSTALLPRIVLIB INSTALLARCHLIB INSTALLSITELIB
271 INSTALLSITEARCH INSTALLBIN INSTALLSCRIPT PERL_LIB
272 PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
273 FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC
274 PERL_INC PERL FULLPERL LIBPTH BASE_IMPORT PERLRUN
275 PERLRUNINST TEST_LIBS FULL_AR PERL_CORE
276 NLM_VERSION MPKTOOL TOOLPATH
279 next unless defined $self->{$tmp};
280 push @m, "$tmp = $self->{$tmp}\n";
283 (my $boot = $self->{'NAME'}) =~ s/:/_/g;
284 $self->{'BOOT_SYMBOL'}=$boot;
285 push @m, "BOOT_SYMBOL = $self->{'BOOT_SYMBOL'}\n";
287 # If the final binary name is greater than 8 chars,
288 # truncate it here and rename it after creation
289 # otherwise, Watcom Linker fails
290 if(length($self->{'BASEEXT'}) > 8) {
291 $self->{'NLM_SHORT_NAME'} = substr($self->{'NAME'},0,8);
292 push @m, "NLM_SHORT_NAME = $self->{'NLM_SHORT_NAME'}\n";
296 VERSION_MACRO = VERSION
297 DEFINE_VERSION = -D\$(VERSION_MACRO)=\\\"\$(VERSION)\\\"
298 XS_VERSION_MACRO = XS_VERSION
299 XS_DEFINE_VERSION = -D\$(XS_VERSION_MACRO)=\\\"\$(XS_VERSION)\\\"
302 # Get the include path and replace the spaces with ;
303 # Copy this to makefile as INCLUDE = d:\...;d:\;
304 (my $inc = $Config{'incpath'}) =~ s/ /;/g;
306 # Get the additional include path and append to INCLUDE, keep it in
307 # INC will give problems during compilation, hence reset it after getting
309 (my $add_inc = $self->{'INC'}) =~ s/ -I/;/g;
312 INCLUDE = $inc;$add_inc;
315 # Set the path to Watcom binaries which might not have been set in
318 PATH = \$(PATH);\$(TOOLPATH)
322 MAKEMAKER = $INC{'ExtUtils\MakeMaker.pm'}
323 MM_VERSION = $ExtUtils::MakeMaker::VERSION
327 # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
328 # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
329 # ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD) !!! Deprecated from MM 5.32 !!!
330 # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
331 # DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
335 FULLEXT BASEEXT PARENT_NAME DLBASE VERSION_FROM INC DEFINE OBJECT
338 next unless defined $self->{$tmp};
339 push @m, "$tmp = $self->{$tmp}\n";
343 # Handy lists of source code files:
344 XS_FILES= ".join(" \\\n\t", sort keys %{$self->{XS}})."
345 C_FILES = ".join(" \\\n\t", @{$self->{C}})."
346 O_FILES = ".join(" \\\n\t", @{$self->{O_FILES}})."
347 H_FILES = ".join(" \\\n\t", @{$self->{H}})."
348 HTMLLIBPODS = ".join(" \\\n\t", sort keys %{$self->{HTMLLIBPODS}})."
349 HTMLSCRIPTPODS = ".join(" \\\n\t", sort keys %{$self->{HTMLSCRIPTPODS}})."
350 MAN1PODS = ".join(" \\\n\t", sort keys %{$self->{MAN1PODS}})."
351 MAN3PODS = ".join(" \\\n\t", sort keys %{$self->{MAN3PODS}})."
355 INST_HTMLPRIVLIBDIR INSTALLHTMLPRIVLIBDIR
356 INST_HTMLSITELIBDIR INSTALLHTMLSITELIBDIR
357 INST_HTMLSCRIPTDIR INSTALLHTMLSCRIPTDIR
358 INST_HTMLLIBDIR HTMLEXT
359 INST_MAN1DIR INSTALLMAN1DIR MAN1EXT
360 INST_MAN3DIR INSTALLMAN3DIR MAN3EXT
362 next unless defined $self->{$tmp};
363 push @m, "$tmp = $self->{$tmp}\n";
371 .NO_CONFIG_REC: Makefile
372 } if $ENV{CLEARCASE_ROOT};
374 # why not q{} ? -- emacs
376 # work around a famous dec-osf make(1) feature(?):
379 .SUFFIXES: .xs .c .C .cpp .cxx .cc \$(OBJ_EXT)
381 # Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
382 # some make implementations will delete the Makefile when we rebuild it. Because
383 # we call false(1) when we rebuild it. So make(1) is not completely wrong when it
384 # does so. Our milage may vary.
385 # .PRECIOUS: Makefile # seems to be not necessary anymore
387 .PHONY: all config static dynamic test linkext manifest
389 # Where is the Config information that we are using/depend on
390 CONFIGDEP = \$(PERL_ARCHLIB)\\Config.pm \$(PERL_INC)\\config.h
393 my @parentdir = split(/::/, $self->{PARENT_NAME});
395 # Where to put things:
396 INST_LIBDIR = }. File::Spec->catdir('$(INST_LIB)',@parentdir) .q{
397 INST_ARCHLIBDIR = }. File::Spec->catdir('$(INST_ARCHLIB)',@parentdir) .q{
399 INST_AUTODIR = }. File::Spec->catdir('$(INST_LIB)','auto','$(FULLEXT)') .q{
400 INST_ARCHAUTODIR = }. File::Spec->catdir('$(INST_ARCHLIB)','auto','$(FULLEXT)') .q{
403 if ($self->has_link_code()) {
405 INST_STATIC = $(INST_ARCHAUTODIR)\$(BASEEXT)$(LIB_EXT)
406 INST_DYNAMIC = $(INST_ARCHAUTODIR)\$(DLBASE).$(DLEXT)
407 INST_BOOT = $(INST_ARCHAUTODIR)\$(BASEEXT).bs
417 $tmp = $self->export_list;
421 $tmp = $self->perl_archive;
427 #INST_PM = }.join(" \\\n\t", sort values %{$self->{PM}}).q{
429 #PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
433 TO_INST_PM = }.join(" \\\n\t", sort keys %{$self->{PM}}).q{
435 PM_TO_BLIB = }.join(" \\\n\t", %{$self->{PM}}).q{
443 return File::Spec->path();
448 Defines how to produce the *.a (or equivalent) files.
454 # Come to think of it, if there are subdirs with linkcode, we still have no INST_STATIC
455 # return '' unless $self->needs_linking(); #might be because of a subdir
457 return '' unless $self->has_link_code;
461 $(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)\.exists
465 # If this extension has its own library (eg SDBM_File)
466 # then copy that to $(INST_STATIC) and add $(OBJECT) into it.
467 push(@m, "\t$self->{CP} \$(MYEXTLIB) \$\@\n") if $self->{MYEXTLIB};
470 q{ $(AR) }.($BORLAND ? '$@ $(OBJECT:^"+")'
471 : ($GCC ? '-ru $@ $(OBJECT)'
472 : '-out:$@ $(OBJECT)')).q{
473 }.$self->{NOECHO}.q{echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)\extralibs.ld
477 # Old mechanism - still available:
479 push @m, "\t$self->{NOECHO}".q{echo "$(EXTRALIBS)" >> $(PERL_SRC)\ext.libs}."\n\n"
480 if $self->{PERL_SRC};
482 push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
488 Defines targets for bootstrap files.
493 my($self, %attribs) = @_;
496 ' unless $self->has_link_code();
499 BOOTSTRAP = '."$self->{BASEEXT}.bs".'
501 # As Mkbootstrap might not write a file (if none is required)
502 # we use touch to prevent make continually trying to remake it.
503 # The DynaLoader only reads a non-empty file.
504 $(BOOTSTRAP): '."$self->{MAKEFILE} $self->{BOOTDEP}".' $(INST_ARCHAUTODIR)\.exists
505 '.$self->{NOECHO}.'echo "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
506 '.$self->{NOECHO}.'$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \
507 -MExtUtils::Mkbootstrap \
508 -e "Mkbootstrap(\'$(BASEEXT)\',\'$(BSLOADLIBS)\');"
509 '.$self->{NOECHO}.'$(TOUCH) $(BOOTSTRAP)
512 $(INST_BOOT): $(BOOTSTRAP) $(INST_ARCHAUTODIR)\.exists
513 '."$self->{NOECHO}$self->{RM_RF}".' $(INST_BOOT)
514 -'.$self->{CP}.' $(BOOTSTRAP) $(INST_BOOT)
519 =item dynamic_lib (o)
521 Defines how to produce the *.so (or equivalent) files.
526 my($self, %attribs) = @_;
527 return '' unless $self->needs_linking(); #might be because of a subdir
529 return '' unless $self->has_link_code;
531 my($otherldflags) = $attribs{OTHERLDFLAGS} || ($BORLAND ? 'c0d32.obj': '');
532 my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
533 my($ldfrom) = '$(LDFROM)';
535 (my $boot = $self->{NAME}) =~ s/:/_/g;
538 # This section creates the dynamically loadable $(INST_DYNAMIC)
539 # from $(OBJECT) and possibly $(MYEXTLIB).
540 OTHERLDFLAGS = '.$otherldflags.'
541 INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
543 $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP)
546 # q{ $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) }
547 # .q{$(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)});
549 # Create xdc data for an MT safe NLM in case of mpk build
550 if ( $self->{CCFLAGS} =~ m/ -DMPK_ON /) {
552 push @m, ' $(MPKTOOL) $(BASEEXT).xdc
559 q{ $(LD) Form Novell NLM '$(DISTNAME) Extension, XS_VERSION=$(XS_VERSION)'}
562 # Taking care of long names like FileHandle, ByteLoader, SDBM_File etc
563 if($self->{NLM_SHORT_NAME}) {
564 # In case of nlms with names exceeding 8 chars, build nlm in the
565 # current dir, rename and move to auto\lib. If we create in auto\lib
566 # in the first place, we can't rename afterwards.
568 q{ Name $(NLM_SHORT_NAME).$(DLEXT)}
572 q{ Name $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT)}
577 q{ Option Quiet Option Version = $(NLM_VERSION) Option Caseexact Option NoDefaultLibs Option screenname 'none' Option Synchronize }
582 q{ Option XDCDATA=$(BASEEXT).xdc }
586 # Add additional lib files if any (SDBM_File)
587 if($self->{MYEXTLIB}) {
589 q{ Library $(MYEXTLIB) }
593 #For now lets comment all the Watcom lib calls
594 #q{ LibPath $(LIBPTH) Library plib3s.lib Library math3s.lib Library clib3s.lib Library emu387.lib Library $(PERL_ARCHIVE) Library $(PERL_INC)\Main.lib}
597 q{ Library $(PERL_ARCHIVE) Library $(PERL_INC)\Main.lib}
598 .q{ Export boot_$(BOOT_SYMBOL) $(BASE_IMPORT) }
599 .q{ FILE $(OBJECT:.obj=,)}
602 # If it is having a short name, rename it
603 if($self->{NLM_SHORT_NAME}) {
605 if exist $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT) del $(INST_AUTODIR)\\$(BASEEXT).$(DLEXT)';
607 rename $(NLM_SHORT_NAME).$(DLEXT) $(BASEEXT).$(DLEXT)';
609 move $(BASEEXT).$(DLEXT) $(INST_AUTODIR)';
616 push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
623 return '$(PERL_INC)\\'.$Config{'libperl'};
629 return "$self->{BASEEXT}.def";
634 No physical check on the filesystem, but a logical cleanup of a
635 path. On UNIX eliminated successive slashes and successive "/.".
640 my($self,$path) = @_;
641 $path =~ s/^([a-z]:)/\u$1/;
643 $path =~ s|(.)\\+|$1\\|g ; # xx////xx -> xx/xx
644 $path =~ s|(\\\.)+\\|\\|g ; # xx/././xx -> xx/xx
645 $path =~ s|^(\.\\)+|| unless $path eq ".\\"; # ./xx -> xx
647 unless $path =~ m#^([a-z]:)?\\#; # xx/ -> xx
648 $path .= '.' if $path =~ m#\\$#;
654 Takes one argument, a file name, and returns the file name, if the
655 argument is likely to be a perl script. On MM_Unix this is true for
656 any ordinary, readable file.
661 my($self,$file) = @_;
662 return $file if -r $file && -f _;
663 return "$file.pl" if -r "$file.pl" && -f _;
664 return "$file.bat" if -r "$file.bat" && -f _;
670 Defines target that copies all files in the hash PM to their
671 destination and autosplits them. See L<ExtUtils::Install/DESCRIPTION>
677 my($autodir) = File::Spec->catdir('$(INST_LIB)','auto');
679 pm_to_blib: $(TO_INST_PM)
680 }.$self->{NOECHO}.q{$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
681 "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
683 ($NMAKE ? 'qw[ <<pmfiles.dat ],'
684 : $DMAKE ? 'qw[ $(mktmp,pmfiles.dat $(PM_TO_BLIB:s,\\,\\\\,)\n) ],'
685 : '{ qw[$(PM_TO_BLIB)] },'
686 ).q{'}.$autodir.q{')"
690 } : '') . $self->{NOECHO}.q{$(TOUCH) $@
694 =item test_via_harness (o)
696 Helper method to write the test targets
700 sub test_via_harness {
701 my($self, $perl, $tests) = @_;
702 "\t$perl".q! -Mblib -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e "use Test::Harness qw(&runtests $$verbose); $$verbose=$(TEST_VERBOSE); runtests @ARGV;" !."$tests\n";
706 =item tool_autosplit (override)
708 Use Win32 quoting on command line.
713 my($self, %attribs) = @_;
715 $asl = "\$AutoSplit::Maxlen=$attribs{MAXLEN};" if $attribs{MAXLEN};
717 # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
718 AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MAutoSplit }.$asl.q{ -e "autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1);"
722 =item tools_other (o)
726 Defines SHELL, LD, TOUCH, CP, MV, RM_F, RM_RF, CHMOD, UMASK_NULL in
727 the Makefile. Also defines the perl programs MKPATH,
728 WARN_IF_OLD_PACKLIST, MOD_INSTALL. DOC_INSTALL, and UNINSTALL.
735 my $bin_sh = $Config{sh} || 'cmd /c';
738 } unless $DMAKE; # dmake determines its own shell
740 for (qw/ CHMOD CP LD MV NOOP RM_F RM_RF TEST_F TOUCH UMASK_NULL DEV_NULL/ ) {
741 push @m, "$_ = $self->{$_}\n";
745 # The following is a portable way to say mkdir -p
746 # To see which directories are created, change the if 0 to if 1
747 MKPATH = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mkpath
749 # This helps us to minimize the effect of the .exists files A yet
750 # better solution would be to have a stable file in the perl
751 # distribution with a timestamp of zero. But this solution doesn't
752 # need any changes to the core distribution and works with older perls
753 EQUALIZE_TIMESTAMP = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e eqtime
757 return join "", @m if $self->{PARENT};
760 # Here we warn users that an old packlist file was found somewhere,
761 # and that they should call some uninstall routine
762 WARN_IF_OLD_PACKLIST = $(PERL) -lwe "exit unless -f $$ARGV[0];" \\
763 -e "print 'WARNING: I have found an old package in';" \\
764 -e "print ' ', $$ARGV[0], '.';" \\
765 -e "print 'Please make sure the two installations are not conflicting';"
770 MOD_INSTALL = $(PERL) -I$(INST_LIB) -I$(PERL_LIB) -MExtUtils::Install \
771 -e "install({ @ARGV },'$(VERBINST)',0,'$(UNINST)');"
773 DOC_INSTALL = $(PERL) -e "$$\=\"\n\n\";" \
774 -e "print '=head2 ', scalar(localtime), ': C<', shift, '>', ' L<', shift, '>';" \
775 -e "print '=over 4';" \
776 -e "while (defined($$key = shift) and defined($$val = shift)) { print '=item *';print 'C<', \"$$key: $$val\", '>'; }" \
779 UNINSTALL = $(PERL) -MExtUtils::Install \
780 -e "uninstall($$ARGV[0],1,1); print \"\nUninstall is deprecated. Please check the";" \
781 -e "print \" packlist above carefully.\n There may be errors. Remove the\";" \
782 -e "print \" appropriate files manually.\n Sorry for the inconveniences.\n\""
790 Defines suffix rules to go from XS to object files directly. This is
791 only intended for broken make implementations.
795 sub xs_o { # many makes are too dumb to use xs_c then c_o
800 =item top_targets (o)
802 Defines the targets all, subdirs, config, and O_FILES
807 # --- Target Sections ---
812 #all :: config $(INST_PM) subdirs linkext manifypods
816 all :: pure_all htmlifypods manifypods
817 '.$self->{NOECHO}.'$(NOOP)
819 unless $self->{SKIPHASH}{'all'};
822 pure_all :: config pm_to_blib subdirs linkext
823 '.$self->{NOECHO}.'$(NOOP)
825 subdirs :: $(MYEXTLIB)
826 '.$self->{NOECHO}.'$(NOOP)
828 config :: '.$self->{MAKEFILE}.' $(INST_LIBDIR)\.exists
829 '.$self->{NOECHO}.'$(NOOP)
831 config :: $(INST_ARCHAUTODIR)\.exists
832 '.$self->{NOECHO}.'$(NOOP)
834 config :: $(INST_AUTODIR)\.exists
835 '.$self->{NOECHO}.'$(NOOP)
838 push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
840 if (%{$self->{HTMLLIBPODS}}) {
842 config :: \$(INST_HTMLLIBDIR)/.exists
843 $self->{NOECHO}\$(NOOP)
846 push @m, $self->dir_target(qw[$(INST_HTMLLIBDIR)]);
849 if (%{$self->{HTMLSCRIPTPODS}}) {
851 config :: \$(INST_HTMLSCRIPTDIR)/.exists
852 $self->{NOECHO}\$(NOOP)
855 push @m, $self->dir_target(qw[$(INST_HTMLSCRIPTDIR)]);
858 if (%{$self->{MAN1PODS}}) {
860 config :: \$(INST_MAN1DIR)\\.exists
861 $self->{NOECHO}\$(NOOP)
864 push @m, $self->dir_target(qw[$(INST_MAN1DIR)]);
866 if (%{$self->{MAN3PODS}}) {
868 config :: \$(INST_MAN3DIR)\\.exists
869 $self->{NOECHO}\$(NOOP)
872 push @m, $self->dir_target(qw[$(INST_MAN3DIR)]);
876 $(O_FILES): $(H_FILES)
877 ' if @{$self->{O_FILES} || []} && @{$self->{H} || []};
881 perldoc ExtUtils::MakeMaker
886 }.$self->{NOECHO}.q{$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
887 -MExtUtils::MakeMaker=Version_check \
888 -e "Version_check('$(MM_VERSION)')"
894 =item htmlifypods (o)
896 Defines targets and routines to translate the pods into HTML manpages
897 and put them into the INST_HTMLLIBDIR and INST_HTMLSCRIPTDIR
900 Same as MM_Unix version (changes command-line quoting).
905 my($self, %attribs) = @_;
906 return "\nhtmlifypods : pure_all\n\t$self->{NOECHO}\$(NOOP)\n" unless
907 %{$self->{HTMLLIBPODS}} || %{$self->{HTMLSCRIPTPODS}};
910 if (defined $self->{PERL_SRC}) {
911 $pod2html_exe = File::Spec->catfile($self->{PERL_SRC},'pod','pod2html');
913 $pod2html_exe = File::Spec->catfile($Config{scriptdirexp},'pod2html');
915 unless ($pod2html_exe = $self->perl_script($pod2html_exe)) {
916 # No pod2html but some HTMLxxxPODS to be installed
919 Warning: I could not locate your pod2html program. Please make sure,
920 your pod2html program is in your PATH before you execute 'make'
923 $pod2html_exe = "-S pod2html";
927 qq[POD2HTML_EXE = $pod2html_exe\n],
928 qq[POD2HTML = \$(PERL) -we "use File::Basename; use File::Path qw(mkpath); %m=\@ARGV;for (keys %m){" \\\n],
929 q[-e "next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M '],
930 $self->{MAKEFILE}, q[';" \\
931 -e "print qq(Htmlifying $$m{$$_}\n);" \\
932 -e "$$dir = dirname($$m{$$_}); mkpath($$dir) unless -d $$dir;" \\
933 -e "system(qq[$$^X ].q["-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" $(POD2HTML_EXE) ].qq[$$_>$$m{$$_}])==0 or warn qq(Couldn\\047t install $$m{$$_}\n);" \\
934 -e "chmod(oct($(PERM_RW))), $$m{$$_} or warn qq(chmod $(PERM_RW) $$m{$$_}: $$!\n);}"
936 push @m, "\nhtmlifypods : pure_all ";
937 push @m, join " \\\n\t", keys %{$self->{HTMLLIBPODS}}, keys %{$self->{HTMLSCRIPTPODS}};
940 if (%{$self->{HTMLLIBPODS}} || %{$self->{HTMLSCRIPTPODS}}) {
941 push @m, "\t$self->{NOECHO}\$(POD2HTML) \\\n\t";
942 push @m, join " \\\n\t", %{$self->{HTMLLIBPODS}}, %{$self->{HTMLSCRIPTPODS}};
949 We don't want manpage process.
955 return "\nmanifypods :\n\t$self->{NOECHO}\$(NOOP)\n";
960 Same as MM_Unix version (changes command-line quoting).
969 $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=maniread \\
970 -e "@all = keys %{ maniread() };" \\
971 -e "print(\"Executing $(CI) @all\n\"); system(\"$(CI) @all\");" \\
972 -e "print(\"Executing $(RCS_LABEL) ...\n\"); system(\"$(RCS_LABEL) @all\");"
979 Same as MM_Unix version (changes command-line quoting).
987 dist : $(DIST_DEFAULT)
988 }.$self->{NOECHO}.q{$(PERL) -le "print \"Warning: Makefile possibly out of date with $$vf\" if " \
989 -e "-e ($$vf=\"$(VERSION_FROM)\") and -M $$vf < -M \"}.$self->{MAKEFILE}.q{\";"
991 tardist : $(DISTVNAME).tar$(SUFFIX)
993 zipdist : $(DISTVNAME).zip
995 $(DISTVNAME).tar$(SUFFIX) : distdir
998 $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
999 $(RM_RF) $(DISTVNAME)
1000 $(COMPRESS) $(DISTVNAME).tar
1003 $(DISTVNAME).zip : distdir
1005 $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
1006 $(RM_RF) $(DISTVNAME)
1009 uutardist : $(DISTVNAME).tar$(SUFFIX)
1010 uuencode $(DISTVNAME).tar$(SUFFIX) \\
1011 $(DISTVNAME).tar$(SUFFIX) > \\
1012 $(DISTVNAME).tar$(SUFFIX)_uu
1016 $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
1017 $(RM_RF) $(DISTVNAME)
1025 Defines the string that is passed to recursive make calls in
1032 return "PASTHRU = " . ($NMAKE ? "-nologo" : "");