paulj paulj - 3 months ago 23
Perl Question

Installing DBD::Sybase on OS X with Homebrew fails to find freetds libraries

I am installing DBD::Sybase

I receive following error, after setting

export SYBASE=/usr/local/Cellar/freetds/0.95.80

and download freetds:

brew install freetds


Configuring DBD-Sybase-1.15 ... Can't find any Sybase libraries in /usr/local/Cellar/freetds/0.95.80/lib or /usr/local/Cellar/freetds/0.95.80/lib64 at Makefile.PL line 155, <IN> line 44

I believe I need to edit the makefile directly. Do I need to edit makefile? And could I use CPANM still. CPANM is under Brew (cellar).

├── libct.4.dylib
├── libct.a
├── libct.dylib -> libct.4.dylib
├── libsybdb.5.dylib
├── libsybdb.a
└── libsybdb.dylib -> libsybdb.5.dylib

AUTHORS ChangeLog NEWS TODO etc lib


There is a reported bug in DBD::Sybase on OS X which is causing your problem.

One part of the configuration thinks you're on Windows. Perl reports OS X as darwin and DBD::Sybase is checking for /win/ as in MSWin32 or maybe cygwin. As a result it looks for a dll directory, but falsely reports it's looking for lib and lib64.

The quick fix is to use cpanm --prompt DBD::Sybase. When it fails, cpanm will ask what to do.

Configuring DBD-Sybase failed.
You can s)kip, r)etry, e)xamine build log, or l)ook ? [s]

Tell it to l)ook. This will dump you into a shell with the unpacked source for DBD::Sybase. Use an editor to delete lines 143-145 in the Makefile.PL.

if ($^O =~ /win/i) {
  @libdir = ( 'dll' );

Then exit the shell. cpanm will ask you what to do again, tell it to r)etry. It should use your edited Makefile.PL.