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";
96 my %BUILD_REQUIRES = (
98 'ExtUtils::MakeMaker' => 0,
105 configure_requires => {
107 'ExtUtils::MakeMaker' => 0,
115 bugtracker => "http://rt.cpan.org/Dist/Display.html?Name=$dist",
116 homepage => "http://search.cpan.org/dist/$dist/",
117 license => 'http://dev.perl.org/licenses/',
118 repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
124 AUTHOR => 'Vincent Pit <perl@profvince.com>',
126 VERSION_FROM => $file,
127 ABSTRACT_FROM => $file,
131 BUILD_REQUIRES => \%BUILD_REQUIRES,
132 PREREQ_PM => \%PREREQ_PM,
133 MIN_PERL_VERSION => '5.006',
134 META_MERGE => \%META,
136 PREOP => "pod2text -u $file > \$(DISTVNAME)/README",
137 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
140 FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt*"
149 my $cv = join ' -coverage ', 'cover',
150 qw<statement branch condition path subroutine time>;