package ExtUtils::MM_Win32;
+use strict;
+
+
=head1 NAME
ExtUtils::MM_Win32 - methods to override UN*X behaviour in ExtUtils::MakeMaker
there. This package overrides the implementation of these methods, not
the semantics.
-=over
-
=cut
-#use Config;
-#use Cwd;
+use Config;
use File::Basename;
-require Exporter;
+use File::Spec;
+use ExtUtils::MakeMaker qw( neatvalue );
-Exporter::import('ExtUtils::MakeMaker',
- qw( $Verbose &neatvalue));
+use vars qw(@ISA $VERSION $BORLAND $GCC $DMAKE $NMAKE);
+
+require ExtUtils::MM_Any;
+require ExtUtils::MM_Unix;
+@ISA = qw( ExtUtils::MM_Any ExtUtils::MM_Unix );
+$VERSION = '1.07';
$ENV{EMXSHELL} = 'sh'; # to run `commands`
-unshift @MM::ISA, 'ExtUtils::MM_Win32';
+
+$BORLAND = 1 if $Config{'cc'} =~ /^bcc/i;
+$GCC = 1 if $Config{'cc'} =~ /^gcc/i;
+$DMAKE = 1 if $Config{'make'} =~ /^dmake/i;
+$NMAKE = 1 if $Config{'make'} =~ /^nmake/i;
+
+
+=head2 Overridden methods
+
+=over 4
+
+=item B<dlsyms>
+
+=cut
sub dlsyms {
my($self,%attribs) = @_;
my($funcs) = $attribs{DL_FUNCS} || $self->{DL_FUNCS} || {};
my($vars) = $attribs{DL_VARS} || $self->{DL_VARS} || [];
+ my($funclist) = $attribs{FUNCLIST} || $self->{FUNCLIST} || [];
my($imports) = $attribs{IMPORTS} || $self->{IMPORTS} || {};
my(@m);
- (my $boot = $self->{NAME}) =~ s/:/_/g;
if (not $self->{SKIPHASH}{'dynamic'}) {
push(@m,"
$self->{BASEEXT}.def: Makefile.PL
",
- q! $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Mksymlists \\
- -e "Mksymlists('NAME' => '!, $self->{NAME},
- q!', 'DLBASE' => '!,$self->{DLBASE},
+ q! $(PERLRUN) -MExtUtils::Mksymlists \\
+ -e "Mksymlists('NAME'=>\"!, $self->{NAME},
+ q!\", 'DLBASE' => '!,$self->{DLBASE},
+ # The above two lines quoted differently to work around
+ # a bug in the 4DOS/4NT command line interpreter. The visible
+ # result of the bug was files named q('extension_name',) *with the
+ # single quotes and the comma* in the extension build directories.
q!', 'DL_FUNCS' => !,neatvalue($funcs),
+ q!, 'FUNCLIST' => !,neatvalue($funclist),
q!, 'IMPORTS' => !,neatvalue($imports),
q!, 'DL_VARS' => !, neatvalue($vars), q!);"
!);
join('',@m);
}
+=item replace_manpage_separator
+
+Changes the path separator with .
+
+=cut
+
sub replace_manpage_separator {
my($self,$man) = @_;
$man =~ s,/+,.,g;
$man;
}
+
+=item B<maybe_command>
+
+Since Windows has nothing as simple as an executable bit, we check the
+file extension.
+
+The PATHEXT env variable will be used to get a list of extensions that
+might indicate a command, otherwise .com, .exe, .bat and .cmd will be
+used by default.
+
+=cut
+
sub maybe_command {
my($self,$file) = @_;
- return "$file.exe" if -e "$file.exe";
+ my @e = exists($ENV{'PATHEXT'})
+ ? split(/;/, $ENV{PATHEXT})
+ : qw(.com .exe .bat .cmd);
+ my $e = '';
+ for (@e) { $e .= "\Q$_\E|" }
+ chop $e;
+ # see if file ends in one of the known extensions
+ if ($file =~ /($e)$/i) {
+ return $file if -e $file;
+ }
+ else {
+ for (@e) {
+ return "$file$_" if -e "$file$_";
+ }
+ }
return;
}
-sub file_name_is_absolute {
- my($self,$file) = @_;
- $file =~ m{^([a-z]:)?[\\/]}i ;
+
+=item B<find_tests>
+
+The Win9x shell does not expand globs and I'll play it safe and assume
+other Windows variants don't either.
+
+So we do it for them.
+
+=cut
+
+sub find_tests {
+ return join(' ', <t\\*.t>);
}
-sub find_perl {
- my($self, $ver, $names, $dirs, $trace) = @_;
- my($name, $dir);
- if ($trace >= 2){
- print "Looking for perl $ver by these names:
-@$names
-in these dirs:
-@$dirs
-";
- }
- foreach $dir (@$dirs){
- next unless defined $dir; # $self->{PERL_SRC} may be undefined
- foreach $name (@$names){
- my ($abs, $val);
- if ($self->file_name_is_absolute($name)) { # /foo/bar
- $abs = $name;
- } elsif ($self->canonpath($name) eq $self->canonpath(basename($name))) { # foo
- $abs = $self->catfile($dir, $name);
- } else { # foo/bar
- $abs = $self->canonpath($self->catfile($self->curdir, $name));
- }
- print "Checking $abs\n" if ($trace >= 2);
- next unless $self->maybe_command($abs);
- print "Executing $abs\n" if ($trace >= 2);
- $val = `$abs -e "require $ver;" 2>&1`;
- if ($? == 0) {
- print "Using PERL=$abs\n" if $trace;
- return $abs;
- } elsif ($trace >= 2) {
- print "Result: `$val'\n";
- }
- }
- }
- print STDOUT "Unable to find a perl $ver (by these names: @$names, in these dirs: @$dirs)\n";
- 0; # false and not empty
+
+=item B<init_DIRFILESEP>
+
+Using \ for Windows.
+
+=cut
+
+sub init_DIRFILESEP {
+ my($self) = shift;
+
+ # The ^ makes sure its not interpreted as an escape in nmake
+ $self->{DIRFILESEP} = $NMAKE ? '^\\' :
+ $DMAKE ? '\\\\'
+ : '\\';
}
-sub catdir {
- my $self = shift;
- my @args = @_;
- for (@args) {
- # append a slash to each argument unless it has one there
- $_ .= "\\" if $_ eq '' or substr($_,-1) ne "\\";
+=item B<init_others>
+
+Override some of the Unix specific commands with portable
+ExtUtils::Command ones.
+
+Also provide defaults for LD and AR in case the %Config values aren't
+set.
+
+LDLOADLIBS's default is changed to $Config{libs}.
+
+Adjustments are made for Borland's quirks needing -L to come first.
+
+=cut
+
+sub init_others {
+ my ($self) = @_;
+
+ # Used in favor of echo because echo won't strip quotes. :(
+ $self->{ECHO} ||= $self->oneliner('print qq{@ARGV}', ['-l']);
+
+ $self->{TOUCH} ||= '$(PERLRUN) -MExtUtils::Command -e touch';
+ $self->{CHMOD} ||= '$(PERLRUN) -MExtUtils::Command -e chmod';
+ $self->{CP} ||= '$(PERLRUN) -MExtUtils::Command -e cp';
+ $self->{RM_F} ||= '$(PERLRUN) -MExtUtils::Command -e rm_f';
+ $self->{RM_RF} ||= '$(PERLRUN) -MExtUtils::Command -e rm_rf';
+ $self->{MV} ||= '$(PERLRUN) -MExtUtils::Command -e mv';
+ $self->{NOOP} ||= 'rem';
+ $self->{TEST_F} ||= '$(PERLRUN) -MExtUtils::Command -e test_f';
+ $self->{DEV_NULL} ||= '> NUL';
+
+ # technically speaking, these should be in init_main()
+ $self->{LD} ||= $Config{ld} || 'link';
+ $self->{AR} ||= $Config{ar} || 'lib';
+
+ $self->SUPER::init_others;
+
+ # Setting SHELL from $Config{sh} can break dmake. Its ok without it.
+ delete $self->{SHELL};
+
+ $self->{LDLOADLIBS} ||= $Config{libs};
+ # -Lfoo must come first for Borland, so we put it in LDDLFLAGS
+ if ($BORLAND) {
+ my $libs = $self->{LDLOADLIBS};
+ my $libpath = '';
+ while ($libs =~ s/(?:^|\s)(("?)-L.+?\2)(?:\s|$)/ /) {
+ $libpath .= ' ' if length $libpath;
+ $libpath .= $1;
+ }
+ $self->{LDLOADLIBS} = $libs;
+ $self->{LDDLFLAGS} ||= $Config{lddlflags};
+ $self->{LDDLFLAGS} .= " $libpath";
}
- my $result = $self->canonpath(join('', @args));
- $result;
+
+ return 1;
}
-=item catfile
-Concatenate one or more directory names and a filename to form a
-complete path ending with a filename
+=item init_platform (o)
+
+Add MM_Win32_VERSION.
+
+=item platform_constants (o)
=cut
-sub catfile {
- my $self = shift @_;
- my $file = pop @_;
- return $file unless @_;
- my $dir = $self->catdir(@_);
- for ($dir) {
- $_ .= "\\" unless substr($_,length($_)-1,1) eq "\\";
- }
- return $dir.$file;
+sub init_platform {
+ my($self) = shift;
+
+ $self->{MM_Win32_VERSION} = $VERSION;
}
-sub init_others
-{
- my ($self) = @_;
- &ExtUtils::MM_Unix::init_others;
- $self->{'TOUCH'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e touch';
- $self->{'CHMOD'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e chmod';
- $self->{'CP'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e cp';
- $self->{'RM_F'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e rm_f';
- $self->{'RM_RF'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e rm_rf';
- $self->{'MV'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mv';
- $self->{'NOOP'} = 'rem';
- $self->{'TEST_F'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e test_f';
- $self->{'LD'} = 'link';
- $self->{'DEV_NULL'} = '> NUL';
- # $self->{'NOECHO'} = ''; # till we have it working
+sub platform_constants {
+ my($self) = shift;
+ my $make_frag = '';
+
+ foreach my $macro (qw(MM_Win32_VERSION))
+ {
+ next unless defined $self->{$macro};
+ $make_frag .= "$macro = $self->{$macro}\n";
+ }
+
+ return $make_frag;
}
-sub path {
- local $^W = 1;
+
+=item special_targets (o)
+
+Add .USESHELL target for dmake.
+
+=cut
+
+sub special_targets {
my($self) = @_;
- my $path = $ENV{'PATH'} || $ENV{'Path'} || $ENV{'path'};
- my @path = split(';',$path);
- foreach(@path) { $_ = '.' if $_ eq '' }
- @path;
+
+ my $make_frag = $self->SUPER::special_targets;
+
+ $make_frag .= <<'MAKE_FRAG' if $DMAKE;
+.USESHELL :
+MAKE_FRAG
+
+ return $make_frag;
}
+
=item static_lib (o)
-Defines how to produce the *.a (or equivalent) files.
+Changes how to run the linker.
+
+The rest is duplicate code from MM_Unix. Should move the linker code
+to its own method.
=cut
sub static_lib {
my($self) = @_;
-# Come to think of it, if there are subdirs with linkcode, we still have no INST_STATIC
-# return '' unless $self->needs_linking(); #might be because of a subdir
-
return '' unless $self->has_link_code;
my(@m);
push(@m, <<'END');
-$(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)/.exists
+$(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists
$(RM_RF) $@
END
- # If this extension has it's own library (eg SDBM_File)
+
+ # If this extension has its own library (eg SDBM_File)
# then copy that to $(INST_STATIC) and add $(OBJECT) into it.
- push(@m, "\t$self->{CP} \$(MYEXTLIB) \$\@\n") if $self->{MYEXTLIB};
+ push @m, <<'MAKE_FRAG' if $self->{MYEXTLIB};
+ $(CP) $(MYEXTLIB) $@
+MAKE_FRAG
push @m,
-q{ lib -nologo -out:$@ $(OBJECT)
- }.$self->{NOECHO}.q{echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)/extralibs.ld
- $(CHMOD) 755 $@
+q{ $(AR) }.($BORLAND ? '$@ $(OBJECT:^"+")'
+ : ($GCC ? '-ru $@ $(OBJECT)'
+ : '-out:$@ $(OBJECT)')).q{
+ $(CHMOD) $(PERM_RWX) $@
+ $(NOECHO) $(ECHO) "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)\extralibs.ld
};
-# Old mechanism - still available:
-
- push @m, "\t$self->{NOECHO}".q{echo "$(EXTRALIBS)" >> $(PERL_SRC)/ext.libs}."\n\n"
- if $self->{PERL_SRC};
+ # Old mechanism - still available:
+ push @m, <<'MAKE_FRAG' if $self->{PERL_SRC} && $self->{EXTRALIBS};
+ $(NOECHO) $(ECHO) "$(EXTRALIBS)" >> $(PERL_SRC)\ext.libs
+MAKE_FRAG
- push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
- join('', "\n",@m);
+ push @m, "\n", $self->dir_target('$(INST_ARCHAUTODIR)');
+ join('', @m);
}
-
=item dynamic_lib (o)
-Defines how to produce the *.so (or equivalent) files.
+Complicated stuff for Win32 that I don't understand. :(
=cut
return '' unless $self->has_link_code;
- my($otherldflags) = $attribs{OTHERLDFLAGS} || "";
+ my($otherldflags) = $attribs{OTHERLDFLAGS} || ($BORLAND ? 'c0d32.obj': '');
my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
my($ldfrom) = '$(LDFROM)';
my(@m);
+
+# one thing for GCC/Mingw32:
+# we try to overcome non-relocateable-DLL problems by generating
+# a (hopefully unique) image-base from the dll's name
+# -- BKS, 10-19-1999
+ if ($GCC) {
+ my $dllname = $self->{BASEEXT} . "." . $self->{DLEXT};
+ $dllname =~ /(....)(.{0,4})/;
+ my $baseaddr = unpack("n", $1 ^ $2);
+ $otherldflags .= sprintf("-Wl,--image-base,0x%x0000 ", $baseaddr);
+ }
+
push(@m,'
# This section creates the dynamically loadable $(INST_DYNAMIC)
# from $(OBJECT) and possibly $(MYEXTLIB).
OTHERLDFLAGS = '.$otherldflags.'
INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
-$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
+$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
');
-
- push(@m,' $(LD) -out:$@ $(LDDLFLAGS) '.$ldfrom.
- ' $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)');
+ if ($GCC) {
+ push(@m,
+ q{ dlltool --def $(EXPORT_LIST) --output-exp dll.exp
+ $(LD) -o $@ -Wl,--base-file -Wl,dll.base $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) dll.exp
+ dlltool --def $(EXPORT_LIST) --base-file dll.base --output-exp dll.exp
+ $(LD) -o $@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) dll.exp });
+ } elsif ($BORLAND) {
+ push(@m,
+ q{ $(LD) $(LDDLFLAGS) $(OTHERLDFLAGS) }.$ldfrom.q{,$@,,}
+ .($DMAKE ? q{$(PERL_ARCHIVE:s,/,\,) $(LDLOADLIBS:s,/,\,) }
+ .q{$(MYEXTLIB:s,/,\,),$(EXPORT_LIST:s,/,\,)}
+ : q{$(subst /,\,$(PERL_ARCHIVE)) $(subst /,\,$(LDLOADLIBS)) }
+ .q{$(subst /,\,$(MYEXTLIB)),$(subst /,\,$(EXPORT_LIST))})
+ .q{,$(RESFILES)});
+ } else { # VC
+ push(@m,
+ q{ $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) }
+ .q{$(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)});
+ }
push @m, '
- $(CHMOD) 755 $@
+ $(CHMOD) $(PERM_RWX) $@
';
push @m, $self->dir_target('$(INST_ARCHAUTODIR)');
join('',@m);
}
-sub perl_archive
-{
- return '$(PERL_INC)\perl$(LIB_EXT)';
-}
+=item clean
+
+Clean out some extra dll.{base,exp} files which might be generated by
+gcc. Otherwise, take out all *.pdb files.
-sub export_list
+=cut
+
+sub clean
{
- my ($self) = @_;
- return "$self->{BASEEXT}.def";
-}
+ my ($self) = shift;
+ my $s = $self->SUPER::clean(@_);
+ my $clean = $GCC ? 'dll.base dll.exp' : '*.pdb';
+ $s .= <<END;
+clean ::
+ -\$(RM_F) $clean
-=item canonpath
+END
+ return $s;
+}
-No physical check on the filesystem, but a logical cleanup of a
-path. On UNIX eliminated successive slashes and successive "/.".
+=item init_linker
=cut
-sub canonpath {
- my($self,$path) = @_;
- $path =~ s|/|\\|g;
- $path =~ s|\\+|\\|g ; # xx////xx -> xx/xx
- $path =~ s|(\\\.)+\\|\\|g ; # xx/././xx -> xx/xx
- $path =~ s|^(\.\\)+|| unless $path eq ".\\"; # ./xx -> xx
- $path =~ s|\\$||
- unless $path =~ m#^([a-z]:)?\\#; # xx/ -> xx
- $path .= '.' if $path =~ m#\\$#;
- $path;
+sub init_linker {
+ my $self = shift;
+
+ $self->{PERL_ARCHIVE} = "\$(PERL_INC)\\$Config{libperl}";
+ $self->{PERL_ARCHIVE_AFTER} = '';
+ $self->{EXPORT_LIST} = '$(BASEEXT).def';
}
+
=item perl_script
-Takes one argument, a file name, and returns the file name, if the
-argument is likely to be a perl script. On MM_Unix this is true for
-any ordinary, readable file.
+Checks for the perl program under several common perl extensions.
=cut
sub perl_script {
my($self,$file) = @_;
- return "$file.pl" if -r "$file.pl" && -f _;
+ return $file if -r $file && -f _;
+ return "$file.pl" if -r "$file.pl" && -f _;
+ return "$file.plx" if -r "$file.plx" && -f _;
+ return "$file.bat" if -r "$file.bat" && -f _;
return;
}
-=item pm_to_blib
-Defines target that copies all files in the hash PM to their
-destination and autosplits them. See L<ExtUtils::Install/DESCRIPTION>
+=item xs_o (o)
-=cut
-
-sub pm_to_blib {
- my $self = shift;
- my($autodir) = $self->catdir('$(INST_LIB)','auto');
- return q{
-pm_to_blib: $(TO_INST_PM)
- }.$self->{NOECHO}.q{$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
- "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
- -e "pm_to_blib(qw{ <<pmfiles.dat },'}.$autodir.q{')"
- }.q{
-$(PM_TO_BLIB)
-<<
- }.$self->{NOECHO}.q{$(TOUCH) $@
-};
-}
-
-=item test_via_harness (o)
-
-Helper method to write the test targets
+This target is stubbed out. Not sure why.
=cut
-sub test_via_harness {
- my($self, $perl, $tests) = @_;
- "\t$perl".q! -Mblib -I$(PERL_ARCHLIB) -I$(PERL_LIB) -e "use Test::Harness qw(&runtests $$verbose); $$verbose=$(TEST_VERBOSE); runtests @ARGV;" !."$tests\n";
+sub xs_o {
+ return ''
}
-=item tool_autosplit (override)
-Use Win32 quoting on command line.
+=item pasthru (o)
+
+All we send is -nologo to nmake to prevent it from printing its damned
+banner.
=cut
-sub tool_autosplit{
- my($self, %attribs) = @_;
- my($asl) = "";
- $asl = "\$AutoSplit::Maxlen=$attribs{MAXLEN};" if $attribs{MAXLEN};
- q{
-# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
-AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MAutoSplit }.$asl.q{ -e "autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1);"
-};
+sub pasthru {
+ my($self) = shift;
+ return "PASTHRU = " . ($NMAKE ? "-nologo" : "");
}
-=item tools_other (o)
-Win32 overrides.
+=item oneliner (o)
-Defines SHELL, LD, TOUCH, CP, MV, RM_F, RM_RF, CHMOD, UMASK_NULL in
-the Makefile. Also defines the perl programs MKPATH,
-WARN_IF_OLD_PACKLIST, MOD_INSTALL. DOC_INSTALL, and UNINSTALL.
+These are based on what command.com does on Win98. They may be wrong
+for other Windows shells, I don't know.
=cut
-sub tools_other {
- my($self) = shift;
- my @m;
- my $bin_sh = $Config{sh} || 'cmd /c';
- push @m, qq{
-SHELL = $bin_sh
-};
-
- for (qw/ CHMOD CP LD MV NOOP RM_F RM_RF TEST_F TOUCH UMASK_NULL DEV_NULL/ ) {
- push @m, "$_ = $self->{$_}\n";
- }
-
- push @m, q{
-# The following is a portable way to say mkdir -p
-# To see which directories are created, change the if 0 to if 1
-MKPATH = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mkpath
+sub oneliner {
+ my($self, $cmd, $switches) = @_;
+ $switches = [] unless defined $switches;
-# This helps us to minimize the effect of the .exists files A yet
-# better solution would be to have a stable file in the perl
-# distribution with a timestamp of zero. But this solution doesn't
-# need any changes to the core distribution and works with older perls
-EQUALIZE_TIMESTAMP = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e eqtime
-};
+ # Strip leading and trailing newlines
+ $cmd =~ s{^\n+}{};
+ $cmd =~ s{\n+$}{};
+ $cmd = $self->quote_literal($cmd);
+ $cmd = $self->escape_newlines($cmd);
- return join "", @m if $self->{PARENT};
+ $switches = join ' ', @$switches;
- push @m, q{
-# Here we warn users that an old packlist file was found somewhere,
-# and that they should call some uninstall routine
-WARN_IF_OLD_PACKLIST = $(PERL) -lwe "exit unless -f $$ARGV[0];" \\
--e "print 'WARNING: I have found an old package in';" \\
--e "print ' ', $$ARGV[0], '.';" \\
--e "print 'Please make sure the two installations are not conflicting';"
+ return qq{\$(PERLRUN) $switches -e $cmd};
+}
-UNINST=0
-VERBINST=1
-MOD_INSTALL = $(PERL) -I$(INST_LIB) -I$(PERL_LIB) -MExtUtils::Install \
--e "install({@ARGV},'$(VERBINST)',0,'$(UNINST)');"
+sub quote_literal {
+ my($self, $text) = @_;
-DOC_INSTALL = $(PERL) -e "$$\=\"\n\n\";" \
--e "print '=head2 ', scalar(localtime), ': C<', shift, '>', ' L<', shift, '>';" \
--e "print '=over 4';" \
--e "while (defined($$key = shift) and defined($$val = shift)){print '=item *';print 'C<', \"$$key: $$val\", '>';}" \
--e "print '=back';"
+ # I don't know if this is correct, but it seems to work on
+ # Win98's command.com
+ $text =~ s{"}{\\"}g;
-UNINSTALL = $(PERL) -MExtUtils::Install \
--e "uninstall($$ARGV[0],1,1); print \"\nUninstall is deprecated. Please check the";" \
--e "print \" packlist above carefully.\n There may be errors. Remove the\";" \
--e "print \" appropriate files manually.\n Sorry for the inconveniences.\n\""
-};
+ # dmake eats '{' inside double quotes and leaves alone { outside double
+ # quotes; however it transforms {{ into { either inside and outside double
+ # quotes. It also translates }} into }. The escaping below is not
+ # 100% correct.
+ if( $DMAKE ) {
+ $text =~ s/{/{{/g;
+ $text =~ s/}}/}}}/g;
+ }
- return join "", @m;
+ return qq{"$text"};
}
-=item manifypods (o)
-We don't want manpage process. XXX add pod2html support later.
+sub escape_newlines {
+ my($self, $text) = @_;
-=cut
+ # Escape newlines
+ $text =~ s{\n}{\\\n}g;
-sub manifypods {
- return "\nmanifypods :\n\t$self->{NOECHO}\$(NOOP)\n";
+ return $text;
}
-=item dist_ci (o)
-
-Same as MM_Unix version (changes command-line quoting).
-=cut
-
-sub dist_ci {
- my($self) = shift;
- my @m;
- push @m, q{
-ci :
- $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=maniread \\
- -e "@all = keys %{ maniread() };" \\
- -e "print(\"Executing $(CI) @all\n\"); system(\"$(CI) @all\");" \\
- -e "print(\"Executing $(RCS_LABEL) ...\n\"); system(\"$(RCS_LABEL) @all\");"
-};
- join "", @m;
-}
-
-=item dist_core (o)
+=item max_exec_len
-Same as MM_Unix version (changes command-line quoting).
+Using 31K, a safe number gotten from Windows 2000.
=cut
-sub dist_core {
- my($self) = shift;
- my @m;
- push @m, q{
-dist : $(DIST_DEFAULT)
- }.$self->{NOECHO}.q{$(PERL) -le "print \"Warning: Makefile possibly out of date with $$vf\" if " \
- -e "-e ($$vf=\"$(VERSION_FROM)\") and -M $$vf < -M \"}.$self->{MAKEFILE}.q{\";"
-
-tardist : $(DISTVNAME).tar$(SUFFIX)
-
-zipdist : $(DISTVNAME).zip
-
-$(DISTVNAME).tar$(SUFFIX) : distdir
- $(PREOP)
- $(TO_UNIX)
- $(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
- $(RM_RF) $(DISTVNAME)
- $(COMPRESS) $(DISTVNAME).tar
- $(POSTOP)
-
-$(DISTVNAME).zip : distdir
- $(PREOP)
- $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
- $(RM_RF) $(DISTVNAME)
- $(POSTOP)
-
-uutardist : $(DISTVNAME).tar$(SUFFIX)
- uuencode $(DISTVNAME).tar$(SUFFIX) \\
- $(DISTVNAME).tar$(SUFFIX) > \\
- $(DISTVNAME).tar$(SUFFIX)_uu
-
-shdist : distdir
- $(PREOP)
- $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
- $(RM_RF) $(DISTVNAME)
- $(POSTOP)
-};
- join "", @m;
+sub max_exec_len {
+ my $self = shift;
+
+ return $self->{_MAX_EXEC_LEN} ||= 31 * 1024;
}
-=item pasthru (o)
-Defines the string that is passed to recursive make calls in
-subdirectories.
+=item os_flavor
+
+Windows is Win32.
=cut
-sub pasthru {
- my($self) = shift;
- return "PASTHRU = /nologo"
+sub os_flavor {
+ return('Win32');
}
-
1;
__END__
=cut
+