Enabled PDO and PDO_SQLITE by default.
Fixup PDO header detection so that it searches in the correct order, and
correctly picks up the headers when building from outside of the source
tree.
TODO: make pdo_XXX auto-enable when XXX is enabled. Volunteers welcome.
# mini hack
install: $(all_targets) $(install_targets) install-pdo-headers
-$(top_srcdir)/ext/pdo/pdo_sql_parser.c: $(top_srcdir)/ext/pdo/pdo_sql_parser.re
- exit 0; re2c -b $(top_srcdir)/ext/pdo/pdo_sql_parser.re > $@
+#$(top_srcdir)/ext/pdo/pdo_sql_parser.c: $(top_srcdir)/ext/pdo/pdo_sql_parser.re
+# exit 0; re2c -b $(top_srcdir)/ext/pdo/pdo_sql_parser.re > $@
+
+#$(srcdir)/pdo_sql_parser.c: $(srcdir)/pdo_sql_parser.re
+# exit 0; re2c -b $(srcdir)/pdo_sql_parser.re > $@
-$(srcdir)/pdo_sql_parser.c: $(srcdir)/pdo_sql_parser.re
- exit 0; re2c -b $(srcdir)/pdo_sql_parser.re > $@
fi
])
-PHP_ARG_ENABLE(pdo, whether to disable PDO support,
-[ --disable-pdo Disable PHP Data Objects support], yes)
+PHP_ARG_ENABLE(pdo, whether to enable PDO support,
+[ --enable-pdo=yes Enable PHP Data Objects support (recommended)], yes)
if test "$PHP_PDO" != "no"; then
if test "$ext_shared" = "yes" ; then
], [
-L$FIREBIRD_LIBDIR
])
-
- if test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$prefix/include/php/ext
- elif test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; 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 ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=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.])
+ AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
fi
+ AC_MSG_RESULT($pdo_inc_path)
PHP_ADD_LIBRARY_WITH_PATH($FIREBIRD_LIBNAME, $FIREBIRD_LIBDIR, PDO_FIREBIRD_SHARED_LIBADD)
PHP_ADD_INCLUDE($FIREBIRD_INCDIR)
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_SUBST(PDO_FIREBIRD_SHARED_LIBADD)
+ PHP_ADD_EXTENSION_DEP(pdo_firebird, pdo)
fi
AC_CHECK_FUNCS([mysql_commit mysql_stmt_prepare])
LDFLAGS=$_SAVE_LDFLAGS
- if test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$prefix/include/php/ext
- elif test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=ext
+ 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.])
+ AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
fi
+ AC_MSG_RESULT($pdo_inc_path)
PHP_NEW_EXTENSION(pdo_mysql, pdo_mysql.c mysql_driver.c mysql_statement.c, $ext_shared,,-I$pdo_inc_path)
-dnl PHP_ADD_EXTENSION_DEP(pdo_mysql, pdo)
+ PHP_ADD_EXTENSION_DEP(pdo_mysql, pdo)
PDO_MYSQL_MODULE_TYPE=external
PDO_MYSQL_INCLUDE=-I$PDO_MYSQL_INC_DIR
-L$PDO_OCI_LIB_DIR $PDO_OCI_SHARED_LIBADD
])
- if test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$prefix/include/php/ext
- elif test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; 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 ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=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.])
+ AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
fi
+ AC_MSG_RESULT($pdo_inc_path)
PHP_NEW_EXTENSION(pdo_oci, pdo_oci.c oci_driver.c oci_statement.c, $ext_shared,,-I$pdo_inc_path)
PHP_SUBST_OLD(PDO_OCI_SHARED_LIBADD)
PHP_SUBST_OLD(PDO_OCI_DIR)
PHP_SUBST_OLD(PDO_OCI_VERSION)
+ PHP_ADD_EXTENSION_DEP(pdo_oci, pdo)
fi
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 ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=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_RESULT($pdo_inc_path)
PHP_NEW_EXTENSION(pdo_odbc, pdo_odbc.c odbc_driver.c odbc_stmt.c, $ext_shared,,-I$pdo_inc_path $PDO_ODBC_INCLUDE)
-dnl PHP_ADD_EXTENSION_DEP(pdo_odbc, pdo)
+ PHP_ADD_EXTENSION_DEP(pdo_odbc, pdo)
fi
PHP_ADD_INCLUDE($PGSQL_INCLUDE)
-dnl find PDO sources
- if test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$prefix/include/php/ext
+ 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 ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=ext
+ 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.])
+ AC_MSG_ERROR([Cannot find php_pdo_driver.h.])
fi
+ AC_MSG_RESULT($pdo_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)
-dnl PHP_ADD_EXTENSION_DEP(pdo_pgsql, pdo)
+ PHP_ADD_EXTENSION_DEP(pdo_pgsql, pdo)
fi
dnl vim:et:sw=2:ts=2:
PHP_ARG_WITH(pdo-sqlite, for sqlite 3 driver for PDO,
-[ --with-pdo-sqlite Include PDO sqlite 3 support])
+[ --with-pdo-sqlite Include PDO sqlite 3 support],yes)
if test "$PHP_PDO_SQLITE" != "no"; then
AC_MSG_CHECKING([for PDO includes])
- if test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$prefix/include/php/ext
- elif test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=$abs_srcdir/ext
- elif test -f ext/pdo/php_pdo_driver.h; then
- pdo_inc_path=ext
+ 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_CHECK_HEADERS(time.h)
fi
-dnl PHP_ADD_EXTENSION_DEP(pdo_sqlite, pdo)
+ PHP_ADD_EXTENSION_DEP(pdo_sqlite, pdo)
fi