8aa3fd1b3485424b97f063df825f909a85353770
[simpleserver-moved-to-github.git] / Makefile.PL
1 use ExtUtils::MakeMaker;
2
3 ## $Id: Makefile.PL,v 1.9 2006-03-24 12:06:15 mike Exp $
4
5 my $yazconf = "yaz-config";
6 my $yazver = `$yazconf --version`;
7 my $yazinc = `$yazconf --cflags threads`;
8 my $yazlibs = `$yazconf --libs threads`;
9 if (!$yazver || (!$yazinc && !$yazlibs)) {
10    die qq[
11 ERROR: Unable to call script: yaz-config
12 If you're using a YAZ installation from the Debian package "yaz", you
13 will also need to install "libyaz-dev" in order to build the
14 SimpleServer module.
15 ];
16 }
17
18 # Judging by the YAZ NEWS file, 2.1.10 was the first release to
19 # include SRW/U support in the GFS
20 chomp($yazver);
21 my ($major, $minor, $trivial) = split(/\./, $yazver);
22 #print "major=$major, minor=$minor, trivial=$trivial\n";
23 die "You have YAZ version $major.$minor.$trivial; you need 2.1.10 or better"
24     if ($major < 2 || 
25         $major == 2 && $minor < 1 ||
26         $major == 2 && $minor == 1 && $trivial < 10);
27
28 # For Windows use
29 # $yazinc = '-Ic:\yaz\include'
30 # $yazlibs = 'c:\yaz\lib\yaz.lib'
31
32 WriteMakefile(
33     'NAME'      => 'Net::Z3950::SimpleServer',
34     'VERSION_FROM' => 'SimpleServer.pm', # finds $VERSION
35     'LIBS'      => [$yazlibs],   # e.g., '-lm' 
36     'DEFINE'    => '',     # e.g., '-DHAVE_SOMETHING' 
37     'INC'       => $yazinc,     # e.g., '-I/usr/include/other' 
38 );