[continued from previous message]
+ @hkey = map { $hkey->Open($_, $_); $_ } @hkey;
+ return @hkey;
+ };
} unless $req_ok;
# Workaround Win32::TieRegistry FETCH error during global destruction. @@ -1063,38 +1062,38 @@
# Look for ORACLE_HOME in all ORACLE sub-folders, use last one found
# before 8.1.5, there should be only one
eval {
- my ($oh1, %oh);
- my @hkey = ($hkey);
- # JLU: December 5, 2002: if the "default" home is set and has
- # an OCI directory, then use it.
- if ($default_home && -d $default_home && -d $default_home . "/oci") { - $oh = $default_home;
- } else {
- # use previous logic if default home doesn't have OCI
- # directory
- while (@hkey) {
- $hkey = shift @hkey;
- $oh = $oh1, $oh{$oh1} = 1
- if ($oh1 = &$Val($hkey)) && -d $oh1;
- push @hkey, &$Keys($hkey);
- }
- if (1 < keys %oh) {
- # JLU: 8/21/01 Oracle's default home is the first one in
- # the path, at least with 8i
- print "\n\007Multiple Oracle homes: ", join(" ", sort keys %oh), "\n\n";
- my @path = split(";", $ENV{PATH});
- my $dir;
- foreach $dir (@path) {
- # the path will be c:\path\to\home\bin, so remove \bin if it's there.
- $dir =~ s/\\bin$//;
- if (defined($oh{$dir})) {
- print "$dir is first in the PATH, so we'll use that as Oracle's default home.\n\n";
- $oh = $dir;
- last;
- }
- }
- }
- }
+ my ($oh1, %oh);
+ my @hkey = ($hkey);
+ # JLU: December 5, 2002: if the "default" home is set and has
+ # an OCI directory, then use it.
+ if ($default_home && -d $default_home && -d $default_home . "/oci") {
+ $oh = $default_home;
+ } else {
+ # use previous logic if default home doesn't have OCI
+ # directory
+ while (@hkey) {
+ $hkey = shift @hkey;
+ $oh = $oh1, $oh{$oh1} = 1
+ if ($oh1 = &$Val($hkey)) && -d $oh1;
+ push @hkey, &$Keys($hkey);
+ }
+ if (1 < keys %oh) {
+ # JLU: 8/21/01 Oracle's default home is the first one in
+ # the path, at least with 8i
+ print "\n\007Multiple Oracle homes: ", join(" ", sort keys %oh), "\n\n";
+ my @path = split(";", $ENV{PATH});
+ my $dir;
+ foreach $dir (@path) {
+ # the path will be c:\path\to\home\bin, so remove \bin if it's there.
+ $dir =~ s/\\bin$//;
+ if (defined($oh{$dir})) {
+ print "$dir is first in the PATH, so we'll use that as Oracle's default home.\n\n";
+ $oh = $dir;
+ last;
+ }
+ }
+ }
+ }
} if defined $Keys;
}
@@ -1106,14 +1105,17 @@
sub read_sysliblist {
my $syslibs = (-f "$OH/lib/sysliblist")
- ? read_file("$OH/lib/sysliblist")
- : (-f "$OH/rdbms/lib/sysliblist") ? read_file("$OH/rdbms/lib/sysliblist") : '';
+ ? read_file("$OH/lib/sysliblist")
+ : (-f "$OH/rdbms/lib/sysliblist") ? read_file("$OH/rdbms/lib/sysliblist") : '';
if ($^O eq "hpux") {
$syslibs =~ s/-l:lib(\w+).(sl|a)\b/-l$1/g;
$syslibs =~ s/\s*-ldld\b//g;
$linkwith =~ m/-lcl\b/ or
$syslibs =~ s/\s*-lcl\b//g;
}
+ if (lc(@Config{qw(myuname)}) =~ /debian/) {
+ $syslibs .= " -Wl,--no-as-needed -lnnz12 -lons -lclntshcore -lipc1 -lmql1";
+ }
return $syslibs;
}
@@ -1145,8 +1147,8 @@
my @del;
push @del, $1 while $str =~ s:([^\s=]*\bcrt[1in]\.o)\b::;
if ($orig ne $str) {
- print "Deleted @del from link args.\n" if $verbose;
- print "del_crtobj: $orig\n : $str\n@del\n" if $::opt_v;
+ print "Deleted @del from link args.\n" if $verbose;
+ print "del_crtobj: $orig\n : $str\n@del\n" if $::opt_v;
}
return $str;
}
@@ -1155,19 +1157,19 @@
sub find_mkfile {
my @mk_oci32 = (
- 'rdbms/demo/demo_xe.mk',
+ 'rdbms/demo/demo_xe.mk',
'rdbms/demo/demo_rdbms32.mk',
'rdbms/demo/demo_rdbms.mk',
'rdbms/lib/ins_rdbms.mk', #Oracle 11 full client
'sdk/demo/demo.mk' #OIC .mk location
);
my @mk_oci64 = (
- 'rdbms/demo/demo_xe.mk',
- 'rdbms/lib/oracle.mk',
- 'rdbms/demo/oracle.mk',
- 'rdbms/demo/demo_rdbms.mk',
- 'rdbms/demo/demo_rdbms64.mk',
- 'rdbms/lib/ins_rdbms.mk', #Oracle 11 full client
+ 'rdbms/demo/demo_xe.mk',
+ 'rdbms/lib/oracle.mk',
+ 'rdbms/demo/oracle.mk',
+ 'rdbms/demo/demo_rdbms.mk',
+ 'rdbms/demo/demo_rdbms64.mk',
+ 'rdbms/lib/ins_rdbms.mk', #Oracle 11 full client
'sdk/demo/demo.mk' # git issue 20 - path on mac os
);
my @mk_oci = perl_is_64bit() ? @mk_oci64 : @mk_oci32;
@@ -1180,37 +1182,37 @@
my @mkplaces = ($::opt_p) ? (@mk_oci) : (@mk_oci);
if ($::opt_m) {
- $::opt_m = cwd()."/$::opt_m" unless $::opt_m =~ m:^/:;
- die "-m $::opt_m: not found" unless -f $::opt_m;
- unshift @mkplaces, $::opt_m;
+ $::opt_m = cwd()."/$::opt_m" unless $::opt_m =~ m:^/:;
+ die "-m $::opt_m: not found" unless -f $::opt_m;
+ unshift @mkplaces, $::opt_m;
}
my $mkfile;
- foreach my $place (@mkplaces) {
- $place = "$OH/$place"
- unless $place =~ m:^[/\.]:; # abs or relative path
- next unless -f $place;
- $mkfile ||= $place; # use first one found
- print "Found $place\n";
+ for my $place (@mkplaces) {
+ $place = "$OH/$place"
+ unless $place =~ m:^[/\.]:; # abs or relative path
+ next unless -f $place;
+ $mkfile ||= $place; # use first one found
+ print "Found $place\n";
}
unless ($^O eq 'MSWin32' || $^O eq 'VMS' || ($mkfile && -f $mkfile) || $::opt_F) {
- $::opt_l or return ($mkfile = undef);
- die qq{
- Unable to locate an oracle.mk or other suitable *.mk
- file in your Oracle installation. (I looked in
- @mkplaces under $OH)
-
- The oracle.mk (or demo_rdbms.mk) file is part of the Oracle
- RDBMS product. You need to build DBD::Oracle on a
- system which has one of these Oracle components installed.
- (Other *.mk files such as the env_*.mk files will not work.)
- Alternatively you can use Oracle Instant Client.
-
- In the unlikely event that a suitable *.mk file is installed
- somewhere non-standard you can specify where it is using the -m option: - perl Makefile.PL -m /path/to/your.mk
+ $::opt_l or return ($mkfile = undef);
+ die qq{
+ Unable to locate an oracle.mk or other suitable *.mk
+ file in your Oracle installation. (I looked in
+ @mkplaces under $OH)
+
+ The oracle.mk (or demo_rdbms.mk) file is part of the Oracle
+ RDBMS product. You need to build DBD::Oracle on a
+ system which has one of these Oracle components installed.
+ (Other *.mk files such as the env_*.mk files will not work.)
+ Alternatively you can use Oracle Instant Client.
+
+ In the unlikely event that a suitable *.mk file is installed
+ somewhere non-standard you can specify where it is using the -m option:
+ perl Makefile.PL -m /path/to/your.mk
- See the appropriate troubleshooting guide for your OS for more information and some alternatives.
- };
+ See the appropriate troubleshooting guide for your OS for more information and some alternatives.
+ };
}
print "Using $mkfile\n";
@@ -1227,32 +1229,32 @@
# Don't include the following definitions in the generated
# makefile (note that %MK stills gets these values).
my @edit = qw(
- SHELL CC CPP CFLAGS CCFLAGS OPTIMIZE ASFLAGS RCC LD LDFLAGS
- AR AS CHMOD ECHO EXE OBJS PERL OBJ_EXT LIB_EXT VERSION
+ SHELL CC CPP CFLAGS CCFLAGS OPTIMIZE ASFLAGS RCC LD LDFLAGS
+ AR AS CHMOD ECHO EXE OBJS PERL OBJ_EXT LIB_EXT VERSION
);
my %edit; @edit{@edit} = ('$_ = ""') x @edit;
$edit{ORA_NLS} = $edit{ORA_NLS33} = $edit{ORA_NLS32} = q{
- print "Deleting $_\n",
- " because it is not already set in the environment\n",
- " and it can cause ORA-01019 errors.\n";
- $_ = '';
+ print "Deleting $_\n",
+ " because it is not already set in the environment\n",
+ " and it can cause ORA-01019 errors.\n";
+ $_ = '';
} unless $ENV{ORA_NLS} || $ENV{ORA_NLS33} || $ENV{ORA_NLS32}
- || 1; # Old problem? Let's try without it for a while
+ || 1; # Old problem? Let's try without it for a while
$edit{COMPOBJS} = q{
- # Firstly a Solaris specific edit:
- $_ = del_crtobj($_) if $^O eq 'solaris';
+ # Firstly a Solaris specific edit:
+ $_ = del_crtobj($_) if $^O eq 'solaris';
- # Delete any object files in COMPOBJS that don't actually exist
- my $of;
- foreach $of (split(/=|\s+/)) {
- next if !$of or $of eq "COMPOBJS";
- my $obj = expand_mkvars($of,0,0);
- next if -e $obj;
- print "Deleting $of from COMPOBJS because $obj doesn't exist.\n";
- s:\Q$of::;
- }
+ # Delete any object files in COMPOBJS that don't actually exist
+ my $of;
+ foreach $of (split(/=|\s+/)) {
+ next if !$of or $of eq "COMPOBJS";
+ my $obj = expand_mkvars($of,0,0);
+ next if -e $obj;
+ print "Deleting $of from COMPOBJS because $obj doesn't exist.\n"; + s:\Q$of::;
+ }
};
# deal with (some subversions) of Oracle8.0.3's incompatible use of OBJ_EXT
@@ -1266,117 +1268,117 @@
my $lastline = '';
my @lines = read_inc_file($file);
for(1; $_ = shift(@lines); $lastline = $_){
- # Join split lines but retain backwack and newlines:
- $_ .= shift @lines while(m/\\[\r\n]+$/);
- chomp;
- push @MK, '' if $_ eq '' and $lastline ne ''; # squeeze multiple blank lines
- next unless $_;
-
- if ($incompat_ext) {
- s/\.(\$\(OBJ_EXT\))/$1/g;
- s/\.(\$\(LIB_EXT\))/$1/g;
- }
- # skip compiler options for undesirable compilers
- m/^ifdef (\w+)/ and do {
- if ($ignore_def{$1}) {
- $_ = shift @lines until m/^endif/;
- next;
- }
- };
+ # Join split lines but retain backwack and newlines:
+ $_ .= shift @lines while(m/\\[\r\n]+$/);
+ chomp;
+ push @MK, '' if $_ eq '' and $lastline ne ''; # squeeze multiple blank lines
+ next unless $_;
+
+ if ($incompat_ext) {
+ s/\.(\$\(OBJ_EXT\))/$1/g;
+ s/\.(\$\(LIB_EXT\))/$1/g;
+ }
+ # skip compiler options for undesirable compilers
+ m/^ifdef (\w+)/ and do {
+ if ($ignore_def{$1}) {
+ $_ = shift @lines until m/^endif/;
+ next;
+ }
+ };
if (m!^([-\w/+.\$()\s]+)\s*:+\s*([^=]*)!) { # skip targets
my @tgts = split(/ /, $1); # multiple target names in Oracle9i's demo_rdbms.mk
- for (@tgts) { $mk_target_deps{$_} = $2 || '' }
- my @rules;
+ for (@tgts) { $mk_target_deps{$_} = $2 || '' }
+ my @rules;
while (@lines && $lines[0] =~ m!^\t! && chomp $lines[0]) {
my $tmp_line = shift @lines;
- while($tmp_line =~ m!\\$!) { # continuations!
+ while($tmp_line =~ m!\\$!) { # continuations!
$tmp_line =~ s/\s+\\$/ /;
$tmp_line .= shift @lines;
chomp($tmp_line);
}
- push @rules, $tmp_line;
- #print "target @tgts => $mk_target_deps{$tgt} => @{$mk_target_rules{$tgt}}\n";
+ push @rules, $tmp_line;
+ #print "target @tgts => $mk_target_deps{$tgt} => @{$mk_target_rules{$tgt}}\n";
}
- for (@tgts) { push @{ $mk_target_rules{$_} ||= [] }, @rules }
+ for (@tgts) { push @{ $mk_target_rules{$_} ||= [] }, @rules }
next;
}
- next if m!^\t!; # skip target build rules
- next if m/^\s*\.SUFFIXES/;
+ next if m!^\t!; # skip target build rules
+ next if m/^\s*\.SUFFIXES/;
- unless($MK{mkver}) { # still want to get version number
- my $line = $_; $line =~ s/[\\\r\n]/ /g;
- $MK{mkver} = $mkver = $1
- if $line =~ m/\$Header:.*?\.mk.+(\d+\.\d+)/;
- }
-
- # We always store values into %MK before checking %edit
- # %edit can edit this in addition to $_ if needed.
- my $name;
- if (m/^\s*(\w+)\s*(\+?)=\s*/) {
- $name = $1;
- my $append = $2;
- my $value = $';
- $value =~ s/^\@`/`/;
- if ($append) {
- my $expanded = expand_mkvars($value, 0, 1);
- print "Appending '$expanded' to $name\n" if $::opt_v;
- $value = $MK{$name} ? "$MK{$name} $expanded" : $expanded;
- }
- elsif ($MK{$name} && $MK{$name} ne $value) {
- print "$name macro redefined by Oracle\n from $MK{$name}\n to $value\n"
- if $::opt_d;
- }
- $MK{$name} = $value;
- $MK{$name} =~ s/^([^#]*)#.*/$1/; # remove comments
-
- if (exists $edit{$name}) {
- my $pre = $_;
- eval $edit{$name}; # execute code to edit $_
- print "Edit $name ($edit{$name}) failed: $@\n" if $@;
- if ($_ ne $pre and $::opt_v) {
- $_ ? print "Edited $name definition\n from: $pre\n to: $_\n"
- : print "Deleted $name definition: $pre\n";
- }
- }
- }
+ unless($MK{mkver}) { # still want to get version number
+ my $line = $_; $line =~ s/[\\\r\n]/ /g;
+ $MK{mkver} = $mkver = $1
+ if $line =~ m/\$Header:.*?\.mk.+(\d+\.\d+)/;
+ }
- push(@MK, $_);
+ # We always store values into %MK before checking %edit
+ # %edit can edit this in addition to $_ if needed.
+ my $name;
+ if (m/^\s*(\w+)\s*(\+?)=\s*/) {
+ $name = $1;
+ my $append = $2;
+ my $value = $';
+ $value =~ s/^\@`/`/;
+ if ($append) {
+ my $expanded = expand_mkvars($value, 0, 1);
+ print "Appending '$expanded' to $name\n" if $::opt_v;
+ $value = $MK{$name} ? "$MK{$name} $expanded" : $expanded;
+ }
+ elsif ($MK{$name} && $MK{$name} ne $value) {
+ print "$name macro redefined by Oracle\n from $MK{$name}\n to $value\n"
+ if $::opt_d;
+ }
+ $MK{$name} = $value;
+ $MK{$name} =~ s/^([^#]*)#.*/$1/; # remove comments
+
+ if (exists $edit{$name}) {
+ my $pre = $_;
+ eval $edit{$name}; # execute code to edit $_
+ print "Edit $name ($edit{$name}) failed: $@\n" if $@;
+ if ($_ ne $pre and $::opt_v) {
+ $_ ? print "Edited $name definition\n from: $pre\n to: $_\n"
+ : print "Deleted $name definition: $pre\n";
+ }
+ }
+ }
+
+ push(@MK, $_);
}
# --- now decide what to link with ---
my $linkvia;
if ($::opt_n) {
- $linkvia = "\$($::opt_n)" if $MK{$::opt_n};
- warn "Can't use '$::opt_n': not defined by .mk files\n"
- unless $linkvia;
+ $linkvia = "\$($::opt_n)" if $MK{$::opt_n};
+ warn "Can't use '$::opt_n': not defined by .mk files\n"
+ unless $linkvia;
}
# modern Oracle .mk files define OCISTATICLIBS and OCISHAREDLIBS
if (!$linkvia && ($MK{OCISHAREDLIBS} || $MK{OCISTATICLIBS})) {
- $linkvia = '';
- if ($MK{OCISTATICLIBS} &&
- ( ($opts{LINKTYPE}||'') eq 'static'
- || "@ARGV" =~ m/\bLINKTYPE=static\b/
- || $::opt_c)
+ $linkvia = '';
+ if ($MK{OCISTATICLIBS} &&
+ ( ($opts{LINKTYPE}||'') eq 'static'
+ || "@ARGV" =~ m/\bLINKTYPE=static\b/
+ || $::opt_c)
) {
- $linkvia .= '$(DEF_ON) ' if $MK{DEF_ON};
- $linkvia .= '$(SSCOREED) ' if $MK{SSCOREED};
- $linkvia .= '$(OCISTATICLIBS)';
- }
- else {
- $linkvia .= '$(SSDBED) ' if $MK{SSDBED};
- $linkvia .= '$(DEF_OPT) ' if $MK{DEF_OPT};
- if ($client_version_full =~ /^8\.0\./ and $^O eq 'dec_osf' and $osvers >= 4.0) {
- $linkvia .= '$(SCOREPT) $(NAETAB) $(NAEDHS) $(LLIBRDBMS_CLT) $(LLIBMM) ';
- $linkvia .= '$(NETLIBS) $(CORELIBS) $(LLIBCOMMON) $(LLIBEPC) '; - $need_ldlp_env = "LD_LIBRARY_PATH";
- }
- $linkvia .= '$(OCISHAREDLIBS)';
- }
+ $linkvia .= '$(DEF_ON) ' if $MK{DEF_ON};
+ $linkvia .= '$(SSCOREED) ' if $MK{SSCOREED};
+ $linkvia .= '$(OCISTATICLIBS)';
+ }
+ else {
+ $linkvia .= '$(SSDBED) ' if $MK{SSDBED};
+ $linkvia .= '$(DEF_OPT) ' if $MK{DEF_OPT};
+ if ($client_version_full =~ m/^8\.0\./ and $^O eq 'dec_osf' and $osvers >= 4.0) {
+ $linkvia .= '$(SCOREPT) $(NAETAB) $(NAEDHS) $(LLIBRDBMS_CLT) $(LLIBMM) ';
+ $linkvia .= '$(NETLIBS) $(CORELIBS) $(LLIBCOMMON) $(LLIBEPC) ';
+ $need_ldlp_env = "LD_LIBRARY_PATH";
+ }
+ $linkvia .= '$(OCISHAREDLIBS)';
+ }
}
$linkvia = '$(LIBCLNTSH)' if !$linkvia && $MK{LIBCLNTSH};
@@ -1385,29 +1387,29 @@
$linkvia = '$(OCILDLIBS)' if !$linkvia && $MK{OCILDLIBS};
# Now we get into strange land of twisty turny macros
- if (!$linkvia && $MK{PROLDLIBS}) { # Oracle 7.3.x
- # XXX tweak for threaded perl? - use PROLLSsharedthread
- if ($MK{PROLDLIBS} =~ /thread/i && $MK{PROLLSshared}) {
- $linkvia = '$(PROLLSshared)';
- }
- else {
- $linkvia = '$(PROLDLIBS)';
- }
+ if (!$linkvia && $MK{PROLDLIBS}) { # Oracle 7.3.x
+ # XXX tweak for threaded perl? - use PROLLSsharedthread
+ if ($MK{PROLDLIBS} =~ /thread/i && $MK{PROLLSshared}) {
+ $linkvia = '$(PROLLSshared)';
+ }
+ else {
+ $linkvia = '$(PROLDLIBS)';
+ }
}
elsif (!$linkvia && int($mkver) == 1) {
- if ($MK{LLIBOCIC}) {
- $linkvia = '$(LLIBOCIC) $(TTLIBS)';
- } else {
- print "WARNING: Guessing what to link with.\n";
- $linkvia = '-locic $(TTLIBS)'; # XXX GUESS HACK
- }
+ if ($MK{LLIBOCIC}) {
+ $linkvia = '$(LLIBOCIC) $(TTLIBS)';
+ } else {
+ print "WARNING: Guessing what to link with.\n";
+ $linkvia = '-locic $(TTLIBS)'; # XXX GUESS HACK
+ }
}
- elsif (!$linkvia && $MK{CCLIB}) { # Oracle XE
- $linkvia = '$(CCLIB)';
+ elsif (!$linkvia && $MK{CCLIB}) { # Oracle XE
+ $linkvia = '$(CCLIB)';
}
unless ($linkvia){
- die "ERROR parsing $file: Unable to determine what to link with.\n"
- ."Please send me copies of these files (one per mail message):\n@mkfiles\n";
+ die "ERROR parsing $file: Unable to determine what to link with.\n"
+ ."Please send me copies of these files (one per mail message):\n@mkfiles\n";
}
$MK_TEXT = join("\n", @MK);
return $linkvia;
@@ -1418,23 +1420,23 @@
my $file = shift;
my $fh;
unless ($fh = new FileHandle "<$file") {
- # Workaround more oracle bungling (Oracle 7.3.2/Solaris x86)
- my $alt; ($alt = $file) =~ s/\.dk\.mk$/\.mk/;
- $fh = new FileHandle "<$alt";
- die "Unable to read $file: $!" unless $fh;
+ # Workaround more oracle bungling (Oracle 7.3.2/Solaris x86)
+ my $alt; ($alt = $file) =~ s/\.dk\.mk$/\.mk/;
+ $fh = new FileHandle "<$alt";
+ die "Unable to read $file: $!" unless $fh;
}
print "Reading $file\n";
my @lines;
push(@mkfiles, $file);
while(<$fh>) {
- # soak up while looking for include directives
- push(@lines, $_), next
- unless /^\s*include\s+(.*?)\s*$/m;
- my $inc_file = $1;
- # deal with "include $(ORACLE_HOME)/..."
- # (can't use expand_mkvars() here)
- $inc_file =~ s/\$\((ORACLE_HOME|ORACLE_ROOT)\)/$ENV{$ORACLE_ENV}/og;
- push(@lines, read_inc_file($inc_file));
+ # soak up while looking for include directives
+ push(@lines, $_), next
+ unless /^\s*include\s+(.*?)\s*$/m;
+ my $inc_file = $1;
+ # deal with "include $(ORACLE_HOME)/..."
+ # (can't use expand_mkvars() here)
+ $inc_file =~ s/\$\((ORACLE_HOME|ORACLE_ROOT)\)/$ENV{$ORACLE_ENV}/og;
+ push(@lines, read_inc_file($inc_file));
}
print "Read a total of ".@lines." lines from $file (including inclusions)\n" if $::opt_v;
return @lines;
@@ -1447,14 +1449,14 @@
my $cmd = $orig;
my $debug = $::opt_d || $::opt_v;
print "Evaluating `$orig`\n"
- if $debug && !$expand_shellescape{$orig};
+ if $debug && !$expand_shellescape{$orig};
# ensure we have no $(...) vars left - strip out undefined ones:
$cmd =~ s/\$[({](\w+)[})]/mkvar("$1", 1, 0, $level+1)/ge;
print " expanded `$cmd`\n" if $debug and $cmd ne $orig;
my $result = `$cmd`;
$result =~ s/\s+$/ /; # newlines etc to single space
print " returned '$result'\n"
- if $debug && !$expand_shellescape{$orig};
+ if $debug && !$expand_shellescape{$orig};
$expand_shellescape{$orig} = $result;
$result;
}
@@ -1462,22 +1464,22 @@
sub expand_mkvars {
my ($string, $strip, $backtick, $level, $maxlevel) = @_;
- return if(!defined $string);
+ return if(!defined $string);
$level ||= 1;
local($_) = $string;
print "$level Expanding $_\n" if $::opt_d;
# handle whizzo AIX make feature used by Oracle
s/\$[({] (\w+) \? ([^(]*?) : ([^(]*?) [})]/
- my ($vname, $vT, $vF) = ($1,$2,$3);
- $MK{$vname} = (mkvar($vname, 1, $backtick, $level+1)) ? $vT : $vF
+ my ($vname, $vT, $vF) = ($1,$2,$3);
+ $MK{$vname} = (mkvar($vname, 1, $backtick, $level+1)) ? $vT : $vF
/xge; # can recurse
s/\$[({] (\w+) [})]/
- mkvar("$1", $strip, $backtick, $level+1, $maxlevel)
+ mkvar("$1", $strip, $backtick, $level+1, $maxlevel)
/xge; # can recurse
s/`(.*?[^\\])`/expand_shellescape("$1", $level+1)/esg if $backtick; # can recurse
- s/\s*\\\n\s*/ /g; # merge continuations
- s/\s+/ /g; # shrink whitespace
+ s/\s*\\\n\s*/ /g; # merge continuations
+ s/\s+/ /g; # shrink whitespace
print "$level Expanded $string\n to $_\n\n" if $::opt_d and $_ ne $string;
$_;
}
@@ -1491,14 +1493,14 @@
return $ENV{$ORACLE_ENV} if $var eq 'ORACLE_HOME';
my $val = $MK{$var};
if (!defined $val and exists $ENV{$var}) {
- $val = $ENV{$var};
- print "Using value of $var from environment: $val\n"
- unless $var eq 'LD_LIBRARY_PATH';
+ $val = $ENV{$var};
+ print "Using value of $var from environment: $val\n"
+ unless $var eq 'LD_LIBRARY_PATH';
}
return $default unless defined $val;
if ($MK_expanding{$var}) {
- print "Definition of \$($var) includes \$($var).\n";
- return "\$($var)";
+ print "Definition of \$($var) includes \$($var).\n";
+ return "\$($var)";
}
local($MK_expanding{$var}) = 1;
return $val if $maxlevel && $level >= $maxlevel;
@@ -1509,8 +1511,8 @@
sub read_file {
my $file = shift;
unless (open(ROL, "<$file")) {
- warn "WARNING: Unable to open $file: $!\n";
- return "";
+ warn "WARNING: Unable to open $file: $!\n";
+ return "";
}
my $text = join "", <ROL>;
$text =~ s/\n+/ /g;
@@ -1540,20 +1542,21 @@
# compensate for case where final .0 isn't in the install directory name
(my $client_version_trim = $client_version_full) =~ s/\.0$//;
- my @try = grep { -d $_ } ( # search the ORACLE_HOME we're using first
+ my @try = grep { -d $_ } ( # search the ORACLE_HOME we're using first
# --- Traditional full-install locations
"$OH/rdbms/public", # prefer public over others
"$OH/rdbms",
"$OH/plsql", # oratypes.h sometimes here (eg HPUX 11.23 Itanium Oracle 9.2.0),
# --- Oracle SDK Instant Client locations
"$OH/sdk/include",
+ "$OH/include",
# --- Oracle RPM Instant Client locations
map { ( $_, $_."64" ) }
map { ( $_, "/usr$_" ) }
map { "/include/oracle/$_/client" }
- $client_version,
- $client_version_trim,
- $client_version_full,
+ $client_version,
+ $client_version_trim,
+ $client_version_full,
#"/include/oracle/$client_version_full/client", # Instant Client for RedHat FC3
#"/include/oracle/$client_version_trim/client", # Instant Client for RedHat FC3
@@ -1589,14 +1592,14 @@
print "Found header files in @h_dir.\n" if @h_dir;
if (!$h_file{'oratypes.h'} || !$h_file{'ocidfn.h'}) {
- print "\n\n*********************************************************\n";
- print "I can't find the header files I need in your Oracle installation.\n";
- print "You probably need to install some more Oracle components.\n";
- print "For Instant Client that means the SDK package.\n";
- print "I'll keep going, but the compile will probably fail.\n";
- print "See the appropriate troubleshooting guide for your OS for more information.$BELL\n";
- print "*********************************************************\n\n"; - sleep 5;
+ print "\n\n*********************************************************\n";
+ print "I can't find the header files I need in your Oracle installation.\n";
+ print "You probably need to install some more Oracle components.\n";
+ print "For Instant Client that means the SDK package.\n";
+ print "I'll keep going, but the compile will probably fail.\n";
+ print "See the appropriate troubleshooting guide for your OS for more information.$BELL\n";
+ print "*********************************************************\n\n"; + sleep 5;
}
return @h_dir;
}
@@ -1622,92 +1625,90 @@
print "PATH=$ENV{PATH}\n" if $::opt_v;
if (find_bin($sqlplus_exe)) {
- local $ENV{SQLPATH} = ""; # avoid $SQLPATH/login.sql causing sqlplus to hang
- # Try to use the _SQLPLUS_RELEASE predefined variable from sqlplus
- # Documented in the SQL*Plus reference guide:
- #
http://download-west.oracle.com/docs/cd/B12037_01/server.101/b12170/ch13.htm#i2675128
- # Output is in the following format:
- # DEFINE _SQLPLUS_RELEASE = "902000400" (CHAR) Representing 9.2.0.4.0
- # DEFINE _SQLPLUS_RELEASE = "1001000200" (CHAR) Representing 10.1.0.2.0
- open FH, ">define.sql" or warn "Can't create define.sql: $!";
- print FH "DEFINE _SQLPLUS_RELEASE\nQUIT\n";
- close FH;
- my $sqlplus_release = `$sqlplus_exe -S /nolog \@define.sql 2>&1`;
- if ($sqlplus_release =~ /(SP2-0750)|(SP2-0642)/) {
-
-
- my $x = $ENV{ORACLE_HOME};
- delete $ENV{ORACLE_HOME};
- $sqlplus_release = `$sqlplus_exe -S /nolog \@define.sql 2>&1`;
- $ENV{ORACLE_HOME} = $x;
- }
- unlink "define.sql";
- print $sqlplus_release; # the _SQLPLUS_RELEASE may not be on first line:
- if ($sqlplus_release =~ /DEFINE _SQLPLUS_RELEASE = "(\d?\d)(\d\d)(\d\d)(\d\d)(\d\d)"/) {
- $client_version_full = sprintf("%d.%d.%d.%d", $1, $2, $3, $4);
- }
- else {
- my $ldlib_note = ($Config{ldlibpthname})
- ? "Specifically, your $Config{ldlibpthname} environment variable"
- : "Many systems need an environment variable (such as LD_LIBRARY_PATH, DYLD_LIBRARY_PATH)";
- warn qq{
- If sqlplus failed due to a linker/symbol/relocation/library error or similar problem
- then it's likely that you've not configured your environment correctly.
- $ldlib_note
- set to include the directory containing the Oracle libraries.
- \a\n};
- sleep 5;
- }
+ local $ENV{SQLPATH} = ""; # avoid $SQLPATH/login.sql causing sqlplus to hang
+ # Try to use the _SQLPLUS_RELEASE predefined variable from sqlplus
+ # Documented in the SQL*Plus reference guide:
+ #
http://download-west.oracle.com/docs/cd/B12037_01/server.101/b12170/ch13.htm#i2675128
+ # Output is in the following format:
+ # DEFINE _SQLPLUS_RELEASE = "902000400" (CHAR) Representing 9.2.0.4.0
+ # DEFINE _SQLPLUS_RELEASE = "1001000200" (CHAR) Representing 10.1.0.2.0
+ open my $FH, '>', 'define.sql' or warn "Can't create define.sql: $!"; + print $FH "DEFINE _SQLPLUS_RELEASE\nQUIT\n";
+ close $FH;
+ my $sqlplus_release = `$sqlplus_exe -S /nolog \@define.sql 2>&1`;
+ if ($sqlplus_release =~ m/(SP2-0750)|(SP2-0642)/) {
+ my $x = $ENV{ORACLE_HOME};
+ delete $ENV{ORACLE_HOME};
+ $sqlplus_release = `$sqlplus_exe -S /nolog \@define.sql 2>&1`;
+ $ENV{ORACLE_HOME} = $x;
+ }
+ unlink "define.sql";
+ print $sqlplus_release; # the _SQLPLUS_RELEASE may not be on first line:
+ if ($sqlplus_release =~ /DEFINE _SQLPLUS_RELEASE = "(\d?\d)(\d\d)(\d\d)(\d\d)(\d\d)"/) {
+ $client_version_full = sprintf("%d.%d.%d.%d", $1, $2, $3, $4);
+ }
+ else {
+ my $ldlib_note = ($Config{ldlibpthname})
+ ? "Specifically, your $Config{ldlibpthname} environment variable"
+ : "Many systems need an environment variable (such as LD_LIBRARY_PATH, DYLD_LIBRARY_PATH)";
+ warn qq{
+ If sqlplus failed due to a linker/symbol/relocation/library error or similar problem
+ then it's likely that you've not configured your environment correctly.
+ $ldlib_note
+ set to include the directory containing the Oracle libraries.
+ \a\n};
+ sleep 5;
+ }
}
else {
- warn "Can't find sqlplus. Pity, it would have helped.\n";
+ warn "Can't find sqlplus. Pity, it would have helped.\n";
}
if (!$client_version_full && $OH && open INST, "<$OH/install/unix.rgs") { - local $/ = undef;
- <INST> =~ m/^(rdbms|sql\*plus)\s+([\d.]+)/m;
- $client_version_full = $2 if $2;
- close INST;
+ local $/ = undef;
+ <INST> =~ m/^(rdbms|sql\*plus)\s+([\d.]+)/m;
+ $client_version_full = $2 if $2;
+ close INST;
}
if (!$client_version_full && $OH && -x "$OH/orainst/inspdver" ) {
- open INST, "$OH/orainst/inspdver |"; # client only install does not have this
- my @inspdver = <INST>;
- close INST;
- foreach (@inspdver) {
- $client_version_full = $1 if m/^(\d+\.\d+\.\d+)\S*\s+.*RDBMS/;
- next unless $::opt_v
- or m/RDBMS/i or m/PL.SQL/i
- or m/Precomp/i or m/Pro\*C/i;
- print $_;
- }
+ open my $INST, "$OH/orainst/inspdver |"; # client only install does not have this
+ my @inspdver = <$INST>;
+ close $INST;
+ foreach (@inspdver) {
+ $client_version_full = $1 if m/^(\d+\.\d+\.\d+)\S*\s+.*RDBMS/;
+ next unless $::opt_v
+ or m/RDBMS/i or m/PL.SQL/i
+ or m/Precomp/i or m/Pro\*C/i;
+ print $_;
+ }
}
if (!$client_version_full) {
- print "I'm having trouble finding your Oracle version number... trying harder\n"
- unless $force_version;
- if ( $OH =~ m\.\d+\.\d+(\.\d+)?)! ) { #decode it from $OH if possible
- $client_version_full = $1;
- }
- elsif ( "$OH/" =~ m!\D(8|9|10)(\d)(\d?)\D!) { # scary but handy
- $client_version_full = join ".", $1, $2, ($3||'0');
- }
- elsif ( "$OH/" =~ m!/10g!) { # scary but handy
- $client_version_full = "10.0.0.0";
- }
+ print "I'm having trouble finding your Oracle version number... trying harder\n"
+ unless $force_version;
+ if ( $OH =~ m\.\d+\.\d+(\.\d+)?)! ) { #decode it from $OH if possible
+ $client_version_full = $1;
+ }
+ elsif ( "$OH/" =~ m!\D(8|9|10)(\d)(\d?)\D!) { # scary but handy
+ $client_version_full = join ".", $1, $2, ($3||'0');
+ }
+ elsif ( "$OH/" =~ m!/10g!) { # scary but handy
+ $client_version_full = "10.0.0.0";
+ }
elsif ( "$OH/" =~ m!/usr/lib/oracle/(\d+\.\d)/!) { # Linux RPM
$client_version_full = "$1.0.0";
}
}
if ($force_version && $force_version ne $client_version_full) {
[continued in next message]
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)