vcpkg/ports/libpq/unix/fix-configure.patch

80 lines
4.3 KiB
Diff
Raw Normal View History

diff --git a/configure.ac b/configure.ac
2023-10-11 06:00:28 +08:00
index 7f97248..48ff1a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,8 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros
[libpq] Update to 16.2 (#36849) Fixes #36168. * Update `libpq` to 16.2. * Removed outdated patch `python_lib.patch`. * Feature `client` has an error on `x86-windows`: https://github.com/microsoft/vcpkg/issues/36693, but it is not caused by this update and will be solved in another PR. - [x] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [x] SHA512s are updated for each updated download. - [ ] ~The "supports" clause reflects platforms that may be fixed by this new version.~ - [ ] ~Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file.~ - [x] Any patches that are no longer applied are deleted from the port's directory. - [x] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [x] Only one version is added to each modified port's versions file. Features `client,icu,lz4,nls,openssl,python,tcl,xml,xslt,zlib,zstd` are tested successfully in the following triplet: ``` x64-windows x64-windows-static ``` Features `icu,lz4,nls,openssl,xml,xslt,zlib,zstd` are tested successfully in the following triplet: ``` x86-windows ``` Features `readline,bonjour` are tested successfully in the following triplet: ``` x64-osx ``` Feature `readline` are tested successfully in the following triplet: ``` x64-linux ``` The usage test passed on `x64-windows` (header files found): ``` The package libpq provides CMake integration: find_package(PostgreSQL REQUIRED) target_link_libraries(main PRIVATE PostgreSQL::PostgreSQL) ``` --------- Co-authored-by: Monica <v-liumonica@microsoft.com>
2024-02-22 13:54:14 +08:00
AC_INIT([PostgreSQL], [16.2], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/])
-m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required.
+cross_compiling=yes # Avoid conftest loading shared objects
+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
fi
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.])
fi
if test "$with_zlib" = yes; then
- AC_CHECK_LIB(z, inflate, [],
+ PKG_CHECK_MODULES([ZLIB], [zlib], [LIBS="$ZLIB_LIBS $LIBS"],
[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
# 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
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
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])])
fi
+ 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
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])])
+ 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"
fi
if test "$with_libxslt" = yes ; then
- AC_CHECK_LIB(xslt, xsltCleanupGlobals, [], [AC_MSG_ERROR([library 'xslt' is required for XSLT support])])
+ 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"
fi
if test "$with_lz4" = yes ; then
- AC_CHECK_LIB(lz4, LZ4_compress_default, [], [AC_MSG_ERROR([library 'lz4' is required for LZ4 support])])
+ 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"
fi
if test "$with_zstd" = yes ; then
- AC_CHECK_LIB(zstd, ZSTD_compress, [], [AC_MSG_ERROR([library 'zstd' is required for ZSTD support])])
+ 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"
fi
# Note: We can test for libldap_r only after we know PTHREAD_LIBS;