derick          Fri Jul  1 05:10:15 2005 EDT

  Modified files:              (Branch: PHP_4_4)
    /php-src/ext/pgsql  config.m4 
  Log:
  - Backport config.m4 from HEAD so that pg_config can be used.
  
  
http://cvs.php.net/diff.php/php-src/ext/pgsql/config.m4?r1=1.34.4.2&r2=1.34.4.2.2.1&ty=u
Index: php-src/ext/pgsql/config.m4
diff -u php-src/ext/pgsql/config.m4:1.34.4.2 
php-src/ext/pgsql/config.m4:1.34.4.2.2.1
--- php-src/ext/pgsql/config.m4:1.34.4.2        Sun Apr  3 09:06:58 2005
+++ php-src/ext/pgsql/config.m4 Fri Jul  1 05:10:14 2005
@@ -1,37 +1,56 @@
 dnl
-dnl $Id: config.m4,v 1.34.4.2 2005/04/03 13:06:58 tony2001 Exp $
+dnl $Id: config.m4,v 1.34.4.2.2.1 2005/07/01 09:10:14 derick Exp $
 dnl
 
+AC_DEFUN([PHP_PGSQL_CHECK_FUNCTIONS],[
+])
+
 PHP_ARG_WITH(pgsql,for PostgreSQL support,
 [  --with-pgsql[=DIR]      Include PostgreSQL support.  DIR is the PostgreSQL
-                          base install directory, defaults to 
/usr/local/pgsql.])
+                          base install directory or the path to pg_config])
 
 if test "$PHP_PGSQL" != "no"; then
   PHP_EXPAND_PATH($PGSQL_INCLUDE, PGSQL_INCLUDE)
 
-  if test "$PHP_PGSQL" = "yes"; then
-    PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/pgsql"
+  AC_MSG_CHECKING(for pg_config)
+  for i in $PHP_PGSQL $PHP_PGSQL/bin /usr/local/pgsql/bin /usr/local/bin 
/usr/bin ""; do
+       if test -x $i/pg_config; then
+      PG_CONFIG="$i/pg_config"
+      break;
+    fi
+  done
+
+  if test -n "$PG_CONFIG"; then
+    AC_MSG_RESULT([$PG_CONFIG])
+    PGSQL_INCLUDE=`$PG_CONFIG --includedir`
+    PGSQL_LIBDIR=`$PG_CONFIG --libdir`
+    AC_DEFINE(HAVE_PG_CONFIG_H,1,[Whether to have pg_config.h])
   else
-    PGSQL_SEARCH_PATHS=$PHP_PGSQL
-  fi
+    AC_MSG_RESULT(not found)
+    if test "$PHP_PGSQL" = "yes"; then
+      PGSQL_SEARCH_PATHS="/usr /usr/local /usr/local/pgsql"
+    else
+      PGSQL_SEARCH_PATHS=$PHP_PGSQL
+    fi
   
-  for i in $PGSQL_SEARCH_PATHS; do
-    for j in include include/pgsql include/postgres include/postgresql ""; do
-      if test -r "$i/$j/libpq-fe.h"; then
-        PGSQL_INC_BASE=$i
-        PGSQL_INCLUDE=$i/$j
-        if test -r "$i/$j/pg_config.h"; then
-          AC_DEFINE(HAVE_PG_CONFIG_H,1,[Whether to have pg_config.h])
+    for i in $PGSQL_SEARCH_PATHS; do
+      for j in include include/pgsql include/postgres include/postgresql ""; do
+        if test -r "$i/$j/libpq-fe.h"; then
+          PGSQL_INC_BASE=$i
+          PGSQL_INCLUDE=$i/$j
+          if test -r "$i/$j/pg_config.h"; then
+            AC_DEFINE(HAVE_PG_CONFIG_H,1,[Whether to have pg_config.h])
+          fi
         fi
-      fi
-    done
+      done
 
-    for j in lib lib/pgsql lib/postgres lib/postgresql ""; do
-      if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then 
-        PGSQL_LIBDIR=$i/$j
-      fi
+      for j in $PHP_LIBDIR $PHP_LIBDIR/pgsql $PHP_LIBDIR/postgres 
$PHP_LIBDIR/postgresql ""; do
+        if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then 
+          PGSQL_LIBDIR=$i/$j
+        fi
+      done
     done
