Subject: | 1.22 doesn't compile on 64 bit systems with unixODBC |
Date: | Tue, 07 Jul 2009 17:31:59 +0200 |
To: | bug-DBD-ODBC [...] rt.cpan.org |
From: | Marten Lehmann <lehmann [...] cnm.de> |
Hi,
since my installation always broke with this error:
"I cannot find an ODBC driver manager that I recognize.
...And I know about these drivers:
Microsoft ODBC, adabas, easysoft, empress, esodbc, informix,
intersolve, iodbc, sapdb, solid, udbc, unixodbc"
I looked into Makefile.PL and found this obvious problem at line 349:
$myodbc = 'unixodbc'
if !$myodbc && glob "$odbchome/lib/libodbc.*";
So Makefile.PL will never detect unixodbc (and other driver managers as
well) correctly on 64 bit systems, since most modern 64 bit systems put
their libraries into "lib64" and not "lib" os 32 bit systems.
The same problem occurs later at line 475:
my @libs = glob "$odbchome/lib/libodbc.*";
I attached a patch for release 1.22 which will make it work on 64 bit,
but then it won't work on 32 bit any longer. Makefile.PL should include
a --libdir parameter to define "lib" or "lib64", or maybe it can detect
this on its own.
Kind regards
Marten Lehmann
--- DBD-ODBC-1.22/Makefile.PL.orig 2009-04-20 17:21:34.000000000 +0200
+++ DBD-ODBC-1.22/Makefile.PL 2009-07-06 18:20:02.000000000 +0200
@@ -347,7 +347,7 @@
$arext =~ s/^\.//;
$myodbc = 'unixodbc'
- if !$myodbc && glob "$odbchome/lib/libodbc.*";
+ if !$myodbc && glob "$odbchome/lib64/libodbc.*";
$myodbc = 'iodbc'
if !$myodbc && ((glob "$odbchome/*iodbc*") ||
@@ -472,7 +472,7 @@
} else {
print " odbc_config not found - ok\n";
}
- my @libs = glob "$odbchome/lib/libodbc.*";
+ my @libs = glob "$odbchome/lib64/libodbc.*";
my @ilibs = grep { /\.($Config{so}|$Config{dlext}|a)$/ } @libs;
if (scalar(@ilibs) == 0) {
die "That's odd, I can't see any unixodbc libs in $odbchome." .