- Added PHP_CHECK_PDO_INCLUDES macro (caches the result)

This commit is contained in:
foobar 2005-06-14 00:00:53 +00:00
parent ee28f62dc0
commit 15cf2a60b0
7 changed files with 33 additions and 75 deletions

View File

@ -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
])
])

View File

@ -40,17 +40,7 @@ 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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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"