From: foobar Date: Tue, 14 Jun 2005 00:00:53 +0000 (+0000) Subject: - Added PHP_CHECK_PDO_INCLUDES macro (caches the result) X-Git-Tag: php-5.1.0b2~214 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15cf2a60b0239096f470c7ae3782af922c38912e;p=php - Added PHP_CHECK_PDO_INCLUDES macro (caches the result) --- diff --git a/acinclude.m4 b/acinclude.m4 index e190806976..1c94878aab 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -2469,3 +2469,21 @@ AC_DEFUN([PHP_REGEX],[ 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 + ]) +]) diff --git a/ext/pdo_firebird/config.m4 b/ext/pdo_firebird/config.m4 index f967245cee..90aa1a9e21 100644 --- a/ext/pdo_firebird/config.m4 +++ b/ext/pdo_firebird/config.m4 @@ -40,18 +40,8 @@ if test "$PHP_PDO_FIREBIRD" != "no"; then -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,[ ]) diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4 index 76b1499dd5..4ea134621c 100755 --- a/ext/pdo_mysql/config.m4 +++ b/ext/pdo_mysql/config.m4 @@ -61,17 +61,7 @@ Note that the MySQL client library is not bundled anymore!]) 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) diff --git a/ext/pdo_oci/config.m4 b/ext/pdo_oci/config.m4 index c0fdb2b636..dbdc90f8c4 100755 --- a/ext/pdo_oci/config.m4 +++ b/ext/pdo_oci/config.m4 @@ -160,17 +160,7 @@ You need to tell me where to find your oracle SDK, or set ORACLE_HOME. -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) diff --git a/ext/pdo_odbc/config.m4 b/ext/pdo_odbc/config.m4 index 9385c8ba1d..94acaf46d0 100755 --- a/ext/pdo_odbc/config.m4 +++ b/ext/pdo_odbc/config.m4 @@ -30,11 +30,11 @@ AC_DEFUN([PDO_ODBC_CHECK_HEADER],[ 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 @@ -44,21 +44,21 @@ if test "$PHP_PDO_ODBC" != "no"; then 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)" ;; @@ -67,7 +67,7 @@ if test "$PHP_PDO_ODBC" != "no"; then ;; 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 @@ -127,17 +127,7 @@ functions required for PDO support. 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) diff --git a/ext/pdo_pgsql/config.m4 b/ext/pdo_pgsql/config.m4 index 0d9955f640..844aad1f8f 100644 --- a/ext/pdo_pgsql/config.m4 +++ b/ext/pdo_pgsql/config.m4 @@ -100,17 +100,7 @@ if test "$PHP_PDO_PGSQL" != "no"; then 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) diff --git a/ext/pdo_sqlite/config.m4 b/ext/pdo_sqlite/config.m4 index fc3642438d..9e6dd18dab 100644 --- a/ext/pdo_sqlite/config.m4 +++ b/ext/pdo_sqlite/config.m4 @@ -9,17 +9,7 @@ PHP_ARG_WITH(pdo-sqlite, for sqlite 3 driver for 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"