AC_MSG_CHECKING([which regex library to use])
AC_MSG_RESULT([$REGEX_TYPE])
])
+
+dnl
+dnl PHP_CHECK_PDO_INCLUDES
+dnl
+AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[
+ AC_CACHE_CHECK([for PDO includes], pdo_inc_path, [
+ AC_MSG_CHECKING([for PDO includes])
+ if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$abs_srcdir/ext
+ elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
+ pdo_inc_path=$prefix/include/php/ext
+ else
+ AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
+ fi
+ ])
+])
-L$FIREBIRD_LIBDIR
])
- AC_MSG_CHECKING([for PDO includes])
- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$prefix/include/php/ext
- else
- AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
- fi
- AC_MSG_RESULT($pdo_inc_path)
-
+ PHP_CHECK_PDO_INCLUDES
+
PHP_ADD_LIBRARY_WITH_PATH($FIREBIRD_LIBNAME, $FIREBIRD_LIBDIR, PDO_FIREBIRD_SHARED_LIBADD)
PHP_ADD_INCLUDE($FIREBIRD_INCDIR)
AC_DEFINE(HAVE_PDO_FIREBIRD,1,[ ])
AC_CHECK_FUNCS([mysql_commit mysql_stmt_prepare])
LDFLAGS=$_SAVE_LDFLAGS
- AC_MSG_CHECKING([for PDO includes])
- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$prefix/include/php/ext
- else
- AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
- fi
- AC_MSG_RESULT($pdo_inc_path)
+ PHP_CHECK_PDO_INCLUDES
PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_inc_path)
PHP_ADD_EXTENSION_DEP(pdo_mysql, pdo)
-L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD
])
- AC_MSG_CHECKING([for PDO includes])
- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$prefix/include/php/ext
- else
- AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
- fi
- AC_MSG_RESULT($pdo_inc_path)
+ PHP_CHECK_PDO_INCLUDES
PHP_NEW_EXTENSION(pdo_oci, pdo_oci.c oci_driver.c oci_statement.c, $ext_shared,,-I$pdo_inc_path)
if test "$PHP_PDO_ODBC" != "no"; then
AC_MSG_CHECKING([for selected PDO ODBC flavour])
- pdo_odbc_flavour=`echo $PHP_PDO_ODBC | cut -d, -f1`
- pdo_odbc_dir=`echo $PHP_PDO_ODBC | cut -d, -f2`
+ pdo_odbc_flavour="`echo $PHP_PDO_ODBC | cut -d, -f1`"
+ pdo_odbc_dir="`echo $PHP_PDO_ODBC | cut -d, -f2`"
if test "$pdo_odbc_dir" = "$PHP_PDO_ODBC" ; then
- pdo_odbc_dir=""
+ pdo_odbc_dir=
fi
case $pdo_odbc_flavour in
pdo_odbc_def_lib=-ldb2
;;
- unixODBC)
+ unixODBC|unixodbc)
pdo_odbc_def_libdir=/usr/local/lib
pdo_odbc_def_incdir=/usr/local/include
pdo_odbc_def_lib=-lodbc
;;
- ODBCRouter)
+ ODBCRouter|odbcrouter)
pdo_odbc_def_libdir=/usr/lib
pdo_odbc_def_incdir=/usr/include
pdo_odbc_def_lib=-lodbcsdk
;;
generic)
- pdo_odbc_def_lib="`echo $withval | cut -d, -f3`"
- pdo_odbc_def_cflags="`echo $withval | cut -d, -f4`"
+ pdo_odbc_def_lib="`echo $PHP_PDO_ODBC | cut -d, -f3`"
+ pdo_odbc_def_cflags="`echo $PHP_PDO_ODBC | cut -d, -f4`"
pdo_odbc_flavour="$pdo_odbc_flavour ($pdo_odbc_def_lib)"
;;
;;
esac
- if test "$pdo_odbc_dir" != "" ; then
+ if test -n "$pdo_odbc_dir"; then
PDO_ODBC_INCDIR="$pdo_odbc_dir/include"
PDO_ODBC_LIBDIR="$pdo_odbc_dir/lib"
else
PHP_EVAL_LIBLINE($PDO_ODBC_LIBS $PDO_ODBC_LFLAGS, [PDO_ODBC_SHARED_LIBADD])
PHP_SUBST(PDO_ODBC_SHARED_LIBADD)
- AC_MSG_CHECKING([for PDO includes])
- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$prefix/include/php/ext
- else
- AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
- fi
- AC_MSG_RESULT($pdo_inc_path)
+ PHP_CHECK_PDO_INCLUDES
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)
PHP_ADD_INCLUDE($PGSQL_INCLUDE)
- AC_MSG_CHECKING([for PDO includes])
- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$prefix/include/php/ext
- else
- AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
- fi
- AC_MSG_RESULT($pdo_inc_path)
+ PHP_CHECK_PDO_INCLUDES
PHP_NEW_EXTENSION(pdo_pgsql, pdo_pgsql.c pgsql_driver.c pgsql_statement.c, $ext_shared,,-I$pdo_inc_path $PDO_PGSQL_CFLAGS)
PHP_ADD_EXTENSION_DEP(pdo_pgsql, pdo)
if test "$PHP_PDO_SQLITE" != "no"; then
- AC_MSG_CHECKING([for PDO includes])
- if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$prefix/include/php/ext
- else
- AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
- fi
- AC_MSG_RESULT($pdo_inc_path)
+ PHP_CHECK_PDO_INCLUDES
php_pdo_sqlite_sources_core="pdo_sqlite.c sqlite_driver.c sqlite_statement.c"