Set the pointer alignment (in bits) via a C macro generated by the Makefile.PL
[p5sagit/Devel-Size.git] / Makefile.PL
1 use 5.008;
2 use ExtUtils::MakeMaker;
3
4 use Config;
5 (unpack "B*", pack "N", $Config{ptrsize}) =~ /^0+1(0+)$/
6   or die "Your pointer size of $Config{ptrsize} is very confusing";
7 my $ptr_bits = length $1;
8
9 WriteMakefile(
10   NAME => 'Devel::Size',
11   VERSION_FROM => 'lib/Devel/Size.pm',
12   DEFINE => "-DALIGN_BITS=$ptr_bits",
13   ($ExtUtils::MakeMaker::VERSION >= 6.47 ? (MIN_PERL_VERSION => '5.008') : ()),
14   ($ExtUtils::MakeMaker::VERSION >= 6.31 ? (LICENSE => 'perl') : ()),
15 );