Change 33792 by rgs@scipion on 2008/05/08 15:38:43
Subject: [PATCH] -Uusedl on cygwin
From: Reini Urban <rurban@x-ray.at>
Date: Mon, 05 May 2008 20:34:13 +0200
Message-ID: <481F5325.5090907@x-ray.at>
Affected files ...
... //depot/perl/ext/Win32CORE/Makefile.PL#4 edit
... //depot/perl/ext/Win32CORE/Win32CORE.c#5 edit
Differences ...
==== //depot/perl/ext/Win32CORE/Makefile.PL#4 (text) ====
Index: perl/ext/Win32CORE/Makefile.PL
--- perl/ext/Win32CORE/Makefile.PL#3~31229~ 2007-05-16 01:26:09.000000000 -0700
+++ perl/ext/Win32CORE/Makefile.PL 2008-05-08 08:38:43.000000000 -0700
@@ -4,3 +4,15 @@
'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;
+}
==== //depot/perl/ext/Win32CORE/Win32CORE.c#5 (text) ====
Index: perl/ext/Win32CORE/Win32CORE.c
--- perl/ext/Win32CORE/Win32CORE.c#4~31490~ 2007-06-28 03:11:15.000000000 -0700
+++ perl/ext/Win32CORE/Win32CORE.c 2008-05-08 08:38:43.000000000 -0700
@@ -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 @@
* should never be called though, as Win32CORE.pm doesn't use DynaLoader.
*/
}
-#ifdef __CYGWIN__
+#if defined(__CYGWIN__) && defined(USEIMPORTLIB)
__declspec(dllexport)
#endif
void
End of Patch.