From a91f20addcfaabeb168f1dd2aeec730aefc44873 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Sun, 31 May 2020 04:03:05 +0200 Subject: 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 Reviewed-by: Thorsten Behrens (cherry picked from commit 5e1eaaeb04e6194a3587eefcfd8e63652cc3a46d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95234 --- configure.ac | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 614e40eb9497..10da45dafaa9 100644 --- a/configure.ac +++ b/configure.ac @@ -10521,18 +10521,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" @@ -10551,11 +10541,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" @@ -10685,7 +10703,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. -- cgit