Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 31792
Status: resolved
Worked: 2 hours (120 min)
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: LGODDARD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: 804.028 Won't Comple in cygwin

Message body is not shown because it is too large.

Message body is not shown because it is too large.

Attached patch finally fixes cygwin breakage for Tk-804.027 and Tk-804.028. 2008-02-17 Reini Urban <rurban@x-ray.at> * tkPort.h: cygwin does not define WIN32, only within pTk. So define it here. * pTk/mTk/tclUnix/tclUnix{Event,Notfy,Time}.c: They do not include tkUnixPort.h, so some declarations are missing under cygwin only. * Tk/MMutil.pm: -limm32 and -lcomctl32 are missing -- Reini Urban
difforig Tk-804.028 2008-02-17 Reini Urban <rurban@x-ray.at> * tkPort.h: cygwin does not define WIN32, only within pTk. So define it here. * pTk/mTk/tclUnix/tclUnix{Event,Notfy,Time}.c: They do not include tkUnixPort.h, so some declarations are missing under cygwin only. * Tk/MMutil.pm: -limm32 and -lcomctl32 are missing diff -ub Tk-804.028/Tk/MMutil.pm.orig --- Tk-804.028/Tk/MMutil.pm.orig 2007-05-05 18:37:55.000000000 +0000 +++ Tk-804.028/Tk/MMutil.pm 2008-02-17 19:52:16.843750000 +0000 @@ -550,7 +550,7 @@ { my $base = $Config{'libpth'}; $base =~ s#lib$#i386-mingw32/lib#; - my $extra = "-L$base -lcomdlg32 -lgdi32"; + my $extra = "-L$base -limm32 -lcomctl32 -lcomdlg32 -lgdi32"; my $libs = $att{'LIBS'}->[0]; $att{'LIBS'}->[0] = "$extra $libs"; } @@ -562,7 +562,7 @@ push(@opt,'LD' => 'gcc -shared'); if ($win_arch eq 'MSWin32') { - my $extra = "-L/lib/w32api -lcomdlg32 -lgdi32"; + my $extra = "-L/lib/w32api -limm32 -lcomctl32 -lcomdlg32 -lgdi32"; my $libs = $att{'LIBS'}->[0]; $att{'LIBS'}->[0] = "$extra $libs"; $att{'DEFINE'} .= ' -D__WIN32__ -D_WIN32 -DWINARCH_MSWIN32'; diff -ub Tk-804.028/pTk/mTk/tclUnix/tclUnixEvent.c.orig --- Tk-804.028/pTk/mTk/tclUnix/tclUnixEvent.c.orig 2007-05-05 18:39:41.000000000 +0000 +++ Tk-804.028/pTk/mTk/tclUnix/tclUnixEvent.c 2008-02-17 19:29:54.031250000 +0000 @@ -20,6 +20,11 @@ #include "Lang.h" #endif #ifdef TCL_EVENT_IMPLEMENT + +#ifdef __CYGWIN__ +# include <sys/time.h> +#endif + /* *---------------------------------------------------------------------- * diff -ub Tk-804.028/pTk/mTk/tclUnix/tclUnixNotfy.c.orig --- Tk-804.028/pTk/mTk/tclUnix/tclUnixNotfy.c.orig 2007-05-05 18:39:37.000000000 +0000 +++ Tk-804.028/pTk/mTk/tclUnix/tclUnixNotfy.c 2008-02-17 19:41:04.156250000 +0000 @@ -35,6 +35,34 @@ #endif extern Tcl_NotifierProcs tclOriginalNotifier; +#ifndef MASK_SIZE +/* under Cygwin we use tclUnix but tkWin. + So bring in some "tkUnixPort.h" definitions + */ +#ifdef HAVE_SYS_SELECT_H +# include <sys/select.h> +#endif + +/* + * The following macro defines the number of fd_masks in an fd_set: + */ + +#ifndef FD_SETSIZE +# ifdef OPEN_MAX +# define FD_SETSIZE OPEN_MAX +# else +# define FD_SETSIZE 256 +# endif +#endif +#if !defined(howmany) +# define howmany(x, y) (((x)+((y)-1))/(y)) +#endif +#ifndef NFDBITS +# define NFDBITS NBBY*sizeof(fd_mask) +#endif +#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS) +#endif + /* * This structure is used to keep track of the notifier info for a * a registered file. diff -ub Tk-804.028/pTk/mTk/tclUnix/tclUnixTime.c.orig --- Tk-804.028/pTk/mTk/tclUnix/tclUnixTime.c.orig 2007-05-05 18:39:34.000000000 +0000 +++ Tk-804.028/pTk/mTk/tclUnix/tclUnixTime.c 2008-02-17 19:25:56.562500000 +0000 @@ -15,11 +15,15 @@ #include "Lang.h" #ifdef TCL_EVENT_IMPLEMENT - -#ifdef __EMX__ +#if TIME_WITH_SYS_TIME # include <sys/time.h> -#else # include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif #endif #if 0 diff -ub Tk-804.028/pTk/tkPort.h.orig --- Tk-804.028/pTk/tkPort.h.orig 2008-02-17 18:47:08.812500000 +0000 +++ Tk-804.028/pTk/tkPort.h 2008-02-17 18:49:27.281250000 +0000 @@ -24,6 +24,10 @@ #include "Lang.h" #endif +#if defined(__WIN32__) && !defined(WIN32) +#define WIN32 +#endif + #if defined(__WIN32__) || defined(_WIN32) # include "tkWinPort.h" # ifndef strcasecmp diff -ub Tk-804.028/tkGlue.h.orig --- Tk-804.028/tkGlue.h.orig 2007-05-05 18:37:45.000000000 +0000 +++ Tk-804.028/tkGlue.h 2008-02-17 18:48:07.968750000 +0000 @@ -66,14 +66,14 @@ extern SV * sv_maybe_utf8(SV *sv); extern SV * Lang_SystemEncoding(void); +#ifdef WIN32 +#include "pTk/tkWinInt.h" +#endif + #ifndef WIN32 #define HWND void * #endif EXTERN HWND SVtoHWND _ANSI_ARGS_((SV *win)); -#ifdef WIN32 -#include "pTk/tkWinInt.h" -#endif - #endif
Subject: 804.028 Won't compile on cygwin
From: RURBAN [...] cpan.org
The previous patch didn't apply cleanly, tkPort.h was in the wrong directory. Attached patch fixes that. It compiles cleanly on cygwin, but does not work ok yet. I'll try the old-style GetMessage() loop now. On Sun Feb 17 14:58:19 2008, RURBAN wrote: Show quoted text
> Attached patch finally fixes cygwin breakage for Tk-804.027 and
Tk-804.028. -- Reini Urban
difforig Tk-804.028 2008-02-17 Reini Urban <rurban@x-ray.at> * tkPort.h: cygwin does not define WIN32, only within pTk. So define it here. * pTk/mTk/tclUnix/tclUnix{Event,Notfy,Time}.c: They do not include tkUnixPort.h, so some declarations are missing under cygwin only. * Tk/MMutil.pm: -limm32 and -lcomctl32 are missing diff -ub Tk-804.028/Tk/MMutil.pm.orig --- Tk-804.028/Tk/MMutil.pm.orig 2007-05-05 18:37:55.000000000 +0000 +++ Tk-804.028/Tk/MMutil.pm 2008-02-17 19:52:16.843750000 +0000 @@ -550,7 +550,7 @@ { my $base = $Config{'libpth'}; $base =~ s#lib$#i386-mingw32/lib#; - my $extra = "-L$base -lcomdlg32 -lgdi32"; + my $extra = "-L$base -limm32 -lcomctl32 -lcomdlg32 -lgdi32"; my $libs = $att{'LIBS'}->[0]; $att{'LIBS'}->[0] = "$extra $libs"; } @@ -562,7 +562,7 @@ push(@opt,'LD' => 'gcc -shared'); if ($win_arch eq 'MSWin32') { - my $extra = "-L/lib/w32api -lcomdlg32 -lgdi32"; + my $extra = "-L/lib/w32api -limm32 -lcomctl32 -lcomdlg32 -lgdi32"; my $libs = $att{'LIBS'}->[0]; $att{'LIBS'}->[0] = "$extra $libs"; $att{'DEFINE'} .= ' -D__WIN32__ -D_WIN32 -DWINARCH_MSWIN32'; diff -ub Tk-804.028/pTk/mTk/tclUnix/tclUnixEvent.c.orig --- Tk-804.028/pTk/mTk/tclUnix/tclUnixEvent.c.orig 2007-05-05 18:39:41.000000000 +0000 +++ Tk-804.028/pTk/mTk/tclUnix/tclUnixEvent.c 2008-02-17 19:29:54.031250000 +0000 @@ -20,6 +20,11 @@ #include "Lang.h" #endif #ifdef TCL_EVENT_IMPLEMENT + +#ifdef __CYGWIN__ +# include <sys/time.h> +#endif + /* *---------------------------------------------------------------------- * diff -ub Tk-804.028/pTk/mTk/tclUnix/tclUnixNotfy.c.orig --- Tk-804.028/pTk/mTk/tclUnix/tclUnixNotfy.c.orig 2007-05-05 18:39:37.000000000 +0000 +++ Tk-804.028/pTk/mTk/tclUnix/tclUnixNotfy.c 2008-02-17 19:41:04.156250000 +0000 @@ -35,6 +35,34 @@ #endif extern Tcl_NotifierProcs tclOriginalNotifier; +#ifndef MASK_SIZE +/* under Cygwin we use tclUnix but tkWin. + So bring in some "tkUnixPort.h" definitions + */ +#ifdef HAVE_SYS_SELECT_H +# include <sys/select.h> +#endif + +/* + * The following macro defines the number of fd_masks in an fd_set: + */ + +#ifndef FD_SETSIZE +# ifdef OPEN_MAX +# define FD_SETSIZE OPEN_MAX +# else +# define FD_SETSIZE 256 +# endif +#endif +#if !defined(howmany) +# define howmany(x, y) (((x)+((y)-1))/(y)) +#endif +#ifndef NFDBITS +# define NFDBITS NBBY*sizeof(fd_mask) +#endif +#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS) +#endif + /* * This structure is used to keep track of the notifier info for a * a registered file. diff -ub Tk-804.028/pTk/mTk/tclUnix/tclUnixTime.c.orig --- Tk-804.028/pTk/mTk/tclUnix/tclUnixTime.c.orig 2007-05-05 18:39:34.000000000 +0000 +++ Tk-804.028/pTk/mTk/tclUnix/tclUnixTime.c 2008-02-17 19:25:56.562500000 +0000 @@ -15,11 +15,15 @@ #include "Lang.h" #ifdef TCL_EVENT_IMPLEMENT - -#ifdef __EMX__ +#if TIME_WITH_SYS_TIME # include <sys/time.h> -#else # include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif #endif #if 0 diff -ub Tk-804.028/pTk/mTk/generic/tkPort.h.orig --- Tk-804.028/pTk/mTk/generic/tkPort.h.orig 2008-02-17 18:47:08.812500000 +0000 +++ Tk-804.028/pTk/mTk/generic/tkPort.h 2008-02-17 18:49:27.281250000 +0000 @@ -24,6 +24,10 @@ #include "Lang.h" #endif +#if defined(__WIN32__) && !defined(WIN32) +#define WIN32 +#endif + #if defined(__WIN32__) || defined(_WIN32) # include "tkWinPort.h" # ifndef strcasecmp diff -ub Tk-804.028/tkGlue.h.orig --- Tk-804.028/tkGlue.h.orig 2007-05-05 18:37:45.000000000 +0000 +++ Tk-804.028/tkGlue.h 2008-02-17 18:48:07.968750000 +0000 @@ -66,14 +66,14 @@ extern SV * sv_maybe_utf8(SV *sv); extern SV * Lang_SystemEncoding(void); +#ifdef WIN32 +#include "pTk/tkWinInt.h" +#endif + #ifndef WIN32 #define HWND void * #endif EXTERN HWND SVtoHWND _ANSI_ARGS_((SV *win)); -#ifdef WIN32 -#include "pTk/tkWinInt.h" -#endif - #endif
From: SREZIC [...] cpan.org
On Thu Feb 21 02:58:34 2008, RURBAN wrote: Show quoted text
> The previous patch didn't apply cleanly, > tkPort.h was in the wrong directory. > Attached patch fixes that. > > It compiles cleanly on cygwin, but does not work ok yet. > I'll try the old-style GetMessage() loop now. > > On Sun Feb 17 14:58:19 2008, RURBAN wrote:
> > Attached patch finally fixes cygwin breakage for Tk-804.027 and
> Tk-804.028.
Thanks. This compiles also on my Vista system. I can start Tk programs, but the event handling does not seem to work. Funny enough, text on the Canvas appear as Chinese text (?!). How about future patches: I can apply your patch already to the subversion repository of Tk (https://svn.perl.org/modules/Tk/trunk). But then you should do your patches against the svn repository. Or should I just wait for the final patch? Regards, Slaven
From: RURBAN [...] cpan.org
On Thu Feb 21 18:09:05 2008, SREZIC wrote: Show quoted text
> On Thu Feb 21 02:58:34 2008, RURBAN wrote:
> > The previous patch didn't apply cleanly, > > tkPort.h was in the wrong directory. > > Attached patch fixes that. > > > > It compiles cleanly on cygwin, but does not work ok yet. > > I'll try the old-style GetMessage() loop now. > > > > On Sun Feb 17 14:58:19 2008, RURBAN wrote:
> > > Attached patch finally fixes cygwin breakage for Tk-804.027 and
> > Tk-804.028.
> > Thanks. This compiles also on my Vista system. I can start Tk programs, > but the event handling does not seem to work. Funny enough, text on the > Canvas appear as Chinese text (?!).
Oops. So we send our chars to the W functions. Show quoted text
> How about future patches: I can apply your patch already to the > subversion repository of Tk (https://svn.perl.org/modules/Tk/trunk). But > then you should do your patches against the svn repository. Or should I > just wait for the final patch?
Please apply this patch and the ticket can be closed because cygwin compiles now :) To change the cygwin event handling back to unix or debug the cygwin way (hmm) I do not have enough time for the next month or so. Cannot you do that? :) I'm very busy to get out the perl compiler and optree debugger. -- Reini Urban
On Wed Mar 19 14:20:04 2008, RURBAN wrote: Show quoted text
> On Thu Feb 21 18:09:05 2008, SREZIC wrote:
> > On Thu Feb 21 02:58:34 2008, RURBAN wrote:
> > > The previous patch didn't apply cleanly, > > > tkPort.h was in the wrong directory. > > > Attached patch fixes that. > > > > > > It compiles cleanly on cygwin, but does not work ok yet. > > > I'll try the old-style GetMessage() loop now. > > > > > > On Sun Feb 17 14:58:19 2008, RURBAN wrote:
> > > > Attached patch finally fixes cygwin breakage for Tk-804.027 and
> > > Tk-804.028.
> > > > Thanks. This compiles also on my Vista system. I can start Tk programs, > > but the event handling does not seem to work. Funny enough, text on the > > Canvas appear as Chinese text (?!).
> > Oops. So we send our chars to the W functions. >
> > How about future patches: I can apply your patch already to the > > subversion repository of Tk (https://svn.perl.org/modules/Tk/trunk). But > > then you should do your patches against the svn repository. Or should I > > just wait for the final patch?
> > Please apply this patch and the ticket can be closed because cygwin > compiles now :) > > To change the cygwin event handling back to unix or debug the > cygwin way (hmm) I do not have enough time for the next month or so. > Cannot you do that? :)
Sorry, my knowledge about Windows is near zero. So I revert cygwin's default from MSWin32 to x. Your patch is now in the subversion repository. Regards, Slaven