Skip to content

Commit 27d6814

Browse files
committed
PDO_OCI: support IC 12.2 in configure option
1 parent 6444703 commit 27d6814

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ PHP NEWS
2828
. Fixed bug #74663 (Segfault with opcache.memory_protect and
2929
validate_timestamp). (Laruence)
3030

31+
- PDO_OCI:
32+
. Support Instant Client 12.2 in --with-pdo-oci configure option.
33+
(Tianfang Yang)
34+
3135
- Reflection:
3236
. Fixed bug #74673 (Segfault when cast Reflection object to string with
3337
undefined constant). (Laruence)

ext/pdo_oci/config.m4

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,31 @@ dnl $Id$
22
dnl config.m4 for extension pdo_oci
33
dnl vim:et:sw=2:ts=2:
44

5-
SUPPORTED_LIB_VERS="9.0 10.1 11.1 12.1" # The lib vers are not bumped when the DB version is bumped
5+
if test -z "$SED"; then
6+
PHP_PDO_OCI_SED="sed";
7+
else
8+
PHP_PDO_OCI_SED="$SED";
9+
fi
10+
11+
PHP_PDO_OCI_TAIL1=`echo a | tail -n1 2>/dev/null`
12+
if test "$PHP_PDO_OCI_TAIL1" = "a"; then
13+
PHP_PDO_OCI_TAIL1="tail -n1"
14+
else
15+
PHP_PDO_OCI_TAIL1="tail -1"
16+
fi
17+
618
AC_DEFUN([AC_PDO_OCI_VERSION],[
719
AC_MSG_CHECKING([Oracle version])
8-
for OCI_VER in $SUPPORTED_LIB_VERS; do
9-
if test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.$OCI_VER; then
10-
PDO_OCI_VERSION="$OCI_VER"
11-
fi
12-
done
13-
if test -z "$PDO_OCI_VERSION"; then
14-
AC_MSG_ERROR([Oracle required OCI8 libraries not found under $PDO_OCI_DIR])
20+
PDO_OCI_LCS_BASE=$PDO_OCI_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME
21+
PDO_OCI_LCS=`ls $PDO_OCI_LCS_BASE.*.1 2> /dev/null | $PHP_PDO_OCI_TAIL1` # Oracle 10g, 11g, 12c etc
22+
if test -f "$PDO_OCI_LCS"; then
23+
dnl Oracle 10g, 11g 12c etc. The x.2 version libraries are named x.1 for drop in compatibility
24+
PDO_OCI_VERSION=`echo $PDO_OCI_LCS | $PHP_PDO_OCI_SED -e 's/.*\.\(.*\)\.1$/\1.1/'`
25+
elif test -f $PDO_OCI_LCS_BASE.9.0; then
26+
dnl There is no case for Oracle 9.2. Oracle 9.2 libraries have a 9.0 suffix for drop-in compatibility with Oracle 9.0
27+
PDO_OCI_VERSION=9.0
28+
else
29+
AC_MSG_ERROR(Oracle libclntsh.$SHLIB_SUFFIX_NAME client library not found or its version is lower than 9)
1530
fi
1631
AC_MSG_RESULT($PDO_OCI_VERSION)
1732
])
@@ -147,12 +162,11 @@ You need to tell me where to find your Oracle Instant Client SDK, or set ORACLE_
147162
fi
148163

149164
case $PDO_OCI_VERSION in
150-
9.0|10.1|10.2|11.1|11.2|12.1)
151-
PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
165+
7.3|8.0|8.1)
166+
AC_MSG_ERROR(Unsupported Oracle version $PDO_OCI_VERSION)
152167
;;
153-
154168
*)
155-
AC_MSG_ERROR(Unsupported Oracle version $PDO_OCI_VERSION)
169+
PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
156170
;;
157171
esac
158172

0 commit comments

Comments
 (0)