~ubuntu-branches/debian/sid/libsereal-decoder-perl/sid

« back to all changes in this revision

Viewing changes to inc/Sereal/BuildTools.pm

  • Committer: Package Import Robot
  • Author(s): gregor herrmann
  • Date: 2014-10-20 18:24:15 UTC
  • mfrom: (1.1.20)
  • Revision ID: package-import@ubuntu.com-20141020182415-2ess8kil1bszql6f
Tags: 3.003-1
* Team upload.
* New upstream release.
* Set SEREAL_USE_BUNDLED_LIBS=1 in debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1264
1264
  }
1265
1265
}
1266
1266
 
 
1267
# Prefer external csnappy and miniz libraries over the bundled ones.
 
1268
sub check_external_libraries {
 
1269
  my ($libs, $defines, $objects) = @_;
 
1270
  require Devel::CheckLib;
 
1271
 
 
1272
  if (
 
1273
    !$ENV{SEREAL_USE_BUNDLED_LIBS} &&
 
1274
    !$ENV{SEREAL_USE_BUNDLED_CSNAPPY} &&
 
1275
    Devel::CheckLib::check_lib(
 
1276
      lib      => 'csnappy',
 
1277
      header   => 'csnappy.h'
 
1278
  )) {
 
1279
    print "Using installed csnappy library\n";
 
1280
    $$libs .= ' -lcsnappy';
 
1281
    $$defines .= ' -DHAVE_CSNAPPY';
 
1282
  } else {
 
1283
    print "Using bundled csnappy code\n";
 
1284
  }
 
1285
 
 
1286
  if (
 
1287
    !$ENV{SEREAL_USE_BUNDLED_LIBS} &&
 
1288
    !$ENV{SEREAL_USE_BUNDLED_MINIZ} &&
 
1289
    Devel::CheckLib::check_lib(
 
1290
      lib      => 'miniz',
 
1291
      header   => 'miniz.h'
 
1292
  )) {
 
1293
    print "Using installed miniz library\n";
 
1294
    $$libs .= ' -lminiz';
 
1295
    $$defines .= ' -DHAVE_MINIZ';
 
1296
  } else {
 
1297
    print "Using bundled miniz code\n";
 
1298
    $$objects .= ' miniz$(OBJ_EXT)';
 
1299
  }
 
1300
}
1267
1301
 
1268
1302
1;
1269
1303