5 use ExtUtils::MakeMaker;
11 eval { require File::Spec; 1 } or die 'OS unsupported';
22 print "Forcing the use of $cc as the C compiler.\n";
24 # Inspired from Module::Install::Can
25 print "Checking for a valid C compiler in the PATH... ";
26 my @ccs = ($Config{cc});
27 unshift @ccs, $ENV{CC} if $ENV{CC};
30 for my $dir (split /$Config{path_sep}/, $ENV{PATH}) {
31 my $abs = File::Spec->catfile($dir, $c);
32 if (-x $abs or MM->maybe_command($abs)) {
39 print "none\n" unless defined $cc;
43 push @C, 'Util.c' if defined $cc;
47 sub is_little_endian {
48 my $order = $Config{byteorder};
49 return 0 unless $order;
50 my $len = length $order;
52 $order = substr $order, 0, 8;
55 return $order eq (join '', 1 .. $len);
58 my $unit = { bits => 8, size => 1 };
59 if (not is_little_endian()) {
60 print "Forcing unit size of 8 on non-little-endian systems.\n";
62 print "Checking unit size in bits... ";
63 my $align = $Config{alignbytes} || 1;
64 my @bits = (8, 16, 32, 64);
65 for my $bits (@bits) {
66 my $size = $Config{"u${bits}size"};
68 $unit = { bits => $bits, size => $size } if $size && $size <= $align;
71 " (actually $unit->{size} bytes for $align bytes alignment).\n";
75 my $bits = $unit->{bits};
76 push @DEFINES, '-DBV_UNIT="' . ($Config{"u${bits}type"} || "U$bits") . '"';
77 push @DEFINES, "-DSVU_SIZE=$bits";
80 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
82 my $dist = 'Scalar-Vec-Util';
84 (my $name = $dist) =~ s{-}{::}g;
86 (my $file = $dist) =~ s{-}{/}g;
87 $file = "lib/$file.pm";
97 configure_requires => {
99 'ExtUtils::MakeMaker' => 0,
104 'ExtUtils::MakeMaker' => 0,
110 bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
111 homepage => "http://search.cpan.org/dist/$dist/",
112 license => 'http://dev.perl.org/licenses/',
113 repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
119 AUTHOR => 'Vincent Pit <perl@profvince.com>',
121 VERSION_FROM => $file,
122 ABSTRACT_FROM => $file,
126 PREREQ_PM => \%PREREQ_PM,
127 MIN_PERL_VERSION => '5.006',
128 META_MERGE => \%META,
130 PREOP => "pod2text -u $file > \$(DISTVNAME)/README",
131 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
134 FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt*"
143 my $cv = join ' -coverage ', 'cover',
144 qw<statement branch condition path subroutine time>;