From: Peter Kokot Date: Mon, 8 Jul 2019 08:23:09 +0000 (+0200) Subject: Simplify PHP_CHECK_PDO_INCLUDES calls X-Git-Tag: php-7.4.0alpha3~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a39ea91753c5d131ff802ee394ee23ce2f37d7f4;p=php Simplify PHP_CHECK_PDO_INCLUDES calls Conditional checks were once used for backwards compatibility with phpize from PHP versions that didn't have this macro call yet. Closes GH-4376 --- diff --git a/build/php.m4 b/build/php.m4 index 5cc520d0ef..db8c9beb38 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -2182,7 +2182,6 @@ dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]]) dnl AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[ AC_CACHE_CHECK([for PDO includes], pdo_cv_inc_path, [ - AC_MSG_CHECKING([for PDO includes]) if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then pdo_cv_inc_path=$abs_srcdir/ext elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then diff --git a/ext/pdo_dblib/config.m4 b/ext/pdo_dblib/config.m4 index 33d80ac28c..fe81dd8031 100644 --- a/ext/pdo_dblib/config.m4 +++ b/ext/pdo_dblib/config.m4 @@ -51,22 +51,7 @@ if test "$PHP_PDO_DBLIB" != "no"; then PHP_ADD_INCLUDE($PDO_FREETDS_INCLUDE_DIR) PHP_ADD_LIBRARY_WITH_PATH(sybdb, $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR, PDO_DBLIB_SHARED_LIBADD) - ifdef([PHP_CHECK_PDO_INCLUDES], - [ - PHP_CHECK_PDO_INCLUDES - ],[ - AC_MSG_CHECKING([for PDO includes]) - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$abs_srcdir/ext - elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$phpincludedir/ext - else - AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) - fi - AC_MSG_RESULT($pdo_cv_inc_path) - ]) + PHP_CHECK_PDO_INCLUDES PDO_DBLIB_DEFS="-DPDO_DBLIB_FLAVOUR=\\\"freetds\\\"" PHP_NEW_EXTENSION(pdo_dblib, pdo_dblib.c dblib_driver.c dblib_stmt.c, $ext_shared,,-I$pdo_cv_inc_path $PDO_DBLIB_DEFS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) diff --git a/ext/pdo_mysql/config.m4 b/ext/pdo_mysql/config.m4 index 0bb87c9c25..546152fb1f 100644 --- a/ext/pdo_mysql/config.m4 +++ b/ext/pdo_mysql/config.m4 @@ -124,22 +124,7 @@ if test "$PHP_PDO_MYSQL" != "no"; then ]) fi - ifdef([PHP_CHECK_PDO_INCLUDES], - [ - PHP_CHECK_PDO_INCLUDES - ],[ - AC_MSG_CHECKING([for PDO includes]) - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$abs_srcdir/ext - elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$phpincludedir/ext - else - AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) - fi - AC_MSG_RESULT($pdo_cv_inc_path) - ]) + PHP_CHECK_PDO_INCLUDES if test -n "$PDO_MYSQL_CONFIG"; then PDO_MYSQL_SOCKET=`$PDO_MYSQL_CONFIG --socket` diff --git a/ext/pdo_oci/config.m4 b/ext/pdo_oci/config.m4 index 744a26c788..fe0fecddd6 100644 --- a/ext/pdo_oci/config.m4 +++ b/ext/pdo_oci/config.m4 @@ -210,22 +210,7 @@ if test "$PHP_PDO_OCI" != "no"; then -L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD ]) - ifdef([PHP_CHECK_PDO_INCLUDES], - [ - PHP_CHECK_PDO_INCLUDES - ],[ - AC_MSG_CHECKING([for PDO includes]) - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$abs_srcdir/ext - elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$phpincludedir/ext - else - AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) - fi - AC_MSG_RESULT($pdo_cv_inc_path) - ]) + PHP_CHECK_PDO_INCLUDES PHP_NEW_EXTENSION(pdo_oci, pdo_oci.c oci_driver.c oci_statement.c, $ext_shared,,-I$pdo_cv_inc_path) diff --git a/ext/pdo_odbc/config.m4 b/ext/pdo_odbc/config.m4 index 9e54591c48..9532a8d4d8 100644 --- a/ext/pdo_odbc/config.m4 +++ b/ext/pdo_odbc/config.m4 @@ -29,22 +29,7 @@ if test "$PHP_PDO_ODBC" != "no"; then AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.]) fi - ifdef([PHP_CHECK_PDO_INCLUDES], - [ - PHP_CHECK_PDO_INCLUDES - ],[ - AC_MSG_CHECKING([for PDO includes]) - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$abs_srcdir/ext - elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$phpincludedir/ext - else - AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) - fi - AC_MSG_RESULT($pdo_cv_inc_path) - ]) + PHP_CHECK_PDO_INCLUDES AC_MSG_CHECKING([for selected PDO ODBC flavour]) diff --git a/ext/pdo_pgsql/config.m4 b/ext/pdo_pgsql/config.m4 index 44a95880a6..e0c2df24f2 100644 --- a/ext/pdo_pgsql/config.m4 +++ b/ext/pdo_pgsql/config.m4 @@ -83,22 +83,7 @@ if test "$PHP_PDO_PGSQL" != "no"; then PHP_ADD_INCLUDE($PGSQL_INCLUDE) - ifdef([PHP_CHECK_PDO_INCLUDES], - [ - PHP_CHECK_PDO_INCLUDES - ],[ - AC_MSG_CHECKING([for PDO includes]) - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$abs_srcdir/ext - elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$phpincludedir/ext - else - AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) - fi - AC_MSG_RESULT($pdo_cv_inc_path) - ]) + PHP_CHECK_PDO_INCLUDES PHP_NEW_EXTENSION(pdo_pgsql, pdo_pgsql.c pgsql_driver.c pgsql_statement.c, $ext_shared,,-I$pdo_cv_inc_path) ifdef([PHP_ADD_EXTENSION_DEP], diff --git a/ext/pdo_sqlite/config.m4 b/ext/pdo_sqlite/config.m4 index 32bc60fa9a..c45d73f526 100644 --- a/ext/pdo_sqlite/config.m4 +++ b/ext/pdo_sqlite/config.m4 @@ -10,22 +10,7 @@ if test "$PHP_PDO_SQLITE" != "no"; then AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.]) fi - ifdef([PHP_CHECK_PDO_INCLUDES], - [ - PHP_CHECK_PDO_INCLUDES - ],[ - AC_MSG_CHECKING([for PDO includes]) - if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$abs_srcdir/ext - elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$abs_srcdir/ext - elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then - pdo_cv_inc_path=$phpincludedir/ext - else - AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) - fi - AC_MSG_RESULT($pdo_cv_inc_path) - ]) + PHP_CHECK_PDO_INCLUDES PKG_CHECK_MODULES([SQLITE], [sqlite3 > 3.7.4])