summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-10-20 12:55:41 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-10-26 13:58:41 +0200
commitd8c751008a0997ab9a171675b27b238ba503986a (patch)
tree641c13a74b74b1adc37ddc3888f11bd1eed4208e /configure.ac
parentffb9dcce397f5b13b675b5849457bb98ca9c8e8e (diff)
Enable gtktiledviewer on Windows
A new configure argument is introduced: --with-gtk3-build=<absolute path to GTK3 build> When provided, libreofficekit_selectionhandles package, libreofficekitgtk library and gtktiledviewer executable would be built on Windows using the GTK3 libraries in the passed directory, that must contain lib/pkgconfig subdirectory with correct pkg-config data. Change-Id: I6504af6eec0fc73cceb26a1ce923337abe14b5c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141624 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac56
1 files changed, 44 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 842721cc4427..df1d03a14488 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,19 +46,31 @@ FilterLibs()
# Return value: $filteredlibs
filteredlibs=
- for f in $1; do
- case "$f" in
- # let's start with Fedora's paths for now
- -L/lib|-L/lib/|-L/lib64|-L/lib64/|-L/usr/lib|-L/usr/lib/|-L/usr/lib64|-L/usr/lib64/)
- # ignore it: on UNIXoids it is searched by default anyway
- # but if it's given explicitly then it may override other paths
- # (on macOS it would be an error to use it instead of SDK)
- ;;
- *)
+ if test "$COM" = "MSC"; then
+ for f in $1; do
+ if test "x$f" != "x${f#-L}"; then
+ filteredlibs="$filteredlibs -LIBPATH:${f:2}"
+ elif test "x$f" != "x${f#-l}"; then
+ filteredlibs="$filteredlibs ${f:2}.lib"
+ else
filteredlibs="$filteredlibs $f"
- ;;
- esac
- done
+ fi
+ done
+ else
+ for f in $1; do
+ case "$f" in
+ # let's start with Fedora's paths for now
+ -L/lib|-L/lib/|-L/lib64|-L/lib64/|-L/usr/lib|-L/usr/lib/|-L/usr/lib64|-L/usr/lib64/)
+ # ignore it: on UNIXoids it is searched by default anyway
+ # but if it's given explicitly then it may override other paths
+ # (on macOS it would be an error to use it instead of SDK)
+ ;;
+ *)
+ filteredlibs="$filteredlibs $f"
+ ;;
+ esac
+ done
+ fi
}
PathFormat()
@@ -2681,6 +2693,11 @@ libo_FUZZ_ARG_WITH(latest-c++,
published standard.]),,
[with_latest_c__=no])
+AC_ARG_WITH(gtk3-build,
+ AS_HELP_STRING([--with-gtk3-build=<absolute path to GTK3 build>],
+ [(Windows-only) In order to build GtkTiledViewer on Windows, pass the path
+ to a GTK3 build, like '--with-gtk3-build=C:/gtk-build/gtk/x64/release'.]))
+
dnl ===================================================================
dnl Branding
dnl ===================================================================
@@ -11748,6 +11765,7 @@ dnl ===================================================================
GTK3_CFLAGS=""
GTK3_LIBS=""
+ENABLE_GTKTILEDVIEWER=""
if test "$test_gtk3" = yes -a "x$enable_gtk3" = "xyes" -o "x$enable_gtk3_kde5" = "xyes"; then
if test "$with_system_cairo" = no; then
add_warning 'Non-system cairo combined with gtk3 is assumed to cause trouble; proceed at your own risk.'
@@ -11765,9 +11783,23 @@ if test "$test_gtk3" = yes -a "x$enable_gtk3" = "xyes" -o "x$enable_gtk3_kde5" =
AC_CHECK_HEADER(EGL/eglplatform.h, [],
[AC_MSG_ERROR(EGL headers not found. install mesa-libEGL-devel)], [])
fi
+elif test -n "$with_gtk3_build" -a "$OS" = "WNT"; then
+ PathFormat "${with_gtk3_build}/lib/pkgconfig"
+ if test "$build_os" = "cygwin"; then
+ dnl cygwin's pkg-config does not recognize "C:/..."-style paths, only "/cygdrive/c/..."
+ formatted_path_unix=`cygpath -au "$formatted_path_unix"`
+ fi
+
+ PKG_CONFIG_PATH="$formatted_path_unix"; export PKG_CONFIG_PATH
+ PKG_CHECK_MODULES(GTK3, cairo gdk-3.0 gio-2.0 glib-2.0 gobject-2.0 gtk+-3.0)
+ GTK3_CFLAGS="$GTK3_CFLAGS -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
+ FilterLibs "${GTK3_LIBS}"
+ GTK3_LIBS="${filteredlibs}"
+ ENABLE_GTKTILEDVIEWER="yes"
fi
AC_SUBST(GTK3_LIBS)
AC_SUBST(GTK3_CFLAGS)
+AC_SUBST(ENABLE_GTKTILEDVIEWER)
GTK4_CFLAGS=""
GTK4_LIBS=""