summaryrefslogtreecommitdiff
path: root/utils/perlcc.PL
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-09-24 16:09:23 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-09-24 16:09:23 +0000
commitb6fbb8a80bb346d2cf570d95f2cd4a86144bf596 (patch)
tree68196aea40bac679b08afb78989a516815ac67d3 /utils/perlcc.PL
parent33c0e3ec3c9b4103fd0146ace1e9048f01c2013d (diff)
downloadperl-b6fbb8a80bb346d2cf570d95f2cd4a86144bf596.tar.gz
support cygwin and other platforms that link to import libraries
rather than directly with shared libraries (from a suggestion by Lucian Cionca <Lucian.Cionca@algoritma.ro>) p4raw-id: //depot/perl@4224
Diffstat (limited to 'utils/perlcc.PL')
-rw-r--r--utils/perlcc.PL7
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/perlcc.PL b/utils/perlcc.PL
index ad2543afb3..a585580be0 100644
--- a/utils/perlcc.PL
+++ b/utils/perlcc.PL
@@ -375,7 +375,9 @@ sub _ccharness
my $libs = _getSharedObjects($sourceprog);
- my $cccmd = "$Config{cc} $Config{ccflags} $optimize $incdir "
+ my $ccflags = $Config{ccflags};
+ $ccflags .= ' -DUSEIMPORTLIB' if $Config{osname} =~ /cygwin/i;
+ my $cccmd = "$Config{cc} $ccflags $optimize $incdir "
."@args $dynaloader $linkargs @$libs";
_print ("$cccmd\n", 36);
@@ -467,7 +469,8 @@ sub _lookforAuto
my ($relabs, $relshared);
my ($prefix);
my $return;
- my $sharedextension=$^O eq 'MSWin32' ? '.lib':$Config{so};
+ my $sharedextension = $^O =~ /MSWin32|cygwin|os2/i
+ ? $Config{_a} : ".$Config{so}";
($prefix = $file) =~ s"(.*)\.pm"$1";
my ($tmp, $modname) = ($prefix =~ m"(?:(.*)[\\/]){0,1}(.*)"s);