Skip to content

Commit

Permalink
Cache the pdo include path
Browse files Browse the repository at this point in the history
  • Loading branch information
rlerdorf committed May 15, 2011
1 parent a8df376 commit 08792f6
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 37 deletions.
10 changes: 5 additions & 5 deletions acinclude.m4
Expand Up @@ -2760,17 +2760,17 @@ dnl
dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]]) dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]])
dnl dnl
AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[ AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[
AC_CACHE_CHECK([for PDO includes], pdo_inc_path, [ AC_CACHE_CHECK([for PDO includes], pdo_cv_inc_path, [
AC_MSG_CHECKING([for PDO includes]) AC_MSG_CHECKING([for PDO includes])
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$prefix/include/php/ext pdo_cv_inc_path=$prefix/include/php/ext
fi fi
]) ])
if test -n "$pdo_inc_path"; then if test -n "$pdo_cv_inc_path"; then
ifelse([$1],[],:,[$1]) ifelse([$1],[],:,[$1])
else else
ifelse([$2],[],[AC_MSG_ERROR([Cannot find php_pdo_driver.h.])],[$2]) ifelse([$2],[],[AC_MSG_ERROR([Cannot find php_pdo_driver.h.])],[$2])
Expand Down
10 changes: 5 additions & 5 deletions ext/pdo_dblib/config.m4
Expand Up @@ -59,19 +59,19 @@ if test "$PHP_PDO_DBLIB" != "no"; then
],[ ],[
AC_MSG_CHECKING([for PDO includes]) AC_MSG_CHECKING([for PDO includes])
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$prefix/include/php/ext pdo_cv_inc_path=$prefix/include/php/ext
else else
AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
fi fi
AC_MSG_RESULT($pdo_inc_path) AC_MSG_RESULT($pdo_cv_inc_path)
]) ])


PDO_DBLIB_DEFS="-DPDO_DBLIB_FLAVOUR=\\\"freetds\\\"" 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_inc_path $PDO_DBLIB_DEFS) PHP_NEW_EXTENSION(pdo_dblib, pdo_dblib.c dblib_driver.c dblib_stmt.c, $ext_shared,,-I$pdo_cv_inc_path $PDO_DBLIB_DEFS)
AC_CHECK_LIB(dnet_stub, dnet_addr, AC_CHECK_LIB(dnet_stub, dnet_addr,
[ PHP_ADD_LIBRARY_WITH_PATH(dnet_stub,,PDO_DBLIB_SHARED_LIBADD) [ PHP_ADD_LIBRARY_WITH_PATH(dnet_stub,,PDO_DBLIB_SHARED_LIBADD)
AC_DEFINE(HAVE_LIBDNET_STUB,1,[ ]) AC_DEFINE(HAVE_LIBDNET_STUB,1,[ ])
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo_firebird/config.m4
Expand Up @@ -50,7 +50,7 @@ if test "$PHP_PDO_FIREBIRD" != "no"; then
PHP_ADD_LIBRARY_WITH_PATH($FIREBIRD_LIBNAME, $FIREBIRD_LIBDIR, PDO_FIREBIRD_SHARED_LIBADD) PHP_ADD_LIBRARY_WITH_PATH($FIREBIRD_LIBNAME, $FIREBIRD_LIBDIR, PDO_FIREBIRD_SHARED_LIBADD)
PHP_ADD_INCLUDE($FIREBIRD_INCDIR) PHP_ADD_INCLUDE($FIREBIRD_INCDIR)
AC_DEFINE(HAVE_PDO_FIREBIRD,1,[ ]) AC_DEFINE(HAVE_PDO_FIREBIRD,1,[ ])
PHP_NEW_EXTENSION(pdo_firebird, pdo_firebird.c firebird_driver.c firebird_statement.c, $ext_shared,,-I$pdo_inc_path) PHP_NEW_EXTENSION(pdo_firebird, pdo_firebird.c firebird_driver.c firebird_statement.c, $ext_shared,,-I$pdo_cv_inc_path)
PHP_SUBST(PDO_FIREBIRD_SHARED_LIBADD) PHP_SUBST(PDO_FIREBIRD_SHARED_LIBADD)
PHP_ADD_EXTENSION_DEP(pdo_firebird, pdo) PHP_ADD_EXTENSION_DEP(pdo_firebird, pdo)
fi fi
10 changes: 5 additions & 5 deletions ext/pdo_mysql/config.m4
Expand Up @@ -136,15 +136,15 @@ if test "$PHP_PDO_MYSQL" != "no"; then
],[ ],[
AC_MSG_CHECKING([for PDO includes]) AC_MSG_CHECKING([for PDO includes])
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$prefix/include/php/ext pdo_cv_inc_path=$prefix/include/php/ext
else else
AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
fi fi
AC_MSG_RESULT($pdo_inc_path) AC_MSG_RESULT($pdo_cv_inc_path)
]) ])


