Alien-SDL2

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

GetOptions (  "travis"  => \$travis)  ;

print "Welcome to Alien::SDL2 module installation\n";
print "------------------------------------------\n";
print "checking operating system... $^O\n";
$| = 1;
print "checking for $My::Utility::cc... ";
if( !check_prereqs_tools($My::Utility::cc) ) {
  print "no\n";
  for(qw(gcc cc lc)) {
    next if $_ eq \$My::Utility::cc;
    print "checking for $_... ";
    if( check_prereqs_tools($_) ) {
      $My::Utility::cc = $_;
      print "yes\n";
      last;
    }
    else {
      print "no\n";
    }
  }
}
else {
  print "yes\n";
}
print "checking build system type... $Config{archname}\n";

#### we need the platform-specific module
my %platforms =(
       # Unix = default, thus not listing all UNIX like systems
       MSWin32 => 'Windows',
);
my $package = 'My::Builder::' . ($platforms{$^O} || 'Unix');
print "checking platform specific module... using '$package'\n";
eval "require $package" or die "Require '$package' failed: $@\n";

my $sdl2_config;

#### Stadard Module::Builder stuff
my $build = $package->new(
  module_name          => 'Alien::SDL2',
  all_from             => 'lib/Alien/SDL2.pm',
  dist_abstract        => 'Get, Build and Use SDL2 libraries',
  dist_author          => 'Kartik Thakore <KTHAKORE@cpan.org>',
  license              => 'perl',
  requires             => {
    'File::Spec'       => '0',
    'File::Temp'       => '0.23',
    'File::ShareDir'   => '0',
    'File::Which'      => '0',
    'ExtUtils::CBuilder' => '0',
    'Capture::Tiny'    => '0',
    'perl'             => '5.008000',
  },
  build_requires       => {  #need to have for running: ./Build (install|test)
    'File::Spec'       => '0',
    'File::Temp'       => '0.23',
    'File::ShareDir'   => '0',
    'ExtUtils::CBuilder' => '0',
    'File::Path'       => '2.08',
    'File::Fetch'      => '0.24',
    'File::Find'       => '0',
    'File::Which'      => '0',
    'Digest::SHA'      => '0',
    'Archive::Extract' => '0',
    'Archive::Tar'     => '0',
    'Archive::Zip'     => '0',
    'Module::Build'    => '0.36',
    'Text::Patch'      => '1.4',
  },
  configure_requires   => {  #need to have for running: perl Build.PL
    'File::Spec'       => '0',
    'File::Path'       => '2.08',
    'File::Fetch'      => '0.24',
    'File::Find'       => '0',
    'File::Which'      => '0',
    'Digest::SHA'      => '0',
    'Archive::Extract' => '0',
    'Module::Build'    => '0.36',
    'Text::Patch'      => '1.4',
    'File::ShareDir'   => '0',
    'IPC::Run3'        => '0',
  },
  meta_merge => {
    resources  => {
      bugtracker => 'http://github.com/PerlGameDev/SDL2/issues?labels=Alien-SDL2',
      repository => 'http://github.com/PerlGameDev/Alien-SDL2'
    }
  },
  get_options => { 'with-sdl2-config' => { qw(type :s  store) => \$sdl2_config } },
  dynamic_config => 1,
  create_readme => 1,
  share_dir => 'sharedir',
);

my $choice;
my %have_libs = ();

if (defined $sdl2_config) {
  # handle --with-sdl2-config (without params)
  $sdl2_config = 'sdl2-config' if $sdl2_config eq '';
  # Don't prompt; just use specified location:
  $choice = check_config_script($sdl2_config)
      or warn "###ERROR### Unable to use config script $sdl2_config\n";
}
else {
  $| = 1;

  if( $My::Utility::cc eq 'cl' && $^O eq 'MSWin32' ) {
    print "checking INCLUDE and LIB... ";
    if( !$ENV{INCLUDE} || !$ENV{LIB} ) {
      my @set = `\@vcvars32 & set`;
      chomp @set;
      my %set  = map /(\w+)=(.+)/, @set;
      for( keys %set ) {
        if( /^INCLUDE|LIB$/ ) {
          $ENV{$_} = $set{$_};
        }
      }
      print(($ENV{INCLUDE} && $ENV{LIB})
        ? "yes, via vcvars32\n"
        : "no\n");
    }
    else {
      print "yes\n";
    }
  }
  #### check what options we have for our platform
  my $rv;
  my @candidates = ();

  # sdl2-config script
  push @candidates, $rv if $rv = check_config_script("sdl2-config");



( run in 0.883 second using v1.01-cache-2.11-cpan-df04353d9ac )