]> granicus.if.org Git - php/commitdiff
- Added PHP_CHECK_PDO_INCLUDES macro (caches the result)
authorfoobar <sniper@php.net>
Tue, 14 Jun 2005 00:00:53 +0000 (00:00 +0000)
committerfoobar <sniper@php.net>
Tue, 14 Jun 2005 00:00:53 +0000 (00:00 +0000)
acinclude.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 e190806976f384019e76722953ede4f83df665b2..1c94878aabfde5e51fc4068bb5cb4cd552a47a3d 100644 (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
+  ])
+])
index f967245ceef5cdfaabe7eeb3e354a07793aea5b5..90aa1a9e2150e4f5081d86aadedb61e4a911afae 100644 (file)
@@ -40,18 +40,8 @@ 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)
   AC_DEFINE(HAVE_PDO_FIREBIRD,1,[ ])
index 76b1499dd552aeb205f770af07157e59e4a80ddf..4ea134621ce68749451ea860eea1d5a16ce91821 100755 (executable)
@@ -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)
index c0fdb2b6360d48da49f79f7a43f01e804c1a97fa..dbdc90f8c409a28b8149e0547b4ad53012cdf718 100755 (executable)
@@ -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)
 
index 9385c8ba1d301d73ae528eba40fbfe6d60c35a00..94acaf46d05dbdd85aec0274db16f752a106c77c 100755 (executable)
@@ -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)
index 0d9955f6403e67263829feb64ee920de9c3dae81..844aad1f8f93efe5dc324a12a2a1577bc5e63c37 100644 (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) 
index fc3642438d00752a1b7c64e16f2c5e65094ce3c9..9e6dd18dabe9b2ea832c104e60ab25e3b16d9e5a 100644 (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"