if test -n "$PDO_MYSQL_CONFIG"; then if test -n "$PDO_MYSQL_CONFIG"; then
Expand All @@ -153,7 +153,7 @@ if test "$PHP_PDO_MYSQL" != "no"; then
fi fi


dnl fix after renaming to pdo_mysql dnl fix after renaming to pdo_mysql
PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_inc_path -I) PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_cv_inc_path -I)
ifdef([PHP_ADD_EXTENSION_DEP], ifdef([PHP_ADD_EXTENSION_DEP],
[ [
PHP_ADD_EXTENSION_DEP(pdo_mysql, pdo) PHP_ADD_EXTENSION_DEP(pdo_mysql, pdo)
Expand Down
10 changes: 5 additions & 5 deletions ext/pdo_oci/config.m4
Expand Up @@ -214,18 +214,18 @@ You need to tell me where to find your Oracle Instant Client SDK, or set ORACLE_
],[ ],[
AC_MSG_CHECKING([for PDO includes]) AC_MSG_CHECKING([for PDO includes])
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$prefix/include/php/ext pdo_cv_inc_path=$prefix/include/php/ext
else else
AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
fi fi
AC_MSG_RESULT($pdo_inc_path) AC_MSG_RESULT($pdo_cv_inc_path)
]) ])


PHP_NEW_EXTENSION(pdo_oci, pdo_oci.c oci_driver.c oci_statement.c, $ext_shared,,-I$pdo_inc_path) PHP_NEW_EXTENSION(pdo_oci, pdo_oci.c oci_driver.c oci_statement.c, $ext_shared,,-I$pdo_cv_inc_path)


PHP_SUBST_OLD(PDO_OCI_SHARED_LIBADD) PHP_SUBST_OLD(PDO_OCI_SHARED_LIBADD)
PHP_SUBST_OLD(PDO_OCI_DIR) PHP_SUBST_OLD(PDO_OCI_DIR)
Expand Down
10 changes: 5 additions & 5 deletions ext/pdo_odbc/config.m4
Expand Up @@ -47,15 +47,15 @@ if test "$PHP_PDO_ODBC" != "no"; then
],[ ],[
AC_MSG_CHECKING([for PDO includes]) AC_MSG_CHECKING([for PDO includes])
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$prefix/include/php/ext pdo_cv_inc_path=$prefix/include/php/ext
else else
AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
fi fi
AC_MSG_RESULT($pdo_inc_path) AC_MSG_RESULT($pdo_cv_inc_path)
]) ])


AC_MSG_CHECKING([for selected PDO ODBC flavour]) AC_MSG_CHECKING([for selected PDO ODBC flavour])
Expand Down Expand Up @@ -165,7 +165,7 @@ functions required for PDO support.
AC_MSG_ERROR([Your ODBC library does not exist or there was an error. Check config.log for more information]) AC_MSG_ERROR([Your ODBC library does not exist or there was an error. Check config.log for more information])
], $PDO_ODBC_LDFLAGS) ], $PDO_ODBC_LDFLAGS)


