diff options
author | Rasmus Lerdorf <rasmus@php.net> | 1999-10-28 20:33:43 +0000 |
---|---|---|
committer | Rasmus Lerdorf <rasmus@php.net> | 1999-10-28 20:33:43 +0000 |
commit | 990d5d72ea77dd064e4849a5e6cba92739345aa3 (patch) | |
tree | 5c8e6da9794ef2e35db24a880f3c6447d76f62dc | |
parent | 9704cd487338c93d44721b3b58ea9e630b00aea3 (diff) | |
download | php-git-990d5d72ea77dd064e4849a5e6cba92739345aa3.tar.gz |
(IBM DB2 Support) Fix stuff to allow IBM DB2 to work with PHP 4.
Tested against DB2 6.1 UDB on Linux (RH-6.0)
@- Enable IBM DB2 support - Tested against DB2 6.1 UDB on Linux (RH-6.0)
-rw-r--r-- | ext/odbc/config.h.stub | 1 | ||||
-rw-r--r-- | ext/odbc/config.m4 | 28 | ||||
-rw-r--r-- | ext/odbc/php_odbc.c | 6 | ||||
-rw-r--r-- | ext/odbc/php_odbc.h | 10 |
4 files changed, 37 insertions, 8 deletions
diff --git a/ext/odbc/config.h.stub b/ext/odbc/config.h.stub index f892c5b7d0..a339939aa1 100644 --- a/ext/odbc/config.h.stub +++ b/ext/odbc/config.h.stub @@ -1,4 +1,5 @@ #define HAVE_SOLID 0 +#define HAVE_IBMDB2 0 #define HAVE_IODBC 0 #define HAVE_ESOOB 0 #define HAVE_UNIXODBC 0 diff --git a/ext/odbc/config.m4 b/ext/odbc/config.m4 index b57031b382..f6d6643732 100644 --- a/ext/odbc/config.m4 +++ b/ext/odbc/config.m4 @@ -102,6 +102,34 @@ AC_ARG_WITH(solid, fi if test -z "$ODBC_TYPE"; then +AC_MSG_CHECKING(for IBM DB2 support) +AC_ARG_WITH(ibm-db2, +[ --with-ibm-db2[=DIR] Include IBM DB2 support. DIR is the DB2 base + install directory, defaults to /home/db2inst1/sqllib], +[ + if test "$withval" != "no"; then + if test "$withval" = "yes"; then + ODBC_INCDIR=/home/db2inst1/sqllib/include + ODBC_LIBDIR=/home/db2inst1/sqllib/lib + else + ODBC_INCDIR=$withval/include + ODBC_LIBDIR=$withval/lib + fi + ODBC_INCLUDE=-I$ODBC_INCDIR + ODBC_TYPE=db2 + ODBC_LIBS="-ldb2" + AC_DEFINE(HAVE_IBMDB2) + + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi +],[ + AC_MSG_RESULT(no) +]) +fi + +if test -z "$ODBC_TYPE"; then AC_MSG_CHECKING(for Empress support) AC_ARG_WITH(empress, [ --with-empress[=DIR] Include Empress support. DIR is the Empress base diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 1a09702d99..64ed24d343 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -62,7 +62,7 @@ static int le_result, le_conn, le_pconn; #define SAFE_SQL_NTS(n) ((SQLSMALLINT) ((n)?(SQL_NTS):0)) /* - * #if defined( HAVE_DB2 ) || defined( HAVE_UNIXODBC ) + * #if defined( HAVE_IBMDB2 ) || defined( HAVE_UNIXODBC ) SQLHANDLE henv; #else HENV henv; @@ -152,7 +152,7 @@ static void _free_odbc_result(odbc_result *res) (UWORD)SQL_COMMIT); #endif SQLFreeStmt(res->stmt,SQL_DROP); -#if !defined( HAVE_DB2 ) && !defined( HAVE_UNIXODBC ) +#if !defined( HAVE_IBMDB2 ) && !defined( HAVE_UNIXODBC ) res->stmt = NULL; #endif } @@ -445,7 +445,7 @@ PHP_MINFO_FUNCTION(odbc) php_printf("</table>\n"); } -#if defined ( HAVE_DB2 ) || defined ( HAVE_UNIXODBC ) +#if defined ( HAVE_IBMDB2 ) || defined ( HAVE_UNIXODBC ) void ODBC_SQL_ERROR(SQLHANDLE henv, SQLHANDLE conn, SQLHANDLE stmt, char *func) #else void ODBC_SQL_ERROR(HENV henv, HDBC conn, HSTMT stmt, char *func) diff --git a/ext/odbc/php_odbc.h b/ext/odbc/php_odbc.h index f82fb8ee28..f07a263373 100644 --- a/ext/odbc/php_odbc.h +++ b/ext/odbc/php_odbc.h @@ -118,9 +118,9 @@ PHP_FUNCTION(solid_fetch_prev); #define HAVE_SQL_EXTENDED_FETCH 1 #include <odbc.h> -#elif HAVE_DB2 /* DB2 CLI */ +#elif HAVE_IBMDB2 /* DB2 CLI */ -#define ODBC_TYPE "DB2 CLI" +#define ODBC_TYPE "IBM DB2 CLI" #define HAVE_SQL_EXTENDED_FETCH 1 #include <sqlcli1.h> #ifdef DB268K @@ -189,7 +189,7 @@ PHP_FUNCTION(odbc_statistics); PHP_FUNCTION(odbc_tableprivileges); typedef struct odbc_connection { -#if defined( HAVE_DB2 ) || defined( HAVE_UNIXODBC ) +#if defined( HAVE_IBMDB2 ) || defined( HAVE_UNIXODBC ) SQLHANDLE henv; SQLHANDLE hdbc; #else @@ -208,7 +208,7 @@ typedef struct odbc_result_value { } odbc_result_value; typedef struct odbc_result { -#if defined( HAVE_DB2 ) || defined( HAVE_UNIXODBC ) +#if defined( HAVE_IBMDB2 ) || defined( HAVE_UNIXODBC ) SQLHANDLE stmt; #else HSTMT stmt; @@ -249,7 +249,7 @@ odbc_connection *odbc_get_conn(HashTable *list, int count); void odbc_del_conn(HashTable *list, int ind); #define ODBC_SQL_ERROR odbc_sql_error -#if defined( HAVE_DB2 ) || defined( HAVE_UNIXODBC ) +#if defined( HAVE_IBMDB2 ) || defined( HAVE_UNIXODBC ) void odbc_sql_error(SQLHANDLE henv, SQLHANDLE conn, SQLHANDLE stmt, char *func); #else void odbc_sql_error(HENV henv, HDBC conn, HSTMT stmt, char *func); |