2001-12-01 03:00:13 +08:00
|
|
|
dnl
|
1999-05-12 22:21:38 +08:00
|
|
|
dnl $Id$
|
2001-12-01 03:00:13 +08:00
|
|
|
dnl
|
1999-05-12 22:21:38 +08:00
|
|
|
|
2003-01-25 01:51:19 +08:00
|
|
|
AC_DEFUN(PHP_OCI_IF_DEFINED,[
|
|
|
|
old_CPPFLAGS=$CPPFLAGS
|
|
|
|
CPPFLAGS=$3
|
|
|
|
AC_EGREP_CPP(yes,[
|
|
|
|
#include <oci.h>
|
|
|
|
#if defined($1)
|
|
|
|
yes
|
|
|
|
#endif
|
|
|
|
],[
|
|
|
|
CPPFLAGS=$old_CPPFLAGS
|
|
|
|
$2
|
|
|
|
],[
|
|
|
|
CPPFLAGS=$old_CPPFLAGS
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2000-04-27 22:29:11 +08:00
|
|
|
AC_DEFUN(AC_OCI8_VERSION,[
|
1999-05-12 22:21:38 +08:00
|
|
|
AC_MSG_CHECKING([Oracle version])
|
2000-10-29 12:36:33 +08:00
|
|
|
if test -s "$OCI8_DIR/orainst/unix.rgs"; then
|
2002-08-20 20:01:24 +08:00
|
|
|
OCI8_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4`
|
|
|
|
test -z "$OCI8_VERSION" && OCI8_VERSION=7.3
|
2001-09-07 08:24:06 +08:00
|
|
|
elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then
|
2002-08-20 20:01:24 +08:00
|
|
|
OCI8_VERSION=9.0
|
2001-09-07 08:24:06 +08:00
|
|
|
elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then
|
2002-08-20 20:01:24 +08:00
|
|
|
OCI8_VERSION=8.1
|
2001-09-07 08:24:06 +08:00
|
|
|
elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then
|
2002-08-20 20:01:24 +08:00
|
|
|
OCI8_VERSION=8.0
|
2001-02-15 05:41:40 +08:00
|
|
|
elif test -f $OCI8_DIR/lib/libclntsh.a; then
|
|
|
|
if test -f $OCI8_DIR/lib/libcore4.a; then
|
|
|
|
OCI8_VERSION=8.0
|
|
|
|
else
|
|
|
|
OCI8_VERSION=8.1
|
|
|
|
fi
|
1999-05-12 22:21:38 +08:00
|
|
|
else
|
2000-05-08 17:41:37 +08:00
|
|
|
AC_MSG_ERROR(Oracle-OCI8 needed libraries not found)
|
1999-05-12 22:21:38 +08:00
|
|
|
fi
|
2000-04-27 22:29:11 +08:00
|
|
|
AC_MSG_RESULT($OCI8_VERSION)
|
2000-05-08 17:41:37 +08:00
|
|
|
])
|
1999-05-12 22:21:38 +08:00
|
|
|
|
2000-05-08 17:06:48 +08:00
|
|
|
PHP_ARG_WITH(oci8, for Oracle-OCI8 support,
|
2003-10-03 13:24:33 +08:00
|
|
|
[ --with-oci8[=DIR] Include Oracle-oci8 support. Default DIR is ORACLE_HOME.])
|
1999-05-12 22:21:38 +08:00
|
|
|
|
2000-05-08 17:06:48 +08:00
|
|
|
if test "$PHP_OCI8" != "no"; then
|
|
|
|
AC_MSG_CHECKING([Oracle Install-Dir])
|
|
|
|
if test "$PHP_OCI8" = "yes"; then
|
2002-08-20 20:01:24 +08:00
|
|
|
OCI8_DIR=$ORACLE_HOME
|
2000-05-08 17:06:48 +08:00
|
|
|
else
|
2002-08-20 20:01:24 +08:00
|
|
|
OCI8_DIR=$PHP_OCI8
|
2000-05-08 17:06:48 +08:00
|
|
|
fi
|
|
|
|
AC_MSG_RESULT($OCI8_DIR)
|
1999-05-12 22:21:38 +08:00
|
|
|
|
2000-05-08 17:06:48 +08:00
|
|
|
if test -d "$OCI8_DIR/rdbms/public"; then
|
2002-08-20 20:01:24 +08:00
|
|
|
PHP_ADD_INCLUDE($OCI8_DIR/rdbms/public)
|
2003-01-25 01:51:19 +08:00
|
|
|
OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/public"
|
2000-05-08 17:06:48 +08:00
|
|
|
fi
|
|
|
|
if test -d "$OCI8_DIR/rdbms/demo"; then
|
2002-08-20 20:01:24 +08:00
|
|
|
PHP_ADD_INCLUDE($OCI8_DIR/rdbms/demo)
|
2003-01-25 01:51:19 +08:00
|
|
|
OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/rdbms/demo"
|
2000-05-08 17:06:48 +08:00
|
|
|
fi
|
|
|
|
if test -d "$OCI8_DIR/network/public"; then
|
2002-08-20 20:01:24 +08:00
|
|
|
PHP_ADD_INCLUDE($OCI8_DIR/network/public)
|
2003-01-25 01:51:19 +08:00
|
|
|
OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/network/public"
|
2000-05-08 17:06:48 +08:00
|
|
|
fi
|
|
|
|
if test -d "$OCI8_DIR/plsql/public"; then
|
2002-08-20 20:01:24 +08:00
|
|
|
PHP_ADD_INCLUDE($OCI8_DIR/plsql/public)
|
2003-01-25 01:51:19 +08:00
|
|
|
OCI8_INCLUDES="$OCI8_INCLUDES -I$OCI8_DIR/plsql/public"
|
2000-05-08 17:06:48 +08:00
|
|
|
fi
|
1999-05-12 22:21:38 +08:00
|
|
|
|
2000-05-08 17:06:48 +08:00
|
|
|
if test -f "$OCI8_DIR/lib/sysliblist"; then
|
2002-08-20 20:01:24 +08:00
|
|
|
PHP_EVAL_LIBLINE(`cat $OCI8_DIR/lib/sysliblist`, OCI8_SYSLIB)
|
2000-05-08 17:06:48 +08:00
|
|
|
elif test -f "$OCI8_DIR/rdbms/lib/sysliblist"; then
|
2002-08-20 20:01:24 +08:00
|
|
|
PHP_EVAL_LIBLINE(`cat $OCI8_DIR/rdbms/lib/sysliblist`, OCI8_SYSLIB)
|
2000-05-08 17:06:48 +08:00
|
|
|
fi
|
2000-04-27 22:29:11 +08:00
|
|
|
|
2000-05-08 17:06:48 +08:00
|
|
|
AC_OCI8_VERSION($OCI8_DIR)
|
|
|
|
case $OCI8_VERSION in
|
2002-08-20 20:01:24 +08:00
|
|
|
8.0)
|
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(nlsrtl3, "", OCI8_SHARED_LIBADD)
|
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(core4, "", OCI8_SHARED_LIBADD)
|
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(psa, "", OCI8_SHARED_LIBADD)
|
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(clntsh, $OCI8_DIR/lib, OCI8_SHARED_LIBADD)
|
|
|
|
;;
|
2000-04-27 22:29:11 +08:00
|
|
|
|
2002-12-06 21:44:35 +08:00
|
|
|
8.1)
|
2002-08-20 20:01:24 +08:00
|
|
|
PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
|
|
|
|
PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD)
|
2003-01-25 01:51:19 +08:00
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl OCI_ATTR_STATEMENT is not available in all 8.1.x versions
|
|
|
|
dnl
|
|
|
|
PHP_OCI_IF_DEFINED(OCI_ATTR_STATEMENT, [AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ])], $OCI8_INCLUDES)
|
2002-08-20 20:01:24 +08:00
|
|
|
;;
|
2001-07-27 07:07:45 +08:00
|
|
|
|
2002-12-06 21:44:35 +08:00
|
|
|
9.0)
|
|
|
|
PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
|
|
|
|
PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD)
|
|
|
|
AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ])
|
2003-04-30 18:17:25 +08:00
|
|
|
|
|
|
|
dnl These functions are only available in version >= 9.2
|
|
|
|
PHP_CHECK_LIBRARY(clntsh, OCIEnvNlsCreate,
|
|
|
|
[
|
|
|
|
PHP_CHECK_LIBRARY(clntsh, OCINlsCharSetNameToId,
|
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_OCI_9_2,1,[ ])
|
|
|
|
OCI8_VERSION=9.2
|
|
|
|
], [], [
|
|
|
|
-L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
|
|
|
|
])
|
|
|
|
], [], [
|
|
|
|
-L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
|
|
|
|
])
|
2002-12-06 21:44:35 +08:00
|
|
|
;;
|
|
|
|
|
2002-08-20 20:01:24 +08:00
|
|
|
*)
|
2000-05-08 17:06:48 +08:00
|
|
|
AC_MSG_ERROR(Unsupported Oracle version!)
|
2002-08-20 20:01:24 +08:00
|
|
|
;;
|
2000-05-08 17:06:48 +08:00
|
|
|
esac
|
2000-04-27 22:29:11 +08:00
|
|
|
|
2003-03-24 18:18:00 +08:00
|
|
|
dnl
|
|
|
|
dnl Check if we need to add -locijdbc8
|
|
|
|
dnl
|
|
|
|
PHP_CHECK_LIBRARY(clntsh, OCILobIsTemporary,
|
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ])
|
|
|
|
], [
|
|
|
|
PHP_CHECK_LIBRARY(ocijdbc8, OCILobIsTemporary,
|
|
|
|
[
|
|
|
|
PHP_ADD_LIBRARY(ocijdbc8, 1, OCI8_SHARED_LIBADD)
|
|
|
|
AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ])
|
|
|
|
], [], [
|
2003-04-30 18:17:25 +08:00
|
|
|
-L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
|
2003-03-24 18:18:00 +08:00
|
|
|
])
|
|
|
|
], [
|
2003-04-30 18:17:25 +08:00
|
|
|
-L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
|
2003-03-24 18:18:00 +08:00
|
|
|
])
|
|
|
|
|
2003-12-16 23:58:10 +08:00
|
|
|
dnl
|
|
|
|
dnl Check if we have collections
|
|
|
|
dnl
|
|
|
|
PHP_CHECK_LIBRARY(clntsh, OCICollAssign,
|
|
|
|
[
|
2004-01-15 14:30:23 +08:00
|
|
|
AC_DEFINE(PHP_OCI8_HAVE_COLLECTIONS,1,[ ])
|
2003-12-16 23:58:10 +08:00
|
|
|
], [], [
|
|
|
|
-L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
|
|
|
|
])
|
|
|
|
|
|
|
|
|
2002-03-13 00:44:00 +08:00
|
|
|
PHP_NEW_EXTENSION(oci8, oci8.c, $ext_shared)
|
2000-05-08 17:06:48 +08:00
|
|
|
AC_DEFINE(HAVE_OCI8,1,[ ])
|
2000-04-27 22:29:11 +08:00
|
|
|
|
2001-02-15 05:41:40 +08:00
|
|
|
PHP_SUBST_OLD(OCI8_SHARED_LIBADD)
|
|
|
|
PHP_SUBST_OLD(OCI8_DIR)
|
2000-12-21 01:21:37 +08:00
|
|
|
PHP_SUBST_OLD(OCI8_VERSION)
|
2003-12-16 23:58:10 +08:00
|
|
|
|
2000-05-08 17:06:48 +08:00
|
|
|
fi
|