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 $@;
23 print "Forcing the use of $cc as the C compiler.\n";
25 # Inspired from Module::Install::Can
26 print "Checking for a valid C compiler in the PATH... ";
27 my @ccs = ($Config{cc});
28 unshift @ccs, $ENV{CC} if $ENV{CC};
31 for my $dir (split /$Config{path_sep}/, $ENV{PATH}) {
32 my $abs = File::Spec->catfile($dir, $c);
33 if (-x $abs or MM->maybe_command($abs)) {
40 print "none\n" unless defined $cc;
44 push @C, 'Util.c' if defined $cc;
48 sub is_little_endian {
49 my $order = $Config{byteorder};
50 return 0 unless $order;
51 my $len = length $order;
53 $order = substr $order, 0, 8;
56 return $order eq (join '', 1 .. $len);
59 my $unit = { bits => 8, size => 1 };
60 if (not is_little_endian()) {
61 print "Forcing unit size of 8 on non-little-endian systems.\n";
63 print "Checking unit size in bits... ";
64 my $align = $Config{alignbytes} || 1;
65 my @bits = (8, 16, 32, 64);
66 for my $bits (@bits) {
67 my $size = $Config{"u${bits}size"};
69 $unit = { bits => $bits, size => $size } if $size && $size <= $align;
72 " (actually $unit->{size} bytes for $align bytes alignment).\n";
76 my $bits = $unit->{bits};
77 push @DEFINES, '-DBV_UNIT="' . ($Config{"u${bits}type"} || "U$bits") . '"';
78 push @DEFINES, "-DSVU_SIZE=$bits";
81 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
83 my $dist = 'Scalar-Vec-Util';
85 (my $name = $dist) =~ s{-}{::}g;
87 (my $file = $dist) =~ s{-}{/}g;
88 $file = "lib/$file.pm";
98 configure_requires => {
100 'ExtUtils::MakeMaker' => 0,
105 'ExtUtils::MakeMaker' => 0,
111 bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
112 homepage => "http://search.cpan.org/dist/$dist/",
113 license => 'http://dev.perl.org/licenses/',
114 repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
120 AUTHOR => 'Vincent Pit <perl@profvince.com>',
122 VERSION_FROM => $file,
123 ABSTRACT_FROM => $file,
127 PREREQ_PM => \%PREREQ_PM,
128 MIN_PERL_VERSION => '5.006',
129 META_MERGE => \%META,
131 PREOP => "pod2text -u $file > \$(DISTVNAME)/README",
132 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
135 FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt*"
144 my $cv = join ' -coverage ', 'cover',
145 qw<statement branch condition path subroutine time>;