AC_MSG_CHECKING(which ODBC flavour you want)
if test "$PHP_PDO_ODBC" != "no" && test "$PHP_PDO_ODBC" != "yes" ; then
+
+ AC_MSG_CHECKING([for PDO includes])
+ if test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$prefix/include/php/ext
+ elif test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=ext
+ else
+ AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
+ fi
+ AC_MSG_RESULT($pdo_inc_path)
+
pdo_odbc_flavour=`echo $withval | cut -d, -f1`
pdo_odbc_dir=`echo $withval | cut -d, -f2`
PHP_EVAL_LIBLINE($PDO_ODBC_LIBS $PDO_ODBC_LFLAGS, [PDO_ODBC_SHARED_LIBADD])
PHP_SUBST(PDO_ODBC_SHARED_LIBADD)
- PHP_NEW_EXTENSION(pdo_odbc, pdo_odbc.c odbc_driver.c odbc_stmt.c, $ext_shared,,-I\$prefix/include/php/ext $PDO_ODBC_INCLUDE)
+ PHP_NEW_EXTENSION(pdo_odbc, pdo_odbc.c odbc_driver.c odbc_stmt.c, $ext_shared,,-I$pdo_inc_path $PDO_ODBC_INCLUDE)
PHP_ADD_EXTENSION_DEP(pdo_odbc, pdo)
else
AC_MSG_ERROR(
#include "pdo/php_pdo_driver.h"
#include "php_pdo_odbc.h"
#include "php_pdo_odbc_int.h"
+#include "zend_exceptions.h"
static int pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
{
einfo = &S->einfo;
}
- spprintf(&message, 0, "%s (%s[%d] at %s:%d)",
+ spprintf(&message, 0, "%s (%s[%ld] at %s:%d)",
einfo->last_err_msg,
einfo->what, einfo->last_error,
einfo->file, einfo->line);
sql = nsql;
} else if (ret == -1) {
/* couldn't grok it */
+ strcpy(dbh->error_code, stmt->error_code);
+ efree(S);
return 0;
}