Mail Archives: cygwin/2003/04/05/09:34:01
Sorry - my original reply went to Gerrit only - having read on the list that
it should be going to the group, I am sending this to the group ...
Gerrit,
Thanks for the email.
I have been using CYGWIN for about 3/4 years now, both at home and at work,
and I needed to get this item to work using cygwin perl. Now it does.
>> It was reported that Tk800.024 builds without patching it or with
>> minimal tweaks like the one you need to apply to get it compiled
>> after updating 023 w/ patch to 024.
The libraries compile (except for the warning below), but one of the test
programs failed to link due to the undefined reference to
`_win32_get_osfhandle' issue in Tk800.024-1/Event/Event.xs. I found the
answer on how to fix that in
http://sources.redhat.com/ml/cygwin/2002-09/msg00752.html.
To build I execute the command "perl Makefile.PL && make && make test &&
make install". Hence my reason for "patching" the source.
My purpose in sending the email was to ensure that nobody else had to
"re-invent the wheel". Maybe you could try this patch out, and then release
it for the cygwin community.
Since emailing the group, I have fixed the below problem:
/usr/include/limits.h:143:1: warning: this is the location of the previous
definition
gcc -c -I.. -I../pTk/mTk/xlib -I. -Ibitmaps -I../pTk/mTk/xlib -DPERL_USE_SA
FE_PUTENV -fno-strict-aliasing -DUSEIMPORTLIB -O2 -DVERSION=\"800.024\" -D
XS_VERSION=\"800.024\"
"-I/usr/lib/perl5/5.8.0/cygwin-multi-64int/CORE" -D__WIN32__ -D_WIN32 -DWIN
32 -Wall -Wno-implicit-int -Wno-comment -Wno-unused -D__USE_FIXED_PROTOTYPES
__ imgGIF.c
In file included from tkPort.h:28,
from tk.h:71,
from imgGIF.c:35:
tkWinPort.h:54:1: warning: "OPEN_MAX" redefined
In file included from
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/limits.h:132,
from
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/syslimits.h:7,
from
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/include/limits.h:11,
from tkWinPort.h:31,
from tkPort.h:28,
from tk.h:71,
from imgGIF.c:35:
Hence my current (complete) patch is (which is largely based on your
original patch):
<Start_Of_Patch>
diff -r -u Tk800.024/Event/Event.xs Tk800.024-1/Event/Event.xs
--- Tk800.024/Event/Event.xs 2002-01-07 03:35:44.000000000 -0600
+++ Tk800.024-1/Event/Event.xs 2003-04-04 13:49:42.000000000 -0600
@@ -4,6 +4,17 @@
modify it under the same terms as Perl itself.
*/
+/*
+ * Fix required to fix: undefined reference to `_win32_get_osfhandle' issue
as directed in:
+ *
+ * http://sources.redhat.com/ml/cygwin/2002-09/msg00752.html
+ *
+ */
+#ifdef __CYGWIN__
+# define win32_get_osfhandle _get_osfhandle
+# define win32_open_osfhandle _open_osfhandle
+#endif
+
#include <EXTERN.h>
#include <perl.h>
#include <XSUB.h>
diff -r -u Tk800.024/Makefile.PL Tk800.024-1/Makefile.PL
--- Tk800.024/Makefile.PL 2002-03-05 08:00:43.000000000 -0600
+++ Tk800.024-1/Makefile.PL 2003-04-04 13:49:42.000000000 -0600
@@ -154,7 +154,7 @@
}
sub MY::postamble {
- '
+ my $str = '
html : subdirs manifypods
@cd pod && $(MAKE) html $(PASTHRU)
@@ -184,6 +184,8 @@
$(MAKE) manifest
';
+ $str =~ s/DEFINE=.*// if($^O eq 'cygwin');
+ $str;
}
diff -r -u Tk800.024/README.cygwin Tk800.024-1/README.cygwin
--- Tk800.024/README.cygwin 2000-09-08 04:27:27.000000000 -0500
+++ Tk800.024-1/README.cygwin 2003-04-04 13:49:42.000000000 -0600
@@ -90,7 +90,7 @@
(sometimes $^O eq 'MSWin32' is used instead of $Tk::platform
eq 'MSWin32' assuming they are equivalent and vice versa)
+ #define distinctions
- _WIN32 defined by gcc, if X11 need to undef
+ _WIN32 win_arch MSWin32
__WIN32__ win_arch MSWin32, also defined in pTk/Lang.h
WIN32 from #include <windows.h>
when precedes #include "perl.h" then need
@@ -107,7 +107,7 @@
README.cygwin MANIFEST
* documentation
- Makefile.PL Tk/MMutil.pm pTk/Makefile.PL
+ Makefile.PL Tk/MMutil.pm pTk/Makefile.PL myConfig
* make stuff
pTk/mTk/win/tkWinX.c
@@ -149,6 +149,6 @@
+ Fix gcc warnings, mostly in pTk win32 flavor?
+ Test with cygwin-xfree X Server?
-Thu Aug 31 12:54:09 BST 2000
+Sun Jun 10 21:34:30 PST 2001
Eric Fifer
-efifer AT dircon DOT co DOT uk
+egf7 AT columbia DOT edu
diff -r -u Tk800.024/Tk/MMutil.pm Tk800.024-1/Tk/MMutil.pm
--- Tk800.024/Tk/MMutil.pm 2002-03-05 08:27:40.000000000 -0600
+++ Tk800.024-1/Tk/MMutil.pm 2003-04-04 13:49:42.000000000 -0600
@@ -238,13 +238,10 @@
push(@def,qw(-D__CYGWIN__));
if ($win_arch eq 'MSWin32')
{
- push(@def,qw(-D__WIN32__)) unless $self->{'DEFINE'} =~
/-D__WIN32__/;
+ push(@def,qw(-D__WIN32__ -D_WIN32))
+ unless $self->{'DEFINE'} =~ /-D__WIN32__/;
push(@def,qw(-DWIN32)) if $self->{'NAME'} eq 'Tk::pTk';
}
- elsif ($win_arch eq 'x')
- {
- push(@def,qw(-U_WIN32));
- }
}
foreach (@inc)
{
@@ -519,16 +516,12 @@
push(@opt,'LD' => 'gcc -shared');
if ($win_arch eq 'MSWin32')
{
- my $extra = "-lcomdlg32 -lgdi32";
+ my $extra = "-L/lib/w32api -lcomdlg32 -lgdi32";
my $libs = $att{'LIBS'}->[0];
$att{'LIBS'}->[0] = "$extra $libs";
- $att{'DEFINE'} .= ' -D__WIN32__';
+ $att{'DEFINE'} .= ' -D__WIN32__ -D_WIN32';
$att{'DEFINE'} .= ' -DWIN32' if($att{'NAME'} eq 'Tk::pTk');
}
- elsif ($win_arch eq 'x')
- {
- $att{'DEFINE'} .= ' -U_WIN32';
- }
}
if (delete $att{'ptk_include'})
{
diff -r -u Tk800.024/myConfig Tk800.024-1/myConfig
--- Tk800.024/myConfig 2000-03-31 04:06:53.000000000 -0600
+++ Tk800.024-1/myConfig 2003-04-04 13:49:42.000000000 -0600
@@ -340,7 +340,7 @@
$define .= " -D__PM__";
$inc =
"-I../pTk/mTk/xlib -I../../pTk/mTk/xlib -IpTk/mTk/xlib -ImTk/os2_rc";
$xlib = ""; # No library is needed
-} elsif ($IsWin32) {
+} elsif ($IsWin32 or $^O eq 'cygwin') {
$inc = '-I$(TKDIR)/pTk/mTk/xlib';
}
diff -r -u Tk800.024/pTk/Xlib.excwin Tk800.024-1/pTk/Xlib.excwin
--- Tk800.024/pTk/Xlib.excwin 2001-07-13 05:39:41.000000000 -0500
+++ Tk800.024-1/pTk/Xlib.excwin 2003-04-04 13:49:42.000000000 -0600
@@ -38,4 +38,5 @@
XReadBitmapFile
XOpenDisplay
XLoadQueryFont
-XCreateWindow
\ No newline at end of file
+XCreateWindow
+XRectInRegion
diff -r -u Tk800.024/pTk/mTk/win/tkWinPort.h
Tk800.024-1/pTk/mTk/win/tkWinPort.h
--- Tk800.024/pTk/mTk/win/tkWinPort.h 2000-03-13 11:53:14.000000000 -0600
+++ Tk800.024-1/pTk/mTk/win/tkWinPort.h 2003-04-04 13:55:51.000000000 -0600
@@ -51,7 +51,9 @@
#define NBBY 8
-#define OPEN_MAX 32
+#ifndef __CYGWIN__
+# define OPEN_MAX 32
+#endif
/*
* The following define causes Tk to use its internal keysym hash table
<End_Of_Patch>
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -