Align configuration of YAZ with Net::Z3950
authorAdam Dickmeiss <adam@indexdata.dk>
Sun, 13 Mar 2005 20:01:38 +0000 (20:01 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Sun, 13 Mar 2005 20:01:38 +0000 (20:01 +0000)
Makefile.PL

index b3826a6..d3bc617 100644 (file)
@@ -1,22 +1,27 @@
 use ExtUtils::MakeMaker;
 
 use ExtUtils::MakeMaker;
 
-## $Id: Makefile.PL,v 1.7 2004-08-03 08:59:37 mike Exp $
+## $Id: Makefile.PL,v 1.8 2005-03-13 20:01:38 adam Exp $
 
 
-my $libs = `yaz-config --libs threads` || die qq[
+my $yazconf = "yaz-config";
+my $yazinc = `$yazconf --cflags threads`;
+my $yazlibs = `$yazconf --libs threads`;
+if (!$yazinc && !$yazlibs) {
+   die qq[
 ERROR: Unable to call script: yaz-config
 If you're using a YAZ installation from the Debian package "yaz", you
 will also need to install "libyaz-dev" in order to build the
 SimpleServer module.
 ];
 ERROR: Unable to call script: yaz-config
 If you're using a YAZ installation from the Debian package "yaz", you
 will also need to install "libyaz-dev" in order to build the
 SimpleServer module.
 ];
+}
 
 # For Windows use
 
 # For Windows use
-# 'LIBS' => 'c:\yaz\lib\yaz.lib'
-# 'INC' => 'c:\yaz\include'
+# $yazinc = '-Ic:\yaz\include'
+# $yazlibs = 'c:\yaz\lib\yaz.lib'
 
 WriteMakefile(
     'NAME'     => 'Net::Z3950::SimpleServer',
     'VERSION_FROM' => 'SimpleServer.pm', # finds $VERSION
 
 WriteMakefile(
     'NAME'     => 'Net::Z3950::SimpleServer',
     'VERSION_FROM' => 'SimpleServer.pm', # finds $VERSION
-    'LIBS'     => [$libs],   # e.g., '-lm' 
+    'LIBS'     => [$yazlibs],   # e.g., '-lm' 
     'DEFINE'   => '',     # e.g., '-DHAVE_SOMETHING' 
     'DEFINE'   => '',     # e.g., '-DHAVE_SOMETHING' 
-    'INC'      => '',     # e.g., '-I/usr/include/other' 
+    'INC'      => $yazinc,     # e.g., '-I/usr/include/other' 
 );
 );