Merge pull request #988 from signalwire/osx-libpq-configure

[build] fix libpq configure check to use flags from autoconf/pkg-config
This commit is contained in:
Andrey Volk 2020-12-16 21:28:03 +04:00 committed by GitHub
commit 4d070c43e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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_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])