File: MyMakeMaker.pm

package info (click to toggle)
libwx-glcanvas-perl 0.09-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 144 kB
  • sloc: cpp: 644; perl: 311; makefile: 18
file content (34 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package MyMakeMaker;

use strict;
use Exporter; *import =\&Exporter::import;

our @EXPORT = qw(wxWriteMakefile);

eval { require Wx::build::MakeMaker };
my $has_wx = $@ ? 0 : 1;
if( !$has_wx ) {
    require ExtUtils::MakeMaker;

    ExtUtils::MakeMaker->import;
    *wxWriteMakefile = sub {
        my( %args ) = @_;

        unless( $has_wx ) {
            $args{depend} = { '$(FIRST_MAKEFILE)' => 'you_better_rebuild_me' };
            delete $args{$_} foreach grep /WX_|_WX/, keys %args;
        }

        WriteMakefile( %args );

        if( !$has_wx ) {
            sleep 3;
            open my $fh, ">> you_better_rebuild_me";
            print $fh "touched";
        }
    };
} else {
    Wx::build::MakeMaker->import;
}

1;