]> granicus.if.org Git - php/commitdiff
MFH: compile fixes for < 9.2 oracle
authorfoobar <sniper@php.net>
Wed, 30 Apr 2003 10:20:14 +0000 (10:20 +0000)
committerfoobar <sniper@php.net>
Wed, 30 Apr 2003 10:20:14 +0000 (10:20 +0000)
ext/oci8/config.m4
ext/oci8/oci8.c

index a6122b878f78d364a49e3ea236bbbb246b8c8bbb..d689600d52dd5372cc3a9bfaa0e6e4a11924b084 100644 (file)
@@ -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)
index 7905bd6134c88b413f6c4910bd8fe6f897269d09..c5a6011f17e366a45edda02035bef5b0684d1714 100644 (file)
@@ -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(
@@ -2349,7 +2349,7 @@ static oci_session *_oci_open_session(oci_server* server,char *username,char *pa
 
        return psession;
 
- CLEANUP:
+CLEANUP:
        oci_debug("_oci_open_session: FAILURE -> CLEANUP called");
 
        _oci_close_session(session);
@@ -2526,7 +2526,7 @@ static oci_server *_oci_open_server(char *dbname,int persistent)
 
        return pserver;
 
- CLEANUP:
+CLEANUP:
        oci_debug("_oci_open_server: FAILURE -> CLEANUP called");
 
        _oci_close_server(server);
@@ -2769,7 +2769,7 @@ static void oci_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent,int exclu
 
        RETURN_RESOURCE(connection->id);
        
- CLEANUP:
+CLEANUP:
        oci_debug("oci_do_connect: FAILURE -> CLEANUP called");
 
        if (connection->id) {
@@ -3415,7 +3415,7 @@ PHP_FUNCTION(ociwritelobtofile)
                RETURN_TRUE;
        }
        
- bail:
+bail:
        if (fp != -1) {
                close(fp);
        }