From 16a4c21af7e350c47617a2e18f667aef60e0f116 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Tue, 15 Dec 2020 11:22:21 -0700 Subject: [PATCH] [build] fix libpq configure check to use flags from autoconf/pkg-config --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index 9724e309b8..9ea2d11b87 100644 --- a/configure.ac +++ b/configure.ac @@ -699,7 +699,13 @@ AC_DEFINE_UNQUOTED([POSTGRESQL_MAJOR_VERSION], ${POSTGRESQL_MAJOR_VERSION}, [Spe AC_DEFINE_UNQUOTED([POSTGRESQL_MINOR_VERSION], ${POSTGRESQL_MINOR_VERSION}, [Specifies the version of PostgreSQL we are linking against]) AC_DEFINE_UNQUOTED([POSTGRESQL_PATCH_VERSION], ${POSTGRESQL_PATCH_VERSION}, [Specifies the version of PostgreSQL we are linking against]) have_libpq=no +save_LIBS="${LIBS}" +save_CPPFLAGS="${CPPFLAGS}" +LIBS="${POSTGRESQL_LDFLAGS}" +CPPFLAGS="${POSTGRESQL_CFLAGS}" AC_CHECK_LIB([pq], [PQgetvalue], [have_libpq="yes"]) +LIBS="${save_LIBS}" +CPPFLAGS="${save_CPPFLAGS}" AM_CONDITIONAL([HAVE_PGSQL],[test "${have_libpq}" = "yes"]) AC_SUBST([POSTGRESQL_CFLAGS], [$POSTGRESQL_CFLAGS]) AC_SUBST([POSTGRESQL_LDFLAGS], [$POSTGRESQL_LDFLAGS])