1 package Wx::build::MakeMaker::Win32;
4 use base 'Wx::build::MakeMaker::Any_OS';
8 sub is_mingw() { $Config{cc} =~ /gcc/ }
9 sub is_msvc() { $Config{cc} =~ /cl/ }
13 my %config = $this->SUPER::get_flags;
15 $config{CC} = Alien::wxWidgets->compiler;
16 $config{LD} = Alien::wxWidgets->linker;
17 # used to be CCFLAGS, but overrode CCFLAGS from MakeMaker
18 $config{CC} .= ' ' . Alien::wxWidgets->c_flags . ' ';
19 # $config{dynamic_lib}{OTHERLDFLAGS} = Alien::wxWidgets->link_flags;
20 $config{clean}{FILES} .= is_mingw ? ' dll.base dll.exp '
21 :' *.pdb *.pdb *_def.old ';
22 $config{DEFINE} .= Alien::wxWidgets->defines . ' ';
23 $config{INC} .= Alien::wxWidgets->include_path;
26 $config{OPTIMIZE} = ' ';
30 # add $MINGWDIR/lib to lib search path, to stop perl from complaining...
31 my $path = Wx::build::Utils::path_search( 'gcc.exe' )
32 or warn "Unable to find gcc";
33 $path =~ s{bin[\\/]gcc\.exe$}{}i;
34 $config{LIBS} = "-L${path}lib " . ( $config{LIBS} || '' );
36 $config{DEFINE} .= '-D_CRT_SECURE_NO_DEPRECATE ';
44 my %config = $this->SUPER::configure_core( @_ );
46 my $res = $this->_res_file;
47 $config{depend} = { $res => 'Wx.rc ' };
48 $config{LDFROM} .= "\$(OBJECT) $res ";
49 $config{dynamic_lib}{INST_DYNAMIC_DEP} .= " $res";
50 $config{clean}{FILES} .= " $res Wx_def.old";
57 my $text = $this->SUPER::postamble_core( @_ );
59 return $text unless $Wx::build::MakeMaker::Core::has_alien;
61 my $wxdir = Alien::wxWidgets->wx_base_directory;
62 my $command = $this->_res_command;
63 my $res_file = $this->_res_file;
65 $command =~ s/%incdir/$wxdir\\include/;
66 $command =~ s/%src/Wx.rc/;
67 $command =~ s/%dest/$res_file/;
68 my $strip = $this->_strip_command;
70 $text .= sprintf <<'EOT', $res_file, $command, $strip;
80 perl script/make_ppm.pl