2 BEGIN { require 5.006; } # allow CPAN testers to get the point
7 use ExtUtils::MakeMaker;
8 my $PERL_CORE = grep { $_ eq 'PERL_CORE=1' } @ARGV;
10 my $do_xs = $PERL_CORE || can_cc();
13 /^-pm/ and $do_xs = 0;
14 /^-xs/ and $do_xs = 1;
18 NAME => q[List::Util],
19 ABSTRACT => q[Common Scalar and List utility subroutines],
20 AUTHOR => q[Graham Barr <gbarr@cpan.org>],
21 DEFINE => q[-DPERL_EXT],
22 DISTNAME => q[Scalar-List-Utils],
23 VERSION_FROM => 'lib/List/Util.pm',
25 # We go through the ListUtil.xs trickery to foil platforms
26 # that have the feature combination of
28 # (2) allowing only one object by the same name in the static library
29 # (3) the object name matching being case-blind
30 # This means that we can't have the top-level util.o
31 # and the extension-level Util.o in the same build.
32 # One such platform is the POSIX-BC BS2000 EBCDIC mainframe platform.
33 XS => {'ListUtil.xs' => 'ListUtil.c'},
34 OBJECT => 'ListUtil$(OBJ_EXT)',
38 INSTALLDIRS => q[perl],
39 PREREQ_PM => {'Test::More' => 0,},
40 (eval { ExtUtils::MakeMaker->VERSION(6.31) } ? (LICENSE => 'perl') : ()),
41 ($do_xs ? () : (XS => {}, C => [], OBJECT => '')),
42 ( eval { ExtUtils::MakeMaker->VERSION(6.46) } ? (
45 repository => 'http://github.com/gbarr/Scalar-List-Utils',
58 foreach my $cmd (split(/ /, $Config::Config{cc})) {
60 return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
62 for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
63 my $abs = File::Spec->catfile($dir, $_[1]);
64 return $abs if (-x $abs or $abs = MM->maybe_command($abs));
76 $self->SUPER::init_PM(@_);
81 my $pm_file = File::Spec->catfile(qw(lib List Util XS.pm));
83 # When installing pure perl, install XS.pp as XS.pm
84 $self->{PM}{'XS.pp'} = delete $self->{PM}{$pm_file};