16fb12b70Safresh1# -*- perl -*-
26fb12b70Safresh1BEGIN { require 5.006; }
36fb12b70Safresh1use strict;
46fb12b70Safresh1use warnings;
56fb12b70Safresh1use Config;
66fb12b70Safresh1use File::Spec;
76fb12b70Safresh1use ExtUtils::MakeMaker;
86fb12b70Safresh1my $PERL_CORE = grep { $_ eq 'PERL_CORE=1' } @ARGV;
9*de8cc8edSafresh1my $defines = $ENV{PERL_CORE} ? q[-DPERL_EXT] : q[-DPERL_EXT -DUSE_PPPORT_H];
106fb12b70Safresh1
11*de8cc8edSafresh1my %params = (
126fb12b70Safresh1  NAME         => q[List::Util],
136fb12b70Safresh1  ABSTRACT     => q[Common Scalar and List utility subroutines],
146fb12b70Safresh1  AUTHOR       => q[Graham Barr <gbarr@cpan.org>],
15*de8cc8edSafresh1  DEFINE       => $defines,
166fb12b70Safresh1  DISTNAME     => q[Scalar-List-Utils],
176fb12b70Safresh1  VERSION_FROM => 'lib/List/Util.pm',
186fb12b70Safresh1
196fb12b70Safresh1  # We go through the ListUtil.xs trickery to foil platforms
206fb12b70Safresh1  # that have the feature combination of
216fb12b70Safresh1  # (1) static builds
226fb12b70Safresh1  # (2) allowing only one object by the same name in the static library
236fb12b70Safresh1  # (3) the object name matching being case-blind
246fb12b70Safresh1  # This means that we can't have the top-level util.o
256fb12b70Safresh1  # and the extension-level Util.o in the same build.
266fb12b70Safresh1  # One such platform is the POSIX-BC BS2000 EBCDIC mainframe platform.
276fb12b70Safresh1  XS     => {'ListUtil.xs' => 'ListUtil.c'},
286fb12b70Safresh1  OBJECT => 'ListUtil$(OBJ_EXT)',
296fb12b70Safresh1  ( $PERL_CORE
306fb12b70Safresh1    ? ()
316fb12b70Safresh1    : (
326fb12b70Safresh1      INSTALLDIRS      => ($] < 5.011 ? q[perl] : q[site]),
33*de8cc8edSafresh1      TEST_REQUIRES => {
34*de8cc8edSafresh1        'Test::More' => 0,
35*de8cc8edSafresh1      },
366fb12b70Safresh1      (eval { ExtUtils::MakeMaker->VERSION(6.31) } ? (LICENSE => 'perl') : ()),
375759b3d2Safresh1      (eval { ExtUtils::MakeMaker->VERSION(6.48) } ? (MIN_PERL_VERSION => '5.006') : ()),
386fb12b70Safresh1      ( eval { ExtUtils::MakeMaker->VERSION(6.46) } ? (
396fb12b70Safresh1          META_MERGE => {
405759b3d2Safresh1            'meta-spec' => { version => 2 },
415759b3d2Safresh1            dynamic_config => 0,
426fb12b70Safresh1            resources => {    ##
435759b3d2Safresh1              repository => {
445759b3d2Safresh1                url => 'https://github.com/Scalar-List-Utils/Scalar-List-Utils.git',
455759b3d2Safresh1                web => 'https://github.com/Scalar-List-Utils/Scalar-List-Utils',
465759b3d2Safresh1                type => 'git',
475759b3d2Safresh1              },
485759b3d2Safresh1              bugtracker => {
495759b3d2Safresh1                mailto => 'bug-Scalar-List-Utils@rt.cpan.org',
505759b3d2Safresh1                web => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Scalar-List-Utils',
515759b3d2Safresh1              },
526fb12b70Safresh1            },
536fb12b70Safresh1          }
546fb12b70Safresh1          )
556fb12b70Safresh1        : ()
566fb12b70Safresh1      ),
576fb12b70Safresh1    )
586fb12b70Safresh1  ),
596fb12b70Safresh1);
60*de8cc8edSafresh1
61*de8cc8edSafresh1if ($params{TEST_REQUIRES} and !eval { ExtUtils::MakeMaker->VERSION(6.64) }) {
62*de8cc8edSafresh1    $params{BUILD_REQUIRES} = {
63*de8cc8edSafresh1        %{$params{BUILD_REQUIRES} || {}},
64*de8cc8edSafresh1        %{delete $params{TEST_REQUIRES}},
65*de8cc8edSafresh1    };
66*de8cc8edSafresh1}
67*de8cc8edSafresh1if ($params{BUILD_REQUIRES} and !eval { ExtUtils::MakeMaker->VERSION(6.5503) }) {
68*de8cc8edSafresh1    $params{PREREQ_PM} = {
69*de8cc8edSafresh1        %{$params{PREREQ_PM} || {}},
70*de8cc8edSafresh1        %{delete $params{BUILD_REQUIRES}},
71*de8cc8edSafresh1    };
72*de8cc8edSafresh1}
73*de8cc8edSafresh1
74*de8cc8edSafresh1WriteMakefile(%params);
75