summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2003-04-30 10:17:25 +0000
committerfoobar <sniper@php.net>2003-04-30 10:17:25 +0000
commit5fbbd31ca4a3a1e82dfdc5b004869d5f76f8c15a (patch)
tree1f52f93afa4f06744aeae359d5441b3dd1dd1e1b
parent11d9dd93b97b9f336d76dabe704decd7c0546226 (diff)
downloadphp-git-5fbbd31ca4a3a1e82dfdc5b004869d5f76f8c15a.tar.gz
Fix compile problems with < 9.2 oracle libs
-rw-r--r--ext/oci8/config.m420
-rw-r--r--ext/oci8/oci8.c6
2 files changed, 19 insertions, 7 deletions
diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4
index a6122b878f..d689600d52 100644
--- a/ext/oci8/config.m4
+++ b/ext/oci8/config.m4
@@ -101,7 +101,20 @@ if test "$PHP_OCI8" != "no"; then
PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD)
AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ])
AC_DEFINE(HAVE_OCI8_SHARED_MODE,1,[ ])
- AC_DEFINE(HAVE_OCI9,1,[ ])
+
+ 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
+ ])
;;
*)
@@ -116,16 +129,15 @@ if test "$PHP_OCI8" != "no"; then
[
AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ])
], [
- unset ac_cv_func_ocilobistemporary
PHP_CHECK_LIBRARY(ocijdbc8, OCILobIsTemporary,
[
PHP_ADD_LIBRARY(ocijdbc8, 1, OCI8_SHARED_LIBADD)
AC_DEFINE(HAVE_OCI8_TEMP_LOB,1,[ ])
], [], [
- $OCI8_SHARED_LIBADD
+ -L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
])
], [
- $OCI8_SHARED_LIBADD
+ -L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
])
PHP_NEW_EXTENSION(oci8, oci8.c, $ext_shared)
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 318ceb8566..8f77125179 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -2153,7 +2153,7 @@ static oci_session *_oci_open_session(oci_server* server,char *username,char *pa
oci_session *session = 0, *psession = 0;
OCISvcCtx *svchp = 0;
char *hashed_details;
-#ifdef HAVE_OCI9
+#ifdef HAVE_OCI_9_2
ub2 charsetid = 0;
#endif
TSRMLS_FETCH();
@@ -2204,7 +2204,7 @@ static oci_session *_oci_open_session(oci_server* server,char *username,char *pa
session->server = server;
session->exclusive = exclusive;
-#ifdef HAVE_OCI9
+#ifdef HAVE_OCI_9_2
/* following chunk is Oracle 9i+ ONLY */
if (*charset) {
@@ -2242,7 +2242,7 @@ static oci_session *_oci_open_session(oci_server* server,char *username,char *pa
session->pEnv = OCI(pEnv);
session->charsetId = 0;
-#endif /* HAVE_OCI9 */
+#endif /* HAVE_OCI_9_2 */
/* allocate temporary Service Context */
CALL_OCI_RETURN(OCI(error), OCIHandleAlloc(