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])