Skip to content

Commit

Permalink
[ZBX-22783] added automatic detection of Oracle instant client instal…
Browse files Browse the repository at this point in the history
…led from RPM (mprihodko)
  • Loading branch information
CHERTS committed Apr 11, 2024
1 parent f2bb76b commit c2b0b2e
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 6 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ A......... [ZBX-21332] fixed runtime errors when linking items from two template
...G...... [ZBX-22521] added debug logging for process selection in proc.mem[] on AIX (Andris)
...G...... [ZBX-22695] fixed eventlog duplicate timestamps (asestakovs)
........S. [ZBX-22772] added trends cleanup for non-numeric value types (wiper)
....I..... [ZBX-22783] added automatic detection of Oracle instant client installed from RPM (mprihodko)
...G...PS. [ZBX-23221] fixed memory leaks when using certificate-based encryption in Zabbix Agent 1 and Agent 2; thanks to Masato Hirahata for the patch (akozlovs, Andris)
...G...... [ZBX-23890] removed non-existing headers from compiler checks: mtent.h and knlist.h (arimdjonoks)

Expand Down
1 change: 1 addition & 0 deletions PATCHLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@
[ZBX-22521] added debug logging for process selection in proc.mem[] on AIX (https://support.zabbix.com/browse/ZBX-22521)
[ZBX-22695] fixed eventlog duplicate timestamps (https://support.zabbix.com/browse/ZBX-22695)
[ZBX-22772] added trends cleanup for non-numeric value types (https://support.zabbix.com/browse/ZBX-22772)
[ZBX-22783] added automatic detection of Oracle instant client installed from RPM (https://support.zabbix.com/browse/ZBX-22783)
[ZBX-23221] fixed memory leaks when using certificate-based encryption in Zabbix Agent 1 and Agent 2; thanks to Masato Hirahata for the patch (https://support.zabbix.com/browse/ZBX-23221)
[ZBX-23890] removed non-existing headers from compiler checks: mtent.h and knlist.h (https://support.zabbix.com/browse/ZBX-23890)
[ZBXNEXT-170] implemented possibility to "unlink" specific templates in hosts and templates massupdate (https://support.zabbix.com/browse/ZBXNEXT-170)
Expand Down
78 changes: 72 additions & 6 deletions m4/ax_lib_oracle_oci.m4
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,67 @@ AC_DEFUN([AX_LIB_ORACLE_OCI],
elif test "$oracle_home_lib_dir" = "yes"; then
want_oracle_but_no_path="yes"
fi
elif test "$want_oracle_oci" = "yes"; then
want_oracle_but_no_path="yes"
fi
dnl
dnl Search include/lib paths of Oracle client installed from RPM package
dnl
if test "x$want_oracle_but_no_path" = "xyes"; then
oracle_rpm_include_dir='/usr/include/oracle/*/*'
oracle_rpm_lib_dir='/usr/lib/oracle/*/*/lib'
cnt_include=0
cnt_lib=0
for d in $oracle_rpm_include_dir; do
if test -d $d; then
if test -f "$d/oci.h" -o -f "$d/ociver.h"; then
((cnt_include++))
tmp_include_dir=$d
fi
fi
done
for d in $oracle_rpm_lib_dir; do
if test -d $d; then
if test -f "$d/libclntsh.so"; then
((cnt_lib++))
tmp_lib_dir=$d
fi
fi
done
AC_MSG_CHECKING([for Oracle include dir installed from RPM package])
if test $cnt_include -eq 1; then
AC_MSG_RESULT([$oracle_include_dir])
oracle_include_dir=$tmp_include_dir
else
AC_MSG_RESULT([no])
if test $cnt_include -gt 1; then
AC_MSG_WARN([$cnt_include Oracle include dirs installed from RPM packages, impossible to choose automatically])
fi
fi
AC_MSG_CHECKING([for Oracle lib dir installed from RPM package])
if test $cnt_lib -eq 1; then
AC_MSG_RESULT([$oracle_lib_dir])
oracle_lib_dir=$tmp_lib_dir
else
AC_MSG_RESULT([no])
if test $cnt_lib -gt 1; then
AC_MSG_WARN([$cnt_lib Oracle lib dirs installed from RPM packages, impossible to choose automatically])
fi
fi
if test $cnt_include -eq 1 && test $cnt_lib -eq 1; then
want_oracle_but_no_path="no"
fi
fi
if test "$want_oracle_but_no_path" = "yes"; then
AC_MSG_WARN([Oracle support is requested but no Oracle paths have been provided. \
AC_MSG_WARN([Oracle support is requested but no Oracle paths have been provided or automatically detected. \
Please, locate Oracle directories using --with-oracle or \
--with-oracle-include and --with-oracle-lib options.])
fi
Expand Down Expand Up @@ -271,11 +328,20 @@ Please, locate Oracle directories using --with-oracle or \
dnl Add -lnnz1x flag to Oracle >= 10.x
AC_MSG_CHECKING([for Oracle OCI version >= 10.x to use -lnnz1x flag])
oracle_nnz1x_flag=`expr $oracle_version_number / 1000000`
if test "$oracle_nnz1x_flag" -ge 10; then
oci_libs="$oci_libs -lnnz$oracle_nnz1x_flag"
LIBS="$LIBS -lnnz$oracle_nnz1x_flag"
AC_MSG_RESULT([-lnnz$oracle_nnz1x_flag])
if test "$oracle_version_major" -ge 10; then
oci_libs="$oci_libs -lnnz$oracle_version_major"
LIBS="$LIBS -lnnz$oracle_version_major"
AC_MSG_RESULT([-lnnz$oracle_version_major])
else
AC_MSG_RESULT([no])
fi
dnl Add -lons -lclntshcore -lmql1 -lipc1 flags to Oracle = 12.x
AC_MSG_CHECKING([for Oracle OCI version = 12.x to use -lons -lclntshcore -lmql1 -lipc1 flags])
if test "$oracle_version_major" -eq 12; then
oci_libs="$oci_libs -lons -lclntshcore -lmql1 -lipc1"
LIBS="$LIBS -lons -lclntshcore -lmql1 -lipc1"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
Expand Down

0 comments on commit c2b0b2e

Please sign in to comment.