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, 64);
58 for my $bits (@bits) {
59 my $size = $Config{"u${bits}size"};
61 $unit = { bits => $bits, size => $size } if $size && $size <= $align;
64 " (actually $unit->{size} bytes for $align bytes alignment).\n";
68 my $bits = $unit->{bits};
69 push @DEFINES, '-DBV_UNIT="' . ($Config{"u${bits}type"} || "U$bits") . '"';
70 push @DEFINES, "-DSVU_SIZE=$bits";
73 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
75 my $dist = 'Scalar-Vec-Util';
77 (my $name = $dist) =~ s{-}{::}g;
79 (my $file = $dist) =~ s{-}{/}g;
80 $file = "lib/$file.pm";
90 configure_requires => {
92 'ExtUtils::MakeMaker' => 0,
97 'ExtUtils::MakeMaker' => 0,
103 bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
104 homepage => "http://search.cpan.org/dist/$dist/",
105 license => 'http://dev.perl.org/licenses/',
106 repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
112 AUTHOR => 'Vincent Pit <perl@profvince.com>',
114 VERSION_FROM => $file,
115 ABSTRACT_FROM => $file,
119 PREREQ_PM => \%PREREQ_PM,
120 MIN_PERL_VERSION => 5.006,
121 META_MERGE => \%META,
123 PREOP => "pod2text $file > \$(DISTVNAME)/README",
124 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
127 FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt"
136 my $cv = join ' -coverage ', 'cover',
137 qw<statement branch condition path subroutine time>;