2022-03-24 07:41:00 +08:00
diff --git a/configure.ac b/configure.ac
2023-10-11 06:00:28 +08:00
index 7f97248..48ff1a1 100644
2022-03-24 07:41:00 +08:00
--- a/configure.ac
+++ b/configure.ac
2023-06-01 10:55:03 +08:00
@@ -19,7 +19,8 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
2022-03-24 07:41:00 +08:00
2024-08-20 00:54:25 +08:00
AC_INIT([PostgreSQL], [16.4], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
2022-05-28 08:03:32 +08:00
2022-03-24 07:41:00 +08:00
-m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
2023-06-01 10:55:03 +08:00
+cross_compiling=yes # Avoid conftest loading shared objects
2022-05-28 08:03:32 +08:00
+m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_warn([unsupported],[Autoconf version 2.69 is required.
Untested combinations of 'autoconf' and PostgreSQL versions are not
recommended. You can remove the check from 'configure.ac' but it is then
your responsibility whether the result works or not.])])
2023-10-11 06:00:28 +08:00
@@ -1311,7 +1312,8 @@ if test "$enable_thread_safety" = yes; then
2022-05-28 08:03:32 +08:00
fi
2022-03-24 07:41:00 +08:00
2022-05-28 08:03:32 +08:00
if test "$with_readline" = yes; then
- PGAC_CHECK_READLINE
+ PKG_CHECK_MODULES([READLINE], [readline], [HAVE_LIBREADLINE=1], [pgac_cv_check_readline=no])
+ LIBS="$READLINE_LIBS $LIBS"
if test x"$pgac_cv_check_readline" = x"no"; then
AC_MSG_ERROR([readline library not found
If you have readline already installed, see config.log for details on the
2023-10-11 06:00:28 +08:00
@@ -1321,7 +1323,7 @@ Use --without-readline to disable readline support.])
2022-03-24 07:41:00 +08:00
fi
if test "$with_zlib" = yes; then
- AC_CHECK_LIB(z, inflate, [],
2022-05-28 08:03:32 +08:00
+ PKG_CHECK_MODULES([ZLIB], [zlib], [LIBS="$ZLIB_LIBS $LIBS"],
2022-03-24 07:41:00 +08:00
[AC_MSG_ERROR([zlib library not found
If you have zlib already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
2023-10-11 06:00:28 +08:00
@@ -1370,6 +1372,9 @@ if test "$with_ssl" = openssl ; then
2022-05-28 08:03:32 +08:00
# Minimum required OpenSSL version is 1.0.1
AC_DEFINE(OPENSSL_API_COMPAT, [0x10001000L],
[Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.])
+ PKG_CHECK_MODULES([CRYPTO_new_ex_data], [libcrypto], [LIBS="$CRYPTO_new_ex_data_LIBS $LIBS"], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
+ PKG_CHECK_MODULES([SSL_new], [libssl], [LIBS="$SSL_new_LIBS $LIBS"], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
+ if false ; then
if test "$PORTNAME" != "win32"; then
2022-03-24 07:41:00 +08:00
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
AC_CHECK_LIB(ssl, SSL_new, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
2023-10-11 06:00:28 +08:00
@@ -1377,6 +1382,7 @@ if test "$with_ssl" = openssl ; then
2022-05-28 08:03:32 +08:00
AC_SEARCH_LIBS(CRYPTO_new_ex_data, [eay32 crypto], [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
AC_SEARCH_LIBS(SSL_new, [ssleay32 ssl], [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])
2022-03-24 07:41:00 +08:00
fi
2022-05-28 08:03:32 +08:00
+ fi
2023-10-11 06:00:28 +08:00
# Functions introduced in OpenSSL 1.0.2. LibreSSL does not have
# SSL_CTX_set_cert_cb().
AC_CHECK_FUNCS([X509_get_signature_nid SSL_CTX_set_cert_cb])
@@ -1403,19 +1409,23 @@ if test "$with_pam" = yes ; then
2022-03-24 07:41:00 +08:00
fi
if test "$with_libxml" = yes ; then
- AC_CHECK_LIB(xml2, xmlSaveToBuffer, [], [AC_MSG_ERROR([library 'xml2' (version >= 2.6.23) is required for XML support])])
2022-05-28 08:03:32 +08:00
+ PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6.23], [AC_DEFINE(HAVE_LIBXML2,1,[Define to 1 if with xml2])], [AC_MSG_ERROR([library 'xml2' (version >= 2.6.23) is required for XML support])])
+ LIBS="$LIBXML2_LIBS $LIBS"
2022-03-24 07:41:00 +08:00
fi
if test "$with_libxslt" = yes ; then
- AC_CHECK_LIB(xslt, xsltCleanupGlobals, [], [AC_MSG_ERROR([library 'xslt' is required for XSLT support])])
2022-05-28 08:03:32 +08:00
+ PKG_CHECK_MODULES([LIBXSLT], [libxslt], [AC_DEFINE(HAVE_LIBXSLT,1,[Define to 1 if with xslt])], [AC_MSG_ERROR([library 'xslt' is required for XSLT support])])
+ LIBS="$LIBXSLT_LIBS $LIBS"
2022-03-24 07:41:00 +08:00
fi
if test "$with_lz4" = yes ; then
- AC_CHECK_LIB(lz4, LZ4_compress_default, [], [AC_MSG_ERROR([library 'lz4' is required for LZ4 support])])
2022-05-28 08:03:32 +08:00
+ PKG_CHECK_MODULES([LZ4], [liblz4], [AC_DEFINE(HAVE_LIBLZ4,1,[Define to 1 if with lz4])], [AC_MSG_ERROR([library 'lz4' is required for LZ4 support])])
+ LIBS="$LZ4_LIBS $LIBS"
2022-03-24 07:41:00 +08:00
fi
2023-03-02 03:04:27 +08:00
if test "$with_zstd" = yes ; then
- AC_CHECK_LIB(zstd, ZSTD_compress, [], [AC_MSG_ERROR([library 'zstd' is required for ZSTD support])])
2023-06-01 10:55:03 +08:00
+ PKG_CHECK_MODULES([ZSTD], [libzstd], [AC_DEFINE(HAVE_LIBZSTD,1,[Define to 1 if with zstd])], [AC_MSG_ERROR([library 'zstd' is required for ZSTD support])])
+ LIBS="$ZSTD_LIBS $LIBS"
2023-03-02 03:04:27 +08:00
fi
2022-03-24 07:41:00 +08:00
# Note: We can test for libldap_r only after we know PTHREAD_LIBS;