sas Mon Feb 19 00:14:50 2001 EDT Modified files: /php4/ext/pgsql config.m4 php_pgsql.h Log: Fix incompatibility with PostgreSQL CVS. We now perform a check whether we need to include <postgres.h> to succesfully compile. PR: #9328 Index: php4/ext/pgsql/config.m4 diff -u php4/ext/pgsql/config.m4:1.18 php4/ext/pgsql/config.m4:1.19 --- php4/ext/pgsql/config.m4:1.18 Sun Feb 18 23:49:16 2001 +++ php4/ext/pgsql/config.m4 Mon Feb 19 00:14:45 2001 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.18 2001/02/19 07:49:16 sas Exp $ +dnl $Id: config.m4,v 1.19 2001/02/19 08:14:45 sas Exp $ AC_DEFUN(PGSQL_INC_CHK,[if test -r $i$1/libpq-fe.h; then PGSQL_DIR=$i; PGSQL_INCDIR=$i$1]) @@ -23,6 +23,25 @@ PGSQL_INCLUDE="-I$PGSQL_INCDIR" + AC_CACHE_CHECK([whether PostgreSQL needs postgres.h], ac_cv_php_pgsql_postgres_h,[ + old_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $PGSQL_INCLUDE" + AC_TRY_COMPILE([ +#include <libpq-fe.h> +],[ + Oid x = InvalidOid; +],[ + ac_cv_php_pgsql_postgres_h=no +],[ + ac_cv_php_pgsql_postgres_h=yes +]) + CPPFLAGS=$old_CPPFLAGS +]) + + if test "$ac_cv_php_pgsql_postgres_h" = "yes"; then + AC_DEFINE(PHP_PGSQL_NEEDS_POSTGRES_H, 1, [whether pgsql needs postgres.h]) + fi + PGSQL_LIBDIR=$PGSQL_DIR/lib test -d $PGSQL_DIR/lib/pgsql && PGSQL_LIBDIR=$PGSQL_DIR/lib/pgsql Index: php4/ext/pgsql/php_pgsql.h diff -u php4/ext/pgsql/php_pgsql.h:1.25 php4/ext/pgsql/php_pgsql.h:1.26 --- php4/ext/pgsql/php_pgsql.h:1.25 Tue Feb 13 10:28:24 2001 +++ php4/ext/pgsql/php_pgsql.h Mon Feb 19 00:14:45 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_pgsql.h,v 1.25 2001/02/13 18:28:24 thies Exp $ */ +/* $Id: php_pgsql.h,v 1.26 2001/02/19 08:14:45 sas Exp $ */ #ifndef PHP_PGSQL_H #define PHP_PGSQL_H @@ -29,7 +29,9 @@ #ifdef PHP_PGSQL_PRIVATE #undef SOCKET_SIZE_TYPE +#ifdef PHP_PGSQL_NEEDS_POSTGRES_H #include <postgres.h> +#endif #include <libpq-fe.h> #ifdef PHP_WIN32 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]