Skip to content

Commit 255b29d

Browse files
committed
Use /sbin/ldconfig -p to find ORACLE_HOME
Incorporating @Tux's feedback
1 parent 4806c0f commit 255b29d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Makefile.PL

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,18 @@ sub find_oracle_home {
957957
# but for non-IC ORACLE_HOME may be dir above a /lib*
958958
s:/lib\w*/?$:: for @oh; # remove possible trailing lib dir
959959
}
960+
if ( !@oh && $^O eq 'linux' && -x '/sbin/ldconfig' ) {
961+
my @cmd = qw( /sbin/ldconfig -p );
962+
if ( open my $fh, '-|', @cmd ) {
963+
local $/;
964+
push @oh => ( <$fh> =~
965+
m{^\tlibclntsh.$so[ ].*[ ]=>[ ](/.*)/libclntsh.so$}msg );
966+
close $fh or warn "Closing @cmd failed: $!\n";
967+
}
968+
else {
969+
warn "Cannot run: @cmd\n";
970+
}
971+
}
960972
if (!@oh) { # else try the traditional kind of install
961973
# this should work for non-instant-client installs ($OH/bin & $OH/lib*)
962974
@oh = grep { (glob("$_/../lib*/libclntsh.$so*"))[0] } @path;

0 commit comments

Comments
 (0)