~ubuntu-branches/ubuntu/wily/libsereal-encoder-perl/wily

« back to all changes in this revision

Viewing changes to Makefile.PL

  • Committer: Package Import Robot
  • Author(s): gregor herrmann
  • Date: 2014-10-20 18:26:33 UTC
  • mfrom: (17.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20141020182633-ojroz2634vd16lqf
Tags: 3.003-1
* Team upload.
* New upstream release.
* Bump versioned build dependency on libsereal-decoder-perl.
* Set SEREAL_USE_BUNDLED_LIBS=1 in debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
our $OPTIMIZE;
27
27
 
 
28
my $libs = '';
 
29
my $objects = '$(BASEEXT)$(OBJ_EXT) srl_encoder$(OBJ_EXT)';
28
30
my $defines = join " ", map "-D$_", grep exists $ENV{$_},
29
31
              qw(NOINLINE DEBUG MEMDEBUG NDEBUG ENABLE_DANGEROUS_HACKS);
30
32
 
56
58
  $defines .= " -Dinline= ";
57
59
}
58
60
 
59
 
# from Compress::Snappy
60
 
require Devel::CheckLib;
61
 
my $ctz = Devel::CheckLib::check_lib(
62
 
    lib      => 'c',
63
 
    function => 'return (__builtin_ctzll(0x100000000LL) != 32);'
64
 
) ? '-DHAVE_BUILTIN_CTZ' : '';
65
 
$defines .= " $ctz" if $ctz;
 
61
# Prefer external libraries over the bundled one.
 
62
inc::Sereal::BuildTools::check_external_libraries(\$libs, \$defines, \$objects);
 
63
 
 
64
if ($defines !~ /HAVE_CSNAPPY/) {
 
65
    # from Compress::Snappy
 
66
    require Devel::CheckLib;
 
67
    my $ctz = Devel::CheckLib::check_lib(
 
68
        lib      => 'c',
 
69
        function => 'return (__builtin_ctzll(0x100000000LL) != 32);'
 
70
    ) ? '-DHAVE_BUILTIN_CTZ' : '';
 
71
    $defines .= " $ctz" if $ctz;
 
72
}
66
73
 
67
74
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
68
75
# the contents of the Makefile that is written.
70
77
    MIN_PERL_VERSION => '5.008',
71
78
    META_MERGE => {
72
79
        resources => {
73
 
            repository => 'git://github.com/Sereal/Sereal.git',
74
 
            bugtracker => 'https://github.com/Sereal/Sereal/issues',
 
80
            repository => {
 
81
              url => 'git://github.com/Sereal/Sereal.git',
 
82
            },
 
83
            bugtracker => {
 
84
              web => 'https://github.com/Sereal/Sereal/issues',
 
85
            },
75
86
        },
 
87
        'meta-spec' => { version => 2 },
76
88
    },
77
 
    BUILD_REQUIRES => {
 
89
    TEST_REQUIRES => {
78
90
        'Test::More' => 0.88,
79
91
        'Scalar::Util' => 0,
80
 
        'File::Find' => 0,
81
92
        'File::Spec' => 0,
82
 
        'Scalar::Util' => 0,
83
 
        'File::Path' => 0,
84
 
        'ExtUtils::ParseXS' => '2.21',
85
93
        'Test::LongString' => '0',
 
94
        'Test::Warn' => '0',
86
95
        'Data::Dumper' => '0',
87
 
        'Test::Warn' => '0',
88
96
        'Sereal::Decoder' => '3.00',
89
97
    },
 
98
    BUILD_REQUIRES => {
 
99
        'File::Find' => 0,
 
100
        'File::Path' => 0,
 
101
        'ExtUtils::ParseXS' => '2.21',
 
102
    },
90
103
    NAME              => $module,
91
104
    VERSION_FROM      => 'lib/Sereal/Encoder.pm', # finds $VERSION
92
105
    PREREQ_PM         => {
95
108
    LICENSE => 'perl',
96
109
    ABSTRACT_FROM => 'lib/Sereal/Encoder.pm',
97
110
    AUTHOR => 'Steffen Mueller <smueller@cpan.org>, Yves Orton <yves@cpan.org>',
98
 
    LIBS              => [''], # e.g., '-lm'
 
111
    LIBS              => [$libs], # e.g., '-lm'
99
112
    DEFINE            => $defines,
100
113
    INC               => '-I.', # e.g., '-I. -I/usr/include/other'
101
114
    OPTIMIZE          => $OPTIMIZE,
102
 
    OBJECT            => '$(O_FILES)',
 
115
    OBJECT            => $objects,
103
116
    test              => {
104
117
        TESTS => "t/*.t t/*/*/*.t",
105
118
    },
112
125
    $eumm_version=eval $eumm_version;
113
126
    die "EXTRA_META is deprecated" if exists $params{EXTRA_META};
114
127
    die "License not specified" if not exists $params{LICENSE};
 
128
    if ($params{TEST_REQUIRES} and $eumm_version < 6.6303) {
 
129
        $params{BUILD_REQUIRES}={ %{$params{BUILD_REQUIRES} || {}} , %{$params{TEST_REQUIRES}} };
 
130
        delete $params{TEST_REQUIRES};
 
131
    }
115
132
    if ($params{BUILD_REQUIRES} and $eumm_version < 6.5503) {
116
133
        #EUMM 6.5502 has problems with BUILD_REQUIRES
117
134
        $params{PREREQ_PM}={ %{$params{PREREQ_PM} || {}} , %{$params{BUILD_REQUIRES}} };