Skip Menu |
 

This queue is for tickets about the DBD-ODBC CPAN distribution.

Report information
The Basics
Id: 73734
Status: resolved
Priority: 0/
Queue: DBD-ODBC

People
Owner: Nobody in particular
Requestors: rkitover [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.33
Fixed in: 1.34_4



Subject: debian is moving libraries to /usr/lib/i386-linux-gnu
Building DBD::ODBC on Debian unstable no longer works because the library directory is now /usr/lib/i386-linux-gnu rather than /usr/lib, and the Makefile.PL cannot find the unixODBC libraries and bails out. I made this change to the Makefile.PL to get it to compile: Index: Makefile.PL =================================================================== --- Makefile.PL (revision 15067) +++ Makefile.PL (working copy) @@ -1081,13 +1081,13 @@ my @dirs; # start with specified dir if there was one - push @dirs, "$home/lib" if defined($opt_o) || defined($ENV {ODBCHOME}); + push @dirs, "$home/lib/i386-linux-gnu", "$home/lib" if defined ($opt_o) || defined($ENV{ODBCHOME}); # look in perl's libspath as it is more likely to be compatible # (e.g., a lib64 dir) push @dirs, split(' ', $Config{libspath}); # add found odbc home if not added already - push @dirs, "$home/lib" if !defined($opt_o) && !defined($ENV {ODBCHOME}); + push @dirs, "$home/lib/i386-linux-gnu", "$home/lib" if !defined ($opt_o) && !defined($ENV{ODBCHOME}); for my $d(@dirs) { my @found;
Download (untitled) / with headers
text/plain 276b
This is the output of unpatched Makefile.PL: Looking for odbc_config to get cflags odbc_config not found - ok That's odd, I can't see any unixodbc libs in /usr. This is all I found: Perhaps you need to install the unixODBC development package, often called unixodbc-dev.
patch attached
Subject: dbd-odbc-multiarch.patch
Index: Makefile.PL =================================================================== --- Makefile.PL (revision 15067) +++ Makefile.PL (working copy) @@ -1048,13 +1048,25 @@ return; } +sub arch_lib_dir +{ + my $home = shift; + + -f '/etc/debian_version' || return (); + + chomp(my $arch_dir = + qx{dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null}); + + return $arch_dir ? "$home/lib/$arch_dir" : (); +} + sub find_iodbc { my $home = shift; # will be specified odbc home or one we've found my @dirs; # start with specified dir if there was one - push @dirs, "$home/lib" if defined($opt_o) || defined($ENV{ODBCHOME}); + push @dirs, arch_lib_dir($home), "$home/lib" if defined($opt_o) || defined($ENV{ODBCHOME}); # look in perl's libspath as it is more likely to be compatible # (e.g., a lib64 dir) @@ -1062,6 +1074,7 @@ # add found odbc home if not added already if (defined($opt_o) || defined($ENV{ODBCHOME})) { push @dirs, "$home"; + push @dirs, arch_lib_dir($home); push @dirs, "$home/lib"; } for my $d(@dirs) { @@ -1081,13 +1094,13 @@ my @dirs; # start with specified dir if there was one - push @dirs, "$home/lib" if defined($opt_o) || defined($ENV{ODBCHOME}); + push @dirs, arch_lib_dir($home), "$home/lib" if defined($opt_o) || defined($ENV{ODBCHOME}); # look in perl's libspath as it is more likely to be compatible # (e.g., a lib64 dir) push @dirs, split(' ', $Config{libspath}); # add found odbc home if not added already - push @dirs, "$home/lib" if !defined($opt_o) && !defined($ENV{ODBCHOME}); + push @dirs, arch_lib_dir($home), "$home/lib" if !defined($opt_o) && !defined($ENV{ODBCHOME}); for my $d(@dirs) { my @found;
Download (untitled) / with headers
text/plain 414b
On Wed Jan 04 09:16:22 2012, RKITOVER wrote: Show quoted text
> patch attached
I simple changed the existing Makefile.PL in find_unixodbc and find_iodbc subs like this: if (@found = glob "$d/libiodbc*") { ^^^ and if (@found = glob "$d/libodbc*") { ^^^ and it seems to work fine as it is already using libspath. Martin -- Martin J. Evans Wetherby, UK


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.