configure.ac |   46 ++++++++++++++++++++++++++++++++--------------
 1 file changed, 32 insertions(+), 14 deletions(-)

New commits:
commit e3beaed3420b5f6deda1c443da1435d4ccfee022
Author:     Thorsten Behrens <thorsten.behr...@cib.de>
AuthorDate: Sun May 31 04:03:05 2020 +0200
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Sun May 31 21:14:04 2020 +0200

    configure.ac: make --enable-gtk3-kde5 work standalone
    
    Previously always required the gtk3 backend enabled, too.
    
    Change-Id: I9fc216686574aa00833335ad1aa8cf93b316e277
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95216
    Tested-by: Thorsten Behrens <thorsten.behr...@cib.de>
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/configure.ac b/configure.ac
index 929b06ed8af7..87603c19c941 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10685,18 +10685,8 @@ if test "x$enable_gtk3" = "xyes"; then
                         [AC_MSG_ERROR(EGL headers not found. install 
mesa-libEGL-devel)], [])
     fi
 fi
-AC_SUBST(GTK3_LIBS)
-AC_SUBST(GTK3_CFLAGS)
 AC_SUBST(ENABLE_GTK3)
 
-if test "$enable_introspection" = yes; then
-    if test "$ENABLE_GTK3" = TRUE; then
-        GOBJECT_INTROSPECTION_REQUIRE(INTROSPECTION_REQUIRED_VERSION)
-    else
-        AC_MSG_ERROR([--enable-introspection requires --enable-gtk3])
-    fi
-fi
-
 ENABLE_QT5=""
 if test "x$enable_qt5" = "xyes"; then
     ENABLE_QT5="TRUE"
@@ -10715,11 +10705,39 @@ AC_SUBST(ENABLE_KF5)
 
 ENABLE_GTK3_KDE5=""
 if test "x$enable_gtk3_kde5" = "xyes"; then
-    ENABLE_GTK3_KDE5="TRUE"
-    AC_DEFINE(ENABLE_GTK3_KDE5)
-    R="$R gtk3_kde5"
+    if test "$with_system_cairo" = no; then
+        AC_MSG_ERROR([System cairo required for gtk3 support, do not combine 
--enable-gtk3 with --without-system-cairo])
+    fi
+    : ${with_system_cairo:=yes}
+    PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.18 gtk+-unix-print-3.0 
gmodule-no-export-2.0 glib-2.0 >= 2.38 cairo, ENABLE_GTK3_KDE5="TRUE", 
ENABLE_GTK3_KDE5="")
+    if test "x$ENABLE_GTK3_KDE5" = "xTRUE"; then
+        AC_DEFINE(ENABLE_GTK3_KDE5)
+        R="$R gtk3_kde5"
+    else
+        AC_MSG_ERROR([gtk3_kde5 or dependent libraries of the correct 
versions, not found])
+    fi
+    GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
+    FilterLibs "${GTK3_LIBS}"
+    GTK3_LIBS="${filteredlibs}"
+
+    dnl We require egl only for the gtk3 plugin. Otherwise we use glx.
+    if test "$with_system_epoxy" != "yes"; then
+        AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL 
required.]))
+        AC_CHECK_HEADER(EGL/eglplatform.h, [],
+                        [AC_MSG_ERROR(EGL headers not found. install 
mesa-libEGL-devel)], [])
+    fi
 fi
 AC_SUBST(ENABLE_GTK3_KDE5)
+AC_SUBST(GTK3_LIBS)
+AC_SUBST(GTK3_CFLAGS)
+
+if test "$enable_introspection" = yes; then
+    if test "$ENABLE_GTK3" = "TRUE" -o "$ENABLE_GTK3_KDE5" = "TRUE"; then
+        GOBJECT_INTROSPECTION_REQUIRE(INTROSPECTION_REQUIRED_VERSION)
+    else
+        AC_MSG_ERROR([--enable-introspection requires --enable-gtk3])
+    fi
+fi
 
 if test "$_os" = "WINNT"; then
     R="$R win"
@@ -10852,7 +10870,7 @@ AC_SUBST(SYSTEM_BLUEZ)
 dnl ===================================================================
 dnl Check whether to enable GIO support
 dnl ===================================================================
-if test "$ENABLE_GTK3" = "TRUE"; then
+if test "$ENABLE_GTK3" = "TRUE" -o "$ENABLE_GTK3_KDE5" = "TRUE"; then
     AC_MSG_CHECKING([whether to enable GIO support])
     if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; 
then
         dnl Need at least 2.26 for the dbus support.
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to