| byterock@cvs.perl.org 2005-09-27, 9:25 am |
| Author: byterock
Date: Tue Sep 27 04:17:38 2005
New Revision: 1527
Modified:
dbd-oracle/branches/pythian/Makefile.PL
dbd-oracle/branches/pythian/README.linux
Log:
Check in of working copy of Makefile.PL for intantclient
Modified: dbd-oracle/branches/pythian/Makefile.PL
====================
====================
====================
==================
--- dbd-oracle/branches/pythian/Makefile.PL (original)
+++ dbd-oracle/branches/pythian/Makefile.PL Tue Sep 27 04:17:38 2005
@@ -1,6 +1,16 @@
##
## You should not need to edit this file.
-##
+## Ok I edited it! So what are you going to do about it?
+## John Scoles The Pythian Group
+## September 20 2005
+## scoles@pythian.com
+## changes made
+## Added a new option flag '-ic10' which will
+## do the code under its if statment
+## it look for the the lib files at <$OH/lib*>
+## it set the inc dir as follows $inc = "-I$OH\/sdk/include";
+## and removes the if stament for other oracle versions
+
# vim: ts=8:sw=4
BEGIN { $^W = 1 }
@@ -41,6 +51,7 @@ my $os = $^O;
my $osvers = $Config{osvers}; $osvers =~ s/^\s*(\d+\.\d+).*/$1/; # drop sub-sub-version: 2.5.1 -> 2.5
my $exe_ext = ($os eq 'VMS') ? '.pl' : '';
my $BELL = "\a";
+# put this here as it might change
$| = 1;
my %opts = (
@@ -74,6 +85,7 @@ my %mk_target_rules;
# Options (rarely needed)
# to turn off an option prefix with 'no', ie 'perl Makefile.PL -nob'
+$::opt_ic10 = 1; # Build for Oracle 10g instantclient
$::opt_b = 1; # try to use Oracle's own 'build' rule
$::opt_r = ''; # With -b above, use this names build rule (eg -r=build64)
$::opt_m = 0; # path to proc.mk or oracle.mk file to read
@@ -96,7 +108,7 @@ $::opt_V = 0; # force assumption of sp
# and we force our emulation of OCILobWriteAppend
Getopt::Long::config
( qw( no_ignore_case ) );
-GetOptions(qw(b! r=s v! d! g! p! l! c! f! F! W! w! m=s n=s s=s S=s V=s ProC!))
+GetOptions(qw(b! r=s v! d! g! p! l! c! f! F! W! w! ic10! m=s n=s s=s S=s V=s ProC!))
or die "Invalid arguments";
$::opt_g &&= '-g'; # convert to actual string
@@ -120,7 +132,6 @@ print "\n Configuring DBD::Oracle ...\n
# --- Where is Oracle installed...
my $ORACLE_ENV = ($os eq 'VMS') ? 'ORA_ROOT' : 'ORACLE_HOME';
-
my $OH = $ENV{$ORACLE_ENV} || '';
$OH = win32_oracle_home($O
H) if ($os eq 'MSWin32') or ($os =~ /cygwin/i);
$OH = unixify $OH if $os eq 'VMS';
@@ -133,6 +144,7 @@ die qq{ The $ORACLE_ENV environment var
ABORTED!
} unless $OH;
+
die qq{ The $ORACLE_ENV environment variable value ($OH) is not valid.
It must be set to hold the path to an Oracle installation directory
on this machine (or a machine with a compatible architecture)
@@ -140,6 +152,16 @@ die qq{ The $ORACLE_ENV environment var
ABORTED!
} unless (($os eq 'VMS') ? -d $OH : -d "$OH/lib/.");
+#this unless supports the ora 10g client
+
+die qq{ The $ORACLE_ENV environment variable value ($OH) is not valid.
+ It must be set to hold the path to an Oracle installation directory
+ on this machine (or a machine with a compatible architecture)
+ See the README.clients file for more information.
+ ABORTED!
+
+} unless ( -d $OH );
+
print "Using Oracle in $OH\n";
# $client_version => Major.Minor, $client_version_full
=> Major.Minor.X.Y.Z
@@ -200,6 +222,7 @@ if ($os eq 'VMS') {
}
elsif (($os eq 'MSWin32') or ($os =~ /cygwin/i)) {
+
my $OCIDIR = "";
find( sub {
print "Found $_ directory\n" if /^OCI\d*$/i;
@@ -266,7 +289,7 @@ elsif (($os eq 'MSWin32') or ($os =~ /cy
# --- UNIX Variants ---
elsif ($::opt_l and # use -l to enable this direct-link approach
- @_=grep { m:/lib(cl(ie)?ntsh|oracle).\w+$:o } <$OH/lib/lib*>
+ @_=grep { m:/lib(cl(ie)?ntsh|oracle).\w+$:o } <$OH/lib/lib*>
) {
# --- the simple modern way ---
foreach(@_) { s:\Q$OH/lib/::g }
@@ -278,17 +301,39 @@ elsif ($::opt_l and # use -l to enable t
$opts{dynamic_lib} = { OTHERLDFLAGS => "$::opt_g" };
my @h_dirs = find_headers();
if ($client_version_ful
l =~ /^8.0.6/ && $os eq 'hpux') {
- $linkwith_msg = "-lextp -l$lib.";
- $opts{LIBS} = [ "-L$OH/$libdir -lextp -l$lib $syslibs" ];
- push @h_dirs, 'network/public';
+ $linkwith_msg = "-lextp -l$lib.";
+ $opts{LIBS} = [ "-L$OH/$libdir -lextp -l$lib $syslibs" ];
+ push @h_dirs, 'network/public';
}
else {
- $linkwith_msg = "-l$lib.";
- $opts{LIBS} = [ "-L$OH/$libdir -l$lib $syslibs" ];
+ $linkwith_msg = "-l$lib.";
+ $opts{LIBS} = [ "-L$OH/$libdir -l$lib $syslibs" ];
}
my $inc = join " ", map { "-I$OH/$_" } @h_dirs;
$opts{INC} = "$inc -I$dbi_arch_dir";
}
+# --- special case for Oracle 10g instant client
+
+elsif (($::opt_ic10) and # uses the -l direct-link approach as well
+ @_=grep { m:/lib(cl(ie)?ntsh|oracle).\w+$:o } <$OH/lib*>
+ ) {
+ # --- the simple modern way ---
+ foreach(@_) { s:\Q$OH/lib/::g }
+ print "Found direct-link candidates: @_\n";
+ my $lib = ("@_" =~ m:lib(cl(ie)?ntsh)\.:) ? $1 : "oracle";
+ my $syslibs = read_sysliblist();
+ print "Oracle sysliblist: $syslibs\n";
+ my $libdir = ora_libdir();
+ $opts{dynamic_lib} = { OTHERLDFLAGS => "$::opt_g" };
+ $linkwith_msg = "-l$lib.";
+ $opts{LIBS} = [ "-L$OH/$libdir -l$lib $syslibs" ];
+
+ my $inc = "-I$OH\/sdk/include";
+
+ $opts{INC} = "$inc -I$dbi_arch_dir";
+
+ print "libs=$opts{LIBS}[0]\n";
+}
else { # --- trawl the guts of Oracle's make files looking the how it wants to link
#Lincoln: pick the right library path
Modified: dbd-oracle/branches/pythian/README.linux
====================
====================
====================
==================
--- dbd-oracle/branches/pythian/README.linux (original)
+++ dbd-oracle/branches/pythian/README.linux Tue Sep 27 04:17:38 2005
@@ -48,3 +48,22 @@ smooth as just about every other CPAN mo
I don't know if Oracle is bulletproof on Linux but the install process
has some problems.
+
+From: John Scoles <scoles@pythian.com>
+Date: Thurs, 22 Sep 2005 07:00:00 -0600 (EST)
+Subject Oracle 10g Instantclient
+
+I have modified the Makefile.PL by adding a -ic10 option flag.
+This does the same action as a -l but looks for files in different dirs.
+I am working on a new Makefile.PL that auto-detects for the Instantclient
+Check out this thread
+http://www.cpanforum.com/threads/229
+at the cpan form as my new Makefile.PL incorporates the changes indicated in this thread.
+You may have to set some links as follows
+ln -s . lib
+ln -s libclntsh.so.10.1 libclntsh.so
+ln -s libocci.so.10.1 libocci.so
+depending where the Instantclient is installed.
+
+
+
|