Skip to content

Commit 70075bc

Browse files
committed
- Improved message and version checking
1 parent 599d913 commit 70075bc

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

ext/pdo_oci/config.m4

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ PHP_ARG_WITH(pdo-oci, Oracle OCI support for PDO,
4444
[ --with-pdo-oci[=DIR] PDO: Oracle OCI support. DIR defaults to \$ORACLE_HOME.
4545
Use --with-pdo-oci=instantclient,prefix,version
4646
for an Oracle Instant Client SDK.
47-
For Linux with 10.2.0.3 RPMs (for example) use:
48-
--with-pdo-oci=instantclient,/usr,10.2.0.3])
47+
For example on Linux with 11.2 RPMs use:
48+
--with-pdo-oci=instantclient,/usr,11.2
49+
With 10.2 RPMs use:
50+
--with-pdo-oci=instantclient,/usr,10.2.0.4])
4951

5052
if test "$PHP_PDO_OCI" != "no"; then
5153

@@ -79,6 +81,13 @@ You need to tell me where to find your Oracle Instant Client SDK, or set ORACLE_
7981
fi
8082
PDO_OCI_IC_PREFIX="`echo $PDO_OCI_DIR | cut -d, -f2`"
8183
PDO_OCI_IC_VERS="`echo $PDO_OCI_DIR | cut -d, -f3`"
84+
if test -n "$PDO_OCI_IC_VERS"; then
85+
PDO_OCI_IC_MAJ_VER="`echo $PDO_OCI_IC_VERS | cut -d. -f1`"
86+
if test "$PDO_OCI_IC_MAJ_VER" -ge 11; then
87+
# From 11.1.0.7 the RPM path only has an X.Y component
88+
PDO_OCI_IC_VERS="`echo $PDO_OCI_IC_VERS | cut -d. -f1-2`"
89+
fi
90+
fi
8291
AC_MSG_CHECKING([for oci.h])
8392
if test -f $PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/$PDO_OCI_CLIENT_DIR/oci.h ; then
8493
PHP_ADD_INCLUDE($PDO_OCI_IC_PREFIX/include/oracle/$PDO_OCI_IC_VERS/$PDO_OCI_CLIENT_DIR)
@@ -95,11 +104,11 @@ You need to tell me where to find your Oracle Instant Client SDK, or set ORACLE_
95104
else
96105
AC_MSG_ERROR([I'm too dumb to figure out where the include dir is in your Instant Client install])
97106
fi
98-
if test -f "$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/$PDO_OCI_CLIENT_DIR/lib/libclntsh.so" ; then
107+
if test -f "$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/$PDO_OCI_CLIENT_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME" ; then
99108
PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/$PDO_OCI_CLIENT_DIR/lib"
100-
elif test -f "$PDO_OCI_IC_PREFIX/$PDO_OCI_CLIENT_DIR/lib/libclntsh.so" ; then
109+
elif test -f "$PDO_OCI_IC_PREFIX/$PDO_OCI_CLIENT_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME" ; then
101110
PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/$PDO_OCI_CLIENT_DIR/lib"
102-
elif test -f "$PDO_OCI_IC_PREFIX/libclntsh.so" ; then
111+
elif test -f "$PDO_OCI_IC_PREFIX/libclntsh.$SHLIB_SUFFIX_NAME" ; then
103112
PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX"
104113
else
105114
AC_MSG_ERROR([I'm too dumb to figure out where the libraries are in your Instant Client install])

0 commit comments

Comments
 (0)