Commit b894582d authored by Christopher Huhn's avatar Christopher Huhn 🥚
Browse files

New upstream version 2.1.3

parents
OCI8
Stig Bakken, Thies C. Arntzen, Andy Sautins, David Benson, Maxim Maletsky, Harald Radi, Antony Dovgal, Andi Gutmans, Wez Furlong, Christopher Jones, Oracle Corporation
--------------------------------------------------------------------
The PHP License, version 3.01
Copyright (c) 1999 - 2016 The PHP Group. All rights reserved.
--------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, is permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. The name "PHP" must not be used to endorse or promote products
derived from this software without prior written permission. For
written permission, please contact group@php.net.
4. Products derived from this software may not be called "PHP", nor
may "PHP" appear in their name, without prior written permission
from group@php.net. You may indicate that your software works in
conjunction with PHP by saying "Foo for PHP" instead of calling
it "PHP Foo" or "phpfoo"
5. The PHP Group may publish revised and/or new versions of the
license from time to time. Each version will be given a
distinguishing version number.
Once covered code has been published under a particular version
of the license, you may always continue to use it under the terms
of that version. You may also choose to use such covered code
under the terms of any subsequent version of the license
published by the PHP Group. No one other than the PHP Group has
the right to modify the terms applicable to covered code created
under this License.
6. Redistributions of any form whatsoever must retain the following
acknowledgment:
"This product includes PHP software, freely available from
<http://www.php.net/software/>".
THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------
This software consists of voluntary contributions made by many
individuals on behalf of the PHP Group.
The PHP Group can be contacted via Email at group@php.net.
For more information on the PHP Group and the PHP project,
please see <http://www.php.net>.
PHP includes the Zend Engine, freely available at
<http://www.zend.com>.
The OCI8 Extension
------------------
Use the OCI8 extension to access Oracle Database.
Documentation is at http://php.net/oci8
Use 'pecl install oci8' to install for PHP 7.
Use 'pecl install oci8-2.0.12' to install for PHP 5.2 - PHP 5.6.
Use 'pecl install oci8-1.4.10' to install for PHP 4.3.9 - PHP 5.1.
The OCI8 extension needs to be linked with Oracle 12, 11, or 10.2
client libraries. These libraries are found in your database
installation, or in the free Oracle Instant Client from
http://www.oracle.com/technetwork/database/features/instant-client/
Install the 'Basic' or 'Basic Lite' Instant Client package. If
building from source, then also install the SDK package.
Oracle's standard cross-version connectivity applies. For example,
PHP OCI8 linked with Instant Client 11.2 can connect to Oracle
Database 9.2 onward. See Oracle's note "Oracle Client / Server
Interoperability Support" (ID 207303.1) for details.
if test -z "$SED"; then
PHP_OCI8_SED="sed";
else
PHP_OCI8_SED="$SED";
fi
PHP_OCI8_TAIL1=`echo a | tail -n1 2>/dev/null`
if test "$PHP_OCI8_TAIL1" = "a"; then
PHP_OCI8_TAIL1="tail -n1"
else
PHP_OCI8_TAIL1="tail -1"
fi
AC_DEFUN([AC_OCI8_CHECK_LIB_DIR],[
AC_MSG_CHECKING([ORACLE_HOME library validity])
if test ! -d "$OCI8_DIR"; then
AC_MSG_ERROR([${OCI8_DIR} is not a directory])
fi
if test -d "$OCI8_DIR/lib" && test ! -d "$OCI8_DIR/lib32"; then
OCI8_LIB_DIR=lib
elif test ! -d "$OCI8_DIR/lib" && test -d "$OCI8_DIR/lib32"; then
OCI8_LIB_DIR=lib32
elif test -d "$OCI8_DIR/lib" && test -d "$OCI8_DIR/lib32"; then
OCI8_LIB_DIR=$PHP_OCI8_OH_LIBDIR
else
dnl This isn't an ORACLE_HOME. Try heuristic examination of the dir to help the user
if test -f "$OCI8_DIR/libociei.$SHLIB_SUFFIX_NAME"; then
AC_MSG_ERROR([Expected an ORACLE_HOME top level directory but ${OCI8_DIR} appears to be an Instant Client directory. Try --with-oci8=instantclient,${OCI8_DIR}])
else
AC_MSG_ERROR([Oracle library directory not found in ${OCI8_DIR}])
fi
fi
AC_MSG_RESULT($OCI8_LIB_DIR)
])
AC_DEFUN([AC_OCI8IC_VERSION],[
AC_MSG_CHECKING([Oracle Instant Client library version compatibility])
OCI8_LCS_BASE=$PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME
OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | $PHP_OCI8_TAIL1` # Oracle 10g, 11g etc
OCI8_NNZ=`ls $PHP_OCI8_INSTANT_CLIENT/libnnz*.$SHLIB_SUFFIX_NAME 2> /dev/null | $PHP_OCI8_TAIL1`
if test -f "$OCI8_NNZ" && test -f "$OCI8_LCS"; then
if test ! -f "$OCI8_LCS_BASE"; then
AC_MSG_ERROR([Link from $OCI8_LCS_BASE to $OCI8_LCS_BASE.*.1 not found])
fi
OCI8_ORACLE_VERSION=`echo $OCI8_LCS | $PHP_OCI8_SED -e 's/.*\.\(.*\)\.1$/\1.1/'`
else
AC_MSG_ERROR([Oracle Instant Client libraries libnnz.$SHLIB_SUFFIX_NAME and libclntsh.$SHLIB_SUFFIX_NAME not found])
fi
AC_MSG_RESULT([$OCI8_ORACLE_VERSION])
])
AC_DEFUN([AC_OCI8_ORACLE_VERSION],[
AC_MSG_CHECKING([Oracle library version compatibility])
OCI8_LCS_BASE=$OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME
OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | $PHP_OCI8_TAIL1` # Oracle 10g, 11g etc
if test -s "$OCI8_DIR/orainst/unix.rgs"; then
OCI8_ORACLE_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | $PHP_OCI8_SED 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4`
test -z "$OCI8_ORACLE_VERSION" && OCI8_ORACLE_VERSION=7.3
elif test -f "$OCI8_LCS"; then
dnl Oracle 10g, 11g etc. The x.2 version libraries are named x.1 for drop in compatibility
OCI8_ORACLE_VERSION=`echo $OCI8_LCS | $PHP_OCI8_SED -e 's/.*\.\(.*\)\.1$/\1.1/'`
elif test -f $OCI8_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
OCI8_ORACLE_VERSION=9.0
elif test -f $OCI8_LCS_BASE.8.0; then
OCI8_ORACLE_VERSION=8.1
elif test -f $OCI8_LCS_BASE.1.0; then
OCI8_ORACLE_VERSION=8.0
elif test -f $OCI8_DIR/$OCI8_LIB_DIR/libclntsh.a; then
if test -f $OCI8_DIR/$OCI8_LIB_DIR/libcore4.a; then
OCI8_ORACLE_VERSION=8.0
else
OCI8_ORACLE_VERSION=8.1
fi
else
AC_MSG_ERROR(Oracle libclntsh.$SHLIB_SUFFIX_NAME client library not found)
fi
AC_MSG_RESULT($OCI8_ORACLE_VERSION)
])
dnl
dnl OCI8_INIT_DTRACE(providerdesc, header-file, sources)
dnl This mimics PHP_INIT_DTRACE from PHP 5.4's acinclude.m4. It is
dnl necessarily different from PHP_INIT_DTRACE which doesn't currently
dnl support DTrace for extensions. Creating OCI8_INIT_DTRACE
dnl independently instead of using a refactored PHP_INIT_DTRACE allows
dnl OCI8 to be DTraced on versions of PHP where core PHP DTrace support
dnl isn't available.
dnl
AC_DEFUN([OCI8_INIT_DTRACE],[
ac_srcdir=[]PHP_EXT_SRCDIR([oci8])/
ac_bdir=[]PHP_EXT_BUILDDIR([oci8])/
dnl providerdesc
ac_provsrc=$1
dnl header-file
ac_hdrobj=$2
dnl DTrace objects
old_IFS=[$]IFS
for ac_src in $3; do
IFS=.
set $ac_src
ac_obj=[$]1
IFS=$old_IFS
OCI8_DTRACE_OBJS="[$]OCI8_DTRACE_OBJS [$]ac_bdir[$]ac_obj.lo"
done;
for ac_lo in $OCI8_DTRACE_OBJS; do
dtrace_oci8_objs="[$]dtrace_oci8_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`"
done;
dnl Generate Makefile.objects entry
dnl The empty $ac_provsrc command stops an implicit circular dependency
dnl in GNU Make which causes the .d file to be overwritten (Bug 61268)
cat>>Makefile.objects<<EOF
PHP_EXT_SRCDIR([oci8])/$ac_provsrc:;
$ac_bdir[$]ac_hdrobj: $ac_srcdir[$]ac_provsrc
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) -e 's,PHPOCI_,DTRACE_,g' \$[]@.bak > \$[]@
\$(OCI8_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj
EOF
case $host_alias in
*solaris*|*linux*)
dtrace_prov_name="`echo $ac_provsrc | $SED -e 's#\(.*\)\/##'`.o"
dtrace_lib_dir="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/[^/]*#\1#'`/.libs"
dtrace_d_obj="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/\([^/]*\)#\1/.libs/\2#'`.o"
dtrace_nolib_objs='$(OCI8_DTRACE_OBJS:.lo=.o)'
for ac_lo in $OCI8_DTRACE_OBJS; do
dtrace_oci8_lib_objs="[$]dtrace_oci8_lib_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`"
done;
dnl Always attempt to create both PIC and non-PIC DTrace objects (Bug 63692)
cat>>Makefile.objects<<EOF
$ac_bdir[$]ac_provsrc.lo: \$(OCI8_DTRACE_OBJS)
echo "[#] Generated by Makefile for libtool" > \$[]@
@test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir
if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $ac_srcdir[$]ac_provsrc $dtrace_oci8_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\]
echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\]
else [\\]
echo "pic_object='none'" >> \$[]@ [;\\]
fi
if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $ac_srcdir[$]ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\]
echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\]
else [\\]
echo "non_pic_object='none'" >> \$[]@ [;\\]
fi
EOF
;;
*)
AC_MSG_WARN([OCI8 extension: OCI8 DTrace support is not confirmed on this platform])
cat>>Makefile.objects<<EOF
$ac_bdir[$]ac_provsrc.o: \$(OCI8_DTRACE_OBJS)
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o \$[]@ -s $ac_srcdir[$]ac_provsrc $dtrace_oci8_objs
EOF
;;
esac
])
dnl --with-oci8=shared,instantclient,/path/to/client/dir/lib
dnl or
dnl --with-oci8=shared,/path/to/oracle/home
PHP_ARG_WITH(oci8, for Oracle Database OCI8 support,
[ --with-oci8[=DIR] Include Oracle Database OCI8 support. DIR defaults to [$]ORACLE_HOME.
Use --with-oci8=instantclient,/path/to/instant/client/lib
to use an Oracle Instant Client installation])
if test "$PHP_OCI8" != "no"; then
if test -z "$PHP_OCI8"; then
dnl --with-oci8=$ORACLE_HOME where ORACLE_HOME isn't set (or is mistyped) will match this case
AC_MSG_ERROR([Empty parameter value passed to --with-oci8])
fi
dnl Check PHP version is compatible with this extension
AC_MSG_CHECKING([PHP version])
tmp_version=$PHP_VERSION
if test -z "$tmp_version"; then
if test -z "$PHP_CONFIG"; then
AC_MSG_ERROR([php-config not found])
fi
php_version=`$PHP_CONFIG --version 2>/dev/null|head -n 1|$PHP_OCI8_SED -e 's#\([0-9]\.[0-9]*\.[0-9]*\)\(.*\)#\1#'`
else
php_version=`echo "$tmp_version"|$PHP_OCI8_SED -e 's#\([0-9]\.[0-9]*\.[0-9]*\)\(.*\)#\1#'`
fi
if test -z "$php_version"; then
AC_MSG_ERROR([failed to detect PHP version, please report])
fi
ac_IFS=$IFS
IFS="."
set $php_version
IFS=$ac_IFS
oci8_php_version=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
if test "$oci8_php_version" -lt "5002000"; then
AC_MSG_ERROR([You need at least PHP 5.2.0 to be able to use this version of OCI8. PHP $php_version found])
else
AC_MSG_RESULT([$php_version, ok])
fi
dnl Check whether --enable-dtrace was set.
dnl To use DTrace with a PECL install, extract the OCI8 archive, phpize it, and set
dnl PHP_DTRACE=yes before running configure
AC_MSG_CHECKING([OCI8 DTrace support])
oci8_do_dtrace="`echo $PHP_OCI8 | cut -d, -f3`"
if test "$PHP_DTRACE" = "yes" -o "$oci8_do_dtrace" = "dtrace" ; then
AC_MSG_RESULT([yes])
if test "$ext_shared" = "no"; then
AC_MSG_ERROR([For DTrace support OCI8 must be configured as a shared extension])
else
AC_CHECK_HEADERS([sys/sdt.h], [
OCI8_INIT_DTRACE([oci8_dtrace.d],[oci8_dtrace_gen.h],[oci8.c oci8_statement.c])
], [
AC_MSG_ERROR(
[Cannot find sys/sdt.h which is required for DTrace support])
])
PHP_SUBST(OCI8_DTRACE_OBJS)
AC_DEFINE(HAVE_OCI8_DTRACE,1,[Defined to 1 if PHP OCI8 DTrace support was enabled during configuration])
dnl Developer warning: hard coded extension is OK for the known supported environments
shared_objects_oci8="$shared_objects_oci8 PHP_EXT_BUILDDIR(oci8)/oci8_dtrace.d.lo"
fi
else
AC_MSG_RESULT([no])
fi
dnl Set some port specific directory components for use later
AC_CHECK_SIZEOF(long int, 4)
AC_MSG_CHECKING([checking if we're on a 64-bit platform])
if test "$ac_cv_sizeof_long_int" = "4"; then
AC_MSG_RESULT([no])
PHP_OCI8_OH_LIBDIR=lib32
PHP_OCI8_IC_LIBDIR_SUFFIX=""
else
AC_MSG_RESULT([yes])
PHP_OCI8_OH_LIBDIR=lib
PHP_OCI8_IC_LIBDIR_SUFFIX=64
fi
dnl Determine if the user wants to use Oracle Instant Client libraries
PHP_OCI8_INSTANT_CLIENT="no"
dnl PECL Bug 14268 (Allow "pecl install oci8" command to "autodetect"
dnl an Instant Client RPM install). This also has a benefit for non
dnl "pecl install" builds: if the user does --with-oci8 or
dnl --with-oci8=shared but the ORACLE_HOME environment variable is not
dnl actually set, the install tries to locate the Instant Client RPM
if test "$PHP_OCI8" = "yes" && test -z "$ORACLE_HOME"; then
AC_MSG_WARN([OCI8 extension: ORACLE_HOME is not set, looking for default Oracle Instant Client instead])
PHP_OCI8=instantclient
fi
if test "`echo $PHP_OCI8`" = "instantclient"; then
PHP_OCI8_INSTANT_CLIENT="yes"
elif test "`echo $PHP_OCI8 | cut -d, -f2`" = "instantclient"; then
PHP_OCI8_INSTANT_CLIENT="`echo $PHP_OCI8 | cut -d, -f3`"
PHP_OCI8="`echo $PHP_OCI8 | cut -d, -f1,4`"
if test "$PHP_OCI8_INSTANT_CLIENT" = ""; then
PHP_OCI8_INSTANT_CLIENT="yes"
fi
if test -z "$PHP_OCI8"; then
PHP_OCI8=yes
fi
elif test "`echo $PHP_OCI8 | cut -d, -f1`" = "instantclient"; then
PHP_OCI8_INSTANT_CLIENT="`echo $PHP_OCI8 | cut -d, -f2`"
PHP_OCI8="`echo $PHP_OCI8 | cut -d, -f3,4`"
if test "$PHP_OCI8_INSTANT_CLIENT" = ""; then
PHP_OCI8_INSTANT_CLIENT="yes"
fi
if test -z "$PHP_OCI8"; then
PHP_OCI8=yes
fi
fi
if test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then
dnl ***************************************
dnl Branch for using an ORACLE_HOME install
dnl ***************************************
AC_MSG_CHECKING([Oracle ORACLE_HOME install directory])
if test "$PHP_OCI8" = "yes"; then
OCI8_DIR=$ORACLE_HOME
else
OCI8_DIR=$PHP_OCI8
fi
AC_MSG_RESULT($OCI8_DIR)
AC_OCI8_CHECK_LIB_DIR($OCI8_DIR)
if test -d "$OCI8_DIR/rdbms/public"; then
PHP_ADD_INCLUDE($OCI8_DIR/rdbms/public)
OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/public"
fi
if test -d "$OCI8_DIR/rdbms/demo"; then
PHP_ADD_INCLUDE($OCI8_DIR/rdbms/demo)
OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/demo"
fi
if test -d "$OCI8_DIR/network/public"; then
PHP_ADD_INCLUDE($OCI8_DIR/network/public)
OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/network/public"
fi
if test -d "$OCI8_DIR/plsql/public"; then
PHP_ADD_INCLUDE($OCI8_DIR/plsql/public)
OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/plsql/public"
fi
if test -f "$OCI8_DIR/$OCI8_LIB_DIR/sysliblist"; then
PHP_EVAL_LIBLINE(`cat $OCI8_DIR/$OCI8_LIB_DIR/sysliblist`, OCI8_SYSLIB)
elif test -f "$OCI8_DIR/rdbms/$OCI8_LIB_DIR/sysliblist"; then
PHP_EVAL_LIBLINE(`cat $OCI8_DIR/rdbms/$OCI8_LIB_DIR/sysliblist`, OCI8_SYSLIB)
fi
AC_OCI8_ORACLE_VERSION($OCI8_DIR)
case $OCI8_ORACLE_VERSION in
7.3|8.0|8.1|9.0)
AC_MSG_ERROR([Oracle client libraries < 10 are not supported])
;;
esac
PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
PHP_ADD_LIBPATH($OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD)
PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c, $ext_shared)
AC_DEFINE(HAVE_OCI8,1,[Defined to 1 if the PHP OCI8 extension for Oracle Database is configured])
PHP_SUBST_OLD(OCI8_SHARED_LIBADD)
PHP_SUBST_OLD(OCI8_DIR)
PHP_SUBST_OLD(OCI8_ORACLE_VERSION)
dnl Fix Bug #46623
AC_DEFINE_UNQUOTED(PHP_OCI8_DEF_DIR, "$OCI8_DIR", [ ])
AC_DEFINE_UNQUOTED(PHP_OCI8_DEF_SHARED_LIBADD, "$OCI8_SHARED_LIBADD", [ ])
else
dnl ***************************************************
dnl Branch for using an Oracle Instant Client directory
dnl ***************************************************
AC_MSG_CHECKING([Oracle Instant Client directory])
if test "$PHP_OCI8_INSTANT_CLIENT" = "yes"; then
dnl Find the directory if user specified "instantclient" but did not
dnl give a dir. Generally the Instant Client can be anywhere so the
dnl user must pass in the library directory. But on Linux we default
dnl to the most recent version in /usr/lib which is where the Oracle
dnl Instant Client RPM gets installed.
PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | $PHP_OCI8_TAIL1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'`
if test -z "$PHP_OCI8_INSTANT_CLIENT"; then
AC_MSG_ERROR([Oracle Instant Client directory /usr/lib/oracle/.../client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib libraries not found. Try --with-oci8=instantclient,DIR])
fi
fi
AC_MSG_RESULT($PHP_OCI8_INSTANT_CLIENT)
OCI8_DIR=$PHP_OCI8_INSTANT_CLIENT
AC_MSG_CHECKING([Oracle Instant Client SDK header directory])
dnl Header directory for Instant Client SDK RPM install
OCISDKRPMINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!^/usr/lib/oracle/\(.*\)/client\('${PHP_OCI8_IC_LIBDIR_SUFFIX}'\)*/lib[/]*$!/usr/include/oracle/\1/client\2!'`
dnl Header directory for Instant Client SDK zip file install
OCISDKZIPINC=$PHP_OCI8_INSTANT_CLIENT/sdk/include
dnl Header directory for manual installation
OCISDKMANINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e 's!\(.*\)/lib[/]*$!\1/include!'`
if test -f "$OCISDKRPMINC/oci.h"; then
AC_MSG_RESULT($OCISDKRPMINC)
PHP_ADD_INCLUDE($OCISDKRPMINC)
OCI8INCDIR=$OCISDKRPMINC
elif test -f "$OCISDKZIPINC/oci.h"; then
AC_MSG_RESULT($OCISDKZIPINC)
PHP_ADD_INCLUDE($OCISDKZIPINC)
OCI8INCDIR=$OCISDKZIPINC
elif test -f "$OCISDKMANINC/oci.h"; then
AC_MSG_RESULT($OCISDKMANINC)
PHP_ADD_INCLUDE($OCISDKMANINC)
OCI8INCDIR=$OCISDKMANINC
else
AC_MSG_ERROR([Oracle Instant Client SDK header files not found])
fi
OCISYSLIBLIST=`echo "$OCI8INCDIR" | $PHP_OCI8_SED -e 's!\(.*\)/include$!\1/demo/sysliblist!'`
if test -f "$OCISYSLIBLIST"; then
PHP_EVAL_LIBLINE(`cat $OCISYSLIBLIST`, OCI8_SYSLIB)
fi
AC_OCI8IC_VERSION($PHP_OCI8_INSTANT_CLIENT)
PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
PHP_ADD_LIBPATH($PHP_OCI8_INSTANT_CLIENT, OCI8_SHARED_LIBADD)
AC_DEFINE(HAVE_OCI_INSTANT_CLIENT,1,[Defined to 1 if OCI8 configuration located Oracle's Instant Client libraries])
PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c, $ext_shared)
AC_DEFINE(HAVE_OCI8,1,[Defined to 1 if the PHP OCI8 extension for Oracle Database is configured])
PHP_SUBST_OLD(OCI8_SHARED_LIBADD)
PHP_SUBST_OLD(OCI8_DIR)
PHP_SUBST_OLD(OCI8_ORACLE_VERSION)
fi
fi
// vim:ft=javascript
if (PHP_OCI8 != "no" && PHP_OCI8_11G != "no") {
if (!PHP_OCI8_SHARED && !PHP_OCI8_11G_SHARED) {
WARNING("oci8 and oci8-11g provide the same extension and cannot both be built statically");
PHP_OCI8 = "no"
}
}
if (PHP_OCI8 != "no" && PHP_OCI8_12C != "no") {
if (!PHP_OCI8_SHARED && !PHP_OCI8_12C_SHARED) {
WARNING("oci8 and oci8-12c provide the same extension and cannot both be built statically");
PHP_OCI8 = "no"
}
}
if (PHP_OCI8_11G != "no" && PHP_OCI8_12C != "no") {
if (!PHP_OCI8_11G_SHARED && !PHP_OCI8_12C_SHARED) {
WARNING("oci8-11g and oci8-12c provide the same extension and cannot both be built statically");
PHP_OCI8_11G = "no"
}
}
ARG_WITH("oci8", "OCI8 support", "no");
if (PHP_OCI8 != "no") {
oci8_dirs = new Array(
PHP_OCI8
);
oci8_lib_paths = "";
oci8_inc_paths = "";
// find the Oracle install
for (i = 0; i < oci8_dirs.length; i++) {
oci8_lib_paths += oci8_dirs[i] + "\\lib;";
oci8_lib_paths += oci8_dirs[i] + "\\lib\\msvc;";
oci8_inc_paths += oci8_dirs[i] + "\\include;";
}
oci8_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient;"
oci8_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient;";
if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8", oci8_inc_paths) &&
CHECK_LIB("oci.lib", "oci8", oci8_lib_paths))
{
EXTENSION('oci8', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c');
AC_DEFINE('HAVE_OCI8', 1);
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
} else {
WARNING("oci8 not enabled: Oracle Database client libraries or Oracle 10g Instant Client not found");
PHP_OCI8 = "no"
}
}
ARG_WITH("oci8-11g", "OCI8 support using Oracle 11g Instant Client", "no");
if (PHP_OCI8_11G != "no") {
oci8_11g_dirs = new Array(
PHP_OCI8_11G
);
oci8_11g_lib_paths = "";
oci8_11g_inc_paths = "";
// find the Oracle install
for (i = 0; i < oci8_11g_dirs.length; i++) {
oci8_11g_lib_paths += oci8_11g_dirs[i] + "\\lib;";
oci8_11g_lib_paths += oci8_11g_dirs[i] + "\\lib\\msvc;";
oci8_11g_inc_paths += oci8_11g_dirs[i] + "\\include;";
}
oci8_11g_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient_11;"
oci8_11g_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient_11;";
if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_11G", oci8_11g_inc_paths) &&
CHECK_LIB("oci.lib", "oci8_11g", oci8_11g_lib_paths))
{
EXTENSION('oci8_11g', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c', null, null, null, "ext\\oci8_11g")
AC_DEFINE('HAVE_OCI8', 1);
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
} else {
WARNING("oci8-11g not enabled: Oracle Database client libraries or Oracle 11g Instant Client not found");
PHP_OCI8_11G = "no"
}
}
ARG_WITH("oci8-12c", "OCI8 support using Oracle Database 12c Instant Client", "no");
if (PHP_OCI8_12C != "no") {
oci8_12c_dirs = new Array(
PHP_OCI8_12C
);
oci8_12c_lib_paths = "";
oci8_12c_inc_paths = "";
// find the Oracle install
for (i = 0; i < oci8_12c_dirs.length; i++) {
oci8_12c_lib_paths += oci8_12c_dirs[i] + "\\lib;";
oci8_12c_lib_paths += oci8_12c_dirs[i] + "\\lib\\msvc;";
oci8_12c_inc_paths += oci8_12c_dirs[i] + "\\include;";
}
oci8_12c_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient_12;"
oci8_12c_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient_12;";
if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_12C", oci8_12c_inc_paths) &&
CHECK_LIB("oci.lib", "oci8_12c", oci8_12c_lib_paths))
{
EXTENSION('oci8_12c', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c', null, null, null, "ext\\oci8_12c")
AC_DEFINE('HAVE_OCI8', 1);
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
} else {
WARNING("oci8-12c not enabled: Oracle Database client libraries or Oracle Database 12c Instant Client not found");
PHP_OCI8_12C = "no"
}
}