Subject: Re: perl 5.8.6
From: Yitzchak Scott-Thoennes <[email-masked]>
To: "Gerrit P. Haase" <[email-masked]>
Cc: [email-masked]
Date: Thu, 9 Dec 2004 04:32:19 -0800

On Wed, Dec 08, 2004 at 11:30:53AM -0800, Yitzchak Scott-Thoennes wrote:
> Gerrit, I've hoped to have some time to work on Win32:: stuff on the
> perl side, but haven't gotten around to it.  For 5.8.6, could you give
> a try to including the Win32CORE module from the perl-libwin32 package
> as a static extension and the Win32 module as a dynamic extension (and
> bootstrap Win32CORE in cygwin.c)?  If it works, that would make cygwin
> have equivalent to what's in win32 perl.

Here's the Win32CORE part.  I'd really like to see the builtin Win32::
functions be available in the cygwin perl, and this seems the easiest
way to do it for just a cygwin release, but in the longer term I'm
really hoping to get the equivalent (only newer now) code in from the
regular win32 perl build shared between win32 and cygwin by the time
5.8.7 is ready.  AIUI cutoff for that will be February 1st.

This patch should apply to the perl-5.8.6 source, and the tarball has
the new files for the Win32CORE extension.  Those are taken verbatim
from the perl-libwin32 package, except that I added a "no warnings
"redefine"' to the Win32CORE.pm so those who use it don't get warnings.
I didn't make it just a no-op in case there are people sharing modules
between different versions of perl.
--- perl-5.8.6/Configure.orig	2004-12-08 22:25:52.658217600 -0800
+++ perl-5.8.6/Configure	2004-12-08 22:27:59.090017600 -0800
@@ -20006,6 +20006,7 @@
     for xxx in *; do
        case "$xxx" in
            DynaLoader|dynaload) ;;
+           Win32CORE) known_extensions="$known_extensions $1$xxx";;
            *)
            if $test -f $xxx/$xxx.xs; then
                known_extensions="$known_extensions $1$xxx";
--- perl-5.8.6/hints/cygwin.sh.orig	2004-02-22 14:07:58.000000000 -0800
+++ perl-5.8.6/hints/cygwin.sh	2004-12-08 20:52:01.891572800 -0800
@@ -57,3 +57,4 @@
 #ldflags="$ldflags -s"
 #ccdlflags="$ccdlflags -s"
 #lddlflags="$lddlflags -s"
+static_ext="$static_ext Win32CORE"
--- perl-5.8.6/cygwin/cygwin.c.orig	2002-03-20 14:58:42.000000000 -0800
+++ perl-5.8.6/cygwin/cygwin.c	2004-12-08 20:19:31.537100800 -0800
@@ -159,7 +159,14 @@
 init_os_extras(void)
 {
     char *file = __FILE__;
+    CV *cv;
     dTHX;
 
     newXS("Cwd::cwd", Cygwin_cwd, file);
+
+    if ((cv = get_cv("Win32CORE::bootstrap", 0))) {
+        dSP;
+        PUSHMARK(SP);
+        (void)call_sv((SV *)cv, G_EVAL|G_DISCARD|G_VOID);
+    }
 }
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/