summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Jones <sixd@php.net>2017-06-20 16:00:22 +1000
committerChristopher Jones <sixd@php.net>2017-06-20 16:00:22 +1000
commit27d681435174433c3a9b0b8325361dfa383be0a6 (patch)
tree3b5f36903dc579ef7bc9a2da355d59114634b605
parent64447030bbbf0364f72077cd1cf99f5a62f3b469 (diff)
downloadphp-git-27d681435174433c3a9b0b8325361dfa383be0a6.tar.gz
PDO_OCI: support IC 12.2 in configure option
-rw-r--r--NEWS4
-rwxr-xr-xext/pdo_oci/config.m438
2 files changed, 30 insertions, 12 deletions
diff --git a/NEWS b/NEWS
index 76627a232a..f276362c7a 100644
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,10 @@ PHP NEWS
. Fixed bug #74663 (Segfault with opcache.memory_protect and
validate_timestamp). (Laruence)
+- PDO_OCI:
+ . Support Instant Client 12.2 in --with-pdo-oci configure option.
+ (Tianfang Yang)
+
- Reflection:
. Fixed bug #74673 (Segfault when cast Reflection object to string with
undefined constant). (Laruence)
diff --git a/ext/pdo_oci/config.m4 b/ext/pdo_oci/config.m4
index 34cfb1397e..7132a40e10 100755
--- a/ext/pdo_oci/config.m4
+++ b/ext/pdo_oci/config.m4
@@ -2,16 +2,31 @@ dnl $Id$
dnl config.m4 for extension pdo_oci
dnl vim:et:sw=2:ts=2:
-SUPPORTED_LIB_VERS="9.0 10.1 11.1 12.1" # The lib vers are not bumped when the DB version is bumped
+if test -z "$SED"; then
+ PHP_PDO_OCI_SED="sed";
+else
+ PHP_PDO_OCI_SED="$SED";
+fi
+
+PHP_PDO_OCI_TAIL1=`echo a | tail -n1 2>/dev/null`
+if test "$PHP_PDO_OCI_TAIL1" = "a"; then
+ PHP_PDO_OCI_TAIL1="tail -n1"
+else
+ PHP_PDO_OCI_TAIL1="tail -1"
+fi
+
AC_DEFUN([AC_PDO_OCI_VERSION],[
AC_MSG_CHECKING([Oracle version])
- for OCI_VER in $SUPPORTED_LIB_VERS; do
- if test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.$OCI_VER; then
- PDO_OCI_VERSION="$OCI_VER"
- fi
- done
- if test -z "$PDO_OCI_VERSION"; then
- AC_MSG_ERROR([Oracle required OCI8 libraries not found under $PDO_OCI_DIR])
+ PDO_OCI_LCS_BASE=$PDO_OCI_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME
+ PDO_OCI_LCS=`ls $PDO_OCI_LCS_BASE.*.1 2> /dev/null | $PHP_PDO_OCI_TAIL1` # Oracle 10g, 11g, 12c etc
+ if test -f "$PDO_OCI_LCS"; then
+ dnl Oracle 10g, 11g 12c etc. The x.2 version libraries are named x.1 for drop in compatibility
+ PDO_OCI_VERSION=`echo $PDO_OCI_LCS | $PHP_PDO_OCI_SED -e 's/.*\.\(.*\)\.1$/\1.1/'`
+ elif test -f $PDO_OCI_LCS_BASE.9.0; then
+ 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
+ PDO_OCI_VERSION=9.0
+ else
+ AC_MSG_ERROR(Oracle libclntsh.$SHLIB_SUFFIX_NAME client library not found or its version is lower than 9)
fi
AC_MSG_RESULT($PDO_OCI_VERSION)
])
@@ -147,12 +162,11 @@ You need to tell me where to find your Oracle Instant Client SDK, or set ORACLE_
fi
case $PDO_OCI_VERSION in
- 9.0|10.1|10.2|11.1|11.2|12.1)
- PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
+ 7.3|8.0|8.1)
+ AC_MSG_ERROR(Unsupported Oracle version $PDO_OCI_VERSION)
;;
-
*)
- AC_MSG_ERROR(Unsupported Oracle version $PDO_OCI_VERSION)
+ PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
;;
esac