package ExtUtils::MM_Win32;
+our $VERSION = '1.00';
+
=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
+=over 4
=cut
use File::Basename;
require Exporter;
-Exporter::import('ExtUtils::MakeMaker',
- qw( $Verbose &neatvalue));
+require ExtUtils::MakeMaker;
+ExtUtils::MakeMaker->import(qw( $Verbose &neatvalue));
$ENV{EMXSHELL} = 'sh'; # to run `commands`
unshift @MM::ISA, 'ExtUtils::MM_Win32';
$DMAKE = 1 if $Config{'make'} =~ /^dmake/i;
$NMAKE = 1 if $Config{'make'} =~ /^nmake/i;
$PERLMAKE = 1 if $Config{'make'} =~ /^pmake/i;
-$OBJ = 1 if $Config{'ccflags'} =~ /PERL_OBJECT/i;
# a few workarounds for command.com (very basic)
-if (Win32::IsWin95()) {
+{
package ExtUtils::MM_Win95;
- unshift @MM::ISA, 'ExtUtils::MM_Win95';
+
+ # the $^O test may be overkill, but we want to be sure Win32::IsWin95()
+ # exists before we try it
+
+ unshift @MM::ISA, 'ExtUtils::MM_Win95'
+ if ($^O =~ /Win32/ && Win32::IsWin95());
sub xs_c {
my($self) = shift;
sub xs_o {
my($self) = shift;
return '' unless $self->needs_linking();
- # Dmake gets confused with 2 ways of making things
- return '' if $ExtUtils::MM_Win32::DMAKE;
'
.xs$(OBJ_EXT):
$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) \\
$(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
';
}
-}
+} # end of command.com workarounds
sub dlsyms {
my($self,%attribs) = @_;
$self->{BASEEXT}.def: Makefile.PL
",
q! $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Mksymlists \\
- -e "Mksymlists('NAME' => '!, $self->{NAME},
- q!', 'DLBASE' => '!,$self->{DLBASE},
+ -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),
INSTALLSITEARCH INSTALLBIN INSTALLSCRIPT PERL_LIB
PERL_ARCHLIB SITELIBEXP SITEARCHEXP LIBPERL_A MYEXTLIB
FIRST_MAKEFILE MAKE_APERL_FILE PERLMAINCC PERL_SRC
- PERL_INC PERL FULLPERL
+ PERL_INC PERL FULLPERL PERLRUN PERLRUNINST TEST_LIBS
+ FULL_AR PERL_CORE
/ ) {
next unless defined $self->{$tmp};
sub path {
- local $^W = 1;
my($self) = @_;
my $path = $ENV{'PATH'} || $ENV{'Path'} || $ENV{'path'};
my @path = split(';',$path);
$(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)\.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};
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).
join('',@m);
}
+sub clean
+{
+ my ($self) = @_;
+ my $s = &ExtUtils::MM_Unix::clean;
+ my $clean = $GCC ? 'dll.base dll.exp' : '*.pdb';
+ $s .= <<END;
+clean ::
+ -\$(RM_F) $clean
+
+END
+ return $s;
+}
+
+
+
sub perl_archive
{
my ($self) = @_;
($NMAKE ? 'qw[ <<pmfiles.dat ],'
: $DMAKE ? 'qw[ $(mktmp,pmfiles.dat $(PM_TO_BLIB:s,\\,\\\\,)\n) ],'
: '{ qw[$(PM_TO_BLIB)] },'
- ).q{'}.$autodir.q{')"
+ ).q{'}.$autodir.q{','$(PM_FILTER)')"
}. ($NMAKE ? q{
$(PM_TO_BLIB)
<<
-e "install({ @ARGV },'$(VERBINST)',0,'$(UNINST)');"
DOC_INSTALL = $(PERL) -e "$$\=\"\n\n\";" \
--e "print '=head2 ', scalar(localtime), ': C<', shift, '>', ' L<', shift, '>';" \
+-e "print '=head2 ', scalar(localtime), ': C<', shift, '>', ' L<', $$arg=shift, '|', $$arg, '>';" \
-e "print '=over 4';" \
-e "while (defined($$key = shift) and defined($$val = shift)) { print '=item *';print 'C<', \"$$key: $$val\", '>'; }" \
-e "print '=back';"
'.$self->{NOECHO}.'$(NOOP)
';
- push @m, qq{
-config :: Version_check
- $self->{NOECHO}\$(NOOP)
-
-} unless $self->{PARENT} or ($self->{PERL_SRC} && $self->{INSTALLDIRS} eq "perl") or $self->{NO_VC};
-
push @m, $self->dir_target(qw[$(INST_AUTODIR) $(INST_LIBDIR) $(INST_ARCHAUTODIR)]);
if (%{$self->{HTMLLIBPODS}}) {