PHP_NEW_EXTENSION(pdo_odbc, pdo_odbc.c odbc_driver.c odbc_stmt.c, $ext_shared,,-I$pdo_inc_path $PDO_ODBC_INCLUDE) PHP_NEW_EXTENSION(pdo_odbc, pdo_odbc.c odbc_driver.c odbc_stmt.c, $ext_shared,,-I$pdo_cv_inc_path $PDO_ODBC_INCLUDE)
PHP_SUBST(PDO_ODBC_SHARED_LIBADD) PHP_SUBST(PDO_ODBC_SHARED_LIBADD)
ifdef([PHP_ADD_EXTENSION_DEP], ifdef([PHP_ADD_EXTENSION_DEP],
[ [
Expand Down
10 changes: 5 additions & 5 deletions ext/pdo_pgsql/config.m4
Expand Up @@ -110,18 +110,18 @@ if test "$PHP_PDO_PGSQL" != "no"; then
],[ ],[
AC_MSG_CHECKING([for PDO includes]) AC_MSG_CHECKING([for PDO includes])
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$prefix/include/php/ext pdo_cv_inc_path=$prefix/include/php/ext
else else
AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
fi fi
AC_MSG_RESULT($pdo_inc_path) AC_MSG_RESULT($pdo_cv_inc_path)
]) ])


PHP_NEW_EXTENSION(pdo_pgsql, pdo_pgsql.c pgsql_driver.c pgsql_statement.c, $ext_shared,,-I$pdo_inc_path $PDO_PGSQL_CFLAGS) PHP_NEW_EXTENSION(pdo_pgsql, pdo_pgsql.c pgsql_driver.c pgsql_statement.c, $ext_shared,,-I$pdo_cv_inc_path $PDO_PGSQL_CFLAGS)
ifdef([PHP_ADD_EXTENSION_DEP], ifdef([PHP_ADD_EXTENSION_DEP],
[ [
PHP_ADD_EXTENSION_DEP(pdo_pgsql, pdo) PHP_ADD_EXTENSION_DEP(pdo_pgsql, pdo)
Expand Down
12 changes: 6 additions & 6 deletions ext/pdo_sqlite/config.m4
Expand Up @@ -19,15 +19,15 @@ if test "$PHP_PDO_SQLITE" != "no"; then
],[ ],[
AC_MSG_CHECKING([for PDO includes]) AC_MSG_CHECKING([for PDO includes])
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext pdo_cv_inc_path=$abs_srcdir/ext
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$prefix/include/php/ext pdo_cv_inc_path=$prefix/include/php/ext
else else
AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
fi fi
AC_MSG_RESULT($pdo_inc_path) AC_MSG_RESULT($pdo_cv_inc_path)
]) ])


php_pdo_sqlite_sources_core="pdo_sqlite.c sqlite_driver.c sqlite_statement.c" php_pdo_sqlite_sources_core="pdo_sqlite.c sqlite_driver.c sqlite_statement.c"
Expand Down Expand Up @@ -70,7 +70,7 @@ if test "$PHP_PDO_SQLITE" != "no"; then
]) ])


PHP_SUBST(PDO_SQLITE_SHARED_LIBADD) PHP_SUBST(PDO_SQLITE_SHARED_LIBADD)
PHP_NEW_EXTENSION(pdo_sqlite, $php_pdo_sqlite_sources_core, $ext_shared,,-I$pdo_inc_path) PHP_NEW_EXTENSION(pdo_sqlite, $php_pdo_sqlite_sources_core, $ext_shared,,-I$pdo_cv_inc_path)
else else
# use bundled libs # use bundled libs
if test "$enable_maintainer_zts" = "yes"; then if test "$enable_maintainer_zts" = "yes"; then
Expand All @@ -92,7 +92,7 @@ if test "$PHP_PDO_SQLITE" != "no"; then


PHP_NEW_EXTENSION(pdo_sqlite, PHP_NEW_EXTENSION(pdo_sqlite,
$php_pdo_sqlite_sources_core, $php_pdo_sqlite_sources_core,
$ext_shared,,-DPDO_SQLITE_BUNDLED=1 $other_flags $threadsafe_flags -I$pdo_inc_path) $ext_shared,,-DPDO_SQLITE_BUNDLED=1 $other_flags $threadsafe_flags -I$pdo_cv_inc_path)


PHP_SUBST(PDO_SQLITE_SHARED_LIBADD) PHP_SUBST(PDO_SQLITE_SHARED_LIBADD)
PHP_ADD_EXTENSION_DEP(pdo_sqlite, sqlite3) PHP_ADD_EXTENSION_DEP(pdo_sqlite, sqlite3)
Expand Down

0 comments on commit 08792f6

Please sign in to comment.