recipe and Makefile.PL tweak for building DBD::Oracle on Linux with Oracle"s Instant Client RPMs

recipe and Makefile.PL tweak for building DBD::Oracle on Linux with Oracle"s Instant Client RPMs

am 14.12.2005 21:06:11 von nathan.vonnahme

After a day of forehead-bashing I got DBD::Oracle to compile with the
Instant Client on Red Hat Enterprise Linux 4 - though I suspect it will
work with most other flavors. Here are my notes for the good of the
next person (and me next time I go looking):

To simplify/standardize the layout of the files I used the RPMs Oracle
provides. They scatter the files into /usr/lib/oracle,
/usr/include/oracle, and /usr/share/oracle, so I had to make an
adjustment in the Makefile.PL to find the .h files.

I used the pythian branch from the subversion repository (announced at
http://www.cpanforum.com/threads/1130). Here's the output of svn diff -
I don't have credentials to commit the change (nor do I want them!)

$ svn diff Makefile.PL
Index: Makefile.PL
==================== =====3D=
==================== =====3D=
=================3D
--- Makefile.PL (revision 2309)
+++ Makefile.PL (working copy)
@@ -18,6 +18,12 @@
## Changes made
## Adding in a few changes suggested by Andy Hassall

## that will enable the compile to work for Windows version of the IC
+##
+## Nathan.Vonnahme at banner health dot com
+## Dec 14 2005
+## tweak to find Oracle Instant Client 10.2.0.1 on Linux when
installed via Oracle's RPMs,
+## which scatter the instant client files into /usr/lib/oracle,
/usr/include/oracle, and
+## /usr/share/oracle

# vim: ts=3D8:sw=3D4

@@ -382,6 +388,7 @@
$linkwith_msg =3D "-l$lib.";
$opts{LIBS} =3D [ "-L$OH/$libdir -l$lib $syslibs"];
my $inc =3D "-I$OH\/sdk/include";
+ $inc .=3D " -I/usr/include/oracle/$client_version_full/client"; #
where Oracle's rpms put the .h files
$opts{INC} =3D "$inc -I$dbi_arch_dir";

}


I also had trouble with the environment variables; this is what finally
worked:
ORACLE_HOME=3D/usr/lib/oracle/10.2.0.1/client/lib
LD_LIBRARY_PATH=3D/usr/lib/oracle/10.2.0.1/client/lib


after those two changes, I could run `perl Makefile.PL` with no args and
get a working makefile.


--
nathan vonnahme, system engineer at fairbanks memorial hospital
1650 cowles street, fairbanks alaska 99701. 907-458-5464