cvs: php4 /ext/odbc config.m4 php_odbc.c php_odbc.h

From: Date: Fri, 30 Jun 2000 19:22:53 +0000
Subject: cvs: php4 /ext/odbc config.m4 php_odbc.c php_odbc.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-571@lists.php.net to get a copy of this message
kalowsky Fri Jun 30 12:22:53 2000 EDT Modified files: /php4/ext/odbc config.m4 php_odbc.c php_odbc.h Log: updates for the SolidEE to work for 3.5 with PHP4.0.1. Still causes warning of "integer from pointer used without typecast" but does not seem to effect the final build any. have not found a correction yet. has not shown the SQLParamData bug either, but unknown if it is closed as i was unable to reproduce it. basically fixed the config.m4 file, and added a #define of HAVE_SOLID_35, due to the solidee 3.5 vs all other solidee systems being drastically different. and solidtech providing no means for testing what version you are using. does not include fixes for the linux users of glibc2 (automatically assumes libc5). temporary work around, link your /usr/local/solid/lib files from a scll2x23 or scll2x30 to a scllux30 or scllux23 name... suggestions to automate this are welcome. Index: php4/ext/odbc/config.m4 diff -u php4/ext/odbc/config.m4:1.18 php4/ext/odbc/config.m4:1.19 --- php4/ext/odbc/config.m4:1.18 Sun Mar 26 11:47:25 2000 +++ php4/ext/odbc/config.m4 Fri Jun 30 12:22:52 2000 @@ -2,36 +2,72 @@ dnl Figure out which library file to link with for the Solid support. dnl AC_DEFUN(AC_FIND_SOLID_LIBS,[ - AC_MSG_CHECKING([Solid library file]) + AC_MSG_CHECKING([Solid library file]) + ac_solid_uname_r=uname -r 2>/dev/null ac_solid_uname_s=uname -s 2>/dev/null case $ac_solid_uname_s in - AIX) ac_solid_os=a3x;; - HP-UX) ac_solid_os=h9x;; + AIX) ac_solid_os=a3x;; # a4x for AIX4 + HP-UX) ac_solid_os=h9x;; # h1x for hpux11, h0x for hpux10 IRIX) ac_solid_os=irx;; - Linux) ac_solid_os=lux;; + Linux) ac_solid_os=lux;; # this is only valid for libc5 systems, use 'l2x' for glibc2 systems SunOS) ac_solid_os=ssx;; # should we deal with SunOS 4? - FreeBSD) ac_solid_os=fbx;; + FreeBSD) if [$ac_solid_uname_r < "3."]; then + ac_solid_os=fbx + else + ac_solid_os=fex + fi;; # "uname -s" on SCO makes no sense. esac - ODBC_LIBS=echo $1/scl${ac_solid_os}*.so | cut -d' ' -f1 + + if test -f $1/scl${ac_solid_os}30.a; then + ac_solid_verion=30 + ac_solid_prefix=scl + elif test -f $1/scl${ac_solid_os}23.a; then + ac_solid_version=23 + ac_solid_prefix=scl + elif test -f $1/soc${ac_solid_os}35.a; then + ac_solid_version=35 + ac_solid_prefix=soc + fi + + ODBC_LIBS=echo $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}*.so | cut -d' ' -f1 if test ! -f $ODBC_LIBS; then - ODBC_LIBS=echo $1/scl${ac_solid_os}*.a | cut -d' ' -f1 + ODBC_LIBS=echo $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a | cut -d' ' -f1 fi if test ! -f $ODBC_LIBS; then - ODBC_LIBS=echo $1/scl2x${ac_solid_os}*.a | cut -d' ' -f1 + if test $ac_solid_version == 35; then + ODBC_LIBS=echo $1/libsolodbc.so | cut -d' ' -f1 + else + ODBC_LIBS=echo $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so| cut -d' ' -f1 + fi fi if test ! -f $ODBC_LIBS; then - ODBC_LIBS=echo $1/scl2x${ac_solid_os}*.a | cut -d' ' -f1 + if test $ac_solid_version == 35; then + ODBC_LIBS=echo $1/libsolodbc.a | cut -d' ' -f1 + else + ODBC_LIBS=echo $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a | cut -d' ' -f1 + fi fi if test ! -f $ODBC_LIBS; then - ODBC_LIBS=echo $1/bcl${ac_solid_os}*.so | cut -d' ' -f1 + if test $ac_solid_version == 35; then + ODBC_LIBS=echo $1/bcl${ac_solid_prefix}*.so | cut -d' ' -f1 + else + ODBC_LIBS=echo $1/bcl${ac_solid_os}*.so | cut -d' ' -f1 + fi fi if test ! -f $ODBC_LIBS; then - ODBC_LIBS=echo $1/bcl${ac_solid_os}*.a | cut -d' ' -f1 + if $ac_solid_version == 35; then + ODBC_LIBS=echo $1/bcl${ac_solid_prefix}*.a | cut -d' ' -f1 + else + ODBC_LIBS=echo $1/bcl${ac_solid_os}*.a | cut -d' ' -f1 + fi fi AC_MSG_RESULT(echo $ODBC_LIBS | sed -e 's!.*/!!') ]) + + + dnl dnl Figure out which library file to link with for the Empress support. dnl @@ -110,7 +146,11 @@ ODBC_LIBDIR=$withval/lib ODBC_INCLUDE=-I$ODBC_INCDIR ODBC_TYPE=solid - AC_DEFINE(HAVE_SOLID,1,[ ]) + if test -f $ODBC_LIBDIR/libsolodbc.a; then + AC_DEFINE(HAVE_SOLID_35,1,[ ]) + else + AC_DEFINE(HAVE_SOLID,1,[ ]) + fi AC_MSG_RESULT(yes) AC_FIND_SOLID_LIBS($ODBC_LIBDIR) else Index: php4/ext/odbc/php_odbc.c diff -u php4/ext/odbc/php_odbc.c:1.56 php4/ext/odbc/php_odbc.c:1.57 --- php4/ext/odbc/php_odbc.c:1.56 Sat Jun 24 08:31:09 2000 +++ php4/ext/odbc/php_odbc.c Fri Jun 30 12:22:52 2000 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.c,v 1.56 2000/06/24 15:31:09 sas Exp $ */ +/* $Id: php_odbc.c,v 1.57 2000/06/30 19:22:52 kalowsky Exp $ */ #include "php.h" #include "php_globals.h" @@ -96,11 +96,11 @@ PHP_FE(odbc_columns, NULL) PHP_FE(odbc_gettypeinfo, NULL) PHP_FE(odbc_primarykeys, NULL) -#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) /* not supported now */ +#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) /* not supported now */ PHP_FE(odbc_columnprivileges, NULL) PHP_FE(odbc_tableprivileges, NULL) #endif -#if !defined(HAVE_SOLID) /* not supported */ +#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) /* not supported */ PHP_FE(odbc_foreignkeys, NULL) PHP_FE(odbc_procedures, NULL) PHP_FE(odbc_procedurecolumns, NULL) @@ -147,7 +147,7 @@ res->values = NULL; } if (res->stmt) { -#ifdef HAVE_SOLID +#if defined(HAVE_SOLID) || defined(HAVE_SOLID_35) SQLTransact(res->conn_ptr->henv, res->conn_ptr->hdbc, (UWORD)SQL_COMMIT); #endif @@ -1227,7 +1227,7 @@ } /* }}} */ -#ifdef HAVE_SOLID +#ifdef HAVE_SOLID || defined(HAVE_SOLID_35) PHP_FUNCTION(solid_fetch_prev) { odbc_result *result; @@ -2403,7 +2403,7 @@ } /* }}} */ -#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) +#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) /* {{{ proto int odbc_columnprivileges(int connection_id, string catalog, string schema, string table, string column) Returns a result identifier that can be used to fetch a list of columns and associated privileges for the specified table */ PHP_FUNCTION(odbc_columnprivileges) @@ -2483,7 +2483,7 @@ /* }}} */ #endif /* HAVE_DBMAKER || HAVE_SOLID*/ -#if !defined(HAVE_SOLID) +#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) /* {{{ proto int odbc_foreignkeys(int connection_id, string pk_qualifier, string pk_owner, string pk_table, string fk_qualifier, string fk_owner, string fk_table) Returns a result identifier to either a list of foreign keys in the specified table or a list of foreign keys in other tables that refer to the primary key in the specified table */ PHP_FUNCTION(odbc_foreignkeys) @@ -2730,7 +2730,7 @@ } /* }}} */ -#if !defined(HAVE_SOLID) +#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) /* {{{ proto int odbc_procedurecolumns(int connection_id [, string qualifier, string owner, string proc, string column]) Returns a result identifier containing the list of input and output parameters, as well as the columns that make up the result set for the specified procedures */ PHP_FUNCTION(odbc_procedurecolumns) @@ -2814,7 +2814,7 @@ /* }}} */ #endif /* HAVE_SOLID */ -#if !defined(HAVE_SOLID) +#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) /* {{{ proto int odbc_procedures(int connection_id [, string qualifier, string owner, string name]) Returns a result identifier containg the list of procedure names in a datasource */ PHP_FUNCTION(odbc_procedures) @@ -3067,7 +3067,7 @@ } /* }}} */ -#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) +#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) /* {{{ proto int odbc_tableprivileges(int connection_id, string qualifier, string owner, string name) Returns a result identifier containing a list of tables and the privileges associated with each table */ PHP_FUNCTION(odbc_tableprivileges) Index: php4/ext/odbc/php_odbc.h diff -u php4/ext/odbc/php_odbc.h:1.21 php4/ext/odbc/php_odbc.h:1.22 --- php4/ext/odbc/php_odbc.h:1.21 Sun May 28 05:48:12 2000 +++ php4/ext/odbc/php_odbc.h Fri Jun 30 12:22:52 2000 @@ -28,7 +28,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.h,v 1.21 2000/05/28 12:48:12 kara Exp $ */ +/* $Id: php_odbc.h,v 1.22 2000/06/30 19:22:52 kalowsky Exp $ */ #ifndef _PHP_ODBC_H #define _PHP_ODBC_H @@ -45,11 +45,24 @@ /* checking in the same order as in configure.in */ -#ifdef HAVE_SOLID /* Solid Server */ +#if defined(HAVE_SOLID) || defined(HAVE_SOLID_35) /* Solid Server */ #define ODBC_TYPE "Solid" -#include <cli0core.h> -#include <cli0ext1.h> +#if defined(HAVE_SOLID) + #include <cli0core.h> + #include <cli0ext1.h> + /*the following help for SOLID 3.0 */ + #include <cli0cli.h> + #include <cli0env.h> +#elif defined(HAVE_SOLID_35) + #if !defined(PHP_WIN32) + #include <sqlunix.h> + #endif + #include <sql.h> + #include <sqltypes.h> + #include <sqlucode.h> + #include <sqlext.h> +#endif #undef HAVE_SQL_EXTENDED_FETCH PHP_FUNCTION(solid_fetch_prev); #define SQLSMALLINT SWORD @@ -194,11 +207,11 @@ PHP_FUNCTION(odbc_longreadlen); PHP_FUNCTION(odbc_tables); PHP_FUNCTION(odbc_columns); -#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) /* not supported now */ +#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_35) /* not supported now */ PHP_FUNCTION(odbc_columnprivileges); PHP_FUNCTION(odbc_tableprivileges); #endif -#if !defined(HAVE_SOLID) /* not supported */ +#if !defined(HAVE_SOLID) || !defined(HAVE_SOLID_35) /* not supported */ PHP_FUNCTION(odbc_foreignkeys); PHP_FUNCTION(odbc_procedures); PHP_FUNCTION(odbc_procedurecolumns);

« previous php.cvs (#571) next »