The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!/usr/bin/perl -w
############################################################################
## Name:        Makefile.PL
## Purpose:     Makefile.PL
## Author:      Mattia Barbon
## Modified by:
## Created:     01/10/2000
## RCS-ID:      $Id: Makefile.PL 2950 2010-08-15 10:03:58Z mbarbon $
## Copyright:   (c) 2000-2010 Mattia Barbon
## Licence:     This program is free software; you can redistribute it and/or
##              modify it under the same terms as Perl itself
#############################################################################

package core;

use 5.006001;
use strict;

use FindBin;
use lib "${FindBin::RealBin}/build";
use Wx::build::MakeMaker::Core;

( my $mmv = ExtUtils::MakeMaker->VERSION ) =~ s/_//g;

if( $mmv == 6.21 ) {
    die <<EOT
ExtUtils::MakeMaker 6.21 is known not to work with wxPerl;
please downgrade to 6.17 or install the latest version from CPAN.
EOT
}

# $ExtUtils::MakeMaker::Verbose = 2;
# $wxConfig::Verbose = 10;

my $build_requires =
  { 'File::Spec::Functions'  => 0.82,
    'Test::More'             => 0.45,
    'Test::Harness'          => 2.26,
    'Data::Dumper'           => 0,
    'ExtUtils::MakeMaker'    => 6.17,
    'Alien::wxWidgets'       => 0.25,
    'if'                     => 0.03,
    'ExtUtils::XSpp'         => 0.15,
    'ExtUtils::ParseXS'      => 2.2203,
    };

eval {
    require ExtUtils::MY_Metafile;
    ExtUtils::MY_Metafile->import;

    my_metafile
      ( { license        => 'perl',
          dynamic_config => 1,
          requires       => {},
          build_requires => $build_requires,
          no_index       => { directory => [ qw(samples script) ],
                              package   => [ qw(MY Parse::Yapp::Driver) ],
                              },
          configure_requires => { 'Alien::wxWidgets' => 0.25,
                                  },
          resources       => { 'license'       => 'http://dev.perl.org/licenses/',
                               'homepage'      => 'http://wxperl.eu/',
                               'bugtracker'    => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=Wx',
                               'repository'    => 'https://wxperl.svn.sourceforge.net/svnroot/wxperl/wxPerl',
                               'MailingList'   => 'http://lists.perl.org/list/wxperl-users.html',
                               },
          } );
};

wxWriteMakefile( NAME          => 'Wx',
                 ABSTRACT_FROM => 'Wx.pm',
                 AUTHOR        => 'Mattia Barbon <mbarbon@cpan.org>',
                 VERSION_FROM  => 'Wx.pm',
                 PREREQ_PM     => { %$build_requires },
                 PMLIBDIRS     => [ 'lib', 'build' ],
                 EXE_FILES     => [ qw(script/wxperl_overload) ],
                 WX_CORE_LIB_MAYBE => $^O eq 'darwin' ? 'media html' : '',
                 WX_CORE_LIB   => 'adv core base',
                 WX_OVERLOAD   => { header  => 'cpp/ovl_const.h',
                                    source  => 'cpp/ovl_const.cpp',
                                    },
                 WX_TOP        => 'Wx.pm',
                 LICENSE       => 'perl',
                 );

END {
    print <<EOT;

======================================================================
For installation instructions and further help please see
docs/INSTALL.pod

For command line switches help use:
perl Makefile.PL --help
======================================================================

EOT

    if( grep /\b(?:INC|LIB)=/, @ARGV ) {
        print <<EOT;
======================================================================
It seems that LIB and/or INC was passed to Makefile.PL invocation;
this might cause the build to fail.  Please retry without passing
INC/LIB to Makefile.PL
======================================================================
EOT
    }
}

# local variables:
# mode: cperl
# end: