]> granicus.if.org Git - php/commitdiff
symlinked pdo drivers under ext.
authorWez Furlong <wez@php.net>
Thu, 17 Feb 2005 04:23:15 +0000 (04:23 +0000)
committerWez Furlong <wez@php.net>
Thu, 17 Feb 2005 04:23:15 +0000 (04:23 +0000)
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.

ext/pdo/Makefile.frag
ext/pdo/config.m4
ext/pdo_firebird/config.m4
ext/pdo_mysql/config.m4
ext/pdo_oci/config.m4
ext/pdo_odbc/config.m4
ext/pdo_pgsql/config.m4
ext/pdo_sqlite/config.m4

index 8149a5df40bb4e18fc658c11e20468b7c5d40485..c5f1be442fe315c8c6a88c89a656dcee3f2d2e03 100644 (file)
@@ -32,8 +32,9 @@ install-pdo-headers:
 # 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 > $@
index 357d81966ca14464ee8a05024a54ceaeb93bcebf..bd2e2b94ef5486d47ae8af6643babf6ebcd9825c 100755 (executable)
@@ -51,8 +51,8 @@ in a future PHP/PEAR release.
 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
index 8af5e9b6d05076d59fa412eeb989d13928df5a1f..92d2a5d6ef87ba0b9959866668c5a00a537e1c71 100644 (file)
@@ -30,20 +30,23 @@ if test "$PHP_PDO_FIREBIRD" != "no"; 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
index d9de612ba1da83b1c408cb1c863cd58014251909..860f10db0e1fafc4df4db27e5f59edcafa5b1021 100755 (executable)
@@ -59,18 +59,20 @@ Note that the MySQL client library is not bundled anymore.])
   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
  
index 043d0cccf2acf372558efb1093c2ef5393b27713..a3d260e6c023003649fb3db66450cbbb6d40e1a0 100755 (executable)
@@ -160,20 +160,23 @@ You need to tell me where to find your oracle SDK, or set ORACLE_HOME.
     -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
index f7113a9207ec0490bd4b339a4388b4cee25f94ed..bddd7dcd6e86f0b5cf3b2c89323c74e7c73c9d82 100755 (executable)
@@ -134,8 +134,8 @@ functions required for PDO support.
   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
@@ -144,6 +144,6 @@ functions required for PDO support.
   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
 
index 5aa283c146457f911f0541b48cf2f7046660ef71..8ab436a62fa36263e9636b6ac782a7ee829cfd35 100644 (file)
@@ -97,17 +97,18 @@ if test "$PHP_PDO_PGSQL" != "no"; then
 
   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
index c5cec4b46cfd2ce53cdc6f4a24a94e388bda9bef..90e986c0a63627faef085abd31ed8ba97507a8f1 100644 (file)
@@ -3,17 +3,17 @@ dnl config.m4 for extension pdo_sqlite
 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
@@ -110,5 +110,5 @@ EOF
       AC_CHECK_HEADERS(time.h)
     
   fi
-dnl  PHP_ADD_EXTENSION_DEP(pdo_sqlite, pdo)
+  PHP_ADD_EXTENSION_DEP(pdo_sqlite, pdo)
 fi