Skip to content

Commit 7642024

Browse files
committed
Use /sbin/ldconfig -p to find ORACLE_HOME
1 parent 4806c0f commit 7642024

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Makefile.PL

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,20 @@ 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 $command = '/sbin/ldconfig -p';
962+
if ( open my $fh, q{-|}, $command ) {
963+
while (<$fh>) {
964+
if (m{^\tlibclntsh.$so[ ].*[ ]=>[ ](/.*)/libclntsh.so$}msx) {
965+
push @oh, $1;
966+
}
967+
}
968+
my $error = close $fh;
969+
}
970+
else {
971+
warn "Cannot run: $command\n";
972+
}
973+
}
960974
if (!@oh) { # else try the traditional kind of install
961975
# this should work for non-instant-client installs ($OH/bin & $OH/lib*)
962976
@oh = grep { (glob("$_/../lib*/libclntsh.$so*"))[0] } @path;

0 commit comments

Comments
 (0)