Add (commented-out) OPTIMIZE line
[simpleserver-moved-to-github.git] / Makefile.PL
1 use ExtUtils::MakeMaker;
2
3 ## $Id: Makefile.PL,v 1.11 2006-07-24 23:04:33 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 chomp($yazver);
19 my ($major, $minor, $trivial) = split(/\./, $yazver);
20 # Judging by the YAZ NEWS file, 2.0.0 was the first release to
21 # include SRW/U support in the GFS
22 my ($needMaj, $needMin, $needTriv) = (2, 0, 0);
23 #print "major=$major, minor=$minor, trivial=$trivial\n";
24 die "You have YAZ version $major.$minor.$trivial; " .
25     "you need $needMaj.$needMin.$needTriv or better."
26     if ($major < $needMaj || 
27         $major == $needMaj && $minor < $needMin ||
28         $major == $needMaj && $minor == $needMin && $trivial < $needTriv);
29
30 # For Windows use
31 # $yazinc = '-Ic:\yaz\include'
32 # $yazlibs = 'c:\yaz\lib\yaz.lib'
33
34 WriteMakefile(
35     'NAME'      => 'Net::Z3950::SimpleServer',
36     'VERSION_FROM' => 'SimpleServer.pm', # finds $VERSION
37     'LIBS'      => [$yazlibs],   # e.g., '-lm' 
38     'DEFINE'    => '',     # e.g., '-DHAVE_SOMETHING' 
39     'INC'       => $yazinc,     # e.g., '-I/usr/include/other' 
40 #    OPTIMIZE   => "-Wdeclaration-after-statement -g -O0",
41 );