1 package My::Build::MacOSX_wx_config;
4 use base qw(My::Build::Any_wx_config);
8 sub awx_wx_config_data {
10 return $self->{awx_data} if $self->{awx_data};
11 my %data = ( linkflags => '', %{$self->SUPER::awx_wx_config_data} );
13 # MakeMaker does not like some options
14 $data{libs} =~ s{-framework\s+\w+}{}g;
15 $data{libs} =~ s{-isysroot\s+\S+}{}g;
16 $data{libs} =~ s{-L/usr/local/lib\s}{}g;
18 $data{libs} =~ s{\s(-arch\s+\w+)}
19 {$data{linkflags} .= " $1 ";
20 $data{cxxflags} .= " $1 ";
23 $data{cxx} =~ s{-isysroot\s+\S+}{}g;
24 $data{ld} = $data{cxx};
25 $data{cxxflags} .= ' -UWX_PRECOMP ';
27 $self->{awx_data} = \%data;
32 my %config = $self->SUPER::awx_configure;
34 $config{link_flags} .= $self->wx_config( 'linkflags' );
39 sub wxwidgets_configure_extra_flags {
43 # on Snow Leopard, force wxWidgets 2.8.x builds to be 32-bit;
44 if( $self->notes( 'build_data' )->{data}{version} =~ /^2.8/
45 && `uname -r` =~ /^10\./
46 && `sysctl hw.cpu64bit_capable` =~ /^hw.cpu64bit_capable: 1/ ) {
47 print "Forcing wxWidgets build to 32 bit\n";
48 $extra_flags = join ' ', map { qq{$_="-arch i386"} }
49 qw(CFLAGS CXXFLAGS LDFLAGS
50 OBJCFLAGS OBJCXXFLAGS);
52 # build fix for 2.9.0 on Snow Leopard
53 if( `uname -r` =~ /^10\./
54 && $self->notes( 'build_data' )->{data}{version} eq '2.9.0' ) {
55 $extra_flags .= ' --with-macosx-version-min=10.5';
61 sub awx_build_toolkit {
62 # use Cocoa for OS X wxWidgets builds with 64 bit Perl
63 if( $Config{osname} =~ /darwin/
64 && $Config{ptrsize} == 8 ) {
71 sub awx_dlext { 'dylib' }
76 # can't build wxWidgets 2.8.x with 64 bit Perl
77 if( $Config{ptrsize} == 8
78 && $self->notes( 'build_data' )->{data}{version} =~ /^2.8/ ) {
80 =======================================================================
81 The 2.8.x wxWidgets for OS X does not support 64-bit. In order to build
82 wxPerl you will need to either recompile Perl as a 32-bit binary or (if
83 using the Apple-provided Perl) force it to run in 32-bit mode (see "man
84 perl"). Alpha 64-bit wx for OS X is in 2.9.x, but untested in wxPerl.
85 =======================================================================
90 $self->SUPER::build_wxwidgets;