~ubuntu-branches/debian/sid/libsane-perl/sid

« back to all changes in this revision

Viewing changes to Makefile.PL

  • Committer: Bazaar Package Importer
  • Author(s): Jeffrey Ratcliffe
  • Date: 2008-11-25 20:31:30 UTC
  • Revision ID: james.westby@ubuntu.com-20081125203130-6j89phvesi73dxui
Tags: upstream-0.02
ImportĀ upstreamĀ versionĀ 0.02

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
use 5.008;
 
2
use ExtUtils::MakeMaker;
 
3
use ExtUtils::Depends;
 
4
use ExtUtils::PkgConfig;
 
5
 
 
6
# minimum required version of dependancies we need to build
 
7
our %build_reqs = (
 
8
        'libsane' => '1.0.19',
 
9
);
 
10
 
 
11
# minimum required version of dependancies we need to run
 
12
our %runtime_reqs = (
 
13
        'libsane' => '1.0.19',
 
14
);
 
15
 
 
16
# Can't assume ExtUtils::PkgConfig will return anything useful until
 
17
# the pkg-config files ship with sane.
 
18
my $lib = '-lsane';
 
19
my $inc = '-I. ';
 
20
if (eval {
 
21
  %pkgcfg = ExtUtils::PkgConfig->find ('sane-backends >= '. $build_reqs{libsane})
 
22
}) {
 
23
 $lib = $pkgcfg{libs};
 
24
 $inc .= $pkgcfg{cflags};
 
25
}
 
26
 
 
27
$runtime_reqs{libsane} = $pkgcfg{modversion};
 
28
 
 
29
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
 
30
# the contents of the Makefile that is written.
 
31
WriteMakefile(
 
32
    NAME              => 'Sane',
 
33
    VERSION_FROM      => 'lib/Sane.pm', # finds $VERSION
 
34
    PREREQ_PM         => {}, # e.g., Module::Name => 1.1
 
35
    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
 
36
      (ABSTRACT_FROM  => 'lib/Sane.pm', # retrieve abstract from module
 
37
       AUTHOR         => 'Jeffrey Ratcliffe') : ()),
 
38
    LIBS              => [$lib], # e.g., '-lm'
 
39
    DEFINE            => '', # e.g., '-DHAVE_SOMETHING'
 
40
    INC               => $inc, # e.g., '-I. -I/usr/include/other'
 
41
        # Un-comment this if you add C files to link with later:
 
42
    # OBJECT            => '$(O_FILES)', # link all the C files too
 
43
);