-  done
+  fi
 
   if test -z "$PGSQL_INCLUDE"; then
     AC_MSG_ERROR(Cannot find libpq-fe.h. Please specify correct PostgreSQL 
installation path)
@@ -50,10 +69,25 @@
   old_LDFLAGS=$LDFLAGS
   LDFLAGS="$LDFLAGS -L$PGSQL_LIBDIR"
   AC_CHECK_LIB(pq, PQescapeString,AC_DEFINE(HAVE_PQESCAPE,1,[PostgreSQL 7.2.0 
or later]))
+  AC_CHECK_LIB(pq, 
PQunescapeBytea,AC_DEFINE(HAVE_PQUNESCAPEBYTEA,1,[PostgreSQL 7.3.0 or later]))
   AC_CHECK_LIB(pq, 
PQsetnonblocking,AC_DEFINE(HAVE_PQSETNONBLOCKING,1,[PostgreSQL 7.0.x or later]))
   AC_CHECK_LIB(pq, PQcmdTuples,AC_DEFINE(HAVE_PQCMDTUPLES,1,[Broken libpq 
under windows]))
   AC_CHECK_LIB(pq, PQoidValue,AC_DEFINE(HAVE_PQOIDVALUE,1,[Older PostgreSQL]))
   AC_CHECK_LIB(pq, 
PQclientEncoding,AC_DEFINE(HAVE_PQCLIENTENCODING,1,[PostgreSQL 7.0.x or later]))
+  AC_CHECK_LIB(pq, 
PQparameterStatus,AC_DEFINE(HAVE_PQPARAMETERSTATUS,1,[PostgreSQL 7.4 or later]))
+  AC_CHECK_LIB(pq, 
PQprotocolVersion,AC_DEFINE(HAVE_PQPROTOCOLVERSION,1,[PostgreSQL 7.4 or later]))
+  AC_CHECK_LIB(pq, 
PQtransactionStatus,AC_DEFINE(HAVE_PGTRANSACTIONSTATUS,1,[PostgreSQL 7.4 or 
later]))
+  AC_CHECK_LIB(pq, PQexecParams,AC_DEFINE(HAVE_PQEXECPARAMS,1,[PostgreSQL 7.4 
or later]))
+  AC_CHECK_LIB(pq, PQprepare,AC_DEFINE(HAVE_PQPREPARE,1,[PostgreSQL 7.4 or 
later]))
+  AC_CHECK_LIB(pq, PQexecPrepared,AC_DEFINE(HAVE_PQEXECPREPARED,1,[PostgreSQL 
7.4 or later]))
+  AC_CHECK_LIB(pq, 
PQresultErrorField,AC_DEFINE(HAVE_PQRESULTERRORFIELD,1,[PostgreSQL 7.4 or 
later]))
+  AC_CHECK_LIB(pq, 
PQsendQueryParams,AC_DEFINE(HAVE_PQSENDQUERYPARAMS,1,[PostgreSQL 7.4 or later]))
+  AC_CHECK_LIB(pq, PQsendPrepare,AC_DEFINE(HAVE_PQSENDPREPARE,1,[PostgreSQL 
7.4 or later]))
+  AC_CHECK_LIB(pq, 
PQsendQueryPrepared,AC_DEFINE(HAVE_PQSENDQUERYPREPARED,1,[PostgreSQL 7.4 or 
later]))
+  AC_CHECK_LIB(pq, PQputCopyData,AC_DEFINE(HAVE_PQPUTCOPYDATA,1,[PostgreSQL 
7.4 or later]))
+  AC_CHECK_LIB(pq, PQputCopyEnd,AC_DEFINE(HAVE_PQPUTCOPYEND,1,[PostgreSQL 7.4 
or later]))
+  AC_CHECK_LIB(pq, PQgetCopyData,AC_DEFINE(HAVE_PQGETCOPYDATA,1,[PostgreSQL 
7.4 or later]))
+  AC_CHECK_LIB(pq, 
PQsetErrorVerbosity,AC_DEFINE(HAVE_PQSETERRORVERBOSITY,1,[PostgreSQL 7.4 or 
later]))
   AC_CHECK_LIB(pq, 
pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[Whether 
libpq is compiled with --enable-multibyte]))
   LIBS=$old_LIBS
   LDFLAGS=$old_LDFLAGS

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to