summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2022-09-20 16:07:14 +0300
committerTor Lillqvist <tml@collabora.com>2022-10-12 14:21:18 +0200
commit2def5485aa57d7c407a84ecc73b22083579e9a98 (patch)
tree42378dc2093ad2fc82001a5b72e9a5e69411ca0c /configure.ac
parenttdf#151261 DOCX import: fix dropdown SDT when the item display text is missing (diff)
downloadcore-2def5485aa57d7c407a84ecc73b22083579e9a98.tar.gz
core-2def5485aa57d7c407a84ecc73b22083579e9a98.zip
Enable opening of downloaded fonts only in ForKit in Online
(This is the second attempt at this, I had to revert the first one as it broke desktop Collabora Office.) We want that only the ForKit process needs to have access to new font files added to a Collabora Online instance dynamically by downloading from a server. There are however many locations in the Kit process, in core and in external libraries like harfbuzz, where the code wants to open a font file. Handle this so that the ForKit process opens such a downloaded font file and doesn't close it. The file descriptor is thus inherited by Kit processes. The font file pathname passed on to other code is a fake on in the format "/:FD:/%d" where the %d is the file descriptor of the opened font file. Add checks in all places where font files are opened, look for this special pathname format, and modify the code to just dup() the already open file descriptor in that case. All this is relevant for Linux only, as Collabora Online runs on Linux. Do the above for harfbuzz, cairo, fontconfig, and freetype. In addition make sure that these libraries (except harfbuzz which needs to be a static library) when bundled, on Linux, are built as shared libraries, and won't be confused with the corresponding system libraries by making sure their sonames are different. Change-Id: Ib059cb27e1637d07bb709249abd0d984f948caa9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140714 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac53
1 files changed, 49 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 65126c1caee5..5d650956063d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4478,6 +4478,18 @@ if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
else
with_system_graphite=no
+ if test -z "$with_system_harfbuzz"; then
+ with_system_harfbuzz=no
+ fi
+ if test -z "$with_system_cairo"; then
+ with_system_cairo=no
+ fi
+ if test -z "$with_system_fontconfig"; then
+ with_system_fontconfig=no
+ fi
+ if test -z "$with_system_freetype"; then
+ with_system_freetype=no
+ fi
fi
if test "$with_system_orcus" = "yes"; then
AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
@@ -10775,13 +10787,27 @@ AC_SUBST(SYSTEM_LIBORCUS)
dnl ===================================================================
dnl HarfBuzz
dnl ===================================================================
-libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3],
+case "$_os" in
+ Linux)
+ libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3],
+ ["-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"],
+ ["-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite"],
+ TRUE)
+ libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.42],
+ ["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],
+ ["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"],
+ TRUE)
+ ;;
+ *)
+ libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3],
["-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"],
["-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite"])
+ libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.42],
+ ["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],
+ ["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"])
+ ;;
+esac
-libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.42],
- ["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],
- ["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"])
if test "$COM" = "MSC"; then # override the above
GRAPHITE_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/graphite.lib"
@@ -13515,6 +13541,25 @@ AC_SUBST(CAIRO_LIBS)
AC_SUBST(ENABLE_CAIRO_CANVAS)
AC_SUBST(SYSTEM_CAIRO)
+if test -z "$with_system_cairo"; then
+ with_system_cairo=yes
+fi
+
+case "$_os" in
+ Linux)
+ AC_MSG_CHECKING([for compatibility of system/bundled font-related libraries])
+ if test "$with_system_harfbuzz" != "$with_system_fontconfig" ||
+ test "$with_system_fontconfig" != "$with_system_freetype" ||
+ test "$with_system_freetype" != "$with_system_cairo" ||
+ test "$with_system_cairo" != "$with_system_graphite"; then
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([cairo, fontconfig, freetype, graphite, and harfbuzz must all be either used from the system or bundled])
+ else
+ AC_MSG_RESULT([yes])
+ fi
+ ;;
+esac
+
dnl ===================================================================
dnl Test whether to use avahi
dnl ===================================================================