Skip Menu |

This queue is for tickets about the Alien-wxWidgets CPAN distribution.

Report information
The Basics
Id: 53471
Status: resolved
Priority: 0/
Queue: Alien-wxWidgets

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

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



Subject: Win32_MinGW.pm patch to support mingw-w64 toolchain
Hi,

please find enclosed patch that makes Alien::wxWidgets compatible with gcc4 toolchains provided by mingw-w64.sf.net project. This toolchain is very likely to be used in the future 64-bit strawberry perl release and it would be nice to support wxWidgets also on this platform.

The patch handles basically 2 things:

1) better detection of GNU make - I have added "gmake" and value from $Config{gmake} to searched candidates

2) harcoded DLL name "mingwm10.dll" does not work on new gcc4 as it uses completely different DLLS, unfortunately the DLL name is not fixed (it differs for 32-bit / 64-bit gcc4 compilers), therefore I have decided to implement a sort simple wildcard search.

Of course I have tried to be backward compatible.

Please consider the enclosed patch to the following files:
inc\My\Build\Win32_MinGW.pm
inc\My\Build\Base.pm

Thanks.

--
kmx

P.S. mingw-w64 gcc4 toolchains (both 32/64bit) are available here:
http://svn.ali.as/cpan/users/kmx/strawberry_gcc-toolchain/
Subject: mingw64_compatibility.patch
diff -r -u Build.orig/Base.pm Build/Base.pm --- Build.orig/Base.pm 2009-12-25 18:26:27.000000000 +0100 +++ Build/Base.pm 2010-01-07 11:33:35.108011000 +0100 @@ -394,7 +394,12 @@ foreach my $d ( File::Spec->path ) { my $full = File::Spec->catfile( $d, $file ); - return $full if -f $full; + #escape spaces as glob() takes space as a separator + $full =~ s/ /\\ /g; + #we are gonna use glob() to accept wildcards + foreach my $f (glob($full)) { + return $f if -f $f; + } } return; Pouze v Build: Base.pm.orig diff -r -u Build.orig/Win32_MinGW.pm Build/Win32_MinGW.pm --- Build.orig/Win32_MinGW.pm 2009-12-25 18:26:27.000000000 +0100 +++ Build/Win32_MinGW.pm 2010-01-07 11:37:35.383085000 +0100 @@ -5,9 +5,11 @@ use My::Build::Utility qw(awx_arch_file awx_install_arch_file awx_install_arch_dir awx_arch_dir); use Config; +use File::Basename; sub _find_make { - my( @try ) = qw(mingw32-make make); + my( @try ) = qw(mingw32-make gmake make); + push @try, $Config{gmake} if $Config{gmake}; foreach my $name ( @try ) { foreach my $dir ( File::Spec->path ) { @@ -88,8 +90,15 @@ sub files_to_install { my $self = shift; - my $dll = 'mingwm10.dll'; - my $dll_from = $self->awx_path_search( $dll ); + my( @try ) = qw(mingwm10.dll libgcc_*.dll); + my ($dll, $dll_from); + foreach my $d (@try) { + $dll_from = $self->awx_path_search( $d ); + if (defined $dll_from) { + $dll = basename($dll_from); + last; + } + } return ( $self->SUPER::files_to_install(), ( $dll_from => awx_arch_file( "rEpLaCe/lib/$dll" ) ) ); Pouze v Build: Win32_MinGW.pm.orig
Subject: Re: [rt.cpan.org #53471] Win32_MinGW.pm patch to support mingw-w64 toolchain
Date: Thu, 07 Jan 2010 23:01:51 +0100
To: bug-Alien-wxWidgets [...] rt.cpan.org
From: Mattia Barbon <mattia.barbon [...] libero.it>
kmx via RT wrote: Hi, Show quoted text
> please find enclosed patch that makes Alien::wxWidgets compatible with gcc4 > toolchains provided by mingw-w64.sf.net project. This toolchain is very likely > to be used in the future 64-bit strawberry perl release and it would be nice to > support wxWidgets also on this platform. > > The patch handles basically 2 things: > > 1) better detection of GNU make - I have added "gmake" and value from > $Config{gmake} to searched candidates > > 2) harcoded DLL name "mingwm10.dll" does not work on new gcc4 as it uses > completely different DLLS, unfortunately the DLL name is not fixed (it differs > for 32-bit / 64-bit gcc4 compilers), therefore I have decided to implement a > sort simple wildcard search. > > Of course I have tried to be backward compatible.
Thanks, applied with a tweak (I replaced glob() with bsd_glob(), works the same way but does not split the pattern on whitespace). Could you try if current Subversion (r2742) works for you? Show quoted text
I guess it's time I buy myself a Windows 7 license... Regards, Mattia
Hello,

Show quoted text
> Could you try if current Subversion (r2742) works for you?

I have successfully tested r2742 with:
1) 5.11.3 + mingw-w64 toolchain based on gcc4.4.3(pre) + wx2.8.10
2) Strawberry Oct2009 release - 5.10.1 + mingw.org toolchain based on gcc3.4.5 + wx2.8.10

So IMHO this RT is fixed.

IDEA: could you please put the SVN repository location somewhere in META.yml, README.txt or Alien::wxWidget doc? (took me a while to found out where it is)

Thanks!

--
kmx

Uploaded version 0.49 with the fix and the mention of the repository.
On Sat Jan 09 06:13:56 2010, MBARBON wrote: Show quoted text
> Uploaded version 0.49 with the fix and the mention of the repository.
You forgot to include wxMSW-2.8.10-mingw64.patch in MANIFEST, so it didn't appear in 0.49.tar.gz -- Serguei Trouchelle
Added the missing file in release 0.50. Thanks! Mattia