Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / debian / libwx-perl / usr / lib / perl5 / Wx / build / MakeMaker / Any_wx_config.pm
1 package Wx::build::MakeMaker::Any_wx_config;
2
3 use strict;
4 use base 'Wx::build::MakeMaker::Any_OS';
5 use Wx::build::MakeMaker::Hacks 'hijack';
6
7 require ExtUtils::Liblist;
8 my $save = hijack( 'MM', 'ext', \&my_ext );
9 sub my_ext {
10   my $this = shift;
11   my $libs = shift;
12   my $full; if( $libs =~ m{(?:\s+|^)(/\S+)} )
13     { $full = $1; $libs =~ s{(?:\s+|^)/\S+}{}g }
14   my @libs = &{$save}( $this, $libs, @_ );
15   if( defined $full ) {
16     $libs[0] = "$libs[0] $full $libs[0]" if $libs[0];
17     $libs[2] = "$libs[2] $full $libs[2]" if $libs[2];
18   }
19
20   return @libs;
21 }
22
23 sub get_flags {
24   my $this = shift;
25   my %config = $this->SUPER::get_flags;
26
27   $config{CC} = $ENV{CXX} || Alien::wxWidgets->compiler;
28   $config{LD} = $ENV{CXX} || Alien::wxWidgets->linker;
29   # used to be CCFLAGS, but overrode CCFLAGS from MakeMaker
30   $config{CC} .= ' ' . Alien::wxWidgets->c_flags . ' ';
31   $config{dynamic_lib}{OTHERLDFLAGS} .= Alien::wxWidgets->link_flags . ' ';
32   $config{DEFINE} .= Alien::wxWidgets->defines . ' ';
33   $config{INC} .= Alien::wxWidgets->include_path;
34
35   if( $this->_debug ) {
36     $config{OPTIMIZE} = ' ';
37   }
38
39   return %config;
40 }
41
42 1;
43
44 # local variables:
45 # mode: cperl
46 # end:
47