diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 1997-11-28 22:39:39 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 1997-11-28 22:39:39 +0000 |
commit | 5b0d9cbecfd90628c0e955ee142f05f9b60bcf43 (patch) | |
tree | af50799266dd7553b6090aa7116baf1118b5c659 /lib | |
parent | 04dc04aa73cc58d998c1f2e8d4c3f8576eee7e49 (diff) | |
download | perl-5b0d9cbecfd90628c0e955ee142f05f9b60bcf43.tar.gz |
Builds completely with Mingw32, dynamic loaded extensions
don't work yet - suspect __declspec() non-implemented issues.
p4raw-id: //depot/ansiperl@329
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ExtUtils/Command.pm | 3 | ||||
-rw-r--r-- | lib/ExtUtils/MM_Win32.pm | 37 | ||||
-rw-r--r-- | lib/ExtUtils/Mksymlists.pm | 8 |
3 files changed, 34 insertions, 14 deletions
diff --git a/lib/ExtUtils/Command.pm b/lib/ExtUtils/Command.pm index d37d0f3c25..2f5f1e1689 100644 --- a/lib/ExtUtils/Command.pm +++ b/lib/ExtUtils/Command.pm @@ -107,11 +107,13 @@ Makes files exist, with current timestamp sub touch { expand_wildcards(); + my $t = time; while (@ARGV) { my $file = shift(@ARGV); open(FILE,">>$file") || die "Cannot write $file:$!"; close(FILE); + utime($t,$t,$file); } } @@ -187,6 +189,7 @@ sub test_f exit !-f shift(@ARGV); } + 1; __END__ diff --git a/lib/ExtUtils/MM_Win32.pm b/lib/ExtUtils/MM_Win32.pm index 3545f2c5a4..778710cabc 100644 --- a/lib/ExtUtils/MM_Win32.pm +++ b/lib/ExtUtils/MM_Win32.pm @@ -30,6 +30,7 @@ $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; @@ -153,13 +154,20 @@ sub init_others $self->{'TEST_F'} = '$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e test_f'; $self->{'LD'} = $Config{'ld'} || 'link'; $self->{'AR'} = $Config{'ar'} || 'lib'; - $self->{'LDLOADLIBS'} - ||= ( $BORLAND - ? 'import32.lib cw32mti.lib ' - : 'msvcrt.lib oldnames.lib kernel32.lib comdlg32.lib winspool.lib gdi32.lib ' - .'advapi32.lib user32.lib shell32.lib netapi32.lib ole32.lib ' - .'oleaut32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib ' - ) . ' odbc32.lib odbccp32.lib'; + if ($GCC) + { + $self->{'LDLOADLIBS'} ||= ' '; + } + else + { + $self->{'LDLOADLIBS'} + ||= ( $BORLAND + ? 'import32.lib cw32mti.lib ' + : 'msvcrt.lib oldnames.lib kernel32.lib comdlg32.lib winspool.lib gdi32.lib ' + .'advapi32.lib user32.lib shell32.lib netapi32.lib ole32.lib ' + .'oleaut32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib ' + ) . ' odbc32.lib odbccp32.lib'; + } $self->{'DEV_NULL'} = '> NUL'; # $self->{'NOECHO'} = ''; # till we have it working } @@ -415,11 +423,17 @@ INST_DYNAMIC_DEP = '.$inst_dynamic_dep.' $(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)\.exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP) '); - - push(@m, $BORLAND ? -q{ $(LD) $(LDDLFLAGS) $(OTHERLDFLAGS) }.$ldfrom.q{,$@,,$(PERL_ARCHIVE:s,/,\,) $(LDLOADLIBS:s,/,\,) $(MYEXTLIB:s,/,\,),$(EXPORT_LIST:s,/,\,),$(RESFILES)} : -q{ $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)} + if ($GCC) { + push(@m, + q{ $(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 }); + } else { + push(@m, $BORLAND ? + q{ $(LD) $(LDDLFLAGS) $(OTHERLDFLAGS) }.$ldfrom.q{,$@,,$(PERL_ARCHIVE:s,/,\,) $(LDLOADLIBS:s,/,\,) $(MYEXTLIB:s,/,\,),$(EXPORT_LIST:s,/,\,),$(RESFILES)} : + q{ $(LD) -out:$@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) -def:$(EXPORT_LIST)} ); + } push @m, ' $(CHMOD) 755 $@ '; @@ -782,3 +796,4 @@ __END__ =cut + diff --git a/lib/ExtUtils/Mksymlists.pm b/lib/ExtUtils/Mksymlists.pm index 350136455f..6bd49f2b73 100644 --- a/lib/ExtUtils/Mksymlists.pm +++ b/lib/ExtUtils/Mksymlists.pm @@ -107,9 +107,11 @@ sub _write_win32 { open(DEF,">$data->{FILE}.def") or croak("Can't create $data->{FILE}.def: $!\n"); # put library name in quotes (it could be a keyword, like 'Alias') - print DEF "LIBRARY \"$data->{DLBASE}\"\n"; - print DEF "CODE LOADONCALL\n"; - print DEF "DATA LOADONCALL NONSHARED MULTIPLE\n"; + if ($Config::Config{'cc'} !~ /^gcc/i) { + print DEF "LIBRARY \"$data->{DLBASE}\"\n"; + print DEF "CODE LOADONCALL\n"; + print DEF "DATA LOADONCALL NONSHARED MULTIPLE\n"; + } print DEF "EXPORTS\n "; my @syms; # Export public symbols both with and without underscores to |