5 use ExtUtils::MakeMaker;
8 eval { require Config };
9 die 'OS unsupported' if $@;
10 Config->import(qw/%Config/);
11 eval { require File::Spec };
12 die 'OS unsupported' if $@;
15 # Inspired from Module::Install::Can
16 print "Checking for a valid C compiler in the PATH... ";
17 my @ccs = ($Config{cc});
18 unshift @ccs, $ENV{CC} if $ENV{CC};
22 for my $dir (split /$Config{path_sep}/, $ENV{PATH}) {
23 my $abs = File::Spec->catfile($dir, $c);
24 if (-x $abs or MM->maybe_command($abs)) {
40 sub is_little_endian {
41 my $order = $Config{byteorder};
42 return 0 unless $order;
43 my $len = length $order;
45 $order = substr $order, 0, 8;
48 return $order eq (join '', 1 .. $len);
51 my $unit = { bits => 8, size => 1 };
52 if (not is_little_endian()) {
53 print "Forcing unit size of 8 on non-little-endian systems.\n";
55 print "Checking unit size in bits... ";
56 my $align = $Config{alignbytes} || 1;
57 my @bits = (8, 16, 32);
58 push @bits, 64 unless $^O eq 'MSWin32';
59 for my $bits (@bits) {
60 my $size = $Config{"u${bits}size"};
62 $unit = { bits => $bits, size => $size } if $size && $size <= $align;
65 " (actually $unit->{size} bytes for $align bytes alignment).\n";
69 my $bits = $unit->{bits};
70 push @DEFINES, '-DBV_UNIT="' . ($Config{"u${bits}type"} || "U$bits") . '"';
71 push @DEFINES, "-DSVU_SIZE=$bits";
74 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
76 my $dist = 'Scalar-Vec-Util';
79 configure_requires => {
81 'ExtUtils::MakeMaker' => 0,
86 'ExtUtils::MakeMaker' => 0,
90 bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
91 homepage => "http://search.cpan.org/dist/$dist/",
92 license => 'http://dev.perl.org/licenses/',
93 repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
98 NAME => 'Scalar::Vec::Util',
99 AUTHOR => 'Vincent Pit <perl@profvince.com>',
101 VERSION_FROM => 'lib/Scalar/Vec/Util.pm',
102 ABSTRACT_FROM => 'lib/Scalar/Vec/Util.pm',
111 MIN_PERL_VERSION => 5.006,
112 META_MERGE => \%META,
114 PREOP => 'pod2text lib/Scalar/Vec/Util.pm > $(DISTVNAME)/README',
115 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
118 FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt"
127 my $cv = join ' -coverage ', 'cover',
128 qw/statement branch condition path subroutine time/;