summaryrefslogtreecommitdiff
path: root/ext/Win32CORE
diff options
context:
space:
mode:
authorReini Urban <rurban@x-ray.at>2008-05-05 22:34:13 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-05-08 15:38:43 +0000
commitb1d302cbe753429dce7ea0bbcc432c1242204c19 (patch)
tree75d09663b37b1dd585d16234c376ea11c23c0461 /ext/Win32CORE
parentbd1c7bd234f2a9333e663f56f79a09143b3a74b5 (diff)
downloadperl-b1d302cbe753429dce7ea0bbcc432c1242204c19.tar.gz
-Uusedl on cygwin
Message-ID: <481F5325.5090907@x-ray.at> p4raw-id: //depot/perl@33792
Diffstat (limited to 'ext/Win32CORE')
-rw-r--r--ext/Win32CORE/Makefile.PL12
-rw-r--r--ext/Win32CORE/Win32CORE.c8
2 files changed, 19 insertions, 1 deletions
diff --git a/ext/Win32CORE/Makefile.PL b/ext/Win32CORE/Makefile.PL
index 0fec3061be..77c1f327af 100644
--- a/ext/Win32CORE/Makefile.PL
+++ b/ext/Win32CORE/Makefile.PL
@@ -4,3 +4,15 @@ WriteMakefile(
'NAME' => 'Win32CORE',
'VERSION_FROM' => 'Win32CORE.pm',
);
+
+# undef USEIMPORTLIB for static compilation
+sub MY::cflags {
+ package MY; # so that "SUPER" works right
+ my ($self, $libperl)=@_;
+ return '' unless $self->needs_linking();
+ my $base = $self->SUPER::cflags($libperl);
+ if ($self->{LINKTYPE} eq 'static') {
+ $base =~ s/CCFLAGS =(.*)$/CCFLAGS =\1 -UUSEIMPORTLIB /m;
+ }
+ return $base;
+}
diff --git a/ext/Win32CORE/Win32CORE.c b/ext/Win32CORE/Win32CORE.c
index 7769c7464d..9863b5b51a 100644
--- a/ext/Win32CORE/Win32CORE.c
+++ b/ext/Win32CORE/Win32CORE.c
@@ -10,7 +10,13 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+#if defined(__CYGWIN__) && !defined(USEIMPORTLIB)
+ #undef WIN32
+#endif
#include "EXTERN.h"
+#if defined(__CYGWIN__) && !defined(USEIMPORTLIB)
+ #define EXTCONST extern const
+#endif
#include "perl.h"
#include "XSUB.h"
@@ -62,7 +68,7 @@ XS(boot_Win32CORE)
* should never be called though, as Win32CORE.pm doesn't use DynaLoader.
*/
}
-#ifdef __CYGWIN__
+#if defined(__CYGWIN__) && defined(USEIMPORTLIB)
__declspec(dllexport)
#endif
void