Alien-wxWidgets
view release on metacpan or search on metacpan
inc/My/Build/Win32_MinGW.pm view on Meta::CPAN
package My::Build::Win32_MinGW;
use strict;
use base qw(My::Build::Win32);
use My::Build::Utility qw(awx_arch_file awx_install_arch_file
awx_install_arch_dir awx_arch_dir);
use Config;
use File::Basename qw();
use File::Glob qw(bsd_glob);
use Data::Dumper;
sub _find_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 ) {
my $abs = File::Spec->catfile( $dir, "$name.exe" );
return $name if -x $abs;
}
}
return 'make';
}
sub awx_configure {
my $self = shift;
my %config = $self->SUPER::awx_configure;
my $mxarchflags = ( $Config{ptrsize} == 8 ) ? '-m64' : '-m32';
if( $self->awx_debug ) {
$config{c_flags} .= qq( -g $mxarchflags );
$config{link_flags} .= qq( $mxarchflags );
} else {
$config{c_flags} .= qq( $mxarchflags );
$config{link_flags} .= qq( -s $mxarchflags );
}
my $cccflags = $self->wx_config( 'cxxflags' );
my $libs = $self->wx_config( 'libs' );
my $incdir = $self->awx_wx_config_data->{wxinc};
my $cincdir = $self->awx_wx_config_data->{wxcontrinc};
my $iincdir = awx_install_arch_dir( $self, 'rEpLaCe/include' );
foreach ( split /\s+/, $cccflags ) {
m(^-DSTRICT) && next;
m(^\.d$) && next; # broken makefile
m(^-W.*) && next; # under Win32 -Wall gives you TONS of warnings
m(^-I) && do {
next if m{(?:regex|zlib|jpeg|png|tiff)$};
if( $self->notes( 'build_wx' ) ) {
$_ =~ s{\Q$cincdir\E}{$iincdir};
$_ =~ s{\Q$incdir\E}{$iincdir};
}
if( $_ =~ /-I\Q$self->{awx_setup_dir}\E/ ) {
$config{include_path} .=
'-I' . awx_install_arch_file( $self, 'rEpLaCe/lib' ) . ' ';
} else {
$config{include_path} .= "$_ ";
}
next;
};
m(^-D) && do { $config{defines} .= "$_ "; next; };
$config{c_flags} .= "$_ ";
}
foreach ( split /\s+/, $libs ) {
m(wx|unicows)i || next;
next if m{(?:wx(?:zlib|regexu?|expat|png|jpeg|tiff)[ud]{0,2})$};
( run in 0.351 second using v1.01-cache-2.11-cpan-524268b4103 )