[build] fix libpq configure check to use flags from autoconf/pkg-config

This commit is contained in:
Mike Jerris 2020-12-15 11:22:21 -07:00
parent 8045c96458
commit 16a4c21af7
1 changed files with 6 additions and 0 deletions

View File

@ -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_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]) AC_DEFINE_UNQUOTED([POSTGRESQL_PATCH_VERSION], ${POSTGRESQL_PATCH_VERSION}, [Specifies the version of PostgreSQL we are linking against])
have_libpq=no have_libpq=no
save_LIBS="${LIBS}"
save_CPPFLAGS="${CPPFLAGS}"
LIBS="${POSTGRESQL_LDFLAGS}"
CPPFLAGS="${POSTGRESQL_CFLAGS}"
AC_CHECK_LIB([pq], [PQgetvalue], [have_libpq="yes"]) AC_CHECK_LIB([pq], [PQgetvalue], [have_libpq="yes"])
LIBS="${save_LIBS}"
CPPFLAGS="${save_CPPFLAGS}"
AM_CONDITIONAL([HAVE_PGSQL],[test "${have_libpq}" = "yes"]) AM_CONDITIONAL([HAVE_PGSQL],[test "${have_libpq}" = "yes"])
AC_SUBST([POSTGRESQL_CFLAGS], [$POSTGRESQL_CFLAGS]) AC_SUBST([POSTGRESQL_CFLAGS], [$POSTGRESQL_CFLAGS])
AC_SUBST([POSTGRESQL_LDFLAGS], [$POSTGRESQL_LDFLAGS]) AC_SUBST([POSTGRESQL_LDFLAGS], [$POSTGRESQL_LDFLAGS])