[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - configure.ac

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Mar 7 17:17:32 UTC 2019


 configure.ac |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 690e525970ad50be119182e5dab965363e8cc76a
Author:     Tomáš Chvátal <tchvatal at suse.com>
AuthorDate: Tue Mar 5 11:33:44 2019 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Mar 7 18:17:02 2019 +0100

    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/68756
    Tested-by: Jenkins
    Reviewed-by: Tomáš Chvátal <tchvatal at suse.cz>
    Tested-by: Tomáš Chvátal <tchvatal at suse.cz>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/configure.ac b/configure.ac
index e109495ff41e..919d13f618da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8669,11 +8669,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


More information about the Libreoffice-commits mailing list