/usr/lib/perl5/Wx/build/MakeMaker/Core.pm is in libwx-perl 1:0.9903-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | package Wx::build::MakeMaker::Core::Dummy;
# to avoid W::b::MM clobbering our wxWriteMakefile
use Wx::build::MakeMaker;
package Wx::build::MakeMaker::Core;
use strict;
use ExtUtils::MakeMaker;
use Wx::build::Utils qw'obj_from_src';
use Wx::build::Options;
use File::Path 'mkpath';
use base 'Exporter';
use vars qw(@EXPORT @subdirs);
@EXPORT = 'wxWriteMakefile';
my @top_level_xs = qw(Wx.xs Constant.xs Controls.xs Event.xs
Frames.xs GDI.xs Window.xs);
@subdirs = qw(socket dnd filesys grid help html mdi print xrc stc docview
calendar datetime media richtext aui dataview);
my %subdirs;
Wx::build::MakeMaker::_set_is_wxPerl_tree( 1 );
eval { require Alien::wxWidgets };
our $has_alien = $@ ? 0 : 1;
my %options = Wx::build::Options->get_makemaker_options if $has_alien;
if( $has_alien ) {
@subdirs{@subdirs} = (1) x @subdirs;
my %opt = %{$options{subdirs}};
@subdirs{keys %opt} = values %opt;
@subdirs = grep { $subdirs{$_} } keys %subdirs;
}
#
# make symlinks to the source tree
#
if( $options{mksymlinks} ) {
require FindBin;
require ExtUtils::Manifest;
require File::Spec::Functions;
local *catfile = \&File::Spec::Functions::catfile;
local *splitpath = \&File::Spec::Functions::splitpath;
my $manifest = MM->catfile( $FindBin::RealBin, 'MANIFEST' );
die "Can't find MANIFEST" unless -e $manifest;
my $files = ExtUtils::Manifest::maniread( $manifest );
foreach my $f ( keys %$files ) {
my( $fr, $to ) = ( catfile( $FindBin::RealBin, $f ), $f );
my $dir;
( undef, $dir, undef ) = splitpath( $to );
mkpath( $dir ) if length $dir && !-d $dir;
next if -l $to;
if( -e $to ){ unlink $to or die "unlink '$to' failed: $!" }
symlink( $fr, $to ) or die "symlink '$fr' => '$to' failed: $!";
}
}
#
# write cpp/setup.h
#
if( $has_alien ) {
unless( -d 'cpp' ) {
mkpath( 'cpp' ) or die "mkpath 'cpp': $!";
}
local *OUT;
open OUT, "> cpp/setup.h" or die "open 'cpp/setup.h': $!";
print OUT <<EOT;
//
// GENERATED BY Makefile.PL, DO NOT EDIT
//
#ifndef __CPP_SETUP_H__
#define __CPP_SETUP_H__
EOT
foreach my $o ( sort keys %subdirs ) {
print OUT "#define wxPERL_USE_", uc $o, " ", $subdirs{$o} ,"\n";
}
print OUT <<EOT;
#endif // __CPP_SETUP_H__
EOT
close OUT;
}
Wx::build::Options->write_config_file( 'Opt' ) if $has_alien;
#
# WriteMakefile wrapper
#
sub wxWriteMakefile {
my %params = @_;
local $Wx::build::MakeMaker::is_core = 1;
if( $has_alien ) {
$params{XSOPT} = ' -nolinenumbers -noprototypes ';
$params{CONFIGURE} = \&Wx::build::MakeMaker::configure;
$params{OBJECT} = join ' ', obj_from_src( @top_level_xs ), '';
}
my $build = Wx::build::MakeMaker::_process_mm_arguments( \%params, $has_alien );
if( $build ) {
WriteMakefile( %params );
unless( Alien::wxWidgets->can( 'load' ) ) {
print <<EOT;
======================================================================
Alien::wxWidgets is missing, you will need to re-run Makefile.PL after
it is installed.
======================================================================
EOT
sleep 3;
open my $fh, ">> alien_wxwidgets_missing";
print $fh "touched";
}
} else {
ExtUtils::MakeMaker::WriteEmptyMakefile( %params );
}
}
1;
# local variables:
# mode: cperl
# end:
|