From 125da02aa766f273176319c09b999fd2f9fca108 Mon Sep 17 00:00:00 2001 From: Andreas Karajannis Date: Mon, 30 Aug 1999 10:48:23 +0000 Subject: [PATCH] Add support for unixODBC --- ext/odbc/config.h.stub | 1 + ext/odbc/config.m4 | 26 ++++++++++++++++++++++++++ ext/odbc/php3_odbc.h | 7 +++++++ ext/odbc/setup.stub | 17 +++++++++++++++-- 4 files changed, 49 insertions(+), 2 deletions(-) diff --git a/ext/odbc/config.h.stub b/ext/odbc/config.h.stub index 74771af292..09c9a8d5ac 100644 --- a/ext/odbc/config.h.stub +++ b/ext/odbc/config.h.stub @@ -1,5 +1,6 @@ #define HAVE_SOLID 0 #define HAVE_IODBC 0 +#define HAVE_UNIXODBC 0 #define HAVE_OPENLINK 0 #define HAVE_ADABAS 0 #define HAVE_CODBC 0 diff --git a/ext/odbc/config.m4 b/ext/odbc/config.m4 index bfe05ed052..6113438145 100644 --- a/ext/odbc/config.m4 +++ b/ext/odbc/config.m4 @@ -222,6 +222,32 @@ AC_ARG_WITH(iodbc, ]) fi +if test -z "$ODBC_TYPE"; then +AC_MSG_CHECKING(for unixODBC support) +AC_ARG_WITH(unixODBC, +[ --with-unixODBC[=DIR] Include unixODBC support. DIR is the unixODBC base + install directory, defaults to /usr/local.], +[ + if test "$withval" = "yes"; then + withval=/usr/local + fi + if test "$withval" != "no"; then + ODBC_INCDIR=$withval/include + ODBC_LIBDIR=$withval/lib + ODBC_LFLAGS=-L$ODBC_LIBDIR + ODBC_INCLUDE=-I$ODBC_INCDIR + ODBC_LIBS=-lodbc + ODBC_TYPE=unixODBC + AC_DEFINE(HAVE_UNIXODBC) + 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 OpenLink ODBC support) AC_ARG_WITH(openlink, diff --git a/ext/odbc/php3_odbc.h b/ext/odbc/php3_odbc.h index 647f4de918..1a35df910e 100644 --- a/ext/odbc/php3_odbc.h +++ b/ext/odbc/php3_odbc.h @@ -77,6 +77,13 @@ PHP_FUNCTION(solid_fetch_prev); #define SQL_LEN_DATA_AT_EXEC_OFFSET (-100) #define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET) +#elif HAVE_UNIXODBC /* unixODBC library */ + +#define ODBC_TYPE "unixODBC" +#include +#include +#define HAVE_SQL_EXTENDED_FETCH 1 + #elif HAVE_OPENLINK /* OpenLink ODBC drivers */ #define ODBC_TYPE "Openlink" diff --git a/ext/odbc/setup.stub b/ext/odbc/setup.stub index 8f2b2a942c..5257797527 100644 --- a/ext/odbc/setup.stub +++ b/ext/odbc/setup.stub @@ -24,8 +24,21 @@ define_option with-iodbc 'iODBC support?' yesnodir \ ' Whether to build PHP with iODBC support. This feature was first\n developed for iODBC Driver Manager, a freely redistributable ODBC\n driver manager which runs under many flavors of UNIX.\n - More info about iODBC can be found on the FreeODBC Pages at \n - http://users.ids.net/~bjepson/freeODBC/.' + More info about iODBC can be found on the iODBC page at \n + http://www.iodbc.org' +fi + +# unixODBC +if test "$option_value_with_solid" = "no" -a \ + "$option_value_with_empress" = "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 + developed for unixODBC Driver Manager, a freely redistributable ODBC\n + driver manager which runs under many flavors of UNIX and conforms to\n + the ODBC 3.5 specification.\n + More info about unixODBC can be found on the unixODBC home page at \n + http://www.unixodbc.org' fi # OpenLink -- 2.40.0