3 use ExtUtils::MakeMaker;
6 eval { require Config };
7 die 'OS unsupported' if $@;
8 Config->import(qw/%Config/);
9 eval { require File::Spec };
10 die 'OS unsupported' if $@;
13 # Inspired from Module::Install::Can
14 print "Checking for a valid C compiler in the PATH... ";
15 my @ccs = ($Config{cc});
16 unshift @ccs, $ENV{CC} if $ENV{CC};
20 for my $dir (split /$Config{path_sep}/, $ENV{PATH}) {
21 my $abs = File::Spec->catfile($dir, $c);
22 if (-x $abs or MM->maybe_command($abs)) {
36 my $arch = $Config{archname} || '';
37 my ($cpu) = $arch =~ /^([^-]+)/;
41 if (unpack("h*", pack("s", 0x1234)) != 4321) {
42 print "Forcing unit size of 8 on non-little-endian systems.\n";
45 my $align = int($Config{alignbytes} || 0);
46 print "Checking unit size in bits... ";
48 my $size = int($Config{'u' . $_ . 'size'} || 0);
49 $unit = $_ if $size && $size <= $align;
53 push @DEFINES, DEFINE => '-DBV_UNIT="'
54 . ($unit == 64 ? 'uint64_t' : 'U' . $unit)
56 . ' -DSVU_SIZE=' . $unit;
58 my $BUILD_REQUIRES = {
60 'ExtUtils::MakeMaker' => 0,
65 my $tometa = ' >> $(DISTVNAME)/META.yml;';
66 my $build_req = 'echo "build_requires:" ' . $tometa;
67 foreach my $mod ( sort { lc $a cmp lc $b } keys %$BUILD_REQUIRES ) {
68 my $ver = $BUILD_REQUIRES->{$mod};
69 $build_req .= sprintf 'echo " %-30s %s" %s', "$mod:", $ver, $tometa;
75 NAME => 'Scalar::Vec::Util',
76 AUTHOR => 'Vincent Pit <perl@profvince.com>',
78 VERSION_FROM => 'lib/Scalar/Vec/Util.pm',
79 ABSTRACT_FROM => 'lib/Scalar/Vec/Util.pm',
89 PREOP => 'pod2text lib/Scalar/Vec/Util.pm > $(DISTVNAME)/README; '
91 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
93 clean => { FILES => 'Scalar-Vec-Util-* *.gcov *.gcda *.gcno cover_db' },
101 my $cv = join ' -coverage ', 'cover',
102 qw/statement branch condition path subroutine time/;