Mail Archives: cygwin/2001/04/17/18:17:32
------_=_NextPart_000_01C0C78C.2EA4E522
Content-Type: text/plain;
charset="iso-8859-1"
There are actually two seperate submissions that have been issued as patches
to the Tk800.022 distribution to enable it's operation with a perl built for
cygwin.
The First submission Tk.cygwin.patch found in the archive:
http://sources.redhat.com/ml/cygwin/2000-08/msg01201.html
The Second submission Tk.patch2 to be applied in addition to the first
patch:
http://sources.redhat.com/ml/cygwin/2001-01/msg00254.html
For prosperity's sake I have attached a combined patch that can be applied
*once* only *without* other patches.
After the patch is applied, further details about the build will be
contained within the README.cygwin file in the Tk800.022 distribtion
directory.
Common Build Recipe
================
Unpack the current distribution into a empty directory:
tar zxvf Tk800.022.tar.gz \
cd Tk800.022 \
patch -p1<../pTk.patch \
perl Makefile.PL \
make \
make test \
make install
Regards,
Neil
> -----Original Message-----
> From: Paul A. Chernoch [mailto:paul DOT chernoch AT zeborg DOT com]
> Sent: Tuesday, April 17, 2001 5:36 PM
> To: Neil Lunn; cygwin AT cygwin DOT com
> Subject: RE: Build of Perl Tk Module fails with Cygwin
>
>
> I tried the patch and get an error when I test for lack of
> some header files:
>
> gcc -c -I.. -I. -Ibitmaps -DPERL_USE_SAFE_PUTENV -DHAS_SBRK_PROTO
> -fno-strict-aliasing -DUSEIMPORT
> LIB -O2 -DVERSION=\"800.022\"
> -DXS_VERSION=\"800.022\" -I/usr/lib/perl5/5.6.1/cygwin/CORE -D__WIN
> 32__ -DWIN32 -Wall -Wno-implicit-int -Wno-comment -Wno-unused
> -D__USE_FIXED_PROTOTYPES__ ClientWin.c
>
> ClientWin.c:30: X11/Xlib.h: No such file or directory
> ClientWin.c:31: X11/Xatom.h: No such file or directory
> make[1]: *** [ClientWin.o] Error 1
> make[1]: Leaving directory `/.cpan/build/Tk800.022/pTk'
> make: *** [pTk/libpTk.a] Error 2
>
> Ought I need these header files for a Win32 Tk build? If so,
> where can I
> get them?
>
> - Paul
> .........
>
> At 02:27 PM 4/17/2001 +1000, you wrote:
> >I'd normally say "search the archives" but this doesn't seem
> to be getting a
> >hit for "Tk" right now.
> >
> >Anyway, follow the links in this message:
> >
> >http://sources.redhat.com/ml/cygwin/2001-01/msg00254.html
> >
> >Neil Lunn
> >
> > > -----Original Message-----
> > > From: Paul A. Chernoch [mailto:paul DOT chernoch AT zeborg DOT com]
> > > Sent: Tuesday, April 17, 2001 2:07 PM
> > > To: cygwin AT cygwin DOT com
> > > Subject: Build of Perl Tk Module fails with Cygwin
> > >
> > >
> > > I am trying to build the Tk Perl module for Cygwin. I can
> > > find no special
> > > Cygwin readme in the release, so expected clear sailing, but
> > > instead was
> > > confronted with these messages from the CPAN module:
> > >
> > > CPAN.pm: Going to build N/NI/NI-S/Tk402.004.tar.gz
> > >
> > > /usr/bin/perl is installed in /usr/lib/perl5/5.6.1/cygwin okay
> > > Test Compiling config/signedchar.c
> > > Test Compiling config/Ksprintf.c
> > > Test Compiling config/tod.c
> > > Test Compiling -DTIMEOFDAY_TZ config/tod.c
> > > TZ gettimeofday()
> > > Cannot find xmkmf
> > > Cannot find -lX11 anywhere at ./myConfig line 284.
> > > Compilation failed in require at Makefile.PL line 12.
> > > BEGIN failed--compilation aborted at Makefile.PL line 14.
> > >
> > > I tried the module by itself as well as in Bundle::Tk. That
> > > "-X11" switch
> > > sounds like X-Windows to me; do I need an entire X-Windows
> > > installation to
> > > use this? Or can it piggy back on Windows like my Activestate
> > > Perl Tk does?
> > > Here is hoping that someone has worked with Tk.
> > >
> > > - Paul
> > > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
> > >
> > > Paul Anton Chernoch
> > > Zeborg, Inc.
> > > 500 West Cummings Park
> > > Woburn, MA 01801
> > >
> > > t: 781.759.0105
> > > f: 781.935.5090
> > > c: 781.606.7382
> > >
> > > http://www.zeborg.com
> > > This message is a personal and confidential communication. If
> > > you are not
> > > the intended recipient, please do not read, copy, or use it,
> > > and do not
> > > disclose it to others. Please notify the sender of the
> > > delivery error by
> > > replying to this message, and then delete it from your
> > > system. Thank you.
> > >
> > > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
> > >
> > >
> > >
> > > --
> > > Want to unsubscribe from this list?
> > > Check out: http://cygwin.com/ml/#unsubscribe-simple
> > >
> >
> >_____________________________________________________________
> _____________
> >Please Note :
> >Only the intended recipient is authorised to access or use
> this e-mail. If
> >you are not the intended recipient,
> >please delete this e-mail and notify the sender immediately.
> The contents
> >of this e-mail are the writer's
> >opinion and are not necessarily endorsed by the Gunz Companies unless
> >expressly stated.
> >
> >We use virus scanning software but exclude all liability for
> viruses or
> >similar in any attachment.
>
> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>
> Paul Anton Chernoch
> Zeborg, Inc.
> 500 West Cummings Park
> Woburn, MA 01801
>
> t: 781.759.0105
> f: 781.935.5090
> c: 781.606.7382
>
> http://www.zeborg.com
> This message is a personal and confidential communication. If
> you are not
> the intended recipient, please do not read, copy, or use it,
> and do not
> disclose it to others. Please notify the sender of the
> delivery error by
> replying to this message, and then delete it from your
> system. Thank you.
>
> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
>
>
>
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple
>
__________________________________________________________________________
Please Note :
Only the intended recipient is authorised to access or use this e-mail. If
you are not the intended recipient,
please delete this e-mail and notify the sender immediately. The contents
of this e-mail are the writer's
opinion and are not necessarily endorsed by the Gunz Companies unless
expressly stated.
We use virus scanning software but exclude all liability for viruses or
similar in any attachment.
------_=_NextPart_000_01C0C78C.2EA4E522
Content-Type: application/octet-stream;
name="pTk.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="pTk.patch"
diff -Naur Tk800.022.orig/DragDrop/Win32Site/Win32Site.xs =
Tk800.022/DragDrop/Win32Site/Win32Site.xs=0A=
--- Tk800.022.orig/DragDrop/Win32Site/Win32Site.xs Wed Jul 28 05:20:04 =
1999=0A=
+++ Tk800.022/DragDrop/Win32Site/Win32Site.xs Wed Apr 18 08:43:36 =
2001=0A=
@@ -3,11 +3,14 @@=0A=
This program is free software; you can redistribute it and/or=0A=
modify it under the same terms as Perl itself.=0A=
*/=0A=
-#ifndef __GNUC__=0A=
+#if !defined(__GNUC__) || defined(__CYGWIN__)=0A=
#include <windows.h>=0A=
#include <shellapi.h>=0A=
#endif=0A=
=0A=
+#ifdef __CYGWIN__=0A=
+# undef WIN32=0A=
+#endif=0A=
#include <EXTERN.h>=0A=
#include <perl.h>=0A=
#include <XSUB.h>=0A=
diff -Naur Tk800.022.orig/DragDrop/site_test =
Tk800.022/DragDrop/site_test=0A=
--- Tk800.022.orig/DragDrop/site_test Sun Aug 22 07:03:26 1999=0A=
+++ Tk800.022/DragDrop/site_test Wed Apr 18 08:43:36 2001=0A=
@@ -3,7 +3,11 @@=0A=
use strict;=0A=
use Tk::DropSite;=0A=
use vars qw($kind $STRING $FILE_NAME); =0A=
-BEGIN { $kind =3D ($^O eq 'MSWin32') ? ['Win32'] : =
['Sun','XDND','KDE'] }=0A=
+BEGIN=0A=
+{=0A=
+ $kind =3D ($^O eq 'MSWin32' or ($^O eq 'cygwin' and $Tk::platform eq =
'MSWin32'))?=0A=
+ ['Win32'] : ['Sun','XDND','KDE']=0A=
+}=0A=
use Tk::DropSite @$kind;=0A=
use Tk::DragDrop @$kind;=0A=
use Tk::Menubar; =0A=
diff -Naur Tk800.022.orig/IO/IO.xs Tk800.022/IO/IO.xs=0A=
--- Tk800.022.orig/IO/IO.xs Sat Jul 31 20:45:19 1999=0A=
+++ Tk800.022/IO/IO.xs Wed Apr 18 08:43:36 2001=0A=
@@ -79,7 +79,7 @@=0A=
static int restore_mode _((PerlIO *f,int mode));=0A=
static int make_nonblock _((PerlIO *f,int *mode,int *newmode));=0A=
=0A=
-#ifdef __WIN32__=0A=
+#if defined(__WIN32__) && !defined(__CYGWIN__)=0A=
static int=0A=
make_nonblock(f,mode,newmode)=0A=
PerlIO *f;=0A=
diff -Naur Tk800.022.orig/MANIFEST Tk800.022/MANIFEST=0A=
--- Tk800.022.orig/MANIFEST Tue May 2 07:14:25 2000=0A=
+++ Tk800.022/MANIFEST Wed Apr 18 08:43:36 2001=0A=
@@ -125,6 +125,7 @@=0A=
README.linux=0A=
README.os2=0A=
README.ultrix=0A=
+README.cygwin=0A=
Scale/Makefile.PL=0A=
Scale/Scale.pm=0A=
Scale/Scale.xs=0A=
diff -Naur Tk800.022.orig/Makefile.PL Tk800.022/Makefile.PL=0A=
--- Tk800.022.orig/Makefile.PL Sat Apr 29 20:28:28 2000=0A=
+++ Tk800.022/Makefile.PL Wed Apr 18 08:43:36 2001=0A=
@@ -11,7 +11,7 @@=0A=
$win_arch =3D shift @ARGV if @ARGV and $ARGV[0] =3D~ =
/^(open32|pm|x|MSWin32)$/;=0A=
require('fix_4_os2.pl'), OS2_massage() if $^O eq 'os2';=0A=
=0A=
- $win_arch =3D ($IsWin32) ? 'MSWin32' : 'x'=0A=
+ $win_arch =3D ($IsWin32 or $^O eq 'cygwin') ? 'MSWin32' : 'x'=0A=
if not defined $win_arch; # Currently 'x', 'pm', 'open32', =
'MSWin32'=0A=
=0A=
require "./myConfig";=0A=
@@ -106,6 +106,10 @@=0A=
($Config{'cc'} =3D~ /^gcc/i) ?=0A=
'pTk\\tkres$(OBJ_EXT)' : 'pTk\\tk.res');=0A=
}=0A=
+ }=0A=
+ if ($win_arch eq 'MSWin32' and $^O eq 'cygwin')=0A=
+ {=0A=
+ push(@{$self->{'O_FILES'}}, 'pTk/tkres$(OBJ_EXT)');=0A=
}=0A=
$ret;=0A=
}=0A=
diff -Naur Tk800.022.orig/README.cygwin Tk800.022/README.cygwin=0A=
--- Tk800.022.orig/README.cygwin Thu Jan 1 10:00:00 1970=0A=
+++ Tk800.022/README.cygwin Wed Apr 18 08:43:58 2001=0A=
@@ -0,0 +1,154 @@=0A=
+=0A=
+This is a brief description of how to get the Tk module working =
with=0A=
+Perl and Cygwin.=0A=
+=0A=
+CONFIGURE/BUILD=0A=
+=0A=
+ Use native Win32 GUI calls:=0A=
+=0A=
+ perl Makefile.PL=0A=
+=0A=
+ Use X11 client libraries (and requires a X server):=0A=
+=0A=
+ Precompiled X11 client libraries can be downloaded from=0A=
+ ftp://sourceware.cygnus.com/pub/cygwin/xfree/xc-4-binaries/=0A=
+ xfree86-4.0-DLLs.tar.bz2=0A=
+ xfree86-4.0-devel.tar.bz2=0A=
+=0A=
+ NOTE: Your DISPLAY must be 127.0.0.1:0.0=0A=
+ Your PATH must include the DLL directory, =
/usr/X11R6/bin=0A=
+=0A=
+ perl Makefile.PL x=0A=
+=0A=
+ make=0A=
+=0A=
+TEST=0A=
+=0A=
+ make test=0A=
+ perl -Mblib demos/widget=0A=
+=0A=
+INSTALL=0A=
+=0A=
+ make install=0A=
+=0A=
+SIDE-BY-SIDE PORT COMPARISONS (demos/widget)=0A=
+=0A=
+ X11 (Hummingbird/Exceed X Server, V6.1)=0A=
+=0A=
+ + Motif look and feel=0A=
+ + Scroll wheel does not work with X11 (config?)=0A=
+ + Global grabs only affect X11 windows (config?)=0A=
+ + Menus, normal style=0A=
+ - Alt+x does not post menus (config?)=0A=
+ + $Tk::platform =3D> unix=0A=
+=0A=
+ Win32=0A=
+=0A=
+ + Windows look and feel=0A=
+ + Uses Win32 clipboard=0A=
+ + Help on menu bar not all the way to the right=0A=
+ + Tear-off menus placed at upper-left instead of near =
pointer=0A=
+ + Tile and Transparent, no tiled camels, third window not=0A=
+ transparent=0A=
+ + Menus, normal style=0A=
+ - File - "Error: unknown option "-label" at Tk.pm line =
217=0A=
+ + Menus, Perl/Tk style=0A=
+ - Menus do not drop as traverse with button press=0A=
+ - Alt+x does not post menus=0A=
+ + Native Win32 FileSelect dialog, FileSelect/FBox the same=0A=
+ + Native Win32 ChooseColor dialog=0A=
+ + Balls bouncing, when start restacked below widget demo =
window=0A=
+ (if bounce window not moved)=0A=
+ + Global grabs only affect current application=0A=
+ + IntelliMouse with IntelliEye (but ok with a trackball, =
setting?)=0A=
+ - Button-2 dragging/scanning does not work well=0A=
+ - Button-2 for copy/paste does not work well=0A=
+ (seems to flip into a scroll mode)=0A=
+ + $Tk::TkwinVtab, $Tk::TkwinintVtab variables=0A=
+ + $Tk::platform =3D> MSWin32=0A=
+=0A=
+ Both=0A=
+ + Tear-off menus restack parent below widget demo window=0A=
+ + Meta-backspace, Meta-d not working (Meta config?)=0A=
+ + Menus, normal and Perl/Tk style=0A=
+ - Meta+x accelerators (Control+x okay) not working =
(config?)=0A=
+=0A=
+ X11 (Cygwin) v X11 (Solaris)=0A=
+=0A=
+ No differences that I could find!=0A=
+=0A=
+ Win32 (Cygwin) v Win32 (MSWin32/ActiveState)=0A=
+=0A=
+ + Menus, normal style=0A=
+ - Accelerators Win32 bound to Control, Cygwin bound to =
Meta=0A=
+ (see demos/demos/widget_lib/menus.pl, $^O eq 'MSWin32')=0A=
+ - Win32 ^A does not work (Meta+A with X11), ^H does=0A=
+=0A=
+PORTING NOTES=0A=
+=0A=
+ + $Tk::platform is really the win_arch, where unix is x=0A=
+ (sometimes $^O eq 'MSWin32' is used instead of $Tk::platform=0A=
+ eq 'MSWin32' assuming they are equivalent and vice versa)=0A=
+ + #define distinctions=0A=
+ _WIN32 defined by gcc, if X11 need to undef=0A=
+ __WIN32__ win_arch MSWin32, also defined in =
pTk/Lang.h=0A=
+ WIN32 from #include <windows.h>=0A=
+ when precedes #include "perl.h" then =
need=0A=
+ a #undef WIN32 (otherwise tries to =
include=0A=
+ Win32 Perl things like win32.h, =
defined=0A=
+ by native Win32 port)=0A=
+ + With native Win32 GUI use Cygwin select() with /dev/windows=0A=
+ pseudo-device rather than using Win32 GetMessage() directly=0A=
+ + pTk/mTk/win/tkWinX.c, pTk/mTk/generic/tkPort.h part of core =
Tk,=0A=
+ which is ordinarily not touched by Tk Perl module? =
pTk/Tcl-pTk?=0A=
+=0A=
+FILES (with Cygwin references)=0A=
+=0A=
+ README.cygwin MANIFEST=0A=
+ * documentation=0A=
+=0A=
+ Makefile.PL Tk/MMutil.pm pTk/Makefile.PL myConfig=0A=
+ * make stuff=0A=
+=0A=
+ pTk/mTk/win/tkWinX.c=0A=
+ * GetMessage() via select() on /dev/windows and callback=0A=
+=0A=
+ Scrollbar/Scrollbar.xs tkWin32Dll.c=0A=
+ * defined(__WIN32__) && defined(__CYGWIN__)=0A=
+=0A=
+ tkGlue.c=0A=
+ * refdef XS because __declspec(dllexport) incompatible with =
static=0A=
+ * defined(__WIN32__) && defined(__CYGWIN__) and pTk/tkWin.h=0A=
+ includes <windows.h> which defines WIN32=0A=
+=0A=
+ Tk.pm=0A=
+ * set $Tk::platform with help from $Tk::Config::win_arch=0A=
+=0A=
+ DragDrop/site_test Tk/X11Font.pm t/create.t t/mwm.t=0A=
+ * $^O eq 'cygwin' and $Tk::platform eq 'MSWin32'=0A=
+=0A=
+ DragDrop/Win32Site/Win32Site.xs=0A=
+ * #undef WIN32 from <windows.h>=0A=
+=0A=
+ pTk/mTk/generic/tkPort.h=0A=
+ * resolve strcasecmp/stricmp #define mess=0A=
+=0A=
+ pTk/Lang.h=0A=
+ * some defs ordinarily from tkUnixPort.h=0A=
+=0A=
+ chnGlue.c=0A=
+ * Cygwin has O_BINARY=0A=
+=0A=
+ IO/IO.xs=0A=
+ * Cygwin has O_NONBLOCK=0A=
+=0A=
+TODO=0A=
+=0A=
+ + Any way to have X11 and native Win32 versions available=0A=
+ at the same time? Build with Xlib/Win32 emulator (see rxvt)?=0A=
+ + Fix gcc warnings, mostly in pTk win32 flavor?=0A=
+ + Test with cygwin-xfree X Server?=0A=
+=0A=
+Thu Aug 31 12:54:09 BST 2000=0A=
+Eric Fifer=0A=
+efifer AT dircon DOT co DOT uk=0A=
diff -Naur Tk800.022.orig/Scrollbar/Scrollbar.xs =
Tk800.022/Scrollbar/Scrollbar.xs=0A=
--- Tk800.022.orig/Scrollbar/Scrollbar.xs Wed Jul 28 05:20:07 1999=0A=
+++ Tk800.022/Scrollbar/Scrollbar.xs Wed Apr 18 08:43:36 2001=0A=
@@ -12,7 +12,7 @@=0A=
=0A=
#include "pTk/tkPort.h"=0A=
#include "pTk/tkInt.h"=0A=
-#ifdef WIN32=0A=
+#if defined(WIN32) || (defined(__WIN32__) && defined(__CYGWIN__))=0A=
#include "pTk/tkWin.h"=0A=
#include "pTk/tkWinInt.h"=0A=
#endif=0A=
diff -Naur Tk800.022.orig/Tk/MMutil.pm Tk800.022/Tk/MMutil.pm=0A=
--- Tk800.022.orig/Tk/MMutil.pm Fri Mar 31 06:37:15 2000=0A=
+++ Tk800.022/Tk/MMutil.pm Wed Apr 18 08:43:36 2001=0A=
@@ -222,6 +222,19 @@=0A=
my @inc =3D split(/\s+/,$self->{'INC'});=0A=
my @def =3D split(/\s+/,$self->{'DEFINE'});=0A=
push(@def,qw(-DWIN32 -D__WIN32__)) if ($IsWin32);=0A=
+ if ($^O eq 'cygwin')=0A=
+ {=0A=
+ push(@def,qw(-D__CYGWIN__));=0A=
+ if ($win_arch eq 'MSWin32')=0A=
+ {=0A=
+ push(@def,qw(-D__WIN32__)) unless $self->{'DEFINE'} =3D~ =
/-D__WIN32__/;=0A=
+ push(@def,qw(-DWIN32)) if $self->{'NAME'} eq 'Tk::pTk';=0A=
+ }=0A=
+ elsif ($win_arch eq 'x')=0A=
+ {=0A=
+ push(@def,qw(-U_WIN32));=0A=
+ }=0A=
+ }=0A=
foreach (@inc)=0A=
{=0A=
s/\$\(TKDIR\)/$tk/g;=0A=
@@ -486,6 +499,25 @@=0A=
my $extra =3D "-L$base -lcomdlg32 -lgdi32";=0A=
my $libs =3D $att{'LIBS'}->[0];=0A=
$att{'LIBS'}->[0] =3D "$extra $libs";=0A=
+ }=0A=
+ if ($^O eq 'cygwin')=0A=
+ {=0A=
+ # NOTE: use gcc -shared instead of dllwrap (ld2),=0A=
+ # dllwrap tries to resolve all symbols, even those=0A=
+ # that are brought in from libraries like libpTk.a=0A=
+ push(@opt,'LD' =3D> 'gcc -shared');=0A=
+ if ($win_arch eq 'MSWin32')=0A=
+ {=0A=
+ my $extra =3D "-lcomdlg32 -lgdi32";=0A=
+ my $libs =3D $att{'LIBS'}->[0];=0A=
+ $att{'LIBS'}->[0] =3D "$extra $libs";=0A=
+ $att{'DEFINE'} .=3D ' -D__WIN32__';=0A=
+ $att{'DEFINE'} .=3D ' -DWIN32' if($att{'NAME'} eq =
'Tk::pTk');=0A=
+ }=0A=
+ elsif ($win_arch eq 'x')=0A=
+ {=0A=
+ $att{'DEFINE'} .=3D ' -U_WIN32';=0A=
+ }=0A=
}=0A=
if (delete $att{'ptk_include'})=0A=
{=0A=
diff -Naur Tk800.022.orig/Tk/X11Font.pm Tk800.022/Tk/X11Font.pm=0A=
--- Tk800.022.orig/Tk/X11Font.pm Fri Dec 24 19:41:43 1999=0A=
+++ Tk800.022/Tk/X11Font.pm Wed Apr 18 08:43:36 2001=0A=
@@ -94,7 +94,7 @@=0A=
my $me =3D shift;=0A=
my $max =3D wantarray ? shift || 128 : 1;=0A=
=0A=
- if ($^O eq 'MSWin32')=0A=
+ if ($^O eq 'MSWin32' or ($^O eq 'cygwin' and $Tk::platform eq =
'MSWin32'))=0A=
{=0A=
my $name =3D $me->{Name};=0A=
if (!defined $name)=0A=
diff -Naur Tk800.022.orig/Tk.pm Tk800.022/Tk.pm=0A=
--- Tk800.022.orig/Tk.pm Sat Apr 29 20:36:41 2000=0A=
+++ Tk800.022/Tk.pm Wed Apr 18 08:43:36 2001=0A=
@@ -17,7 +17,18 @@=0A=
=0A=
*fileevent =3D \&Tk::Event::IO::fileevent;=0A=
=0A=
-BEGIN { $Tk::platform =3D ($^O eq 'MSWin32') ? $^O : 'unix' };=0A=
+BEGIN {=0A=
+ if($^O eq 'cygwin')=0A=
+ {=0A=
+ require Tk::Config;=0A=
+ $Tk::platform =3D $Tk::Config::win_arch;=0A=
+ $Tk::platform =3D 'unix' if $Tk::platform eq 'x';=0A=
+ }=0A=
+ else=0A=
+ {=0A=
+ $Tk::platform =3D ($^O eq 'MSWin32') ? $^O : 'unix';=0A=
+ }=0A=
+};=0A=
=0A=
$Tk::tearoff =3D 1 if ($Tk::platform eq 'unix');=0A=
=0A=
diff -Naur Tk800.022.orig/chnGlue.c Tk800.022/chnGlue.c=0A=
--- Tk800.022.orig/chnGlue.c Wed Jul 28 05:20:11 1999=0A=
+++ Tk800.022/chnGlue.c Wed Apr 18 08:43:36 2001=0A=
@@ -93,7 +93,7 @@=0A=
{=0A=
if (strcmp(newValue,"binary") =3D=3D 0)=0A=
{=0A=
-#if defined(WIN32) || defined(__EMX__)=0A=
+#if defined(WIN32) || defined(__EMX__) || defined(__CYGWIN__)=0A=
setmode(PerlIO_fileno(f), O_BINARY);=0A=
#endif=0A=
return TCL_OK;=0A=
diff -Naur Tk800.022.orig/myConfig Tk800.022/myConfig=0A=
--- Tk800.022.orig/myConfig Fri Mar 31 20:06:53 2000=0A=
+++ Tk800.022/myConfig Wed Apr 18 08:43:58 2001=0A=
@@ -340,7 +340,7 @@=0A=
$define .=3D " -D__PM__";=0A=
$inc =3D "-I../pTk/mTk/xlib -I../../pTk/mTk/xlib -IpTk/mTk/xlib =
-ImTk/os2_rc";=0A=
$xlib =3D ""; # No library is needed=0A=
-} elsif ($IsWin32) {=0A=
+} elsif ($IsWin32 or $^O eq 'cygwin') {=0A=
$inc =3D '-I$(TKDIR)/pTk/mTk/xlib';=0A=
}=0A=
=0A=
diff -Naur Tk800.022.orig/pTk/Lang.h Tk800.022/pTk/Lang.h=0A=
--- Tk800.022.orig/pTk/Lang.h Fri Apr 21 19:13:10 2000=0A=
+++ Tk800.022/pTk/Lang.h Wed Apr 18 08:43:36 2001=0A=
@@ -43,6 +43,11 @@=0A=
# define strcasecmp stricmp=0A=
#endif=0A=
=0A=
+#ifdef __CYGWIN__=0A=
+#include <sys/time.h>=0A=
+#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS)=0A=
+#endif=0A=
+=0A=
/*=0A=
* When version numbers change here, must also go into the following =
files=0A=
* and update the version numbers:=0A=
diff -Naur Tk800.022.orig/pTk/Makefile.PL Tk800.022/pTk/Makefile.PL=0A=
--- Tk800.022.orig/pTk/Makefile.PL Wed Jul 28 05:20:25 1999=0A=
+++ Tk800.022/pTk/Makefile.PL Wed Apr 18 08:43:36 2001=0A=
@@ -45,6 +45,10 @@=0A=
{=0A=
@list =3D qw(win xlib additions generic tixWin tixGeneric tclWin =
tclGeneric);=0A=
}=0A=
+ elsif ($win_arch eq 'MSWin32' and $^O eq 'cygwin')=0A=
+ {=0A=
+ @list =3D qw(win xlib additions generic tixWin tixGeneric tclUnix =
tclGeneric);=0A=
+ }=0A=
elsif ($win_arch eq 'open32')=0A=
{=0A=
@list =3D qw(open32 open32/h win xlib additions generic tixWin =
tixGeneric tclUnix tclGeneric );=0A=
@@ -145,7 +149,8 @@=0A=
$self->{PM}->{$name} =3D $self->catfile($dir,$name);=0A=
}=0A=
=0A=
- if ($Tk::MMutil::IsWin32 or $win_arch eq 'open32' or $win_arch eq =
'pm')=0A=
+ if ($Tk::MMutil::IsWin32 or $win_arch eq 'open32' or $win_arch eq =
'pm' or=0A=
+ ($win_arch eq 'MSWin32' and $^O eq 'cygwin'))=0A=
{my $ddir =3D $self->catdir('$(INST_ARCHLIBDIR)','X11');=0A=
my $sdir =3D $self->catdir('mTk','xlib','X11');=0A=
push(@{$self->{'dir_targets'}},$ddir);=0A=
@@ -228,7 +233,7 @@=0A=
$dep .=3D "config :: " . join(" =
\\\n\t",map($self->catfile($_,".exists"),@{$self->{'dir_targets'}})) =
.=0A=
"\n\t".$self->{NOECHO}."\$(NOOP)\n";=0A=
=0A=
-if ($Tk::MMutil::IsWin32)=0A=
+if ($Tk::MMutil::IsWin32 or ($win_arch eq 'MSWin32' and $^O eq =
'cygwin'))=0A=
{=0A=
my $cc =3D $Config{'cc'};=0A=
my $file =3D 'tk.res';=0A=
diff -Naur Tk800.022.orig/pTk/mTk/generic/tkPort.h =
Tk800.022/pTk/mTk/generic/tkPort.h=0A=
--- Tk800.022.orig/pTk/mTk/generic/tkPort.h Wed Jul 28 05:20:32 1999=0A=
+++ Tk800.022/pTk/mTk/generic/tkPort.h Wed Apr 18 08:43:37 2001=0A=
@@ -29,6 +29,9 @@=0A=
# ifndef strcasecmp=0A=
# define strcasecmp(a,b) stricmp(a,b)=0A=
# endif=0A=
+# ifdef __CYGWIN__=0A=
+# undef strcasecmp=0A=
+# endif=0A=
#else=0A=
# if defined(MAC_TCL)=0A=
# include "tkMacPort.h"=0A=
diff -Naur Tk800.022.orig/pTk/mTk/win/tkWinX.c =
Tk800.022/pTk/mTk/win/tkWinX.c=0A=
--- Tk800.022.orig/pTk/mTk/win/tkWinX.c Tue Mar 28 00:07:36 2000=0A=
+++ Tk800.022/pTk/mTk/win/tkWinX.c Wed Apr 18 08:43:37 2001=0A=
@@ -53,6 +53,10 @@=0A=
* Forward declarations of procedures used in this file.=0A=
*/=0A=
=0A=
+#ifdef __CYGWIN__=0A=
+static void DisplayFileProc _ANSI_ARGS_((ClientData clientData,=0A=
+ int flags));=0A=
+#endif=0A=
static void GenerateXEvent _ANSI_ARGS_((HWND hwnd, UINT message,=0A=
WPARAM wParam, LPARAM lParam));=0A=
static unsigned int GetState _ANSI_ARGS_((UINT message, WPARAM =
wParam,=0A=
@@ -384,6 +388,12 @@=0A=
AllocNone);=0A=
winDisplay =3D (TkDisplay *) ckalloc(sizeof(TkDisplay));=0A=
winDisplay->display =3D display;=0A=
+#ifdef __CYGWIN__=0A=
+ if((ConnectionNumber(display) =3D open("/dev/windows", O_RDONLY)) =
< 0)=0A=
+ return NULL;=0A=
+ Tcl_CreateFileHandler(ConnectionNumber(display), TCL_READABLE,=0A=
+ DisplayFileProc, (ClientData) winDisplay);=0A=
+#endif=0A=
return winDisplay;=0A=
}=0A=
=0C=0A=
@@ -447,9 +457,63 @@=0A=
}=0A=
ckfree((char *) display->screens);=0A=
}=0A=
+#ifdef __CYGWIN__=0A=
+ if (dispPtr->display !=3D 0) {=0A=
+ Tcl_DeleteFileHandler(ConnectionNumber(dispPtr->display));=0A=
+ close(ConnectionNumber(dispPtr->display));=0A=
+ }=0A=
+#endif=0A=
ckfree((char *) display);=0A=
ckfree((char *) dispPtr);=0A=
}=0A=
+=0C=0A=
+#ifdef __CYGWIN__=0A=
+/*=0A=
+ =
*----------------------------------------------------------------------=0A=
+ *=0A=
+ * DisplayFileProc --=0A=
+ *=0A=
+ * This procedure implements the file handler for the /dev/windows=0A=
+ * connection.=0A=
+ *=0A=
+ * Results:=0A=
+ * None.=0A=
+ *=0A=
+ * Side effects:=0A=
+ * Process Win32 message queue. Compare to tclWin/tclWinNotify.c=0A=
+ * Tcl_WaitForEvent() event loop.=0A=
+ *=0A=
+ =
*----------------------------------------------------------------------=0A=
+ */=0A=
+=0A=
+static void=0A=
+DisplayFileProc(clientData, flags)=0A=
+ ClientData clientData; /* The display pointer. */=0A=
+ int flags; /* Should be TCL_READABLE. */=0A=
+{=0A=
+ TkDisplay *dispPtr =3D (TkDisplay *) clientData;=0A=
+ Display *display =3D dispPtr->display;=0A=
+ MSG msg;=0A=
+ int n;=0A=
+=0A=
+ /* NOTE: read returns the result of GetMessage */=0A=
+ /* *not* the number of bytes read */=0A=
+ n =3D read(ConnectionNumber(display), &msg, sizeof(MSG));=0A=
+ if(n =3D=3D 0) {=0A=
+ /*=0A=
+ * The application is exiting, so repost the quit message=0A=
+ * and start unwinding.=0A=
+ */=0A=
+=0A=
+ PostQuitMessage(msg.wParam);=0A=
+ return;=0A=
+ }=0A=
+ if(n > 0) {=0A=
+ TranslateMessage(&msg);=0A=
+ DispatchMessage(&msg);=0A=
+ }=0A=
+}=0A=
+#endif=0A=
=0C=0A=
/*=0A=
=
*----------------------------------------------------------------------=0A=
diff -Naur Tk800.022.orig/t/create.t Tk800.022/t/create.t=0A=
--- Tk800.022.orig/t/create.t Sun Mar 26 22:25:56 2000=0A=
+++ Tk800.022/t/create.t Wed Apr 18 08:43:37 2001=0A=
@@ -61,7 +61,10 @@=0A=
)=0A=
);=0A=
=0A=
- @class =3D grep(!/InputO/,@class) if ($^O eq 'MSWin32');=0A=
+ require Tk if ($^O eq 'cygwin');=0A=
+ @class =3D grep(!/InputO/,@class) if ($^O eq 'MSWin32' or=0A=
+ ($^O eq 'cygwin' and defined($Tk::platform)=0A=
+ and $Tk::platform eq 'MSWin32'));=0A=
=0A=
plan test =3D> (13*@class+3);=0A=
=0A=
diff -Naur Tk800.022.orig/t/mwm.t Tk800.022/t/mwm.t=0A=
--- Tk800.022.orig/t/mwm.t Wed Jul 28 05:21:22 1999=0A=
+++ Tk800.022/t/mwm.t Wed Apr 18 08:43:37 2001=0A=
@@ -1,7 +1,8 @@=0A=
BEGIN =0A=
{ =0A=
$^W =3D 1; $| =3D 1; =0A=
- if ($^O eq 'MSWin32')=0A=
+ require Tk if ($^O eq 'cygwin');=0A=
+ if ($^O eq 'MSWin32' or ($^O eq 'cygwin' and $Tk::platform eq =
'MSWin32'))=0A=
{=0A=
print "1..0\n";=0A=
exit;=0A=
diff -Naur Tk800.022.orig/tkGlue.c Tk800.022/tkGlue.c=0A=
--- Tk800.022.orig/tkGlue.c Fri Apr 21 19:13:10 2000=0A=
+++ Tk800.022/tkGlue.c Wed Apr 18 08:43:37 2001=0A=
@@ -8,6 +8,10 @@=0A=
#include <perl.h>=0A=
#include <XSUB.h>=0A=
#include <patchlevel.h>=0A=
+#ifdef __CYGWIN__=0A=
+# undef XS=0A=
+# define XS(name) void name(pTHXo_ CV* cv)=0A=
+#endif=0A=
=0A=
#define Tkgv_fullname(x,y,z) gv_fullname3(x,y,z)=0A=
=0A=
@@ -26,7 +30,7 @@=0A=
#include "pTk/Xlib_f.h"=0A=
#include "pTk/tkEvent.h"=0A=
#include "pTk/tkEvent.m"=0A=
-#ifdef WIN32=0A=
+#if defined(WIN32) || (defined(__WIN32__) && defined(__CYGWIN__))=0A=
#include "pTk/tkWin.h"=0A=
#include "pTk/tkWinInt.h"=0A=
#include "pTk/tkWin_f.h"=0A=
@@ -5123,7 +5127,7 @@=0A=
Lang_OSHandle(fd)=0A=
int fd;=0A=
{=0A=
-#ifdef WIN32=0A=
+#if defined(WIN32) && !defined(__CYGWIN__)=0A=
return win32_get_osfhandle(fd);=0A=
#else=0A=
return fd;=0A=
diff -Naur Tk800.022.orig/tkWin32Dll.c Tk800.022/tkWin32Dll.c=0A=
--- Tk800.022.orig/tkWin32Dll.c Wed Jul 28 05:21:23 1999=0A=
+++ Tk800.022/tkWin32Dll.c Wed Apr 18 08:43:37 2001=0A=
@@ -13,7 +13,7 @@=0A=
=0A=
#include "pTk/tkPort.h"=0A=
=0A=
-#ifdef WIN32=0A=
+#if defined(WIN32) || (defined(__WIN32__) && defined(__CYGWIN__))=0A=
=0A=
#include "pTk/tkWinInt.h"=0A=
=0A=
------_=_NextPart_000_01C0C78C.2EA4E522
Content-Type: text/plain; charset=us-ascii
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
------_=_NextPart_000_01C0C78C.2EA4E522--
- Raw text -