summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Karajannis <kara@php.net>2000-10-17 15:23:18 +0000
committerAndreas Karajannis <kara@php.net>2000-10-17 15:23:18 +0000
commite8861e6d20ca6cfa8631c9a10bcad6fcb8d447e4 (patch)
tree991837c87f84248a90d0428d791e30a101035aa2
parentd95bc9b3eb4545954d776904400afe5dd60d5a67 (diff)
downloadphp-git-e8861e6d20ca6cfa8631c9a10bcad6fcb8d447e4.tar.gz
Added support for SAP DB
-rw-r--r--ext/odbc/config.m426
-rw-r--r--ext/odbc/php_odbc.h15
-rw-r--r--ext/odbc/setup.stub41
3 files changed, 74 insertions, 8 deletions
diff --git a/ext/odbc/config.m4 b/ext/odbc/config.m4
index 04fc1807ba..aaba400e89 100644
--- a/ext/odbc/config.m4
+++ b/ext/odbc/config.m4
@@ -107,6 +107,32 @@ AC_ARG_WITH(adabas,
fi
if test -z "$ODBC_TYPE"; then
+AC_MSG_CHECKING(for SAP DB support)
+AC_ARG_WITH(sapdb,
+[ --with-sapdb[=DIR] Include SAP DB support. DIR is SAP DB base
+ install directory, defaults to /usr/local.],
+[
+ if test "$withval" = "yes"; then
+ withval=/usr/local
+ fi
+ if test "$withval" != "no"; then
+ AC_ADD_INCLUDE($withval/incl)
+ AC_ADD_LIBPATH($withval/lib)
+ AC_ADD_LIBRARY(sqlod)
+ AC_ADD_LIBRARY(sqlrte)
+ ODBC_TYPE=sapdb
+ AC_DEFINE(HAVE_SAPDB,1,[ ])
+ 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 Solid support)
AC_ARG_WITH(solid,
[ --with-solid[=DIR] Include Solid support. DIR is the Solid base
diff --git a/ext/odbc/php_odbc.h b/ext/odbc/php_odbc.h
index f67e9a12e7..3b903f834b 100644
--- a/ext/odbc/php_odbc.h
+++ b/ext/odbc/php_odbc.h
@@ -75,6 +75,15 @@ PHP_FUNCTION(solid_fetch_prev);
#define HAVE_SQL_EXTENDED_FETCH 1
#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
+#elif defined(HAVE_SAPDB) /* SAP DB */
+
+#define ODBC_TYPE "SAP DB"
+#include <WINDOWS.H>
+#include <sql.h>
+#include <sqlext.h>
+#define HAVE_SQL_EXTENDED_FETCH 1
+#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
+
#elif defined(HAVE_IODBC) /* iODBC library */
#define ODBC_TYPE "iODBC"
@@ -219,7 +228,7 @@ typedef struct odbc_connection {
#if defined( HAVE_IBMDB2 ) || defined( HAVE_UNIXODBC )
SQLHANDLE henv;
SQLHANDLE hdbc;
-#elif defined( HAVE_SOLID_35 )
+#elif defined( HAVE_SOLID_35 ) || defined( HAVE_SAPDB )
SQLHENV henv;
SQLHDBC hdbc;
#else
@@ -240,7 +249,7 @@ typedef struct odbc_result_value {
typedef struct odbc_result {
#if defined( HAVE_IBMDB2 ) || defined( HAVE_UNIXODBC )
SQLHANDLE stmt;
-#elif defined( HAVE_SOLID_35 )
+#elif defined( HAVE_SOLID_35 ) || defined( HAVE_SAPDB )
SQLHSTMT stmt;
#else
HSTMT stmt;
@@ -285,7 +294,7 @@ int odbc_bindcols(odbc_result *result);
#if defined( HAVE_IBMDB2 ) || defined( HAVE_UNIXODBC )
#define ODBC_SQL_ERROR_PARAMS SQLHANDLE henv, SQLHANDLE conn, SQLHANDLE stmt, char *func
-#elif defined( HAVE_SOLID_35 )
+#elif defined( HAVE_SOLID_35 ) || defined( HAVE_SAPDB )
#define ODBC_SQL_ERROR_PARAMS SQLHENV henv, SQLHDBC conn, SQLHSTMT stmt, char *func
#else
#define ODBC_SQL_ERROR_PARAMS HENV henv, HDBC conn, HSTMT stmt, char *func
diff --git a/ext/odbc/setup.stub b/ext/odbc/setup.stub
index f257bc5ec9..859750c9ea 100644
--- a/ext/odbc/setup.stub
+++ b/ext/odbc/setup.stub
@@ -30,7 +30,8 @@ fi
# unixODBC
if test "$option_value_with_solid" = "no" -a \
- "$option_value_with_empress" = "no"; then
+ "$option_value_with_empress" = "no" -a \
+ "$option_value_with_iodbc" = "no"; then
define_option with-unixODBC 'unixODBC support?' yesnodir \
'no /usr/local unixODBC install' \
' Whether to build PHP with unixODBC support. This feature was first\n
@@ -43,7 +44,9 @@ fi
# ESOOB
if test "$option_value_with_solid" = "no" -a \
- "$option_value_with_empress" = "no"; then
+ "$option_value_with_empress" = "no" -a \
+ "$option_value_with_iodbc" = "no" -a \
+ "$option_value_with_unixODBC" = "no"; then
define_option with-esoob 'Easysoft ODBC-ODBC Bridge support?' yesnodir \
'no /usr/local/easysoft/oob/client ESOOB install' \
' Whether to build PHP with Easysoft ODBC-ODBC Bridge support.\n
@@ -54,7 +57,9 @@ fi
# OpenLink
if test "$option_value_with_solid" = "no" -a \
"$option_value_with_empress" = "no" -a \
- "$option_value_with_iodbc" = "no"; then
+ "$option_value_with_iodbc"" = "no" -a \
+ "$option_value_with_unixODBC" = "no" -a \
+ "$option_value_with_esoob" = "no"; then
define_option with-openlink 'OpenLink ODBC support?' yesnodir \
'no /usr/local/openlink OpenLink install' \
' Whether to build PHP with OpenLink ODBC support. See
@@ -65,6 +70,8 @@ fi
if test "$option_value_with_solid" = "no" -a \
"$option_value_with_empress" = "no" -a \
"$option_value_with_iodbc" = "no" -a \
+ "$option_value_with_unixODBC" = "no" -a \
+ "$option_value_with_esoob" = "no" -a \
"$option_value_with_openlink" = "no"; then
define_option with-adabas 'Adabas D support?' yesnodir \
'no /usr/local Adabas D install root' \
@@ -76,6 +83,8 @@ fi
if test "$option_value_with_solid" = "no" -a \
"$option_value_with_empress" = "no" -a \
"$option_value_with_iodbc" = "no" -a \
+ "$option_value_with_unixODBC" = "no" -a \
+ "$option_value_with_esoob" = "no" -a \
"$option_value_with_openlink" = "no" -a \
"$option_value_with_adabas" = "no"; then
define_option with-velocis 'Velocis support?' yesnodir \
@@ -88,6 +97,8 @@ fi
if test "$option_value_with_solid" = "no" -a \
"$option_value_with_empress" = "no" -a \
"$option_value_with_iodbc" = "no" -a \
+ "$option_value_with_unixODBC" = "no" -a \
+ "$option_value_with_esoob" = "no" -a \
"$option_value_with_openlink" = "no" -a \
"$option_value_with_adabas" = "no" -a \
"$option_value_with_velocis" = "no"; then
@@ -97,17 +108,37 @@ define_option with-dbmaker 'DBMaker support?' yesnodir \
More information about DBMaker can be found at http://www.casemaker.com/.'
fi
-# Custom ODBC
+# SAP DB
if test "$option_value_with_solid" = "no" -a \
"$option_value_with_empress" = "no" -a \
"$option_value_with_iodbc" = "no" -a \
+ "$option_value_with_unixODBC" = "no" -a \
+ "$option_value_with_esoob" = "no" -a \
"$option_value_with_openlink" = "no" -a \
"$option_value_with_adabas" = "no" -a \
- "$option_value_with_velocis" = "no"; -a \
+ "$option_value_with_velocis" = "no" -a \
"$option_value_with_dbmaker" = "no"; then
+define_option with-sapdb 'SAP DB support?' yesnodir \
+ 'no /usr/local SAP DB install' \
+' Whether to build PHP with SAP DB support. \n
+ More information about SAP DB can be found at http://www.sapdb.org.'
+fi
+
+# Custom ODBC
+if test "$option_value_with_solid" = "no" -a \
+ "$option_value_with_empress" = "no" -a \
+ "$option_value_with_iodbc" = "no" -a \
+ "$option_value_with_unixODBC" = "no" -a \
+ "$option_value_with_esoob" = "no" -a \
+ "$option_value_with_openlink" = "no" -a \
+ "$option_value_with_adabas" = "no" -a \
+ "$option_value_with_velocis" = "no" -a \
+ "$option_value_with_dbmaker" = "no" -a \
+ "$option_value_with_sapdb" = "no"; then
define_option with-custom-odbc 'custom ODBC support?' yesnodir \
'no /usr/local CODBC install' \
' Whether to build PHP with CODBC support. This feature was first
developed for Sybase SQL Anywhere 5.5 on QNX, but may be used for
any unknown ODBC driver on all flavors of UNIX.'
fi
+