Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / blib / lib / Wx / build / MakeMaker / Win32_MinGW.pm
1 package Wx::build::MakeMaker::Win32_MinGW;
2
3 use strict;
4 use Wx::build::Utils qw(path_search);
5 use base 'Wx::build::MakeMaker::Win32';
6
7 sub _res_file { 'Wx_res.o' }
8 sub _res_command { 'windres --include-dir %incdir %src %dest' }
9 sub _strip_command {
10   return <<EOT;
11         attrib -r blib\\arch\\auto\\Wx\\*.dll
12         strip blib/arch/auto/Wx/*.dll
13         attrib +r blib\\arch\\auto\\Wx\\*.dll
14 EOT
15 }
16
17 #
18 # fixes link command line to use g++ instead of dlltool
19 #
20 sub dynamic_lib {
21   my $this = shift;
22   my $text = $this->SUPER::dynamic_lib( @_ );
23
24   return $text unless $text =~ m/dlltool/i;
25   return $text unless $Wx::build::MakeMaker::Core::has_alien;
26
27   my $strip = $this->_debug ? '' : ' -s ';
28
29   $text =~ s{(?:^\s+(?:dlltool|\$\(LD\)).*\n)+}
30     {\tg++ -shared $strip -o \$@ \$(LDFROM) \$(MYEXTLIB) \$(PERL_ARCHIVE) \$(LDLOADLIBS) \$(BASEEXT).def\n}m;
31   # \$(LDDLFLAGS) : in MinGW passes -mdll, and we use -shared...
32
33   return $text;
34 }
35
36 1;
37
38 # local variables:
39 # mode: cperl
40 # end: