mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
This bumps the libpq client-side PostgreSQL library minimum required version from 9.1 to 10.0. - Sanity check: PQlibVersion -> PQencryptPasswordConn (available since libpq 10.0) - PQsetErrorContextVisibility (available since libpq 9.6) - lo_truncate64 (available since libpq 9.3), if 32-bit system doesn't support lo_*64 functions, error is returned and functions are always available Additionally, the conditional functions usages in pdo_pgsql and pgsql extensions that got piled up are cleaned and synced: - pg_prepare (PQprepare available since libpq 7.4) - pg_query_params (PQexecParams available since libpq 7.4) - pg_result_error_field (PQresultErrorField available since libpq 7.4) - pg_send_prepare (PQsendPrepare available since libpq 7.4) - pg_send_query_params (PQsendQueryParams available since libpq 7.4) - pg_set_error_verbosity (PQsetErrorVerbosity available since libpq 7.4) - pg_transaction_status (PQtransactionStatus available since libpq 7.4) The Windows libpq version is currently at version 11.4: https://github.com/winlibs/postgresql Discussion: https://news-web.php.net/php.internals/123609 Follow-up of GH-14540
47 lines
1.8 KiB
Plaintext
47 lines
1.8 KiB
Plaintext
PHP_ARG_WITH([pgsql],
|
|
[for PostgreSQL support],
|
|
[AS_HELP_STRING([[--with-pgsql[=DIR]]],
|
|
[Include PostgreSQL support. Optional DIR is the PostgreSQL base install
|
|
directory or the path to pg_config. Also, the PGSQL_CFLAGS and PGSQL_LIBS
|
|
environment variables can be used instead of the DIR argument to customize
|
|
the libpq paths.])])
|
|
|
|
if test "$PHP_PGSQL" != "no"; then
|
|
PHP_SETUP_PGSQL([PGSQL_SHARED_LIBADD],,, [$PHP_PGSQL])
|
|
PHP_SUBST([PGSQL_SHARED_LIBADD])
|
|
|
|
AC_DEFINE(HAVE_PGSQL,1,[Whether to build PostgreSQL support or not])
|
|
|
|
PHP_CHECK_LIBRARY([pq], [PQresultMemorySize],
|
|
[AC_DEFINE([HAVE_PG_RESULT_MEMORY_SIZE], [1], [PostgreSQL 12 or later])],,
|
|
[$PGSQL_LIBS])
|
|
PHP_CHECK_LIBRARY([pq], [PQchangePassword],
|
|
[AC_DEFINE([HAVE_PG_CHANGE_PASSWORD], [1], [PostgreSQL 17 or later])],,
|
|
[$PGSQL_LIBS])
|
|
PHP_CHECK_LIBRARY([pq], [PQsocketPoll],
|
|
[AC_DEFINE([HAVE_PG_SOCKET_POLL], [1], [PostgreSQL 17 or later])],,
|
|
[$PGSQL_LIBS])
|
|
PHP_CHECK_LIBRARY([pq], [PQsetChunkedRowsMode],
|
|
[AC_DEFINE([HAVE_PG_SET_CHUNKED_ROWS_SIZE], [1], [PostgreSQL 17 or later])],,
|
|
[$PGSQL_LIBS])
|
|
|
|
old_CFLAGS=$CFLAGS
|
|
CFLAGS="$CFLAGS $PGSQL_CFLAGS"
|
|
|
|
dnl Available since PostgreSQL 12.
|
|
AC_CACHE_CHECK([if PGVerbosity enum has PQERRORS_SQLSTATE],
|
|
[php_cv_enum_pgverbosity_pqerrors_sqlstate],
|
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <libpq-fe.h>],
|
|
[PGVerbosity e = PQERRORS_SQLSTATE; (void)e;])],
|
|
[php_cv_enum_pgverbosity_pqerrors_sqlstate=yes],
|
|
[php_cv_enum_pgverbosity_pqerrors_sqlstate=no])])
|
|
AS_VAR_IF([php_cv_enum_pgverbosity_pqerrors_sqlstate], [yes],
|
|
[AC_DEFINE([HAVE_PQERRORS_SQLSTATE], [1],
|
|
[Define to 1 if PGVerbosity enum has PQERRORS_SQLSTATE.])])
|
|
|
|
CFLAGS=$old_CFLAGS
|
|
|
|
PHP_NEW_EXTENSION(pgsql, pgsql.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
|
|
PHP_ADD_EXTENSION_DEP(pgsql, pcre)
|
|
fi
|