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/
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