Subject: | Bug in Makefile.PL in DBD::Sybase |
Date: | Mon, 28 Oct 2013 11:35:59 -0400 |
To: | bug-DBD-Sybase [...] rt.cpan.org |
From: | Anthony Gilbert <agilbrt [...] gmail.com> |
Hi there,
I had a problem installing DBD::Sybase on Mac OSX 10.8.5. I have solved the
issue for my case and thought it might help you.
The DBD::Sybase version I have is DBD-Sybase-1.15 and the Makefile.PL file
has the CVS $Id of
# $Id: Makefile.PL,v 1.48 2012/10/26 19:11:54 mpeppler Exp $
The symptom of the bug was that it would crash with
Can't find any Sybase libraries in /opt/local/lib or /opt/local/lib64 at
Makefile.PL line 155, <IN> line 44.
when running Makefile.PL despite the fact that I have Macports' "freetds
@0.92.405_0 (active)" package installed, the SYBASE environment contained
'/opt/local' and the /opt/local/lib directory contains, among other files,
libct.4.dylib,libct.a, libct.dylib and libct.la
The bug stems from the lines
if ($^O =~ /win/i) {
@libdir = ( 'dll' );
}
Under Mac OSX, $^O is 'darwin', 'darwin' matches /win/i so @libdir gets
('dll'), /opt/local/dll does not exist so checkLib() shits itself because
it can't open the directory.
My fix.
Comment out the "if ($^O =~ /win/i) {...}" lines and everything works.
I assume the /win/ test is meant to test for Windows but that test is
broken.
The checkLib() method could also croak() or warn() if the first directory
that it finds is not readable instead of die'ing.
--
Anthony Gilbert -------- agilbrt gmail.com