diff options
author | Tomáš Chvátal <tchvatal@suse.com> | 2019-03-05 11:33:44 +0100 |
---|---|---|
committer | Tomáš Chvátal <tchvatal@suse.cz> | 2019-03-05 15:08:34 +0100 |
commit | 6d471576114ff10e9e27006e7a9a886207971be0 (patch) | |
tree | 63d1bc7873bdad294c87b11b31665adf84bee994 | |
parent | 5a226c977633dc77a0a92b5196c75f3863bf1a3d (diff) |
Use pkgconfig to detect PostgreSQL if there is no pg_config
pg_config is meant for linking server extensions,
clients should use pkg-config instead to build against libpq.
This fixes build with PostgreSQL 11.
Change-Id: Ic0b5fc9cb7169f44c00a1edf7218212c360ec235
Reviewed-on: https://gerrit.libreoffice.org/68734
Tested-by: Jenkins
Reviewed-by: Tomáš Chvátal <tchvatal@suse.cz>
-rw-r--r-- | configure.ac | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index a3855d24546e..c4d789140362 100644 --- a/configure.ac +++ b/configure.ac @@ -8814,11 +8814,17 @@ if test "x$enable_postgresql_sdbc" != "xno"; then done fi AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path) - if test -z "$PGCONFIG"; then - AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH]) + if test -n "$PGCONFIG"; then + POSTGRESQL_INC=-I$(${PGCONFIG} --includedir) + POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)" + else + PKG_CHECK_MODULES(POSTGRESQL, libpq, [ + POSTGRESQL_INC=$POSTGRESQL_CFLAGS + POSTGRESQL_LIB=$POSTGRESQL_LIBS + ],[ + AC_MSG_ERROR([pg_config or 'pkg-config libpq' needed; set PGCONFIG if not in PATH]) + ]) fi - POSTGRESQL_INC=-I$(${PGCONFIG} --includedir) - POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)" FilterLibs "${POSTGRESQL_LIB}" POSTGRESQL_LIB="${filteredlibs}" else |